Commit Graph

3825 Commits

Author SHA1 Message Date
Rasmus Melchior Jacobsen
8aaffe82e7 Add incremental hash to FirmwareUpdater
This adds support for computing any hash over the update in the dtu area by providing a closure to the hash update function.
2023-04-03 14:59:55 +02:00
bors[bot]
0909a6cd3f
Merge #1312
1312: Let bootloader partition have read/write/erase operations r=Dirbaio a=rmja

This change should not have any breaking changes.

Co-authored-by: Rasmus Melchior Jacobsen <rmja@laesoe.org>
2023-04-03 11:49:44 +00:00
bors[bot]
08f911d25e
Merge #1318
1318: rp: Allow zero len reads for buffered uart r=Dirbaio a=timokroeger

Prevents the read methods from getting stuck forever.

cc `@MathiasKoch` can you test if this fixes the problem you described in the chat?

Co-authored-by: Timo Kröger <timokroeger93@gmail.com>
2023-04-02 18:33:36 +00:00
Timo Kröger
7ef6a3cfb2 rp: Allow zero len writes for buffered uart
Prevents the write methods from getting stuck forever.
2023-04-02 14:36:32 +02:00
bors[bot]
cd2ed065dc
Merge #1317
1317: Fix set_baudrate on RP-PICO r=Dirbaio a=TFleury

