adl_irqSubscribe always returns ADL_RET_ERR_NOT_SUBSCRIBED

I cannot seem to call adl_irqSubscribe without getting an error message back. I wonder if anyone else use this can see why. Here is how I call it:

s32 gLowLevIrqHandle;
gLowLevIrqHandle = adl_irqSubscribe ( Interrupt_Handler, ADL_IRQ_NOTIFY_LOW_LEVEL, ADL_IRQ_PRIORITY_HIGH_LEVEL, ADL_IRQ_OPTION_AUTO_READ );

This returns -5 (ADL_RET_ERR_NOT_SUBSCRIBED)

I’ve tried several other ways of calling this including the method below, but it it aways fails with the same error message:

s32 gLowLevIrqHandle;
adl_irqCapabilities_t Caps;
adl_irqGetCapabilities ( &Caps ); // Get capabilities

// Set configuration
Config.PriorityLevel = Caps.PriorityLevelsCount - 1; // Highest priority
Config.Enable = TRUE; // Interrupt handler enabled
Config.Options = ADL_IRQ_OPTION_AUTO_READ; // Auto-read option set

gLowLevIrqHandle = adl_irqSubscribe(Interrupt_Handler, ADL_IRQ_NOTIFY_HIGH_LEVEL, &Config);

just to fire at the (maybe too) obvious,
do you have the real-time option enabled in your module?

Are you referring to the “Real Time Operating System” feature that one can set using WCFM and a key? If so, I must admit that I was not even aware that you need this just to enable external interrupts. Or maybe I misunderstand what you mean by real-time option?

I also noticed that at+wmf=2 does not include an “INTERRUPT” feature as mentioned by the documentation. Could the reason for this also be that I first need a key from Wavecom to enable the Real Time Operating System feature using WCFM?

at+wfm=2
+WFM: “MONO900”,0,0
+WFM: “MONO1800”,0,0
+WFM: “MONO1900”,0,0
+WFM: “BI9001800”,0,0
+WFM: “BI9001900”,0,0
+WFM: “MONO850”,0,0
+WFM: “BI8501900”,0,0
+WFM: “QUADBAND”,1,0
+WFM: “EFR”,1,0
+WFM: “HR”,1,0
+WFM: “DTXDATA”,1,0
+WFM: “DATA144”,1,0
+WFM: “SIM3VONLY”,0,0
+WFM: “SIM1V8ONLY”,0,0
+WFM: “SIM1V8AND3V”,1,0
+WFM: “SIMREMOVE”,1,0
+WFM: “OFFWHENUNPLUG”,0,0
+WFM: “SWITCHATT”,1,0
+WFM: “CPHS”,1,0
+WFM: “SIMSPEEDENH”,1,0
+WFM: “LOCA”,0,0
+WFM: “AMR”,1,0
+WFM: “NT_6K”,1,0

Got it working. It had nothing to do with enabling interrupts or the Real Time functionality.

The solution was simply to set the StackSize like this:

/**************************************************************************/
/
Mandatory variables /
/
*************************************************************************/
const u16 wm_apmCustomStackSize = 1024
3;
const u32 wm_apmIRQLowLevelStackSize = 2048;
const u32 wm_apmIRQHighLevelStackSize = 1024;

Just for the record (on firmware 7.x);
The Real Time Enhancement feature has to be enabled on the Wireless CPU® in order to make the IRQ Service available.

The external interrupts are handled via the Extint ADL Service and do not require the Real Time Enhancement feature has to be enabled.