File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #include "py/mphal.h"
2+
3+ void NUCLEO_F767ZI_board_early_init (void ) {
4+ // Turn off the USB switch
5+ #define USB_PowerSwitchOn pin_G6
6+ mp_hal_pin_output (USB_PowerSwitchOn );
7+ mp_hal_pin_low (USB_PowerSwitchOn );
8+ }
Original file line number Diff line number Diff line change 1313#define MICROPY_HW_ENABLE_DAC (1)
1414#define MICROPY_HW_ENABLE_USB (1)
1515
16+ #define MICROPY_BOARD_EARLY_INIT NUCLEO_F767ZI_board_early_init
17+ void NUCLEO_F767ZI_board_early_init (void );
18+
1619// HSE is 25MHz
1720// VCOClock = HSE * PLLN / PLLM = 25 MHz * 432 / 25 = 432 MHz
1821// SYSCLK = VCOClock / PLLP = 432 MHz / 2 = 216 MHz
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ USB_VBUS,PA9
5858USB_ID , PA10
5959USB_DM , PA11
6060USB_DP , PA12
61+ USB_POWER , PG6
6162VCP_TX , PD8
6263VCP_RX , PD9
6364UART2_TX , PD5
Original file line number Diff line number Diff line change 1- #include STM32_HAL_H
1+ #include "py/mphal.h"
22
33void NUCLEO_H743ZI_board_early_init (void ) {
4- GPIO_InitTypeDef GPIO_InitStructure ;
5-
6- __HAL_RCC_GPIOG_CLK_ENABLE ();
7-
84 // Turn off the USB switch
9- GPIO_InitStructure .Pin = GPIO_PIN_6 ;
10- GPIO_InitStructure .Mode = GPIO_MODE_OUTPUT_PP ;
11- GPIO_InitStructure .Pull = GPIO_PULLDOWN ;
12- GPIO_InitStructure .Speed = GPIO_SPEED_FREQ_LOW ;
13- HAL_GPIO_Init (GPIOG , & GPIO_InitStructure );
14- HAL_GPIO_WritePin (GPIOG , GPIO_PIN_6 , GPIO_PIN_RESET );
5+ #define USB_PowerSwitchOn pin_G6
6+ mp_hal_pin_output (USB_PowerSwitchOn );
7+ mp_hal_pin_low (USB_PowerSwitchOn );
158}
You can’t perform that action at this time.
0 commit comments