This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Using gcc in MDK-ARM linker error

I'm trying to use gcc in MDK-ARM.
In CubeMX I generated a simple project for STM32F407.
I generate project for MDK-ARK and SW4STM32 too.
In MDK-ARM I switch complier on gcc and install last Gcc for ARM.
In first step I replace keil strtup assembler file startup_STM32F407.,s with same files form project for SW4STM32 which is in the assembeller for gcc
In second step I use Linker scipt file STM32F407VETx_FLASH.ld from project SW4STM32.

All files will be compiled OK, but linke ld end with error

Where is the problem?

c:/gcc/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: c:/keil/gcc/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp\libc.a(lib_a-init.o): in function `__libc_init_array':
init.c:(.text.__libc_init_array+0x20): undefined reference to `_init'
collect2.exe: error: ld returned 1 exit status
".\STM32F407.elf" - 1 Error(s), 0 Warning(s).

Parents
  • Why do you want to use MDK if you're not going to use the Keil/ARM compiler?

    If you want to use GCC, wouldn't it make more sense to use ST's GCC-based IDE ?

    I generate project for MDK-ARK

    Surely, that will assume the ARM compiler - so shouldn't you generate the Project for GCC ?

    Note that CubeMX is ST's tool - nothing to do with ARM or Keil - so you need to talk to ST for how to get CubeMX to generate the correct output ...

    EDIT

    Same question: community.arm.com/.../169023

Reply
  • Why do you want to use MDK if you're not going to use the Keil/ARM compiler?

    If you want to use GCC, wouldn't it make more sense to use ST's GCC-based IDE ?

    I generate project for MDK-ARK

    Surely, that will assume the ARM compiler - so shouldn't you generate the Project for GCC ?

    Note that CubeMX is ST's tool - nothing to do with ARM or Keil - so you need to talk to ST for how to get CubeMX to generate the correct output ...

    EDIT

    Same question: community.arm.com/.../169023

Children