I am developing a USB device with LPC55S66.
I implemented suspend/resume using the SDK sample of power_manager_lpc as a reference, and it seemed to work well, but after a few minutes after suspend, it resumes. At this time, the PC is still in sleep mode and no other USB devices are being resumed.
I have set only WAKEUP_USB1_NEEDCLK and WAKEUP_USB1 as the wake-up source for Deep Sleep.
What could be the cause?
Thanks in advance.
Hi
Did you revise demo code power_manager_lpc?
How can I reproduce your problem?
Thanks,
Jun Zhang
Sorry, I made a mistake with the SDK sample I referenced. The correct one is dev_suspend_resume_hid_mouse_bm.
The changes I made were to the exclusions from sleep, wake-up source, and RAM retention settings. However, even before I made this change, it was getting angry at me for resuming from suspend.
#if ((defined(USB_DEVICE_CONFIG_LPCIP3511HS)) && (USB_DEVICE_CONFIG_LPCIP3511HS > 0U))
#define APP_EXCLUDE_FROM_DEEPSLEEP \
(kPDRUNCFG_PD_USB1_PHY | kPDRUNCFG_PD_LDOUSBHS)
#define APP_DEEPSLEEP_WAKEUP_SOURCE (WAKEUP_USB1_NEEDCLK | WAKEUP_USB1)
#define APP_DEEPSLEEP_SRAM_RETENTION (0x7FFF)
#endif
I also changed the USB_LowPowerPreSwitchHook to power save DAC/ACD, LED drivers, etc.
void USB_PowerPreSwitchHook(void)
{
// software shutdown LED driver
// LED32327_WriteRegister(LED_DEMO_I2C_BASE_ADDRESS,LED_DEMO_I2C_ADDRESS, 0x00, 0);
// hardware shutdown LED driver
GPIO_PinWrite(GPIO, 0, 2, 0);
// mute dac and set direction to IN
GPIO_PinWrite(GPIO, 0, 24, 0);
gpio_pin_config_t mute_dac_pin;
mute_dac_pin.pinDirection = kGPIO_DigitalInput;
GPIO_PinInit(GPIO, 0, 24, &mute_dac_pin);
// power-down ADC
TLV320ADC3100_Deinit();
// stop audio
stop_audio();
//211116
/* set high of InRush Current Test Control Pin */
GPIO_PinWrite(GPIO, 0, 22, 0);
USB_PreLowpowerMode();
}
Thanks.