See [comment](https://github.com/embassy-rs/embassy/pull/1243#issuecomment-1492894626)

Co-authored-by: Thierry Fleury <thierry@codinlab.fr>
2023-04-02 10:03:20 +00:00
Timo Kröger
f78aa4f936 rp: Allow zero len reads for buffered uart
Prevents the read methods from getting stuck forever.
2023-04-01 14:31:24 +02:00
Thierry Fleury
0e13fe9925 Fix set_baudrate on RP-PICO 2023-04-01 11:44:49 +02:00
Rasmus Melchior Jacobsen
d9d6fd6d70 Add erase and wipe tests 2023-03-31 10:28:47 +02:00
Rasmus Melchior Jacobsen
42931b51f2 Let bootloader partition have read/write/erase operations
This change should not have any breaking changes.
2023-03-31 10:18:19 +02:00
bors[bot]
e3efda2249
Merge #1311
1311: Split bootloader implementation into multiple files r=lulf a=rmja

No other change has been made. I think that I have all the types re-exported in lib.rs as before.

Co-authored-by: Rasmus Melchior Jacobsen <rmja@laesoe.org>
2023-03-31 06:56:26 +00:00
Rasmus Melchior Jacobsen
373760a56b Split bootloader implementation into multiple files 2023-03-31 08:05:37 +02:00
Dario Nieuwenhuis
5955d81374
Merge pull request #1263 from embassy-rs/turbowakers
Turbo-wakers 🚀
2023-03-30 19:03:03 +02:00
Dario Nieuwenhuis
80972f1e0e executor,sync: add support for turbo-wakers.
This is a `core` patch to make wakers 1 word (the task pointer) instead of 2 (task pointer + vtable). It allows having the "waker optimization" we had a while back on `WakerRegistration/AtomicWaker`, but EVERYWHERE, without patching all crates.

Advantages:
- Less memory usage.
- Faster.
- `AtomicWaker` can actually use atomics to load/store the waker, No critical section needed.
- No `dyn` call, which means `cargo-call-stack` can now see through wakes.

Disadvantages:
- You have to patch `core`...
- Breaks all executors and other things that create wakers, unless they opt in to using the new `from_ptr` API.

How to use:

- Run this shell script to patch `core`. https://gist.github.com/Dirbaio/c67da7cf318515181539122c9d32b395
- Enable `build-std`
- Enable `build-std-features = core/turbowakers`
- Enable feature `turbowakers` in `embassy-executor`, `embassy-sync`.
- Make sure you have no other crate creating wakers other than `embassy-executor`. These will panic at runtime.

Note that the patched `core` is equivalent to the unpached one when the `turbowakers` feature is not enabled, so it should be fine to leave it there.
2023-03-30 17:55:55 +02:00
bors[bot]
754bb802ba
Merge #1294
1294: Add support for `QSPI` in `stm32` r=Dirbaio a=Mirror0

Implemented with help of Tomasz Grześ <tomasz.grzes@gmail.com>.

Tested only on stm32f777zi.

Co-authored-by: Mateusz Butkiewicz <mateusz@github.butkiewicz.dev>
2023-03-29 13:42:29 +00:00
Mateusz Butkiewicz
87898501a2 feat(stm32:qspi): convert some u8 to enum variants 2023-03-29 14:28:25 +02:00
bors[bot]
7a841b58d1
Merge #1307
1307: (embassy-stm32): add embedded-io blocking Read + Write for BufferedUart r=MathiasKoch a=MathiasKoch



Co-authored-by: Mathias <mk@blackbird.online>
2023-03-28 12:35:07 +00:00
Mathias
14f6bc88ea Remove unnecessary lifetime 2023-03-28 14:34:36 +02:00
Mathias
2d7f35cf57 Add embedded-io blocking Read + Write for BufferedUart 2023-03-28 14:28:44 +02:00
bors[bot]
cf179f3076
Merge #1303
1303: Add logging and interface for debugging USB buffer usage r=Dirbaio a=jamesmunns



Co-authored-by: James Munns <james@onevariable.com>
2023-03-27 16:31:13 +00:00
James Munns
20aa86d63e Address review comments 2023-03-27 18:21:11 +02:00
James Munns
a77fdefd7c Correct copy/paste errors 2023-03-27 15:37:12 +02:00
James Munns
a6cef4baf2 Add logging and interface for debugging buffer usage 2023-03-27 14:19:00 +02:00
Mateusz Butkiewicz
6a802c4708 feat(stm32:qspi): add support for QSPI in stm32
Implemented with help of Tomasz Grześ <tomasz.grzes@gmail.com>.
2023-03-27 13:20:00 +02:00
Dario Nieuwenhuis
732614579b
Merge pull request #1302 from embassy-rs/update-stm32-pac
Update stm32-metapac
2023-03-27 13:09:11 +02:00
Dario Nieuwenhuis
a33774ec51 Update stm32-metapac 2023-03-27 12:36:31 +02:00
bors[bot]
8a3a7c65a8
Merge #1291
1291: executor: Allow TaskStorage to auto-implement `Sync` r=Dirbaio a=GrantM11235



Co-authored-by: Grant Miller <GrantM11235@gmail.com>
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2023-03-26 22:23:00 +00:00
Dario Nieuwenhuis
21400da073 executor: Use AtomicPtr for signal_ctx, removes 1 unsafe. 2023-03-27 00:22:00 +02:00
Dario Nieuwenhuis
805bca1f5a executor: deduplicate doc comments. 2023-03-27 00:20:24 +02:00
bors[bot]
7186e03801
Merge #1299
1299: sync/pipe: update to clarify docs that it is byte-oriented. r=Dirbaio a=Dirbaio

There was some language copypasted from Channel talking about "messages" or "values", that is not really accurate with Pipe.

bors r+

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2023-03-26 21:34:01 +00:00
Dario Nieuwenhuis
2c45b5c519 sync/pipe: update to clarify docs that it is byte-oriented.
There was some language copypasted from Channel talking about "messages"
or "values", that is not really accurate with Pipe.
2023-03-26 23:32:12 +02:00
bors[bot]
9c7b9b7848
Merge #1288
1288: fix(rp): spi transfer r=elpiel a=elpiel

Fixes #1181 

Co-authored-by: Lachezar Lechev <elpiel93@gmail.com>
2023-03-26 15:55:58 +00:00
Lachezar Lechev
7be63b3468
fix: spi transfer bug and additions to test
Signed-off-by: Lachezar Lechev <elpiel93@gmail.com>
2023-03-26 18:14:17 +03:00
Lachezar Lechev
cd2f28d2ab
chore: add spi_async tests for uneven buffers
Signed-off-by: Lachezar Lechev <elpiel93@gmail.com>
2023-03-24 12:14:38 +02:00
Lachezar Lechev
9939d43800
fix: PR comment
Signed-off-by: Lachezar Lechev <elpiel93@gmail.com>
2023-03-24 12:14:23 +02:00
bors[bot]
299689dfa2
Merge #1295
1295: (embassy-rp): Add embedded-io blocking Read + Write for BufferedUart r=MathiasKoch a=MathiasKoch



Co-authored-by: Mathias <mk@blackbird.online>
2023-03-23 13:27:14 +00:00
Mathias
88483b5abe Fix return type for EH-nb traits 2023-03-23 14:26:37 +01:00
Mathias
04f90e3a9d Add embedded-io blocking Read + Write for BufferedUart 2023-03-23 14:18:19 +01:00
bors[bot]
aa77a06d58
Merge #1287
1287: stm32: use stm32-metapac from crates.io, remove stm32-data submodule. r=Dirbaio a=Dirbaio

- `embassy-stm32` uses `stm32-metapac` from `crates.io`.
- Remove `stm32-data` submodule.
- Remove `stm32-metapac`, `stm32-metapac-gen`. These are now in the `stm32-data` repo.
- Remove `stm32-gen-features`, since it used `stm32-data` directly.
  - The feature list in `stm32-metapac` is generated by `stm32-metapac-gen` now.
  - The feature list in `embassy-stm32` can be updated by hand by copypasting from `stm32-metapac`'s `Cargo.toml`. We can add a script to do this automatically later if that's too annoying.
- Remove outdated `xtask` scripts that no longer work. Not needed anymore, you can run CI locally by doing `./ci.sh`.

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2023-03-21 14:04:10 +00:00
bors[bot]
425a35bf8a
Merge #1292
1292: perf(pubsub): Skip not needed clone of last message r=Dirbaio a=rmja

... return the pop'd message instead

Co-authored-by: Rasmus Melchior Jacobsen <rmja@laesoe.org>
2023-03-21 12:29:29 +00:00
Rasmus Melchior Jacobsen
ce7bd6955f perf(pubsub): Skip clone on last message 2023-03-21 13:25:49 +01:00
Grant Miller
41d558a5f4 executor: Allow TaskStorage to auto-implement Sync 2023-03-20 17:08:15 -05:00
Lachezar Lechev
7a4db1da26
fix(rp): spi transfer
Signed-off-by: Lachezar Lechev <elpiel93@gmail.com>
2023-03-20 16:34:30 +02:00
Dario Nieuwenhuis
0b49b588a2 stm32: use stm32-metapac from crates.io, remove stm32-data submodule. 2023-03-20 02:38:12 +01:00
bors[bot]
b6663a013f
Merge #1274
1274: Example using the PIO to drive WS2812 aka Neopixel RGB leds r=Dirbaio a=CBJamo

This example also uses a pio program compiled at runtime, rather than one built at compile time. There's no reason to do that, but it's probably useful to have an example that does this as well.

Co-authored-by: Caleb Jamison <Caleb@hellbender.com>
2023-03-19 23:43:41 +00:00
bors[bot]
3e541c43e7
Merge #1282
1282: fix(pubsub): Pop messages with count=0 after unsubscribe r=Dirbaio a=rmja



Co-authored-by: Rasmus Melchior Jacobsen <rmja@laesoe.org>
2023-03-19 23:19:23 +00:00
Dario Nieuwenhuis
fcd24adba9 vscode: recommend extensions, disable toml formatting, update. 2023-03-19 22:38:34 +01:00
bors[bot]
4bfe624893
Merge #1285
1285: Add must_use to OnDrop r=Dirbaio a=rmja



Co-authored-by: Rasmus Melchior Jacobsen <rmja@laesoe.org>
2023-03-17 14:38:19 +00:00
Rasmus Melchior Jacobsen
7be385dbb1
Add must_use to OnDrop 2023-03-17 11:40:19 +01:00
bors[bot]
f9c0c53e12
Merge #1284
1284: Fix APB clock calculation for several STM32 families r=Dirbaio a=ericyanush

This PR fixes #1283

Co-authored-by: Eric Yanush <eric@yanu.sh>
2023-03-17 07:49:09 +00:00
Eric Yanush
13f0c64a8c Fix APB clock calculation for several STM32 families 2023-03-16 21:21:39 -06:00