Task switching stops after entering interrupt service routine

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Task switching stops after entering interrupt service routine

    Hello everyone,

    I'm running a small project on the Atmel Sam3u MCU with embOS
    the project runs a simple task: blinking LED task which is working.

    now, i try to catch button interrupt, perform some action, and then resume the task operation.

    the problem is, that before the button is pressed the LED Task is running, when the button is pressed
    the system enters the interrupt handler performs the actions and exits the handler but for some reason doesn't return to task.

    * if i stop the run operation after the interrupt, the system stops in some line inside the interrupt handler.
    * if i put a breakpoint inside the interrupt handler and after the breakpoint is reached i resume the operation (press Run again) the system works fine and the LED task runs again.
    * the project is compiled using IAR workbench in Embedded C++ mode.

    I've added the main.c and the bsp.c files.

    I can't really understand where this bug comes from,
    any help from you guys would be most appreciated,
    Thanks in advance,
    ARMKid
    Files
    • LEDS.zip

      (2.36 kB, downloaded 676 times, last: )
  • Hello,

    could you please attach your complete project?
    We will then be able to reproduce your issue and it should be easy to find the reason for the problem.

    Best regards,
    Til
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hello,

    the project does not build and e.g. I see no vector table entry for BSP_PIOA_ISR_Handler() in RTOSVect.c.

    Maybe it's easier to contact our support directly and to communicate per email.

    Regards,
    Til
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Problem Solved!

    I've solved the problem.

    the problem was that the the system kept calling the ISR handler because the ISR register (PIOA_ISR) wasn't cleared.
    once i cleared that register the problem solved and the LED task resumed.

    thanks everyone.
    ARMKid