diff --git a/variants/arduino_portenta_h7_stm32h747xx_m7/arduino_portenta_h7_stm32h747xx_m7.conf b/variants/arduino_portenta_h7_stm32h747xx_m7/arduino_portenta_h7_stm32h747xx_m7.conf index b0d99951..d8242394 100644 --- a/variants/arduino_portenta_h7_stm32h747xx_m7/arduino_portenta_h7_stm32h747xx_m7.conf +++ b/variants/arduino_portenta_h7_stm32h747xx_m7/arduino_portenta_h7_stm32h747xx_m7.conf @@ -95,3 +95,4 @@ CONFIG_VIDEO_BUFFER_POOL_ALIGN=32 CONFIG_VIDEO_BUFFER_USE_SHARED_MULTI_HEAP=y CONFIG_VIDEO_BUFFER_SMH_ATTRIBUTE=2 CONFIG_FLASH=y +CONFIG_STM32H7_BOOT_M4_AT_INIT=n diff --git a/variants/arduino_portenta_h7_stm32h747xx_m7/variant.cpp b/variants/arduino_portenta_h7_stm32h747xx_m7/variant.cpp index 786c9712..20bde355 100644 --- a/variants/arduino_portenta_h7_stm32h747xx_m7/variant.cpp +++ b/variants/arduino_portenta_h7_stm32h747xx_m7/variant.cpp @@ -1,4 +1,5 @@ #include +#include void _on_1200_bps() { uint32_t tmp = (uint32_t) & (RTC->BKP0R); @@ -6,3 +7,14 @@ void _on_1200_bps() { *(__IO uint32_t *)tmp = (uint32_t)0xDF59; NVIC_SystemReset(); } + +void initVariant(void) { + // check the BLUE LED + /* Set led1 inactive since the Arduino bootloader leaves it active */ + const struct gpio_dt_spec led2 = GPIO_DT_SPEC_GET(DT_ALIAS(led2), gpios); + if (!gpio_is_ready_dt(&led2)) { + return; + } + + gpio_pin_configure_dt(&led2, GPIO_OUTPUT_INACTIVE); +}