Getting Started with the LPC54S018-EVK

Last Modified: 2019-03-26 10:23:00Supports LPCXpresso54S018 Development Board

Contents of this document

  • 1

    Plug It In
  • 2

    Get Software
  • 3

    Build, Run
  • 4

    Create

1. Plug It In

Let's take your LPCXpresso54S018 board for a test drive You have the choice of watching the sequence in a short video or following the detailed actions list below.

1.1 Get Started With the LPCXpresso54S018 Development Board – Demo

1.2 Attach the USB Cable

LPC54S018-EVK-GS-1-1

1.3 Run the Out-of-Box Demo

Your LPCXpresso54S018 board comes preloaded with a “spirit level” demo. The user LEDs (LED1, LED2 and LED3) indicate if the board is level along the horizontal axis of the board. Tilt the board towards or away from you to see the LEDs change.

LPC54S018-EVK-GS-1-2

2. Get Software

2.1 Getting Started With the MCUXpresso SDK

Want to learn more about SDK?

The MCUXpresso Software Development Kit (SDK) is complimentary and includes full source code under a permissive open-source license for all hardware abstraction and peripheral driver software.

Click below to download a pre-configured SDK release for the LPCXpresso54S018, which includes versions for MCUXpresso IDE, Keil MDK and IAR EWArm. Use LPCXpresso54S018 as the target board.

MCUXPRESSO-SDK-TN

Get SDK

You can also use the online MCUXpresso web tool to create a custom SDK package for the LPCXpresso54S018 using the SDK builder.

2.2 Install your Toolchain

NXP offers a free, GNU/Eclipse based toolchain called MCUXpresso IDE.

MCUXpresso IDE

Get MCUXpresso IDE

Want to use a different toolchain?

No problem, The MCUXpresso SDK includes support for other tools such as IAR and Keil.

IAR, Keil Logos

To set up your LPCXpresso54S018 for use with 3rd party tools, first install LPCScrypt in order to install the board’s device drivers. The video below shows how to use LPCScrypt to program your board’s debug probe using this utility.

The video on this Getting Started section are for LPCXpresso54608, but the steps are the same for LPCXpresso54S018.

2.3 MCUXpresso Config Tools

The MCUXpresso Config Tool is an integrated suite of configuration tools that guides users in creating new MCUXpresso SDK projects, and provides pin and clock tools to generate initialization C code for custom board support.

MCUXpresso Config Tools

Get MCUXpresso Config Tools

2.4 Serial Terminal

Most of the MCUXpresso SDK examples set up for IAR and Keil tools use the MCU UART for printf output, and this is also an option for the MCUXpresso IDE. If you are not sure how to use a terminal application try one of these tutorials: Tera Term Tutorial, PuTTY Tutorial

3. Build, Run

3.1 Explore the MCUXpresso SDK Example Code

The MCUXpresso SDK comes with a long list of example applications code. To see what's available, browse to the SDK boards folder of your SDK installation and select LPCXpresso54S018 (<sdk_install_directory>/boards/LPCXpresso54S018</sdk_install_directory>).

To learn more about specific example code, open the readme.txt file in an example’s directory.

3.2 Build, Run

If one or more of the demo applications or driver examples sounds interesting, you're probably wanting to know how you can build and debug yourself. The Getting Started with SDK for LPC540xx guide provides easy, step-by-step instructions on how to configure, build, and debug demos for all toolchains supported by the SDK.

Use the guide below to learn how to open, build and debug an example application using the MCUXpresso IDE.

Using a different toolchain?

Running a Demo Using IAR or Keil.

4. Create

4.1 Get SDK Project Generator

Let's create our own project and make a simple SDK-based application. NXP provides an intuitive, simple project generation utility that allows creation of custom projects based on the Kinetis SDK.

Get Project Generator

4.2 Run the SDK Project Generator

