-
Hello, I'm developing firmware for STM32H750VB that uses the USB PHY to send MIDI over USB. I'm using the TinyUSB library for the USB stack. Right now USB is getting initialized as far as I know (tusb_init() completes without any problems), however the device hangs when I plug in the USB cable with the other end connected to a host (my Windows 10 laptop). What happens in the TinyUSB stack when the USB cable is plugged in? Based on the midi_test device example, I understood that the "tud_mount_cb()" function in main() is called but it looks like that is not the case. I'd like to have some idea where the code is going so I can trace it and find what's going wrong... Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
More info: I captured some packets on the bus and I can see the following: It seems the MCU is getting stuck in the USB code somewhere once it starts receiving USB packets. Does anyone have any ideas where I should look to trace where in the TinyUSB code the program is getting stuck? |
Beta Was this translation helpful? Give feedback.
-
More info: I added the tud_task() call every audio sample (48KS/s) and it doesn't change the system behavior, I'm seeing the same IN tokens followed by NAK from the device. Also, I set up a while (1) loop to blink four LEDs in succession. When USB cable is plugged in the code breaks out of my while (1) loop and goes I know not where. I hope someone can help! Also, I was hoping that instead of polling the USB every 48KHz cycle I could service USB tasks using exclusively interrupts. Is it possible? |
Beta Was this translation helpful? Give feedback.
-
have you include the IRQ forwarder, I think it is best for you to just to get existing example to run on your board first. Adding H750 to existing BSP isn't too difficult https://github.com/hathach/tinyusb/blob/master/hw/bsp/stm32h7/family.c#L47 |
Beta Was this translation helpful? Give feedback.
have you include the IRQ forwarder, I think it is best for you to just to get existing example to run on your board first. Adding H750 to existing BSP isn't too difficult
https://github.com/hathach/tinyusb/blob/master/hw/bsp/stm32h7/family.c#L47