2009-06-23 17:50:08 -05:00
|
|
|
/* simple app.
|
2008-10-06 07:14:52 -05:00
|
|
|
|
|
|
|
modify test.ld to change address.
|
|
|
|
|
|
|
|
Even if the app is position independent, the symbols
|
|
|
|
need to match to test basic debugging.
|
|
|
|
|
|
|
|
To load the app to 0x20000000 in GDB, use:
|
|
|
|
|
|
|
|
load a.out
|
|
|
|
monitor reg sp 0x20004000
|
|
|
|
monitor reg pc 0x20002000
|
|
|
|
stepi
|
|
|
|
|
2009-06-23 17:42:54 -05:00
|
|
|
arm-elf-gcc -mthumb -mcpu = cortex-m3 -nostdlib -Ttest.ld test.c
|
2008-10-06 07:14:52 -05:00
|
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
int j;
|
|
|
|
void _start()
|
|
|
|
{
|
|
|
|
int i;
|
2009-06-23 17:45:47 -05:00
|
|
|
for (i = 0; i < 1000; i++)
|
2008-10-06 07:14:52 -05:00
|
|
|
{
|
|
|
|
j++;
|
|
|
|
}
|
|
|
|
}
|