LPC540xx

From SEGGER Wiki
Revision as of 11:19, 5 April 2018 by Alex (talk | contribs) (Created page with "__TOC__ The LPC540xx series devices are flashless Cortex-M4 based IoT devices. They always boot from external memory (usually QSPI flash). = Debug scenarios = On the LPC540x...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The LPC540xx series devices are flashless Cortex-M4 based IoT devices. They always boot from external memory (usually QSPI flash).

Debug scenarios

On the LPC540xx series there are different debug scenarios:

  • Debugger downloads to QSPI area and debugs in QSPI area. NXP calls this "XIP debug"
  • Debugger downloads to SRAMX area and debugs in SRAMX area. NXP calls this "SRAMX only debug"
  • Debugger downloads to SRAMX area but wants QSPI (@0x10000000) to be programmed. NXP calls this "plain load debug"

Requirements

There are some requirements that need to be fulfilled in order to debug on the LPC540xx series:

  • Min. J-Link software V6.31g (beta) or V6.32 (release) is needed. Other versions are not guaranteed to work.

SRAMX only debug

In this scenario, the application is linked to SRAMX and also executed there. When debugging this scenario, the application needs to be re-downloaded on each reset because the LPC540xx device clears the SRAMX on each reset. J-Link supports an IDE independent method to allow an automatic restore of a given memory area, on reset.

Debugging in IAR EWARM

  • Make sure that under Project options -> Debugger -> Download the "Use flash loader(s)" checkbox is not checked.
  • Make sure that a decent target interface speed is used AG xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  • Make sure that a restore area is registered under Project options -> Debugger -> Extra Options


--jlink_exec_command "MemPreserveOnReset 0x0 0x30000"
IMGGGGGGGG

XIP debug

This scenario is easy and straight forward: The application is linked to the QSPI flash area, downloaded to there and also executed there. There are usually no special steps that need to be considered.

Debugging in IAR EWARM

  • Make sure that under Project options -> Debugger -> Download the "Use flash loader(s)" checkbox is not checked. This will make sure that instead of the IAR flash loader, the J-Link one is used, which dynamically detects the QSPI flash that is mounted and supports a broad range of flashes: AG xxxxxxxxxxxxxxxxxxxxxxxxxxx
  • Make sure that a decent target interface speed is used AG xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Plain load debug

This scenario is the most complex one because the debugger tells J-Link to download to the SRAMX area but in reality wants the QSPI flash to be programmed. The ROM BTL of the LPC540xx device will copy over QSPI flash data into SRAMX at the next reset. Debugging happens in the SRAMX area. To support this mode, it is required to tell J-Link to handle a write to the SRAMX area as a write to the QSPI flash. J-Link supports in IDE independent method for this.

Debugging in IAR EWARM

  • Make sure that under Project options -> Debugger -> Download the "Use flash loader(s)" checkbox is not checked. This will make sure that instead of the IAR flash loader, the J-Link one is used, which dynamically detects the QSPI flash that is mounted and supports a broad range of flashes: AG xxxxxxxxxxxxxxxxxxxxxxxxxxx
  • Make sure that a decent target interface speed is used AG xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  • Make sure that a restore area is registered under Project options -> Debugger -> Extra Options


--jlink_exec_command "map add 0x00000000-0x07FFFFFF A FLASH 0x10000000 0x17FFFFFF"
IMGGGGGGGG