Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


STM32L0538 using FATFS with SPI

Hi,
I’m trying to read a memory card with FATFS through SPI, so I generated a project with CubeMX on my board (L0538-discovery). I think my problem is that I don’t give FATFS the right driver to link, because I get a FR_NO_FILESYSTEM when I try to f_open (but no error before), and the only driver I seem to have access to is USER_DRIVER. Does anyone know what is the driver I have to pass to FATSFS_LinkDriver before starting to use f_xxx function ?

Thanks

Hi,

follow the call of MX_FATFS_Init() and look what it does.

If you use a plain CubeMX generated project you have to fill the 5 skeleton functions in user_diskio.c
Then provide what these functions needs.

There are examples in STM32Cube_FW_L0... repository.

For example the IO functions:
STM32Cube_FW_L0_V1.5.0/Drivers/BSP/Adafruit_Shield/stm32_adafruit_sd.c

For example the example user_diskio.c:
STM32Cube_FW_L0_V1.5.0/Middlewares/Third_Party/FatFs/src/drivers/sd_diskio.c

Dieter


Thank you for the explanations and examples !

I adapted the files you showed me to my board (pins, leds, ..), but I have an FR_DISK_ERR when mount my device. Does anyone have a solution to know where it may comes from ? (Or which function between write, read and iodl)


 

Newest Forum Posts

  1. SPI on Nucleo_STMH533RE by royjamil, 2025-05-04 20:13
  2. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  3. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  4. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  5. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  6. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  7. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  8. Build a project in "release" mode by tang, 2025-02-20 10:36
  9. Build a project in "release" mode by info@creosrl.it, 2025-02-19 17:35
  10. Fail to debug in Win 11 C/C++ by mortenlund, 2024-12-26 20:27

Last-Modified Blogs