Scheduling Audio, MIDI and HID

In my previous post I mentioned that my audio interface crashes after a while. I also mentioned that my guess it is because of the non-scheduling my different USB transefers. So I did it.

I used the SOF (Start-of-frame) interrupt as my 1ms timebase.This interrupt has to be enabled in the USB device configuration part, because it’s disabled by default. In other words simply replaced my HAL_GetTick() function which is based on the counter incremented each 1ms in the SysTick interrupt. My similar function is the USB_GetTick() which is based on the counter incremented each 1ms in the USB SOF interrup.

This is the new waveform I have. The start of the HID report transfer is in a fixed time slot. It comes after 718us always. And it completes of course in the end of the frame.

hid_sof_sync

Continue reading

Advertisements

4 channel USB soundcard with STM32

At this point I would like to make a 4 channel sound card out of the 2 channels. I started with modifing the USB descriptors in usbd_audio.c. I more or less cloned the first part of Reloop Beatpad descriptors. So I deleted the Audio Feature descriptor. I modified everything to 4 channel and stuff like that.

Continue reading