MCUXpresso Usage
Tags: cpp, mcu, embedded, tool
Published: 2021-01-11 11:22:13


Hi everyone,

I would like to give you some information about using **MCUXpresso IDE** that builded from **NXP**. This chapter includes about how to **Import** projects to our workspaces, how to builds them, and how to debug and build your projects in workspaces. I will use **LPC1113 and LPC1768** MCU series in my works.

Firstly, you need to install **MCUXpresso IDE** from their official [websites](https://www.nxp.com/support/developer-resources/run-time-software/mcuxpresso-software-and-tools/mcuxpresso-integrated-development-environment-ide:MCUXpresso-IDE?tab=Design_Tools_Tab).

## **Import Library**

I will explain how to include a library into our workspace in our projects. If you use to **LPC** series you need to install **CMSIS Library** to your workspaces. Easily you can download this libraries from my github page for [LPC11xx]
(https://github.com/coderkan/CMSISv2p00_LPC11xx/tree/master) , [LPC17xx](https://github.com/coderkan/CMSISv1p30_LPC17xx).


After installed these libraries we can open MCUXpresso IDE and go to **Project Explorer** in workspace and right click then you see **Import** section. Below image you can see detail.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1610347179425/JnSM2MEvZ.png)

After clicked **Import** section then you will see under **General** section **Existing Projects into Workspace**.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1610347180893/aegfl4YhX.png)

After **Existing Projects into Workspace** section we can click **Browse** button then demonstrate our library paths.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1610347182466/0IrigL18U.png)

Go to your library project files path and select it.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1610347183970/oL8PSMozs.png)

If you successfully select your library path then you will show imported projects files in **Import** pages. If more than one projects exist in your path you can select which you want. Then click **Finish** button.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1610347185853/Cs1yQBrbh.png)

After added projects to your workspaces then you will see added projects like below images in **Project Explorer**.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1610347187460/5T19TmCKm.png)

Import Project steps finished. You can **build** added projects. Right click on project files and click **Build Project**. If you don’t have any error in console, build projects has done.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1610347189516/93eQB5I_M.png)

## **Create Project**

This section you will demonstrate how to create new C/C++ project in **MCUXpresso IDE** for **LPC11xx** and **LPC1768**.

Firstly, we need to import **CMSIS Library** our workspaces. After that we can create new **LPC C/C++** embedded projects.

In **Project Explorer** section right click and select **New** and **New C/C++ Project**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1610347191210/Tzl_eKQf3.png)

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1610347192768/wiuhbuNoV.png)

Then select which MCU Type you have. I have **LPC1113/302** and **LPC1768.**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1610347194335/eS8zRghrN.png)

Select which language develop your project opened panel. If you select LPCOpen projects before you need to download LPCOpen libraries. I will use **CMSIS Library** so select C project. Then click **Next** button.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1610347196464/gS1-nWWzz.png)

Type your project name in **Project name:** label then click **Next** button.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1610347198004/hoWjlgllT.png)

This section is important. You will see **Wizard properties page** and select which library you want to use in **CMSIS Core library**. You need to be careful when select core library because you have already imported your library in workspace before. I have already imported **CMSISv2p00_LPC11xx and CMSISv1p30_LPC17xx** these libraries into my workspace.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1610347199691/oe344Sv6q.png)

After select core library click **Next** and you can simply see your project into your workspace.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1610347201496/aOnyURiXL.png)

Simply you can see your project that in **Project Explorer**.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1610347203187/zbdkligh1.png)

After all that time you can build your project, shown below images.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1610347204712/XTBw13iZo.png)

These steps finished and your simple project has ready for development with in **CMSIS** library.

## **Add External Library**

Most of our development times we create external or internal library for our purpose usage. Some libraries must be generic and use where you want. So we need to add these libraies our main projects. This section demonstrate you how to import **external library** to your project.

Firstly, right click on your project and go to **Properties** than go to **Settings** label under **C/C++ Build** section.

Properties | C/C++ Build

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1610347206064/di5xDnPyZ.png)

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1610347207507/HECfzjeY0.png)

After selected **Settings** label than select Includes under **Tool Settings** than add your library path in **Include paths (-l)** label with **Add** button. You can simply see how to add library paths as below images.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1610347208986/qIv0vVOO-.png)

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1610347210838/UzAo4y-Lw.png)

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1610347212424/9RJ7koml7.png)

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1610347213968/YGorShlTf.png)

After all that you can **Build** your project and see has any error or other things you need.

## **Debug Project**

Development time all developers need to **Debug** so this section demonstrate how to debug **MCUXpresso** project.

In order to debug the created project we select our project in **Project Explorer** and then click on the **Debug** tab in the **Quick Start** panel and then wait for **Jlink** to run.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1610347215479/ACy0vHDaV.png)

The first time we run the JLink screen will continue to select the future and we are ready to use the screen by clicking on **Accept** button.

In order to be able to install the program, the energy of the cycle should be given your device circuit.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1610347217561/8_SqPgRAg.png)

If **Debug** succeeds, the **main** function will also fall to **breakpoint**. Then you can run the project by pressing the **Resume All Debug** button at the bottom.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1610347219134/64HueMQwN.png)

I hope you enjoy reading.

Have a nice coding…

[Cover Image](http://www.ocfreaks.com/tutorial-using-mcuxpresso-create-cortex-m-project-cmsis/)