Hi,
i've got a hardfault while testing my code.
Unfortunately this was a tool in normal use, where I'm not able to get the complete backtrace nor a debugger on it.
The only information I've had:
The SP was at 0x200003E0.
R0 at 0x0801EA4B which is chRescheduleAhead when I'm looking in the map file.
Any idea what could be the reason for this?
HardFault on chRescheduleAhead
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: HardFault on chRescheduleAhead
It could be anything, are you able to run the code with debug options enabled?
I would look for a stack overflow or a state violation.
Giovanni
I would look for a stack overflow or a state violation.
Giovanni
Re: HardFault on chRescheduleAhead
Yes, I will try to check this with debug options again.
Unfortunately this occure only once for now, just after a reboot.
How much space should the main stack have? I can see it will go down to 100bytes free.
Unfortunately this occure only once for now, just after a reboot.
How much space should the main stack have? I can see it will go down to 100bytes free.
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: HardFault on chRescheduleAhead
Just enough, there is no need to keep "free" space.
You should also try to enable HW stack check, there is a port option for that, it is much more reliable than the normal SW check. If the application is critical I recommend keeping stack checking ON in release code.
You may also try to use chSysIntegrityCheckI() in your error handler for some on-field diagnostic.
Giovanni
You should also try to enable HW stack check, there is a port option for that, it is much more reliable than the normal SW check. If the application is critical I recommend keeping stack checking ON in release code.
You may also try to use chSysIntegrityCheckI() in your error handler for some on-field diagnostic.
Giovanni