Trouble Writing to SD card with Simulink Embedded Coder Support for STM32 Microcontroller

9 views (last 30 days)
Has anyone successfully used this Simulink STM32 guide to write to an SD card? I am trying to run a simulink model on a Nucleo-F767ZI and write the output to an SD card. I have tried to follow the directions, but it is not working. The model can compile and run on the board, but when I check the SD card, it is still empty. I have tried different clock speeds, 1-bit and 4-bit modes, but nothing seems to work. I scoped the clock signal, and it seems to be at 400 kHz, which is indicative of it being in the initialization stage. Does anyone know what may be wrong? Thanks!

Accepted Answer

Elizabeth
Elizabeth on 1 May 2025
SOLUTION: I contacted MatLab support and they were very helpful. They instructed me to enable "SDMMC Hardware Flow Control" in SDMMC Parameter settings. Using 1-bit mode, with a clock divide factor of 10, it worked! I have attached a screenshot of the settings I used. They said you can use 4-bit mode but it usually has more problems. Hopefully this helps someone else from the hastle:)

More Answers (0)

Products


Release

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!