Debug startup code

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
Post Reply
avrhack
Posts: 140
Joined: Tue Dec 24, 2013 1:42 pm
Has thanked: 17 times
Been thanked: 3 times

Debug startup code

Post by avrhack »

Can someone remind me how the hell to debug Chibios startup code with gdb as it's handing before it gets to main() so 'start' is useless. I've done this before but can't remember how, nor can I find any useful hits through google either in this forum or more generally.

I'm sure it will be a clock issue, but getting to step through the code seems obscure to say the least.

Thanks.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Debug startup code

Post by Giovanni »

You may launch the application, keep it running and place a breakpoint in the startup code, press reset.

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

Re: Debug startup code

Post by avrhack »

I've tried to find an appropriate point for that breakpoint but can't find one that triggers so I'm starting to think it's the damned changes ST made to the 'boot' pin on later processors ie reversing the polarity. No idea why they did that - just causes bloody pain for everyone.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Debug startup code

Post by Giovanni »

Hi,

Place it in crt0_v7m.S right at beginning.

Giovanni
Post Reply