cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F0 HAL Firmware 1.0.9 Usb bug

Simon Benoit
Associate
Posted on June 01, 2018 at 02:34

Hi,

I am new to forum posting and I don't really know how to start ....

It's been a while since I wanted to give the HAL drivers a chance and every time ... I get disappointed. My guess is that they use their interns to code the drivers and no one review them before releasing a package.

Enough said, let's get to the point. I generated a template with STM32 CubeMx on my discovery STM32F072 and wanted to have the USB CDC interface. While looking for a mysterious bug that hangs the micro and bring it to a hard fault, I have found some interesting thing in the file : usbd_code.h

Once again, I don't know where else to go to report this bug, so. Let's take, for example

/**

* @brief USBD_Start

* Start the USB Device Core.

* @param pdev: Device Handle

* @retval USBD Status

*/

USBD_StatusTypeDef

USBD_Start

(USBD_HandleTypeDef

*

pdev)

{

   

/* Start the low level driver */

   USBD_LL_Start

(pdev);

   return

 USB_OK;

}

See that return value that always return USB_OK ?

So my fix here would be :

USBD_StatusTypeDef

USBD_Start

(USBD_HandleTypeDef

*

pdev)

{

/* Start the low level driver */

return

USBD_LL_Start

(pdev);

}

Let me know if I am wrong, but I have to go through all this file to edit all the return values or else ... they are useless.

#stm32cube---bug-report #usb-fs-cdc #usb_device #stm32cube-fw_f0-1.9.0
1 REPLY 1
Khouloud GARSI
Lead II
Posted on June 08, 2018 at 15:48

Hi

simon.benoit

‌,

We are trying our best to provide a good quality of STM32 software. However, if you encounter a bug, please just share it here. One of our moderators will check it and a fix will be implemented (if needed).

The STM32MCUs Forum is not only a question/answer space , it also allows you to express your ideas, report potential bugs, propose enhancements...

So, thanks for sharing your feedback here.

About the point you have highlighted, the returned 'USB_OK' just reflects the USB device status and will not hang the MCU or cause the 'Hard Fault' you're getting.

In your case, was commenting ' return USB_OK;' the only modification you did in order to resolve your issue?

Khouloud.