AnsweredAssumed Answered

How to reset LPC43xx from application

Question asked by hp eric on Dec 28, 2019
Latest reply on Jan 1, 2020 by jeremyzhou

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..

Attachments

Outcomes