Open USB stack port (& examples)

464 views
Skip to first unread message

Seb H

unread,
Feb 2, 2018, 7:27:24 PM2/2/18
to tomu discussion list
If anyone's interested in making wierd & wonderful USB applications, I've ported the libopencm3 USB stack.

My libopencm3 fork for efm32hg (tomu) is here: https://github.com/schnommus/libopencm3 (branch: efm32hg)

I've also copied & updated a bunch of example applications, which you can get here: https://github.com/schnommus/libopencm3-examples (branch: efm32hg)

You'll find the examples at: examples/efm32/efm32hg/tomu-efm32hg309 in the above repository

These are the ones I've already tested on the Tomu using a Linux host:
    - A USB-Serial CDCACM device example (usb_cdcacm)
    - A USB HID mouse emulation example (usb_hid)
    - A USB Mass Storage Device example (usb_msc)
    - A USB MIDI example (usb_midi)
    - A raw endpoint example with a sample python program that controls an LED

I plan to try and push these changes upstream (to libopencm3) in the near future, but posting here in case anyone is interested (not sure how long it will take to get this upstream).

Haven't started on the touch sensing library yet; but the USB, gpio & clock libraries seem to work fine.

If you find a bug, let me know!

Cheers,
Seb.

Tim 'mithro' Ansell

unread,
Feb 4, 2018, 4:51:52 PM2/4/18
to Seb H, tomu discussion list
Awesome work Seb!

How should we make these examples available on the im-tomu github org (https://github.com/im-tomu)?

There is the https://github.com/im-tomu/tomu-samples repository, but maybe we should just for the libopencm3-examples into the organisation? We should definitely put a README or similar file in the tomu-samples repository pointing to them...

Thanks!

Tim 'mithro' Ansell

--
You received this message because you are subscribed to the Google Groups "tomu discussion list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tomu-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to tomu-d...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/tomu-discuss/864b8119-de3b-489e-8675-088cdaee8aa7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Seb H

unread,
Feb 5, 2018, 5:01:10 AM2/5/18
to tomu discussion list
Hi Tim,

Sure, forking libopencm3-examples (and perhaps renaming the 'efm32hg' branch to 'master') onto the organisation sounds like an easy solution for now.

As for the 'libopencm3' fork, feel free to fork that onto the org as well - we can redirect the submodule in 'libopencm3-examples' to mainline libopencm3 if/when efm32hg goes upstream.

Longer term, it probably makes more sense to add the libopencm3 submodule to 'tomu-samples', and then just put the relevant examples in the top-level directory - I'm happy to do that quick restructure when I get a chance.

Cheers,
Seb.


On Monday, 5 February 2018 08:51:52 UTC+11, Tim 'mithro' Ansell wrote:
Awesome work Seb!

How should we make these examples available on the im-tomu github org (https://github.com/im-tomu)?

There is the https://github.com/im-tomu/tomu-samples repository, but maybe we should just for the libopencm3-examples into the organisation? We should definitely put a README or similar file in the tomu-samples repository pointing to them...

Thanks!

Tim 'mithro' Ansell
On 2 February 2018 at 16:27, Seb H <schn...@gmail.com> wrote:
If anyone's interested in making wierd & wonderful USB applications, I've ported the libopencm3 USB stack.

My libopencm3 fork for efm32hg (tomu) is here: https://github.com/schnommus/libopencm3 (branch: efm32hg)

I've also copied & updated a bunch of example applications, which you can get here: https://github.com/schnommus/libopencm3-examples (branch: efm32hg)

You'll find the examples at: examples/efm32/efm32hg/tomu-efm32hg309 in the above repository

These are the ones I've already tested on the Tomu using a Linux host:
    - A USB-Serial CDCACM device example (usb_cdcacm)
    - A USB HID mouse emulation example (usb_hid)
    - A USB Mass Storage Device example (usb_msc)
    - A USB MIDI example (usb_midi)
    - A raw endpoint example with a sample python program that controls an LED

I plan to try and push these changes upstream (to libopencm3) in the near future, but posting here in case anyone is interested (not sure how long it will take to get this upstream).

Haven't started on the touch sensing library yet; but the USB, gpio & clock libraries seem to work fine.

If you find a bug, let me know!

Cheers,
Seb.

--
You received this message because you are subscribed to the Google Groups "tomu discussion list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tomu-discuss...@googlegroups.com.

Tim 'mithro' Ansell

unread,
Feb 5, 2018, 11:24:02 AM2/5/18
to Seb H, tomu discussion list
Hi Seb!

We have forked the libopencm3 and libopencm3-examples repository into the I'm Tomu organisation (https://github.com/im-tomu). I also added the following to the samples directory -> https://github.com/im-tomu/tomu-samples/tree/master/libopencm3

Tim 'mithro' Ansell


To unsubscribe from this group and stop receiving emails from it, send an email to tomu-discuss+unsubscribe@googlegroups.com.

To post to this group, send email to tomu-d...@googlegroups.com.

Seb H

unread,
Feb 5, 2018, 3:57:29 PM2/5/18
to tomu discussion list
Sweet, thanks Tim!

youlian troyanov

unread,
Feb 6, 2018, 5:00:04 AM2/6/18
to tomu discussion list
hey seb
how do you test gpios on tomu? what i have been doing myself and what i have seen others doing in that regard on "enthusiast" boards does not seem applicable here. what am i missing here?

Seb H

unread,
Feb 6, 2018, 4:25:10 PM2/6/18
to tomu discussion list
Hi Youlian,
As far as GPIOs go, I've only tested libopencm3's GPIO driver on the 2 LEDs on the board (GPIOs PA0, PB7). I don't see why it wouldn't work on other pins though --

Seb H

unread,
Mar 3, 2018, 12:46:55 AM3/3/18
to tomu discussion list
Update for future reference - the efm32hg libopencm3 changes are now upstream at https://github.com/libopencm3/libopencm3
And all the examples have been moved to: https://github.com/im-tomu/tomu-samples/
If anyone's been playing with this, I would strongly recommend switching to upstream libopencm3 as I made some bugfixes to the USB stack.

- Seb.

Chinmay Pendharkar

unread,
Apr 9, 2019, 11:59:01 AM4/9/19
to tomu discussion list
Thanks Tim and Seb. The usb-cdcacm example is super handy for what I'm trying to do.

Quick question about that though. Where is the baud rate set? I got the demo working with the baud rate of my terminal app set to 115200, but I can't find where in the code that is set up.

Thanks!

Sean Cross

unread,
Apr 9, 2019, 12:01:07 PM4/9/19
to Chinmay Pendharkar, tomu discussion list
The baud rate really doesn't matter.

If it were connecting to a real device, or acting as a real serial port, the baud rate would set an actual real UART.  But since it's just a USB device answering your queries, it'll talk as fast as you like.

Within limits of the buffer, of course!


Sean

Chinmay Pendharkar

unread,
Apr 9, 2019, 10:04:13 PM4/9/19
to Sean Cross, tomu discussion list
Interesting. I didn't realize that the baud rate on usb-cdcacm was not really relevant. 

Just for the record, I tried with 460800 and it's worked fine.

`stty -f /dev/cu.usbmodemDEMO1 460800 & screen /dev/cu.usbmodemDEMO1 460800`

-Chinmay

P.S. Thanks for porting dfu to Tomu @xobs. 
Reply all
Reply to author
Forward
0 new messages