Skip to content

Commit ecd42ca

Browse files
facchinmpennam
authored andcommitted
stm32h7: restore 1200bps functionality by enabling Backup area access
Backup area access is needed to write magic number and reboot in dfu mode Signed-off-by: Martino Facchin <[email protected]>
1 parent 1821cb9 commit ecd42ca

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

loader/fixups.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ SYS_INIT(disable_bootloader_mpu, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAU
3939
SYS_INIT(disable_mpu_rasr_xn, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
4040
#endif
4141

42+
#if defined(CONFIG_SOC_STM32H747XX_M7)
43+
int enable_bkp_access(void)
44+
{
45+
/* Enable access to the backup domain */
46+
// HAL_PWR_EnableBkUpAccess();
47+
SET_BIT(PWR->CR1, PWR_CR1_DBP);
48+
return 0;
49+
}
50+
SYS_INIT(enable_bkp_access, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
51+
#endif
52+
4253
#if defined(CONFIG_BOARD_ARDUINO_GIGA_R1) && defined(CONFIG_VIDEO)
4354
#include <zephyr/kernel.h>
4455
#include <zephyr/device.h>

0 commit comments

Comments
 (0)