Thanks for the reply. I've added some code to the serial driver (Serial_SAM926X) to (hopefully) do this:
Code:
///---------------------------------------------------------------------------------
/// Interrupt Init
// Request sysintr for the device
pSerialInitStructure->dwSysIntr = SYSINTR_UNDEFINED;
if (!KernelIoControl(IOCTL_HAL_REQUEST_SYSINTR, (PVOID)&pSerialInitStructure->dwDeviceID, sizeof(pSerialInitStructure->dwDeviceID), (PVOID)&pSerialInitStructure->dwSysIntr, sizeof(pSerialInitStructure->dwSysIntr), NULL))
{
RETAILMSG(1, (TEXT("ERROR: Failed to request the serial sysintr for USART XX.\r\n")));
pSerialInitStructure->dwSysIntr = SYSINTR_UNDEFINED;
goto error;
}
// new code to enable wake on serial?
if(!KernelIoControl(IOCTL_HAL_ENABLE_WAKE, (PVOID)&pSerialInitStructure->dwSysIntr , sizeof(pSerialInitStructure->dwSysIntr) , &dwResult , sizeof(dwResult ), 0))
{
RETAILMSG(1, (TEXT("IOCTL_HAL_ENABLE_WAKE failed\n\r")));
}
This doesn't work - I'm guessing the UART is turned off when the device suspends, preventing the interrupt from being generated? If so, how can I make sure it is left enabled? I'm using USART0, so the tx/rx pins are on PIOA, which, according to this line from BSPPowerOff, should still be active?
Code:
pPMC->PMC_PCDR = ~((1 << AT91C_ID_PIOCDE) | (1 << AT91C_ID_PIOA) | (1 << AT91C_ID_AC97C) | (1 << AT91C_ID_2DGE) | (1 << AT91C_ID_EMAC)); //0xFF5BFFEB
Anyone have any ideas?