I've run into a rather frustratingly simple problem while programming the M3 core on an F28M36P63C2 device using the V208 MWare driverlib.
I was trying to set up a pin interrupt on Port N, pin 5 using the following code:
GPIOPinTypeGPIOInput (GPIO_PORTN_BASE, GPIO_PIN_5); GPIOIntTypeSet (GPIO_PORTN_BASE, GPIO_PIN_5, GPIO_FALLING_EDGE); GPIOPinIntEnable (GPIO_PORTN_BASE, GPIO_PIN_5); IntRegister (INT_GPION, _portn_isr); // can't use GPIOPortIntRegister() for PORT N IntEnable (INT_GPION);
I noticed that the driverlib GPIOPortIntRegister() function called GPIOGetIntNumber() on the port base address, but that GPIO_PORTN_BASE isn't listed in the switch statement in that function (it only goes as far as Port J). However, GPIOBaseValid() allows GPIO_PORTN_AHB_BASE and INT_PORTN is defined. GPIOGetIntNumber() does return -1 in the default case, but there is no check on that number before handing it to IntRegister().
I used IntRegister() and IntEnable() manually instead. However, what I didn't notice (and I should have, since I just saw evidence of port N being missing) was that IntEnable() also doesn't support interrupts that go into registers NVIC_EN3 and NVIC_EN4, and silently ignores attempts to register interrupts in these registers. However, IntRegister() worked fine and emplaced the ISR, and both functions did "ASSERT(ulInterrupt < NUM_INTERRUPTS)" and passed (INT_PORTN == 128). There was no sign of a problem at compile time and the only symptom was missing ISR calls, despite the handler being registered in the NVIC table. No ASSERTs were ever triggered to indicate invalid runtime arguments.
Manually setting NVIC_EN4 using HWREG fixed my issue, but I am now wondering what the limitations of using driverlib are: other than the GPIO ports greater than Port J, are there other peripherals or functions that I should be aware of limited functionality in driverlib for the F28M36 devices? Is it expected that I should amend the driverlib code to support these ports, or is there a reason these ports aren't available in driverlib that I'd run into if I patched my copy?
NVIC_EN3 and NVIC_EN4 only appeared in hw_nvic.h in MWare v208, so perhaps this functionality is on the way? However, it appears to be totally missing from TIRTOS's (tirtos_c2000_2_16_01_14) version of MWare, which is "v202a".