UCOS V2.51 installation and commissioning guide

xiaoxiao2021-03-06  18

UC / OS is a small and practical real-time operating system. Due to its openness of its code, in recent years, many people have been concerned about this operating system, but because of less documentation Especially for the installation and use guidance articles are not sufficient enough, making many beginners, especially those who have just arrived in embedded operating systems, do not know how to install and debug the system, for this purpose, I combined with my own useful experience Talk about its installation and debugging issues, I hope to have a certain help to everyone.

The development tools and development packages in the text are as follows:

Development Kit: UC / OS2.51 Click here to download text Development Tools: Borland C 3.1 Click here to download

Among them, the development tool is only used by this item, only applicable to this project development.

1 installation

1.1 Download Software Software.rar (file size 848KB) 1.2 Unzipped, it is recommended to extract to the root directory of the C: / Software, which will be installed in C: / Software, need space 2.4 is 1.4 with default installation path as an example, directory The structure is:

C: / Software This is the root directory, all software-related files are placed in this directory.

C: / Software / Blocks Subprogram Module Directory. The author compiled in this directory after compiling the PC-related function modules associated with the PC in the example. C: / Software / HPLISTC is stored in this directory that is related to the example HPLIST (see appendix D, HPLISTC, and TO). Hplist.c stores in a C: / Software / Hplistc / source directory. The executable under the DOS is stored in C: / Software / TO / EXE. C: / Software / to This directory is stored with example to-related files (see Appendix D, HPLISTC and TO). Source file to.c Store in C: / Software / To / Source, the executable of DOS is stored in C: / Software / TO / EXE. Note that To need an To.TBL file, it must be placed under the root directory. Users can find the to.tbl file in the C: / Software / To / Exe directory. If you want to run to.exe, you must copy to.tbl to the root directory. C: / Software / UCOS-II is placed in this directory with μC / OS-II.

C: / Software / UCOS-II / EX1_X86L includes the source code of Example 1 (see 1.07, Example 1), which can be run in DOS (or DOS window under Windows 95). C: / Software / UCOS-II / EX2_X86L This directory includes the source code of Example 2 (see 1.08, Example 2), which can be run under DOS (or DOS window under Windows 95). C: / Software / UCOS-II / EX3_X86L This directory includes the source code of Example 3 (see 1.09, Example 3), which can be run in DOS (or DOS window under Windows 95). C: / Software / UCOS-II / IX86L This directory includes code dependent on the processor type. At this time, some code, real mode, which must be run on the 80x86 processor, compiled in large mode. C: / Software / UCOS-II / source includes source codeless source code that is independent of the processor type. These code can be fully portable to other architectures.

2 Development Tools Borland C 3.1 installation

2.1 Download Borland C 3.1 (file size 1.65MB) 2.2 Decompressing, it is recommended to decompress the root directory of the C: / BC31, so that all files will be installed in C: / BC31, we strongly recommend this path to install, so you will be able to do it directly Compilation and commissioning of the project without changing their configuration, requiring space 5.10MB 2.3 If you must install it to another directory, modify the corresponding configuration file, pay attention to the blue part: 2.3.1 Open /Bin/turboc.cfg, displayed as follows: -IC: / bc31 / include-lc: / bc31 / lib will be installed by the C: / BC31, such as the installation directory is E: / borlandc31, should be reformable - IE: / borlandc31 / include-le: / borlandc31 / lib 2.3.2 Open /BIN/TLINK.CFG, display the following: -lc: / bc31 / lib will be installed by the c: / bc31, for example The installation directory is E: / borlandc31, then the -Le: / borlandc31 / lib 2.4 is changed to this. 2.5 is used as the default installation path as an example, the directory structure is:

C: / bc31 This is the root directory, all tool-related files are placed in this directory.

C: / BC31 / BIN development tools are placed in this directory C: / bc31 / lib full link library files stored in this directory C: / bc31 / include all header files are stored in this directory

It is also necessary to explain that this Borland C has been reducing it, the purpose is to reduce the required space (19.6MB of the original version), if you use the original software, you can install, no need to perform 2.3 steps. Configuration work, if you need this original software, please contact me to write a message.

3 project development

4 examples with the development package have certain representations. Here we will introduce the whole process of project development in connection with Example 1, which requires that the installation path is the default.

3.1 Enter the C: / Software / UCOS-II / EX1_X86L / BC45 directory, you will see two directories, their functions are as follows:

