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.
avrhack
Posts: 138
Joined: Tue Dec 24, 2013 1:42 pm
Has thanked: 16 times
Been thanked: 3 times

Debug startup code

Postby avrhack » Mon May 03, 2021 4:47 pm

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: 13629
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 888 times
Been thanked: 768 times
Contact:

Re: Debug startup code

Postby Giovanni » Mon May 03, 2021 6:13 pm

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

Giovanni

avrhack
Posts: 138
Joined: Tue Dec 24, 2013 1:42 pm
Has thanked: 16 times
Been thanked: 3 times

Re: Debug startup code

Postby avrhack » Mon May 03, 2021 7:52 pm

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: 13629
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 888 times
Been thanked: 768 times
Contact:

Re: Debug startup code

Postby Giovanni » Tue May 04, 2021 6:00 am

Hi,

Place it in crt0_v7m.S right at beginning.

Giovanni


Return to “Development and Feedback”

Who is online

Users browsing this forum: No registered users and 3 guests