57#if USE_HARD_FAULT_RECOVERY
59#if defined(STM32F4XX) || defined (STM32F7XX)
60#define BCKP_SECTION ".ram5"
61#define IN_BCKP_SECTION(var) var __attribute__ ((section(BCKP_SECTION), aligned(8)))
62#elif defined(STM32H7XX)
63#define BCKP_SECTION ".ram7"
64#define IN_BCKP_SECTION(var) var __attribute__ ((section(BCKP_SECTION), aligned(8)))
66#error "No backup ram available"
108#if defined(STM32F4XX)
109#define __PWR_BACKUP_REG PWR->CSR
110#define __PWR_BACKUP_ENABLE PWR_CSR_BRE
111#define __PWR_BACKUP_READY PWR_CSR_BRR
112#define __RCC_RESET_REGISTER RCC->CSR
113#define __RCC_RESET_FLAG RCC_CSR_SFTRSTF
114#define __RCC_RESET_REMOVE_FLAG RCC_CSR_RMVF
115#elif defined(STM32F7XX)
116#define __PWR_BACKUP_REG PWR->CSR1
117#define __PWR_BACKUP_ENABLE PWR_CSR1_BRE
118#define __PWR_BACKUP_READY PWR_CSR1_BRR
119#define __RCC_RESET_REGISTER RCC->CSR
120#define __RCC_RESET_FLAG RCC_CSR_SFTRSTF
121#define __RCC_RESET_REMOVE_FLAG RCC_CSR_RMVF
122#elif defined(STM32H7XX)
123#define __PWR_BACKUP_REG PWR->CR2
124#define __PWR_BACKUP_ENABLE PWR_CR2_BREN
125#define __PWR_BACKUP_READY PWR_CR2_BRRDY
126#define __RCC_RESET_REGISTER RCC->RSR
127#define __RCC_RESET_FLAG RCC_RSR_SFTRSTF
128#define __RCC_RESET_REMOVE_FLAG RCC_RSR_RMVF
130#error Hard fault recovery not supported
148#if defined(USE_RTC_BACKUP)
167#if defined(STM32H7XX)
171#if USE_HARD_FAULT_RECOVERY
173#if defined(STM32F4XX) || defined(STM32F7XX)
214#if defined(USE_RTC_BACKUP)
232#if defined(ENERGY_SAVE_INPUTS)
237#if defined(ENERGY_SAVE_LOWS)
254#if defined(STM32F4XX)
259#elif defined(STM32F7XX)
264#elif defined(STM32H7XX)
286#if defined(USE_RTC_BACKUP)
307 dr[0] = (
val) & 0xFFFF;
309#elif defined(STM32G4)
319#if defined(STM32H7XX)
#define BOARD_GROUP_DECLFOREACH(line, group)
rtc_boot_magic
RTC backup register values.
@ RTC_BOOT_FAST
No timeout in bootloader.
@ RTC_BOOT_OFF
Normal boot.
@ RTC_BOOT_CANBL
CAN bootloader, ORd with 8 bit local node ID.
@ RTC_BOOT_HOLD
Hold in bootloader, do not boot application.
@ RTC_BOOT_FWOK
indicates FW ran for 30s
static void mcu_deep_sleep(void)
Put MCU into deep sleep mode.
void mcu_arch_init(void)
Initialize the specific archittecture functions.
#define ENERGY_SAVE_INPUTS
void mcu_reboot(enum reboot_state_t reboot_state)
Reboot the MCU.
reboot_state_t
The requested reboot states.
void mcu_energy_save(void)
Save energy for performing operations on shutdown Used for example to shutdown SD-card logging.
@ MCU_REBOOT_BOOTLOADER
Go to bootloader.
@ MCU_REBOOT_POWEROFF
Poweroff the device.
@ MCU_REBOOT_FAST
Fast reboot (skip bootloader)
Arch independent mcu ( Micro Controller Unit ) utilities.
Specific RAM section for DMA usage on F7.
static void __enable_irq(void)
static void __disable_irq(void)
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.