2020-04-10 03:19 PM
Hello everyone
I'm working on STemWin532 library on STM32F103ZET6 bord in STM32CudeIDE. I could successfully configured LCD interface (The Controller is HX8325B and GUI runs on internal RAM) and insert some text on the screen (following image):
But when i use external SRAM as GUI memory result is very strange and interesting :). The text is driven out of the screen. The following picture shows the situation:
While the code is the same code that works correctly in the internal RAM of MCU. The only command that i changed is the following variable definition for GUI memory allocation:
#include "GUI.h"
#define GUI_NUMBYTES 1024*50
U32 static aMemory[GUI_NUMBYTES/4]; // This is for internal RAM
U32 static aMemory[GUI_NUMBYTES/4]__attribute__((section(".GUI_0x68000000"))); // This is for extenal SRAM
void GUI_X_Config(void) {
GUI_ALLOC_AssignMemory(aMemory, GUI_NUMBYTES);
}
The section .GUI_0x68000000 is defined within linker command file as follows:
// other codes ...............
/* Memories definition */
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 512K
ExtSRAM (xrw) : ORIGIN = 0x68000000, LENGTH = 1024K
}
/* Sections */
SECTIONS
{
.GUI_0x68000000 :
{
} >ExtSRAM
// other codes.......
}
Build Analyzer output of CudeIDE shows the memory usage:
There is no hard fault in execution procedure and while(1) loop is executing as normal:
Any help will highly appreciated.
Best Regards
Ali.H