A way to make emWin use an external SDRAM instead of internal RAM

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

    • A way to make emWin use an external SDRAM instead of internal RAM

      Hi,

      I'm using a library version of emWin, but I would like to ask if there is a way/option to make emWin use an external SDRAM instead of internal RAM.
      For the application part, I think I can use compiler/linker options (#pragma or something).

      Thanks in advance.

      Best Regards,
      Rowel
    • Hi,

      You have to link the "GUI-memory" into the SDRAM. How this is done depends our your linker.


      emWin will allocate memory only from the block set with GUI_ALLOC_AssignMemory().


      Here is an example from a GUIConf.c which does it.


      C Source Code

      1. #include "GUI.h"
      2. /*********************************************************************
      3. *
      4. * Defines
      5. *
      6. **********************************************************************
      7. */
      8. //
      9. // Define the available number of bytes available for the GUI
      10. //
      11. #define GUI_NUMBYTES (1024 * 1024 * 4)
      12. #if (defined __ICCARM__) // IAR
      13. static __no_init U32 aMemory[GUI_NUMBYTES / 4] @ "GUI_RAM";
      14. #elif (defined __SES_ARM) // SES
      15. static U32 aMemory[GUI_NUMBYTES / 4] __attribute__ ((section (".GUI_RAM")));
      16. #else
      17. static U32 aMemory[GUI_NUMBYTES / 4];
      18. #endif
      19. /*********************************************************************
      20. *
      21. * Static code
      22. *
      23. **********************************************************************
      24. */
      25. /*********************************************************************
      26. *
      27. * Public code
      28. *
      29. **********************************************************************
      30. */
      31. /*********************************************************************
      32. *
      33. * GUI_X_Config
      34. *
      35. * Purpose:
      36. * Called during the initialization process in order to set up the
      37. * available memory for the GUI.
      38. */
      39. void GUI_X_Config(void) {
      40. //
      41. // Assign memory to emWin
      42. //
      43. GUI_ALLOC_AssignMemory(aMemory, GUI_NUMBYTES);
      44. }
      Display All

      If you are using the GUIDRV_Lin driver you might also want to link the frame buffer to the external memory. This is most likely done the same way as with the "GUI-memory".

      Regards
      Sven
      Please read the forum rules before posting.

      Keep in mind, this is *not* a support forum.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/

      Or you can contact us via e-mail.