stm32wl5_pwr: add support to boot second CPU (cortex-m0)

Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
This commit is contained in:
Michał Łyszczek 2022-08-03 12:24:26 +02:00 committed by Xiang Xiao
parent 74f1bfbfd7
commit cc08ae67cb
2 changed files with 26 additions and 0 deletions

View File

@ -29,6 +29,7 @@
#include <stdbool.h>
#include <errno.h>
#include "hardware/stm32wl5_pwr.h"
#include "arm_internal.h"
#include "stm32wl5_pwr.h"
#include "stm32wl5_rcc.h"
@ -106,3 +107,17 @@ bool stm32wl5_pwr_enablebkp(bool writable)
return waswritable;
}
/****************************************************************************
* Name: stm32wl5_pwr_boot_c2
*
* Description:
* Boots up CPU2 (cortex-m0) after reset or wakeup from stop or standby
* modes.
*
****************************************************************************/
void stm32wl5_pwr_boot_c2(void)
{
modifyreg32(STM32WL5_PWR_CR4, 0, PWR_CR4_C2BOOT);
}

View File

@ -68,6 +68,17 @@ extern "C"
bool stm32wl5_pwr_enablebkp(bool writable);
/****************************************************************************
* Name: stm32wl5_pwr_boot_c2
*
* Description:
* Boots up CPU2 (cortex-m0) after reset or wakeup from stop or standby
* modes.
*
****************************************************************************/
void stm32wl5_pwr_boot_c2(void);
#undef EXTERN
#if defined(__cplusplus)
}