Porting MDK emWin 532 -> 632: Getting Monochrome only

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

    • Porting MDK emWin 532 -> 632: Getting Monochrome only

      Hi

      I've a simple Hello World project. When I use an old (STemWin) 532 library i get colour yet when I use the (MDK-MW) 632 I am only getting monochrome. This is happening at the "paint" level; When I look at the VRAM I see that only 0xFF / 0x00 are being written to layer memory.

      Code is:

      Source Code

      1. GUI_Init();
      2. WM_SetScreenSize(800, 480);
      3. WM_MULTIBUF_Enable(1);
      4. GUI_EnableAlpha(1);
      5. GUI_SetAlpha(0);
      6. while(1){
      7. GUI_MULTIBUF_Begin();
      8. GUI_Clear();
      9. GUI_SetColor(GUI_ORANGE);
      10. GUI_DispStringAt("hello",x,100);
      11. GUI_SetColor(GUI_BLUE);
      12. GUI_FillRect(0,0,20,20);
      13. GUI_MULTIBUF_End();
      14. x+=10;
      15. if(x > 750){
      16. x = 10;
      17. }
      18. }
      Display All

      From my LTDC driver:
      #define COLOR_CONVERSION_0 GUICC_M4444I
      #define BYTE_PER_PIXEL_0 2
      #define DISPLAY_DRIVER_0 GUIDRV_LIN_16

      DMA2D is enabled (but, as said, none of the problem is at the LTDC/DMA level as the layer memory is showing monochrome only).

      When selecting emWin Core in the MDK RTE I, also, select the Interface Template. I, then, disable the interface template from my compile and use another LTDC driver.

      Am i missing something? My thought (see prior post) is that the MDK emWin lib build may not include GUICC_M4444I but I cannot check this (I cannot find a listing of the build options in the library).

      Thanks
      Mark
    • OK, so here is what I have found:

      1.3.0 is built with #define GUI_USE_ARGB 1, whilst
      1.2.0 is built with #define GUI_USE_ARGB 0

      I did not dig back but suspect earlier libs had 0, too.

      My LTDC driver was not compensating for this but I'd have expected only a color difference, not mono. I have a hunch that this build difference may not include, in the lib, some color_conversions resulting in mono in VRAM?

      Anyway, I'm just posting to close this out.

      Mark