2572 Commits

Author SHA1 Message Date
Dániel Buga
3e015dfd1c
Read thread ID with interrupts disabled (#4155) 2025-09-19 18:11:36 +00:00
Dániel Buga
9f7193fec4
Put the whole print macro in a critical section (#4154) 2025-09-19 18:09:57 +00:00
Ulf Lilleengen
62529e2fd3
chore: update bt-hci version (#4146)
* chore: update bt-hci version

* chore: use released version of trouble-host

* Make sure clippy fails, fix warning

---------

Co-authored-by: Dániel Buga <bugadani@gmail.com>
2025-09-19 13:48:49 +00:00
Simon Neuenhausen
8e29b925cb
Split out PHY init into esp-phy crate. (#3892)
* Minimal infrastructure

* Implemented dig reg backup.

* usb bbpll

* Removed default feature.

* OS adapter tweaks

* Fixed S2 and implemented PhyController

* Added manual deinit.

* Fixed linker scripts and migrated esp-radio to esp-phy

* Fixed warnings.

* Fixed NPL

* Tried fixing NPL again

* Fixed ieee802154

* Fixed reading chip version of S3.

* fmt

* Added changelog entry

* Added changelog for esp-radio

* Deleted chip specific common adapters.

* Added docs and unstable

* Migrated cal data load/store to esp-phy

* Fixed PHY cal CI error

* Removed instability

* Removed feature from esp-phy

* fmt

* Fixed esp-sync docs.

* Removed log with CONFIG

* Removed nonreentrantmutex from common adapter

* Disable reset for radio blocks where required.

* Fixed cfg_if for s2

* fmt

* Added bt_bb_v2_init_cmplx to phy_provides.x

* Added CHANGELOG

* Moved EXTERN and fixed comment.

* Fixed lint

* Fixed common adapter again.

* Docs and Readme.

* Fixed ref count.

* This time pls.

* Added MAC time update CB for esp-radio

* fixed field init

* Fixed inconsistency in metadata

* Removed useless changelog entry

* Fixed S2.

* Swaped addr_of for &raw mut

* Properly initialize NVS

* Fixed lint

* Fixed C6

* Fixed remaining issues

* Fixed CI

* Added link

* Updated esp-wifi-sys in esp-phy

* Address reviews

* Renamed PHY lock

* Moved syscon let in common_adapter

* Fmt

* Remove critical_section

* Don't steal when not necessary

* Added esp-phy changelog to workflow

* Add cargo metadata for esp-phy

* Added reference to #4015

* Refixed Cargo.toml

---------

Co-authored-by: Dániel Buga <bugadani@gmail.com>
2025-09-19 14:14:25 +00:00
Dániel Buga
83105b4dbb
Replace some inline ASM with xtensa_lx implementations (#4144)
* Fix incorrect uses of wsr.intset

* Also use interrupt::clear

* Also replace wsr.vecbase

* Remove cause_sw_intr_to_core from C3/S3
2025-09-19 11:52:33 +00:00
Dániel Buga
e57530c9b5
Process timer queue in timer interrupt handler (#4147) 2025-09-19 10:45:21 +00:00
Björn Quentin
37f048f20b
Fix ota-update example (#4145) 2025-09-19 08:11:24 +00:00
Dániel Buga
5e938322f4
Remove static muts from multicore control code (#4143) 2025-09-19 07:47:32 +00:00
Dániel Buga
f0d029b29d
Fix running specific test (#4142) 2025-09-19 05:11:40 +00:00
Dániel Buga
69776eb638
Even more cargo-batch, encode configs in Cargo.toml (#4134)
* Abstract out LP-core targeting packages

* Encode targets_lp_core in Cargo.toml

* Encode architecture compatibility in Cargo.toml

* Move semver_checked into Cargo.toml

* Cache parsed tomls

* Parse simple feature sets from Cargo.toml

* Move all basic feature rules to Cargo.toml

* Add check configs

* Limit command length on Windows

* Update cargo.rs

* Add clippy configs

* Use a single syntax, use a single doc-config line

* Fix known problems

* Run cargo check in CI command

* Fix more problems

* Fix esp-storage
2025-09-18 16:15:35 +00:00
Juraj Sadel
9e892db654
clean up (#4141) 2025-09-18 15:30:38 +00:00
Juraj Sadel
3d0d20002e
Make a singleton form FlashStorage constructor, removed Default (#4132)
* Make a singleton form FlashStorage constructor, removed Default

* changelog

* Simplify, don't need the Singleton

* changelog

* reviews and build errors

* fix dead links

* fmt
2025-09-18 14:33:42 +00:00
Dániel Buga
1eed542f64
Use cargo-batch to build tests and examples, avoid linting so much (#4108)
* Use cargo-batch

* Run CI on mac runner

* Rely on MSRV and nightly jobs to lint

* Build docs separately

* Don't copy examples - fix builds on stable

* Run everything by default, set CI env var in ci command

* Run batched commands with RUSTC_BOOTSTRAP enabled

* Force cargo-batch to correctly ignore unstable option

* Test with nightly

* Use a persistent target folder, remove cache

* Don't delete the lp examples

* Restore target dir

* Build with stable again

* Fix rebase fail

* Remove handling tests

* Remove redundant code

* Restore repeated test run option

* Add simpler cargo check

* Introduce check-packages

* Remove stabilized -Zdoctest-xcompile

* Clean up commented code

* Remove more stuff

* Fix uart_uhci test

* No badger for us
2025-09-18 11:25:11 +00:00
Benedikt
8e58a753b6
RMT: refactor copies to/from channel RAM (#4126)
* RMT: add check_data_eq to log more details on test failure

if defmt is enabled

* RMT: add minimal RmtWriter

- de-duplicates the copy-to-hardware code
- splits copying data to the buffer and `start_send`
- this also paves the way for supporting other data types (like
  iterators instead of slices)

* RMT: add minimal RmtReader

- de-duplicates the copy-from-hardware code
- this also paves the way for supporting other data types (like
  iterators instead of slices) and wrapping rx (RmtReader as implemented
  here already supports that, but it's unused for now)
2025-09-18 08:48:43 +00:00
Szybet
97b34faa1b
Improve the UHCI Api, configurable after splitting and dma channel as generic (#4039)
* Make UHCI more configurable

* UHCI hil tests improvements

* change DMA to use DmaXXChannel

* further merging

* Apply suggested changes

* split structs

* changelog

* changelog + format
2025-09-18 07:43:34 +00:00
Juraj Sadel
aadbf3c076
Remove duplicated log (#4133) 2025-09-17 14:04:11 +00:00
Dániel Buga
42297811be
Use TLSF by default (#4130)
* Use TLSF by default

* Update example heap usage to leave more stack

* Fix test configurations
2025-09-17 14:03:32 +00:00
florianL21
acf3327fa3
Esp storage implement multi core strategies (#4082)
* First draft of multicore strategies implementation

* Implemented second core active detection mechanism
Removed dependency to esp-hal

* Guarded flash unlock as well
Made esp_metadata_generated only check for chips if not building with "emulation"
Added more documentation

* Applied suggestions

* Restored second core active detection for esp32

* Flipped check of stall condition on esp32

* Implement defmt::Format and common traits

---------

Co-authored-by: Dániel Buga <bugadani@gmail.com>
2025-09-17 13:00:05 +00:00
Juraj Sadel
555922b887
Add defmt to esp-storage (#4127)
* Add defmt to esp-storage

* changelog

* Fix technically-incorrect feature comment

* Add some docs for pub API

* Move demft in the optional deps

* reviews

* reviews
2025-09-17 11:09:23 +00:00
Benedikt
099b70fef9
RMT: move channel specification to esp-metadata (#4131) 2025-09-17 11:05:29 +00:00
Dániel Buga
38bd6a5a88
ESP32/I2S: Allow connecting MCLK (#4128)
* Support CLK_OUT on ESP32 I2S

* Enable example

* Remove mclk_signal from ESP32
2025-09-17 10:40:14 +00:00
Juraj Sadel
139ce0e0c7
xtask housekeeping, adding logs, adding missing docs (#4106)
* xtask housekeeping, adding logs, adding missing docs

* Use anyhow::Context
2025-09-17 10:17:29 +00:00
Dániel Buga
646495eb16
Runtime wifi config options (#4121)
* Turn country code and default power mode into runtime configs

* Move G_CONFIG setup to wifi::new

* Turn most configs into runtime options

* Set core ID to current one

* Mark most options unstable
2025-09-17 08:13:18 +00:00
Dániel Buga
321ae5ef1b
Rewrite Xtensa startup code in assembly (#4117)
* Initialize rtc RAM in xtensa-lx-rt

* Rewrite CPU reset handler in ASM
2025-09-17 07:57:23 +00:00
Dániel Buga
3a4b7c6ded
Fix AES touching memory at inappropriate places (#4124)
* Add failing test

* Avoid copying the writeback buffer

* Fix AES cache operations
2025-09-17 07:23:59 +00:00
Björn Quentin
89b81a2f8e
update radio blobs (#4113)
* update radio blobs

use esp-wifi-sys 0.8.2

* CHANGELOG.md

* fmt

* Address review

* Address review comments

* Address review comments
2025-09-17 06:59:00 +00:00
Dániel Buga
54d0da12af
Add defmt+esp-println example (#4122)
* Add defmt+esp-println example

* Fix warning

* Un-nit the pick
2025-09-16 15:09:06 +00:00
Dániel Buga
177e99fcef
Add TimerHandle::is_active (#4119) 2025-09-16 13:52:59 +00:00
Scott Mabin
3f024529e2
upgrade to 1.89.0.0 for CI (#4102)
* upgrade to 1.89.0.0 for CI

* regenerate baseline

* Resolve clippy errors

---------

Co-authored-by: Jesse Braham <jesse@beta7.io>
2025-09-16 11:53:59 +00:00
Dániel Buga
b3a17079e8
Ping i2c sensor after cancellation (#4120) 2025-09-16 11:32:30 +00:00
Benedikt
d7d4e79aef
RMT: don't require physical pin connections for loopback HIL tests (#4118)
by using Flex::split instead
2025-09-16 11:32:15 +00:00
Jesse Braham
92bf58f6ec
Miscellaneous cleanup in rtc_cntl module (#4112)
* Define a metadata symbol for SWD

* Use `cfg_if` rather than multiple `cfg`s

* Eliminate some pointless variable declarations

* Make derives match for both versions of `RtcCalSel`

* Disallow instantiation of `Rtwdt` or `Swd` outside of `Rtc`
2025-09-16 10:56:35 +00:00
Dániel Buga
9c35cf9b16
Test and fix critical-section feature in esp-println (#4116) 2025-09-16 06:40:17 +00:00
Dániel Buga
9d596ca752
esp-radio: remove scheduler lifecycle management, remove idle task (#4093)
* Start scheduler on preempt init, remove deinit

* Static-allocate the main task context

* taskless idle

* Remove the need for an idle task
2025-09-15 12:47:39 +00:00
Juraj Sadel
c1c226a20d
esp-radio: Add BuilderLite for EapClientConfig (#4115)
* esp-radio: Add BuilderLite for EapClientConfig

* changelog
2025-09-15 10:58:15 +00:00
Sergei Varibrus
31a0b1c60f
fix: I2S RX half-sample bits configuration and add regression test (#4109)
* fix: I2S RX half-sample bits configuration and add regression test

* add record in CHANGELOG.md

* turn off test for esp32s2
2025-09-15 10:48:53 +00:00
Dániel Buga
63009c8163
Fix warning without unstable (#4107) 2025-09-12 19:12:01 +00:00
Juraj Sadel
a5a0833318
Add a CI workflow for checking links in .rs, .md, and .toml files acc… (#4098)
* Add a CI workflow for checking links in .rs, .md, and .toml files accross esp-hal workspace

fix dead links

* exclude unpublished crate documentation's links

* Add .lycheeignore with excluded links

* play with patterns

* don't forget to remove
2025-09-12 10:48:04 +00:00
Dániel Buga
f41c86a902
Create timer task on demand (#4091) 2025-09-12 07:06:03 +00:00
Dániel Buga
56aac5e179
Reduce likelyhood of very short scl pulses (#4099) 2025-09-11 18:18:39 +00:00
Dániel Buga
b346074de0
Release RTC_I2C resources when dropped (#4101) 2025-09-11 15:35:57 +00:00
Benedikt
97e3d00c90
RMT: Misc refactoring (#4100)
* RMT: move configure_*x_channel to Channel impl

These methods are essentially (unsafe) constructors for Channel, so it
makes sense for them to be part of the Channel rather than free-standing
functions.

Importantly, this refactoring also reorders channel configuration and
creation of GenericPeripheralGuard. Note that it's still not guranteed
that the peripheral is clocked when configuring it, since code like the
following compiles:

```
let ch0_creator = {
	let rmt = Rmt::new(peripherals.RMT, freq).unwrap();
	rmt.channel0;
	// Other fields of `rmt` are dropped, including the
	// `Rmt.peripheral: RMT` field.
	// Since not GenericPeripheralGuard has been created at this
	// point, this will disable the peripheral's clock.
};

// This re-enables RMT clocks. With this commit, it does so before
// actually accessing RMT registers. However, the clock configuration that
// happens in Rmt::new() will have been lost!
// -> will be fixed in a later PR
let ch0 = ch0_creator.configure_tx(pin, config).unwrap();
```

There's no change to the API here.

* RMT: merge transmit_continuously{,with_loopcount}

...by introducing an extra loopcount argument.

Add the LoopCount enum such that the resulting code remains readable.

This is in preparation for adding more variants of rx/tx methods in
order to avoid combinatoric explosion.

* RMT: use stop_tx if available, only for esp32 fill buffer with end markers

note that stop_tx requires an update() call (according to TRMs and to IDF code)

for consistency, this also removes all update() calls from the low-level
methods in favor of explicit calls
this de-duplicates some update calls for start_tx()

* RMT: deduplicate ContinuousTxTransaction::{stop, stop_next}

* RMT: remove spurious ch_tx_thr_event access on Rx channel

for esp32 + esp32s2, which don't support the ch_rx_thr_event (this was
partially cleaned up in #3701 already, but this instance was overseen)

* RMT: assert!(...is_ok()) -> unwrap in HIL tests
2025-09-11 14:15:38 +00:00
Dániel Buga
ba2d541624
Some mild scheduler cleanup (#4096)
* Clean up arch-specific task code

* Avoid a few redundant unwraps in run_scheduler

* Pass TaskPtr to alarm callback

* Ensure the radio runs on the scheduler's core

* clippy

* Add warnings
2025-09-11 12:11:23 +00:00
Kirill Mikhailov
b01f444822
Implement Error trait more (#4097)
* Implement `Error` trait more

fmt

* oi

* fix
2025-09-11 11:17:29 +00:00
Dániel Buga
d16b68396c
Try to explain preempt needs (#4092) 2025-09-11 08:37:21 +00:00
Dániel Buga
627a25e7dc
Disable wdt after test (#4095) 2025-09-11 10:36:35 +02:00
Dániel Buga
cf80e6a8f1
Implement priority levels (#4090)
* Add priority to tasks

* Separate Mutex out of counting Semaphore

* Add priority inheritance to mutexes

* Test priority inheritance, fix issues

* Compare against the owner's current priority
2025-09-11 08:03:44 +00:00
Björn Quentin
9e190f112d
Use riscv-rt's startup and trap-handling code (#3857)
* Use riscv-rt's startup code

* CHANGELOG.md

* Enable v-trap - get rid of one unused function

* Re-use riscv-rt's TrapFrame instead of keeping a copy of it

* fmt

* Update riscv-rt rev

* Enable defmt

* use riscv-rt's trap handling

* Compile on stable

* (Re)add the SP fixing code

* Move comment

* Update `riscv*` deps

* esp-riscv-rt: Remove the (unused) CI feature
2025-09-11 07:48:44 +00:00
Jesse Braham
6f033666c8
Move RTC clock enums/structs to clock module (#4089)
* Move RTC clock enums to `clock` module and fix naming violations

* Move `RtcClock` to `clock` module

* Update migration guide

* Update `CHANGELOG.md`

* Remove invalid attribute from enum variant
2025-09-10 09:47:07 +00:00
Dániel Buga
35e208236a
Add wait queues to semaphore/queue (#4086)
* Add wait queue to semaphores

* Spawn idle task, prevent re-waking a ready task

* Add wait queues to queues

* Clean up wait queues

* Remove task from wait queue on timeout/resume

* Do not re-schedule deleted task

* Implement simple stack overflow detection

* Task deletion: remove task from queues in one place

* Fix storing context into freed memory

* Restore idle task stack size

* Undo alloc changes

* Don't let task sleep if wakeup time is in the past

* Improve codegen of esp_preempt_now
2025-09-10 07:24:25 +00:00