AnsweredAssumed Answered

LPC845: resetting M0+ Core and Peripherals

Question asked by René Kniest on Aug 1, 2018
Latest reply on Aug 6, 2018 by René Kniest

MicroController: LPC845

Subject: Resetting peripherals and Core to jump from BootLoader to Application


When jumping from BootLoader to Application I'd like to get rid of all history

(e.g. clock settings, inits of peripherals, pending interrupts) by

1. setting VTOR to 0x2000, as follows:

    *((volatile uint32_t*) 0xE000ED08) = 0x00002000;

2. resetting all peripherals and the Cortex-M0+ Core


With the sequence 

*((volatile uint32_t*) 0xE000ED08) = 0x00002000;


in combination with calling function SYS_ResetAllPeripherals (see below),

immediately after reset, this goal is not achieved

(and it's hard to debug this low level stuff, going through reset).

I would appreciate any advise on this matter.


// -----------------------------------------------------------------------------
// Function : SYS_ResetAllPeripherals()
// Comment  : Reset all peripherals (which can be reset by
//                     means of PRESETCTRL0 and PRESETCTRL1)
//                     except the Flash Controller
// Params   :
//   Input  : -
//   Output : -
// Return   : -
// -----------------------------------------------------------------------------
void SYS_ResetAllPeripherals(void)
 // Activate reset of all peripherals
    LPC_SYSCON->PRESETCTRL0 = 0x0402001F;
    // Deactivate peripheral reset