Skip to main content
Associate
April 23, 2026
Solved

STM32H563 USB CDC bare-metal: classic USB_Device not available in CubeMX 6.17.0

  • April 23, 2026
  • 1 reply
  • 119 views

Hardware: STEVAL-MKI109D (STM32H563ZI)
CubeMX: 6.17.0
CubeIDE: 2.1.0
Connection: USB-C directly to STM32H563 USB OTG (no ST-LINK chip)


PROBLEM:
I need USB CDC Virtual COM Port in a bare-metal application
(no RTOS). CubeMX 6.17.0 for STM32H563 only offers:
- USBX (requires ThreadX)
- ThreadX
- FileX
- LevelX

Classic USB_Device middleware (usbd_cdc_if.h / CDC_Transmit_FS)
is NOT available for STM32H5 series in CubeMX 6.17.0.

USBX requires ThreadX RTOS. Without ThreadX running,
MX_USBX_Init() causes the board to crash silently —
after DFU flash the board is completely invisible on USB
(no lsusb entry, no /dev/ttyACM*).

QUESTIONS:
1. How do I implement USB CDC on STM32H563 WITHOUT ThreadX?

2. Is there a way to enable classic USB_Device stack for STM32H5
in CubeMX 6.17.0?

3. Is there a bare-metal USBX CDC example that does NOT require
ThreadX for STM32H5?

4. Can I manually add usbd_cdc_if.c and USB Device library files
to an STM32H5 project without CubeMX support?

I have a working SPI sensor application (ISM330DHCX on DIL24)
and just need to stream data over USB CDC. Adding full ThreadX
RTOS is too complex for this use case.

Please provide guidance or a working minimal example.

 

Attachments: MKI109D_ISM330DHCX.ioc

Best answer by FBL

Hello @pooja_g 

First, I would suggest starting with this article :  How to implement USBX in standalone mode and  How to implement USB mass storage device standalone

Second CubeMX doesn't support classic core middleware for H5 as it supports natively USBX. To use classic core MW apps, check this repo.

Also you can port this example.

I hope this helps!

1 reply

FBLBest answer
ST Technical Moderator
April 23, 2026

Hello @pooja_g 

First, I would suggest starting with this article :  How to implement USBX in standalone mode and  How to implement USB mass storage device standalone

Second CubeMX doesn't support classic core middleware for H5 as it supports natively USBX. To use classic core MW apps, check this repo.

Also you can port this example.

I hope this helps!

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.Best regards,FBL
pooja_gAuthor
Associate
July 1, 2026

Hi @FBL, following up on this — separate issue now that USB CDC is working.

I'm trying to write bare-metal SPI communication with the ISM330DHCX sensor (STEVAL-MKI207V1) on the DIL24 socket, but I'm consistently getting WHO_AM_I = 0xFF regardless of GPIO/SPI config (I've verified AF mapping, clock/mode settings, and read command bytes are all correct against the datasheet).

I noticed the board's stock firmware (ProfiH5_MKI109D) uses the STM32H563ZI's DAC1_OUT1/OUT2 (PA4/PA5) to drive the software-adjustable VDD/VDDIO supply circuit — which conflicts with the pins I'd otherwise use for SPI1_NSS/SCK.

Could you point me to the actual GPIO pin mapping between the STM32H563ZI and the DIL24 socket's SPI signals (SCK/MOSI/MISO/CS), so I know which pins are safe to use for SPI without colliding with the power-supply DAC pins? Is there a schematic or pinout table available outside of MEMS Studio for developers writing custom firmware for this board?