Skip to content

Commit 72e78b3

Browse files
committed
stm32h7: restore 1200bps functionality by enabling Backup area access
1 parent 9f5410b commit 72e78b3

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

cores/arduino/USB.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ void arduino::SerialUSB_::usbd_next_cb(struct usbd_context *const ctx, const str
5656
if (msg->type == USBD_MSG_CDC_ACM_LINE_CODING) {
5757
uint32_t baudrate;
5858
uart_line_ctrl_get(Serial.uart, UART_LINE_CTRL_BAUD_RATE, &baudrate);
59+
printf("Baud rate changed to %d\n", baudrate);
5960
Serial._baudChangeHandler(nullptr, baudrate);
6061
}
6162
}

loader/fixups.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ 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+
void 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+
}
49+
SYS_INIT(enable_bkp_access, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
50+
#endif
51+
4252
#if defined(CONFIG_BOARD_ARDUINO_GIGA_R1) && defined(CONFIG_VIDEO)
4353
#include <zephyr/kernel.h>
4454
#include <zephyr/device.h>

variants/arduino_giga_r1_stm32h747xx_m7/arduino_giga_r1_stm32h747xx_m7.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,5 @@ CONFIG_BT_HCI_DRIVER_LOG_LEVEL_DBG=y
6868
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
6969
CONFIG_BT_RX_STACK_SIZE=4096
7070
CONFIG_BT_HCI_TX_STACK_SIZE=4096
71+
72+
CONFIG_RTC=y

variants/arduino_giga_r1_stm32h747xx_m7/arduino_giga_r1_stm32h747xx_m7.overlay

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,11 @@
333333
};
334334
};
335335

336+
&rtc {
337+
clocks = <&rcc STM32_CLOCK_BUS_APB4 0x00010000>,
338+
<&rcc STM32_SRC_LSE RTC_SEL(1)>;
339+
status = "okay";
340+
};
336341

337342
&flash0 {
338343
partitions {

0 commit comments

Comments
 (0)