STemwin hard fault if buffer in ext sram.
Hello,
I have a project based on STM32F417ZET. I want to use the STemwin library (STemWin532_CM4_OS_GCC.a) provided by ST. I'm using FreeRTOS that's why the lib is the _OS_ version.
Two things attached to the uC via FSMC:
- external SRAM
- type: IS66WV51216EBLL-70TLI-TR
- display controller
- type: ILI9481
Everything is fine and works well if the buffer for the emwin is in internal RAM. If I move this buffer to the external RAM I get hard fault, more precisely unaligned access hard fault. I did some disassembly debugging the hard fault happens somewhere in __ALLOC function inside emwin.
#define GUI_BLOCKSIZE 0x80
#define GUI_NUMBYTES (100UL*1024UL)
//This cause hardfault
static U32 extMem[GUI_NUMBYTES/4] __attribute__ ((section(".extram"))) = {0};
//This works fine
static U32 extMem[GUI_NUMBYTES/4]= {0};
void GUI_X_Config(void)
{
GUI_ALLOC_AssignMemory(extMem , GUI_NUMBYTES);
GUI_ALLOC_SetAvBlockSize(GUI_BLOCKSIZE);
}I tried 8/16/32 bit access to the sram, all test passed. The hard fault occurs only if I place the buffer in the external sram for emwin.
Does anyone experienced this kind of error? Any idea?
