LPC54018 SWD Programming

cancel
Showing results for 
Search instead for 
Did you mean: 

LPC54018 SWD Programming

67 Views
ahmed_mostafa
Contributor II

Hello,

I have created my own circuit board based on the LPC54018. I copied the schematic exactly as the LPC54018 IoT board, except without the wifi chip and the external SPI flash. Do I need the external SPI flash in order to debug the microcontroller?

How can I load a program onto a brand new microcontroller using only SWD and no other pins?

Thanks,

Ahmed

Labels (1)
0 Kudos
8 Replies

28 Views
ahmad_
Contributor II

Hi @ahmed_mostafa ,

I use LPC Link-2 to program my custom lpc54018 board. 

I dont know if this going to help, you can try to reset your board, close and open back your IDE or try using other usb ports.

 

 

0 Kudos

37 Views
ahmed_mostafa
Contributor II

Can anyone provide any help?

0 Kudos

14 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello ahmed_mostafa,

Which debugger do you used?

Could you please take a picture about the hardware connection.

And what about your project? This chip is no internal flash, so you only can put your code in RAM.

 

BR

Alice

0 Kudos

11 Views
ahmed_mostafa
Contributor II

@Alice_Yang 

I use the CMSIS DAP probe debugger that is present on the mini IoT debugger

https://www.nxp.com/products/sensors/accelerometers/mini-iot-baseboard:OM40008

How do I load my code into RAM instead of flash? I am using MCUXpresso.

I notice the Evaluation board has an external flash SPI chip. Is that what is used to program the device on the LPC54018 IoT board? https://www.nxp.com/design/designs/lpc54018-iot-solution:IoT-Solution-with-Amazon-FreeRTOS

 

0 Kudos

61 Views
converse
Senior Contributor IV

No you do not need external SPI to debug.

you will need a debug probe such as MCU-link, LPC-link2 etc and install an IDE such as the free NXP MCUXpresso.

0 Kudos

57 Views
ahmed_mostafa
Contributor II

I use MCUXpresso and it works just fine with the LPC54018 IoT module. I'm using the CMSIS Link server debugger than comes with that IoT module.

However when I apply that same setup to my custom board, I get errors. I'm confident that I've connected the SWD traces correctly to the microcontroller. Is there any other setting I need to do inside MCUXpresso? This is my Console output:

__________________________________________________________________________

MCUXpresso IDE RedlinkMulti Driver v11.3 (Jan 11 2021 16:41:13 - crt_emu_cm_redlink build 9)

Found chip XML file in C:/Users/amostafa9/Documents/Code Repositories/LPC54018_Digital_Out/lpcxpresso54s018_mcofd_Digital_Out/Debug\LPC54S018.xml

Reconnected to existing LinkServer process.

Probe Firmware: LPC11U3x CMSIS-DAP v1.0.4 (NXP Semiconductors)

Serial Number:  11041018

VID:PID:  1FC9:0132

USB Path: \\?\hid#vid_1fc9&pid_0132&mi_00#7&25c5da96&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}

Using memory from core 0 after searching for a good core

On debug connection - use system reset, stalling when 0x40000040 is accessed

Retask read watchpoint 1 at 0x40000040 to use for boot ROM stall

Waiting for target to stop...

Warning - processor did not halt - gave up waiting

debug interface type      = CoreSight DP (DAP DP ID 2BA01477) over SWD TAP 0

processor type            = Cortex-M4 (CPU ID 00000C24) on DAP AP 0

number of h/w breakpoints = 6

number of flash patches   = 2

number of h/w watchpoints = 4

Probe(0): Connected&Reset. DpID: 2BA01477. CpuID: 00000C24. Info: <None>

Debug protocol: SWD. RTCK: Disabled. Vector catch: Enabled.

Content of CoreSight Debug ROM(s):

RBASE E00FF000: CID B105100D PID 04000BB4C4 ROM (type 0x1)

ROM 1 E000E000: CID B105E00D PID 04000BB00C Gen SCS (type 0x0)

ROM 1 E0001000: CID B105E00D PID 04003BB002 Gen DWT (type 0x0)

ROM 1 E0002000: CID B105E00D PID 04002BB003 Gen FPB (type 0x0)

ROM 1 E0000000: CID B105E00D PID 04003BB001 Gen ITM (type 0x0)

ROM 1 E0040000: CID B105900D PID 04000BB9A1 CSt TPIU type 0x11 Trace Sink - TPIU

ROM 1 E0041000: CID B105900D PID 04000BB925 CSt ETM type 0x13 Trace Source - Core

NXP: LPC54S018

DAP stride is 4096 bytes (1024 words)

XML Error - no license-type XML file 'crt_common.xme' on path.

note - part information contained no product license-type data

Inspected v.2 External Flash Device on SPI LPC540xx_SPIFI_SFDP.cfx

Image 'LPC540xx_JEDEC_SFDP Dec 17 2020 10:03:04'

Opening flash driver LPC540xx_SPIFI_SFDP.cfx

Using SOFT reset to run the flash driver

rst - Boot ROM stall address was not accessed (but we entered debug on Halt anyway)

Driver V.2 dynamic startup failed - driver Init provided no flash parameters

Flash Driver V.2 startup failed - rc Ef(55): Dynamic flash driver startup failed to provide flash parameters.

Terminate (0x0, 0x0, 0x0) status 0x40 - driver reports init failure - EXTSPI driver rc 1 - Device is busy

chip initialization failed - Ef(55): Dynamic flash driver startup failed to provide flash parameters.

failed to initialize flash driver LPC540xx_SPIFI_SFDP.cfx

-------------------------------------------------------------------------------------------------------------------------

What is causing these errors?

 

 

0 Kudos

34 Views
ahmed_mostafa
Contributor II

Can anyone provide any help?

0 Kudos

18 Views
converse
Senior Contributor IV

with almost 100% certainty, you have a problem on your circuit. Check the debug connection, power and termination of unused pins 

0 Kudos