Hi, working with the STM32SD library i'm coming across an error where SD.open() suceeds in making new files but SD.write() returns 0 when trying to write bytes? The SDMMC1 clock is set to 8MHz.
If i run each SD command one after another in setup() it works ok, eg. SD.open() -> SD.write() -> SD.close().
however, when i SD.open() in the setup function, and SD.write() in the loop, it has problems after a while where it doesn't write any bytes at all, i.e. Sd.write() returns 0.
Cheers!
Richard
STM32SD SD.write() doesn't work in the loop?
Re: STM32SD SD.write() doesn't work in the loop?
Bump - It looks like it might be conflicting with another devices HAL setup or interrupt priority?
Re: STM32SD SD.write() doesn't work in the loop?
Bump - The problem goes away if i disable the HardwareTimer TIM3?
Re: STM32SD SD.write() doesn't work in the loop?
This is possible that IRQ prio can interfere. Up to end user to ensure prio.
https://github.com/stm32duino/wiki/wiki ... ity-values
https://github.com/stm32duino/wiki/wiki ... ity-values
Re: STM32SD SD.write() doesn't work in the loop?
How do i configure these priorities? - The SDMMC doesn't have a interrupt priority?fpiSTM wrote: ↑Wed Feb 03, 2021 12:56 pm This is possible that IRQ prio can interfere. Up to end user to ensure prio.
https://github.com/stm32duino/wiki/wiki ... ity-values
Re: STM32SD SD.write() doesn't work in the loop?
I tried putting "HAL_NVIC_EnableIRQ(SDMMC1_IRQn);" after the TIMER configuration but it didn't do anything.
Re: STM32SD SD.write() doesn't work in the loop?
AFAIK theSTM32SD does not use any interrupt...
My guess is you have a pin mapping issue...
My guess is you have a pin mapping issue...
Re: STM32SD SD.write() doesn't work in the loop?
If i remove the TIMER configuration completely it works, but the interrupts don't seem to be fixing anything
Re: STM32SD SD.write() doesn't work in the loop?
Bump - If i change the TIM2 clock speed from 16000 hertz to 1000 hertz it works