Page 1 of 1

Debug startup code

Posted: Mon May 03, 2021 4:47 pm
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.

Re: Debug startup code

Posted: Mon May 03, 2021 6:13 pm
by Giovanni
You may launch the application, keep it running and place a breakpoint in the startup code, press reset.

Giovanni

Re: Debug startup code

Posted: Mon May 03, 2021 7:52 pm
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.

Re: Debug startup code

Posted: Tue May 04, 2021 6:00 am
by Giovanni
Hi,

Place it in crt0_v7m.S right at beginning.

Giovanni