9 years, 10 months ago.

bug with the hardware interrrupts and ticker

Hi,

I have a problem on this plateform when I use a hardware interrupt and a ticker, the main just crashes. Same code on Nucleao works fine. Here a full description of the bug with the code:

http://developer.mbed.org/forum/repo-56921-nRF51822-community/topic/5393/

thanks for your help,

Question relating to:

The nRF51 Development Kit is a single-board development kit for Bluetooth Smart, ANT and 2.4GHz proprietary applications using the nRF51 Series SoC. This kit supports both development for both nRF51822 …

yep this is the same

posted by rosco pekolt 05 Jan 2015

This has my attention now. I'll try to reproduce this and report before end-of-day tomorrow. Apologies for the trouble.

posted by Rohit Grover 05 Jan 2015

1 Answer

9 years, 10 months ago.

I've reproduced the issue with the following:

code needed to reproduce the problem

#include "mbed.h"

Ticker flipper1;

InterruptIn button(BUTTON1);
DigitalOut led1(LED1);
DigitalOut led2(LED2);

void trigger()
{
    led1 = !led1;

    button.enable_irq();
    flipper1.detach();
}

void interrupt_in()
{
    flipper1.attach_us(&trigger, 200000); // the address of the function to be attached (flip) and the interval (200 msecs)
    button.disable_irq();
}

int main()
{
    button.rise(&interrupt_in);
    while(1) {
        led2 = !led2;
        wait(0.5);
    }
}

The system hangs after a button press. This reproduces every time. Thanks for bringing this to our attention.

Mbed's Nordic port uses the app_timer module from their SDK. This module provides software timers on top of the RTC. This bug exposes some weird behaviour within the app_timer module; and we're working with Nordic to resolve this.

+1

posted by Martin Kojtal 06 Jan 2015

+1

posted by Jules Thuillier 31 Jan 2015

Hi,

https://github.com/mbedmicro/mbed/pull/932 is an ongoing attempt to address this issue. Please try it out.

posted by Rohit Grover 27 Feb 2015