Global variable

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Global variable

541 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by manlong on Thu Jun 12 14:14:32 MST 2014
Hello,

I use LPCXpresso v7.2.0 for LPCXpresso 1549.
I don't understand why when I execute my program with a global varialbe, the program go directly to HardFault_Handler.
The program compile well.
When I comment the use of my global variables but the declaration stay present, the program run well.
When I use global variable, and I want to execute it, the program go directly to HardFault_Handler.
Do you have an explanation, a solution of my issue?

Regards

Man Long
Labels (1)
0 Kudos
4 Replies

529 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Fri Jun 13 02:02:45 MST 2014
Before you post your code, I suggest that you actually try debugging the cause of the problem yourself…

http://www.lpcware.com/content/faq/lpcxpresso/debugging-hard-fault

After doing this, then if you are still stuck, then rather than just posting a code snippet it might be more helpful to export and post an actual project that shows up the problem…

http://www.lpcware.com/content/faq/lpcxpresso/how-importexport-projects

Regards,
LPCXpresso Support
0 Kudos

529 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by manlong on Fri Jun 13 00:45:47 MST 2014
Hi MC,

I will post the code Sunday.
Thank you

Man Long
0 Kudos

529 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Thu Jun 12 18:08:05 MST 2014
Hi Man Long,
Can you please post your code here?
0 Kudos

529 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Pacman on Thu Jun 12 15:05:17 MST 2014
I think it's best only to have one thread regarding this; otherwise, we'll all get confused, when we reply. I suggest this one in the LPC15xx forum.

When you ask questions like this, it is a real good idea to make a minimal test program first, which only consists of main(), the global variable and some LED that is turned on / off.

Before you pose a code example, I'd like to ask you to use the [color=#060][[/color][color=#060]code][/color] and  [color=#060][[/color][color=#060]/code][/color] tags, to format your code snippets. (You can use the '#' button for that, and you can press the eye-button to see a preview of your post, before you click the "Post" button).

0 Kudos