2020-12-21 09:16 AM
Hey all! I'm working on a project with the STM32L151C8T6. However, my STM32CubeMX generated project (For STM32CubeIDE) launches straight into a hardfault. Any idea what could cause this or what I could debug to get this to work? I've already generated a new empty MX project that doesn't have anything configured - same problem. Thanks!
Solved! Go to Solution.
2020-12-21 09:58 AM
Check the linker script, and where it is placing things like the stack.
Off the top of my head this part should have at least 64KB FLASH and 16KB RAM on-die
Check the .MAP file.
If there is an option to uncheck "run to main()" use that and walk it in.
Check constructor initialization in startup.s, and if you need that (.cpp) , comment out if not
/* Call the clock system intitialization function.*/
bl SystemInit
/* Call static constructors */
/* bl __libc_init_array */
/* Call the application's entry point.*/
bl main
Oddly a NRND, but free-stock..
2020-12-21 09:58 AM
Check the linker script, and where it is placing things like the stack.
Off the top of my head this part should have at least 64KB FLASH and 16KB RAM on-die
Check the .MAP file.
If there is an option to uncheck "run to main()" use that and walk it in.
Check constructor initialization in startup.s, and if you need that (.cpp) , comment out if not
/* Call the clock system intitialization function.*/
bl SystemInit
/* Call static constructors */
/* bl __libc_init_array */
/* Call the application's entry point.*/
bl main
Oddly a NRND, but free-stock..
2020-12-22 11:21 PM
You're my man! Turns out I had accidentally generated the project for the STM32L151C8T6A, the not NRND version of the chip that has 32KB RAM. That properly messed things up.
Have a nice week,
David