cancel
Showing results for 
Search instead for 
Did you mean: 

STemWin on external SRAM

Ahaji.1
Associate II

Hello everyone

Has anybody ever been successful in configuring STemWin library for external SRAM with STM32 MCUs?

(I struggling with this for a couple of months)​

6 REPLIES 6

Are you using GNU based tools?

Have you thoroughly validated your external memory initialization, functionality, startup code and Linker script?​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
berendi
Principal
  1. Check that all necessary clocks are stable at their intended frequency. Verify them directly on the LCD and SDRAM clock pins and the system clock on MCO.
  2. Check SDRAM read/write access over the whole framebuffer address range.
  3. Check that direct memory writes to the framebuffer produce a visible pattern on the display.
  4. Copy LCDConf_Lin_Template.c into your project
  5. Adjust XSIZE_PHYS and YSIZE_PHYS
  6. #define DISPLAY_DRIVER (&GUIDRV_Lin_xx_API) where xx is the number of bits per pixel in your LDTC layer settings.
  7. Set #define VRAM_ADDR to the address of the framebuffer.

This should get basic operations going.

>>..Are you using GNU based tools?

I'm using STM32CubeIDE.

>>..Have you thoroughly validated your external memory initialization, functionality

Yes, I'm pretty sure that is working correctly. I can write any data (with different sizes and width) and read it back.

>>.. startup code 

Should I modify the startup file?

>>.. and Linker script?

I have updated linker script so that linker place the GUI memory into the external SRAM.

  1. >>..Check that all necessary clocks are stable at their intended frequency. Verify them directly on the LCD and SDRAM clock pins and the system clock on MCO.
  2. Check SDRAM read/write access over the whole framebuffer address range.

I think if I can write to the entire addresses of the SRAM and read it back correctly, this two conditions are met. Am I right?

>>..3. Check that direct memory writes to the framebuffer produce a visible pattern on the display.

I do not know how to do this and I'm not using frambuffer. Currently I have wrote few code that it display a increasing progress bar. It works in the internal RAM very well but it fails when GUI memory is placed in the external memory.

Generally you'll need to modify the startup code to handle the initialization of external memory properly via the load regions you've described in the linker script. The SDRAM will need to be brought up early enough to allow the statics to be unpacked there.

You'll also probably want to manage the stack/heap so they can exist in two different memory regions, and fix the _sbrk() allocator to allow for that.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Do you have any example project for such a configuration, in any IDE?