3
\$\begingroup\$

I am trying to make small data logger project with STM32F072 as an opportunity to get more familiar with STM's HAL.

With CubeMX I generated HAL code that has SPI and also includes FatFS.

Right now I am having issue gluing SPI low level drivers to FatFS.

Can someone please point me in the right direction or post some examples on how to glue HAL SPI functions to FatFS? Right now I see that there is following declaration generated by HAL, but I can't seem to find any actual implementation that works.

Diskio_drvTypeDef  USER_Driver =
{
  USER_initialize,
  USER_status,
  USER_read, 
#if  _USE_WRITE
  USER_write,
#endif  /* _USE_WRITE == 1 */  
#if  _USE_IOCTL == 1
  USER_ioctl,
#endif /* _USE_IOCTL == 1 */
};

Any examples or documentation on how to implement this would be very much appreciated.

\$\endgroup\$

1 Answer 1

7
\$\begingroup\$

I've finally manage to implement low-level drivers and they seem to work nicely.

I'm sharing source code of my implementation in case somebody else gets stuck at the same part that I was.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ thanks for making your code accessible, it worked instantly. \$\endgroup\$ Commented Sep 3, 2017 at 13:35
  • \$\begingroup\$ @Calculon. Your solution could be really useful to me.... but the link does not work. Are you able to fix? \$\endgroup\$
    – TheGrovesy
    Commented Sep 26, 2017 at 15:39
  • \$\begingroup\$ @TheGrovesy Sorry about that. My GitHub username got changed so the gist was no longer pointing to the correct account. I've fixed it so you should be good now. Let me know if you need any additional help. \$\endgroup\$
    – Calculon
    Commented Sep 28, 2017 at 2:04

Not the answer you're looking for? Browse other questions tagged or ask your own question.