HS USB MSC as Device --> formatting error on Host
Hi,
I am trying to set up a basic HS USB MSC project on a custom board with an STM32F723.
The project is based on these tutorials from ST, the only difference is, that I'm using USB HS and not USB FS.
https://www.st.com/content/st_com/en/support/learning/stm32-education/stm32-moocs/STM32-USB-training.html
https://www.youtube.com/watch?v=GjQqZd1keBo&ab_channel=STMicroelectronics
https://www.youtube.com/watch?v=Us_sTdGGcOQ&t=363s&ab_channel=ControllersTech
I'll shortly show the CubeMX setup and the code changes I made (all like in the tutorials) and then I will show what the error Message is on the Host.
Project Setup:
Linker Settings:
Minimum Heap Size 0x2000
Minimum Stack Size 0x2000
- Clock Config

- USB_HS config

- USB_Device config

This is are all configuration I made. The rest is set to default when you start a new project with the project wizard. The IOC File is also attached to this post.
In the code I made these addons in the usbd_storage_if.c file:
#define STORAGE_LUN_NBR 1
#define STORAGE_BLK_NBR 0x10000
#define STORAGE_BLK_SIZ 0x200
/* USER CODE BEGIN PRIVATE_DEFINES */
#define STORAGE_BLK_NBR 128
uint8_t usb_buffer[STORAGE_BLK_NBR*STORAGE_BLK_SIZ];int8_t STORAGE_Read_HS(uint8_t lun, uint8_t *buf, uint32_t blk_addr, uint16_t blk_len)
{
/* USER CODE BEGIN 13 */
memcpy(&usb_buffer[blk_addr*STORAGE_BLK_SIZ], buf, blk_len*STORAGE_BLK_SIZ);
return (USBD_OK);
/* USER CODE END 13 */
}
int8_t STORAGE_Write_HS(uint8_t lun, uint8_t *buf, uint32_t blk_addr, uint16_t blk_len)
{
/* USER CODE BEGIN 14 */
memcpy(buf, &usb_buffer[blk_addr*STORAGE_BLK_SIZ], blk_len*STORAGE_BLK_SIZ);
return (USBD_OK);
/* USER CODE END 14 */
}
After building and running the FW the host computer (Windows 10) detects a new storage device and shows this message (german):

It say's you have to format the device before using it.
If I do so:

I'll get this error message which says: Windows could not complete the formatting

I have also tried to format the device on an Linux host which also failed.
In the link I shared on the top, the youtube Video from ST, there people in the comments facing the same problems.
Further it is to say, that the USB CDC example works. So the USB connection works.
Is there anyone faced the same problems and have a solution?
