Found another USB device example for the Nucleo-F042K6 board…however…
It complains about “mbed.h” not being found…which are included in the USB device library files…
removing the include statement then causes many types to be unknown, like Null, uint8_t and so on…
Is this platform not supported anymore in current mbed os?
At least I could choose this platform when selecting a board…
The NUCLEO-F042K6 seems to be supported in current Mbed OS 5 and also in the coming Mbed OS 6. You can check it in the mbed-os/targets/targets.json file. However, there is no:
"device_has_add": [
...
"USBDEVICE",
...
],
entry for the NUCLEO_F042K6 target. That means there in no USB driver available for it yet in the Mbed OS.
the autor made that in august 2018 so you would need an older version of the MbedOS, probably 5.8 or stay on the Mbed2. If it still possible to compile it and if it ever worked.
BTW I not see the F042 target in the master branch of MbedOS project on github.