Foreword :

Speaking nonsense, there are a lot of articles about uCOS-ii transplantation on the Internet. Many of them are monotonous and theoretical. They analyze a lot of imaginary things. I really want to ask them. You are sure that these things are analyzed. Need your work? There is a serious lack of practicality. . . In this respect, I have also taken a lot of detours. I will record my own transplant process step by step, and I will also give you a reference.

First, briefly summarize the general process of porting:

(1) Go to uC/OS-ii official website to download the relevant case of the CPU you want to transplant, not necessarily exactly, then find the corresponding series.

(2) There are two programming environments, IAR and MDK, which are downloaded according to your own programming environment.

(3) This case needs to port uC/OS-II to STM32F103ZET6, and the programming environment I use is MDK. Unfortunately, the case provided on the official website is based on IAR, so I need to change based on the IAR case.

(4) Use MDK to create a simple program without operating system to ensure that this program can be used. The purpose of this is to check the error step by step. If there is no operating system, there will be errors, and there will definitely be a migration process. Compilation errors, then increase the difficulty when troubleshooting errors, how to do not write a simple program of the operating system. . . Then don't look down.

(5) There are two main changes to the migration. One is the addition and subtraction of some header files, and the other is the modification of PendSV_Handler and SysTIck_Handler in the vector table. Here I have to vomit, I said a lot of changes on OS_CPU.H and various functions on the Internet, which are all nonsense. . . These don't need to be modified by the transplanter at all. The cases provided by the official website have already been provided. Unless you choose to transplant the CPU is relatively biased, then these things need to be written by the transplanter himself.

Ok, let's start with a detailed record of how to migrate.

First, create a simple bare board system without operating system

1. Create a source file project folder as shown below:

The most practical: the detailed steps of transplanting uCOS-II to STM32

The folder "CMSIS" is the interface of the kernel, and the files contained are as follows.

The most practical: the detailed steps of transplanting uCOS-II to STM32

The folder STM32_StdPeriph is the firmware driver folder, which adds all the firmware of the STM32.

The folder User is another file, as shown below:

The most practical: the detailed steps of transplanting uCOS-II to STM32

The folder Output and List are mainly used to put the messy files generated by the compilation, in order to make the project code more concise.

2. Use MDK to create an OS-free project. This is not to say one by one. The screenshot of the created project file tree is as follows:

The most practical: the detailed steps of transplanting uCOS-II to STM32

There is no main file at this time, then create a mian.c document. Note here that after creating main.c, you need to add it to the project instead of simply saving it. As shown below:,

The most practical: the detailed steps of transplanting uCOS-II to STM32

Note: There must be a mian function in main.c, otherwise the compiler will prompt you for an error. Then there is the configuration of the project, this is still very important, the following points need to be configured:

(1) The Output options are as follows:

The most practical: the detailed steps of transplanting uCOS-II to STM32

The Create HEX File option is checked and the project output is placed in the Output folder created earlier.

(2) List option, put the file generated by the List into the previously created List folder.

(3) The C/C++ configuration options are as follows:

The most practical: the detailed steps of transplanting uCOS-II to STM32

Among the Define options, fill in: USE_STDPERIPH_DRIVER, STM32F10X_HD, which tells the compiler to use standard peripherals, as well as the CPU type of choice, where the CPU type needs to be changed according to the CPU you choose to port. Include Paths is the path to the header file to be included. For insurance purposes, it is sufficient to include all the files with .h files in the project.

4.Debug options are as follows:

Card Slot Phone Case

The card slot back Cover with the protect function , and you could put the card slots ,it more convient you life .It could fit all phone size , Like S, M and L size (4.7-5.5).We sell Pu/genunine Leather phone case,card slot Phone Case,folio phone case, Card Slot Back Cover,Leather Mobile Phone Cover,Universal Leather Case.

6

We employ the most creative designers and tech brilliant engineers to make the best cases. We believe our high-quality products with competitive prices will satisfy your needs.

The productive process :

Make the Products Mould –Cutting the fabric –Do the half products – Finish products – Cleaning –QC- Package – Shippment .

Slot Phone Case,Phone Case Cover,Card Slot Back Cover,Card Slot With Phone Case

Ysure Leather case 24/7 Support : 86 13430343455 , https://www.ysurecase.com