STM32 USB
Posted: Sat Jun 13, 2020 5:28 pm
I have a custom board with an STM32F401. I can flash micropython with DFU, but cannot connect to the REPL over USB (the computer - a MAC - won't even "see" the USB port).
The wiring of the USB connector could be the problem: only DP (1.5k pullup to 3.3V) and DM are connected (and 5V). ID is NC (and A10 unused), and A9 on the mcu is connected to an LED. Is it possible to communicate with micropython with this setup?
For reference: mpconfigboard.h (8MHz crystal on the board):
Thanks,
Bernhard
The wiring of the USB connector could be the problem: only DP (1.5k pullup to 3.3V) and DM are connected (and 5V). ID is NC (and A10 unused), and A9 on the mcu is connected to an LED. Is it possible to communicate with micropython with this setup?
For reference: mpconfigboard.h (8MHz crystal on the board):
Code: Select all
#define MICROPY_HW_ENABLE_USB (1)
#define MICROPY_HW_HAS_FLASH (1)
// HSE is 8MHz
#define MICROPY_HW_CLK_PLLM (8)
#define MICROPY_HW_CLK_PLLN (336)
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV2)
#define MICROPY_HW_CLK_PLLQ (7)
#define MICROPY_HW_CLK_LAST_FREQ (1)
// LEDs
#define MICROPY_HW_LED1 (pin_A9) // Green LED
#define MICROPY_HW_LED_ON(pin) (mp_hal_pin_high(pin))
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))
// USB config
#define MICROPY_HW_USB_FS (1)
// #define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_A9)
// #define MICROPY_HW_USB_OTG_ID_PIN (pin_A10)
Bernhard