cancel
Showing results for 
Search instead for 
Did you mean: 

Strange problem with STemWin Library

Ahaji.1
Associate II

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):

0693W000000VhwFQAS.png

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:

0693W000000VhwKQAS.png

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:

0693W000000VhwAQAS.png

There is no hard fault in execution procedure and while(1) loop is executing as normal:

0693W000000VhwUQAS.png

Any help will highly appreciated.

Best Regards

Ali.H

0 REPLIES 0