Assignment 22 - MIDI out to STM32 Device

USB Setup Forum That Helped a Bit

Pasted image 20240311135401.png

The device (STM) to be a USB Host, but what is a USB host?

Main Points on USB Hosting

There are multiple USB host types. Since we are doing a USB-type B from our device, and USB-type A to our STM, we want our STM to be an OTG A-host.

Some behaviors to note are that:

Initialization

When connecting:

Host Initialization

You must:

Channel Initialization

You'll need to setup a USB channel in order to read and write data over. See pg. 1783 for that.

Receiving Data Packets

See pg. 1784 and 1785 for read and write access to FIFOs per channel. The programming flowchart is essentially what code you want to have to setup your USB read/write functions.

Setting up GPIO

By ![[datasheet_stm32l476rg.pdf#page=99]]
use the PA10-13 pins for connecting the USB-A side pins to, rather than the onboard usb (that's the debug USB). Via ![[datasheet_stm32l476rg.pdf#page=99]]
,