Other Parts Discussed in Thread: CC2540
I have a CC2540-based device with the TI BLE Stack. I added the USB CDC Libraries to the code in order to send serial commands to the device through a terminal.
I noticed that PM2 is not compatible with the USB Controller on the CC2540.
I tried setting a global flag in usb_interrupt.c (in the ISR) so that OSAL.c knows when USB is connected. This way, osal_run_system(void) will only call osal_pwrmgr_powerconserve() if the USB flag is not set.
This seemed like a great idea, only, the usbirqHandler(void) never gets called. I checked hal_sleep.c to see what interrupts are enabled when the device enters sleep mode and it appears that Port 2 interrupts (which contains USB) are enabled.
I am not even sure if the USB interrupt is even waking the device out of sleep mode.
Is it possible to wake the CC2540 up from PM2 through a USB interrupt? Is there a reliable way that I can make sure the computer detects the device over USB if it is periodically going in and out of PM2?
Any help would be appreciated.
Thanks,
Seth Berggren