2026-02-04 3:18 AM - last edited on 2026-02-04 6:15 AM by FBL
Hello,
I'm using STM32CubeIDE 2.0.0 + STM32CubeMX 6.16.1 + FW_H7 V1.12.1
I have a problem with USBX RNDIS.
The generated code on file ux_device_descriptor.h at line 308 is:
#define USBD_RNDIS_EPINCMD_ADDR 0x81U
In the exemple code of STM32H735-DK find on stm32-usbx-exemple repo I have this
#define USBD_RNDIS_EPINCMD_ADDR 0x82U
The USB device is well recognized be my computer (windows 11) only if the value is 0x82U.
My questions:
- why it doesn't work with 0x81
- is there is a tips to modify this value on Cube ? Actually I add an error at the end of the file if value is 0x81..
Thanks for help !
Solved! Go to Solution.
2026-02-06 1:17 AM
Hi @Dams
With the configuration below, the code is generated correctly. In particular, the IN endpoint address and the IN endpoint command address are assigned the additional values 0x81 and 0x82, respectively, since bit 7 indicates the direction (0 for OUT, 1 for IN).
I hope it's clear.
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.
2026-02-04 6:13 AM - edited 2026-02-04 6:14 AM
Hi @Dams
This behavior is related to the role of this endpoint. The USBD_RNDIS_EPINCMD_ADDR is the command IN endpoint, and its direction and index.
If USBD_RNDIS_EPINCMD_ADDR is set to 0x81U, it conflicts with the data IN endpoint configuration, and the device is not correctly handled by the host. That’s why it only works correctly when USBD_RNDIS_EPINCMD_ADDR is set to 0x82U, as in the reference example.
/* EP_IN, EP_OUT, CMD_EP */
#define USBD_RNDIS_EPIN_ADDR 0x81U
#define USBD_RNDIS_EPOUT_ADDR 0x01U
#define USBD_RNDIS_EPINCMD_ADDR 0x82U
Here you can find the configuration of FIFOs in this example. To learn more you can refer to this helper How to configure USB FIFO over USB OTG controller and Practical use cases to manage FIFO in USB OTG
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.
2026-02-04 6:25 AM
Hi @FBL
Thanks for feedback. According to your answer, I think the generated code from Cube is not correct. In the file "ux_device_descriptor.h" the value of USBD_RNDIS_EPINCMD_ADDR shall be set to 0x82U intead of 0x81U.
Have you same value on your configuration ?
Best regards,
2026-02-04 6:42 AM
Hi @Dams
I'm only referring to the example provided here. I didn't generate code using CubeMX. Would you attach IOC file to check code generated?
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.
2026-02-04 7:31 AM
2026-02-06 1:17 AM
Hi @Dams
With the configuration below, the code is generated correctly. In particular, the IN endpoint address and the IN endpoint command address are assigned the additional values 0x81 and 0x82, respectively, since bit 7 indicates the direction (0 for OUT, 1 for IN).
I hope it's clear.
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.
2026-02-06 1:23 AM