@gedare @JoelSherrill
I researched boards with USB,TinyUSB support and RTEMS BSP. Here’s what I found:
- STM32F4 Discovery (STM32F407)
-USB OTG built-in
-TinyUSB has board definitions ready
-RTEMS has stm32f4 BSP
-Cheap (~$25), well-documented
- Raspberry Pi Pico (RP2040)
-Native USB, TinyUSB fully supports it
-RTEMS has RPi BSPs but may need work for Pico specifically
- BeagleBone Black
-USB host/device capable, mature RTEMS BSP
-More expensive (~$60)
My pick: STM32F4 Discovery- best overlap between TinyUSB and RTEMS support, affordable, tons of resources available.
Does this make sense, or would you recommend a different board?
Thanks!
For clarification, the RP2040 does not use the same ARM chip as the remainder of the Raspberry Pi family and is not supported by any existing BSPs. I would not recommend the RP2040 for this project as you’d need to create a BSP for it as well and that could be a whole GSoC project by itself.
Thanks for the clarification about the RP2040, that makes sense. I’ll drop it from my list then.
Right now STM32F4 Discovery looks like the best fit for the TinyUSB work, with BeagleBone Black as a possible secondary target.
Would you recommend starting with STM32F4 as the primary board?
If you want to concentrate on porting the TinyUSB, you should definitively select a board that is supported on RTEMS and TinyUSB. Adding another driver should be a stretch goal - USB drivers are not really simple to write and tricky to debug.
So the STM32F4 that you selected is not a bad choice from that point of view. Only disadvantage: The F4 is a quite small target and RTEMS is already using quite some memory on that chip (at least in my experience). I’m not sure how much memory TinyUSB needs. Maybe think about building an RTEMS hello world app for that target and a TinyUSB example (they seem to have a “No os” target). You don’t have to run the apps. Just check with size or objdump how much memory the applications would need. If the combined memory fits into the STM32F4 memory, it should be a valid choice.
By the way: From skimming over the list of the supported boards in TinyUSB, something i.MXRT based could work too if you find a cheap board with USB support.
1 Like
Thanks a lot for the explanation!
I’ll do the memory check you suggested:
-Build an RTEMS hello world app
-Build a TinyUSB “no os” example
-compare the memory usage
I’m still in the process of procuring an STM32F4
board, so it might take a little time before I can run things on real hardware but I will start with the build and size analysis. If the combined memory fits ,then I’ll keep STM32F4 as my main board.If not I’ll also take a look at MXRT as an option.
Since you mentioned that a BSP for RP2040 could be a whole GSOC project by itself, would it make sense to consider “Add RTEMS BSP support for RP2040” as a separate GSOC project idea?
I’d be happy to explore this direction if there is mentor interested.
If the combined size doesn’t fit, it can still work. There will be some overlap between RTEMS and the TinyUSB. But it will most likely increase the necessary effort. Also make sure to compare the sizes of the sections (size or objdump or similar) and not the executable size.
Regardint the RP2040: Adding new BSPs is always a possible GSoC project if you find someone interested in mentoring that. But note that adding a new library is usually more useful than adding a new BSP, just because there are more potential users for that library than for a special BSP. The RP2040 is of course a very common chip so that this could be an interesting project too.
1 Like
Thanks for the feedback!
I actually have a rp2040 ready. Since you mentioned it could be a project, can I start working on it?
What direction do you think I should begin with?
For BSP projects usually the starting point is the core: Is it already supported by another BSP? If yes: Which peripherals do you plan to support? Start with the basic ones. UART, some system timer, I2C, SPI, …
I would suggest to look at other projects from the past that added a new BSP. Usually the basics are quite similar.
But like I said: From a project point of view, usually a library is more interesting than a new BSP. Of course that depends on who you ask.
Thanks for the advice
ill be doing the section size analysis you mentioned to verify the STM32F4 memory situation. Will share results soon.