Mbed-os: MAX32630 MAX32625: Program hangs when scheduled many tickers one after the other with the same time interval

Created on 12 Oct 2017  路  10Comments  路  Source: ARMmbed/mbed-os

When schedule many Tickers one after the other with the same time interval 100ms and then wait 105ms it's expected that after this time all Tickers will be fired once. But we get other results. There is no action test hangs and timeout occurs

Problem noticed in https://github.com/ARMmbed/mbed-os/pull/5261 in the following test

/** Test many tickers run one after the other

    Given many Tickers
    When schedule them one after the other with the same time intervals
    Then tickers properly execute callbacks
    When schedule them one after the other with the different time intervals
    Then tickers properly execute callbacks
 */
void test_multi_ticker(void)

Sample code for reproduction

#define MULTI_TICKER_TIME_MS 100
#define TICKER_COUNT 16
Ticker ticker[TICKER_COUNT];
uint32_t multi_counter;

void increment_multi_counter(void)
{
   core_util_atomic_incr_u32(&multi_counter, 1);
}

const uint32_t extra_wait = 5; // extra 5ms wait time
multi_counter = 0;
for (int i = 0; i < TICKER_COUNT; i++) {
    ticker[i].attach_us(callback(increment_multi_counter), MULTI_TICKER_TIME_MS * 1000);
}

Thread::wait(MULTI_TICKER_TIME_MS + extra_wait);
for (int i = 0; i < TICKER_COUNT; i++) {
    ticker[i].detach();
 }

TEST_ASSERT_EQUAL(TICKER_COUNT, multi_counter);

Description


Bug

Target
MAX32630, MAX32625

Toolchain:
GCC_ARM|ARM|IAR

mbed-os sha:
master

Expected behavior
Ticker callback is executed exactly 16 times

Actual behavior
Test hung and timeout occurs

closed_in_jira hal maxim mirrored bug

All 10 comments

cc @kgills @jeremybrodt

@ARMmbed/team-maximintegrated

ping

@jessexm

ping @ARMmbed/team-maximintegrated @jessexm

Currently testing fix.

@jessexm Let us know if any problem

@jessexm what is the status of the fix?

ARM Internal Ref: MBOTRIAGE-153

Two fixes addressed this issue (referenced above)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pilotak picture pilotak  路  3Comments

sarahmarshy picture sarahmarshy  路  4Comments

cesarvandevelde picture cesarvandevelde  路  4Comments

bcostm picture bcostm  路  4Comments

MarceloSalazar picture MarceloSalazar  路  3Comments