AnsweredAssumed Answered

USB and WFI

Question asked by Legrand.Thomas.001 on Dec 6, 2011
Hello,

I finally get the USB stack to work on my custom hardware.
Last thing I need to fix is that once everything is started I rely only upon interrupts (as the USB stack), so my main method looks like :

int main(void)
{
     init();

     while(1)
          __WFI();
}

But with the USB stack active, it works only if I change the __WFI() intrinsic by __nop().
That means the MCU doesn't automatically enters sleep mode between interrupts, and my power consumption increased a lot (by 20/30mA), I cannot really afford that on the LDO.

Do anyone have a clue about why the USB stack doesn't work with WFI ?

Thomas.

[EDIT] Do you think using SLEEPONEXIT would change something ?

Outcomes