STM32H7 USB FS Host Core how to recover from "Data toggle error"
Hi all,
Preamble:
I have an STM32H743 application that needs to constantly read some data stream from an USB memory stick. Basically all works. I needed to apply the NAK fix to avoid FreeRTOS getting blocked from too many NAK IRQs. Done, no longer an issue. Customers are running the device every day with no issues at all. But there is one thing: One customer replaced the USB stick we ship with the product with some other USB stick. Now this stick works 100% fine on PC and iMacs and also on other embedded devices but not on the STM32H7 host.
Problem:
This 8GB stick causes "Data toggle errors", that trigger a MCU flag called USB_OTG_HCINT_DTERR. The current host stack from STM32Cube H7 V1.7.0 is unable to recover from this. It loops forever in MSC_read. No error is thrown. Its just nothing else happening untill the stick is pulled out (disconnect event). I tried fixing this by re-activating the host with the usual sequence clearing USB_OTG_HCCHAR_CHDIS and setting USB_OTG_HCCHAR_CHENA in HCCHAR - does not help.
Has anyone had this before and maybe are there some ideas how to get back fo transfer without completly un-remounting the stick?
