2023-11-15 12:01 PM
Hi! Hope everyone are doing well! I currently encounter a problem and can't solve it. I want to write some pieces of data into a file in a usb-disk and now the Appli_state is constantly idle even I connect the USB-Disk already.
This is a test demo code from main.c and set up for USB related port. Thanks so much for your support!
Solved! Go to Solution.
2023-11-15 01:54 PM
Question: can you read ? or read things ?
2023-11-15 12:29 PM
Hi, just : what IS working here ?
i just suggest: dont write, at first try to read (existing file) and proof, its working.
write or format mkfs just could destroy the device... so dont do this. if mount - open- read - working fine, then you can do some write.
2023-11-15 12:39 PM
Hi,
Question is that the state is always idle and can’t do the open, write things
2023-11-15 01:54 PM
Question: can you read ? or read things ?
2023-11-15 05:21 PM
I can use now use f_mount and it works. But when I try f_open it returns FR_NO_FILESYSTEM. How can I solve it?
2023-11-15 11:32 PM
probably you use mount with parameter 0 = delayed mount. (so you see the error at first read/open )
try :
fresult = f_mount(&SDfs, (TCHAR const*)SDPath, 1); // SD card mount now !
if no mount success, you have a hardware problem or low level access not working.
look at (set breakpoint ...)
static void USBH_UserProcess... (USBH_HandleTypeDef *phost, uint8_t id)
{
/* USER CODE BEGIN CALL_BACK_2 */
switch(id)
{
case HOST_USER_SELECT_CONFIGURATION:
break;
case HOST_USER_DISCONNECTION:
Appli_state = APPLICATION_DISCONNECT;
break;
case HOST_USER_CLASS_ACTIVE:
Appli_state = APPLICATION_READY;
break;
case HOST_USER_CONNECTION:
Appli_state = APPLICATION_START;
break;
-- is _ready or _start recognized ? then debug _mount , to see, whats the problem.