Can't solve MCUX SDHC driver crashing in FreeRTOS.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can't solve MCUX SDHC driver crashing in FreeRTOS.

892 Views
minibix
Contributor II

I am using the FRDM-K64F board, MCUxpresso SDK, FreeRTOS and the SDHC driver.

I created a new project and have a FRTOS task that initialises the SD card and attempts to write a raw block of data to it, I am using the code from the "xxxx_driver_examples_sdcard_sdcard_freertos" SDK example which runs fine if I build that project to the K64F.

In my new project, I am using an almost identical configuration as the example, yet my project crashes on a hard fault when attempting to write a block the SD card. SD card powers on and initialises fine.

I have attached the thread/stack frame list and highlighted the block of code where it crashes. I have tried many fixes with ISR priorities and heap/stack sizes, and even when I use the same config as the example, it still crashes.

The only major difference is that my project is C++ using NewLibNano, and the example project is C RedLib.

Labels (1)
0 Kudos
1 Reply

681 Views
minibix
Contributor II

I've narrowed it down and found that it is a read operation causing the issue. SD_ReadBlocks seems to be causing the issue (in my project, but not the example project).

SD_WriteBlocks and SD_EraseBlocks work fine...

0 Kudos