I have been getting started with the LPC55S16-EVK recently. I have downloaded the SDK in order to try demo applications. I am having bit of an issue with the debugging though. The project is led_blinky inside demo_apps folder. And my IDE is IAR 8.50.1.
The issue is that, when I download and debug the application using the onboard debugger, MCU cannot run to main and it is stuck on hardfault. I removed "run to main" tick in order to see where it fails.
It starts with the reset handler normally.
Sat May 02, 2020 11:53:11: The downloaded program doesn't seem to match the expected memory layout of the target system:
Sat May 02, 2020 11:53:11: Some SFRs are placed outside known memory areas, or in memory areas designated as read-only or as RAM:
Sat May 02, 2020 11:53:11: FLASH_CFPA0_HEADER @ 0x0003E000, 32 bits
Sat May 02, 2020 11:53:11: FLASH_CFPA0_VERSION @ 0x0003E004, 32 bits
Sat May 02, 2020 11:53:11: FLASH_CFPA0_S_FW_Version @ 0x0003E008, 32 bits
Sat May 02, 2020 11:53:11: FLASH_CFPA0_NS_FW_Version @ 0x0003E00C, 32 bits
Sat May 02, 2020 11:53:11: FLASH_CFPA0_IMAGE_KEY_REVOKE @ 0x0003E010, 32 bits
Sat May 02, 2020 11:53:11: and more...
Sat May 02, 2020 11:53:11: Memory is specified as follows:
Sat May 02, 2020 11:53:11: 0x00000000 - 0x0003DDFF ROM/Flash
Sat May 02, 2020 11:53:11: 0x0003DE00 - 0x000408BF ROM/Flash
Sat May 02, 2020 11:53:11: 0x03000000 - 0x0301FFFF ROM/Flash
Sat May 02, 2020 11:53:11: 0x04000000 - 0x04003FFF RAM
Sat May 02, 2020 11:53:11: 0x10000000 - 0x1003DDFF ROM/Flash
Sat May 02, 2020 11:53:11: 0x1003DE00 - 0x1003FFFF ROM/Flash
Sat May 02, 2020 11:53:11: 0x13000000 - 0x1301FFFF ROM/Flash
Sat May 02, 2020 11:53:11: 0x14000000 - 0x14003FFF RAM
Sat May 02, 2020 11:53:11: 0x20000000 - 0x20007FFF RAM
Sat May 02, 2020 11:53:11: 0x20008000 - 0x2000BFFF RAM
Sat May 02, 2020 11:53:11: 0x2000C000 - 0x2000FFFF RAM
Sat May 02, 2020 11:53:11: 0x20010000 - 0x20013FFF RAM
Sat May 02, 2020 11:53:11: 0x30000000 - 0x30007FFF RAM
Sat May 02, 2020 11:53:11: 0x30008000 - 0x3000BFFF RAM
Sat May 02, 2020 11:53:11: 0x3000C000 - 0x3000FFFF RAM
Sat May 02, 2020 11:53:11: 0x30010000 - 0x30013FFF RAM
Sat May 02, 2020 11:53:11: 0x40000000 - 0x40013FFF Uncached/SFR
Sat May 02, 2020 11:53:11: 0x40020000 - 0x4003DFFF Uncached/SFR
Sat May 02, 2020 11:53:11: 0x40082000 - 0x4008EFFF Uncached/SFR
Sat May 02, 2020 11:53:11: 0x40094000 - 0x4009FFFF Uncached/SFR
Sat May 02, 2020 11:53:11: 0x400A0000 - 0x400ACFFF Uncached/SFR
Sat May 02, 2020 11:53:11: 0x50000000 - 0x50013FFF Uncached/SFR
Sat May 02, 2020 11:53:11: 0x50020000 - 0x5003DFFF Uncached/SFR
Sat May 02, 2020 11:53:11: 0x50082000 - 0x5008EFFF Uncached/SFR
Sat May 02, 2020 11:53:11: 0x50094000 - 0x5009FFFF Uncached/SFR
Sat May 02, 2020 11:53:11: 0x500A0000 - 0x500ACFFF Uncached/SFR
Sat May 02, 2020 11:53:11: 0xE0000000 - 0xE00FFFFF Uncached/SFR
Sat May 02, 2020 11:53:11: SFRs range from 0x0003DE00 to 0xE00FFFFF
Sat May 02, 2020 11:53:11: LowLevelReset(software, delay 200)
Sat May 02, 2020 11:53:11: Calling reset script: SoftwareReset
Sat May 02, 2020 11:53:11: LowLevelReset(system, delay 200)
Sat May 02, 2020 11:53:11: Calling reset script: SystemReset
Sat May 02, 2020 11:53:11: 5102 bytes verified (99.65 Kbytes/sec)
Sat May 02, 2020 11:53:11: Download completed and verification successful.
Sat May 02, 2020 11:53:11: LowLevelReset(software, delay 200)
Sat May 02, 2020 11:53:11: Calling reset script: SoftwareReset
Sat May 02, 2020 11:53:11: Target reset
Sat May 02, 2020 11:53:11: INFO: Configuring trace using 'SWO,ETB' setting ...
Sat May 02, 2020 11:53:11: Trace: ETMv4 not found, so trying ETMv3 for Cortex-M33 core ...INFO: SWO trace mode is not supported by the probe (use I-jet/I-jet-Trace probe) - trace is disabled.
Sat May 02, 2020 11:53:11: There were 3 warnings during the initialization of the debugging session.
Sat May 02, 2020 11:53:59: HardFault exception.
Sat May 02, 2020 11:53:59: The processor has escalated a configurable-priority exception to HardFault.
Sat May 02, 2020 11:53:59:
Sat May 02, 2020 11:53:59: Exception occured at PC = 0xffffffff, LR = 0x0
Sat May 02, 2020 11:53:59:
Sat May 02, 2020 11:53:59: See the call stack for more information.
The only way I can run the application in debugging mode is to change the reset setting to "Hardware" and do a reset. But then debug screen jumps directly to infinite while loop inside the main. This prevents me from debugging anything before that. A software reset returns to reset handler and ends up with the hardfault.
I tried debugging with a J-Link and there were no such problems. I could step by step debug each instruction after reset.