Emwin with LPC1788 gives Hardware Fault when GUI_SetColor(GUI_WHITE) is used

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

  • Emwin with LPC1788 gives Hardware Fault when GUI_SetColor(GUI_WHITE) is used

    Hello,

    I am Raksha. I am using LPC1788 microcontroller with emwin.



    Configuration:

    - 7"LCD (800 X 480) configured for 16bit colour (GUICC_M565), External SDRAM, operating frequency = 108MHz, pclk = 108/2

    - used GUI_MEMDEV_Handle



    Error:

    - When I use GUI_WHITE color, then the microcontroller enters in hard fault error

    - actually whenever I use 8 bit colour value between 0 toff, no error (GUI_BLACK = 0, GUI_RED = 0xff), but when I use any other color value whose value is greater than ff, then hardfault error is observed

    - tried reducing operating clock



    Following is my test code:

    void SeggerLCDTest(void);



    main()

    {

    ....

    MCU_Init();

    ....

    GUI_Init();

    GUI_Clear();

    GUI_SetBkColor(GUI_WHITE); // Error due to this, if I change this to GUI_RED, no error is observed.

    GUI_SetColor(GUI_BLACK);

    GUI_SetFont(&GUI_Font8X16);

    GUI_Clear();

    GUI_DispStringAt("Hello World\n", 0, 0);



    while(1)

    {

    SeggerLCDTest();

    DelayMs(500);



    GUI_Exec();

    }

    }



    void SeggerLCDTest(void)

    {

    static GUI_MEMDEV_Handle hMem = 0;



    if (!hMem )

    {

    hMem = GUI_MEMDEV_Create(0, 0, 800, 480);

    GUI_MEMDEV_Select(hMem);

    }

    GUI_DispDecAt(timer0_cntr, 100, 140, 5); // timer0_cntr is a global variable incremented every 1ms in 1ms isr



    GUI_MEMDEV_Select(hMem);

    GUI_MEMDEV_CopyToLCD(hMem);

    }



    kindly give suggestions on the same.


    Thank you,