C: / Software / UCOS-II / EX1_X86L / BC45 / SOURCE Source File Directory

C: /software/ucos-ii/ex1_x86l/bc45/source/includes.h total project header file, each source file should contain c: /software/ucos-ii/ex1_x86l/bc45/source/os_cfg.h configuration File, used for operating system configuration and clipping C: /software/ucos-ii/ex1_x86l/bc45/source/test.c application file, you can refer to this file when developing new projects C: / Software / UCOS-II /EX1_X86L/BC45/Source/test.lnk link file, contains links to libraries and link parameters C: / Software / UCOS-II / EX1_X86L / BC45 / TEST project file directory

C: /software/ucos-ii/ex1_x86l/bc45/test/test.mak project Make file, people who are familiar with the C compiler must know that through the make file can be smart to automatically compile links to the entire project, it is very convenient, We will introduce this file in detail later.

C: /software/ucos-ii/ex1_x86l/bc45/test/test.map project image file mainly completes mapping of library file addresses, is the product of the item C: / Software / UCOS-II / EX1_X86L / BC45 / TEST / MAKETEST. BAT project Make action batch file, which will automatically complete the entire process of compiled links C: /software/ucos-ii/ex1_x86l/bc45/test/test.exe project generated executable file, so that the item's product is officially Start the development of the project 3.2 First step, press the above directory structure, establish a project directory, established a directory C: / Software / UCOS-II / EX1_X86L / BC45 /, and newly built two subdirectories TEST and Source, and copy the relevant files into these two directories, pay attention to this path and directory structure, otherwise the path information in the file may be required, which is very troublesome. The fastest way to recommend is to copy an example of the directory. If your new project name is newProject, you can create a new directory in C: / Software / UCOS-II C: / Software / UCOS-II / NewProject, will The two subdirectories in C: / Software / UCOS-II / EX1_X86L are copied directly to the newly built directory, and finally you only need to change some of the configurations of the inside file, and you can rewrite the code of the new project in Test.c. 3.3 Step 2, change the incrudes.h file, the content of the file is: #include #include #include #include #include #include #include

#include "/software/ucos-i/ix86l/bc45/OS_CPU.H"#include" OS_CFG.H "#include" /software/ucos-i/source/ucos_ii.h"#include "/ Software / Blocks / PC /BC45/PC.H "

If your package installation path and project establishment path are set by recommendation, do not need to change this file, but you can add some headers you want to add in the project, such as some drivers or application modules Header file, but must pay attention to whether the path is correct. If you build a project in accordance with the standard path, you must change the code of the blue color part by line, so that the path is correct.

3.4 Step 3, configure the OS_CFG.H file, because this is not related to the installation of the package and development tool, only for the configuration of the operating system in the project, for details, according to your project, there are many introductions, you can Refer to the e-book of UC / OS-II. 3.5 Fourth step, modify the Test.Lnk configuration, where some parameters and link modules are set when the development tool link is performed, and the editor can be opened by the editor:

/ v / s / c / p- c: /bc31/lib/c0l.obj .. / obj / test.obj .. / Obj / OS_CPU_A.Obj .. / OBJ / OS_CPU_C.Obj .. /Obj/pc.obj .. / obj / ucos_ii.obj ../ Obj / test, .. / OBJ / TESTC: /BC31/LIB/emu.lib c: /bc31/lib/mathl.lib C : /BC31/LIB/cl.lib

3.5.1 / v / s / c / p- is the parameters of the link, it is recommended not to change; 3.5.2 c: /bc31/lib/c0l.obj is Turbo C's Large mode compile library module, if the development tool path is not default Set, change to the actual installation path, such as change C: / BC31 to E: / borlandc31

3.5.3 ../obj/test.obj is the target file of the application, which is generated by Test.c and saves the c: / software / ucos-II / EX1_X86L / BC45 / OBJ directory that is temporarily generated. In this directory uses the target file generated when compiling.

3.5.4 ../obj/OS_CPU_A.Obj ../obj/OS_CPU_C.Obj ../obj/pc.obj ../obj/ucos_ii.obj is the same, it is the target file generated during compile, and saves in OBJ In the directory, the constituent module of the project link is missing if the above file is missing in the OBJ directory, and the link will not succeed.

3.5.5 ../Obj/test ,../obj/test is the specified project generated EXE file and the path and name of the MAP file, which are Test.exe and Test.map, saved in the OBJ directory.

