cancel
Showing results for 
Search instead for 
Did you mean: 

USB not recognized by PC in FreeRTOS

alyssa
Associate II

Hi, I want to get log using Type-c, and using freertos to run all the tasks.

setting:

MCU STM32L4A6VG

STM32CubeIDE 1.12.0

STM32CubeMX  6.8.0

tera term 4.106

alyssa_0-1723607387160.pngalyssa_1-1723607401827.pngalyssa_2-1723607423269.png

alyssa_4-1723607858546.png

alyssa_8-1723630965206.png

when i insert Type-c, device manager return the unknown usb.

alyssa_5-1723608106367.pngalyssa_6-1723608116023.png

I try some methods:

1. put MX_USB_DEVICE_Init() before  MX_FREERTOS_Init() -->unknown usb error 43

2. put MX_USB_DEVICE_Init() in task -->unknown usb error 43

3. increase MINIMAL_STACK_SIZE to 1024  -->unknown usb error 43  (ref: https://community.st.com/t5/stm32cubemx-mcus/nucleo-h723zg-usb-cdc-communication-not-working-when-using/m-p/662907 )

4. change clock output  -->unknown usb error 43(ref: https://community.st.com/t5/stm32cubemx-mcus/unknown-usb-device-on-stm32f429zi-device/m-p/75508 )

5. i dont think i need interrupt in usb, but this ref make me confused (ref:https://community.st.com/t5/stm32-mcus-embedded-software/stm32g0b1-usb-device-not-recognized-in-windows-10/m-p/135939  )

It will be very helpful if any one tell me something. Thank you.

8 REPLIES 8
TDK
Guru

Can you include your code?

You definitely need USB interrupts enabled.

If you feel a post has answered your question, please click "Accept as Solution".
FBL
ST Employee

Hi @alyssa 

 

Based on these attachments, there might be missing or incorrect device descriptors in your configuration. You need to check them.

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.

alyssa
Associate II

Hi, 

thank you for you reply.

If you say the interrupt in NVIC settings. I have set it before (sorry make you confused), but still get unknown usb error 43.

alyssa_0-1723714551967.png

i attach the main.c below. (for just testing usb, i disable the FreeRTOS)

but i dont think this is a FW problem.

because when i  use Full chip erase by STM32CubeProgrammer v2.13.0, the PC still tell me the unknown usb error 43.

i think without the FW, PC can recognize STM32 BOOTLOADER when insert usb.

 

alyssa
Associate II

Hi,

i make a only-usb setting. but still get same problem.

(nothing is changed, all the code is generated by STM32CubeMX  6.8.0.)

> i think without the FW, PC can recognize STM32 BOOTLOADER when insert usb.

This is true. So perhaps there is a hardware error. Can you show your schematic?

Do you have a Nucleo or other known good ST board you can test this one?

If you feel a post has answered your question, please click "Accept as Solution".

As suggested @TDK , please share your schematics or try to reproduce on reference board so that we might help you investigate further. Try to update all your SW tools.

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.

alyssa
Associate II

Hi, 

sorry for the delay.

I attach the schematic below.

Hi @alyssa 

You  need to ensure that the D+ and D- lines in design are equal in length and respect differential pair routing guidelines as referenced in AN4879 is crucial for maintaining signal integrity and achieving reliable USB communication. In your screenshot 102632 these rules are not respected. D+ and D- lines should be of equal length and consistent spacing.

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.