From 1cd2bc066de7cfec778631d99fe64d29b093ba80 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 4 Jul 2019 11:03:10 +1000 Subject: [PATCH] stm32/boards/PYBD_SFx: Configure EN_3V3 pin as output on boot. But leave it turned off, the application must turn it on if/when needed. --- ports/stm32/boards/PYBD_SF2/board_init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/stm32/boards/PYBD_SF2/board_init.c b/ports/stm32/boards/PYBD_SF2/board_init.c index 8438b82317..a8cf10f3a5 100644 --- a/ports/stm32/boards/PYBD_SF2/board_init.c +++ b/ports/stm32/boards/PYBD_SF2/board_init.c @@ -33,6 +33,9 @@ void mboot_board_early_init(void) { } void board_early_init(void) { + // Configure EN_3V3 as an output pin, but keep it turned off + mp_hal_pin_config(pyb_pin_EN_3V3, MP_HAL_PIN_MODE_OUTPUT, MP_HAL_PIN_PULL_NONE, 0); + // Explicitly init SPI2 because it's not enabled as a block device spi_bdev_ioctl(&spi_bdev2, BDEV_IOCTL_INIT, (uint32_t)&spiflash2_config); }