Skip to content

Ticker: program stuck when attaching callback with very small time < 25us #5020

@maciejbocianski

Description

@maciejbocianski

Program stuck in function Ticker::attach_us when called with very small time < 25us

3  // sample code (1) ticker version
4  Ticker ticker;
5  ticker.attach_us(callback(fun), 15);
6  // program never reach this line !!!
3   // sample code (2) timeout version
4   Timeout timeout;
5   Thread thread;
6  
7   void wait_callback(void)
9   {
10     timeout.attach_us(callback(wait_callback), 15);
11  }
12
13  void run(void)
14  {
15     timeout.attach_us(callback(wait_callback), 15);
16     Thread::wait(10000);
17  }
18  
19  thread.start(callback(run));
19  // program never reach this line !!!

Description

  • Type: Bug
  • Priority: Major

Bug

Target
tested on: K64F|NUCLEO_F070RB|NRF51_DK

Toolchain:
GCC_ARM|ARM|IAR

mbed-os sha:
master

Expected behavior
callback is called
Actual behavior
program stuck or callback is not called
Steps to reproduce
Get change #5006
Modyfy one of the test like below
test_attach_us_time<10> 10us callback
run ticker test e.g. "mbed test -t ARM -m k64f -n tests-mbed_drivers-ticker -vv"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions