SerialUSB doesn't work on Maple Mini and Bootloader2.0

Post here all questions related to STM32 core if you can't find a relevant section!
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: SerialUSB doesn't work on Maple Mini

Post by fpiSTM »

Great :)
Ralf9
Posts: 33
Joined: Sat Jan 11, 2020 7:21 pm
Answers: 1
Location: Germany, BaWü

Re: SerialUSB doesn't work on Maple Mini

Post by Ralf9 »

Happy too early.
It doses not work after a reset or power off.
It works only after upload. I use the Bootloader 2.0

Code: Select all

fu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Opening DFU capable USB device...
ID 1eaf:0003
Run-time device DFU version 0110
Claiming USB DFU Interface...
Setting Alternate Setting #2 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 0110
Device returned transfer size 1024
Copying data from PC to DFU device
Download        [=========================] 100%        18796 bytes
Download done.
state(8) = dfuMANIFEST-WAIT-RESET, status(0) = No error condition is present
Done!
Resetting USB to switch back to runtime mode
Waiting for /dev/ttyACM0 serial...Done
# ls -l /dev/serial/by-id
insgesamt 0
lrwxrwxrwx 1 root root 13 20. Jan 18:15 usb-STMicroelectronics_MAPLEMINI_F103CB_CDC_in_FS_Mode_8D7452895051-if00 -> ../../ttyACM0
after a reset:

Code: Select all

# ls -l /dev/serial/by-id
ls: Zugriff auf '/dev/serial/by-id' nicht möglich: Datei oder Verzeichnis nicht gefunden
Ralf9
Posts: 33
Joined: Sat Jan 11, 2020 7:21 pm
Answers: 1
Location: Germany, BaWü

Re: SerialUSB doesn't work on Maple Mini

Post by Ralf9 »

gdenton61 wrote: Wed Jan 22, 2020 11:45 pm I'm seeing something similar with the 1.8.0 core on Ubuntu, after uploading a sketch the board never shows back up as /dev/ttyACM0, so I cannot open the Serial Monitor.
To upload the sketch again I have to hit RESET right after selecting Upload.

I can then switch to Roger's core, upload a sketch using the above method and the board magically shows back up as /dev/ttyACM0, and works fine after that.

I thought the STM core worked before I updated to the latest release.
Ralf9
Posts: 33
Joined: Sat Jan 11, 2020 7:21 pm
Answers: 1
Location: Germany, BaWü

Re: SerialUSB doesn't work on Maple Mini

Post by Ralf9 »

should I be here for that open a issue?
https://github.com/stm32duino/Arduino_Core_STM32/issues
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: SerialUSB doesn't work on Maple Mini

Post by fpiSTM »

Honestly, I'm not able to reproduce your issue.
I will made some other try.
I see last week, that the bootloader have a regression and Roger made a patch.
So it could be fine to test it.
Ralf9
Posts: 33
Joined: Sat Jan 11, 2020 7:21 pm
Answers: 1
Location: Germany, BaWü

Re: SerialUSB doesn't work on Maple Mini

Post by Ralf9 »

it is not clear to me what this has to do with the bootloader.
I have testet it with the same bootloader on rogers core, it also works after a reset or plug off and on.
Ralf9
Posts: 33
Joined: Sat Jan 11, 2020 7:21 pm
Answers: 1
Location: Germany, BaWü

Re: SerialUSB doesn't work on Maple Mini

Post by Ralf9 »

I use this sketch:

Code: Select all

int8_t led = 0;
#define csPin  7
#define csPin2  31

void setup() {
   pinMode(csPin, OUTPUT);
   pinMode(csPin2, OUTPUT);
   digitalWrite(csPin, HIGH);
   digitalWrite(csPin2, HIGH);
   Serial.begin(115200);
   pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  if(Serial.available()) {
    char c = Serial.read();
    Serial.print("hello ");
    Serial.print(c);
    Serial.println();
  }
  led = ~ led & 1;
  digitalWrite(LED_BUILTIN, led);
  delay(100);
}
At SPI1 and SPI2 I have connected a CC1101 an a LAN Modul. can this matter?
fredbox
Posts: 125
Joined: Thu Dec 19, 2019 3:05 am
Answers: 2

Re: SerialUSB doesn't work on Maple Mini

Post by fredbox »

You can simplify the led line to

Code: Select all

led = 1 - led;
If led is 0 then 1 - led = 1.
If led is 1 then 1 - led = 0.
Ralf9
Posts: 33
Joined: Sat Jan 11, 2020 7:21 pm
Answers: 1
Location: Germany, BaWü

Re: SerialUSB doesn't work on Maple Mini

Post by Ralf9 »

with this /dev/serial/by-id the SerialUSB works also after a reset or power off:
usb-LeafLabs_Maple-if00

Code: Select all

Setting Alternate Setting #2 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 0110
Device returned transfer size 1024
Copying data from PC to DFU device
Download        [=========================] 100%        16268 bytes
Download done.
state(8) = dfuMANIFEST-WAIT-RESET, status(0) = No error condition is present
Done!
Resetting USB to switch back to runtime mode
Waiting for /dev/ttyACM0 serial...Done
# ls -l /dev/serial/by-id
insgesamt 0
lrwxrwxrwx 1 root root 13  2. Feb 23:11 usb-LeafLabs_Maple-if00 -> ../../ttyACM0
With this /dev/serial/by-id the SerialUSB don't works after a reset or power off:
usb-STMicroelectronics_MAPLEMINI_F103CB_CDC_in_FS_Mode_8D7452895051-if00

Code: Select all

Setting Alternate Setting #2 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 0110
Device returned transfer size 1024
Copying data from PC to DFU device
Download        [=========================] 100%        19880 bytes
Download done.
state(8) = dfuMANIFEST-WAIT-RESET, status(0) = No error condition is present
Done!
Resetting USB to switch back to runtime mode
Waiting for /dev/ttyACM0 serial...Done
# ls -l /dev/serial/by-id
insgesamt 0
lrwxrwxrwx 1 root root 13  2. Feb 20:10 usb-STMicroelectronics_MAPLEMINI_F103CB_CDC_in_FS_Mode_8D7452895051-if00 -> ../../ttyACM0
After a reset there is no /dev/serial/by-id

Code: Select all

# ls -l /dev/serial/by-id
ls: Zugriff auf '/dev/serial/by-id' nicht möglich: Datei oder Verzeichnis nicht gefunden
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: SerialUSB doesn't work on Maple Mini

Post by fpiSTM »

Hnestly, I don't know why this not work.
Maybe an issue with the reenumeration.
You can try to change the USBD_ENUM_DELAY value which is set to 10 ms by default.
Post Reply

Return to “General discussion”