LPC1112 , after i use__enable_irq() , always got hardfault with interrupt

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

LPC1112 , after i use__enable_irq() , always got hardfault with interrupt

706 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by waranyoo1 on Wed Jan 19 18:21:30 MST 2011
I try to use IAP in lpc1112, at address 0x2000 , everything write ok, see from memory.I use __disable_irq() ; iap call () ; __enable_irq() but once __enable_irq(); is called , when come to use interrupt it will lead to hardfault.

kindly advise that i've to free or wait something before use __disable_irq() or __enable_irq() ? or any process wrong ?:eek:
0 Kudos
Reply
3 Replies

669 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Sat Jan 22 10:14:47 MST 2011
Information on using your own linker scripts instead of the default LPCXpresso managed linker script mechanism, including some links containing details on writing linker scripts themselves, can be found at:

  http://support.code-red-tech.com/CodeRedWiki/OwnLinkScripts

There are also more details on reserving RAM for the IAP (as mentioned by NXP_USA) at:

http://support.code-red-tech.com/CodeRedWiki/ReserveIAPRam

Regards,
CodeRedSupport
0 Kudos
Reply

669 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by waranyoo1 on Sat Jan 22 09:31:18 MST 2011
I used lpc1112, I solved it, i found the reason because i wrote IAP overlap to my sourccode at 0x2000, why my code come after IAP , it immediately hardfault.:D

Would anybody show example script to protect sector  in link script from lpcxpresso? because i am not familiar script in link script, i try to do but it show my address 0x2000 overlap in ".text":(
0 Kudos
Reply

669 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_USA on Wed Jan 19 18:38:45 MST 2011
There should be no need to wait or free anything after executing IAP. However, IAP makes use of the top 32 bytes of on-chip RAM (see 20.4.8 RAM used by ISP command handler in UM10398). If you plan to use IAP calls you must leave this space free. This can be done in LPCXpresso by changing the Stack Offset setting that appears in the Project / Properties / C/C++ General / Settings / MCU Linker / Target dialog.

I hope this helps resolve your problem!

Thank you,
-NXP
0 Kudos
Reply