Eclipse GDB “init” and “run” settings for ARM LPC1768 using OpenOCD?

◇◆丶佛笑我妖孽 提交于 2019-12-01 08:28:54

Perhaps try one step at a time.

Start openocd, probably something like -f interface/jlink.cfg -f target/lpc1768.cfg or whatever, sounds like you have that working.

second telnet localhost 4444 or whatever the windows command line is (something similar)

WITHIN THE TELNET SESSION:

> halt
> mdw 0x0000

and stuff like that to see that you are talking to the part.

if you have already compiled some programs you can simply load them and run them, for example if you make a ram only program (tell the linker .text, .data, etc are all at 0x10000000) then

> load_image /path/to/myprog.elf
> resume 0x10000001

(yes add 1 to make it odd, this is a thumb processor wont run ARM instructions (lsbit = 0 is arm mode lsbit = 1 is thumb mode).

To re-run after re-compiling:

> halt
> load_image /path/to/myprog.elf
> resume 0x10000001

then worry about flashing, etc after you have ram based programs showing signs of life.

If none of that is working then gdb is just one more level of complexity on top of that and going to make it harder to figure out.

As far as the bootloader goes, the answer is it depends are you trying to run from ram or program to rom. If running from ram you can take over the system and take all the ram, some chips (stm32) have some routines you can call and those require some ram to be untouched, but if you are taking over the chip you can have all the ram, it is a matter of telling the linker and perhaps the debugger if it doesnt know from the binary (using elf files or ihex or srec or pretty much anything that is not a .bin is good, if the tool supports it).

if you are going to write to flash then you had better know exactly what portion of flash might contain a bootloader, what that bootloader does to hand off to your code, etc, and again tell the linker and the debugger this information. you could easily erase/trash the bootloader depending on where it is and what you are doing (a lot of these lpc and st parts have bootloaders, serial or usb, that are somewhat protected from casual mistakes, but you can still usually erase them and replace them if you are not careful).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!