I've just been chasing an odd bug, where I was trying to map Host Interrupt 42 (event 31) via the EventCombiner module. This worked just fine standalone but seemed to get crossed over with the PA interrupt when I enabled networking, ie. after NIMU startup I only seemed to get an interrupt when a packet arrived. (eg. ping worked just fine...)
I then found this, which I didn't understand. Perhaps someone can explain it for me.
C:\ti\pdk_C6678_1_1_0_3\packages\ti\platform\resource_mgr.h
/** @defgroup Platform_interrupts Interrupts
* Interrupt and event IDs. Only those which are assigned appear here.
*
* We are currently combining all interrupts for the switch and they are set by the demo
* applications in their .cfg files:
* Ecm.eventGroupHwiNum[0] = 7;
* Ecm.eventGroupHwiNum[1] = 8;
* Ecm.eventGroupHwiNum[2] = 9;
* Ecm.eventGroupHwiNum[3] = 10;
*/
/*@{*/
#define PLATFORM_ETH_EVENTID 48 /**< Ethernet Switch event - Used by NIMU library */
#define PLATFORM_ETH_INTERRUPT 7 /**< Ethernet Switch Interrupt - Used by NIMU library */
/*@}*/ /* defgroup */
The ECM setup in the comment is the same that I have in my .cfg file, copied from the PDK demos.
BUT in the default NIMU driver, we have:
C:\ti\pdk_C6678_1_1_0_3\packages\ti\transport\ndk\nimu\src\nimu_eth.c
/* Register interrupts for the system event corresponding to the
* accumulator channel we are using.
*/
/* System event n - Accumulator Channel 0 */
eventId = PLATFORM_ETH_EVENTID;
/* Pick a interrupt vector id to use */
vectId = PLATFORM_ETH_INTERRUPT;
platform_write ("Ethernet eventId : %d and vectId (Interrupt) : %d \n", eventId, vectId);
/* Register our ISR handle for this event */
EventCombiner_dispatchPlug (eventId, (EventCombiner_FuncPtr)EmacRxPktISR, (UArg)ptr_net_device, TRUE);
EventCombiner_enableEvent(eventId);
/* Map the event id to hardware interrupt 7. */
Hwi_eventMap(vectId, eventId >> 5);
/* Enable interrupt */
Hwi_enableInterrupt(vectId);
This appears to be mapping event *1* to interrupt 7, which would explain why my event 0 via interrupt 7 mapping was being clobbered.
Anyway, I've solved the immediate issue by using event 92 via interrupt 9, which was unused, and that seems to work. I'd just like to know for curiosity's sake (and in case I need to add more events later) why my first effort didn't work.
Cheers,
Gordon