Page 1 of 1

STM32F407VET6 Data Logging Issue – Need Help!

Posted: Wed Oct 09, 2024 10:21 am
by Mithilesh
Hi all,

I’m facing issues with data logging on my STM32F407VET6 using FatFs and an SD card via SPI. The logging starts fine but then either freezes or corrupts the file after some time. I’ve tried adjusting buffer sizes, checked SPI communication, and ensured a stable power supply, but no luck.

Any advice on what might be causing the issue or debugging steps to try? Could it be SPI timing, FatFs handling, or a power/memory issue?

Thanks for any help!

Re: STM32F407VET6 Data Logging Issue – Need Help!

Posted: Thu Nov 14, 2024 10:01 am
by Shraddha
Hello,

You’ve already done a lot of troubleshooting. But you can consider the following few steps, that might help you to solve an issue.
1. Double check the SPI clock speed. Sometimes a low or high clock speed tends to cause such issues
2. Check the buffer sizes and sector sizes
3. Try to use a logic analyzer to monitor SPI communication
4. Add debug prints to log FatFs function statuses
5. Test with different SD cards
6. Check the low-level disk I/O functions. Make sure the card detect pin and initialization are working correctly.

Please check the community discussions for similar issues to help troubleshoot your problem.
https://community.st.com/t5/stm32-mcus- ... d-p/598176
https://community.st.com/t5/stm32-mcus- ... d-p/679705