Please note: We are aware of an issue affecting replies on the Arm Community forums, which may not be loading as expected.

We apologize for any inconvenience and appreciate your patience while we investigate and work to resolve the issue.

Thank you for your understanding.


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).