Other Parts Discussed in Thread: C2000WARE
Hi,
I'm using the TI USB Library from the C2000 Ware software suite. I have CCS Version: 9.3.0.00012. I have imported the source files for the USB stack into the project so I can modify it.
The version of the library is written as comments in the source file as follows:
// $TI Release: F2806x Support Library v2.06.00.00 $
// $Release Date: Fri Feb 12 19:15:11 IST 2021 $
// $Copyright:
// Copyright (C) 2009-2021 Texas Instruments Incorporated - http://www.ti.com/
I believe this library was ported from the Stellaris microcontroller family to the C28x family.
I am using the host functions of the USB library to communicate point-to-point with a mass storage device at full speed. On occasion the device fails to respond and I receive a NAKTO (NAK timeout) error in the PipeRead or PipeWrite functions in the usbhostenum.c file. The pipe read/write functions are blocking (i.e., I wait in there until the transaction is completed). I realized there's a while forever loop in these functions that was causing my program to get stuck so I use a timer to exit with a 500ms timeout.
The problem I have is after I exit this function I am not able to restore communication with the device ever except after a DSP reset (using the watchdog). I have tried to reset the USB stack by using the initialization functions in the example project in C2000Ware. This works sometimes but not always. I believe I have seen one time where the TXPKTRDY bit was set and was preventing any other communication to be sent from the host.
My question is what is the best way to reset all the USB registers for a 'fresh' start. I'd rather not have to reset the DSP every time this happens? I believe I'm missing something in the re-initialization which makes a DSP reset via watchdog work but not a software reset of the USB stack.
Also will going non-blocking route work better? How can I implement a non-blocking pipe read/write?
Thanks