We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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 gccIn 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).
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 ?
Hans Berger said: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
Why?Why not :)But seriously1. uVision has direct support for using gcc2 I want to try embedded wizardm and this sw support MDK-ARM only with gcc,I know whose product is CubeMX.The problem, but not the CubeMX, problem, is probably in the compiler or linker settings
try adding this to one of your C files
void _init() {}
That will fix your current issue.