This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Interrupt and osSignalSet issue

Hi all,

I'm using a NXP Cortex M4 microcontroller to which I have connected a matrix keypad ( 4 rows and 3 columns ). My goal is to have the rows connected to interrupts and whenever one of the keys is press an interrupt will occur. So I have connected all 4 rows to port B and created and irq handler, which all it does is set a signal to transfer to another thread that has a high priority and then clear the isr flags.
Here is my isr handler routine:

extern osThreadId t_chkkeys;

void PORTB_IRQHandler(void) __irq{
   osSignalSet(t_chkkeys, 0x01);
   DelayMS(10);
   PORTB_ISFR = 0xFFFF;
}


then t_chkkeys thread has a osWaitSignal condition that waits for the signal before going forward.

void chkkeys(void const *argument)
{
   while(1)
   {
      osSignalWait(0x01, osWaitForever);                         /* key process authorized */
      if ( setProcessFlag != 0 )
         continue;
         mainKey = Keypad.WaitKey();
......

So the issue that I'm having is that the IRQHandler does not execute, but when I remove the osSignalWait form the chkkeys thread, the IRQHandler works fine, except it does not transfer control to the thread (which makes sense). Why would the IRQHandler depends on the OS intructions such as osSignalWait?
I have all 4 pins of port B set for interrupt mode with triggering on either edge. Also I use __enable_irq() during my initialization process to enable interrupts globally.
Is there something that I'm missing or doing incorrect?

Any help or comments appreciated.