STM32F4 SDIO f_write() lockup in Timer Callback
Posted: Tue Jun 24, 2014 5:27 pm
Hello,
I am toubleshooting an issue involving writing to an SD card with f_write().
My platform is as follows:
Hardware: STM32F4Discovery Board
Compiler : IAR 7.10.3
ChibiOS : 2.6.4
I am able to write full sectors(512 Bytes) to to the SD card without issue within main().
However, calling the same f_write() function from within a timer callback function results in an "_unhandled_exception".
The timer callback function is fired every 50ms.
Each time it is called a single sector(512 Bytes) of data is written to the SD card.
I timed the successful sector writes in main() and they were just over 8ms.
Therefore, there should be plenty of time to write 1 sector every 50ms.
Here is what I have tried thus far:
Suspecting some hidden DMA conflict, I changed the default DMA to DMA2 stream6 (from DMA2 stream3).
The hardware timer being used is TIMER14 which had no DMA capability however, I was just being careful.
- This had no effect.
I am about to dive into the DMA and IRQ priorities next.
As a fairly inexperience ARM firmware guy I could use a little advice here.
Thank You,
Forrest
I am toubleshooting an issue involving writing to an SD card with f_write().
My platform is as follows:
Hardware: STM32F4Discovery Board
Compiler : IAR 7.10.3
ChibiOS : 2.6.4
I am able to write full sectors(512 Bytes) to to the SD card without issue within main().
However, calling the same f_write() function from within a timer callback function results in an "_unhandled_exception".
The timer callback function is fired every 50ms.
Each time it is called a single sector(512 Bytes) of data is written to the SD card.
I timed the successful sector writes in main() and they were just over 8ms.
Therefore, there should be plenty of time to write 1 sector every 50ms.
Here is what I have tried thus far:
Suspecting some hidden DMA conflict, I changed the default DMA to DMA2 stream6 (from DMA2 stream3).
The hardware timer being used is TIMER14 which had no DMA capability however, I was just being careful.
- This had no effect.
I am about to dive into the DMA and IRQ priorities next.
As a fairly inexperience ARM firmware guy I could use a little advice here.
Thank You,
Forrest