STM32F429IIT6 Based RT-Thread porting


1. Obtain STM32F4 firmware library and RT-Thread source code

STM32F4 firmware library (v1.6.1):
http://www.st.com/web/zh/catalog/tools/PF257901

RT-Thread source code (download on Github, v2.1.0):
https://github.com/RT-Thread/rt-thread

2.Create MDK project template

It is recommended to use the ported template so that you don’t have to worry about CPU stack interrupts and other processing code (stm32f40x is used in this example).

At the same time, it is recommended to keep the consistency of the catalog as much as possible when using the official authoritative source code.

For example, this port uses the same structure of the RT-Thread source code directory:
The required documentation can be based on the RT-Thread documentation.


Attention:
The HardFault_Handler, PendSV_Handler, and SysTick_Handler interrupt functions are transferred from the stm32f4xx_it.c file.The following functions are not declared (temporarily commented out): rt_application_init, stm32_hw_usart_init and stm32_hw_pin_init.The main function has been implemented in startups.c, do not redefine.

3. Modify the source code

STM32F4 CLOCK SYSTEM


The right side is modified, note that the file needs to be changed SystemCoreClock = 168000000;

4. Continue to modify the code

Go to the stm32_hw_usart_init function commented in the previous step

Add the rtdevice.h header file (in \components\drivers\include)

Add serial.c, completion.c and dataqueue.c files

At the same time need to modify the USART interface of the hardware

At this point, when the RT-Thread system is started, the system version information will be output from the serial port, which means that the migration is successful.

Purchase STM32F429IIT6: Kynix Semiconductor
Dob 10 march 2021, 8:31
Vote for this post
Bring it to the Main Page
 

Comments

Leave a Reply

B
I
U
S
Help
Avaible tags
  • <b>...</b>highlighting important text on the page in bold
  • <i>..</i>highlighting important text on the page in italic
  • <u>...</u>allocated with tag <u> text shownas underlined
  • <s>...</s>allocated with tag <s> text shown as strikethrough
  • <sup>...</sup>, <sub>...</sub>text in the tag <sup> appears as a superscript, <sub> - subscript
  • <blockquote>...</blockquote>For  highlight citation, use the tag <blockquote>
  • <code lang="lang">...</code>highlighting the program code (supported by bash, cpp, cs, css, xml, html, java, javascript, lisp, lua, php, perl, python, ruby, sql, scala, text)
  • <a href="http://...">...</a>link, specify the desired Internet address in the href attribute
  • <img src="http://..." alt="text" />specify the full path of image in the src attribute