CDC & F10x

BennehBoy
Mon Jan 14, 2019 3:54 pm
I only just realised that PR388 for CDC won’t work on the F103C8 based boards, Maple Mini, & Bluepill.

Does CDC have to be emulated in software for these due to the lack of OTG? Or have I completely misunderstood – I was unable to get the a MM to enumerate as anything after flashing with a minimal flash/SerialUSB sketch. (with USB CDC FS enabled)


fpiSTM
Mon Jan 14, 2019 4:06 pm
BluePill is working on my side.
I didn’t test MapleMini.
Even if there is no USB OTG, basic USB is enabled.
I’ve also test on Nucleo STM32F103RB using a dedicated shield to have USB connector and updating clock config to have 48KHz clock.

Rick Kimball
Mon Jan 14, 2019 4:14 pm
[fpiSTM – Mon Jan 14, 2019 4:06 pm] –
I’ve also test on Nucleo STM32F103RB using a dedicated shield to have USB connector and updating clock config to have 48KHz clock.

Is that something ST sells or something you made yourself?


fpiSTM
Mon Jan 14, 2019 4:37 pm
Made internally by our hardware team for test purposes. But yes it should be fine to propose one for sell. :roll:

BennehBoy
Mon Jan 14, 2019 4:37 pm
I also just checked a BP and can’t get SerialUSB (or anything to show over USB)

Here’s the code:

// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
SerialUSB.begin(57600);
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
SerialUSB.println("On");
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
SerialUSB.println("Off");
delay(1000); // wait for a second
}


fpiSTM
Mon Jan 14, 2019 4:40 pm
I’ve tested MapleMini, by default this not work.
MM required to handle DISC pin (PB9).
Adding this I’m able to have SerialUSB up and running on Windows and Linux and Mac

pinMode(PB9, OUTPUT);
digitalWrite(PB9,0);


fpiSTM
Mon Jan 14, 2019 4:47 pm
Did you manage to disconnect-reconnect after flash ?
Reenumerate is currently not managed.

BennehBoy
Mon Jan 14, 2019 5:00 pm
Yes I reconnected.

BennehBoy
Mon Jan 14, 2019 5:07 pm
OK, MM working with the pin initialisation for PB9

About to restest BP


BennehBoy
Mon Jan 14, 2019 5:10 pm
BP still non functional (this device does have the required 1.5k pullup).

fpiSTM
Mon Jan 14, 2019 5:12 pm
Nice, I will handle this properly.
Check if this is not linked to a previous installed driver for the BP.

BennehBoy
Mon Jan 14, 2019 5:17 pm
I uninstalled all 134f & 0483 devices & replugged – no change, nothing enumerated, no windows bing bong – I’ll try on linux also.

BennehBoy
Mon Jan 14, 2019 5:19 pm
No device detected by linux.

BennehBoy
Mon Jan 14, 2019 5:32 pm
Idiot moment….

The micro USB cable I was using was power only :oops: :oops: :oops:

Working fine.


BennehBoy
Mon Jan 14, 2019 5:33 pm
Still, we have a working MM now :D

fpiSTM
Mon Jan 14, 2019 5:39 pm
Ouf :lol:

Rick Kimball
Mon Jan 14, 2019 5:55 pm
Nice!

Success! wrote:
Jan 14 12:53:09 kimballr kernel: [2167879.967862] usb 1-3.4: Product: BLUEPILL_F103C8 CDC in FS Mode
Jan 14 12:53:09 kimballr kernel: [2167879.967864] usb 1-3.4: Manufacturer: STMicroelectronics
Jan 14 12:53:09 kimballr kernel: [2167879.967867] usb 1-3.4: SerialNumber: 8D8623685251
Jan 14 12:53:09 kimballr kernel: [2167879.968726] cdc_acm 1-3.4:1.0: ttyACM1: USB ACM device


Rick Kimball
Mon Jan 14, 2019 6:39 pm
isConnected is failing ..

/tmp/arduino_cache_730592/core/core_8decc66340a600b90f98384814ca6329.a(USBSerial.cpp.o): In function `USBSerial::isConnected()’:
USBSerial.cpp:(.text._ZN9USBSerial11isConnectedEv+0xc): undefined reference to `device_connection_status’
collect2: error: ld returned 1 exit status
exit status 1

Looks like this hasn’t been finished yet.

Is the CDC supposed to be ready or are we still mucking about?


fpiSTM
Mon Jan 14, 2019 7:03 pm
It is not fully ended. Still some enhancement and features to do.
What is achieved now is to have a “generic” implementation for HID composite (keyboard and mouse) and CDC for basic USB, OTG FS or HS. No more needs to have specific files for USB in the variant.
Tested for F0/1/2/3/4/7 and L0/1/4. Only H7 is not functionnal at this time.
Next step are:

  • Remove timer usage
    Serial definition. How to manage? If USB then Serial == SerialUSB ? (Any comments on this are welcome)
    reenumerate()
    ReadBytes()
    custom VID/PID ans string?
    Disc pin management
    Isconnected

Leave a Reply

Your email address will not be published. Required fields are marked *