cancel
Showing results for 
Search instead for 
Did you mean: 

Host USB application on discovery L4

andrea6388
Associate II
Posted on September 21, 2016 at 14:24

Good afternoon,

I am developing an application on the L4 discovery to log data on an USB, using FATFs and based on the example project from the STM32F4 library.

The initialization seems to go smoothly but when I call f_mount() a function inside it called find_volume() gives back the reply FR_NO_FILESYSTEM.

Has someone succeded in what I'm trying to do? 

&sharpUPDATE: I checked and the returned value is issued by this line:

if (LD_WORD(fs->win.d8 + BPB_BytsPerSec) != SS(fs)) /* (BPB_BytsPerSec must be equal to the physical sector size) */

return FR_NO_FILESYSTEM;

what does it means? 

#usb #stm32l4 #hal #fatfs
2 REPLIES 2
andrea6388
Associate II
Posted on September 23, 2016 at 08:42

If anyone would need it, I managed to solve the problem:

for me the example now works just fine, with a couple of fixes:

1 - In the f_mount() function, comment last return FR_OK to force the mount before opening;

2 - Increase heap and stack size. I am not an expert embedded programmer so I cannot give you a correct way to taylor the dimension to the application, for me doubling the standard sizes worked.

Any comment on these changes that could explain how they effect would be appreciable.