Skip to main content
kchin.2
Associate II
August 7, 2023
Solved

Flash memory as ram

  • August 7, 2023
  • 2 replies
  • 1806 views

I want to use some part of flash memory as ram but i am getting below error

C:/ST/STM32CubeIDE_1.13.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.0.202305231506/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: Radar_Data_Acquisition_FW.elf section `user_settings_section' will not fit in region `RAM'

C:/ST/STM32CubeIDE_1.13.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.0.202305231506/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: Radar_Data_Acquisition_FW.elf section `user_settings_section' will not fit in region `FLASH'

C:/ST/STM32CubeIDE_1.13.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.0.202305231506/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: region `RAM' overflowed by 389856 bytes

C:/ST/STM32CubeIDE_1.13.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.0.202305231506/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: region `FLASH' overflowed by 194904 bytes

collect2.exe: error: ld returned 1 exit status

 

what i configured:

MEMORY

{

RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K

FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 312K

RAM2 (xrx) : ORIGIN = 0x804E000, LENGTH = 200K

}

.user_settings_section (NOLOAD):

{

. = ALIGN(4);

KEEP(*(.user_settings_section)) /* Config section */

. = ALIGN(4);

} >RAM2

 

in .c code

uint16_t myarray[200000] __attribute__((section("user_settings_section"), used));

 

can anyone please help me on this.

 

    This topic has been closed for replies.
    Best answer by Tesla DeLorean

    >>is it possible ?

    No, not in the way you imagine it working.

    It is slow and has width issues, although you don't identify the part in question. Why can't you just output to the UART? Probably the same reason the FLASH won't work. You've got some other fast backing store you can use?

    2 replies

    TDK
    Super User
    August 7, 2023

    FLASH cannot be used as RAM.

    "If you feel a post has answered your question, please click ""Accept as Solution""."
    kchin.2
    kchin.2Author
    Associate II
    August 7, 2023

    i red dma can access flash memory i want to store adc samples to flash and from flash using dma i want to trasfer data via uart

    is it possible ?

     

    Tesla DeLorean
    Tesla DeLoreanBest answer
    Guru
    August 7, 2023

    >>is it possible ?

    No, not in the way you imagine it working.

    It is slow and has width issues, although you don't identify the part in question. Why can't you just output to the UART? Probably the same reason the FLASH won't work. You've got some other fast backing store you can use?

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..