I've got an ugly problem with one of my Vdk drivers (for a MAX1233 device).
I'm running on a proprietary BF548 platform.
The driver calls VDK::PendDeviceFlag() in it's SyncRead function. It works fine,
if the MAX1233 is the only device that is generating interrupts.
If there's a second device operating concurrently (regardless
of the type of this second device), it sometimes happens, that the
MAX1233 interrupt occurs, is detected by the Vdk driver's ISR, the
VDK::C_ISR_ActivateDevice(..) is called but the driver isn't really
activated (PendDeviceFlag does not return). How can this happen?
Here's my SyncRead function:
int Max1233KeypadVdkDriver::SyncRead (char *pData, int nSize, VDK::Ticks nTimeoutTicks)
// some code to init the Max1233...
// some more code to serve the Max1233...
And here's may ISR:
VDK::IOID ioidDevice; // system-wide unique ID of the Max1233Keypad device
Max1233KeypadVdkDriver *pDevice=(Max1233KeypadVdkDriver *)ClientArg;
if(pDevice->m_pPinInt->IsActive()) // interrupt was for us -> activate us
ioidDevice=pDevice->ID(); // get ID of the device
VDK::C_ISR_ActivateDevice(ioidDevice); // activate the driver
During normal operation, I see on the scope, that the port for my
debug LED is toggled low by the interrupt handler, and back high
as soon as PendDeviceFlag returns in my SyncRead function.
If the error occurs, the LED is just toggled low - so the ISR is called,
but SyncRead is still stuck (forever) in the PendDeviceFlag function.
The error occurs, when the Blackfin is serving the other device using
a similar VDK driver, just when the interrupt for the MAX1233 occurs.