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!
STM32F407VET6 Data Logging Issue – Need Help!
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
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