Bootloader and gdb Topic is solved

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
avrhack
Posts: 140
Joined: Tue Dec 24, 2013 1:42 pm
Has thanked: 17 times
Been thanked: 3 times

Bootloader and gdb

Post by avrhack »

I can't see this has been asked/answered elsewhere although a couple of posts come close, so here goes.....

I currently use a black magic probe (bmp) to debug my ChibiOS creations and that is an excellent setup, however going forward I want to have my applications relocated to make room for a boot loader and run from there.

However what I can't figure out is how to debug an application who's reset vector is not 0 and whose VTOR vectors have been relocated. Loading the elf in gdb still ends up with gdb trying to run the boot loader and of course it has no symbols for that.

I'm sure this is just me being stupid and there's a simple answer, so could someone explain how to do this please?
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Bootloader and gdb

Post by Giovanni »

Hi,

I think you need to put the first breakpoint past the bootloader and into the application code, once it stops there you should see symbols and all.

Giovanni
avrhack
Posts: 140
Joined: Tue Dec 24, 2013 1:42 pm
Has thanked: 17 times
Been thanked: 3 times

Re: Bootloader and gdb

Post by avrhack »

Giovanni wrote:I think you need to put the first breakpoint past the bootloader and into the application code, once it stops there you should see symbols and all.
Giovanni


Yep that's exactly it. I loaded the application without doing a full erase so the bootloader was still in place then used 'start' in gdb which places a breakpoint at main() and it worked perfectly. Did a reset, hit the bootloader, ran that through to the point it started the application and when it go to the main() in the application it was in gdb prompt exactly as if no bootloader.

Seems obvious now you've said it and I've tried it, but was puzzling me until now :)

Thanks!
mobyfab
Posts: 484
Joined: Sat Nov 19, 2011 6:47 pm
Has thanked: 21 times
Been thanked: 31 times

Re: Bootloader and gdb

Post by mobyfab »

You should have no problem debugging the target app if you enter the correct address in gdb.
It will jump to the correct vector directly without running the bootloader.

It works fine for me, but I'm using stlink.
Post Reply