Skip to main content
Senior
November 14, 2025
Solved

Is `ux_user.h` included in the project when generated from CubeMX?

  • November 14, 2025
  • 7 replies
  • 370 views

Using Ux_Device_Audio2.0_PlayBack as an example for STM32H753, I enabled in the .ioc file, but it doesn't seem to be affected in the project. Any idea why? 

 

In the .ioc, I have this `UX_DEVICE_CLASS_AUDIO_FEEDBACK_SUPPORTenabled... should be affecting ux_user.h 

 

audio_0-1763158205482.png

 

But ux_user.h is not being used in the project, so I don't think it's actually being built into the .elf file. I also can't find the file in the STM32CubeIDE project as well, although it is under `USBX/App/ux_user.h` in the system explorer...

Here's the Project explorer in the IDE:

audio_1-1763158813613.png

and even opening each of those *.c files doesn't reveal ux_user.h

audio_2-1763158872615.png

Lastly, I do have UX_INCLUDE_USER_DEFINE_FILE in the preprocessor:

audio_3-1763158955819.png

Am I missing something?

Best answer by FBL

Hi @audio @Mohamed_AYED 

I found this interesting example supporting feedback endpoint (full SW setup). Feel free to use it as reference.
Assigning feedback endpoint here, initialize feedback task then compute USB feedback.

7 replies

Explorer
November 15, 2025

Hi @audio,

  1.  by enabling the "UX_DEVICE_CLASS_AUDIO_FEEDBACK_SUPPORT" in cubemx this flag will be defined in ux_user.h
  2. UX_INCLUDE_USER_DEFINE_FILE is defined by default in preprocessor.
  3. when compiling your project ux_user.h will ben included. you can see here 
    https://github.com/eclipse-threadx/usbx/blob/68aee7d1053bad353f941a7e71b46585c7398270/ports/generic/inc/ux_port.h#L67

So when compiling the project, the Generic USBX Project constants in "ux_port.h" will be forced to constants defined to the user in "ux_user.h"

audioAuthor
Senior
November 15, 2025
Thank you for your response, where would I find this in the STM32CubeIDE? I
shared the screenshots in previous post so without showing the headers
automatically, it's hard to find where they are. Even using search doesn't
show the file.
Explorer
November 15, 2025

Can you share with me your ioc file ?

Technical Moderator
November 17, 2025

Hi @audio 

Totally agreed @Mohamed_AYED 

About USB_AUDIO_FEEDBACK_SUPPORT,  it is still not supported by our current implementation as I mentioned here

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.Best regards,FBL
audioAuthor
Senior
November 17, 2025

@Mohamed_AYED Thank you for your response. Here's the .ioc file. 

@FBL Hello again! Just to clarify, if I enable UX_DEVICE_CLASS_AUDIO_FEEDBACK_SUPPORT or not, it won't work in this project? 

 

Edit: I should clarify, I enabled this in the .ioc file, I couldn't do this in the ux_user.h file as I can't find this as mentioned in the original post of this question. I expect that when I enable this, I should see ux_user.h show up in the Project Explorer for me to use UX_DEVICE_CLASS_AUDIO_FEEDBACK_SUPPORT.

audioAuthor
Senior
November 20, 2025

@Mohamed_AYED @FBL 

Following up, I haven't heard a reply from you since. 

Technical Moderator
November 20, 2025

Hi @audio 

Did you try with latest CubeMX version? 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.Best regards,FBL
audioAuthor
Senior
November 21, 2025

Hello @FBL

I spent my day trying to figure out what broke, and this was after the CubeMX update, and made it even worse when I updated the CubeIDE as well. I had to uninstall everything and reinstall so now things are working, but sadly my project won't build. I'll put the error message at the end of this post. 

 

Having said this... @Mohamed_AYED your trick didn't work with me for some reason, but before the MX update, I was able to find it in the includes folder. This is after the MX update so of course I can't open it, but it would be under here: 

audio_0-1763751171411.png

 

Something weird is going on though. But back to my error message: 

audio_1-1763751212934.png

I did not make any changes, so I'm not sure why there's that error - but I just noticed that in the other screenshot (the includes list), it shows a warning icon on it, and that's where the pdm2pcm_glo.h actually is. 

 

Is there something corrupted that it can't load the hierarchy properly? 

Lastly @FBL I'm excited to try the example you mentioned earlier today. But until then, I gotta figure out why my project won't compile anymore, and any help is appreciated.

audioAuthor
Senior
November 21, 2025

Ok I figured it out. The workspace was not set up correctly so I had to remove some things to force the right workspace to work. 

 

And somehow the \Middlewares\ST\STM32_Audio folder was deleted, so I was able to copy that folder over from older project, so now it compiles nicely. 

 

Lastly, @Mohamed_AYED your trick worked. Finally. I'm not sure which solution is correct now, it was a messy ride to get here. This thread can be closed. 

 

Now I go ahead and try the example code.

Explorer
November 20, 2025

Hi @audio,

Sorry for the delay, i tried project generated with you .ioc and i see that UX_DEVICE_CLASS_AUDIO_FEEDBACK_SUPPORT is correctly generated in ux_user.h and correctly included in the project.

To test that you can compile generated code and then go to ux_device_class_audio_change.c file click with rigth button of your mouse on UX_DEVICE_CLASS_AUDIO_FEEDBACK_SUPPORT then go to declarection you can see that UX_DEVICE_CLASS_AUDIO_FEEDBACK_SUPPORT is defined in ux_user.h

Mohamed_AYED_0-1763678527373.png

 

FBLBest answer
Technical Moderator
November 21, 2025

Hi @audio @Mohamed_AYED 

I found this interesting example supporting feedback endpoint (full SW setup). Feel free to use it as reference.
Assigning feedback endpoint here, initialize feedback task then compute USB feedback.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.Best regards,FBL