Question Details

No question body available.

Tags

stm32 microcontroller interrupt spi sd-card

Answers (1)

April 24, 2026 Score: 0 Rep: 57 Quality: Low Completeness: 50%

Found the issue, the problem was the variable buffersReady which could increase at a very rapid rate. A test I made creating new variables, loadBufCount and saveBufCount gave me that, with a low buffer size, I lost about half of the packages at the one minute timestamp. So by then, buffersReady could be any number between 0 and 255 buffers ready to load, which crashed the sd's capacity to write. When I just changed it to be either 0 or 1 the code worked, but allowed these packages to be lost. I still haven't seen a way to achieve my goal properly, but I'm nearly there. As I'm working with STM32F103C8T6, it has 20kB of RAM and I'm pushing it to the limit with these buffers, so it's not quite the solution I'd like, but my initial question was solved.