STM32F429IIT6 Based RT-Thread porting
1. Obtain STM32F4 firmware library and RT-Thread source code
STM32F4 firmware library (v1.6.1):
RT-Thread source code (download on Github, v2.1.0):
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.
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
|Vote for this post
Bring it to the Main Page