2 years, 8 months ago.

Compile error when importing USBKeyboard.h


I've been trying to make my ST-Nucleo-F303K8 into a HID keyboard. This seems like an incredibly easy task thanks to mbed! I've been following https://os.mbed.com/handbook/USBKeyboard and https://www.hackerspace-ntnu.no/wiki/tutorials/mbed/mbed-keyboard-en/ - my entire main.cpp is:


#include "mbed.h"
#include "USBKeyboard.h"

USBKeyboard keyboard;

int main(void) {

    while (1) {

Problem is, it seems whenever I link against the USBDevice library I get


Error: Identifier "PCD_HandleTypeDef" is undefined in "USBDevice/USBDevice/USBHAL.h", Line: 134, Col: 6

It seems something is missing in the USBDevice library? Do I need to include something else too?


1 Answer

2 years, 8 months ago.

Hi Max,

Please see my answer on your question here: https://stackoverflow.com/questions/52828259/mbed-compiling-with-usbdevice-library-results-in-error

Please let me know if you have any questions!

- Jenny, team Mbed

If this solved your question, please make sure to click the "Thanks" link below!

Accepted Answer