Software environment: win7 + mdk4.7.2
Hardware environment: stm32f4discovery
OS code used: RT-Thread2.0.0 BETA: https://github.com/RT-Thread/rt-thread/archive/v2.0.0_beta.zip
After decompression, use \ rt-thread-2.0.0_beta \ BSP \ stm32f40x \ project. uvproj for the experiment.
Scons and Python are not used. This is not necessary.
Today, I am only familiar with the software environment:
1,RTGo to mainBefore,
Like a normal MDK-STM32 program. The systeminit function in the system_stm32f4xx.c file is used to initialize the clock.
2,MainThe function is located in startup. C.File. For two jobs
Before the system starts, rt_hw_interrupt_disable will disable all interruptions.
Then start rtthread with rtthread_startup
3, Function rtthread_startup ()Completed tasks:
1. Call the rt_hw_board_init function to initialize the board.
2. display version information: rt_show_version
3. initialization system ticking: rt_system_tick_init
4. system kernel object initialization: rt_system_object_init
5. Timer initialization: rt_system_timer_init
6. System stack initialization rt_system_heap_init
7. Task Scheduler initialization: rt_system_scheduler_init
8. rt_application_init // Add a custom task
9. finsh module initialization,
10. Timer thread initialization: rt_system_timer_thread_init
11. initialize rt_thread_idle_init for idle tasks
12. Start task scheduling. The OS takes over the MCU: rt_system_scheduler_start.
After the task scheduling starts, the OS is started. The subsequent tasks are all run under the OS management.
4In RTTHow to add a peripheral driver in the example project:
Add driver header file to board. h
Familiar with the software and hardware environment of RT-thread [RT-thread study Note 1]