2399 Commits

Author SHA1 Message Date
Dániel Buga
90fb97531c
Make metadata macros available even for build scripts (#3906) 2025-08-07 11:03:47 +00:00
Björn Quentin
d0a2d49565
Make sure tagged isr callback pointers don't get accidentally called (#3885)
* Make sure tagged isr callback pointers don't get accidentally called

* Changelog and MG

* Honor ESP32-S2's special needs

* Address review comments
2025-08-07 10:41:48 +00:00
Björn Quentin
52790613d2
Don't fail on long strings (#3905)
* Don't fail on long strings

* CHANGELOG.md
2025-08-07 10:32:03 +00:00
Björn Quentin
46fd87347a
Don't panic in build.rs when using RA with rustc-wrapper (#3904) 2025-08-06 19:21:04 +00:00
Björn Quentin
4dac7bafe2
RISCV: Don't pass TrapFrame into interrupt handlers (#3903)
* RISCV: Don't pass TrapFrame into interrupt handlers

* CHANGELOG.md

* Fix

* Remove the fake-trapframe
2025-08-06 13:44:13 +00:00
Dániel Buga
70e2b3d435
Fix FlashRegion capacity (#3902) 2025-08-06 08:43:05 +00:00
Björn Quentin
3ab3490d62
Move malloc etc to esp-alloc, common C functions to esp-rom-sys, define "C functions" in esp-radio weak (#3890)
* Provide malloc, free and friends in esp-alloc

* Mute warning

* Remove some (now unused) global symbols

* Have a way to opt-out of esp-alloc's malloc,free etc.

* Fixes

* Move some common C functions from esp-radio to esp-rom-sys

* Fix

* Make esp-readio symbols weakly linked

* CHANGELOG.md

* Align MSRV, cleanup visibility

* Init before `assume_init`

* Linker script fixes

* Fix examples

* Remove heapless - esp-radio is alloc

* Fix examples

* Whitespace

* realloc_internal

* Make `__esp_radio_putchar` a no-op if `sys-logs` is not enabled
2025-08-05 11:58:31 +00:00
Dániel Buga
97cc5e4d7a
Fix AES issues, clean up API (#3895) 2025-08-05 07:25:39 +00:00
Dániel Buga
351dcfd367
Fix indexing (#3896) 2025-08-04 09:11:49 +00:00
Dániel Buga
3ec26ead9d
Crypto work queue [AES] (#3880)
* Implement a generic work queue

* Implement AES work queue backend with software block modes

* Move tail after enqueueing

* Use NonNull more liberally

* Tweak the queue a bit

* Merge the AES-DMA test into the AES test suite

* Drop AesFlavour

* Document things

* Stop the driver when its handle is dropped

* Fix docs

* Address some correctness concerns
2025-08-01 08:45:36 +00:00
Björn Quentin
3c12be8d24
Move exception handler from esp-backtrace to esp-hal (#3887)
* Move exception handler from esp-backtrace to esp-hal

* CHANGELOG.md

* Fix

* Only use defmt compatible display hints

* Workaround xtensa-lx-rt and riscv-rt not implementing defmt::Format

* Add `defmt` feature to xtensa-lx-rt and esp-riscv-rt

* Favor feature gates over random `allow`s - remove unnecessary `allow`s
2025-08-01 07:57:42 +00:00
Juraj Sadel
0fbbe2d22c
esp-wifi: Add unstable feature, mark ble, esp-now, csi, sniffer, and smoltcp features and APIs as unstable (#3865)
* esp-wifi: Add unstable feature, mark ble, esp-now and csi features and APIs as unstable

* changelog

* fix hils

* rebase and reviews

* rebase

* Make at least wifi_embassy_dhcp work without unstable feature

* remove rand_core

* rebase

* Check if a feature is selected which needs unstable

* reviews and fix ci

* reviews
2025-07-31 07:59:05 +00:00
Björn Quentin
dfd66be8ab
Simplify riscv trap handler (#3875)
* use `riscv::interrupt::nested` for nesting

* Only save/restore caller saved registers in trap-frame (risc-v)

* Replace RISC-V scheduler

* Cleanup

* Clippy

* CHANGELOG.md

* Make sure to reset the runlevel to current, not prio-1

* Clippy

* Fix it for real

* Address review comments

* Address review comments

* More docs, optimize away one instruction

* Address review comments

* Address review comments

* Use a bool for the nested flag again

* Fix

* Clippy
2025-07-30 18:31:05 +00:00
Benedikt
3c21662606
RMT: Refactor state checks, support non-blocking poll on blocking transactions (#3716)
* RMT: add get_tx_status, get_rx_status methods

Unused right now; these methods allow to look at all flags without several
volatile reads (in contrast to calling is_tx_done/is_rx_done,
is_tx_threshold_set, is_error individually). `match`ing on their result
leads to very idiomatic code, and also result in blocking and async code
that is very similar.

The #[inline] attribute might not be required, but better be sure: We
really don't want the Option<Event> to actually be constructed, but
rather that the compiler completely optimized it away in favor of direct
bit tests in the calling function.

* RMT: optimize RmtTxFuture to avoid repeated register reads

* RMT: optimize RmtRxFuture to avoid repeated register reads

* RMT: Optimize ContinuousTxTransaction by avoiding repeated register reads

* RMT: Optimize/simplify SingleShotTxTransaction (1/2)

by merging two loops into one

* RMT: Optimize/simplify SingleShotTxTransaction (2/2)

by avoiding repeated register reads

* RMT: add poll() method to blocking transactions

This allows properly interleaving several such transactions (as the HIL
loopback tests do, in fact) or other work.

Regarding the implementation of the place_rmt_driver_in_ram feature for these
methods, note that `#[ram]` implies `[inline(never)]`.

Thus, this uses `#[inline(always)]` for `poll` and `wait` in that case,
which are rather simple methods.
If putting them in ram actually matters, the calling user code should
probably be placed in ram as well, and then, forced inlining of both
methods should have the desired effect.

`poll_internal` in turn
- contains more code and is called from `poll` and `wait`
	-> it seems sensible that it is not inlined to reduce code size.
- includes the hot loop that copies to the hardware buffer
	-> should be forced to ram
so `#[ram]` makes sense.

Note that none of this was benchmarked.

* RMT: Remove unused low-level methods

Their use has entirely be replaced by get_tx_status and get_rx_status
2025-07-30 18:28:08 +00:00
Dániel Buga
e0b3eb429d
Don't use defmt in ble tests (#3883) 2025-07-30 16:29:16 +00:00
Kirill Mikhailov
66b196a5f8
preempt crates: Rename esp_wifi-prefixed symbols to match new esp-radio crate name (#3881)
* rename `esp_wifi`-prefixed symbols to match new `esp-radio` crate name

* fmt

* rename the rest of functions + example variable renaming

* add migration guide

* reword 😅
2025-07-30 15:17:05 +00:00
Juraj Sadel
52831f7c0e
Move Bytes behing ieee802154 feature and make it pub(crate) (#3874) 2025-07-30 15:02:59 +00:00
Dániel Buga
406056ab9c
Midterm AES rework (#3882)
* Midterm AES rework

* Update esp-hal/src/aes/mod.rs

Co-authored-by: Dominic Fischer <14130965+Dominaezzz@users.noreply.github.com>

* Update esp-hal/MIGRATING-1.0.0-rc.0.md

Co-authored-by: Dominic Fischer <14130965+Dominaezzz@users.noreply.github.com>

* Panic on wrong size

---------

Co-authored-by: Dominic Fischer <14130965+Dominaezzz@users.noreply.github.com>
2025-07-30 15:02:12 +00:00
Kirill Mikhailov
e1917abf9f
esp32: Block ADC2 usage simultaneously with radio (#3876)
* block `ADC2` usage simultaneously with radio (esp32)

* implement `Drop` for `ADC2` (esp32)

fmt

format

* multiple fixes

* make functions internal, lint package

* Cleanup

* use `fetch_or` instead

* take it easy
2025-07-30 12:44:16 +00:00
Kirill Mikhailov
4eb4c89944
Fold esp-ieee802154 package into esp-radio (#3861)
* folding esp-ieee802154 to `esp-radio`

* remove the package

 Edit monorepo changelog to reflect the ieee-crate changes

* edit readme

* fix cargo.toml

* changelog update

fix changelog entry

* address reviews

* edit changelog

* remove useless "fmt.rs" file

* address reviews

* fix HIL build

sure

oh

fix hashmap inconsistency
2025-07-28 14:31:15 +00:00
Kirill Mikhailov
8ca0f94715
Get rid of EspRadio prefix in esp-radio structs (#3869)
* get rid of `EspRadio` prefix in esp-radio structs

* changelog entry + migration guide entry

* reword entries

* fmt run

* Fix migration guide entry

* edit the changelog entry to still reflect `esp-wifi` changes
2025-07-28 11:40:56 +00:00
Dániel Buga
a215aca629
Move REF_TICK and RC_FAST_CLK to metadata (#3866)
* Move REF_TICK and RC_FAST_CLK to metadata

* Don't try to use ref_tick if it doesn't exist

* Fix S3
2025-07-28 10:14:34 +00:00
Dániel Buga
82100314c5
Reorganize efuse code (#3868) 2025-07-28 08:35:17 +00:00
Dániel Buga
b2c31a1dac
Reorganize PSRAM (#3867) 2025-07-28 07:24:14 +00:00
Dániel Buga
bb50746e9c
Move TIMG clock source defaults to metadata (#3864)
* Read register once

* Move TIMG clock sources to metadata

* Also describe C2/3/S2/S3 clock source options

* H2: Use PLL as WDT clock source

* Fix H2 WDT calculation

* Initialize clocks before setting up WDT

* Set clock source for all timers in the timer group
2025-07-28 07:10:58 +00:00
Kirill Mikhailov
73ef8d9227
Rename esp-wifi to esp-radio (part 1) (#3858)
* rename `esp-wifi` to `esp-radio`

* Add migration guide entry

* changelog entry

* address reviews

* more fixes

* address reviews

* Thank you for this rebase!

* mmm, rebase

* Remove unnecessary diff

bob

* get rid off all `esp-wifi` references

* drop the links ƒrom the table
2025-07-25 12:26:08 +00:00
Dániel Buga
bb55f1152b
Remove raw interrupt map address (#3863) 2025-07-25 07:39:48 +00:00
Dániel Buga
87febcbb4f
Replace evalexpr (#3860) 2025-07-25 06:37:49 +00:00
Dániel Buga
07214ef80d
Split out preempt driver and default impl (#3855) 2025-07-25 06:35:19 +00:00
Dániel Buga
1af4e29014
Move RSA operand sizes to metadata (including AES fallout) (#3845)
* Encode RSA operand sizes in metadata, compactly

* Rework AES with for-each macro
2025-07-24 08:36:32 +00:00
Kirill Mikhailov
a2f2a224cd
Stop using ok in esp-wifi/esp-ieee802154 crates codebase. (#3853)
* is that it?

* `expect` <-> `unwrap`

* macro update

fix macro

* how did i manage to forget..?
2025-07-24 08:36:04 +00:00
Dániel Buga
818d30972d
Don't try to write FUNC_IN_SEL_CFG of non-matrix signal (#3849) 2025-07-23 07:41:18 +00:00
Dániel Buga
9eb89a3de5
Fix ble crash (#3854)
* Implement NPL timed dequeue

* Add failing test case

* Always return dequeued event

* Add a short sleep to prevent crashing while deinit
2025-07-22 17:12:13 +00:00
HaoboGu
bccd9d770a
Bump embassy-usb version (#3848)
* Bump `embassy-usb` version

Signed-off-by: Haobo Gu <haobogu@outlook.com>

* Add `embassy-usb` update to CHANGELOG.md

Signed-off-by: Haobo Gu <haobogu@outlook.com>

---------

Signed-off-by: Haobo Gu <haobogu@outlook.com>
2025-07-22 13:07:37 +00:00
Dániel Buga
3adadced67
Yield in usleep (#3852) 2025-07-22 12:47:24 +00:00
Juraj Sadel
3995a3f66d
esp-wifi: remove bunch of FIXMEs and clippy cleanup (#3851) 2025-07-22 12:47:07 +00:00
Dániel Buga
d9da2b4721
Restore printing exception context (#3850) 2025-07-22 10:32:17 +00:00
Dániel Buga
0c1cc17ed1
Move SHA algos to metadata (#3844) 2025-07-21 19:47:33 +00:00
Dániel Buga
fd66bd3dcc
Encode AES key lengths in metadata (#3843) 2025-07-21 19:01:45 +00:00
Dániel Buga
0d9f43db29
Rewrite RNG (#3829) 2025-07-21 15:10:35 +00:00
Dániel Buga
94d955bfb0
Fix GPIO matrix typo (#3840) 2025-07-21 14:59:36 +00:00
Björn Quentin
7af0f3f3bb
use riscv 0.14.0 (#3842)
* use riscv 0.14.0

* Don't use the re-exports from esp-riscv-rt because of the RT feature

* fmt

* More fixes caused by the existence of the `rt` feature
2025-07-21 14:37:12 +00:00
Kirill Mikhailov
2518789a5f
cleanup esp-wifi README (#3841)
* cleanup `esp-wifi` README

* better links format

* lose weight, less words
2025-07-21 14:25:11 +00:00
Dániel Buga
39d1e115c1
Add SOC config that is hidden from the peri table (#3839) 2025-07-21 11:48:15 +00:00
Dániel Buga
da9a933e7e
Panic in exception handler (#3838) 2025-07-21 11:43:14 +00:00
Denys Vitali
c4c8d1d5b9
feat(esp-wifi): add Country Code (#3837)
* feat(esp-wifi): add Country Code

* fix: fmt, changelog

* fix: cast

* chore: cargo xtask fmt-packages

* chore: remove example

* fix: use Option<[u8;2]> for country code

* fix: return Some

* Use an opaque type

---------

Co-authored-by: Dániel Buga <bugadani@gmail.com>
2025-07-21 11:00:57 +00:00
Dániel Buga
af6ffb102f
Update instability (#3836) 2025-07-21 09:37:58 +00:00
Kirill Mikhailov
de67c31013
Add additional configuration section to docs in packages that lacked this (#3827)
* Add `additional configuration` to docs in packages that lacked this

* update esp-backtrace doc

* address review

Co-authored-by: Dániel Buga <bugadani@gmail.com>

* update the "greeting" entry

* conditioned "force frame pointers" entry

* oopsy

---------

Co-authored-by: Dániel Buga <bugadani@gmail.com>
2025-07-18 18:54:09 +00:00
Dániel Buga
fc27f983c9
Generate new semver baseline (#3835) 2025-07-18 15:32:05 +00:00
Szybet
d02dd21871
Make stats fields in esp alloc public (#3828)
* Update lib.rs

* Update CHANGELOG.md

* Update CHANGELOG.md
2025-07-18 12:44:55 +00:00