Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 11 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:
1 Answer
9 years, 11 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.
Hi,
https://github.com/mbedmicro/mbed/pull/932 is an ongoing attempt to address this issue. Please try it out.
posted by 27 Feb 2015
IS this related: https://developer.mbed.org/forum/repo-56921-nRF51822-community/topic/5393/ ?
posted by Martin Kojtal 05 Jan 2015yep this is the same
posted by rosco pekolt 05 Jan 2015This 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