how to Debug in SDRAM

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

how to Debug in SDRAM

458 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jerrycai on Sun Jul 21 05:02:39 MST 2013
MCU: LPC1788FBD20
IDE: Keil MDK 4.71

I'm trying to download and debug the code in external SDRAM via Jtag. It takes much time to erase and download to Flash, So I want to download the code to SDRAM direclty.

Anyone has the excessful sample? or verified SDRAM.ini file for MDK?
Or this idea is infeasible for Cortex-M3.

Labels (1)
0 Kudos
3 Replies

389 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jerrycai on Sat Jul 27 23:51:27 MST 2013
I defined an .ini file for system clock and sdram initialization.

But Debug sebug aborted when I change the CPU clock from sysclk to pll_clk.

the error info

[color=#f00]_WDWORD(0x400FC104,0x00000101)
^
*** error 125: AGDI: memory write failed (0x400FC104)[/color]

But when I write it in code, and debug the code step by step without .ini file, it works well.

What's the difference between the two methods,and how can I avoid the issue in .ini file?
0 Kudos

389 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jerrycai on Sat Jul 27 23:47:24 MST 2013
I defined an .ini file for system clock and sdram initialization.

But Debug sebug aborted when I change the CPU clock from sysclk to pll_clk.

the error info

[color=#f00]_WDWORD(0x400FC104,0x00000101)
^
*** error 125: AGDI: memory write failed (0x400FC104)[/color]

But when I write it in code, and debug the code step by step without .ini file, it works well.

What's the difference between the two methods,and how can I avoid the issue in .ini file?
0 Kudos

389 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wmues on Mon Jul 22 01:25:30 MST 2013
If you want to load your code into SDRAM, and execute from there, you will need to set many registers, incl. MPU, and will need to setup the SDRAM inside your debugger start script.

You also must copy the interrupt vector table into internal RAM and set the vtable pointer.

See the attached file (for openocd debugger) as a starting point.

regards
Wolfgang
0 Kudos