Static Constant Variable Allocated as RAM when used by HAL I2C functions STM32CubeIDE
Hi, I am working on a project where I have a 4096 byte data array that I will be passing to another component via I2C. This array is a constant, so I declared it as follows in order to have it live in flash memory rather than RAM:
static const uint8_t myArray[4096] = {
0x80,0x40,0x00,0x11,
...However, when I pass a pointer to this variable to the HAL I2C functions, it suddenly gets placed in RAM and I get a RAM overflow error from the compiler:
HAL_I2C_Slave_Sequential_Transmit_IT(&h_i2c, (uint8_t *)myArray, 4096, I2C_FIRST_AND_LAST_FRAME);/Applications/STM32CubeIDE.app/Contents/Eclipse/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.macos64_1.0.0.202111181127/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: my-proj.elf section `._user_heap_stack' will not fit in region `RAM'
/Applications/STM32CubeIDE.app/Contents/Eclipse/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.macos64_1.0.0.202111181127/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: region `RAM' overflowed by 16 bytes
collect2: error: ld returned 1 exit status
make: *** [makefile:87: stereo-slo-051.elf] Error 1
"make -j11 all" terminated with exit code 2. Build might be incomplete.Any idea what's going on here and how I can fix it?
