I'm working on a an application that makes use of the BF 527 hosting a mass storage device. I've found that with the FSS loaded and a file opened (i.e. adi_fss_fileOpen()) that the removal of the usb memory stick causes the program to hang at:
// FILE: adi_usb_hdrc.c (VDSP 5.0 Update 9 Release )
3515 /* check if FIFO is empty or not */
3516 if(*pUSB_TXCSR & (1 << 1))
3518 /* only for the bulk endpoints we will wait */
3520 while(*pUSB_TXCSR & (1 << 1)) ; <---HANGS HERE !!!!!!
3522 *pUSB_TXCSR |= (1 << 3);
I have a callback that detects the removal of the device (i.e. case ADI_FSS_EVENT_VOLUME_UNMOUNT), but I have been unable to take the corrective action to keep from hanging at the line indicated above. The way I am handling this currently is using by starting the watchdog timer to generate an interrupt as soon as the unmount occurs. There is a timer callback the receives the event from the watchdog interrupt, then sets *pUSB_TXCSR = 0x0, and stops the watchdog timer. This does not work. Can anyone offer any advise to handle this situation?