I have an issue connecting the Bluepill stm32 board via USB to my linux box. I would like to use it as a USB_CDC device.
The device gets recognized:
Apr 07 08:29:27 ferrero kernel: usb 8-1: new full-speed USB device number 26 using uhci_hcd
Apr 07 08:29:27 ferrero kernel: usb 8-1: New USB device found, idVendor=1eaf, idProduct=0004, bcdDevice= 0.00
Apr 07 08:29:27 ferrero kernel: usb 8-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Apr 07 08:29:27 ferrero kernel: usb 8-1: Product: BLUEPILL_F103C8_128K CDC in FS Mode
Apr 07 08:29:27 ferrero kernel: usb 8-1: Manufacturer: Unknown
Apr 07 08:29:27 ferrero kernel: usb 8-1: SerialNumber: 6D9144804953
Apr 07 08:29:27 ferrero kernel: cdc_acm 8-1:1.0: ttyACM0: USB ACM device
Apr 07 08:29:27 ferrero mtp-probe[13925]: checking bus 8, device 26: "/sys/devices/pci0000:00/0000:00:1d.2/usb8/8-1"
Apr 07 08:29:27 ferrero mtp-probe[13925]: bus: 8, device: 26 was not an MTP device
Apr 07 08:29:28 ferrero mtp-probe[13956]: checking bus 8, device 26: "/sys/devices/pci0000:00/0000:00:1d.2/usb8/8-1"
The device /dev/ttyACM0 is created but I cannot use it. It says I/O error:
[j0b314:/dev]$ minicom -b 9600 -D /dev/ttyACM0
minicom: Fehler beim Öffnen der Datei »/dev/ttyACM0«: Eingabe-/Ausgabefehler
The platformio.ini is configured this way:
[env:bluepill_f103c8_128k]
platform = ststm32
board = bluepill_f103c8_128k
framework = arduino
debug_tool = jlink
upload_protocol = jlink
build_flags = -D USBCON
-D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC
-D HAL_PCD_MODULE_ENABLED
-D USBD_VID=0x1EAF
-D USBD_PID=0x0004
-D USB_PRODUCT=\"bluepill\"
The main.c looks like this:
#include <Arduino.h>
void setup() {
// initialize LED digital pin as an output.
pinMode(LED_BUILTIN, OUTPUT);
// Enable USB Serial
SerialUSB.begin();
}
void loop() {
// turn the LED on (HIGH is the voltage level)
digitalWrite(LED_BUILTIN, HIGH);
// wait for a second
delay(1500);
SerialUSB.write("Hello from USB\r\n");
// turn the LED off by making the voltage LOW
digitalWrite(LED_BUILTIN, LOW);
// wait for a second
delay(1500);
}
Nothing changes if I exchange “SerialUSB” with “Serial”. The led flashing works as expected.
I don’t understand why the kernel says “bus: 8, device 26 was not an MTP device”
Does someone had this issue already?
Thanks