STM32 UCOSII port

1. Preparation

We need UCOSII source code and basic project template.

2. Transplantation steps

Create a new UCOSII folder under the project template, and create CONFIG, CORE, and PORT folders below.

Copy all UCOSII Source except os_cfg_r.h and os_dbg_r.c to CORE

Add two files include.h and os_cfg.h to the CONFIG folder, os_cfg.h is the configuration and tailoring of UCOSII. Copy the punctual atom directly.

Copy the PORT folder of the punctual atom transplantation experiment, and copy all of them.

 Keil opens the demo, adds files, clicks on the small box, creates groups, and adds them separately. Note that ucos_ii.c should not be added to UCOSII-CORE. And click the magic wand to add the corresponding folder.

 

 

 Note that the last picture, added like this is wrong. (Follow-up error reporting).

Compile it after completion,

 

 Here keil shows that ucos_ii.h is marked with a key and cannot be edited. Open it with vscode, then save and overwrite the original file.

Shield the app_cfg.h file and add #include "includes.h".

 error again

After multiple checks, this error is due to an error in adding files, and the wrong steps have been taken above. The correction is as follows:

 

 Recompile and successfully transplant.

Complete project:

qq-hh/qq-hh-My_Project_stm32 (github.com)

Guess you like

Origin blog.csdn.net/weixin_58125062/article/details/126441035