[Enhancement] USB CDC Build on DISCO_F072RB

Please post bugs and enhancements for the STM core here
User avatar
ekawahyu
Posts: 107
Joined: Wed Apr 13, 2016 6:17 am

[Enhancement] USB CDC Build on DISCO_F072RB

Post by ekawahyu » Tue Sep 26, 2017 9:38 am

I made some enhancement to enable USB CDC to build on STM32F072RB Discovery. Please review the code, it is in here:

https://github.com/ekawahyu/Arduino_Cor ... sb-cdc-acm

I added USB IRQ Handler as part of hw_config. I hope this is the right place to put it, otherwise please suggest what best to do.

Questions:
  1. Serial.begin(), Serial1.begin(), etc are intended for hardware serial port, what would be the syntax for USB Serial?
  2. Is SoftwareSerial library supported with the latest core? Has anyone tried it?

fpiSTM
Posts: 192
Joined: Fri Sep 16, 2016 12:33 pm
Location: Le Mans, France

Re: [Enhancement] USB CDC Build on DISCO_F072RB

Post by fpiSTM » Tue Sep 26, 2017 1:22 pm

I'm currently working on USB features (not only USB CDC).
https://github.com/stm32duino/Arduino_C ... 32/pull/91

This will not be the correct implementation but I've provided an CDC implementation to wi6labs for this:
https://github.com/stm32duino/Arduino_C ... e0d9eb8f05

When I'm working with Arduino guy they used SerialUSB but I think Serial would be good and more generic. Then for hardware Serial use Serialx when x is the number of the Serial instance (Serial1 == USART1).
I never tried the SoftwareSerial, maybe @wi6labs test it.

User avatar
ekawahyu
Posts: 107
Joined: Wed Apr 13, 2016 6:17 am

Re: [Enhancement] USB CDC Build on DISCO_F072RB

Post by ekawahyu » Tue Sep 26, 2017 5:57 pm

When I was working on the HALMX project, it used Serial instead of SerialUSB. I think we can keep it as Serial. Any other concern?

What is the ETA of this USB changes to become mainstream? Is there anything I can do to help? All I need right now is to merge USBSerial.cpp (I think) to get Serial working?

Good job at making the USB devices selectable from the menu!

fpiSTM
Posts: 192
Joined: Fri Sep 16, 2016 12:33 pm
Location: Le Mans, France

Re: [Enhancement] USB CDC Build on DISCO_F072RB

Post by fpiSTM » Tue Sep 26, 2017 7:06 pm

I'm currently working on USB features as a background task.
During this task I saw several restriction in the core that I'm currently removed.
Name of the instance will be SerialUSB but it will be link to Serial.
Serial will be the generic name to use in the sketch (Hw uart or Serial USB).

User avatar
ekawahyu
Posts: 107
Joined: Wed Apr 13, 2016 6:17 am

Re: [Enhancement] USB CDC Build on DISCO_F072RB

Post by ekawahyu » Fri Sep 29, 2017 9:42 pm

@fpiSTM There is a fundamental difference between USB driver I am adding with the one in the library. Mine is based on the latest v2.0_Cube, and the library you have written is based on the non-Cube USB driver v1.0.2. My question is, do you plan to migrate from this version to V2.0_Cube anytime soon? I am stuck at porting the USBSerial because there are some differences in function call namings. What version would you suggest me to work with?

User avatar
Rick Kimball
Posts: 1014
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: [Enhancement] USB CDC Build on DISCO_F072RB

Post by Rick Kimball » Fri Sep 29, 2017 10:50 pm

You could spend a few dollars and get a nucleo version of the F072 and use the builtin serial port instead of trying to use CDC USB.

http://www.st.com/en/evaluation-tools/n ... 072rb.html
-rick

fpiSTM
Posts: 192
Joined: Fri Sep 16, 2016 12:33 pm
Location: Le Mans, France

Re: [Enhancement] USB CDC Build on DISCO_F072RB

Post by fpiSTM » Sat Sep 30, 2017 4:20 am

@ekawahyu,

I will check this point next week. But in general, I use the latest version. As I've done this first port some month ago, I will probably update it.

User avatar
ekawahyu
Posts: 107
Joined: Wed Apr 13, 2016 6:17 am

Re: [Enhancement] USB CDC Build on DISCO_F072RB

Post by ekawahyu » Sat Sep 30, 2017 8:29 am

fpiSTM wrote:
Sat Sep 30, 2017 4:20 am
@ekawahyu,

I will check this point next week. But in general, I use the latest version. As I've done this first port some month ago, I will probably update it.
Ok, cool! Please keep me updated. Thank you for spending the time looking at it.

User avatar
ekawahyu
Posts: 107
Joined: Wed Apr 13, 2016 6:17 am

Re: [Enhancement] USB CDC Build on DISCO_F072RB

Post by ekawahyu » Sat Sep 30, 2017 8:35 am

Rick Kimball wrote:
Fri Sep 29, 2017 10:50 pm
You could spend a few dollars and get a nucleo version of the F072 and use the builtin serial port instead of trying to use CDC USB.

http://www.st.com/en/evaluation-tools/n ... 072rb.html
Well, I consider doing things for fun and not getting a shortcut just to make it work. Anyway, your GitHub links in this post:

viewtopic.php?f=35&t=113#p837

are all not working, where can I get the source, or whatever you had in those GitHub repos, from? Do you still have it or is it completely vanished from your machine as well?

User avatar
Rick Kimball
Posts: 1014
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: [Enhancement] USB CDC Build on DISCO_F072RB

Post by Rick Kimball » Sat Sep 30, 2017 2:17 pm

ekawahyu wrote:
Sat Sep 30, 2017 8:35 am
Do you still have it or is it completely vanished from your machine as well?
viewtopic.php?f=35&t=113&start=40#p24403
-rick

Post Reply