Help with USB on stm32l432
Posted: Wed Jan 27, 2021 1:45 pm
Hi all,
I have a custom device, based on Nucleo-L432KC. No external crystals. I use PlatformIO for development, stm32duino framework. Also, I know USB is working on the board, when I reset the board with Boot0=High, the device is successfully registered in Win10. Also, I can download code with st-link, and blinking the LED's is working fine.
If however my code runs, Win10 shows an invalid USB device, I cannot read the device descriptors. Have tried anything I can in the platformio.ini file, but ran out of ideas. Any help is highly appreciated!
I do not have an original Nucleo board to check if the code is working there. I wonder if the internal USB clocks are setup correctly, unfortunately I do not know how I could check.
Here my file:
I have a custom device, based on Nucleo-L432KC. No external crystals. I use PlatformIO for development, stm32duino framework. Also, I know USB is working on the board, when I reset the board with Boot0=High, the device is successfully registered in Win10. Also, I can download code with st-link, and blinking the LED's is working fine.
If however my code runs, Win10 shows an invalid USB device, I cannot read the device descriptors. Have tried anything I can in the platformio.ini file, but ran out of ideas. Any help is highly appreciated!
I do not have an original Nucleo board to check if the code is working there. I wonder if the internal USB clocks are setup correctly, unfortunately I do not know how I could check.
Here my file:
Code: Select all
[env:genericSTM32L432]
platform = ststm32
board = nucleo_l432kc
framework = arduino
upload_protocol = stlink
build_flags =
-D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC
-D USBCON
;-D USBD_VID=0x0483
;-D USBD_PID=0x5740
;-D USB_MANUFACTURER="unknown"
;-D USB_PRODUCT="\"Test"\"
;-D HAL_PCD_MODULE_ENABLED
;-Os
lib_deps =
bblanchon/ArduinoJson @ ^6.17.2
sandeepmistry/LoRa @ ^0.8.0
rweather/Crypto @ ^0.2.0