Sunday, February 25th 2018, 6:22pm UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

reza_elc87

Beginner

Date of registration: Aug 8th 2015

Posts: 5

1

Saturday, August 22nd 2015, 12:56pm

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

FBerkel

Beginner

Date of registration: Feb 13th 2008

Posts: 4

2

Monday, August 24th 2015, 10:30am

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...

Date of registration: May 26th 2009

Posts: 1,022

3

Monday, August 24th 2015, 10:42am

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/C++ Source code

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

Best regards,
Adrian

reza_elc87

Beginner

Date of registration: Aug 8th 2015

Posts: 5

4

Saturday, August 29th 2015, 12:58pm

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
reza_elc87 has attached the following image:
  • The error.PNG

reza_elc87

Beginner

Date of registration: Aug 8th 2015

Posts: 5

5

Saturday, August 29th 2015, 1:25pm

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
reza_elc87 has attached the following images:
  • Error 2.PNG
  • Hard fault.PNG

Date of registration: May 26th 2009

Posts: 1,022

6

Monday, August 31st 2015, 3:55pm

Closed, since this problem is dealt with in the thread below:

http://forum.segger.com/index.php?page=Thread&threadID=2568

- Adrian