XIP, program not starting on LPC54018J4M custom board

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

XIP, program not starting on LPC54018J4M custom board

Jump to solution
1,105 Views
ronwal
Contributor III
Hello,

 

I am currently working on a new custom board using LPC54018J4MET180 with integrated 4MB Flash.
 
I have been able to run the code when using the "Link application to RAM" setting from MCUXpressoIDE. but it´ll not execute the code with XIP.
When I try to debug from MCUXpresso, the debugger does not get to the main or even ResetISR breakpoint and just says that the thread is running and the following message:
No source available for "(gdb[34].proc[42000].threadGroup[i1],gdb[34].proc[42000].OSthread[1]).thread[1].frame[0]"
 
These are the debugger log messages:

 

MCUXpresso IDE RedlinkMulti Driver v11.8 (Jul 12 2023 16:09:15 - crt_emu_cm_redlink build 2)
Found chip XML file in D:/workspaceM4/LPC54018M_Minimal/Debug\LPC54018J4M.xml
(  5) Remote configuration complete
Reconnected to existing LinkServer process.
Probe Firmware: MCU-LINK (r0FF) CMSIS-DAP V2.263 (NXP Semiconductors)
Serial Number:  HC2ZIXAVLISYN
VID:PID:  1FC9:0143
USB Path: \\?\hid#vid_1fc9&pid_0143&mi_00#7&73995f5&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
Using memory from core 0 after searching for a good core
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: Disabled.
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: LPC54018J4M
DAP stride is 4096 bytes (1024 words)
Inspected v.2 External Flash Device on SPI LPC540xx_SPIFI_GENERIC.cfx
Image 'LPC5460x Generic SPIFI Jul 25 2023 09:07:38'
Opening flash driver LPC540xx_SPIFI_GENERIC.cfx
Sending VECTRESET to run flash driver
Flash variant 'W25Q32FV' detected (4MB = 64*64K at 0x10000000)
Closing flash driver LPC540xx_SPIFI_GENERIC.cfx
Connected: was_reset=true. was_stopped=false
Awaiting telnet connection to port 3330 ...
GDB nonstop mode enabled
Opening flash driver LPC540xx_SPIFI_GENERIC.cfx (already resident)
Sending VECTRESET to run flash driver
Flash variant 'W25Q32FV' detected (4MB = 64*64K at 0x10000000)
Writing 13616 bytes to address 0x10000000 in Flash
10004000 done 100% (16384 out of 13616)
Erased/Wrote sector 0-0 with 13616 bytes in 437msec
Closing flash driver LPC540xx_SPIFI_GENERIC.cfx
Flash Write Done
Flash Program Summary: 13616 bytes in 0.44 seconds (30.43 KB/sec)
Starting execution using system reset and halt target with a stall address
Retask read watchpoint 1 at 0x40000040 to use for boot ROM stall
Boot ROM stalled accessing address 0x40000040 (restoring watchpoint 1)
Stopped (Was Reset)  [Reset from Unknown]

 

 

Thanks in advance for any help.

Best regards

Ron

0 Kudos
Reply
1 Solution
821 Views
ronwal
Contributor III

Hello

After one week of investigating, I found the reason for my problem. Maybe I´ll help somebody...

The XIP image layout  was incorrect. The HEADER_OFFSET at 0x28 shall point to the HEADER_MARKER with i typical standard value of 0x160. But in my case I had to change it to 0x158.

After that the image could be loaded.

ronwal_0-1699367999885.png

Ron

View solution in original post

0 Kudos
Reply
6 Replies
822 Views
ronwal
Contributor III

Hello

After one week of investigating, I found the reason for my problem. Maybe I´ll help somebody...

The XIP image layout  was incorrect. The HEADER_OFFSET at 0x28 shall point to the HEADER_MARKER with i typical standard value of 0x160. But in my case I had to change it to 0x158.

After that the image could be loaded.

ronwal_0-1699367999885.png

Ron

0 Kudos
Reply
937 Views
ronwal
Contributor III

Hello @Alice_Yang 

 

Can you please provide some more help because I am really stuck with this problem?

 

Here I summarize my problem:

Setup:

  • LPCLPC54018J4MET180,
  • MCU-Link debug probe,
  • hello_world XIP sample program

 

1. Using the LPC540xx_SPIFI_SFDP.cfx driver gives me the following error:

ProgramPage (0x10000000, 0x2290, 0x4000) status 0x1 - driver reported driver error - EXTSPI driver rc 35 (0x23)
15: Target error from Commit Flash write: Ef(49): Flash driver operation gave error.

 

2. Using the  LPC540xx_SPIFI_GENERIC.cfx flashing succeeds with no error.

Even verify the flash with the GUI flash tool afterwards succeeds. After starting the debug session,the program hangs somewhere in BootRom area 0x03xxxxx with message "no debug information avaiable...".

Checking the flash memory with the memory monitor shows all 0x0 at flash adress 0x10000000.

This means to me, that there was nothing written at all and that could be the reason why the program hangs at the bootloader, right?

But why did it say "writting succeeded"?

Any idea?

Thanks

Ron

 

0 Kudos
Reply
1,061 Views
ronwal
Contributor III

Hello Alice

 

Yes I know it´s setup like this. My problem is, that the program does not load at all when configured for XIP. It hangs before start.

Is there any special configuration I have to make to the internal QSPI flash before able to use it?

My memory config is as follows and I am using the LPC540xx_SPIFI_GENERIC.cfx driver:

nxp1.JPG

Also I checked my linker file if configured correctly:

  • Image type 3 (XIP with no CRC)
  • Load_address 0x10000000 (flash)

Also I checked for a possible ISP boot mode

  • the BOOT_SRC bits9+10 are not set, which means the ISP pins decide
  •  P0.4, P0.5, P0.6 have external pullups and always high, which means Auto boot sequence

My program ist based on the "hello_world_qspi_xip" SDK sample. But I also tried to create i new project from scratch, which shows the same behaviour.

Do you have any other idea I could check?

Thanks

Ron

 

0 Kudos
Reply
1,035 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @ronwal 

 

How about use Flash driver: LPC540xx_SPIFI_SFDP.cfx ?

 

BR

Alice

0 Kudos
Reply
1,031 Views
ronwal
Contributor III

Hi @Alice_Yang 

I tried it, but it gave me the following EXTSPY driver error right away:

ProgramPage (0x10000000, 0x2290, 0x4000) status 0x1 - driver reported driver error - EXTSPI driver rc 112 (0x70)

 

How can I debug, why the MCU stops in Bootloader ROM area?

From my knowledge there could be many reasons for that, like:

  • ISP pins
  • no valid Image found
  • watchdog timer

But where can I see, what caused the MCU to stop?

Regards

Ronny

0 Kudos
Reply
1,067 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @ronwal 

The "plain load images" control XIP or no-xip, if you want to XIP, disable it (un-check):

Alice_Yang_0-1698047522629.png

 

About detail, you can refer to <MCUXpresso IDE User Guide > -> plain load image.

Also you can import a xip demo for lpc54018 to test.

 

BR

Alice

0 Kudos
Reply