After extracting the ZIP file, open the utility by clicking on the KSDK_Project_Generator executable for your computer's operating system. Point the tool to your SDK installation path, name your project, and select the board that it uses as a reference. Click on the Quick Generate button to finish.

KSDK-PROJECT-GENERATOR

4.3 Open Your Project

Your new project will be located in <sdk_install_directory>/examples/frdmk64/user_apps</sdk_install_directory>. Open the project in your toolchain of choice by using the same process described in section 3.2.

4.4 Write Some Code

Now, let's make our new project do something other than spin in an infinite loop. The SDK examples provide a board support package (BSP) to do various things specific to the board, including macros and definitions for items such as LEDs, switches and peripheral instances. To keep things simple, lets make the LED blink using the BSP macros.

Update the main() function in your project's main.c file with the following code:

volatile int delay;
// Configure board specific pin muxingBOARD_InitPins();
// Configure clock sourceBOARD_BootClockRUN();
// Initialize the UART terminalBOARD_InitDebugConsole();PRINTF("\r\nRunning the myProject project.\n");
// Enable GPIO port for the red LEDCLOCK_EnableClock(kCLOCK_PortE);PORT_SetPinMux(BOARD_LED_RED_GPIO_PORT, BOARD_LED_RED_GPIO_PIN, kPORT_MuxAsGpio);LED_RED_INIT(LOGIC_LED_OFF);for (;;){LED_RED_TOGGLE();delay = 5000000;while(delay--);}

4.5 Build, Download, Run

With the changes made to your main() function, build your application. Once the build is complete, download the application to your board.

If you need help figuring out how to build, download or run an application, reference your tool-specific guide from section 3.2.

4.6 Success

With the application downloaded, you will see the FRDM-KE15Z's red LED blinking. You can also view terminal output using PRINTF.

Tera Term Tutorial

Tera Term Tutorial

Tera Term is a very popular open source terminal emulation application. This program can be used to display information sent from your NXP development platform's virtual serial port.

  1. Download Tera Term from SourceForge. After the download, run the installer and then return to this webpage to continue.
  2. Download

  3. Launch Tera Term. The first time it launches, it will show you the following dialog. Select the serial option. Assuming your board is plugged in, there should be a COM port automatically populated in the list.
  4. Tera-Term-Connection-MCUXPRESSO
  5. Configure the serial port settings (using the COM port number identified earlier) to 115200 baud rate, 8 data bits, no parity and 1 stop bit. To do this, go to Setup -> Serial Port and change the settings.
  6. Verify that the connection is open. If connected, Tera Term will show something like below in it's title bar.
  7. Tera-Term-Console
  8. You're ready to go

PuTTY Tutorial

PuTTY Tutorial

PuTTY is a popular terminal emulation application. This program can be used to display information sent from your NXP development platform's virtual serial port.

  1. Download PuTTY using the button below. After the download, run the installer and then return to this webpage to continue
  2. Download

  3. Launch PuTTY by either double clicking on the *.exe file you downloaded or from the Start menu, depending on the type of download you selected
  4. Configure In the window that launches, select the Serial radio button and enter the COM port number that you determined earlier. Also enter the baud rate, in this case 115200
  5. PUTTY-Configuration
  6. Click Open to open the serial connection. Assuming the board is connected and you entered the correct COM port, the terminal window will open. If the configuration is not correct, PuTTY will alert you
  7. You're ready to go

Running a Demo Using IAR or Keil®

Learn how to build and run a simple example using IAR or Keil Third Party IDE toolchains.

Running a Demo Using IAR

Build an Example Application

