LPC1788 Hard Fault after GUI_X_Init

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

  • LPC1788 Hard Fault after GUI_X_Init

    Dear friends,


    I am having problems using emWin library on LPC1788. I executed the code and set a break-point on GUI_X_Init. The code reaches this point which implies that RAM works fine and the function LCD_X_Config is executed successfully. However after this point a hard fault condition occurs.
    Can you tell me where the execution goes after GUI_X_Init so that I can track the flow of the program and find what might be causing hard fault?
    Or do you have any idea what the problem might be?


    Best regards
  • Hi,

    you wrote: "However after this point a hard fault condition occurs"

    Where exactly does the problem occur? What exactly causes the hard fault? You can find it out by checking the LR-register within the hard fault handler or by returning from there with a "BX LR"

    Regards...
  • Hello,

    Please check if you have sufficient stack. In case you have, please verify the following CPU registers in order to determine the cause of the HardFault Handler:

    C Source Code

    1. <previous> <-- SP points here before exception
    2. SP + 0x1C xPSR
    3. SP + 0x18 PC
    4. SP + 0x14 LR
    5. SP + 0x10 R12
    6. SP + 0x0C R3
    7. SP + 0x08 R2
    8. SP + 0x04 R1
    9. SP + 0x00 R0 <-- SP points here after exception

    Best regards,
    Adrian
  • Dear Adrian,


    Thanks a lot for your answers.
    As per your suggestion I took an screenshot from the assembly part that causes the problem. Please refer to the attached picture for more information.


    Yours sincerely
    Images
    • The error.PNG

      171.41 kB, 1,599×840, viewed 790 times
  • Dear Adrian,



    After the execution of the code, suddenly the line of code I posted previously is executed successfully. However the hard fault condition occurs in another line of code. I have attached the screenshots of where hard-fault occurs and the hard-fault itself.


    Regards
    Images
    • Error 2.PNG

      160.59 kB, 1,599×839, viewed 728 times
    • Hard fault.PNG

      118.25 kB, 1,599×839, viewed 729 times