Command Reset

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Command Reset

3,438件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by marcossmart on Fri Jun 29 07:45:11 MST 2012
[SIZE=5]What is the command that reset the processor? I can use within the HardFault_Handler? [/SIZE]
[SIZE=5]LPCXpresso LPC1114.[/SIZE]
0 件の賞賛
返信
10 返答(返信)

3,247件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by frame on Sun Jul 01 08:38:55 MST 2012
I consider it a bad idea to just do a reset upon a Hardfault.

The hardfault occured because of a specific problem, probably because of a bug. With a reset and a subsequent restart, you are hardly changing any of the conditions leading to the hardfault.
In short, you will probably create an endless reset cycle.

I would rather investigate the reason for the hardfault. Better check the system register contents for possible reasons, and use the debugger.

The basic idea for the endless loop in the hardfault handler (and other handlers) is to prevent damage by erraneous code. This might not make much of a difference for a hobbyist device, but certainly for a mass product. A customer complaining about "device is not working" is still better than one telling "device destroyed that much of my property".

I would rather see it as a help, and not try to circumvent it.
0 件の賞賛
返信

3,247件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by marcossmart on Sun Jul 01 07:14:21 MST 2012
ok, thanks.
0 件の賞賛
返信

3,247件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by atomicdog on Sat Jun 30 16:25:41 MST 2012

Quote: marcossmart
Excuse me!

This is correct?

#include "core_cm0.h"
__attribute__ ((section(".after_vectors")))
void HardFault_Handler(void)
{
NVIC_SystemReset();
}


Are you trying to modify [I]cr_startup_lpc11.c[/I] ?
You don't need to to that. You also don't need to include [I]core_cm0.h[/I] since it's already include through [I]LPC11xx.h
[/I]
Just add the function in your main.c file.

void HardFault_Handler(void)
{
  NVIC_SystemReset();
}
0 件の賞賛
返信

3,247件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by researchinnovation on Fri Jun 29 23:32:12 MST 2012

Quote: marcossmart
[SIZE=5]What is the command that reset the processor? I can use within the HardFault_Handler? [/SIZE]
[SIZE=5]LPCXpresso LPC1114.[/SIZE]


Hi...!!!

Please check your function's calling sequence and due to improper use of pointer also you can get this error.
Just check what are you passing in functions.
Do step by step debug and check the value of your function's pointer then you may get an idea about it.
Sometime loop(while,for(;;)) creates this problem.
Read the page56/57 "LPCXpresso_BaseBoard_rev_B_Users_Guide.pdf" but it is not about the command.
http://knowledgebase.nxp.com/showthread.php?t=3248
http://knowledgebase.nxp.trimm.net/showthread.php?t=3028
http://support.code-red-tech.com/CodeRedWiki/CodeRedFAQ
http://support.code-red-tech.com/CodeRedWiki/DebugHardFault
http://ics.nxp.com/support/documents/microcontrollers/?scope=LPC3000









Thanks & Regards.....:)
0 件の賞賛
返信

3,247件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by marcossmart on Fri Jun 29 15:49:59 MST 2012
When I do the include file # include "core_cm0.h" generates the following errors:



D:\MRR\ARM\FIRMWARE\ABA_PRO7P_V4\CMSISv2p00_LPC11xx\inc/core_cm0.h:451:47: error: expected ')' before 'IRQn'
D:\MRR\ARM\FIRMWARE\ABA_PRO7P_V4\CMSISv2p00_LPC11xx\inc/core_cm0.h:464:48: error: expected ')' before 'IRQn'
D:\MRR\ARM\FIRMWARE\ABA_PRO7P_V4\CMSISv2p00_LPC11xx\inc/core_cm0.h:479:55: error: expected ')' before 'IRQn'
D:\MRR\ARM\FIRMWARE\ABA_PRO7P_V4\CMSISv2p00_LPC11xx\inc/core_cm0.h:492:51: error: expected ')' before 'IRQn'
D:\MRR\ARM\FIRMWARE\ABA_PRO7P_V4\CMSISv2p00_LPC11xx\inc/core_cm0.h:505:53: error: expected ')' before 'IRQn'
D:\MRR\ARM\FIRMWARE\ABA_PRO7P_V4\CMSISv2p00_LPC11xx\inc/core_cm0.h:522:49: error: expected ')' before 'IRQn'
D:\MRR\ARM\FIRMWARE\ABA_PRO7P_V4\CMSISv2p00_LPC11xx\inc/core_cm0.h:545:53: error: expected ')' before 'IRQn'
D:\MRR\ARM\FIRMWARE\ABA_PRO7P_V4\CMSISv2p00_LPC11xx\inc/core_cm0.h: In function 'SysTick_Config':
D:\MRR\ARM\FIRMWARE\ABA_PRO7P_V4\CMSISv2p00_LPC11xx\inc/core_cm0.h:595:3: warning: implicit declaration of function 'NVIC_SetPriority'
D:\MRR\ARM\FIRMWARE\ABA_PRO7P_V4\CMSISv2p00_LPC11xx\inc/core_cm0.h:595:21: error: 'SysTick_IRQn' undeclared (first use in this function)
D:\MRR\ARM\FIRMWARE\ABA_PRO7P_V4\CMSISv2p00_LPC11xx\inc/core_cm0.h:595:21: note: each undeclared identifier is reported only once for each function it appears in
D:\MRR\ARM\FIRMWARE\ABA_PRO7P_V4\CMSISv2p00_LPC11xx\inc/core_cm0.h:595:39: error: '__NVIC_PRIO_BITS' undeclared (first use in this function)
make: *** [src/cr_startup_lpc11.o] Error 1
0 件の賞賛
返信

3,247件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by FlySnake on Fri Jun 29 14:47:30 MST 2012

Quote: marcossmart
Excuse me!

This is correct?

#include "core_cm0.h"
__attribute__ ((section(".after_vectors")))
void HardFault_Handler(void)
{
NVIC_SystemReset();
}



Yes, but it's very rough solution. You'll never get the cause of HardFault.
0 件の賞賛
返信

3,247件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by marcossmart on Fri Jun 29 12:04:01 MST 2012
?
0 件の賞賛
返信

3,247件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by marcossmart on Fri Jun 29 08:56:33 MST 2012
Excuse me!

This is correct?

#include "core_cm0.h"
__attribute__ ((section(".after_vectors")))
void HardFault_Handler(void)
{
NVIC_SystemReset();
}
0 件の賞賛
返信

3,247件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by marcossmart on Fri Jun 29 08:48:31 MST 2012
This is correct?

#include "core_cm0.h"
__attribute__ ((section(".after_vectors")))
void HardFault_Handler(void)
{
    while(1)
    {
    NVIC_SystemReset();
    }
}
0 件の賞賛
返信

3,247件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri Jun 29 07:58:46 MST 2012
Do you know what a hard fault is :confused:

See : http://support.code-red-tech.com/CodeRedWiki/DebugHardFault

To reset there's a CMSIS function NVIC_SystemReset() included in core_cm0.h ;)
0 件の賞賛
返信