2022-04-23 08:50 PM
Hi,
Iam student on Sheffield hallam university and I called by sulaiman Alsaffar discover bug when working on stm32f407 discovery board.
This bug set the 5v for the vbus low which make it unactive in patch 6.4.0 .I had to read all folder that generate by the mx usb drive to fix this problem since it wont let you use usb because it wont get enough voltage and it not mentioned anywhere and wasn't there before.
Fixing the issue with USB MSC
The USB Mass Storage Class was not working because of insufficient voltage supply to
VBUS. It was figured out that the usbh_platform.c file generated by the CubeMX software was
having issues.
By making necessary modifications, the expected outcome was obtained.
Before fix
/**
*@brief Drive VBUS.
* @param state : VBUS state
* This parameter can be one of the these values:
* -1: VBUS Active
* -0 : VBUS Inactive
*/
void MX_DriverVbusFS(uint8_t state)
{
uint8_t data - state;
/* USER CODE BEGIN PREPARE_GPIO_DATA_VBUS_FS */
if(state == 0)
{
/* Drive high Charge pump */
data - GPIO PIN_RESET;
}
else
{
/* Drive low Charge pump */
data - GPIO_PIN_SET;
/* USER CODE END PREPARE_GPIO_DATA_VBUS_FS */
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_O, (GPIO_PinState)data);
After the fix
/**
*@brief Drive VBUS.
* @param state : VBUS state
* This parameter can be one of the these values:
* -1: VBUS Active
* -0 : VBUS Inactive
*/
void MX_DriverVbusFS(uint8_t state)
{
uint8_t data - state;
/* USER CODE BEGIN PREPARE_GPIO_DATA_VBUS_FS */
if(state == 1)
{
/* Drive high Charge pump */
data - GPIO PIN_RESET;
}
else
{
/* Drive low Charge pump */
data - GPIO_PIN_SET;
/* USER CODE END PREPARE_GPIO_DATA_VBUS_FS */
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_O, (GPIO_PinState)data);
I hope you find this helpful :)
Sincerely appreciate for your read and effort.
Solved! Go to Solution.
2022-05-11 08:33 AM
2022-04-26 04:38 AM
Hello @sAlsa.1
In order to allow a better analysis of this problem, could you please share your project to reproduce the issue?
Thanks in advance.
BeST Regards,
Walid
2022-05-11 08:32 AM
2022-05-11 08:33 AM
2022-05-12 12:51 AM
Hello @sAlsa.1,
Good news! Thank you for sharing the fix :smiling_face_with_smiling_eyes:
BeST Regards,
Walid