B Default_Handler

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

B Default_Handler

3,418 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dariush_abbasi868 on Mon Sep 14 00:49:17 MST 2015
Hi, every body
I am using an application but sometimes it goes to B Default_Handler and watchdog would restart it.
How I can find out the reason of this problem.
I want to know the last code before going to B Default_Handler .
Labels (1)
0 Kudos
Reply
9 Replies

3,272 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dariush_abbasi868 on Sun Sep 20 03:14:41 MST 2015

Quote: LabRat
https://www.lpcware.com/content/faq/lpcxpresso/debugging-hard-fault



As I mentioned  my application without boot loader is working well , But when I used my secondary boot loader I have this problem , and I am using IAR  Workbench and I think I have some problem in STACK or HEAP only ,
what about RAM?
I 's wondering if my boot loader's RAM or STACK has relation to my application's RAM or STACK?


By the way I read that link but I am not sure what I have to do to fix my problem !

I increased default Heap and Stack as I can but I have problem yet !

also in that case I found out SP(R13)=0x10004030  and LR(R14)=0x1576f 



0 Kudos
Reply

3,272 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Wed Sep 16 00:31:12 MST 2015
https://www.lpcware.com/content/faq/lpcxpresso/debugging-hard-fault
0 Kudos
Reply

3,272 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dariush_abbasi868 on Tue Sep 15 23:50:09 MST 2015
Hi again
I 've just found it .
It is HardFault_Handler  that I don't know why it is happening ?
How I can fix it ?
0 Kudos
Reply

3,271 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dariush_abbasi868 on Tue Sep 15 20:53:54 MST 2015

Quote: mc
Hi,
Yes NVIC->IABR[0...7]. Put the break point inside default handler interrupt subroutine and when execution stops at this breakpoint check the value of all register bits.
If a particular bit is set, it means interrupt represented by that bit is active.
Please use below call
NVIC_GetActive(IRQn_Type IRQn);



Hi and thanks for your kindly reply

would you please help me how I can do that ?
default handler  is in cstartup.c file and I cannot add any breakpoint in it .!
sorry maybe I am make a sily mistake but if you can please help me .

At the attachment picture I tried to show NVIC s at that position , what do you think of it ?

0 Kudos
Reply

3,271 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Tue Sep 15 11:01:00 MST 2015
Hi,
Yes NVIC->IABR[0...7]. Put the break point inside default handler interrupt subroutine and when execution stops at this breakpoint check the value of all register bits.
If a particular bit is set, it means interrupt represented by that bit is active.
Please use below call
NVIC_GetActive(IRQn_Type IRQn);
0 Kudos
Reply

3,271 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dariush_abbasi868 on Tue Sep 15 04:40:18 MST 2015

Quote: mc
Hi dariush,
Please check IABR register to find the active interrupt. From this you will find the active interrupt and see why it is active



Hi
you mean NVIC->IABR[0...7]    
I checked it and all of them are 0!

Besides I checked NVIC->ISER[0..7] and I saw that only the first 8 bit of it is 0xae that seems Ok because I active only timers 0 ,1,2 and also uasrt2 ,0 .


Am I right?




0 Kudos
Reply

3,271 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Mon Sep 14 06:56:48 MST 2015
Hi dariush,
Please check IABR register to find the active interrupt. From this you will find the active interrupt and see why it is active
0 Kudos
Reply

3,271 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dariush_abbasi868 on Mon Sep 14 05:25:17 MST 2015
Actually I have a project that when I use it alone it works very well .
But I made a secondary boot loader for it and my project is an application runs after that .
In that case sometimes I see B Default handler .
I don't know why it happened while interrupt source and handler are the same .
I am sure that nothing in about interrupt or handler is added to project.

0 Kudos
Reply

3,271 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Mon Sep 14 02:00:08 MST 2015
Sounds like you have possibly activated an interrupt source in your application without providing a specific interrupt handler for it - or misspelt the name of the handler in your sources compared to the name specified in the vector table in your startup code..

https://www.lpcware.com/content/faq/lpcxpresso/startup-code-interrupt-handlers

Regards,
LPCXpresso Support
0 Kudos
Reply