How can I learn more about GUI memory

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

    • How can I learn more about GUI memory

      Hello everyone
      where can I find more detail about aMemory array ( the following code):

      C Source Code: GUIConfig.c

      1. GUI_ALLOC_AssignMemory(aMemory, GUI_NUMBYTES);
      Detail about how and where the screen pixels information located in the aMemory array.

      I have some problem when I use external SRAM as GUI memroy in STM32F407. It's look like that the image within LCD has been shifting upward in the SRAM mode.

      Thanks in advance

      The post was edited 2 times, last by Haia_Boosa ().

    • Hi,

      It depends on the LCD driver you are using where the pixel data is stored.

      If you are using the GUIDRV_Lin driver the data is stored within the framebuffer which gets not allocated from "aMemory". The framebuffer typically gets allocated within the LCDConf.c and is not done by emWin.

      If you are using another driver, e.g. the GUIDRV_FlexColor driver, a buffer of one line gets allocated from "aMemory". In case you are using the GUIDRV_FlexColor driver with a cache enabled a complete screen gets allocated. Unfortunately, you don't have direct access to this buffer.

      Which driver are you using?

      You also want to double check your SRAM settings.

      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.
    • Hi Sven
      Thanks for replying
      The configuration is as follows:

      C Source Code: LCDConf.c

      1. #include "GUI.h"
      2. #include "GUIDRV_FlexColor.h"
      3. #ifndef WIN32
      4. #include "ILI9341.h"
      5. #endif
      6. #define XSIZE_PHYS 240
      7. #define YSIZE_PHYS 320
      8. //
      9. // Color conversion
      10. //
      11. #define COLOR_CONVERSION GUICC_565
      12. //
      13. // Display driver
      14. //
      15. #define DISPLAY_DRIVER GUIDRV_FLEXCOLOR
      16. /*********************************************************************
      17. *
      18. * Configuration checking
      19. *
      20. **********************************************************************
      21. */
      22. #ifndef VXSIZE_PHYS
      23. #define VXSIZE_PHYS XSIZE_PHYS
      24. #endif
      25. #ifndef VYSIZE_PHYS
      26. #define VYSIZE_PHYS YSIZE_PHYS
      27. #endif
      28. #ifndef WIN32
      29. static void LCD_X_8080_16_WriteM01_16(U16 * pData, int NumItems) {
      30. //RS_HIGH;
      31. while (NumItems--) {
      32. LCD->LCD_RAM = *pData;
      33. pData++;
      34. }
      35. }
      36. static void LCD_X_8080_16_ReadM01_16(U16 * pData, int NumItems) {
      37. while (NumItems--) {
      38. *pData = LCD->LCD_RAM;
      39. pData++;
      40. }
      41. }
      42. #endif
      43. #ifndef WIN32
      44. static void _InitController(void)
      45. {
      46. TFT_Init();
      47. }
      48. #endif
      49. void LCD_X_Config(void) {
      50. GUI_DEVICE * pDevice;
      51. CONFIG_FLEXCOLOR Config = {0};
      52. GUI_PORT_API PortAPI = {0};
      53. //
      54. // Set display driver and color conversion
      55. //
      56. pDevice = GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 0, 0);
      57. //
      58. // Display driver configuration, required for Lin-driver
      59. //
      60. LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS);
      61. LCD_SetVSizeEx (0, VXSIZE_PHYS, VYSIZE_PHYS);
      62. //
      63. // Orientation
      64. //
      65. Config.Orientation = GUI_SWAP_XY | GUI_MIRROR_Y;
      66. GUIDRV_FlexColor_Config(pDevice, &Config);
      67. //
      68. // Set controller and operation mode
      69. //
      70. #ifndef WIN32
      71. PortAPI.pfWrite16_A0 = LCD_WR_REG;
      72. PortAPI.pfWrite16_A1 = LCD_WR_DATA;
      73. PortAPI.pfWriteM16_A1 = LCD_X_8080_16_WriteM01_16;
      74. PortAPI.pfReadM16_A1 = LCD_X_8080_16_ReadM01_16;
      75. GUIDRV_FlexColor_SetFunc(pDevice, &PortAPI, GUIDRV_FLEXCOLOR_F66709, GUIDRV_FLEXCOLOR_M16C0B16);
      76. #endif
      77. }
      Display All
      Target is STM32F407 and LCD driver is ILI9341.
      SRAM settings is verified by writing and reading back from 8,16 and 32 bit defined variable in the SRAM address range.

      Best regard.
    • Hi,

      Your configuration file looks good so far.

      You might want to try another read function. Please refer to the API description of GUIDRV_FlexColor_SetReadFunc66709_B16() in the emWin user manual.

      You should also check your write functions. It can be possible that the LCD controller expects the data in another order.

      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.