SDMMC Hardfault_Handler() at HAL_SD_InitCard (STM32H7 + Fatfs + freeRTOS + DMA)
Hi,
I'm using an STM32H7A3ZI MCU, with freeRTOS, fatFS & DMA
I have set the SDMMC2 peripheral with 4 bit mode & DMA (by default in STM32H7 MX config). I have implemented the code from this example to test my SD card (microSDHC 32Gb, also test on 2Gb SD).
I set the example code inside a RTOS task (1024 stack size) (CubeMX detects that I use RTOS so the sd_diskio file is set for rtos with queues and so, however I didn't implement queues in the example code)
My problemen is that at the HAL_SD_InitCard part, I have and HardFault_Handler error at this line :
>>> HAL_Delay(1U + (74U * 1000U / (sdmmc_clk)));
(in stm32h7xx_hal_sd.c)
On the hardware part I have 47k pullup on data & CMD pins, the voltage supply is OK. I try also without the 47k pullup & with internal pull up. I have set the SD clock to 12.5Mhz.
Any idea on what could cause this problem ?
You can find my full code here:
https://github.com/pa0694/IOC_SDMMC
Thanks!
