Can't draw JPEG file

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

  • Can't draw JPEG file

    Hi,

    It has HardFault error in Cortex M3 when drawing JPEG file with emWin.
    I used Bin2C to convert JPEG file to C file.

    Code:

    void jpegTest(void)

    {
    GUI_JPEG_INFO Info;

    GUI_JPEG_GetInfo((unsigned char *)actestJpeg, sizeof(actestJpeg), &Info);
    GUI_GotoXY(0, 0);
    GUI_DispDec(Info.XSize, 3);
    GUI_GotoXY(0, 20);
    GUI_DispDec(Info.YSize, 3);
    GUI_Clear();
    GUI_JPEG_Draw(actestJpeg, sizeof(actestJpeg), 0, 0);
    }

    The resolution of JPEG file is 176x220 and it can display 176 & 220 on screen.
    The MCU hangs up in HardFault_Handler when calling GUI_JPEG_Draw().
    I defined 64KB RAM for GUI, it should enough for 176x220 JPEG image.

    //
    // Define the available number of bytes available for the GUI
    //
    #define GUI_NUMBYTES 0x10000
    //
    // Define the average block size
    //
    #define GUI_BLOCKSIZE 0x80

    Best regards,
    KML