2016-10-21 10:35 PM
Hello.
I need to build C/C++ mixing project with microlib.
Building is completed but occur hardfault after loading soon.. not reached to main().
Call stack
HardFault_Handler -- 0x080xxxx
malloc -- 0x0000000
Could you let me know how to fix this issue ?
P.S
after, I checked building withouth microlib.
the result was same but the call stack :
_sys_open 0x0800xxx
freopen 0x08000xxx
_initio 0x800xxxx
0x000000
What is the root cause ? something wrong with my application ?
Regards
Shige
2016-10-22 07:15 AM
Have a Hard Fault handler that can actually output diagnostic information so you can identify where/how it is failing. Then look at that code critically.
Have adequate heap for your expected allocations and constructors. Have an adequate stack for your auto/local variables. Understand your code and its footprint. Turn off ''run to main()'' so you can debug the code before main(), ie the code in SystemInit(), and that initializing the statics.