Software reset of NXP LPC2294 ARM7TDMI system from code

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

Software reset of NXP LPC2294 ARM7TDMI system from code

328 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ihatetoregister on Mon Oct 12 02:47:31 MST 2015
Is it possible to perform a software reset of the processor. ? My question closely resembles Is it possible to reset NXP LPC2100 microcontroller from code [ http://electronics.stackexchange.com/questions/3419/is-it-possible-to-reset-nxp-lpc2100-microcontrol... ]  . However none of the possible answers in the thread work for me.

My requirement is that once my program finishes i want to do a software reset of the system( Since it is not feasible to always walk upto the embedded device and press the RESET button. ) . Ideally would like the reset to be immediate. Here is what i have tried so far :

Approach 1:

// Cause an immediate reset by loading a incorrect value to the WDFEED register   
void stop_feed_watchdog (void) {                  
      //WDFEED = 0xAA;                        
      WDFEED = 0x00; 
    }


// My task that does the processing of some data
__task void my_task(void)
    {
            WDTC  = 0x2000;                        /* Set watchdog time out value     */
            WDMOD = 0x03;                            /* Enable watchdog timer and reset */

            while(1)
            {

                    // Initiate my code
                    processdata();

                    // Wait for 4 clock ticks.
                    os_dly_wait(4);

                   // Problem : The system does not get reset 
                   stop_feed_watchdog();


          }

Approach 2 :

// Declare a function reset in main
    void (*reset)(void);   
    reset = 0x00000000;

    __task void my_task(void)
        {

                while(1)
                {

                        // Initiate the communication infra
                        processdata();

                        // Wait for 4 clock ticks.
                        os_dly_wait(4);

                        // Problem : This seems to not cause a RESET but i get a ABORT
                        reset();

              }

    }
Does anyone know how to do this for NXP LPC2292/4 processors which are AMR7TDMI compliant ?
Labels (1)
0 Kudos
0 Replies