2025-03-25 10:16 AM - last edited on 2025-03-28 2:25 AM by FBL
Hi,
I am using custom board with STM32C071. I am trying to enable USB port with CDC so that my custom board will be visible as virtual com port on PC. After enabling all options and initializations, I was expecting that my board will appear on PC device manager COM port list but it does not appear. Below are the settings:
1. Clock configuration - In my hardware external crystal is connected of 8MHz and I see there is no PLL which can multiply it and hence I am using internal 48MHz clock.
2. USB port is enabled with default settings. PA11 and PA12 pins are used for USB connection in hardware. USB global interrupt is enabled.
3. USBX is enabled from middleware. Device class CDC ACM is only one selected.
4. Most of the settings for USBX is default value except for two of them marked in red color. These values are updated from 1024 to 10000 and 512 to 8000. With default values of 1024 and 512, function MX_USBX_Device_Init() was returning error. After referring to discussions on community, I got one of the reference to make this change which resolve the error of MX_USBX_Device_Init(). However, still my board is not visible on PC as VCP.
Hardware schematic is as follows:
In main.c file, I could see following two function calls:
MX_USB_PCD_Init();
MX_USBX_Device_Init();
Both of the above functions return 'success'.
Please guide me in locating the issue as why my custom board is not appearing as VCP on PC.
Thanks,
Pradeep
edit: updated label STM32C0 Series
2025-03-25 10:21 AM
@PPate.1 wrote:still my board is not visible on PC as VCP.
Does anything at all appear on your PC?
Have you verified good connections, no shorts, etc on your custom board?
Are you sure you're using a good cable, with full data connectivity?
2025-03-25 10:27 AM
Information about layout: 90 ohm differential impedance maintained.
Thanks,
Pradeep
2025-03-25 10:54 AM
But have you actually checked for continuity & shorts?
And, again:
Does anything at all appear on your PC?
Are you sure you're using a good cable, with full data connectivity?
2025-03-25 4:36 PM - edited 2025-03-25 5:04 PM
Have you generated the project from scratch or started from some pre-configured examples such as this?
If the former: adapt the example to your custom board and try only the USB functionality. If it works, find differences to your project and merge carefully.
Or get a Nucleo-C071, build the example, ensure it works, then compare with your custom board project.
2025-03-27 9:10 AM
Hi Andrew,
Yes I checked continuity on board. It is good. I also checked shorts on PCB and have not observed any shorts. I removed ESD protection diodes for now.
The cable I have used which is already in use with other device for data transfer and hence no doubts on cable.
2025-03-27 9:18 AM
Hi Pavel,
Yes, I did generated project from Scratch. I have Nucleo-C071 and tried on it. It works upto level where it I get message on PC - 'Unrecognized USB device'. I downloaded examples for Nucleo-C071 and tried to compile 'Ux_Device_CDC_ACM' from the folder. But it gives me compilation error -
---------------------------------------------------------------------------------------
21:43:40 **** Incremental Build of configuration Debug for project Ux_Device_CDC_ACM ****
make -j12 all
arm-none-eabi-gcc "C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32_callback.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DDEBUG -DTX_INCLUDE_USER_DEFINE_FILE -DUX_INCLUDE_USER_DEFINE_FILE -DUSE_HAL_DRIVER -DSTM32C071xx -c -I../../Core/Inc -I../../AZURE_RTOS/App -I../../USBX/App -I../../USBX/Target -I../../../../../../../Drivers/STM32C0xx_HAL_Driver/Inc -I../../../../../../../Middlewares/ST/threadx/common/inc -I../../../../../../../Drivers/CMSIS/Device/ST/STM32C0xx/Include -I../../../../../../../Middlewares/ST/threadx/ports/cortex_m0/gnu/inc -I../../../../../../../Middlewares/ST/usbx/common/core/inc -I../../../../../../../Middlewares/ST/usbx/ports/generic/inc -I../../../../../../../Middlewares/ST/usbx/common/usbx_stm32_device_controllers -I../../../../../../../Middlewares/ST/usbx/common/usbx_device_classes/inc -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/STM32C0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_callback.d" -MT"Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_callback.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_callback.o"
arm-none-eabi-gcc "C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32_endpoint_create.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DDEBUG -DTX_INCLUDE_USER_DEFINE_FILE -DUX_INCLUDE_USER_DEFINE_FILE -DUSE_HAL_DRIVER -DSTM32C071xx -c -I../../Core/Inc -I../../AZURE_RTOS/App -I../../USBX/App -I../../USBX/Target -I../../../../../../../Drivers/STM32C0xx_HAL_Driver/Inc -I../../../../../../../Middlewares/ST/threadx/common/inc -I../../../../../../../Drivers/CMSIS/Device/ST/STM32C0xx/Include -I../../../../../../../Middlewares/ST/threadx/ports/cortex_m0/gnu/inc -I../../../../../../../Middlewares/ST/usbx/common/core/inc -I../../../../../../../Middlewares/ST/usbx/ports/generic/inc -I../../../../../../../Middlewares/ST/usbx/common/usbx_stm32_device_controllers -I../../../../../../../Middlewares/ST/usbx/common/usbx_device_classes/inc -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/STM32C0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_endpoint_create.d" -MT"Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_endpoint_create.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_endpoint_create.o"
arm-none-eabi-gcc "C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32_endpoint_destroy.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DDEBUG -DTX_INCLUDE_USER_DEFINE_FILE -DUX_INCLUDE_USER_DEFINE_FILE -DUSE_HAL_DRIVER -DSTM32C071xx -c -I../../Core/Inc -I../../AZURE_RTOS/App -I../../USBX/App -I../../USBX/Target -I../../../../../../../Drivers/STM32C0xx_HAL_Driver/Inc -I../../../../../../../Middlewares/ST/threadx/common/inc -I../../../../../../../Drivers/CMSIS/Device/ST/STM32C0xx/Include -I../../../../../../../Middlewares/ST/threadx/ports/cortex_m0/gnu/inc -I../../../../../../../Middlewares/ST/usbx/common/core/inc -I../../../../../../../Middlewares/ST/usbx/ports/generic/inc -I../../../../../../../Middlewares/ST/usbx/common/usbx_stm32_device_controllers -I../../../../../../../Middlewares/ST/usbx/common/usbx_device_classes/inc -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/STM32C0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_endpoint_destroy.d" -MT"Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_endpoint_destroy.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_endpoint_destroy.o"
arm-none-eabi-gcc "C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32_endpoint_reset.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DDEBUG -DTX_INCLUDE_USER_DEFINE_FILE -DUX_INCLUDE_USER_DEFINE_FILE -DUSE_HAL_DRIVER -DSTM32C071xx -c -I../../Core/Inc -I../../AZURE_RTOS/App -I../../USBX/App -I../../USBX/Target -I../../../../../../../Drivers/STM32C0xx_HAL_Driver/Inc -I../../../../../../../Middlewares/ST/threadx/common/inc -I../../../../../../../Drivers/CMSIS/Device/ST/STM32C0xx/Include -I../../../../../../../Middlewares/ST/threadx/ports/cortex_m0/gnu/inc -I../../../../../../../Middlewares/ST/usbx/common/core/inc -I../../../../../../../Middlewares/ST/usbx/ports/generic/inc -I../../../../../../../Middlewares/ST/usbx/common/usbx_stm32_device_controllers -I../../../../../../../Middlewares/ST/usbx/common/usbx_device_classes/inc -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/STM32C0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_endpoint_reset.d" -MT"Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_endpoint_reset.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_endpoint_reset.o"
arm-none-eabi-gcc "C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32_endpoint_stall.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DDEBUG -DTX_INCLUDE_USER_DEFINE_FILE -DUX_INCLUDE_USER_DEFINE_FILE -DUSE_HAL_DRIVER -DSTM32C071xx -c -I../../Core/Inc -I../../AZURE_RTOS/App -I../../USBX/App -I../../USBX/Target -I../../../../../../../Drivers/STM32C0xx_HAL_Driver/Inc -I../../../../../../../Middlewares/ST/threadx/common/inc -I../../../../../../../Drivers/CMSIS/Device/ST/STM32C0xx/Include -I../../../../../../../Middlewares/ST/threadx/ports/cortex_m0/gnu/inc -I../../../../../../../Middlewares/ST/usbx/common/core/inc -I../../../../../../../Middlewares/ST/usbx/ports/generic/inc -I../../../../../../../Middlewares/ST/usbx/common/usbx_stm32_device_controllers -I../../../../../../../Middlewares/ST/usbx/common/usbx_device_classes/inc -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/STM32C0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_endpoint_stall.d" -MT"Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_endpoint_stall.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_endpoint_stall.o"
arm-none-eabi-gcc "C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32_endpoint_status.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DDEBUG -DTX_INCLUDE_USER_DEFINE_FILE -DUX_INCLUDE_USER_DEFINE_FILE -DUSE_HAL_DRIVER -DSTM32C071xx -c -I../../Core/Inc -I../../AZURE_RTOS/App -I../../USBX/App -I../../USBX/Target -I../../../../../../../Drivers/STM32C0xx_HAL_Driver/Inc -I../../../../../../../Middlewares/ST/threadx/common/inc -I../../../../../../../Drivers/CMSIS/Device/ST/STM32C0xx/Include -I../../../../../../../Middlewares/ST/threadx/ports/cortex_m0/gnu/inc -I../../../../../../../Middlewares/ST/usbx/common/core/inc -I../../../../../../../Middlewares/ST/usbx/ports/generic/inc -I../../../../../../../Middlewares/ST/usbx/common/usbx_stm32_device_controllers -I../../../../../../../Middlewares/ST/usbx/common/usbx_device_classes/inc -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/STM32C0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_endpoint_status.d" -MT"Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_endpoint_status.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_endpoint_status.o"
arm-none-eabi-gcc "C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32_frame_number_get.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DDEBUG -DTX_INCLUDE_USER_DEFINE_FILE -DUX_INCLUDE_USER_DEFINE_FILE -DUSE_HAL_DRIVER -DSTM32C071xx -c -I../../Core/Inc -I../../AZURE_RTOS/App -I../../USBX/App -I../../USBX/Target -I../../../../../../../Drivers/STM32C0xx_HAL_Driver/Inc -I../../../../../../../Middlewares/ST/threadx/common/inc -I../../../../../../../Drivers/CMSIS/Device/ST/STM32C0xx/Include -I../../../../../../../Middlewares/ST/threadx/ports/cortex_m0/gnu/inc -I../../../../../../../Middlewares/ST/usbx/common/core/inc -I../../../../../../../Middlewares/ST/usbx/ports/generic/inc -I../../../../../../../Middlewares/ST/usbx/common/usbx_stm32_device_controllers -I../../../../../../../Middlewares/ST/usbx/common/usbx_device_classes/inc -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/STM32C0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_frame_number_get.d" -MT"Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_frame_number_get.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_frame_number_get.o"
arm-none-eabi-gcc "C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32_function.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DDEBUG -DTX_INCLUDE_USER_DEFINE_FILE -DUX_INCLUDE_USER_DEFINE_FILE -DUSE_HAL_DRIVER -DSTM32C071xx -c -I../../Core/Inc -I../../AZURE_RTOS/App -I../../USBX/App -I../../USBX/Target -I../../../../../../../Drivers/STM32C0xx_HAL_Driver/Inc -I../../../../../../../Middlewares/ST/threadx/common/inc -I../../../../../../../Drivers/CMSIS/Device/ST/STM32C0xx/Include -I../../../../../../../Middlewares/ST/threadx/ports/cortex_m0/gnu/inc -I../../../../../../../Middlewares/ST/usbx/common/core/inc -I../../../../../../../Middlewares/ST/usbx/ports/generic/inc -I../../../../../../../Middlewares/ST/usbx/common/usbx_stm32_device_controllers -I../../../../../../../Middlewares/ST/usbx/common/usbx_device_classes/inc -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/STM32C0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_function.d" -MT"Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_function.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_function.o"
arm-none-eabi-gcc "C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32_initialize.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DDEBUG -DTX_INCLUDE_USER_DEFINE_FILE -DUX_INCLUDE_USER_DEFINE_FILE -DUSE_HAL_DRIVER -DSTM32C071xx -c -I../../Core/Inc -I../../AZURE_RTOS/App -I../../USBX/App -I../../USBX/Target -I../../../../../../../Drivers/STM32C0xx_HAL_Driver/Inc -I../../../../../../../Middlewares/ST/threadx/common/inc -I../../../../../../../Drivers/CMSIS/Device/ST/STM32C0xx/Include -I../../../../../../../Middlewares/ST/threadx/ports/cortex_m0/gnu/inc -I../../../../../../../Middlewares/ST/usbx/common/core/inc -I../../../../../../../Middlewares/ST/usbx/ports/generic/inc -I../../../../../../../Middlewares/ST/usbx/common/usbx_stm32_device_controllers -I../../../../../../../Middlewares/ST/usbx/common/usbx_device_classes/inc -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/STM32C0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_initialize.d" -MT"Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_initialize.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_initialize.o"
arm-none-eabi-gcc "C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32_initialize_complete.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DDEBUG -DTX_INCLUDE_USER_DEFINE_FILE -DUX_INCLUDE_USER_DEFINE_FILE -DUSE_HAL_DRIVER -DSTM32C071xx -c -I../../Core/Inc -I../../AZURE_RTOS/App -I../../USBX/App -I../../USBX/Target -I../../../../../../../Drivers/STM32C0xx_HAL_Driver/Inc -I../../../../../../../Middlewares/ST/threadx/common/inc -I../../../../../../../Drivers/CMSIS/Device/ST/STM32C0xx/Include -I../../../../../../../Middlewares/ST/threadx/ports/cortex_m0/gnu/inc -I../../../../../../../Middlewares/ST/usbx/common/core/inc -I../../../../../../../Middlewares/ST/usbx/ports/generic/inc -I../../../../../../../Middlewares/ST/usbx/common/usbx_stm32_device_controllers -I../../../../../../../Middlewares/ST/usbx/common/usbx_device_classes/inc -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/STM32C0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_initialize_complete.d" -MT"Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_initialize_complete.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_initialize_complete.o"
arm-none-eabi-gcc "C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32_interrupt_handler.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DDEBUG -DTX_INCLUDE_USER_DEFINE_FILE -DUX_INCLUDE_USER_DEFINE_FILE -DUSE_HAL_DRIVER -DSTM32C071xx -c -I../../Core/Inc -I../../AZURE_RTOS/App -I../../USBX/App -I../../USBX/Target -I../../../../../../../Drivers/STM32C0xx_HAL_Driver/Inc -I../../../../../../../Middlewares/ST/threadx/common/inc -I../../../../../../../Drivers/CMSIS/Device/ST/STM32C0xx/Include -I../../../../../../../Middlewares/ST/threadx/ports/cortex_m0/gnu/inc -I../../../../../../../Middlewares/ST/usbx/common/core/inc -I../../../../../../../Middlewares/ST/usbx/ports/generic/inc -I../../../../../../../Middlewares/ST/usbx/common/usbx_stm32_device_controllers -I../../../../../../../Middlewares/ST/usbx/common/usbx_device_classes/inc -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/STM32C0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_interrupt_handler.d" -MT"Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_interrupt_handler.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_interrupt_handler.o"
arm-none-eabi-gcc "C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32_transfer_abort.c" -mcpu=cortex-m0plus -std=gnu11 -g3 -DDEBUG -DTX_INCLUDE_USER_DEFINE_FILE -DUX_INCLUDE_USER_DEFINE_FILE -DUSE_HAL_DRIVER -DSTM32C071xx -c -I../../Core/Inc -I../../AZURE_RTOS/App -I../../USBX/App -I../../USBX/Target -I../../../../../../../Drivers/STM32C0xx_HAL_Driver/Inc -I../../../../../../../Middlewares/ST/threadx/common/inc -I../../../../../../../Drivers/CMSIS/Device/ST/STM32C0xx/Include -I../../../../../../../Middlewares/ST/threadx/ports/cortex_m0/gnu/inc -I../../../../../../../Middlewares/ST/usbx/common/core/inc -I../../../../../../../Middlewares/ST/usbx/ports/generic/inc -I../../../../../../../Middlewares/ST/usbx/common/usbx_stm32_device_controllers -I../../../../../../../Middlewares/ST/usbx/common/usbx_device_classes/inc -I../../../../../../../Drivers/CMSIS/Include -I../../../../../../../Drivers/STM32C0xx_HAL_Driver/Inc/Legacy -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_transfer_abort.d" -MT"Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_transfer_abort.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_transfer_abort.o"
In file included from C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32.h:57,
from C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32_endpoint_create.c:30:
../../USBX/Target/ux_stm32_config.h:29:10: fatal error: stm32c0xx_hal.h: No such file or directory
29 | #include "stm32c0xx_hal.h"
| ^~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Middlewares/USBX/UX Device Controllers/subdir.mk:60: Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_endpoint_create.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32.h:57,
from C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32_callback.c:30:
../../USBX/Target/ux_stm32_config.h:29:10: fatal error: stm32c0xx_hal.h: No such file or directory
29 | #include "stm32c0xx_hal.h"
| ^~~~~~~~~~~~~~~~~
compilation terminated.
In file included from C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32.h:57,
from C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32_endpoint_destroy.c:30:
../../USBX/Target/ux_stm32_config.h:29:10: fatal error: stm32c0xx_hal.h: No such file or directory
29 | #include "stm32c0xx_hal.h"
| ^~~~~~~~~~~~~~~~~
make: *** [Middlewares/USBX/UX Device Controllers/subdir.mk:58: Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_callback.o] Error 1
compilation terminated.
In file included from C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32.h:57,
from C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32_endpoint_stall.c:30:
../../USBX/Target/ux_stm32_config.h:29:10: fatal error: stm32c0xx_hal.h: No such file or directory
29 | #include "stm32c0xx_hal.h"
| ^~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Middlewares/USBX/UX Device Controllers/subdir.mk:62: Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_endpoint_destroy.o] Error 1
In file included from C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32.h:57,
from C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32_endpoint_reset.c:30:
../../USBX/Target/ux_stm32_config.h:29:10: fatal error: stm32c0xx_hal.h: No such file or directory
29 | #include "stm32c0xx_hal.h"
| ^~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Middlewares/USBX/UX Device Controllers/subdir.mk:66: Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_endpoint_stall.o] Error 1
make: *** [Middlewares/USBX/UX Device Controllers/subdir.mk:64: Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_endpoint_reset.o] Error 1
In file included from C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32.h:57,
from C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32_endpoint_status.c:30:
../../USBX/Target/ux_stm32_config.h:29:10: fatal error: stm32c0xx_hal.h: No such file or directory
29 | #include "stm32c0xx_hal.h"
| ^~~~~~~~~~~~~~~~~
compilation terminated.
In file included from C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32.h:57,
from C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32_frame_number_get.c:30:
../../USBX/Target/ux_stm32_config.h:29:10: fatal error: stm32c0xx_hal.h: No such file or directory
29 | #include "stm32c0xx_hal.h"
| ^~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Middlewares/USBX/UX Device Controllers/subdir.mk:68: Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_endpoint_status.o] Error 1
In file included from C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32.h:57,
from C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32_function.c:30:
../../USBX/Target/ux_stm32_config.h:29:10: fatal error: stm32c0xx_hal.h: No such file or directory
29 | #include "stm32c0xx_hal.h"
| ^~~~~~~~~~~~~~~~~
compilation terminated.
In file included from C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32.h:57,
from C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32_initialize.c:30:
../../USBX/Target/ux_stm32_config.h:29:10: fatal error: stm32c0xx_hal.h: No such file or directory
29 | #include "stm32c0xx_hal.h"
| ^~~~~~~~~~~~~~~~~
In file included from C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32.h:57,
from C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32_initialize_complete.c:32:
../../USBX/Target/ux_stm32_config.h:29:10: fatal error: stm32c0xx_hal.h: No such file or directory
29 | #include "stm32c0xx_hal.h"
| ^~~~~~~~~~~~~~~~~
make: *** [Middlewares/USBX/UX Device Controllers/subdir.mk:70: Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_frame_number_get.o] Error 1
compilation terminated.
compilation terminated.
In file included from C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32.h:57,
from C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32_interrupt_handler.c:30:
../../USBX/Target/ux_stm32_config.h:29:10: fatal error: stm32c0xx_hal.h: No such file or directory
29 | #include "stm32c0xx_hal.h"
| ^~~~~~~~~~~~~~~~~
compilation terminated.
In file included from C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32.h:57,
from C:/Projects/STM32CubeIDEWorkspace/STM32CubeC0-main/Middlewares/ST/usbx/common/usbx_stm32_device_controllers/ux_dcd_stm32_transfer_abort.c:30:
../../USBX/Target/ux_stm32_config.h:29:10: fatal error: stm32c0xx_hal.h: No such file or directory
29 | #include "stm32c0xx_hal.h"
| ^~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Middlewares/USBX/UX Device Controllers/subdir.mk:72: Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_function.o] Error 1
make: *** [Middlewares/USBX/UX Device Controllers/subdir.mk:74: Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_initialize.o] Error 1
make: *** [Middlewares/USBX/UX Device Controllers/subdir.mk:76: Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_initialize_complete.o] Error 1
make: *** [Middlewares/USBX/UX Device Controllers/subdir.mk:78: Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_interrupt_handler.o] Error 1
make: *** [Middlewares/USBX/UX Device Controllers/subdir.mk:80: Middlewares/USBX/UX Device Controllers/ux_dcd_stm32_transfer_abort.o] Error 1
"make -j12 all" terminated with exit code 2. Build might be incomplete.
21:43:41 Build Failed. 25 errors, 0 warnings. (took 984ms)
2025-03-27 10:41 AM - edited 2025-03-27 11:09 AM
Hi,
I have added - 'HAL_PCD_Start(&hpcd_USB_DRD_FS);' in my custom board application and now when connect its USB port to my PC I get message - 'USB device not recognized'. So now my custom board is also at same level as my Nucleo-C071 board.
I tried increasing Heap memory size from 0x200 to 0x1000 but it didn't help.
Do I need to install any driver on PC side?
Do I have to enable ThreadX to make USBX work?
Thanks,
Pradeep
2025-03-27 1:54 PM
@PPate.1 The ST example is for "standalone" USBX, that means, no ThreadX. So make sure the USBX package is installed (in software components). If it still does not build for the Nucleo board, hopefully ST people can look at this and suggest.
No custom drivers on PC side are needed for Windows 10 and 11.
2025-03-28 3:37 AM
Hi @PPate.1
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.