2018-07-12 03:12 PM
hi,
I try to compile a minimum program using stm driver libs. but I can't compile without error about '__aeabi_uidiv' from line 1083 of stm32f0xx_rcc.c : pllclk = (HSE_VALUE / prediv1factor) * pllmull;
I think the problem come from the linker and I have added path of the libgcc.a in ld flags in my makefile
LIBGCCARM = ${GCCARMPATH}/lib/gcc/arm-none-eabi/${GCCARMVERSION}/${GCCARMARCH}LFLAGS = -L${LIBGCCARM} \
-lgcc \ -nostartfiles -T$(LKR_SCRIPT)the linker find correctly the lib, but the error occurs always...
thanks for your help
2018-07-13 01:12 AM
AFAIK, the library should be the right one.
Perhaps you can check it with objdump or similar, to see if the symbol (function) is really there.
2018-07-13 03:20 PM
Hi,
I've found in libgcc several lines about __aeabi_uidiv:
line 68 00000000 g F .text 00000000 .hidden __aeabi_uidivlines 2918, 2933, 2989... 00000000 *UND* 00000000 __aeabi_uidivan idea?
thanks
2018-07-14 03:56 AM
Looks like it's there.
Can you post the actual error message from the linker ?
2018-07-14 02:12 PM
Hi,
see here after the result of make,
alain@debian9-fuj:~/03_dev/10_wks_stm32f030/11_BootMinimalStCmsisLib $ make
/home/alain/02_bin/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-gcc -I/home/alain/03_dev/10_wks_stm32f030/00_LIB/CMSIS/INC/ -I/home/alain/03_dev/10_wks_stm32f030/00_LIB/stm32f0-stdperiph/INC/ -c -L/home/alain/02_bin/gcc-arm-none-eabi-7-2018-q2-update/lib/gcc/arm-none-eabi/7.3.1 -lgcc -DSTM32F030X4 -fno-common -O0 -g -march=armv6-m -mcpu=cortex-m0 -mthumb -DUSE_STDPERIPH_DRIVER=1 -fno-builtin -ffreestanding -nostdlib -std=gnu11 main.c -o main.o/home/alain/02_bin/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-gcc -I/home/alain/03_dev/10_wks_stm32f030/00_LIB/CMSIS/INC/ -I/home/alain/03_dev/10_wks_stm32f030/00_LIB/stm32f0-stdperiph/INC/ -c -L/home/alain/02_bin/gcc-arm-none-eabi-7-2018-q2-update/lib/gcc/arm-none-eabi/7.3.1 -lgcc -DSTM32F030X4 -fno-common -O0 -g -march=armv6-m -mcpu=cortex-m0 -mthumb -DUSE_STDPERIPH_DRIVER=1 -fno-builtin -ffreestanding -nostdlib -std=gnu11 /home/alain/03_dev/10_wks_stm32f030/00_LIB/stm32f0-stdperiph/SRC/stm32f0xx_rcc.c -o stm32f0xx_rcc.o/home/alain/02_bin/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-gcc -I/home/alain/03_dev/10_wks_stm32f030/00_LIB/CMSIS/INC/ -I/home/alain/03_dev/10_wks_stm32f030/00_LIB/stm32f0-stdperiph/INC/ -c -L/home/alain/02_bin/gcc-arm-none-eabi-7-2018-q2-update/lib/gcc/arm-none-eabi/7.3.1 -lgcc -DSTM32F030X4 -fno-common -O0 -g -march=armv6-m -mcpu=cortex-m0 -mthumb -DUSE_STDPERIPH_DRIVER=1 -fno-builtin -ffreestanding -nostdlib -std=gnu11 /home/alain/03_dev/10_wks_stm32f030/00_LIB/stm32f0-stdperiph/SRC/stm32f0xx_gpio.c -o stm32f0xx_gpio.o/home/alain/02_bin/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-ld -L/home/alain/02_bin/gcc-arm-none-eabi-7-2018-q2-update/lib/gcc/arm-none-eabi/7.3.1 -lgcc -nostartfiles -Tstm32_minimal.ld -o main.elf -I/home/alain/03_dev/10_wks_stm32f030/00_LIB/CMSIS/INC/ -I/home/alain/03_dev/10_wks_stm32f030/00_LIB/stm32f0-stdperiph/INC/ main.o stm32f0xx_rcc.o stm32f0xx_gpio.o stm32f0xx_rcc.o: In function `RCC_GetClocksFreq':/home/alain/03_dev/10_wks_stm32f030/00_LIB/stm32f0-stdperiph/SRC/stm32f0xx_rcc.c:1083: undefined reference to `__aeabi_uidiv'makefile:66 : la recette pour la cible « main.elf » a échouéemake: *** [main.elf] Erreur 1I have try with other gcc version, install witdebian package with same error.
thanks
2018-07-16 12:36 AM
Does it work if you drop the '
-fno-builtin -ffreestanding -nostdlib
' flags ?2018-07-16 05:07 AM
No change, same error...
2018-07-16 07:50 AM
Ignore for a second that this is a different processor, I don't have time to stand-up a CM0 example, look at the other options
This is how I compile for the H7
Compiling file: main.c
arm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -Os -ffunction-sections -fdata-sections -Wall -Wstrict-prototypes -Wextra -std=gnu89 -g -ggdb3 -fverbose-asm -Wa,-ahlms=out/main.lst -DUSE_HAL_DRIVER -DSTM32H743xx -DUSE_STM32H743I_EVAL -MD -MP -MF out/main.d -I. -Iinc main.c -o out/main.oThis is how I link for the H7
arm-none-eabi-g++ -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -TSTM32H743XIHx_FLASH.ld -g -Wl,-Map=out/demo.map,--cref,--no-warn-mismatch -Wl,--gc-sections -nostartfiles out/startup_stm32h743xx.o out/main.o out/stm32h743i_eval.o out/stm32h7xx_hal.o out/stm32h7xx_hal_cortex.o out/stm32h7xx_hal_gpio.o out/stm32h7xx_hal_msp.o out/stm32h7xx_hal_rcc.o out/stm32h7xx_hal_rcc_ex.o out/stm32h7xx_hal_uart.o out/stm32h7xx_it.o out/syscalls.o out/system_stm32h7xx.o -o out/demo.elf
2018-07-16 08:20 AM
This function is supposed to be in libgcc.
Checked a local Atollic test installation (gcc-based), and several libs contain references, but none implementation. It comes with a libc, not a libgcc, though.
2018-07-26 01:47 AM
Hi I (re)install arm-none-eabi toolchain -> same result
I try the same type of compil for stm32F103 (minimal boot projet, same toolchain), it's ok, no error. so the toolchain is correct for f103...
I install eclipse +arm mcu pluggin, using the same toolchain. I try a minimal projet, blinky led, it's ok.
...