Weird inconsistent artifacts on graphics

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

    • Weird inconsistent artifacts on graphics

      Noticed before that fonts and bitmaps/pngs converted to .c, had artifacts. Always assumed it was the tool, but drew some lines programmatically and see the same. Here is the code, and in the attached image you can see that even though drawing is same, the second set of lines have more artifacts. Anyone has any suggestion of what could be causing this?


      C Source Code

      1. static void test(void) {
      2. int i, x1, y1, x2, y2;
      3. GUI_SetColor(GUI_WHITE);
      4. GUI_SetBkColor(GUI_BLACK);
      5. GUI_Clear();
      6. GUI_AA_SetFactor(4);
      7. x1 = 100;
      8. y1 = 50;
      9. for (i = 1; i < 8; i++) {
      10. GUI_SetPenSize(i);
      11. GUI_AA_DrawLine(
      12. x1 + i * 15,
      13. y1,
      14. x1 + i * 15,
      15. y1 + 125);
      16. }
      17. x2 = 130;
      18. y2 = 200;
      19. for (i = 1; i < 8; i++) {
      20. GUI_SetPenSize(i);
      21. GUI_AA_DrawLine(
      22. x2 + i * 15,
      23. y2,
      24. x2 + i * 15,
      25. y2 + 125);
      26. }
      27. }
      Display All
      Images
      • IMG_20200311_165401.jpg

        158.28 kB, 960×1,280, viewed 60 times
    • Hi,

      it looks like there's a cache problem. It is necessary to call SCB_CleanInvalidateDCache() before each DMA operation.

      Attached is a configuration for the STM32F746 board which is similar to your hardware and has therefore a good chance of working as well.

      Best regards,

      Florian
      Files
      • LCDConf.zip

        (21.82 kB, downloaded 26 times, last: )