2. Rtx Migration

Source: Internet
Author: User

The following is an example of a xplain STM32 (using the STM32F103ZET6 CPU) Development Board, which is used to migrate RTX to the board. In order to let people who have just come into contact with the system understand the entire porting process, a project will be re-established to add all the source code (including the RTX kernel) to the project, Instead of using the format of the RTX library.

1. Create a new folder (Rtx-stm32) with the following contents:

--Keil contains Keil's engineering documents

--Misc contains connection script file

--Si is Source Insight project file

--SRC contains source code:

---cm3 CPU-related files

---stm32 files for stm32 CPUs

---the RTX operating system kernel

---user application

Create a new project and save the project file to the Keil folder.

2. Add source code to the project

Cmsis two files core_cm3.c, core_cm3.h Copy to cm3 (can be found in other projects).

The STM32 boot code, library source copy to the Stm32 folder.

The RTX source keil\arm\rl\rtx\src\cm copy to the Rtx folder, you can create a new CM folder, indicating that the kernel source code is for cm3.

Copy RTL.H,RTX_LIB.C and RTX_CONF_CM.C files to the RTX folder from Keil\arm\rv31\inc, Keil\arm\rl\rtx\config, respectively. RTL_LIB.C is an operating system underlying related file, RTX_CONF_CM.C is the operating system configuration file.

User creates a new Main.c file that contains the application. Refer to the example under the \keil\arm\rl\rtx\examples folder for details.

The folder structure and the files added in the project are as follows:

Be careful not to add RTX_LIB.C to the project, otherwise the compilation is wrong and the file is included in other files.

3. Project Properties Settings

The Targe page is as follows: Operating system first to none, tick the use microlib option

The C + + page is as follows:

Define macro Use_stdperiph_driver=1, stm32f10x_hd=1, these two macros are related to STM32 source code, which represents 1. To use the peripheral driver provided by the STM32, 2. CPU type.

To tick on No auto includes, if not checked, automatically:

Keil\arm\rv31\inc
Keil\arm\cmsis\include
keil\arm\inc\st\stm32f10x

Add to the search path to the header file, these paths contain headers like some of our project header files, some confusion, so do not automatically add the header file search path, need to add their own.

The paths contained in includes paths are:

D:\Keil\ARM\ARMCC\include, .... \src\rtx, .... \SRC\CM3, .... \src\user, .... \src\cm3\stm32\libraries\inc, .... \src\cm3\stm32\starup

The ASM page is as follows:

Just tick the No Auto includes option on the line.

4. Mask the Svc_handler, Systick_handler function in the stm32f10x_it.c file, which are defined in hal_cm3.c.

After these 4 steps, RTX can run on the Xplain STM32 board.

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.