185 Commits

Author SHA1 Message Date
Björn Quentin
a5be31fadc
Improve and use timer abstractions (#1753)
* Make esp-wifi timer agnostic

* Use timer-abstractions in embassy time driver

* Refactor

* Fix

* Fix

* Docs

* Adapt examples

* Adapt tests

* Refactoring

* Changelogs

* Fix example

* Adapt xtask

* Make CI pass

---------

Co-authored-by: Jesse Braham <jessebraham@users.noreply.github.com>
2024-07-09 15:59:38 +00:00
Kirill Mikhailov
253b013c2a run-doc-test README entry 2024-07-08 13:34:09 +00:00
Sergio Gasquez Arcos
60b9d5c704
fix: Update probe-rs arguments for run-elfs subcommand (#1734) 2024-06-28 13:42:30 +00:00
Sergio Gasquez Arcos
e46e80b8c1
Enable C2 HIL (#1680)
* ci: Enable c2 hil

* docs: Update pins and add C2

* feat: Update C2 probe-rs args

* test: Update pins and disable failing tests

* docs: Update S3 wires

* ci: Enable C2 hil tests
2024-06-26 14:17:40 +00:00
Jesse Braham
c9925b7f6d
Don't include dependencies in generated documentation when building with xtask (#1713) 2024-06-26 07:43:25 +00:00
Juraj Sadel
4c5e493b1b
esp-hal: Add runnable doctests to peripheral drivers (#1663)
* Check docs examples II

* rebase and update

* fix root crate macro expansion in doctest snippets

* clean up and fmt

* add xtask run-doc-test subcommand and check in CI

* address review comments

* remove commented printlns

* fix the host target check

* rebase and update

* hide docs for before_snippet macro and remove commented block code in twai
2024-06-11 10:18:09 +00:00
Jesse Braham
ebcd26fd51
Update xtask to support generating documentation for multiple packages (#1653)
* Update `xtask` dependencies

* Update `xtask` to support generating documentation for multiple chips

* Update CI and Documentation workflows

* Fix minor mistake in documentation index template
2024-06-04 15:27:41 +00:00
Jesse Braham
48e3e912f3
Extract embassy support into esp-hal-embassy package (#1595)
* Extract embassy support into `esp-hal-embassy` package

* Update relevant packages/examples/tests to get CI green again

* Add back `defmt` support

* Re-export `Executor` and `InterruptExecutor` rather than making `executor` module public

* Document the `esp-hal-embassy` package

* Update `CHANGELOG.md`

* Hack together a "fix" for the `SYSTIMER` time driver

* Make `clippy` shut up
2024-06-03 11:27:20 +00:00
Björn Quentin
7c25750e3a
Improve xtask on Windows (#1632)
* Improve `xtask` on Windows

* Use already existing `windows_safe_path` function
2024-05-28 13:27:15 +00:00
Björn Quentin
0ad4ee0c91
esp-wifi: Fix clippy issues (#1631)
* Don't activate additional features in esp-hal

* Apply `clippy --fix`

* Clippy

* Clippy

* Clippy

* Clippy

* Enable linting esp-wifi

* Fix

* Fix typo
2024-05-28 12:49:55 +00:00
Björn Quentin
60e4b882ef
Add esp-storage to esp-hal repo (#1627)
* Add esp-storage to esp-hal repo

* Include needed feature to lint esp-storage

* Don't lint esp-wifi for now

* Remove redundant copies of license texts

* Try `git-fetch-with-cli`

* Fix esp-pacs URL

* git-fetch-with-cli, again

* desperately trying
2024-05-27 15:28:05 +00:00
Jesse Braham
3b9a4938cb
Add a lint-packages subcommand to xtask, use in CI workflow (#1594)
* Add a subcommand to lint all packages using `clippy`, use in CI

* Address `clippy` warnings
2024-05-24 20:00:04 +00:00
Björn Quentin
06315b8c8c
Add esp wifi to monorepo with history (#1582)
* Move the existing `esp-wifi` package into a directory

* Update READMEs

* Don't prefix the ROM functions linker script with the chip name

* Address a couple comments from review

* Move the `esp-wifi` README back to the root of the repository

* Add esp-now support

* Don't use underscores in feature names

* Smoltcp 0.9 upgrade (#124)

* switch to heapless for SimpleQueue

* Merge Network into WifiStack

- Merge the Network and Wifi structs into WifiStack
- Get it building & running with just TCP socket for now

* get dhcp example building with changes and no warnings

* fixup error checking

* Fix other examples

* fmt

* Remove redundant comment

* fix unused results

* bump BT_INTERNAL_QUEUE to 10

* add back static ip configuration in work()

* Async WiFi (#125)

* Async WiFi with embassy

- Add embassy_net::Driver impl for WifiDevice
- Add embassy_dhcp example
- Update README with embassy_dhcp running instruction

Notes:

TCP connection may fail a few times until the esp gets an IP address, it
seems there is no way to await dhcp completion in embassy_net yet.

* Put embassy-net behind feature

- Whilst other embassy crates can be used behind the async feature,
  embassy-net should be put behind its own feature

* wait for dhcp to complete in example

* fmt

* Simplify embedded-io import

* Update README, use new bleps

* Ensure internal wifi buffers are freed (#128)

Regardless of whether we can do anything with the incoming packets, we
*must* ensure the drivers packet memory is free.

* Async WiFi: connect/disconnect/scan/wait_for_event (#129)

* Add async scan_n()

* WifiFuture and async connect

- Don't compile the blocking `WifiStack` when using the embassy-net
  feature
- Improve WifiEventFuture to have a waker for each WifiEvent
- Stub out async versions of embedded-svc trait

* Add async start/stop/connect

- All works first time
  - Fails on reconnect, but this is a bug in the svc implementation
- Implements `IntoFuture` for `WifiEvent`
  - Is it possible to await the event in two seperate futures? or will
    one overwrite the other?

* Async connect/disconnect

- Now working in fully async fashion
- Improved embedded-svc `Wifi` trait impl
  - is_started etc still needs work
- spotted memory leak when not transmitting anything

* Fix async start

Can now succesfully reconnect to a network

* Fix `is_started`

Closes https://github.com/esp-rs/esp-wifi/issues/126

* link state waker

* Only wake the transmit waker if we have something to send

* Correct WifiEventFuture

Instead of relying on the current state, it now tracks events and clears
the event before trying to listen.

* wifi: split into device and controller

- Split the wifi into two parts, the device part which is used within the
network stack and the controller, which handles the wifi connection
parts

- Remove the uneeded `Wifi` impl now that the two parts are separate

* undo cfg of blocking stack

* small fixups

* controller: add `wait_for_event`

- This solves the waker overwrite issue, as the function takes `&mut
  self`, meaning its only possible to await for the same event once.
- Sadly this means we have to remove the really clean `into_future` impl
  :(, but atleast we don't have to bump MSRV.

* Fix examples

* fmt

* make globals pub(crate)

* make all events awaitable

- Add wakers for all events
- Add some docs
- Make WifiEventFuture pub(crate)

* fix esp-now

* Add basic AP support (#134)

* Add basic AP support

* Remove IS_AP global static

* Remove uneeded features from examples and esp-wifi (#135)

* Adjust for latest HAL (#139)

* Adjust for latest HAL

* ESP32-S3 adjustments needed after update

* Use ESP32-C2 HAL 0.5.1

* ESP32-C6 WiFi support (#142)

* ESP32-C6 WiFi support

* Explain the `run_after_initialze_hack` function

* ESP32-C6 cleanup (#148)

* Use ESP_HAL to read mac address (#149)

* Refactor examples (#146)

* Move some boilerplate code into own examples-util crate

* Have an `examples-esp32XXX` folder for each target

* Cleanup dependencies

* Use workspace dependencies

* Adjust CI workflow

* `cd` into the right directories

* Don't pass chip selection features for examples

* Fix ESP32-C6 CI

* Refactor Socket::write to prevent infinite loop on long writes (#151)

* Use HAL's radio clock control (#153)

* Feature/radio singletons (#141)

* Use RADIO singletons

- Uses the RADIO singletons when creating wifi/ble/esp_now
- Updates all examples to use the singletons
- Simplfy esp_now::ReceiveFuture

* Fixup examples

* fmt

* fix examples

* Feature "big-heap", fix `calloc` (#155)

* Use types from `core::ffi::` (#159)

* Add wifi_set_mode for Wifi Protocol Support (#156)

* Add set_mode

* Revert unnecessary changes

* Review changes

* Removed unecessary change

* Review changes, merge conflict fix

* Add missing ROM functions for ESP32-S3/ESP32-S2 (#160)

* Add missing ROM functions for ESP32-S3/ESP32-S2

* Cut down nocoex + big-heap heap-size

* Async ble (#161)

* Async BLE HCI

* Add async-ble example

* Use nightly-2023-03-09 for CI (for now)

* Use a more sane default MTU, have features to change MTU (#164)

* Improve packet dumps (#165)

* packet-dump dumps the raw packets

* Update README, serialport config in wifishark

* Update embassy (#166)

* chore: update embassy's executor rev sync to 0.2

Signed-off-by: Lachezar Lechev <elpiel93@gmail.com>

* fix: examples - enable features for different example architectures

Signed-off-by: Lachezar Lechev <elpiel93@gmail.com>

* fix: examples riscv executor feature name

Signed-off-by: Lachezar Lechev <elpiel93@gmail.com>

* chore: update embassy-net & net-driver

Signed-off-by: Lachezar Lechev <elpiel93@gmail.com>

* fix - Cargo - on wifi, enable the embedded-svc feature

Signed-off-by: Lachezar Lechev <elpiel93@gmail.com>

* fix - config.toml - enable target atomic operations

Signed-off-by: Lachezar Lechev <elpiel93@gmail.com>

* fix: rustflags for atomic operations

Signed-off-by: Lachezar Lechev <elpiel93@gmail.com>

* fix: esp32s2 example - fix target cfg

Signed-off-by: Lachezar Lechev <elpiel93@gmail.com>

* chore: update crates & revisions

Signed-off-by: Lachezar Lechev <elpiel93@gmail.com>

* feat: patch to latest revision of esp hal crates

Signed-off-by: Lachezar Lechev <elpiel93@gmail.com>

* Adapt to esp-hal changes

* Use published esp-hal, published embassy-executor

---------

Signed-off-by: Lachezar Lechev <elpiel93@gmail.com>
Co-authored-by: Lachezar Lechev <elpiel93@gmail.com>

* Fix DHCP handling (#173)

* Don't use DHCP when using fixed IP

* Make it possible to connect to another AP

* A way to update iface-config (#177)

* fix(esp-wifi): Update is_started() implementation (#180)

The old implementation of is_started() returns `Ok(true)` is the sta or ap is enabled, which is true before wifi_start() has been called. This results in the function returning true, before `start()` has been called.

* Basic IPv6 Support

* Don't panic on full BLE receive queue

* Activate embedded-svc with wifi feature

* A way to dequeue a complete HCI packet

* Make ESP32 BLE work again

* preempt improvements (#185)

* [Xtensa] ensure CPU interrupts are re-enabled

Once the scheduler is enabled.

* [Xtensa] preempt: reduce from 2000hz -> 1000hz

This brings the task switching hz inline with the values for the RISCV
chips

* reduce preempt hz to 100 (freertos default)

* remove WIFI_BB interrupt from esp32_timer

* fix typo in timer_esp32s3

* peer_exists now returns bool

* De-duplicate init code

* What to initialize is now a runtime decision

* COEX is now an explicit feature

* Panic when trying to use BLE and WIFI w/o coex

* Improve feature gating of COEX check

* Make it possible to use ESP-NOW with (STA) WiFi

* Simplify async feature, update all examples

* Make timer type alias public

* Less verbose cfgs

* use linkage = 'weak' for missing intrinsic stub (#191)

* Workaround to make ESP32-C2 BLE work again

* Fix ESP32-C2 BLE

* Don't require timg0 as timebase

* ESP32 and ESP32-C2 working

* BLE works on C3 / S3

* Fix COEX for C3 and S3

* Make COEX for ESP32 compile again

* Remove embassy-net dependency

* Update smoltcp, embassy-net, embassy-net-driver

* Return all pending wifi events

* Clear the correct events, clear after polling, simplify scan_n

* Provide specialized futures

* Remove event in future when polling

* Avoid clearing interesting events

* Add DNS query interface to WifiStack (#213)

* feat(dns_query): add dns_query on WifiStack

* ref(dns_query): separate dns socket creation and dns query

* fix(dns_query): missing self parameter in is_dns_configured

* ref(dns_query): configure_dns now replaces and drops the old socket

* feat(dns_query): add proper dns_query error kinds

* feat(dns_query): dns_query now checks if name is already an ip

* feat(dns_query): dns server is set with dhcp configured event

* ref(dns_query): move dns update to configured case

* Update dependencies (#198)

* Clear state on stop (#217)

* fix log_timestamp value (#218)

The divider should be applied only on the TICKS_PER_SECOND, rather than on the whole systimer count, to get the proper value in millis

* Scan related refactorings (#221)

* Clean up scan result processing

* Remove redundant ap count reading

* Fix scan result API returning clipped AP count

* Inline closure

* Don't copy ssid

* Properly set initial config (#223)

* Properly set initial config

* Make new_with_config fallible

* Make EspWifiInitialization non-exhaustive

* Replace panic with error

* Enable wifi/bt power domain (#220)

* Refactor TCP socket read impl to handle correctly EOF and no data (#216)

* ref(tcp_read): tcp read now checks for eof and no data

* ref(tcp_read): SocketClosed is returned instead of Ok(0)

* Configurable tuning parameters (#233)

* Make certain settings configurable

* Add MD documentation

* Update HALs, uncomment commented code in S2 power domain enable (#235)

* Update esp dependencies

* S2: Properly reset radio power domain on enable

* Wait for esp now send callback to be called after sending (#232)

* Make check_error result propagatable with ?

* Wait for esp_now_send callback after sending #229

* Updated examples

* Add more configuration options (#234)

* Add more configuration options

* Remove obsolete mtu feature

* Simplify DEFAULT_HEAP_SIZE

* Make EspNow methods take immutable borrowed self (#237)

* Reduce stack-allocations (#243)

* Reduce stack-allocations

* Avoid explicit panic on exhausted backing memory

* Remove unnecessary `transmute`

* Add defmt::Format to some types (#251)

* use intset intclear now they are recognized by llvm (#248)

* use intset intclear now they are recognized by llvm

* Bump readme MSRV

* Remove comment

* Clean up btdm initialization (#254)

* Make log optional, add feature and macros to route to defmt (#252)

* Debug-print pointers

* Make log dependency optional

* Add Format to Config

* Add defmt log option

* Add panic macro

* Add unwrap macro

* A few DataFrame-related fixes (#257)

* Clean up DataFrame::from_bytes

* Fix potential typo

* Fix potential memory leak

* Clean up

* Only allocate data frame if queue is not full

* Free DataFrame on drop

* Fix warning

* Remove embedded-hal dependency (#258)

* Don't depend on PACs directly (#260)

* Remove DataFrame, Leverage the internal WiFi heap (#259)

* use heap allocated buffers for RX instead of memcpy to Rust

* remove tx queuing, leverage wifi heap again

* Allow sending up to TX_QUEUE size packets, instead of one at a time

* share tx & rx consume impls. move inflight check into function

* defmt related improvements (#255)

* Replace custom macros with fmt.rs

* Fix missing Format errors

* Update Cargo.tomls

* CI: deduplicate, assert that defmt feature compiles

* Update dependencies

* Fix examples

* Implemented duplex ESP-NOW correctly (#240)

* HAL cleanups & remove example macros (#261)

* use Systimer from hal where possible

* Remove RTC and clocks macros in favour of hal primitives

* Remove system! macro

* Remove the timer macro

* remove the radio macros

* Make utils a single file module for remaining util items

* Fix rebase issues

* Remove redundant example, update esp-now examples

* ESP32-C6 BLE Support (#262)

* ESP32-C6 BLE Support

* Reformat

* Docs & README changes for release (#263)

* Make internal functions/structs private where possible

* Top level docs

* Rework README, move examples into own file
* Include README as top level docs in esp-wifi

* Document public items

* Implement floor() using libm (#272)

* Support ps-max-modem (#273)

* Task/semaphore tweaking (#276)

* Query current systick once

* Use pattern matching to clean up task

* Work with references of timer slots

* Unwrap WORKER_HIGH

* Avoid unwrap by using exact length buffer, simplify types

* Log if work is lost

* Move memory fence to the end of the critical section

* Remove redundant cast

* Only reset timer fields once

* Import some types

* Replace manual borrow_mut

* Remove extra loop

* Deduplicate semaphore index calculation

* Use pattern matching instead of unwrap

* Use option instead of separate flag

* Unwrap REAL_WIFI_QUEUE

* Simplify lock_mutex

* Process message outside of critical section

* Remove unnecessary return statement

Co-authored-by: Scott Mabin <scott@mabez.dev>

* Remove unused import

---------

Co-authored-by: Scott Mabin <scott@mabez.dev>

* Avoid AtomicU64 if possible, fix race condition (#278)

* Xtensa: avoid AtomicU64 in get_systimer_count

* Fix get_systimer_count racy behaviour

* Improve code consistency

* Xtensa: Copy TrapFrame in one statement (#279)

* Remove StrBuf (#280)

* Allow using AP when `ps-max-modem` is enabled (#283)

* Set inactive time only for ps-max-modem

* Set inactive time regardless of modem sleep mode

---------

Co-authored-by: bjoernQ <bjoern.quentin@mobile-j.de>

* Config for failure_retry_cnt and scan_method (#282)

* Deduplicate SoC/arch-specific task switching related code (#284)

* Clean up imports, refer to crate-relative hal

* Move timer* files to submodule, split out common code

* Deduplicate time-based task switching

* Extract common setup fn

* Fix overflow in timestamp calculation (#287)

* Fix log strings (#292)

* Fix typo in ble feature name (#297)

The `initialize` function checks if wifi and ble are enable simultaneously without coex, but it was mistakenly using `feature = bluetooth` instead of `feature = ble`. This meant the check was actually never compiled in.

* Enable `vsnprintf` on compilers newer than `1.73.0.1` (#293)

* Add compiler version check for VaListImpl support

* Raise log level of puts

* Split wifi state for AP and STA (#288)

* Split wifi state for AP and STA

* Use atomic enum to store state

* Clean up unnecessary unsafe blocks

* Misc. simplifications (#298)

* Hide os_adapter

* Remove global is_connected fn

* Extract state management

* Set mode when creating the controller, extract some fns

* Encapsulate WifiMode a bit better

* Simplify setting addresses to static data

* Only set verbose logging once

* Clean up imports

* Deduplicate wifi auth method conversion

* Clean up powersave mode setup

* Remove unnecessary condition

* Explain transmute

* Misc small readability improvements

* Remove unnecessary conversion

* Prepare waiting for multiple interfaces to start and stop

* Pull up wifi interface to caller

* Remove unnecessary binding

* Don't log warnings twice

* Simplify dump_packet

* Explain default config in constructor

* Remove always-panicking new

* Elide lifetime

* Fix sometimes-unused import

* Implement gettimeofday and __assert_func (#304)

* Implement gettimeofday

* Implement __assert_func

* Reimplement log_timestamp

* Configure burst size on async Device, allow 0 as no maximum (#308)

* Set burst size for async Driver

* Use 0 to indicate no max burst size

* Remove unused import (#310)

* Prevent some leaks & a bit of cleanup (#306)

* Decrease inflight counter if internal tx fails

* Clean up recv_cb

* Avoid leaking AP list when scan is cancelled

* Also register transmit waker when calling receive

* Shorten unsafe block

* Explain and reuse FreeApListOnDrop, split up unsafe block

* Block until mutex can be locked (#318)

* Block until mutex is locked

* Don't drop EspWifiPacketBuffer in a critical section

* Misc small changes (#312)

* Set levels to trace, unify some stuff, implement int disable

* Remove unnecessary paths

* Only check once if random is set, copy impl from esp-hal

* Avoid matching on constant

* Print current time in same line as other arming params

* Simplify tick <-> time conversions

* Work around espflash resolving timer addresses

* Raise compat_timer_setfn level to debug

* Resolve warnings

* Fix malloc pointer mutability

* Simplify import

* Resolve commented question

* Clean up a bunch of timer code, use `heapless::Vec` instead of array of options (#313)

* Fix early timeout when counter overflows

* Store the correct fn pointer type

* Remove wrapper around ets timer functions

* Sort out timer: ets_timer, other pointer types

* Use heapless::Vec to store timers

* Fix and clean up npl

* Fix hal_uart_init_cbs signature

* Queue fixes and cleanups, work queue `->` task spawn (#316)

* Clean up imports

* Clean up queue operations

* Clean up task spawning and running

* Move syslog out of common, implement `%ll{u,d}` (#317)

* Move syslog out of common

* Handle escaped percent sign (%%)

* Handle long longs

* Make sure the scheduling won't start before everything is setup (#324)

* Add some config validations from esp-idf (#325)

* Added support for Wifi scan options (#302)

* I added support for wifi options

* Implement a lot of suggestions

* Update esp-wifi/src/wifi/mod.rs

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

* Refactor

* Make it a little more prettier

* Add more documentation

* Update esp-wifi/src/wifi/mod.rs

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

---------

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

* Replace a panic with a compile error (#321)

* Fix fn pointer signatures

* Clean up scoping a bit

* Simplify clock validation

* Make WifiBle option only available when coex is enabled

* Check for wifi and ble if coex is enabled

* Simplify BTDM osi funcs setup

* Xtensa: Set up time slice before switching task, tweak tick rate (#323)

* Set up time slice before switching task

* Make timer code a bit more obvious

* Divide clock cycles by a multiple of 8

* Unify examples (#296)

This PR merges the chip specific examples into one folder, inside the
esp-wifi project.

To simplify building, alias' have been added to
`esp-wifi/.cargo/config.toml` per chip to automatically select the right
target and enable the chip feature.

Add build script detection for invalid features

Fix CI, use build instead of check to detect linker errors

enable async feature of hal, this breaks because of interrupt definition for systimer

upgrade hal rev

upgrade hal rev c6

undo binding modifications

fix esp now

fix esp coex

use released hals, update async examples

sync example names

sync example names

Update examples.md

Document alias

update build alias

* Add a benchmarking example for blocking and async (#328)

* Unify examples

This PR merges the chip specific examples into one folder, inside the
esp-wifi project.

To simplify building, alias' have been added to
`esp-wifi/.cargo/config.toml` per chip to automatically select the right
target and enable the chip feature.

Add build script detection for invalid features

Fix CI, use build instead of check to detect linker errors

enable async feature of hal, this breaks because of interrupt definition for systimer

upgrade hal rev

upgrade hal rev c6

undo binding modifications

fix esp now

fix esp coex

use released hals, update async examples

sync example names

sync example names

Update examples.md

Document alias

update build alias

* Add bench server

* Add bench example

* Add async bench example

* Add bench example to ci

* fmt

* fix CI

* Document bench example

* Use embassy-net 0.2 (#289)

Co-authored-by: Hailey Somerville <hailey@hailey.lol>

* Clean up examples a bit (#332)

* Revise API docs (#330)

* Revise API docs

* Rephrase description of `WifiStack`

* Formatting

* Simplify multitasking (#334)

* AP-STA mode (#299)

* Configure AP-STA mode

* Split up link state waking into two branches

* Add WifiMode::ApSta

* Simplify mode setup

* Deduce wifi mode from config if available

* Rework internals to support AP-STA mode

* Add `new_ap_sta` constructor

* Demote Rx token warning

* Allow using is_sta_enabled and is_ap_enabled

* Disallow certain config changes

* Update readme

* Return capability based on configuration

* Add a default-config constructor for AP-STA

* Shorten unsafe block

* Typestate devices

* Add examples

* Use CCMP instead of TKIP (#338)

* Add basic automated tests (#339)

* Don't enable default features for esp*-hal (#303)

* Add support coex for ESP32C6 (#327)

* Rebase main branch and support coex for esp32c6

* Revert default value of tx_queue_size and add coex feature for esp32c6

* Fixed the formatting issue

* Add features to disable various network protocols (#340)

* Add features for various network protocols

Disable smoltcp if none of them is enabled, as well.  Restructure the
cargo features to make this possible: utils isn't needed unless one of
the protocols is on, but embedded-svc is needed even for sending and
receiving raw frames.

In order to do the latter, we also need a receive and transmit method on
the WifiDevice, rather than using the methods on the smoltcp Device impl
-- and we don't need to give them an Instant.  Copy the implementation.

* Add all combinations of network features to CI

* Document new features

Also fix up a couple references in old ones.

* Tolerate leading v in version string (#348)

* Tolerate leading v in version string

* Pin executor

* Esp32c2 coex (#347)

* Support COEX on ESP32-C2

* Fix script

* Remove WiFi scan from COEX example

* Don't crash on unexpected version string format (#358)

* Prepare release (#343)

* Prepare first release

* Always enable `async` for `bleps`

* Remove obsolete patch

* Fix README.md include (#359)

* Fix README.md include

* Fix links

* add "scan_with_config" method to sync WifiController, like for async (#350)

* add "scan_with_config" method to sync WifiController, like for async

* rename to "scan_with_config_sync", unsure why "scan_n" is fine lol

* Reliably avoid `r_ble_hci_ram_hs_cmd_tx` assert (#362)

* Remove recommendation against LTO (#363)

* Fix broken links (#364)

* Remove embedded-svc feature (#366)

* Make COEX work on ESP-32 (#349)

* Remove big-heap (#367)

* Remove big-heap feature

* Implement get_free_heap_size

* Don't require smoltcp as a dev dependency (#365)

* Don't require smoltcp as a dev dependency

* Document the smoltcp feature

* Some feature/README-related cleanup (#368)

* Clean up embedded-svc feature remnants

* Improve serial jtag section

* Improve feature descriptions

* Label ESP32 COEX as supported (#369)

* Exclude 1.74.0.0 from xtensa vaarg supported compilers (#372)

* Update dependencies, port to portable-atomic (#342)

* Update dependencies, port to portable-atomic

* Drop futures-*

* Add patches

* Make portable-atomic optional

* Don't depend on smoltcp and embedded-svc releases

* Update esp-hal to disallow duplicate versions

* Backtrack on the S2 changes

* Remove features from cargo run aliasses

* Update esp-hal, always use portable-atomic

* H2: Add BLE support (#352)

* H2: Add BLE support

* fix ci

* fix ci 2

* Add H2 into test scripts

* update to latest changes

* revert smoltcp change

* Update smoketest.bat

Co-authored-by: Scott Mabin <scott@mabez.dev>

---------

Co-authored-by: Scott Mabin <scott@mabez.dev>

* Update current support (#381)

* docs: Update current support

* docs: Fix format and typos

* docs: Fix typo (#382)

* Bump esp-hal versions, patch embassy-net (#386)

* Bump esp-hal versions, patch embassy-net

* Make bench.rs example compile again

* Patch all the embassy-* dependencies

* Avoid overwriting HCI buffer until sent (#398)

* Avoid overwriting HCI buffer until sent

* Fix formatting

* move set_isr to chip_specific (#390)

* Reset DHCP socket when the link up is detected (#401)

* Use embassy-net-driver only is esp-wifi, make enet a dev dep (#402)

Also bump enet to 0.3

* Prepare release 0.2.0 (#403)

* Bump version to 0.2.0

* Fix warnings

* Small correction to coex warning message (#404)

* Include coex in list of enabled features for docs.rs (#405)

* Update driver blobs (#410)

* Update driver blobs

* Update README.md

* Don't build embassy-bench for S2 in CI

* Don't build embassy-bench for S2 in CI

* fix(#383): Use a random local port when initializing the wifi stack. (#414)

* Add minimal amount of default features, and instead enable the previously default features only for examples (#420)

* Update everything to use latest `esp-hal` and `embedded-hal-async 1.0.0`, smoltcp to `0.11.0` (#417)

* Update everything to use latest esp-hal

* Change to upstream as PR is merged

* Remove hard dep on backtrace

* Add required feature for heapless

* Update examples

* Update

* update rev

* Remove patches to crates as they are released

* Remove last patch as  is released

* Update changelog

* Prepare release 0.3.0 (#424)

* Bump esp-wifi-sys

* Fix code warning

* Fix test script

* Bump esp-wifi

* Prepare CHANGELOG.md for next release cycle

* Remove "no token" warnings. (#428)

They happen often in normal use, such as downloading/uploading a big file
as fast as possible, and they tank performance if logging is enabled.

* Make embedded svc really optional (#429)

* Make embedded-svc really optional

* Update README.md

* CHANGELOG.md entry

* Performance improvement (#430)

* Improve response times

* Revert "Improve response times"

This reverts commit 77c437a252c8accd4e52b228752c03019b50b60b.

* Fix embassy_bench

* Yield from tx_token/rx_token if no progress can be made otherwise

* CHANGELOG.md entry

---------

Co-authored-by: Karl Rikte <karl.rikte@gmail.com>

* Instead of duplicating the config, we now use const eval to validate the config (#432)

* Update esp-hal etc. (#434)

* Update esp-hal etc.

* Adapt build-aliases

* Fix workflow

* Use published HAL

* Use esp-hal `0.16.1`

* CHANGELOG.md entry

* Prepare release 0.4.0 (#439)

* Fix a compile error when smoltcp can return more than 1 DNS result (#442)

Update the WifiStack::dns_query() return type to match the type returned
by smoltcp, rather than assuming the result size is always 1.

* update for changes in latest esp-hal git (#449)

* Use esp-hal 0.17.0 (#456)

* Bump version, CHANGELOG.md (#458)

* Prepare CHANGELOG.md for next release cycle (#459)

* Prepare CHANGELOG.md for next release cycle

* Fix docs-rs build

* Bump to 0.5.1, make sure docs will build (#462)

* Remove direct embedded-hal v0.2 dependency (#466)

* Remove direct embedded-hal v0.2 dependency

* Add changelog entry.

* Adapt esp-wifi for current HAL

* Move examples to example folder

* Remove dev-dependencies from esp-wifi

* Add bench-server etc.

* Update links in README.md

* Remove useless patch

* Compilable on stable

* Set env-vars used in esp-wifi examples

* Set env-vars used in esp-wifi examples

* Use `esp-build`

* Don't use esp_build::warning

* Fixes after re-checking examples

* Fix workflow file

* Fixes

* Make examples build on stable

* Exclude some examples from H2/S2

* Address review comments

---------

Signed-off-by: Lachezar Lechev <elpiel93@gmail.com>
Co-authored-by: Jesse Braham <jesse@beta7.io>
Co-authored-by: Scott Mabin <scott@mabez.dev>
Co-authored-by: Sebastian Lauwers <sebastian.lauwers@gmail.com>
Co-authored-by: Nereuxofficial <37740907+Nereuxofficial@users.noreply.github.com>
Co-authored-by: Lachezar Lechev <elpiel93@gmail.com>
Co-authored-by: Anthony Grondin <104731965+AnthonyGrondin@users.noreply.github.com>
Co-authored-by: Nereuxofficial <nereux@tuta.io>
Co-authored-by: Dániel Buga <bugadani@gmail.com>
Co-authored-by: Sofiane <sofiane.meftah@outlook.fr>
Co-authored-by: Kayo Phoenix <kayo@illumium.org>
Co-authored-by: M4tsuri <me@m4tsuri.com>
Co-authored-by: Ellis Hoag <ellis.sparky.hoag@gmail.com>
Co-authored-by: Paul Liétar <lietarp@gmail.com>
Co-authored-by: Hannes <55623006+umgefahren@users.noreply.github.com>
Co-authored-by: Hailey Somerville <hailey@hailey.lol>
Co-authored-by: Tu Nguyen <126753419+TuEmb@users.noreply.github.com>
Co-authored-by: Bryan Kadzban <github@kadzban.net>
Co-authored-by: Matt H <mhammerly@users.noreply.github.com>
Co-authored-by: Juraj Sadel <jurajsadel@gmail.com>
Co-authored-by: Sergio Gasquez Arcos <sergio.gasquez@gmail.com>
Co-authored-by: Jan Niehusmann <jan@gondor.com>
Co-authored-by: Fan Jiang <ProfFan@users.noreply.github.com>
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
Co-authored-by: Karl Rikte <karl.rikte@gmail.com>
Co-authored-by: Adam Simpkins <adam@adamsimpkins.net>
Co-authored-by: liebman <liebman@zod.com>
Co-authored-by: Onestacked <chrisi.schrefl@gmail.com>
2024-05-24 17:41:59 +00:00
Jesse Braham
28d26e9f45
Use esp toolchain for all clippy checks, add --check option to fmt-packages subcommand in xtask (#1593)
* Update `fmt-packages` subcommand to allow checking formatting as well

* Use the `esp` toolchain for all `clippy` checks in CI
2024-05-24 15:43:51 +00:00
Jesse Braham
49ebc23a6d
Add the esp-backtrace package to the repository (#1583) 2024-05-23 13:52:52 +00:00
Scott Mabin
ec8308058b
Riscv stable CI (#1491)
* Remove interrupt and thread executor embassy features

* Reserve sw interrupt 3 (4) instead of 0 for multicore systems with the embassy feature enabled

* Add thread mode context id and fix up examples

* Use stable rust for riscv CI

* Add binary-logs feature to 8021504 driver

* Add binary-logs feature to 8021504 driver
2024-05-22 16:36:39 +00:00
Kirill Mikhailov
68628fc008
Add format subcommand to xtask (#1551) 2024-05-14 13:49:26 +00:00
Jesse Braham
df2b7bd847
Refactor and clean up xtask package (#1540)
* Simplify building/running examples, allow building a single example

* Simplify building/running of tests a bit

* Clean up the `run_elfs` function a bit

* Remove unnecessary duplication in `cargo` module
2024-05-07 10:15:25 +00:00
Sergio Gasquez Arcos
edd03717d2
Enable C3, H2, S2 and S3 HIL (#1513)
* ci: Enable C3, H2, S2 and S3 HIL tests

* feat: Disable H2

* test: Disable S2

* ci: Update test folder

* docs: Update setup

* revert: Revert S2 changes

* ci: Update hil tests targets

* test: Adapt uart test for S2

* ci: Enable H2 HIL

* feat: Filter unsupported targets for the tests failing

* test: Filter failing targets

* ci: Remove the test folder

* test: Filter S2

* feat: Add supported targets

* feat: Remove TODOs and format code

* docs: Remove outdated comment

* feat: Add run-elfs xtask subcommand
2024-05-02 15:35:23 +00:00
Sergio Gasquez Arcos
0023473068
feat: Reduce method duplication (#1502) 2024-04-23 12:55:22 +00:00
Sergio Gasquez Arcos
20c77891d8
ci: Adapt HIL tests to use RPi (#1493) 2024-04-22 14:28:01 +00:00
Jesse Braham
71db9fa55c
Remove partial support for the ESP32-P4 (#1461)
* Remove all code for and mentions of the ESP32-P4

* Update `CHANGELOG.md`
2024-04-17 14:49:00 +00:00
Sergio Gasquez Arcos
a22b817ee5
HIL updates (#1412)
* docs: Document new xtask features

* style: format deps

* feat: enable all the aliases

* feat: Update embedded-tests executors

* feat: Enable running only one test

* feat: Exit if a test fails

* docs: Fix typo in command

* build: Enable xtensa-semihosting in xtensa targets

* feat: Handle probe-rs esp32 chip name

* style: Clippy lints

* revert: Exit if a test fails

* chore: Remove aliases

* feat: Remove unnecesary toogle

* feat: Error if a test fails and print failed tests
2024-04-11 14:04:32 +00:00
Scott Mabin
315b8cc0ff
HIL xtask support (#1404)
* allow running tests via xtask

* Add run-tests xtask subcommand

* Use xtask in HIL ci
2024-04-05 14:39:20 +00:00
Scott Mabin
969f9a15f6
Build HIL in CI prior to running them (#1388)
* xtask: allow building hil tests

* check hil tests build in CI
2024-04-03 17:07:46 +00:00
Jesse Braham
ace679f13b
Make examples less dependent on embedded-hal where able (#1342)
* Add support for building a package without its default features to `xtask`

* Do not require `embedded_hal_02` traits in examples where they are not required

* Do not require `embedded_hal_02` traits for filling a buffer with random bytes
2024-03-25 13:14:22 +00:00
Scott Mabin
e98cf71b67
Fix up docs and features; default to enabling eh1 instead of eh02 (#1313)
* Fix up docs and features; default to enabling eh1 instead of eh02

* Changelog

* Fix twai example

* Fixup from defaulting to eh1
2024-03-20 17:12:33 +00:00
Jesse Braham
7983923b16
Simplify building documentation, automatically generate documentation index (#1279) 2024-03-13 17:02:13 +00:00
Jesse Braham
513a063547
Create an xtask subcommand to generate eFuse fields (#1258)
* Use the `xtask` to generate eFuse fields from CSV, instead of at build time

* Rewrite the CSV parser so that it can handle the newer eFuse definitions

* Regenerate eFuse field definitions from latest ESP-IDF commit

* Include generation date and ESP-IDF commit hash in file headers
2024-03-11 14:22:31 +00:00
Jesse Braham
8841d82ead
Allow specifying an output directory when building documentation (#1241) 2024-03-05 16:10:46 +00:00
Björn Quentin
e81957ee98
Make xtask work on Windows, add run-example command (#1215)
* Make xtask work on Windows, add `run-example` command

* Fix xtask for non-Windows users

* Use `find_map`
2024-02-28 17:04:29 +00:00
Jesse Braham
0483b47e77
Add build-package and bump-version subcommands to xtask package (#1172)
* Implement builder pattern for cargo command-line args, refactoring

* Add an `xtask` subcommand to build a package (not its examples)

* Add an `xtask` subcommand to bump the versions of packages
2024-02-16 11:21:31 +00:00
Sergio Gasquez Arcos
32824422a1
Autodetect xtal-freq (#1165)
* feat: Autodetect xtal-freq

* docs: Update changelog

* style: Clippy lints

* feat: Remove XtalClock::RtcXtalFreq24M variant

* feat: Adjust visibility of estimate_xtal_frequency

* feat: Remove xtal freq features
2024-02-14 11:09:35 +00:00
Jesse Braham
2b8db5c2c2
Add an xtask subcommand for building documentation (#1160)
* Fix a silly mistake from the initial implementation

* Improve the `build-examples` subcommand, make it usable with other packages

* Add a `build-documentation` subcommand

* Update `README.md`

* Add toolchain modifier when required
2024-02-13 22:39:01 +00:00
Jesse Braham
ebdd59b0ae
Add the xtask package, implement automation for building examples (#1157)
* Create the `xtask` package, add command for building examples

* Do not perform changelog check for `xtask` package changes

* Fix unrelated `rustfmt` error
2024-02-12 15:38:19 +00:00