cancel
Showing results for 
Search instead for 
Did you mean: 

PROBLEM LINK EDITOR WHEN TRY COMPILE ST LIBRARY FOR VL53L1X on STM32G030F6

Fscu.1
Associate II

I use cube ide when i add the function Status = VL53L0X_StaticInit(pfab);on main.c ,how build it i have this error :

arm-none-eabi-gcc "../Core/Src/main.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DUSE_HAL_DRIVER -DSTM32G030xx -DDEBUG -c -I../Drivers/CMSIS/Include -I../Core/Inc -I../Drivers/CMSIS/Device/ST/STM32G0xx/Include -I../Drivers/STM32G0xx_HAL_Driver/Inc -I../Drivers/STM32G0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Core/Src/main.d" -MT"Core/Src/main.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Core/Src/main.o"

arm-none-eabi-gcc -o "TOF_0.elf" @"objects.list"  -mcpu=cortex-m0plus -T"C:\Users\f.scurti\STM32CubeIDE\workspace_1.3.0\TOF_0\STM32G030F6PX_FLASH.ld" --specs=nosys.specs -Wl,-Map="TOF_0.map" -Wl,--gc-sections -static --specs=nano.specs -mfloat-abi=soft -mthumb -Wl,--start-group -lc -lm -Wl,--end-group

c:\st\stm32cubeide_1.3.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610\tools\arm-none-eabi\bin\ld.exe: TOF_0.elf section `.text' will not fit in region `FLASH'

c:\st\stm32cubeide_1.3.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610\tools\arm-none-eabi\bin\ld.exe: region `FLASH' overflowed by 3768 bytes

collect2.exe: error: ld returned 1 exit status

make: *** [makefile:44: TOF_0.elf] Error 1

"make -j2 all" terminated with exit code 2. Build might be incomplete

I use the micro STM32G030F6 , is it small memory FLash for STM32G030F6 ?

1 REPLY 1
KnarfB
Principal III

> region `FLASH' overflowed by 3768 bytes

Yeah, the flash is too small to hold your code. You are building an debug configuration, release will be smaller. Try to improve compiler flags, E.g. -O0 makes the code really huge. -Os would be space optimized. There are also several libraries around. Check out the "vl53l1x ultra lite driver".

hth

KnarfB