Mbed-os: Ticker bug on STM32F1

Created on 23 Apr 2017  路  4Comments  路  Source: ARMmbed/mbed-os

Description

  • Type: Bug
  • Related issue: #816
  • Priority: Major

Bug

Target
STM32F103

Toolchain:
Compiled using PlatformIO 3.3.0
ststm32 @ 1.8.1
framework-mbed @ 3.137.0
tool-stlink @ 1.10200.0

Expected behavior
The following code should produce a square wave on pin PA_8:

#include "mbed.h"

DigitalOut output_pin(PA_8);
Ticker ticker;

void ticker_fn(){
  output_pin = !output_pin;
}

int main(){
  ticker.attach_us(ticker_fn, 500);
}

Actual behavior
Periodically, the ticker will freeze for 65ms, as shown in the screenshots below.
Immediately following a freeze, all missed interrupts are triggered in a short burst.

stm32_ticker_bug_1
stm32_ticker_bug_2

Some digging reveals similarities to issue #816, though I am unsure how to tackle the problem.

Steps to reproduce
The bug occurs on a generic "blackpill" STM32F103 board.
The example above was compiled using the following platformio.ini config file:

[platformio]
env_default = stm32f103c8t6

[env:stm32f103c8t6]
platform = ststm32
framework = mbed
board = nucleo_f103rb
upload_protocol = stlink
st bug

Most helpful comment

@cesarvandevelde @bcostm will be fixed with #4424

All 4 comments

cc @bcostm @adustm @LMESTM @jeromecoutant

I thought this issue was solved a long time ago. But I have checked it again on NUCLEO_F103RB (using mbed v140) and I confirm the problem.

@cesarvandevelde @bcostm will be fixed with #4424

ST_TO_BE_CLOSED

4424 was merged - @cesarvandevelde the problem is fixed now, feel free to let us know if any further issue

Was this page helpful?
0 / 5 - 0 ratings