Hi Andrea,
Apologize for the delayed response.
[quote]
If tested in extreme conditions, sometimes system hangs (eg .: extraction of the USB stick while you are reading or writing a file).
In particular, two situations may occur:
1) The system stops waiting for an HW condition that will not occur (for example cpp41dma.c line 533, but is not the only while case).
2) The USB starts generating interrupt continuously (one every 10 usec). USB0HostIntHandler() read 0 from INTSRCR (no interrupt pending?) and the final write of 0 to EOIR immediately retrigger a new interrupt.
* Is the driver designed to correctly manage unplug while working? (We can accept problems on the USB key's filesystem if not correctly synced but I would expect no problem on the host side).
[/quote]
Actually the OMAPL138 starterware code does not support error handling such as removing pendrive while accessing (read/write) etc.,
So if we did any abrupt change while working with usb starterware code, we could face unexpected behavior.
[quote]
* Don't you should avoid potentially endless waiting situation? (can we use a timeout? how long? which action should be taken on timeout?)
[/quote]
Yes, you can use timeout. If any abrupt change or pendrive removal then clear out all the interrupts and re-init the required section like interrupt source etc.,
[quote]
* How is it possible to have interrupts while INTSRCR is read as 0?
[/quote]
It is not possible but it could be interrupted due to bad variable changes when abrupt change happens on USB.
[quote]
* Inside the function USBHostIntHandlerInternal() variable ulStaus is OR-ed with the return value of the function USBIntStatusControl (). I cannot find any doocumentation for registers accessed in that function inside OMAP-L138 TRM (spruh77a.pdf). What do I miss?
[/quote]
Those information would come from USB driver file located at "OMAPL138_StarterWare_1_10_04_01/drivers/usb.c"
You can refer to the following TI wiki for USB starterware implementation.
http://processors.wiki.ti.com/index.php/StarterWare_USB
[quote]
* Is there any available update for the driver?
[/quote]
As of now, we don't have plan to do that.