cancel
Showing results for 
Search instead for 
Did you mean: 

USB Error 43 when using the NucleoWB55 Dongle.

rcard
Associate II

i'm trying to use the Nucleo WB55 dongle as a mass storage device.

Using cubeMx i set the USB, and the USB Middleware as MSC, leaving the default settings. Nothing else is running on the dongle, just USB.

When i plug it, it appear as an unknown device. Windows is returning an Error 43 Code [

43 (CM_PROB_FAILED_POST_START)]

Uppon connection, USB events are as follow:

000000: PnP Event: Device Connected (UP), 2019-08-23 11:07:13,0401325 (1. Device: Unknown)

The USB device has just been connected to the system.

000001: PnP Event: Surprise Removal (UP), 2019-08-23 11:07:13,0411870 +0,0010545 (1. Device: Unknown)

The USB device has just been disconnected from the system.

000002: PnP Event: Device Disconnected (UP), 2019-08-23 11:07:13,0413300 +0,0001430 (1. Device: Unknown)

The USB device has just been removed from the system, all drivers unloaded

Using debug, i checked that nothing was skipped, and i also add printf messages through SWO to be sure that all the USB init is done properly. And also to check what happen once the interrupt is enabled in USBD_Start().

The following is the start of the SWO message, showing that all the MX_USB_Device_Init() is done without error, and showing the function call made in HAL_PCD_IRQHandler().

USBD_Init returned USBD_OK @ 1 ms
USBD_RegisterClass returned USBD_OK @ 1 ms
USBD_MSC_RegisterStorage returned USBD_OK @ 2 ms
0 - HAL_PCD_ResetCallback @ 3 ms
1 - HAL_PCD_SetAddress @ 3 ms
USBD_Start returned USBD_OK @ 4 ms
2 - HAL_PCD_SuspendCallback @ 6 ms
3 - HAL_PCD_ResumeCallback @ 104 ms
4 - HAL_PCD_ResetCallback @ 158 ms
5 - HAL_PCD_SetAddress @ 158 ms
6 - HAL_PCD_SOFCallback @ 158 ms
7 - HAL_PCD_SOFCallback @ 159 ms
8 - HAL_PCD_SOFCallback @ 160 ms
9 - HAL_PCD_SOFCallback @ 161 ms
10 - HAL_PCD_SOFCallback @ 162 ms
11 - HAL_PCD_SOFCallback @ 163 ms
12 - HAL_PCD_SOFCallback @ 164 ms
13 - HAL_PCD_SOFCallback @ 165 ms
14 - HAL_PCD_SOFCallback @ 166 ms
15 - HAL_PCD_SOFCallback @ 167 ms
16 - HAL_PCD_SOFCallback @ 168 ms
17 - HAL_PCD_SOFCallback @ 169 ms
18 - HAL_PCD_SOFCallback @ 170 ms
19 - HAL_PCD_SOFCallback @ 171 ms

the HAL_PCD_IRQHandler() call several functions (mostly the SOFcallback) for 2150ms.

I tried that on different computer, on W10 & W7.

And the strangest part is: it work on my own computer (W7).

My own computer is the only one where the USB is working fine.

I don't understand why. On every computer i checked the drivers, nothing wrong.

I don't need an external pull up, and the DPPU bit that turn on the pullup is called and work as expected. DP/DM are not swapped (even though it's an STM product i checked to be sure)

Vbus is perfect, and to be safe i also add a small delay before the USB Init.

I created different project, using different settings, but still error 43.

I don't know what could cause that issue and at that point i think i tried everything.

That issue is above my knowledges.

So if you have any idea, feel free to give your opinion.

Romain

1 ACCEPTED SOLUTION

Accepted Solutions
Le Corre Pierre
Associate III

dear @rcard​,

Even if it is not a direct response to your question, i stronlgy recommend you to start with a working environment before trying to move to a from scratch solution.

The STM32Cube_FW_WB_V1.2.0 contains 2 applications to demonstrate the USB application on the P-NUCLEO-WB55.USBDongle and 4 USB applications on P-NUCLEO-WB55.Nucleo.

It is not MSC but HID and DFU for P-NUCLEO-WB55.USBDongle.

