Debug imx8 M4 on DRAM with Eclipse

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

Debug imx8 M4 on DRAM with Eclipse

529 Views
biafra
Senior Contributor I

Hi everyone,

 

I'm working on a custom board based on imx8m mini and I need to develop an application on the M4 core.
I'm testing a very simple program that blinks a led. I started from the example found on the SDK (v 2.12.1).

 

If I run the program on TCM I can work fine in all the cases I use: following the AN https://www.nxp.com/docs/en/application-note/AN5317.pdf I can start the application from U-Boot (with bin file), I can load it from Linux (with elf file) and I can debug it using Eclipse or Iar.

 

If I compile and link the same application to run from DRAM, I can start the application from U-Boot, but I can't load it from Linux nor I can't debug it using Eclipse or Iar.

 

In Eclipse for the TCM I use the following memory linker parameters:

MEMORY
{
m_interrupts (RX) : ORIGIN = 0x1FFE0000, LENGTH = 0x00000240
m_text (RX) : ORIGIN = 0x1FFE0240, LENGTH = 0x0001FDC0
m_data (RW) : ORIGIN = 0x20000000, LENGTH = 0x00020000
m_data2 (RW) : ORIGIN = 0x80000000, LENGTH = 0x01000000
}

 

For DRAM:

MEMORY
{
m_interrupts (RX) : ORIGIN = 0x77000000, LENGTH = 0x00000240
m_text (RX) : ORIGIN = 0x77000240, LENGTH = 0x001FFDC0
m_data (RW) : ORIGIN = 0x77200000, LENGTH = 0x00200000
m_data2 (RW) : ORIGIN = 0x77400000, LENGTH = 0x00C00000
}

 

If I run the application from Linux I get this errors:

[ 68.269072] remoteproc remoteproc0: powering up imx-rproc
[ 68.314950] remoteproc remoteproc0: Booting fw image BlinkLED_DDR77.elf, size 3294348
[ 68.322908] remoteproc remoteproc0: bad phdr da 0x77000000 mem 0x240
[ 68.329306] remoteproc remoteproc0: Failed to load program segments: -22
[ 68.336859] remoteproc remoteproc0: Boot failed: -22

 

The same application (bin) launched from U-Boot works as expected.

 

If I try to debug the application using Eclipse, after reaching main(), I get continuously:

...
Starting target CPU...
...Breakpoint reached @ address 0x77000EBA
Reading common registers: R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, SP, LR, PC, XPSR
Starting target CPU...
...Breakpoint reached @ address 0x77000EBA
Reading common registers: R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, SP, LR, PC, XPSR
Starting target CPU...
...Breakpoint reached @ address 0x77000EBA
...

 

I can't pause the execution, I can only close the connection.

 

What I have to do to load the application from Linux and to debug it in Eclipse running from DRAM?

 

Many thanks
Biafra

0 Replies