Apologies if this is the wrong forum. What is required to add USB support for a new device? Specific platform is NUCLEO-L432KC.
I looked over the code in the past, but a high level overview of the bringup process from someone who knows what is going on would save me a lot of time.
@sspry
I never had a NUCLEO-L432KC board, but i already tried to adapt another board to Mbed’s current USB stack. Here you can find the assumptions from Mbed-OS in regard of the USBDevice.
You only have to implement the USBPhyHw.h file for your board, everything else marked with blue comes with Mbed-OS core.
Took a quick look on the USBPhy_STM32.cpp file and it contains USBPhyHw::endpoint_table(). That means the new USB stack of Mbed is implemented for the STM boards in general. I also see the USBPhyHW.h in that library… i also assume STM would have already noticed if the implementation was broken.
So next i checked targets.json and it seems USBDEVICE is not defined for this board (around line 3327).
This board inherits from MCU_STM32L432xC that inherits from MCU_STM32L4 that inherits from MCU_STM32, but neither of these declare USBDEVICE feature…
If that is the cause, then adding this mbed_app.json to your project root should solve the issue: