cstm32fftdmaadc

STM32C031C6 - FLASH Overflow Error During FFT Implementation with ARM CMSIS-DSP


I am working on an embedded project with the STM32C031C6 microcontroller using STM32CubeIDE. My goal is to perform an FFT on ADC input data and transmit the results over UART. I am utilizing the ARM CMSIS-DSP library for the FFT processing.

Here are the details of my project:

Microcontroller: STM32C031C6
Toolchain: STM32CubeIDE 1.15.1
Compiler: arm-none-eabi-gcc 12.3.1
CMSIS-DSP: Using arm_rfft_instance_q15 and arm_cmplx_mag_q15 for FFT calculations
Peripherals: ADC (with DMA) and UART

The issue arises when I try to compile the project. I receive the following error:

arm-none-eabi-gcc -o "FFT.elf" @"objects.list" -larm_cortexM0l_math -mcpu=cortex-m0plus -T"STM32C031C6TX_FLASH.ld" --specs=nosys.specs -Wl,-Map="FFT.map" -Wl,--gc-sections -static -L"Lib" --specs=nano.specs -mfloat-abi=soft -mthumb -Wl,--start-group -lc -lm -Wl,--end-group
C:/.../ld.exe: FFT.elf section `.rodata' will not fit in region `FLASH'
C:/.../ld.exe: region `FLASH' overflowed by 63696 bytes
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:64: FFT.elf] Error 1

Solution

  • It means that the program is too big for your MCU.

    Your MCU is the cheapest and of the simplest and smallest in the STM32 family. It has 32 kb of RAM and your binary is at least 3x biggger

    It has a small FLASH, small RAM and does not have FPU and an entry level ARM core. Those MCUs were not designed to carry heave DSP jobs. You need to spend a bit more money and choose the MCU with more resources and best with FPU.