0
\$\begingroup\$

I want implement my bluepill as a midi controller from scratch(like register twiddling or using cmsis max in a text-editor with gnu-arm toolchain and makefiles) and I have been trying to find out resources on working with the usb peripheral. After extensively searching through the data sheets, I cannot find any proper resource on using the usb of the mcu. I even tried looking at the usb protocol specifications but I could not find much apart from intimidation due to information overload...

Tl:dr can't find any resource on how to implement usb on stm32f103c8t6 from scratch.

\$\endgroup\$
4
  • \$\begingroup\$ are you sure there is nothing in STM32F103C8 datasheet about it? I'm pretty sure it describes every function of the MCU as deeply as it gets, no? You must be looking for some library? \$\endgroup\$
    – Ilya
    Commented Sep 16, 2020 at 8:30
  • \$\begingroup\$ Implementing USB is a non trivial project, but it's certainly doable, and all the information you need is freely available. The USB 2.0 spec can be obtained from USB.org and the reference manual for the controller you've chosen will detail the USB peripheral and it's registers. \$\endgroup\$
    – Colin
    Commented Sep 16, 2020 at 8:31
  • \$\begingroup\$ Ah,I missed out the reference manual...yep that's what I was looking for I guess \$\endgroup\$
    – nalostta
    Commented Sep 16, 2020 at 8:47
  • 1
    \$\begingroup\$ I find that libopencm3 has an excellent USB implementation for STM32 (small, easy to understand and use). There is even a MIDI example. By changing otgfs_usb_driverr to st_usbfs_v1_usb_driver it should be very close to working on a BluePill. The easiest project setup is with PlatformIO. \$\endgroup\$
    – Codo
    Commented Sep 16, 2020 at 10:46

1 Answer 1

0
\$\begingroup\$

The problem is quite big. First you need to know how USB works, then implement your own USB driver on the MCU, and implement USB MIDI on top of the USB driver. You should consider running existing USB driver and stack provided by chip manufacturer, and implement USB MIDI on top of that. At least you can take the existing USB stack as an example even if you don't want to use it. The MCU peripheral details can be found in the reference manual, not in the datasheet.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.