Familiar with the software and hardware environment of RT-thread [RT-thread study Note 1]

Source: Internet
Author: User

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]

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.