On the P-NUCLEO-WB55.Nucleo, you can have your exact setup: MSC (Warning: This application requires a separated shield (Adafruit 1.8" TFT shield) to embeded an sd card!).

USB_Device

 CDC_Standalone (P-NUCLEO-WB55.Nucleo)

  •    This application describes how to use USB device application based on the Device Communication Class (CDC) following the PSTN sub-protocol on the STM32WBxx devices.

 DFU_Standalone (P-NUCLEO-WB55.Nucleo and P-NUCLEO-WB55.USBDongle)

  •    Compliant implementation of the Device Firmware Upgrade (DFU).

 HID_Standalone (P-NUCLEO-WB55.Nucleo and P-NUCLEO-WB55.USBDongle)

  •    Use of the USB device application based on the Human Interface (HID).

 MSC_Standalone (P-NUCLEO-WB55.Nucleo)

  •    This application shows how to use the USB device application based on the Mass Storage Class (MSC) on the STM32WBxx devices.

Those example are created with STM32CubeMX so you can check which part is missing on your environment.

They can be found under :

  • Projects\P-NUCLEO-WB55.Nucleo\Applications\USB_Device
  • Projects\P-NUCLEO-WB55.USBDongle\Applications\USB_Device

I just test on my laptop Win10 P-NUCLEO-WB55.USBDongle with HID_Standalone and P-NUCLEO-WB55.Nucleo with MSC_Standalone (be sure to have the Adafruit 1.8" TFT shield and a sd card) and they behave as expected to demonstrate the USB device mode of STM32WB55xx.

BR.

Pierre.

View solution in original post

5 REPLIES 5
Le Corre Pierre
Associate III

dear @rcard​,

Even if it is not a direct response to your question, i stronlgy recommend you to start with a working environment before trying to move to a from scratch solution.

The STM32Cube_FW_WB_V1.2.0 contains 2 applications to demonstrate the USB application on the P-NUCLEO-WB55.USBDongle and 4 USB applications on P-NUCLEO-WB55.Nucleo.

It is not MSC but HID and DFU for P-NUCLEO-WB55.USBDongle.

On the P-NUCLEO-WB55.Nucleo, you can have your exact setup: MSC (Warning: This application requires a separated shield (Adafruit 1.8" TFT shield) to embeded an sd card!).

USB_Device

 CDC_Standalone (P-NUCLEO-WB55.Nucleo)

  •    This application describes how to use USB device application based on the Device Communication Class (CDC) following the PSTN sub-protocol on the STM32WBxx devices.

 DFU_Standalone (P-NUCLEO-WB55.Nucleo and P-NUCLEO-WB55.USBDongle)

  •    Compliant implementation of the Device Firmware Upgrade (DFU).

 HID_Standalone (P-NUCLEO-WB55.Nucleo and P-NUCLEO-WB55.USBDongle)

  •    Use of the USB device application based on the Human Interface (HID).

 MSC_Standalone (P-NUCLEO-WB55.Nucleo)

  •    This application shows how to use the USB device application based on the Mass Storage Class (MSC) on the STM32WBxx devices.

Those example are created with STM32CubeMX so you can check which part is missing on your environment.

They can be found under :

  • Projects\P-NUCLEO-WB55.Nucleo\Applications\USB_Device
  • Projects\P-NUCLEO-WB55.USBDongle\Applications\USB_Device

I just test on my laptop Win10 P-NUCLEO-WB55.USBDongle with HID_Standalone and P-NUCLEO-WB55.Nucleo with MSC_Standalone (be sure to have the Adafruit 1.8" TFT shield and a sd card) and they behave as expected to demonstrate the USB device mode of STM32WB55xx.

BR.

Pierre.

rcard
Associate II

Hello,

Thanks for your answer. I'm going to try that and see if i can finally run USB without the error code 43.

Romain

rcard
Associate II

Ok so the applications seems to work fine. So now i need to find where my error is, and what i have made differently.

Thanks again, i never though of ST's example .

Romain

So, to give an update on this issue:

I modified the MSC Standalone for the NucleoWB55 (not the dongle) to use the SRAM instead of a SD card (because i don't have the adafruit shield). And boom it worked. I now have a working MSC App.

The thing is i still don't understand why. I followed ST's youtube video to setup the USB MSC, and it didn't work. But for some reason the ST App is running fine.

The only thing i can think of is the clock. In my app i used the 32MHz HSE to clock the USB. I should have tried with the internal RC. Even though it's not that logical.

Now i will try to transfer the code from the STM32WB55RG to the STM32WB55CC and see if i can still having it to work.

Ok so i have transferred file by file the working project to the non working project, and i narrowed the faulty part to be in the usbd_desc.c file.

I can't find my error, but copying the MSC_Standalone usbd_desc.c file to my project solved the issue. I guess at some point in the setting i made a mistake.

Thanks again @Le Corre Pierre​ without you i would not have though of the ST's application.

Have a good day.

Romain