I modified a little the firmware of a usrp-based device.
I wanted to check the buffer overrun event on the BULK IN EP2 FIFO, but
interrupt autovectoring mechanism doesn’t work.
The following code
isr_EP2FULLFLAG (void) interrupt
IOD ^= 0x01;
void install_handlers (void)
setup_descriptors (); // ensure that they’re set before use
hook_uv (UV_SUDAV, (WORD) isr_SUDAV);
hook_uv (UV_USBRESET, (WORD) isr_USBRESET);
hook_uv (UV_HIGHSPEED, (WORD) isr_HIGHSPEED);
hook_fgv (FGV_EP2FF, (WORD) isr_EP2FULLFLAG);
SYNCDELAY; EP2FIFOIE = 0x01; /* The FF on the EP2, which is BULK IN */
USBIE = bmSUDAV | bmURES | bmHSGRANT;
I don’t see any changes in the port D bit 0 or _usb_rx_overrun variable,
even in case of the EP2 overrun, which I can less efficiently verify
EP2468STAT or EP24FIFOFLGS (and maybe EP2CS as well).
Any clue? Did someone ever try hook_fgv?