cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 latest firmware v1.9 has a bug which causes FATFS API to return FR_DISK_ERR.

VShet.2
Associate III

My current project is based on STM32H743IIT6 microcontroller with CMSIS RTOS v2, FATFS, USB FS as Mass Storage Host class. Recently, I upgraded to H7 firmware v1.9 after which FATFS API return "FR_DISK_ERR" error frequently.

As a workaround, I had to replace these files "stm32h7xx_ll_usb.c", "stm32h7xx_ll_usb.h", "stm32h7xx_hal_hcd.c" and "stm32h7xx_hal_hcd.h" in latest drivers in v1.9 to the once present in earlier version that is H7 firmware v1.8.

There are changes in USB link layer drivers & HCD drivers in latest firmware and that seems to be the root cause of these issue. I narrowed down at a place in USB link layer "stm32h7xx_ll_usb.c" to function like "USB_ReadPacket()", "USB_WritePacket()" where in earlier v1.8 read and write from USBx_DFIFO were 32bit word aligned which is NOT the case with latest firmware v1.9. I am not sure if word alignment is the issue here but it has something to do with this USB and HCD drivers cause replacing them with the older version in latest firmware seems to work for me.

17 REPLIES 17

Hi @Amel NASRI​ 

Did this test example help to reproduce the issue ?

Hi @VShet.2​ ,

Sorry for delay to come back to you, please be ensured that this is not ignored. I'll come back to you as soon as I have more results to share.

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

budzik1678
Associate II

I have the same problem. I use the STM32H743ii chip and when I use HID (keyboard) and FATfs (SD card) FATfs returns the error "FR_DISK_ERR" after a while. Today I have 2024 and I don't know if you are still dealing with this problem or if it has already been solved. Mine was not solved in the case of 743. I have a very similar system but based on STM32H753ii and the problem does not occur here. The programs are identical. I use "stm32cube_fw_h7_v191" in both cases. I have not seen STM write anything about errors in this chip. Now I do not know what is the problem. The chip (my copy) or the software.

Strange. What are differences in these "similar" boards? Clock source? Are both 753 and 743 stepping V? Any software differences  such as stack size?

 

Both systems are in version V. The first system is based on CoreH7XXI and the second on Core4X9I with 753 system. Both systems have different LCD. Core H7XXI has an additional Mp3 system. Stacks are set by CubeMX to 0x400. You think the stack is too low. Hepa is set to 0x200. I will check with more Stack in a moment.

Core4X9I with 753 system? What is this?

 

 

Core4X9I (waveshare) with STM32H753 chip. Originally was STM32F429. I am the third person on this forum with this problem and no answer. I am not able to handle it myself.

Here you can find help with your project. (while waiting for more helpful replies in this forum of course).