The following steps will guide you through opening the led_output application. These steps may change slightly for other example applications as some of these applications may have additional layers of folders in their path.

  1. If not already done, open the desired example application workspace. Most example application workspace files can be located using the following path:

    <install_dir >/boards/<sdk_board_name >/<example_type>/<application_name>/iar</application_name></example_type></sdk_board_name ></install_dir >

    Using the hello_world demo as an example, the path is:

    <install_dir>/boards/LPCXpresso54S018/driver_examples/gpio/led_output/iar</install_dir>

  2. Select the desired build target from the drop-down. For this example, select the “hello_world – Debug” target.

    GS-OM13092-IAR-1
  3. To build the application, click the “Make” button, highlighted in red below.

    GS-OM13092-IAR-2
  4. The build will complete without errors.:

Run an Example Application

The LPCXpresso54S018 board comes loaded with the CMSIS-DAP debug interface from the factory. Connect the development platform to your PC via USB cable to J8 “Debug Link”.

  1. Click the "Download and Debug" button to download the application to the target.

    GS-FRDM-K64F-IAR-IMG2
  2. The application is then downloaded to the target and automatically runs to the main() function.

    GS-OM13092-IAR-3
  3. Run the code by clicking the "Go" button to start the application.

    GS-FRDM-K64F-IAR-IMG8

Running a Demo Using Keil MDK/µVision®

Install CMSIS device pack

After the MDK tools are installed, Cortex® Microcontroller Software Interface Standard (CMSIS) device packs must be installed to fully support the device from a debug perspective. These packs include things such as memory map information, register definitions and flash programming algorithms. Follow these steps to install the appropriate CMSIS pack.

  1. Open the MDK IDE, which is called µVision. In the IDE, select the "Pack Installer" icon.

    GS-FRDM-K64F-KEIL-IMG1
  2. 2. In the Pack Installer window, navigate to the section with the LPC packs (they are in alphabetical order). The Kinetis packs start with "Keil::LPC" and are followed by the MCU family name, for example "Keil::LPC54000". Because this example uses the LPCXpresso54S018 platform, the LPC54000 family pack is selected. Click on the "Install" button next to the pack. This process requires an internet connection to successfully complete.

    GS-OM13092-KEIL-2
  3. After the installation finishes, close the Pack Installer window and return to the µVision IDE.

Build the Example Application

The following steps will guide you through opening the gpio_led_output application. These steps may change slightly for other example applications as some of these applications may have additional layers of folders in their path.

  1. If not already done, open the desired demo application workspace in:

    <install_dir >/boards/<sdk_board_name >/<example_type>/<application_name>/mdk</application_name></example_type></sdk_board_name ></install_dir >

    The workspace file is named <application_name>.uvmpw, so for this specific example, the actual path is: </application_name>

    <install_dir>/boards/LPCXpresso54S018/driver_examples/gpio/led_output/mdk/gpio_led_output.uvmpw</install_dir>

  2. To build the demo project, select the "Rebuild" button, highlighted in red.

    GS-OM13092-KEIL-3
  3. The build will complete without errors.

Run an Example Application

The LPCXpresso54S018 board comes loaded with CMSIS-DAP debug interface from the factory.

  1. After the application is properly built, click the "Download" button to download the application to the target GS-OM13092-KEIL-4
  2. After clicking the "Download" button, the application downloads to the target and should be running. To debug the application, click the "Start/Stop Debug Session" button, highlighted in red GS-OM13092-KEIL-5
  3. Run the code by clicking the "Run" button to start the application GS-OM13092-KEIL-6

Support

Learn more about the LPC54S018-EVK with design tips, training documents, and the NXP Community. If you need additional help, contact NXP Support.

Troubleshooting

With the application downloaded, you will see the FRDM-KE15Z's red LED blinking. You can also view terminal output using PRINTF.

Demo not working?

Did your board come in a box that looks like this?

NXP Freedom FRDM-KL25Z Box

No problem, your board simply came in the old packaging and has a different out-of-box demo loaded into the flash memory.

You should be seeing the RGB LED toggling between each of the three colors; red, blue and green. It's OK to move onto the next step when you're ready.

Still not working?

Try proceeding to the next steps to get other example applications running on your board. If you still have problems, try contacting us through the NXP Community .