357 Commits

Author SHA1 Message Date
Dániel Buga
581eec517e
Do not enable static_cell/nightly (#3676) 2025-06-23 09:43:11 +00:00
Dániel Buga
2438d03b21
Simplify generated code to save on build time, yeet a few dependencies (#3643)
* Reduce use of iter::chain

* Cache all symbols

* Trim xtensa-lx-rt deps

* Remove unused dep

* Replace chrono with jiff

* Yeet minijinja

* Save a bit on toml_edit

* Disable some default features

* Disable regex log filters

* Reduce xtensa-lx-rt build script

* Remove unnecessary dependencies

* Remove darling

* Update embedded-test

* lol

* Clean up

* Only validate loaded config once

* fmt

* Changelog
2025-06-17 20:35:00 +00:00
Dániel Buga
8cf0fc7153
Test -Zstack-protector (#3636)
* Test -Zstack-protector

* Pass config as inline TOML to cargo

* Try to fix failing test
2025-06-16 12:05:21 +00:00
Dániel Buga
3e6b85bf30
Update i2c/spi instance info (#3627)
* Add instances to drivers

* Move AnyI2c

* Move AnySpi and DataMode

* Generate new semver baseline
2025-06-13 13:56:52 +00:00
Björn Quentin
45248100f4
Simple ota example (#3629)
* Fix esp-bootloader-esp-idf

* Use OTA enabled partition table for examples

* Add simple OTA example

* CHANGELOG.md

* Create a dummy `ota_image` in CI

* mkdir

* Remove unnecessary details from CHANGELOG

* Make non-Window's users life easier

* Test ROM function in esp-bootloader-esp-idf

* Fix
2025-06-13 13:42:09 +00:00
Dániel Buga
c15fc6773e
Esp32: ensure wifi data comes before bss (#3635)
* Place wifi data before bss

* Minor fixes

* Changelog

* Fix the stack guard's address
2025-06-13 08:28:29 +00:00
Dániel Buga
793b01beaa
Move timer instance config into driver metadata (#3626)
* Remove timg_timer1 symbol

* Ensure instances exist

* Rename timers to timergroup

* Remove unnecessary cfg
2025-06-12 14:49:04 +00:00
Gabriel Hansson
1b5a85e7d6
chore: remove unused esp-build dependency listings (#3625) 2025-06-12 13:42:26 +00:00
Dániel Buga
2b6cece356
Lower the probability of a lockup (#3589) 2025-06-05 11:43:44 +00:00
Dániel Buga
4894220e29
Add multi-core critical section test (#3585) 2025-06-05 11:04:38 +00:00
Dániel Buga
6ab240d7ff
Fix i2c hanging after cancelling a transaction (#3572)
* Add failing test

* Reset FSM when cancelling a transaction

* Refactor clear_bus_blocking to avoid duplicating the logic

* Extract timeout from ClearBusFuture

* Clear bus immediately when cancelling an async transfer
2025-06-02 12:12:03 +00:00
Dániel Buga
946cbf842e
Fix duration_since_epoch (#3582) 2025-06-02 11:12:44 +00:00
Dániel Buga
d3a303c4be
Use the I2C future on ESP32, add sw timeout for S2 (#3571) 2025-05-30 13:19:01 +00:00
Kirill Mikhailov
59cfe438fe
change common test pins for esp32 (#3573) 2025-05-29 16:36:16 +00:00
Dániel Buga
f5305a6686
Add i2c blocking timeout test, unwrap results (#3567)
* Add blocking timeout test

* Don't ignore return values
2025-05-29 10:51:49 +00:00
Dániel Buga
6a49e9e0cd
Parametrize I2C tests a bit better (#3566) 2025-05-28 10:52:18 +00:00
Björn Quentin
7e2f1b1d31
Include uninit in noinit section (#3558)
* Include `uninit` in noinit section

* CHANGELOG.md

* Include `defmt` in flip-link test
2025-05-27 13:06:36 +00:00
Juraj Sadel
c6437c7a44
Update examples and qa-test to new bootloader (#3541) 2025-05-26 10:37:41 +00:00
Björn Quentin
51e23fe14d
Fix ESP32 PSRAM (in combination with esp-storage) (#3524)
* Fix ESP32 PSRAM (in combination with esp-storage)

* CHANGELOG.md

* Cleanup

* Add test
2025-05-23 14:28:18 +00:00
Kirill Mikhailov
c53e0bf788
UART: Adding HW and SW flow control config option (#3435)
* Add HW and SW flow control option

* Fmt + warnings

* changelog entry

wrong unstable macro

* address reviews

* get away with using 1 pin only

* unnecessary function call

* Address reviews + use "byte" instead of misleading "character" (at_cmd)
2025-05-21 10:36:07 +00:00
Benedikt
fe25980e53
RMT: Minor cleanups, simplify address calculations, extend HIL test (#3477)
* RMT: simplify/avoid a few cfg attributes

* RMT: factor address calculation into new function channel_ram_start()

* RMT: don't repeatedly read *ChannelInternal::memsize()

Moving this into separate variable greatly increases readability of the
code. It also avoids unnecessary repeated volatile reads of the
corresponding register.

* RMT: rework SingleShotTxTransaction offset calculation

This is not a big simplification yet, but will help will help with
simplifying the somewhat obscure `ram_index` calculation.

* RMT: rework SingleShotTxTransaction offset calculation, part 2

This removes the somewhat hard to parse
    let ram_index = (((self.index - memsize) / (memsize / 2)) % 2) * (memsize / 2);
calculation, by resorting to the ping-pong method also used by the idf
code.

Importantly, even with the previous code, ram_index cannot in fact assume any
possible in-range value in channel RAM, but only either 0 or memsize / 2
(except at the end of a transaction, when there's no data left).

Thus we can update it via
    ram_index = memsize / 2 - ram_index
such that will alternate ("ping-pong") between 0 and memsize / 2.

* RMT: error out on config.memsize == 0

* RMT: fix bogus cfg attributes

This is inside of a #[cfg(any(esp32, esp32s2))] block, so esp32s3 can
never happen: The result of nested cfg attributes was still correct, but
writing it like this doesn't make any sense.

* RMT: remove unnecessary integer literal type annotation

* RMT: remove spurious code from clear_interrupts()

- update() is known to be a no-op here
- For other chips, resetting pointers and setting mem_owner is not done
  in clear_interrupts(), but in start_rx. clear_interrupts() is only used in
  situations where either the channel was unused before (i.e. should be
  stopped), or we explicitly called Self::stop() before. Thus, match
  other chips here.

* RMT: clear mem_owner in start_tx

While I haven't seen this happen, it appears to be possible that one of
the subsequent channels (or even the current channel) was used for RX before.
Thus, ensure that mem_owner is set correctly for TX.

* RMT: small refactoring

There should be no functional change, but this should make it even more
obvious that the return value is exactly the number of codes written.

* RMT: in SingleShotTxTransaction, improve error handling

I haven't seen any error here in practise, but it seems that this could
have locked up in the `while !is_threshold_set()` loop before in case of
an error or early stop code in the data.

* RMT: avoid one register access

* RMT: update HIL tests to use wrapping and extended RAM

* RMT: address review regarding data-writing loops

Make the code less startling by performing writes to the hardware in a
more imperative style via the for-loop; slightly refactor slice
splitting.

* RMT: Update changelog
2025-05-20 13:11:26 +00:00
Dániel Buga
aeaab9a95b
Give more time to ECC tests (#3500) 2025-05-19 14:46:06 +00:00
Dániel Buga
74de9d65d6
Update allocator_api2 (#3487) 2025-05-19 07:38:07 +00:00
Dániel Buga
e2a9fc7437
Try to fix timeout errors when the I2C driver is preempted (#3458)
* Add test case

* Check completion before error
2025-05-08 15:05:22 +00:00
Dániel Buga
9c0512c1be
Hopefully innocent I2C-related cleanups (#3460)
* Simplify test

* Clean up
2025-05-07 13:47:58 +00:00
Dániel Buga
5df246c702
Rely on esp-metadata for chip feature check (#3447) 2025-05-06 08:11:53 +00:00
Dániel Buga
8011a30bd0
Fix write_str returning early (#3452) 2025-05-05 13:41:07 +00:00
Dániel Buga
16897bb68d
Tweak features and dependencies (#3425)
* Group optional dependencies

* Separate version from crate name

* Restore defmt-log mutual exclusivity

* Gate ufmt

* Remove usb-device

* Feature-gate unsable dependencies behind unstable

* S2: assume single core for portable-atomic

* Clean up feature flag docs

* Sack debug

* Fix clippy

* Update examples

* Fix usb-otg feature

* Fix fmt

* Add version to log dep

* Also mark bluetooth private

* Correct changelog/MG

* Clean up esp-hal-embassy

* Clean up ieee802154

* Clean up esp-println

* Move the timestamp function up

* Move info from readme to feature docs

* Clean up esp-storage

* Clean up esp-wifi

* Fix examples

* Add a note for the private features
2025-05-05 11:33:55 +00:00
Dániel Buga
a828331a62
GPIO interrupts, once more (#3408)
* Add test case

* Split into files

* Do not clear interrupt status bits in handler

* Document changes

* Refactor gpio tests to test the default interrupt handler by default

* Fix typo

* Extract mk_static

* Write a bit about interrupt handling

* Various fixes

* Test that the future doesn't resolve for a preceding interrupt

* Add multi-core test

* ESP32: handle GPIO interrupt on the listening core

* Fix multi-core edge case
2025-04-30 13:03:33 +00:00
Dániel Buga
5c97eaf8ba
Fix panic on long waits (#3433)
Co-authored-by: Scott Mabin <scott@mabez.dev>
2025-04-29 08:00:27 +00:00
Dániel Buga
68ffb747db
Update embedded-test (#3432) 2025-04-28 11:29:58 +01:00
Dániel Buga
cb4b09fb62
Rework GPIO matrix impl (#3395)
* WIP

* Clean up init_gpio

* Expand docs a bit

* Remove Input/OutputConnection

* Not everything has PCNT and it's not important for the example

* Remove Frozen, enable input when creating the signal

* Hide fields, add getters

* Update MG

* Add force GPIO matrix fns

* Fix formatting

* Mention latency in the docs

* Rename number to gpio_number

* Deduplicate pin setup code

* Reword associated peripheral

* Rename with_inverted_input/output

* Remove link to doc-hidden OutputSignal

* Fix link syntax
2025-04-25 10:33:29 +00:00
Dániel Buga
fec36e3be3
Implement ReadReady and WriteReady (#3423) 2025-04-25 07:54:58 +00:00
Dániel Buga
b1f487093b
Update dependencies (#3416) 2025-04-24 13:41:20 +00:00
Björn Quentin
11ff06a368
Fix esp32 coex (#3403)
* Make sure to enable relevant interrupts

* Fix more

* Make `current_runlevel` public

* Check that interrupts are enabled when initializing

* Try to be more honest in `is_in_isr`

* Adjust log levels

* Really fix ESP32 COEX

* Improve COEX example

* fmt

* CHANGELOG

* CHANGELOG

* Clarify on `esp_bt_controller_config_t`

* Take INTENABLE into account

* Test esp-wifi init fails

* Simplify test code

* Clarify comment

* fmt

* Rename

* Adapt the test

* Revert unrelated changes (esp_bt_controller_config_t)

* Align Xtensa (current_runlevel)

* Additional test

* Change test
2025-04-24 11:39:07 +00:00
Kirill Mikhailov
04b71139be
disconnect unused connections (#3407) 2025-04-22 15:50:09 +00:00
Kirill Mikhailov
ec6aec4b59
Fix I2C HIL tests (#3405) 2025-04-22 13:32:58 +00:00
Dániel Buga
ffbcae162a
Simplify Flex (#3387)
* Simplify Flex

* Rename functions
2025-04-22 12:30:34 +00:00
Björn Quentin
4bc9ef2f5b
Check for ST_TOUT / MAIN_ST_TOUT (#3333)
* Check for ST_TOUT / MAIN_ST_TOUT

* Fix & CHANGELOG

* cfg gate

* Field renaming in PACs

* Introduce FsmTimeout type

* `new_const`

* Review comments

* Async I2C tests

* Remove FSM timeout for S2

* Add test

* Don't run `async_test_timeout_when_scl_kept_low` on S2 - we know it fails

* Fix

---------

Co-authored-by: Scott Mabin <scott@mabez.dev>
2025-04-22 11:11:11 +00:00
Kirill Mikhailov
b33b877592
Bump edition to 2024, bump MSRV to 1.85 (#3391)
* inter-state

* inter-state (2)

* warnings fix

* fix warnings

* fmt + changelogs

* another unsafe extern "C" doode

* real fmt now

* MSRV + format

* Ignore unsafe_op_in_unsafe_fn lint for now in esp-hal and esp-wifi

* msrv + fmt

* ugh....

* get lcd_cam example right

* expr_2021 -> expr experiment

* gagagugu

* reviews

* more unneeded unsafes (help)

* finish esp-hal unsafe cleanup

* each unsafe call is marked separately

fmt

* should be good now (?)

* piece was never an option...

* dumb
2025-04-22 10:39:11 +00:00
Dominic Fischer
bfe6a1c689
Tidy up Camera according to latest guidelines (#3375)
* Tidy up `Camera` according to latest guidelines

* fmt

* enum
2025-04-16 09:19:49 +00:00
Dániel Buga
11ba2509d2
Peripheralize DMA channels (#3372) 2025-04-14 09:09:54 +00:00
Dániel Buga
014db9bc7e
Define unstable config options (#3365)
* Add stability to config options

* Reject unstable options

* Add note to docs

* Use enum validator in e-h-embassy

* Generate a list for enumerated values

* Don't allow line-wrapping headers

* Center default/allowed values

* Changelog

* Display stability under name

* Remove - from Allowed value when option has no constraints

* Mark more options as unstable

* Include a hint in the unstable error
2025-04-11 15:00:13 +00:00
Dominic Fischer
ba944a2931
Replace ParlIoFullDuplex/ParlIoTxOnly/ParlIoRxOnly with just ParlIo (#3367) 2025-04-11 07:52:04 +00:00
Dominic Fischer
353950dbdf
Change ParlIo driver to use a config struct (#3359)
* Change `ParlIo` driver to use a config struct

* missed a spot
2025-04-10 09:51:55 +00:00
Dominic Fischer
7b4b41c0ed
Add DMA memcpy support to the S2 (#3352)
* Expose CopyDmaChannel

* Add DMA memcpy support to the S2

* whoops, esp32 is a thing

* clear can be a no-op

* sigh

* rust

* enable the DMA channel

* The S2 wants RX first...

* fmt
2025-04-09 13:57:15 +00:00
Dominic Fischer
f87f8846b2
More PARL_IO HIL tests (#3339)
* More PARL_IO HIL tests

* adjust

* adjust

* tweak

* tweak

* give up on the H2

* remove flakey test

* Update CHANGELOG.md

* add comment
2025-04-09 10:33:41 +00:00
Dániel Buga
0a4089b4d3
Refactor GPIO pin types (#3349) 2025-04-09 08:20:37 +00:00
Björn Quentin
523bd381eb
Validate 7-bit I2C addresses (#3343)
* Validate 7-bit I2C addresses

* add test

* CHANGELOG.md

* Docs

* Include address in `Error::AddressInvalid`

* Fix

* CHANGELOG.md

* Revert CHANGELOG change

---------

Co-authored-by: Dániel Buga <bugadani@gmail.com>
2025-04-08 11:35:36 +00:00
Dominic Fischer
d6c6894afe
Make ParlIo driver construction more consistent (#3345)
* Make `ParlIo` driver construction more consistent

* missed a spot
2025-04-08 08:37:33 +00:00