Getting Started

Getting Started

Overview

This chapter gives you some insight into how to install and use µC/LIB.

At the end of this chapter, you should be able to build and run your first application using µC/LIB.

Downloading the Source Code

The source code is available as open-source on Github: 

https://github.com/weston-embedded

µC/LIB depends on other modules, and you need to install all the required modules before building your application. Depending on the availability of support for your hardware platform, ports and drivers may or may not be available for download. Table - µC/LIB Module Dependency shows the module dependency for µC/LIB .

Table - µC/LIB Module Dependency

Module Name

Required

Note(s)

µC/LIB Core

YES

Micriµm run-time library.

µC/LIB Port

Optional

Available only if Micriµm has support for your processor architecture.

µC/CPU Core

YES

µC/CPU Port

YES

Available only if Micriµm has support for your processor architecture.

 

Installing the Files

Once all the distribution packages have been downloaded to your host machine, extract all the files. The package may be extracted to any location. After extracting all the files, the directory structure should look as illustrated in Figure - Directory Tree for µC/LIB.

Note that from this point onward, the path "C:\Micrium\Software\" is used as the parent directory in examples.

Figure - Directory Tree for µC/LIB
Directory structure

 

Copying and Modifying Template Files

Copy the lib_cfg.h template file to your project as illustrated in Figure - Copying lib_cfg.h template file.

Figure - Copying lib_cfg.h template file
Copying lib_cfg.h template file

 

Including µC/LIB Source Code

First, include the µC/LIB source files to your project as indicated in Figure - µC/LIB Source Code. You can optionally add an architecture specific port to optimize memory copy operations. 

Figure - µC/LIB Source Code

 

Second, add the include path to µC/LIB to your project's C compiler settings. In our example, the correct include path would be:

C:\Micrium\Software\uC-LIB\

Initialization

Finally, once µC/LIB has been integrated to your project, some modules need to be initialized by your embedded application. You must call the function Mem_Init() to initialize the lib_mem module and the function Math_Init() to initialize the lib_math module. This should be done right after the initialization of the kernel and of µC/CPU.