Open ThomasHulme opened 4 years ago
I have the same problem, so I think this is a bug.
I have the "PIO_FRAMEWORK_ARDUINO_ENABLE_HID" in the build flags.
As you can see in the docs this is a configuration for the STM32Duino core. But you have defined genericSTM32F103C8
as the board
in the platformio.ini
, so it will use
the maple core (framework-arduinoststm32-maple
) and not STM32Duino core.
Then you also cross-mix libraries for STM32Duino into this build with the lib_extra_dirs
command, which doesn't look healthy.
So which exact core do you want to use?
I tried it also with bluepill_f103c8
as board, which uses stm32
as core and there the error also occurs.
My platformio.ini:
[env:bluepill_f103c8]
platform = ststm32
board = bluepill_f103c8
framework = arduino
build_flags = -D PIO_FRAMEWORK_ARDUINO_ENABLE_HID
The framework needs additional configuration, see
By using additional flags listed in https://community.platformio.org/t/difficulty-with-getting-usb-serial-usb-cdc-working/7501/6?u=maxgerhardt I can get an example to compile.
[env:bluepill_f103c8]
platform = ststm32
board = bluepill_f103c8
framework = arduino
build_flags =
-D PIO_FRAMEWORK_ARDUINO_ENABLE_HID
-D USBCON
-D USBD_VID=0x0483
-D USB_MANUFACTURER="Unknown"
-D USB_PRODUCT="\"BLUEPILL_F103C8\""
-D HAL_PCD_MODULE_ENABLED
#include <Arduino.h>
#include <Keyboard.h>
void setup() {
Serial.begin(9600);
Keyboard.begin();
}
void loop() {
Keyboard.write((uint8_t)'A');
Serial.println("Loop");
delay(500);
}
I'm trying to setup an STM32 Bluepill as a USB keyboard. In the Arduino IDE the settings in Tools are:
In platformio.ini the settings I have are:
However I get the error:
error "USB HID not enabled! Select 'HID' in the 'Tools->USB interface' menu."
I have the "PIO_FRAMEWORK_ARDUINO_ENABLE_HID" in the build flags.
Is there anything I'm missing??