Discovery Kit 上自带 FAT-FS 卡在 DMA中
用 ST32F426 Discovery 板上的 SD 卡。用 STM32CubeIDE 生成项目,其中包括 MX_FATFS_Init() 来初始化 SD 卡。没有进行任何程序上的更改,并且对除 StartDefaultTask 之外的所有内容都使用了默认设置。在 StartDefaultTask 中,想使用类似于 STM32CubeF7 固件包的 SD 卡:f_mount卡住了,因为 sd_diskio.c/SD_read 卡在这个代码块的最后一行:void StartDefaultTask(void const *argument) { /* init code for USB_HOST */ MX_USB_HOST_Init(); /* USER CODE BEGIN 5 */ FIL MyFile; /* File object */ uint8_t workBuffer; FRESULT res; /* FatFs function common result code */ uint32_t byteswritten, bytesread; /* File write/read counts */ uint8_t wtext[] = "This is STM32 working with FatFs"; /* File write buffer */ uint8_t rtext; /* File read buffer */ /*##Register the file system object to the FatFs module ##############*/ if (f_mount(&SDFatFS, (TCHAR const*) SDPath, 1) != FR_OK) {...可能是SD卡硬件连接问题,检查硬件连接。 检查电源是否稳定,或换SD卡。 可能是FatFs初始化配置错误。 SDIO和USB_HOST的时钟、引脚复用冲突。 检查SDIO时钟和引脚配置是否有误。 若使用中断或DMA模式,相关中断是否已启用且优先级无冲突。 检查HAL_SD_Init()是否返回HAL_OK,若失败可能是SDIO外设未正确初始化。 FatFs与SDIO驱动可能不兼容。 建议检查SDIO时钟和引脚配置。
页:
[1]