Skip to main content
Graduate
August 24, 2025
Solved

USB Audio command function not being called

  • August 24, 2025
  • 2 replies
  • 673 views

I'm trying to go about creating a USB Audio interface on a NUCLEO-H7S3L8, receiving USB audio and forwarding it to the SAI, in order to send to an external DAC.

Among other tests, I went back to checking when the functions in usbd_audio_if.c get called, to set up transfers of the packets received.
And while in a previous version of the same project, on audio playback on the host, AUDIO_AudioCmd_HS() was called, allowing me to continue handling data accordingly, after a Cube MX update (6.14->6.15) and some changes on DMA (to get circular -> non-circular) and SAI (Output Drive enabled) settings, it no longer gets called on playback (a breakpoint within it never gets reached).

Following the IRQ handler function for USB on either playback or idle, it only ends up within the code block for handling an incomplete "ISO OUT Interrupt", reaching the "__HAL_PCD_CLEAR_FLAG(hpcd, USB_OTG_GINTSTS_PXFR_INCOMPISOOUT)" macro.

Since the changes I've made ever since it was functional seem mostly irrelevant, I can't exactly find why this is the case, so if anybody has any advice, it'd be much appreciated.

I'll attach usbd_audio_if.c where I'm checking for it, as well as the IOC file of the project (where most of the USB settings are similar to those of the Audio_Standalone example for STM32H7S78_DK).

    This topic has been closed for replies.
    Best answer by Deimos

    Just to close the topic, turns out it wasn't anything related to the board or the examples themselves, but OS related on the USB host side.

    2 replies

    Technical Moderator
    August 26, 2025

    Hi @Deimos 

    Do you replicate the issue using the example firmware?

    DeimosAuthor
    Graduate
    August 26, 2025

    Hello,
    I'm working on a NUCLEO-H7S3L8 board, and unfortunately can't test the Discovery board's  Audio_Standalone example directly.

    But tests for the CDC and HID examples for the NUCLEO work fine, if that helps.
    Testing on a clean project, made in Cube MX 6.14, that completely mimics the USB setup on the Discovery Audio example in CubeMX, I still can't get AUDIO_AudioCmd_HS() to be called on audio playback, with or without added code within the function.

    DeimosAuthorAnswer
    Graduate
    August 26, 2025

    Just to close the topic, turns out it wasn't anything related to the board or the examples themselves, but OS related on the USB host side.