Example of blinking LED on LPCXpresso54608 board (OM13092)

LPC-LINK2 Debug Probe Firmware update required with MBED firmware to enable the mbed flash disk interface (board is seen as MSD mass storage device) so drag and drop programming is possible

tested on Windows 7

Based on

https://os.mbed.com/platforms/LPCXpresso54608/

and

https://os.mbed.com/teams/NXP/wiki/Updating-LPCXpresso-firmware

you need to update your LPCXpresso (programmer/debugger) to the latest firmware to enable the mbed flash disk interface.

Note that for LPCXpresso54114 and LPCXpresso546xx boards there is a 2-step programming process (first bootloader needs to be installed, then binary for LPC546xx board).

Detailed guide as follows:

1. Go to LPCScrypt webpage and download its latest version (needs admin rights)

2. Go to DOCUMENTATION section of above link and select “LPC-Link2 Debug Probe Firmware Programming”

3. Configure the selected board to DFU Boot, then connect to the host computer via USB

  • In case of: OM13092/LPCXpresso54806
    • check jumper JP5 “DFU LINK” (needs to be installed) – to download firmware from IDE

4. Download Link2 (LPC432x) Bootloader binary (Use this Bootloader first for boards that require a 2-step update)

  • https://os.mbed.com/media/uploads/mmahadevan/lpc4322_bl_crc.bin
  • Save to directory of LPCScrypt
    • C:\nxp\LPCScrypt_2.0.0_831\probe_firmware\LPCXpressoV2
    • LPCXpressoV2 folder has been chosen because I was able to find an info that debug probe LPC432x is being programmed with LPC432x_IAP_CMSIS_DAP_V5_183.bin file (and this file is in LPCXpressoV2 folder)
      • to confirm that please go to Start -> start typing LPC -> choose “Program LPC-Link2 with CMSIS-DAP”

5. Make a copy of program_CMSIS.cmd file in C:\nxp\LPCScrypt_2.0.0_831\scripts and call it program_CMSIS_mbed_daplink.cmd

  • Open with Notepad++ program_CMSIS_mbed_daplink.cmd file
  • edit:

before
set Link2ImageWild=LPC432x_IAP_CMSIS_DAP_*.bin

after
set Link2ImageWild=lpc4322_bl_*.bin
  • or comment (by adding REM)

before
set Link2ImageWild=LPC432x_IAP_CMSIS_DAP_*.bin

after
REM set Link2ImageWild=LPC432x_IAP_CMSIS_DAP_*.bin
    set Link2ImageWild=lpc4322_bl_*.bin

6. Go to Start -> cmd

  • go to directory

cd C:\nxp\LPCScrypt_2.0.0_831\scripts
  • type command
    • program_CMSIS_mbed_daplink
    • because of changes in program_CMSIS_mbed_daplink.cmd, now file downloaded from MBED called lpc4322_bl_crc.bin is executed
    • Ctrl+C to quit

7. Disconnect the board

8. Remove the jumper JP5 “DFU LINK”

9. Connect again the board

  • In that step board should be seen as MAINTANANCE

10. Go to https://armmbed.github.io/DAPLink/ and type in the box 54608, then you will see firmware file called

  • 0251_lpc4322_lpc54608xpresso_0x10000.bin
  • Download the firmware file
  • Save wherever you want
  • Drag-and-drop the firmware file onto the mounted drive called MAINTANANCE
  • Wait for the file copy operation to complete
  • Power cycle the board. It will now enumerate and mount as DAPLINK or the name of the board

11. Ready for drag and drop programming

Committer:
marcinch
Date:
Thu Dec 06 11:28:27 2018 +0000
Revision:
3:d5d12de5808c
Parent:
2:2d14566062e9
Child:
4:3bc63d11d829
Serial communication configured (printing of welcome text and pin states)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
marcinch 0:09421d80c468 1 /* mbed Microcontroller Library
marcinch 0:09421d80c468 2 * Copyright (c) 2018 ARM Limited
marcinch 0:09421d80c468 3 * SPDX-License-Identifier: Apache-2.0
marcinch 0:09421d80c468 4 */
marcinch 0:09421d80c468 5
marcinch 0:09421d80c468 6 #include "mbed.h"
marcinch 1:e158e4f407da 7 //#include "stats_report.h"
marcinch 0:09421d80c468 8
marcinch 2:2d14566062e9 9 /*
marcinch 2:2d14566062e9 10 * Pin names available here:
marcinch 2:2d14566062e9 11 * https://os.mbed.com/platforms/LPCXpresso54608/
marcinch 3:d5d12de5808c 12 *
marcinch 3:d5d12de5808c 13 * API for DigitalOut class with example available here:
marcinch 3:d5d12de5808c 14 * https://os.mbed.com/docs/latest/apis/digitalout.html
marcinch 2:2d14566062e9 15 */
marcinch 0:09421d80c468 16 DigitalOut led1(LED1);
marcinch 2:2d14566062e9 17 DigitalOut led2(LED2);
marcinch 2:2d14566062e9 18 DigitalOut led3(LED_RED);
marcinch 2:2d14566062e9 19
marcinch 2:2d14566062e9 20 /*
marcinch 3:d5d12de5808c 21 * API for Serial class with example available here:
marcinch 3:d5d12de5808c 22 * https://os.mbed.com/docs/latest/apis/serial.html
marcinch 2:2d14566062e9 23 */
marcinch 3:d5d12de5808c 24 Serial pc(USBTX, USBRX, 115200);//(pin name Tx, pin name Rx, baud rate)
marcinch 0:09421d80c468 25
marcinch 0:09421d80c468 26 // main() runs in its own thread in the OS
marcinch 0:09421d80c468 27 int main()
marcinch 0:09421d80c468 28 {
marcinch 1:e158e4f407da 29 //SystemReport sys_state(500 /* Loop delay time in ms */);
marcinch 2:2d14566062e9 30
marcinch 2:2d14566062e9 31 //Setting all pins to low (in this case LEDs will be ON) and wait 2 seconds before while loop starts
marcinch 2:2d14566062e9 32 led1 = led2 = led3 = 0;
marcinch 2:2d14566062e9 33 wait(2.0f);
marcinch 3:d5d12de5808c 34 pc.printf("Let's get blinking LEDs demo started!\n\r");
marcinch 2:2d14566062e9 35
marcinch 0:09421d80c468 36 while (true) {
marcinch 0:09421d80c468 37 // Blink LED and wait 0.5 seconds
marcinch 0:09421d80c468 38 led1 = !led1;
marcinch 3:d5d12de5808c 39 pc.printf("led1 = %d \n\r", (uint8_t)led1 );
marcinch 0:09421d80c468 40 wait(0.5f);
marcinch 2:2d14566062e9 41 led2 = !led2;
marcinch 3:d5d12de5808c 42 pc.printf("led2 = %d \n\r", led2.read() );//both methods of reading pin state give the same result
marcinch 2:2d14566062e9 43 wait(0.5f);
marcinch 2:2d14566062e9 44 led3 = !led3;
marcinch 3:d5d12de5808c 45 pc.printf("led3 = %d \n\r", (uint8_t)led3 );
marcinch 2:2d14566062e9 46 wait(0.5f);
marcinch 3:d5d12de5808c 47
marcinch 0:09421d80c468 48 // Following the main thread wait, report on the current system status
marcinch 1:e158e4f407da 49 //sys_state.report_state();
marcinch 2:2d14566062e9 50 }//end while
marcinch 2:2d14566062e9 51 }