Problem with running STemWin on STM32F103ZET from external SRAM

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Problem with running STemWin on STM32F103ZET from external SRAM

      Hi everyone
      I'm using STM32F103ZET to run STemWin532 GUI. In the first step i configured everything for running from internal RAM and program worked fine and GUI displayed components like progress bar and ...., but when i changed linker command file to map GUI memory to external SRAM GUI did not work. I checked connection with SRAM and it was OK. I checked 8,16,32 bit memory accessing integrity by following code:

      C Source Code: main.c

      1. main()
      2. {
      3. // initial codes
      4. uint8_t static Var8[1000]__attribute__((section(".GUI_RAM")));//.GUI_RAM section is
      5. uint16_t static Var16[1000]__attribute__((section(".GUI_RAM")));//located at external SRAM
      6. uint32_t static Var32[1000]__attribute__((section(".GUI_RAM")));
      7. uint8_t Read8[1000];
      8. uint16_t Read16[1000];
      9. uint32_t Read32[1000];
      10. for(ii=0;ii<1000;ii++)
      11. {
      12. Var8[ii]=ii;
      13. Var16[ii]=ii;
      14. Var32[ii]=ii;
      15. }
      16. for(ii=0;ii<1000;ii++)
      17. {
      18. Read8[ii] = Var8[ii];
      19. Read16[ii] = Var16[ii];
      20. Read32[ii] = Var32[ii];
      21. }
      22. // other codes
      23. }
      Display All
      We can write to External SRAM and read it back successfully.

      I attached the STM32CubeIDE Build Analyzer Tool output for memory usage.

      In this case (External SRAM) program runs 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. Program then execute the following codes in the while(1) loop and screen remains black.

      C Source Code: main.c

      1. GUI_Init();
      2. PROGBAR_Handle Progbar0;
      3. Progbar0 = PROGBAR_Create(20, 80, 360, 80, WM_CF_SHOW);
      4. PROGBAR_SetFont(Progbar0, &GUI_Font20B_ASCII);
      5. int val=0;
      6. while (1)
      7. {
      8. GUI_Delay(50);
      9. if(val++>100) val = 0;
      10. PROGBAR_SetValue(Progbar0, val);
      11. }
      Display All


      I placed break point inside the while(1) to making sure that program is running.(Second attached file)

      Thanks
      Haia.B
      Images
      • 1.PNG

        13.75 kB, 790×201, viewed 529 times
      • 2.PNG

        16.06 kB, 650×296, viewed 520 times