How to reset LPC43xx from application

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

How to reset LPC43xx from application

922 Views
hperic
Contributor I

How to reset LPC43xx from application

In my project ,I need to reset cpu from application.

First  I start a Project  in  MDK5 IDE.

void Reset_Handler(){
SystemInit();
__main();
}
void main(){
NVIC_SystemReset();
}

In this Program,  CPU can be reset ,but cpu will crash in systemInit fuction.

LPC_CGU->BASE_M4_CLK = (0x01 << 11) | /* Autoblock En */
(CLK_SRC_IRC << 24) ; /* Set clock source */


LPC_CGU->XTAL_OSC_CTRL = (0 << 0) | /* Enable oscillator-pad */
      (0 << 1) | /* Operation with crystal connected */
      (0 << 2) ; /* Low-frequency mode */

Then ,I modify Program like below, 

#define RESET_CTRL0                  *  (int*) 0x40053100

void main(){
    RESET_CTRL0 =1;

    RESET_CTRL0 =0;
}

this time, the prog failed to restart again ,and the cpu can not be proram anymore.

I need your help..

Labels (3)
0 Kudos
1 Reply

812 Views
jeremyzhou
NXP Employee
NXP Employee

Thank you for your interest in NXP Semiconductor products and
for the opportunity to serve you.
I've inserted the NVIC_SystemReset(); in the demo of the LPCOpen library, After running the demo project, I find that the MCU is available to be reset periodically
Below demonstrates I inserted the NVIC_SystemReset(); in the watchdog demo project.

pastedImage_1.png

Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos