Because of my little experience debugging ChibiOs, it took me some time to find that function f_write() in fatfs was returning a 'time out' error and that I can solve it modifying parameter _FS_TIMEOUT (Timeout period in unit of time tick) in ffconf.h.
But that do not explains why I got this error with ChibiOs 3 and not with version 2.
Until I notice that the system tick frequency defined by CH_FREQUENCY in version 2 and equal to 1000 for almost all the boards was now defined by CH_CFG_ST_FREQUENCY and that this value has increased for many boards. Especially, for the STM32-E407, his value is now 10000.
So, without modifying any parameter in ffconf.h, the time out period was divided by 10.
To avoid this inconvenience, I would like to know if it is a good idea to define _FS_TIMEOUT in function of system tick frequency.
For example:
Code: Select all
#define _FS_TIMEOUT CH_CFG_ST_FREQUENCY // timeout period of 1 secondOr if it is considered a bad programming practice?