Memory access violation of STemWin

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

    • Memory access violation of STemWin

      Hi all

      We have a strange problem with STemWin and memory access of the library.

      We reserve a memory block of 1024 x 1024 bytes for the library in external SDRAM.
      The start address of the memory block we set in GUI_ALLOC_AssignMemory is 0x60F00000 with a length of 0x100000 resulting in an assigned
      memory block from 0x60F00000 to 0x61000000 - 1.
      If we draw rectangles with GUI_FillRect everything works well. If we try to draw text with GUI_DispStringInRect we get a hard fault.
      The reason of the hard fault is a 'precise data access violation' on address 0x610000bc. This address is out of the defined memory range (188 bytes above the end of the memory).

      Why the library tries to access an address outside the defined memory block? Is this a bug in the library (we are using STemWin540_CM7_GCC.a but also tried the other libs)?

      Thanks a lot for your help

      Regards
      Christoph
    • Hi,

      Are you sure that you don't overwrite some of the GUI memory?

      Maybe a conflict between frame buffer and GUI memory (just a guess).

      Which device are you using?


      Is this a bug in the library (we are using STemWin540_CM7_GCC.a but also tried the other libs)?
      For now we are not aware of any issues with displaying text.

      Regards,
      Sven
    • Hi Sven

      In our system we have two displays with ILI9341 controller and want to controll the 2 displays as one big display.
      So we are using GUIDRV_DIST and adding two FlexColor devices (GUIDRV_FLEXCOLOR_F66709) to it. We don't use frame buffer (only GUI memory).

      If I create two FlexColor devices on separate layers (left display -> layer 0, right display -> layer 1) it seems to work. But because we have to update lots of things periodically on both displays we would like to use one 'Memory Device' covering both displays at once.

      Regards
      Christoph
    • Hi,

      The dist driver should exactly do what you want.

      Here is a snippet from a LCDConf.c used for two UC1611 controller. First the GUIDRV_DIST driver gets created for layer 0. And the two 'real' drivers are getting created for layer -1. Later on they are getting added to the dist driver.

      C Source Code

      1. void LCD_X_Config(void) {
      2. GUI_DEVICE * pDevice;
      3. GUI_RECT Rect0;
      4. GUI_RECT Rect1;
      5. CONFIG_SPAGE Config0 = {0};
      6. CONFIG_SPAGE Config1 = {0};
      7. GUI_DEVICE * pDevice0;
      8. GUI_DEVICE * pDevice1;
      9. GUI_PORT_API PortAPI0 = {0};
      10. GUI_PORT_API PortAPI1 = {0};
      11. //
      12. // Set display driver and color conversion for 1st layer
      13. //
      14. pDevice = GUI_DEVICE_CreateAndLink(GUIDRV_DIST, COLOR_CONVERSION, 0, 0);
      15. //
      16. // Display size configuration
      17. //
      18. if (LCD_GetSwapXY()) {
      19. LCD_SetSizeEx (0, YSIZE_PHYS, XSIZE_PHYS);
      20. LCD_SetVSizeEx(0, VYSIZE_PHYS, VXSIZE_PHYS);
      21. } else {
      22. LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS);
      23. LCD_SetVSizeEx(0, VXSIZE_PHYS, VYSIZE_PHYS);
      24. }
      25. //
      26. // Create first driver
      27. //
      28. pDevice0 = GUI_DEVICE_Create(DISPLAY_DRIVER, COLOR_CONVERSION, 0, -1);
      29. //
      30. // Configuration first driver
      31. //
      32. Config0.FirstSEG = 0;//256 - 224;
      33. GUIDRV_SPage_Config(pDevice0, &Config0);
      34. //
      35. // Configure hardware routines of first driver
      36. //
      37. PortAPI0.pfWrite8_A0 = LCD_X_8080_8_Write00;
      38. PortAPI0.pfWrite8_A1 = LCD_X_8080_8_Write01;
      39. PortAPI0.pfWriteM8_A0 = LCD_X_8080_8_WriteM00;
      40. PortAPI0.pfWriteM8_A1 = LCD_X_8080_8_WriteM01;
      41. PortAPI0.pfRead8_A0 = LCD_X_8080_8_Read00;
      42. PortAPI0.pfRead8_A1 = LCD_X_8080_8_Read01;
      43. PortAPI0.pfReadM8_A0 = LCD_X_8080_8_ReadM00;
      44. PortAPI0.pfReadM8_A1 = LCD_X_8080_8_ReadM01;
      45. GUIDRV_SPage_SetBus8(pDevice0, &PortAPI0);
      46. //
      47. // Controller configuration first driver
      48. //
      49. GUIDRV_SPage_SetUC1611(pDevice0);
      50. //
      51. // Create second driver
      52. //
      53. pDevice1 = GUI_DEVICE_Create(DISPLAY_DRIVER, COLOR_CONVERSION, 0, -1);
      54. //
      55. // Configuration second driver
      56. //
      57. Config1.FirstSEG = 256 - 224;
      58. GUIDRV_SPage_Config(pDevice1, &Config1);
      59. //
      60. // Configure hardware routines of second driver
      61. //
      62. PortAPI1.pfWrite8_A0 = LCD_X_8080_8_Write10;
      63. PortAPI1.pfWrite8_A1 = LCD_X_8080_8_Write11;
      64. PortAPI1.pfWriteM8_A0 = LCD_X_8080_8_WriteM10;
      65. PortAPI1.pfWriteM8_A1 = LCD_X_8080_8_WriteM11;
      66. PortAPI1.pfRead8_A0 = LCD_X_8080_8_Read10;
      67. PortAPI1.pfRead8_A1 = LCD_X_8080_8_Read11;
      68. PortAPI1.pfReadM8_A0 = LCD_X_8080_8_ReadM10;
      69. PortAPI1.pfReadM8_A1 = LCD_X_8080_8_ReadM11;
      70. GUIDRV_SPage_SetBus8(pDevice1, &PortAPI1);
      71. //
      72. // Controller configuration second driver
      73. //
      74. GUIDRV_SPage_SetUC1611(pDevice1);
      75. //
      76. // Add drivers to distribution driver
      77. //
      78. Rect0.x0 = 0;
      79. Rect0.y0 = 160;
      80. Rect0.x1 = 223;
      81. Rect0.y1 = 319;
      82. GUIDRV_Dist_AddDriver(pDevice, pDevice0, &Rect0);
      83. Rect1.x0 = 0;
      84. Rect1.y0 = 0;
      85. Rect1.x1 = 223;
      86. Rect1.y1 = 159;
      87. GUIDRV_Dist_AddDriver(pDevice, pDevice1, &Rect1);
      88. }
      Display All
      This was made for the GUIDRV_SPAGE driver but should work also with the GUIDRV_FlexColor driver.

      EDIT:
      Once set up the two displays are getting handled as one big screen.

      Regards,
      Sven