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


Writing on a SD card, but nothing written

Hi,
I used SPI and FatFs to connect a SD card to my STM32L053R8 and I think I managed to initialize the connection. I used adafruit code and SD_IO_Init function. I attached the main.c file. The only way I found to notice the errors was to toggle the led on times depending where the error was (if you have any tip on how to make it differently, I’m interested in it (!).
The problem I have is that the files on the SD card are not changed after the code is sent. And the Led is blinking with a 14s period.. I previously had problems with f_mount and f_open but it seems to be solved.
Maybe it could come from the card itself, it is a 4GB micro sdhc card, I tried to format it in many configurations (exFat with xxx bytes, actually it is FAT with 64KB), but I don’t really know which one should work, and if there is a link beween the 64KB and the parameter in the FatFs config..

Thanks !

Problem solved, still don’t know how I did but now it seems to work :-)

hi

im trying to connect sd card wit stm32f303 discovery board through spi protocol but i’m not getting any resources for it. please help me for sd card initialization .

i also doing same , now i can write into the sd card from spi but i cannot integrate with fatfs

Hi, can you give me some guidance to be able to read/write on the sd card, or at least mount it.

thanks


Hi,

you have to fill the function in user_diskio.c to initialize and use fatfs.
I adapted (?) the following files (I don’t remenber who told me that, sorry):
- C:..\STM32Cube\Repository\STM32Cube_FW_L0_V1.8.0\Middlewares\Third_Party\FatFs\src\drivers\sd_diskio.c, it will be named as user_diskio.c
- C:..\STM32Cube\Repository\STM32Cube_FW_L0_V1.8.0\Drivers\BSP\Adafruit_Shield\stm32_adafruit_sd.c
- C:..\STM32Cube\Repository\STM32Cube_FW_L0_V1.8.0\Drivers\BSP\STM32L0xx_Nucleo\stm32l0xx_nucleo.c
I didn’t modify those files but only the headers (stm32_adafruit_sd.h,...) to connect have the right pins and settings on my board. I don’t know if you need to have a nucleo board to use the nucleo file but you can try.
My new bible is Carmine Norviello’s book : Mastering STM32. If what’s written here doesn’t work yet, try to use the initialization code given in this book (only in your main.c), I’ll try to find it if you need.


 

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