__libc_init_array problems

Sysprogs forums Forums VisualGDB __libc_init_array problems

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #6914
    AndyFraser
    Participant

    Now I have VisualGDB setup correctly, I can now compile my code and debug it on my target hardware.

    However, it is failing at almost the first hurdle 🙁

    In startup_stm32f215xx.c there is a call to __libc_init_array in the Reset handler which I believe is in newlib.  When __libc_init_array is called a hard fault results.

    Looking on other forums, it would appear that this is due to __libc_init_array being compiled as 32-bit ARM code rather than Thumb(2) code required by my Cortex-M3 processor (STM32F215RG).

    Can anyone advise how I go about resolving this ?

    Andy

    #6918
    support
    Keymaster

    Hi,

    We have just rechecked the latest toolchain with another Cortex M3 MCU (STM32F100VB) and could not reproduce the problem, so the fault is not caused by ARM vs Thumb problem.

    In order to pinpoint the problem, please use the call stack window together with the disassembly view to find a specific instruction that causes the fault. If this is not helpful, open the Disassembly view before stepping into __libc_init_array() and then step into it, doing one instruction at a time until the fault occurs. If the fault happens on a memory accessing instruction, please check the address used in that instruction. If it is outside the FLASH/RAM ranges, something got wrong with the memory map (e.g. a bug in the linker script or a wrong address somewhere).

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.