Crt0 _start causes hardfault
Asked by
Andrea Merello
I use have a STM32F407 cortex M4, with the linker script and startup file suggested in "readme.txt".
I have adapted memory map in linker script and Interrupt vector in startup.
I compile and link my application, but the processor jumps in the hard fault handler before reaching main.
The processor calls "atexit" function and then the problem happen when in _register_exitproc it executes
pop {r4-r8,pc}
The PC is loaded with a wrong value and the execution jumps in the wrong location.
Surprisingly if in the startup I do not call the crt _start and I make directly a jump to my main function (I have to zero the BSS by myself) then all works (including the few NewLib functions I use in my application).
Any suggestion?
Thank you
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Andrea Merello
- Solved:
- Last query:
- Last reply:
To post a message you must log in.