mynewt-core icon indicating copy to clipboard operation
mynewt-core copied to clipboard

Add NVIC_DisableAll and Cortex_DisableAll functions

Open kasjer opened this issue 4 months ago • 0 comments

Function NVIC_DisableAll() disable all interrupts on NVIC controller. Cortex_DisableAll() disables all NVIC interrupts and stops SytTick that also can generate interrupt.

Call to Cortex_DisableAll() is added to all hal_bsp_deinit() functions that are executed before control is passed from the bootloader ot the application.

In some cases hal_bsp_deinit was added.

hal_system_init() was added to platforms that did not have this function. Now hal_system_init() calls NVIC_Relocate() (previously NVIC_Relocate was often called from SystemInit() that is usually provided by MCU manufacturer. So mynewt had copies of those files with local modifications that made it harder to maintain in case of upgrade.

Same prototypes

void NVIC_Relocate(void);
void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
uint32_t NVIC_GetVector(IRQn_Type IRQn);

were placed in many headers and now are put in just one.

NXP MK8xF now uses common startup code with auto-generated linker script like ST and Nordic chips.

Signed-off-by: Jerzy Kasenberg [email protected]

kasjer avatar Oct 04 '24 12:10 kasjer