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

RTX task unresponsive. Power cycle doesn't help, but reset does.

Hi, All!

I am dealing with the most obscure bug I have ever encountered.
I am using LPC2144, Keil RTX and MDK 4.60.
I have a task waiting for event (forever) that is triggered by a pin state transition. The pin transition is detected with CAP0.0 (P0.22) interrupt and isr_evt_set it executed to continue the task execution.
The program works flawlessly until a certain point or until power loss. Afterwards, the interrupt refuses to trigger (led that toggles in the interrupt does not change it's state any more). OS works, tasks schedule correctly and even polling the P0.22 returns correct state. Only the interrupt never happens. In that case, only toggle of the reset line can restore proper functionality of the program.
It happens on all three boards I have assembled. I'm starting to think it might also be a HW bug, however, all VCC pins have proper decoupling capacitors and the board has a couple hundreds of uF on the 3.3V line.

Any suggestions would really be appreciated!

Regards,

Matic

Parents
  • This is getting more and more ridiculous. Adding CAP0.3 to do the same thing as CAP0.0 solves the problem. And all I did were these 4 changes :

    Initialization

    //T0CCR = (1<<0);
    T0CCR = (1<<0) | (1<<9);
    
    //PINSEL1 |= (2<<12);
    PINSEL1 |= (2<<12)|(2<<26);
    


    Global definitions

    #define T0_CAP0EN() T0CCR |= (1<<2) | (1<<11)
    #define T0_CAP0DIS() T0CCR &= ~(1<<2) | (1<<11)
    //#define T0_CAP0EN() T0CCR |= (1<<2)
    //#define T0_CAP0DIS() T0CCR &= ~(1<<2)
    


    T0 Interrupt

    // Capture0 interrupt
    if ((IR==(1<<4)) || (IR==(1<<7)))   // Cap0 or Cap3 interrupt
    //if ((IR==(1<<4)))
    

    Any ideas?

Reply
  • This is getting more and more ridiculous. Adding CAP0.3 to do the same thing as CAP0.0 solves the problem. And all I did were these 4 changes :

    Initialization

    //T0CCR = (1<<0);
    T0CCR = (1<<0) | (1<<9);
    
    //PINSEL1 |= (2<<12);
    PINSEL1 |= (2<<12)|(2<<26);
    


    Global definitions

    #define T0_CAP0EN() T0CCR |= (1<<2) | (1<<11)
    #define T0_CAP0DIS() T0CCR &= ~(1<<2) | (1<<11)
    //#define T0_CAP0EN() T0CCR |= (1<<2)
    //#define T0_CAP0DIS() T0CCR &= ~(1<<2)
    


    T0 Interrupt

    // Capture0 interrupt
    if ((IR==(1<<4)) || (IR==(1<<7)))   // Cap0 or Cap3 interrupt
    //if ((IR==(1<<4)))
    

    Any ideas?

Children
  • And even more... If I and prepare both CAPTURE channels as mentioned above, but keep old definitions (enable only the CAP0 interrupt), the program does NOT work after reset/programming, but it DOES work after power cycle.

    Should I start giving up?

  • [ Should I start giving up? ]

    I think that, you already get everything you may need to solve this problem.
    1. You can reproduce the problem 100% successfully.
    2. You already find some clues about the problem, something like an unexpected interrupt was triggered.

    What you need is just to take a break, calm down, then get back with patience.