MEMDEV Issue..

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

    • MEMDEV Issue..

      Hi All,

      Recently, i have testing memory device Because of the flickering.

      I've attached my application test code below.

      My hardware is stm32f767IGT6 with SDRAM using FMC.

      I have two png file to display in 320x240 LCD.

      Because of the flickering, I'd like to use MEMDEV or MULTIBUF.

      First i tried to use Multi Buf. but it's not works with hardfault So, i'm trying to use MEMDEV.

      The test code has 2 images.

      In MainTask,

      If the "test" is true, the smile guy is displayed properly.

      but "test" is false, sysytem crush, with hardfault()

      Of course if not using MEMDEV, displayed properly.

      void MainTask(void)
      {
      GUI_MEMDEV_Handle hMem = GUI_MEMDEV_Create(0, 0, 320, 240);

      GUI_MEMDEV_Select(hMem);

      GUI_Clear();
      if(test)
      {
      GUI_PNG_Draw(_acBitmap_50x50, sizeof(_acPNG), 0, 0);
      }
      else
      {
      GUI_PNG_Draw(background, sizeof(background), 0, 0);
      }
      }
      GUI_MEMDEV_CopyToLCD(hMem);

      while (1)
      {
      GUI_Delay(100);
      }
      }

      What am i doing wrong?
      Files
      • question.zip

        (117.04 kB, downloaded 46 times, last: )

      The post was edited 1 time, last by swan3708 ().

    • Hi,

      first of all, you should make sure that GUI_Init() has been called at the beginning of your program.

      Then, after your drawing operations in a memory device are finished, you have to deselect the memory device by calling GUI_MEMDEV_Select(0).

      If the above steps did not help you, you should make sure that you have enough memory for the PNG images and the memory device.

      Best regards,
      Florian
    • Hi,

      Check out the manual for the memory requirements to draw PNGs:
      segger.com/doc/UM03001_emWin.html#id_000799

      Here is a description on how much memory a memory device requires:
      segger.com/doc/UM03001_emWin.html#Memory_requirements


      I doubt that 400KB are sufficient memory. You might want to try out other formats than PNG instead. You could use the Bitmap Converter to generate a DTA file from the PNG. Drawing a DTA doesn't need that much memory. Also the Bitmap Converter offers different options to keep the image file small.

      Just take a look here for a detailed description about the possibilities of the Bitmap Converter:
      segger.com/doc/UM03001_emWin.html#Bitmap_Converter

      Regards,
      Sven