STM32F407VET6 Data Logging Issue – Need Help!

Subscribe to the forum to receive notifications about new posts.
Post Reply
Mithilesh
Posts: 8
Joined: Tue Jul 09, 2024 3:24 pm

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!
User avatar
Shraddha
Posts: 61
Joined: Fri Jun 14, 2024 3:54 pm

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
Post Reply