Commit graph

62 commits

Author SHA1 Message Date
Finomnis
3dfef74a4c
[monotonics] Fix STM32 read-modify-write race condition (#984)
* Fix stm32 read-modify-write problem

The `SR` register for STM32 clears when writing a zero to a bit.
Therefore, all registers that should not be cleared need to be `1`.

`modify` here caused a read-modify-write error that could clear
unrelated flags.

* Add changelog

* Make initialization more deterministic

* Update changelog

* Beautification in comments

---------

Co-authored-by: Martin Stumpf <martin.stumpf@vected.de>
2024-10-23 19:28:42 +00:00
Emil Fresk
0f532c6b48 rtic-monotonics: Improve docs on interrupt priority 2024-10-23 20:57:42 +02:00
Jesse Braham
1f6b6a42e5
Update support/example for ESP32-C3 to use latest versions of dependencies (#975)
* Update `rtic` package to use latest version of `esp32c3` dependency

* Update `rtic-macros` ESP32-C3 bindings to reflect changes in HAL

* Update the ESP32-C3 examples to use latest versions of all dependencies

* Update changelogs

* adjust expected qemu output, add compile-time checks

* remove runtime checks, this is checked at compile time

* fix expected qemu output

* Clean up interrupt enable code a bit

* Update `rtic-monotonic` to use the latest PAC for ESP32-C3

* Update `CHANGELOG.md` for `rtic-monotonic`

* ci: esp32c3: Format runner.sh

* ci: esp32c3: Default to silent boot

export DEBUGGING while running to get verbose boot

env DEBUGGING=1 cargo xtask ...

* ci: esp32c3: Update expected example output

---------

Co-authored-by: onsdagens <pawdzi-7@student.ltu.se>
Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
2024-10-16 19:29:51 +00:00
onsdagens
805ea267a8
Add SYSTIMER based ESP32-C3 monotonic (#972)
* add esp32c3 monotonic

* fix tests
2024-09-29 04:21:14 +00:00
Michael Zill
6e68a5e615
Feature/rp235x (#970)
* Add support for RP235x (Raspberry Pico 2)

The xtask build system has not been updated therefor the
components need to be build through Cargo

* Remove unnecessary thumbv8mainhf-backend definition

* Remove unnecessary thumbv8m.main-none-eabihf target

* Update CHANGELOG

* Remove default feature rp235x from rtic-monotonics

* Remove features from rp235x-pac dependency in rtic-monotonics for rp235x
2024-09-29 04:19:37 +00:00
Robin Mueller
056616c772
Fix for system_monotonic macro with 1 argument (#978) 2024-09-18 13:15:17 +00:00
Robin Mueller
d81c3758d5
update docs (#977)
Add notice for systems without native CAS operations
2024-09-18 13:14:28 +00:00
Finomnis
5cafe9dd0b
Fix STM32 Monotonic for peripherals with only two Clock Compare modules (#960)
* Update dependencies of stm32g0 timer example

* Replace obsolete probe-run with probe-rs run

* Modify stm32 monotonic to work with timers that have only 2 compare modules

* Add changelog

* Fix typo
2024-07-05 16:19:51 +00:00
Henrik Tjäder
918f9c3f13
Breaking change: portable-atomic (#922)
* Atomics: Replace polyfill with portable-atomic

* Update Cargo.lock for examples

* RTIC: portable-atomic: Update changelog

* rtic-monotonics: portable-atomic: Update changelog

* lm3s6965: enable critical-section when testing

* xtask: Enable portable-atomic/critical-section

When dealing with rtic-monotonics

* rtic-monotonics: portable-atomics: Do not disable the ability to fallback

---------

Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
2024-06-23 06:45:49 +00:00
Emil Fresk
689c4a068e Make rtic-monotonic macros create a public type 2024-06-02 12:34:43 +02:00
Foo
6865b69616
add support for nrf52805 (#941) 2024-05-27 11:26:09 +00:00
Martins Polakovs
5d05d607ee
Bump rp2040-pac to 0.6 in rtic-monotonics (#905)
* Support rp2040-pac v0.6 in rtic-monotonics

* Add changelog entry

* Fix rp2040_local_i2c_init example
2024-04-21 10:46:29 +00:00
Finomnis
8c23e178f3
Monotonic rewrite (#874)
* Rework timer_queue and monotonic architecture

Goals:
 * make Monotonic purely internal
 * make Monotonic purely tick passed, no fugit involved
 * create a wrapper struct in the user's code via a macro that then
   converts the "now" from the tick based monotonic to a fugit based
   timestamp

We need to proxy the delay functions of the timer queue anyway,
so we could simply perform the conversion in those proxy functions.

* Update cargo.lock

* Update readme of rtic-time

* CI: ESP32: Redact esp_image: Too volatile

* Fixup: Changelog double entry rebase mistake

---------

Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
2024-04-10 22:00:38 +00:00
Finomnis
bbed945285
Fix race condition in calculate_now (#860)
* Fix race condition in calculate_now

* Add changelog

* Update changelog

* Refine comment

* More comment fixes
2023-12-06 18:36:09 +00:00
Finomnis
f377471e44
Fix nrf::rtc errata workaround (#858)
* Deprecate `should_dequeue_check`

* Fix errata by delaying the wakeup point

* Add changelog

* Fix changelog typos
2023-12-06 18:36:06 +00:00
Finomnis
89160b7cb9
Fix nrf monotonics (#852)
* Fix nrf::timer

* Bootstrap nrf52840-blinky example

* More work on nrf blinky example

* Fix README

* Add asserts for correct timer functionality

* Add correctness check to other monotonics as well

* Update Changelog

* Fix potential timing issues

* Fix race condition in nrf::rtc

* Add changelog

* Add rtc blinky example

* Change rtc example to RC lf clock source

* Add changelog to rtic-time

* Add changelog

* Attempt to fix CI

* Update teensy4-blinky Cargo.lock
2023-12-06 07:49:38 +00:00
Finomnis
c227a71d24
Refactor race condition free timer helper (#850)
* Implement half_period_counter in rtic-time

* Rename compute_now to calculate_now, use it in stm32 and imxrt

* Add more tests

* Add some docs

* Fix clippy warning, add imxrt timer to monotonics tests

* Bump dependency version to make sure monotonics will build properly

* Add changelog to rtic-monotonics

* Add more docs

* Add more docs

* Finish documentation

* Fix typos

* Switch from atomic-polyfill to portable-atomic

* Some more doc fixes

* More doc fixes

* Minor doc fix

* Minor doc fix

* Fix Atomics not existing

* Fix example

* Minor example improvement

* Revert back to atomic-polyfill

* Fix cargo.toml formatting

* Remove atomic-polyfill

* Attempt to fix unused macro warning

* Remove atomics completely from half period counter

* Minor doc fix

* Doc fixes

* Doc fixes

* Remove obsolete comment

* Fix ordering in monotonic initialization sequence
2023-12-04 14:53:02 +00:00
Finomnis
612a47ef4d
Fix mono delay (#843)
* rtic-time: Compenstate for timer uncertainty

* Update changelog and incorrect cargo.lock in an example

* Fix Monotonic impls

* Fix tests

* Fix other monotonics, again

* Update changelog

* Fix example

* Fix DelayUs and DelayMs impls

* Minor coding style fix in u64 conversions

* Fix all changelogs

* Fix changelog

* Fix blocking DelayUs

* Minor monotonic rework

* Add delay precision test

* Add more tests

* Add rust-version tags to Cargo.toml

* Fix imxrt, rp2040 and systick timer

* Fix more monotonics

* Fix systick monotonic

* Some reverts

* Fix imxrt

* Fix nrf

* Fix rp2040

* Fix stm32

* Fix systick

* Fix rtic-time tests

* Bump to e-h.rc2

* Apply e-h.rc2 fixes to rtic-time

* Apply fixes from arbiter

* Fix clippy warning

* Minor beautification

* Revert previous changes

* Fix variable name

* Add blocking tests, but disable them by default
2023-12-01 07:59:22 +00:00
Finomnis
028a0046bc Update systick.rs 2023-11-10 20:49:12 +00:00
Finomnis
af550483f5 Add documentation for imxrt; other doc fixes 2023-11-10 20:49:12 +00:00
Henrik Tjäder
ea8b5b6c33 CI: rtic-monotonics: systick not always in scope
Links are checked during compilation, and to not
make it overly complex remove the link

```
error: unresolved link to `systick`
 --> rtic-monotonics/src/lib.rs:7:11
  |
7 | //! The [`systick`] monotonic works on all cortex-M parts, and requires that the feature `cortex-m-systick` is enabled.
  |           ^^^^^^^ no item named `systick` in scope
  |
  = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
  = note: `-D rustdoc::broken-intra-doc-links` implied by `-D warnings`
  = help: to override `-D warnings` add `#[allow(rustdoc::broken_intra_doc_links)]`

error: could not document `rtic-monotonics`
```
2023-11-08 20:43:32 +00:00
Finomnis
2fd3b3c404 Add Monotonic for i.MX RT chip family 2023-11-08 19:43:09 +00:00
Finomnis
1f76fb063d Fix STM32 monotonic rollover race condition 2023-11-08 19:42:43 +00:00
Emil Fresk
3c9a8f290d Fix CI with async_fn_in_trait not being a feature 2023-11-01 19:52:57 +00:00
Nils Fitinghoff
8824202c5a rtic-monotonics: Fix stm32-metapac use
Previously, the stm32 monotonics only compiled for some chip families. For
example, stm32g081kb worked, but not stm32f407*.

The stm32-metapac does not directly unify peripheral names between the
many stm32 families, but provides tools for build scripts to generate
code that uses the right names for the selected chip. Use that mechanism
instead of targeting a specific family.
2023-10-03 20:50:50 +00:00
Nils Fitinghoff
a2ec8f983c rtic-monotonics: Implement blocking DelayUs from embedded-hal 1 2023-09-19 13:31:09 +00:00
Andres Vahter
54aec9b398 add embedded-hal-async impl to stm32 2023-09-06 18:48:36 +00:00
Andres Vahter
7dcc59d4ed expose all stm32-metapac chips as features
add more supported timers
2023-09-06 18:48:36 +00:00
Andres Vahter
7d223ffe57 PoC Monotonic impl based on stm32-metapac 2023-09-06 18:48:36 +00:00
Nils Fitinghoff
4ea73021d6 rtic-monotonics: Add 64-bit SysTick monotonic
Counting at 1 kHz, 32 bits for counting ticks is not enough to ensure
monotonicity for more than 50 days. Add a feature to change the backing
storage to 64 bits.
2023-08-25 15:16:18 +00:00
Emil Fresk
5b2d722446 Support RP2040 PAC v0.5 in rtic-monotonics 2023-08-08 10:00:20 +00:00
Emil Fresk
0228350ef4 Fixed new TAIT requirement and release v2.0.1 of RTIC 2023-07-25 08:16:13 +00:00
datdenkikniet
9eae3ed4be Update embedded-hal-async 2023-04-23 17:31:51 +02:00
bors[bot]
55083fb3cc
Merge #736
736: More `xtasks` and add examples to `rtic` repo r=korken89 a=datdenkikniet

This was in #732 before, but decluttering that PR seemed sensible

Co-authored-by: datdenkikniet <jcdra1@gmail.com>
2023-04-16 19:19:09 +00:00
datdenkikniet
2db26c1015 Deny on warnings in xtasks 2023-04-16 13:08:46 +02:00
datdenkikniet
401c636215 rtic-monotonics: Add some docs 2023-04-15 19:19:49 +02:00
Emil Fresk
69ad6df2ed rtic-monotonics: export fugit the same for all monotonics 2023-04-10 21:38:26 +02:00
Emil Fresk
0bb5814443 Fix monotonics race 2023-04-05 20:20:55 +02:00
Emil Fresk
aeec8bd41b Add setting of priority to interrupts 2023-04-04 21:40:19 +02:00
Emil Fresk
a2f153249f Added nRF monotonics 2023-04-02 15:19:07 +02:00
Emil Fresk
ee6e6938f6 Update monotonic token macro names 2023-03-29 20:09:36 +02:00
Yandrik
ef12ae6b04 refactor: re-formatted files 2023-03-15 20:17:26 +01:00
Yandrik
28790218c0 refactor(macro): changed not-yet-changed crate names to $crate 2023-03-15 20:15:20 +01:00
Yandrik
a071ab05b2 refactor(macro): used $crate for better interop 2023-03-15 20:04:27 +01:00
bors[bot]
534d42edf5
Merge #702
702: Monotonics interrupt token r=AfoHT a=korken89



Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
2023-03-11 20:18:58 +00:00
Emil Fresk
e4d9284e25 rtic-monotonics: Add interrupt tokens to make sure users bind interrupts 2023-03-11 20:59:26 +01:00
Emil Fresk
19bab47bba rtic-monotonics: Unmask the RP2040 timer 2023-03-11 20:28:24 +01:00
Henrik Tjäder
98c5490d94 rtic-monotonics: Fix tests 2023-03-04 21:58:45 +01:00
Henrik Tjäder
44af136605 CFG: Align all crates to use hyphen 2023-03-04 20:22:45 +01:00
Emil Fresk
b9e0f36aff Add feature flags 2023-03-01 00:35:20 +01:00