2018-04-29 09:19 PM
Hi All,
Recently, I am stucked in an issue where if i use 'printf('%f', num)' ( where num is float type) then system gives 'hard fault' but if i use 'printf('%d', num) ( where num is integer) then system works fine.
I don't know that how can we debug such issue in STM32 AC6 Workbench ?
Regards,
Manish
#debuging #stm32h7 #ide-debugger-eclipse2018-05-02 03:36 AM
Hello
manishsharma3134
,Please, have a look to this discussion, it may help you
https://community.st.com/0D50X00009XkfDjSAJ
or thishttp://www.openstmorg/forumthread954
Best Regards,
Imen
2018-05-02 03:43 AM
Many toolchains have an option to initialize the stack with a specific pattern.
This will allow you to determine a 'high watermark' during runtime, and an indication of a stack overflow after a crash.
Still, stack size is defined statically, and your responsibility.
This means, you need to increase the size until it fits your application.
Recently, I am stucked in an issue where if i use 'printf('%f', num)' ( where num is float type) ...
You shalt not print floating point numbers.
Their impact on stack usage is well-known.
2018-05-02 04:43 AM
Hard Faults are gross failures and should be pretty easy to pin-point with some precision.
Have a handler that does more than while(1). Identify the instructions which are faulting along with the CPU registers at the fault.
Make sure the tools are pulling the right libraries for the chip, and that the FPU is enabled.
2018-05-02 09:52 PM
meyer.frank
Turvey.Clive.002
Turvey.Clive
DAHMEN.IMEN
Thanks all for the inputs. Although, my question was that 'how can we debug such issue in the AC6 environment' ?
I am novice to this world. Any help is greatly appreciated.
Sincerely,
Manish
2018-05-03 02:09 AM
... my question was that 'how can we debug such issue in the AC6 environment' ?
Obviously not so much users of this IDE here.
I would check for it's documentation and tutorials.
Or, you can work your way from the hardfault backwards:
2018-05-03 06:31 AM
Just try usage StackTrace window to show actual call state at HF. Then try Debug step by step at new run via that call sequence and detect problem place.
2018-05-09 03:26 AM
Apologize for the late reply.
Thanks
kovalenko
meyer.frank
Turvey.Clive
DAHMEN.IMEN
for addressing the issue. It certainly helped me to debug this issue.