Debug code executing in SDRAM

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

Debug code executing in SDRAM

994 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ajones on Tue Dec 03 07:54:47 MST 2013
I am looking at developing an environment that allows code executing from external SDRAM to be debugged.

I understand that that I need a debugger script that initialises the system clocks and SDRAM before attempting to perform a download and debug.

Is there an example available that allows debugging code excuting on SDRAM?

Where is the documentation for the scripts that would allow this initialisation to performed?

Thanks,



Labels (1)
0 Kudos
5 Replies

776 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ajones on Thu Dec 05 07:38:48 MST 2013
Thanks but unfortunately I am using the LPCXpresso IDE (which I should have stated in my original post).
0 Kudos

776 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bavarian on Thu Dec 05 05:00:08 MST 2013
I attached a script file for the LPC4300 and the SDRAM used on the KEIL board which works for uVision + ULINK. If you have another SDRAM configuration then you need to change the code accordingly.
The concept from KEIL allows to write these script files nearly like standard C code, for other debuggers you need to convert the C code ( e.g. do { ... } while )  into other structs which can be executed by the respective debugger.

Regards,
NXP Support Team
0 Kudos

776 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Wed Dec 04 00:47:17 MST 2013
For external RAM, LPCXpresso uses Software breakpoints.
0 Kudos

776 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by John Sinclair on Tue Dec 03 22:00:50 MST 2013
Hi,

Hardwarebreakpoints doesn't work at addresses above 1GB (0x4000 0000) in the ARM Cortex Core. Too bad that NXP design the external memory at 0x8000 0000!
So no chance to set a Hard-breakpoint in external memory
Look at:
http://www.keil.com/forum/20388/

So if you need a Breakpoint you can set only Soft-Breakpoints
Regards

John
0 Kudos

776 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Dec 03 09:57:29 MST 2013
One way to do this would be to write a gdb script that configures your SDRAM controller by reading/writing to the registers. I would suggest:
- write your GDB script and place in a file
- open the project Launch configuration, switch to the Debugger tab and press the Edit Script... button
- in the script, immediately before the ${load} statement, add
source path/to/your/script/file


GDB provides a very powerful scripting language - a web search will find lots of information. The key things are probably:
- to read a memory location on the target and assign to a variable
set $v = (unsigned int *) 0x10000000

- to write to a memory location
set *(unsigned int *)0x10000000 = 0x27
set *(unsigned int *)0x10000000 = $var

0 Kudos