3.5.6 c: /bc31/lib/emu.lib c: /bc31/lib/mathl.lib C: /bc31/lib/cl.lib is the library file required when the link is required, which must make the path compliant with the installation path of Borland C. If installed in a non-recommended directory, you must change the blue path portion. Where EMU is 8087 simulation library, MATHL is a math library, and CL is the runtime library in TurboC in Large mode.

3.6 Step 5, modify the Test.mak file, this is the Make file of Borland C. For the format and writing methods of the make file, please refer to the relevant books, here only introduce some configuration related content, open the file to see: ### ######################################################################################################################################################################################################################################################################################################## ########################################################################################################################################################################################################################################## ######################################################################################################################################################################################################################################################################################################## ### Borland = C: / BC31CC = $ (Borland) / bin / bccasm = $ (borland) / bin / tasmlink = $ (borland) / bin / TLINKTOUCH = $ (borland) / bin / touch ##### ######################################################################################################################################################################################################################################################################################################## ############################################################################################################################################################################################################################################################################ ######################################################################################################################################################################################################################################################################################################## #Target = .. / TestSource = .. / Sourcework = .. / Workobj = .. / Objlst = .. / Lstos = / Software / UCOS-II / SourcePC = / Software / Blocks / PC / BC45port = / Software / UCOS -Ii / ix86l / bc45 If you have Borland C not installed in the recommended installation directory, you need to change Borland = C: / BC31, for example, if you are installed in E: / BorlandC31, change Borland = C: / bc31 to Borland = E: / borlandc31. CC = $ (Borland) / bin / bcc: This is the name and path of the compiler, generally does not change ASM = $ (Borland) / bin / TASM: This is the name and path of the assembler, generally does not change link = $ ( Borland / bin / tlink: This is the name and path of the linker, generally does not change target = .. / test: project file directory, if the path is not recommended by recommendation, you must change the path Source = .. / source: Source file Directory, if the path is not in the recommended mode, you must change the path work = .. / work: project work directory, Maketest.bat automatically compiles all source files to this directory, this setting must be necessary to set up Maketest.bat Coin-phase consistent OBJ = .. / OBJ: Target code directory, this setting must be consistent with MakeTest.bat, which is consistent LST = .. / LST: list file directory, this setting must be set to Maketest.bat Consistent OS = / Software / UCOS-II / Source: Operating system source file directory, must ensure the correct path, if your development package is not installed in recommendation, you must change this setting to the actual installation. PC = / Software / Blocks / PC / BC45: The source file directory related to the PC must ensure the correct path, if your development package is not installed in the recommended mode, you must change this setting to the actual installation.

Port = / Software / UCOS-II / IX86L / BC45: The relevant source file directory of the processor must ensure that the path is correct. If your development package is not installed in recommendation, you must change this setting to the actual installation. There is also a floating point processor file directory IX86L-FP in the development package. These two directories are closely related to transplants, equivalent to BSP (chalan development package). 3.7 Step 6, configure MakeTest.bat, open you can see Md ../workmd ../objmd ../ltcd ../workcopy ../test/test.mak test.makc: / bc31 / bin / make -f Test.makcd ../test is first to create ../work ../obj ../lst three directory, this directory name and path must be consistent with Test.mak, then enter the ../work directory, and will. The Test.mak in the ./test directory copies here, finally executing the Make program of Borland C, automatically compile and link, which is also a path problem with C: / BC31. 3.9 Step 8, the development of related applications can be found, specific can see Test.c file, if your project includes multiple source files, it is best to use the #include statement in Test.c. Contains, otherwise you will change the Make file Test.mak and several other setup files, if you do this, you can try it yourself, here no longer list. 3.10 Finally, run MakeTest.bat to generate a Test.exe file in a TEST directory. 4 other

Fortunately, many netizens have realized exciting debugging development with Borland C in PC. User HCompute wrote its experience. You can also refer to this article PC environment to compile UC / OS with BC3.1 -Ii source file.

There is also more about the application problem of the operating system itself, everyone can refer to its e-book Chinese version

In addition, this article is very rush. It is basically an uncomfortable. It is inevitable that there are many mistakes, some of which may have some mistakes, where I welcome this article and find problems or mistakes in time. Finger, so as to avoid misleading others, but also welcome friends who have sent them to actively write, put forward your opinions and opinions, let us work together to find the best way to develop UC / OS development.

转载请注明原文地址:https://www.9cbs.com/read-41477.html

New Post(0)