cancel
Showing results for 
Search instead for 
Did you mean: 

Migrating FATFS SD Card code (on FreeRTOS) from STM32F7 to STM32H7

Jon Carrier
Associate II

As the title says, I am trying to migrate some code that once was running on an STM32F7 over to STM32H7 (nucleo boards). I have had all sorts of learning hurdles switching over to the H7 which most have been resolved. The issues in general were due to either thread stack sizes being too small or the use of DMA and needing to ensure that the buffers were being linked to appropriate memory ranges (if my memory serves me correctly).

After a long hiatus, I am jumping back to this issue I had where I simply cannot for the life of me get the SD Card to function. What I am currently trying to figure out is why SDMMC1_IRQHandler never fires off.

The application's call stack, where it effectively is waiting for the OS to post a message (which is performed by the ISR for the SD interrupt) is the following:

  • SD_read
  • disk_read
  • move_window
  • check_fs
  • find_volume
  • f_mount
  • "My Application's SD Card Init Routine in an FreeRTOS Task"

I need to dig into the meaning of the SD Card registers, but it did look like the HAL was activating some interrupt masks but I am uncertain if these line up with what they should be for proper operation.

For what it is worth I do see communication on the SD card interface (via logic analyzer), but whether the communication is correct/valid is something I am not too sure of.

At this point I am thinking I will take a step back and create a baremetal application using the SD Card in either in 1-bit mode or ideally 4-bit mode, but I was kind of hoping someone may have had a similar issue.

Anyone have any idea why the interrupt may not be firing off?

0 REPLIES 0