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:50:57 2018 +0000
Revision:
4:3bc63d11d829
Parent:
3:d5d12de5808c
Info about publishing code added

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