This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

USB interrupt issue after NVIC System Reset

Hello,
I am working with -
Environment - lpc1769, KEIL UV5, LPCUSB(Bertrik Sikken) stack

I am working on a system with a secondary USB bootloader.

Bootloader resides at 0x0000. In normal circumstances, main application which starts at a higher address executes.
A PC app sends a reset command via USB. In the main app I use NVIC_VectorReset()
to reset to 0x0000 (i.e. Bootloader). Now the PC app communicates and BL performs IAP commands and thus new main application is flashed. If I use NVIC_SystemReset, windows loses USB com port and does not re-enumerate port unless I plug out and plug in USB cable. This happens even though I do a soft reconnect in BL firmware. Using NVIC_VectorReset(), windows maintains USB com port from main app to BL. Box resets to BL, connects to same USB port and the process goes seamlessly.
The PC app talks to USB virtual com port.

__STATIC_INLINE void NVIC_VectorReset(void)
{
        /* Ensure all outstanding memory accesses included
           buffered write are completed before reset */
        __DSB();

        /* Keep priority group unchanged */
        SCB->AIRCR  =        ((0x5FA << SCB_AIRCR_VECTKEY_Pos) |
                        (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk)) |
                        SCB_AIRCR_VECTRESET_Msk;
        __DSB();     /* Ensure completion of memory access */

        while(1);   /* wait until reset */
}

.

All this works fine in my first product. The second product is the same processor with same USB pins. In this product I can reset to Bootloader, but my USB interrupts don't trigger.
This means I get no BulkIn/BulkOut interrupts. I have to unplug/replug USB cable. Strangely, windows does not lose com port, but in the device side I see no USB interrupts(not even frame interrupts though they are enabled).

I understand I have not given a lot of information, but if anyone has any suggestion worth trying, it would be useful.

Thanks

  • > windows maintains USB com port from main app to BL. Box resets to BL, connects to same USB port and the process goes seamlessly.

    I suppose your board has an external D+ pull-up resister (1k5), which is enabled by CONNECT pin. Attach this resistor directly to 3V3 line (fixed pull-up), skipping CONNECT pin control. And then, NVIC_SystemReset() should also work.

    As NVIC_SystemReset() resets the CONNECT port, the D+ pull-up becomes disabled. This change should be detected by host as disconnection. By fixed pull-up, USB connection could be maintained.

    Anyway, I don't recommend your method to others ;-)
    because it works just for your specific case, on Bertrik's LPCUSB, which isn't aware of Device state, and on LPC17xx USB engine.

    Tsuneo