2019-03-12 12:28 AM
in usbh_msc.c
if(status == USBH_OK)
{
MSC_Handle->max_lun = (MSC_Handle->max_lun > MAX_SUPPORTED_LUN)? MAX_SUPPORTED_LUN : (uint8_t )(MSC_Handle->max_lun) + 1U;
USBH_UsrLog ("Number of supported LUN: %lu", (int32_t)(MSC_Handle->max_lun));
for(i = 0U; i < MSC_Handle->max_lun; i++)
{
MSC_Handle->unit[i].prev_ready_state = USBH_FAIL;
MSC_Handle->unit[i].state_changed = 0U;
}
}
refer to https://usb.org/sites/default/files/usbmassbulk_10.pdf in page7
Data of GetMaxLun would be 1 byte.
So I think
MSC_Handle->max_lun = (MSC_Handle->max_lun > MAX_SUPPORTED_LUN)? MAX_SUPPORTED_LUN : (uint8_t )(MSC_Handle->max_lun) + 1U;
would be
MSC_Handle->max_lun = ( ((uint8_t)MSC_Handle->max_lun) > MAX_SUPPORTED_LUN)? MAX_SUPPORTED_LUN : (uint8_t )(MSC_Handle->max_lun) + 1U;
Is it right?
Solved! Go to Solution.
2020-02-26 01:19 AM
Thank you Imen, indeed fixed in STM32CubeF4 V1.25.0 released a few days ago, I tried this morning.
One year later, fixed ! Whatever, thank you.
2020-02-26 01:34 AM
You are welcome.
Thank you @yjsbd, @Community member and @Ede S for your contribution and enhancement of our STM32 resources.