For STM32 targets using a 32-bit timer for the microsecond ticker, the driver did not properly handle timestamps that are in the past. It would just blindly set the compare register to the requested timestamp, resulting in the interrupt being serviced up to 4295 seconds late (i.e. after the 32-bit timer counts all the way around to hit the timestamp again). This problem can easily be reproduced by creating a Timeout object then calling the timeout's attach_us() member function to attach a callback with a timeout of 0 us. The callback will not get called for over 2147 seconds, and possibly up to 4295 seconds late if no other microsecond ticker events are getting scheduled in the meantime. Now, after the compare register has been set, the timestamp is checked against the current time to see if the timestamp is in the past, and if so, the compare event is manually set. NOTE: By checking if the timestamp is in the past after configuring the capture register, we ensure proper handling in the case where the timer updates past the timestamp while setting the capture register. |
||
---|---|---|
.github | ||
TESTS | ||
cmsis | ||
drivers | ||
events | ||
features | ||
hal | ||
platform | ||
rtos | ||
targets | ||
tools | ||
.gitattributes | ||
.gitignore | ||
.pylintrc | ||
.travis.yml | ||
CONTRIBUTING.md | ||
DOXYGEN_FRONTPAGE.md | ||
Jenkinsfile | ||
LICENSE | ||
README.md | ||
doxygen_options.json | ||
mbed.h | ||
requirements.txt |
README.md
ARM mbed OS
mbed OS is an open-source embedded operating system designed for the "things" in the Internet of Things (IoT). mbed OS includes the features you need to develop a connected product using an ARM Cortex-M microcontroller.
mbed OS provides a platform that includes:
- Security foundations.
- Cloud management services.
- Drivers for sensors, I/O devices and connectivity.
mbed OS is modular, configurable software that you can customize it to your device and to reduce memory requirements by excluding unused software.
Release Notes
The Release Notes detail the current release and previous versions.
Continuous Integration Status
We run continuous integration on all of our branches and pull requests to verify the stability of mbed OS. The following are the Travis CI indicators for mbed OS.
Getting Started for Developers
You need mbed CLI to build mbed OS. For more details, read the mbed OS Handbook.
Getting Started for Contributors
We have a Contributing and Publishing Guide in the mbed OS Handbook.