2020-04-06 11:49 AM
Hi everyone
I'm using stm32f103zet to run emwin gui. In the first step i configured everything for running from internal RAM and program worked fine and gui is displays components like progress bar and ...., but when i changed linker command file to map gui memory to external SRAM everything went wrong. I checked connection with SRAM and it was ok. I checked 8,16,32 bit memory accessing integrity by following code:
this code is running well
build analyzer tool of cubeide shows memory usage as follows:
in this case program run GUI_Init() function successfully and memory allocation and LCD initialization are done, (The LCD is turn to black after GUI_Init() Execution just like when i use the internal RAM as gui memory) but nothing else happens.
What is the problem?
Thank you so much
2020-04-06 12:04 PM
>>..STM32F103ZET .. external SDRAM
This would surprise me, I'm pretty sure the F1 series does not support SDRAM, sure it is not just a Static RAM?
>>this code is running well
The real trick is to be able to read back the content
>>What is the problem?
Hard to know without actually doing some debugging.
Is the content being initialized? Is there a hard fault?
Where does the code go in the "nothing happening" path. Perhaps output telemetry via a USART or SWO/SWV channel
2020-04-06 01:14 PM
>>..This would surprise me, I'm pretty sure the F1 series does not support SDRAM, sure it is not just a Static RAM?
Yes, Sorry, You are right, it is a SRAM (not SDRAM)
>>..The real trick is to be able to read back the content
yes, I checked that through this code:
int main()
{
// some codes
uint8_t static Var8[1000]__attribute__((section(".GUI_RAM")));
uint16_t static Var16[1000]__attribute__((section(".GUI_RAM")));
uint32_t static Var32[1000]__attribute__((section(".GUI_RAM")));
uint8_t Read8[1000];
uint16_t Read16[1000];
uint32_t Read32[1000];
// other codes
for(ii=0;ii<1000;ii++)
{
Var8[ii]=ii;
Var16[ii]=ii;
Var32[ii]=ii;
}
for(ii=0;ii<1000;ii++)
{
Read8[ii] = Var8[ii];
Read16[ii] = Var16[ii];
Read32[ii] = Var32[ii];
}
// break point here
// codes ...
}
I could read back the all content of the Var8,Var16 and Var32. as follows:
>>..Is the content being initialized?
Content of what?
>>.. Is there a hard fault?
No, program continues to execution as normal but nothing displays on the screen
>>..Where does the code go in the "nothing happening" path
program is in the while loop as follows:
I placed break point inside the while(1) to making sure that program is running.
By the way, the same code runs very well with internal RAM.
Thanks
Ali.H