__libc_init_array and STM32Cube hardfault
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-05-18 8:18 AM
Hello,
I'm using an STM32F373C-EVAL and both the Atollic and AC6 IDE tool. When I try to import a project from the STM32CubeF3 V1.4.0 into both the IDE, I get a hardfault error during the __libc_init_array branch instruction. However, if I create a new project from scratch using the STM32CubeMX, I have no problem. What could be the problem? #libc_init_array- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-05-18 3:56 PM
Do you use C++, do you have a list of constructors to be initialized?
Review the startup file and linker script, with a merge/diff tool if required, and identify what is being initialized differently. Review the .MAP files if that helps, and any command line options passed to the compiler/linker from the makefile.What is the address of __libc_init_array? Are you linking against the correct Thumb based library?Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-12-19 6:12 AM
I had this same problem as well but with SW4STM32. I found that I needed to add:
-specs=nosys.specs -specs=nano.specs
to the Linker Flags
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-12-19 6:36 AM
Perhaps you have copied startup files from one project to another ?
The startup code is quite toolchain specific and tailored to the libs provided by the toolchain, even if they look similar, and use similar/same labels.
