Forum : ARM
Original Post
Post Information | Post |
---|---|
September 12, 2011 - 4:28pm
|
Hi All, I'm trying to create a 2D array of 153,6 KB on the STM32F103 flash memory.
When I try to build the project, I receive this message in the Build Log: Building C:\tmp\Colour LCD\407Test.rapp Running: LD Linker "C:\Program Files\Raisonance\Ride\arm-gcc\bin\arm-none-eabi-gcc.exe" -mcpu=cortex-m3 -mthumb -Wl,-T -Xlinker "C:\tmp\Colour LCD\407Test.elf.ld" -u _start -Wl,-static -Wl,--gc-sections -nostartfiles -Wl,-Map -Xlinker "C:\tmp\Colour LCD\407Test.map" c:/program files/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/bin/ld.exe: C:\tmp\Colour LCD\407Test.elf section `.bss' will not fit in region `RAM' c:/program files/raisonance/ride/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/bin/ld.exe: region `RAM' overflowed by 89032 bytes collect2: ld returned 1 exit status Build failed What can be the problem? |
Now, I understand why I get this message. The compiler copies the variables onto the stack. But, how can I overcome this as I also have to write to this portion of memory. Or should I use the flash programming manual and see the writing to flash examples to see how to write to flash?
Thanks for your help.
Hi,
On GCC you just need 2 things to make your array located in flash:
- Qualify it as "const"
- Initilialize it in the declaration.
For example:
Best Regards,
Hi Bruno,
Thanks a lot for your reply.
I'm sorry, I forgot to mention something important that I have to do with that array. I want to be able to change the content of that array.
In fact, I want to use it as a frame buffer for my controller less TFT LCD. So far, I have been able to fill the display with one color, and display bitmap images coded in RGB565 format which were stored in MCU flash.
The only thing I'm left with creating some text and GUI objects. I'm not using any external RAM so I will have to rely on the MCU flash considering the display resolution and the size of one pixel (320 * 240 * 2 bytes).
That's why I want to have a 2D array to ease my task with indexing and in order to be able to control my x and y positions.
Thanks.
Hi all,
I found a way to do it. I'm not using 2D array. I'm writing directly to flash. I figured that out by making some memory address calculations. So far I have been able to draw rectangles, lines, and display texts.
Thanks