USBX MSC + FileX + NAND Flash - Windows I/O
Hello,
I am building and application with a STM32U575 and a 4Gb NAND Flash. What I am trying to achieve now is to upload files from my PC through USB and then used these file within the STM32 using FileX.
I already managed to set up FileX and LevelX to create and manipulate files within the MCU. Then I managed to get a USBX MSC device to appead in windows, with correct capacity, name etc..
Finally I tried to implement the read/write functions in ux_device_msc.c by using the FileX function fx_media_read and fx_media_write. And not I have some issues in the wrinting method.
If I implement the read function "USBD_STORAGE_Read" only, leaving the write function empty, everyting works fine. I am able to find and read my files from windows.
From the moment I implement the USBD_STORAGE_Write function, nothing works anymore. In this configuration, the USB MSC apprears in windows with a capacity of 0 octets and windows stalls if I try to access it. After some digging, I found out that windows tries to write at block 0, which is prevented by the fx_media_write function.
What am I doing wrong here?
Thank you in advance for your help.
