206 Commits

Author SHA1 Message Date
Ulf Lilleengen
93f1012663
Add integration with bt-hci crate (#1971)
* Add integration with bt-hci crate

Implementing traits from bt-hci allows the BleConnector to
be used with the Trouble BLE stack.

* use packed based read interface

* Improve example to allow another connection after disconnect

* update trouble version

* Workaround for spurious command complete events

* fix formatting

* ignore notify errors in example

* fix clippy warnings

* remove async feature from hal dependency

* remove deprecated feature from example

* Adopt to api changes

* Api fix for esp32

* Set rust-version of esp-wifi

* bump MSRV to 1.77 for CI and esp-hal

* Add changelog entry
2024-09-06 13:08:25 +00:00
Juraj Sadel
17daa464ba
Enable ESP32 HIL (#1977)
* Enable ESP32 HIL

* RMT fixed

* SPI DMA partially works, _pcnt tests not working

* bckup

* finish

* readme and cleanup

* rebase + cleanup

* RMT S2 pin typo + clean forgotten comments

* review comments

* update 10000

* indentation

* replace cfg gate with cfg_if
2024-09-06 08:53:27 +00:00
Dániel Buga
5370afb1eb
Build examples in debug mode (#2078)
* Build examples in debug mode

* Allow building psram examples in debug mode in CI

* Don't rebuild tests, try to avoid rebuilding dependencies
2024-09-05 10:04:07 +00:00
Scott Mabin
80c0a81718
fix issue handler, don't rebuild on main the merge queue checks this for us (#2077) 2024-09-04 16:02:47 +00:00
Björn Quentin
0cf7abfc47
Make esp-wifi build on stable, again. Bump to 0.9.1 (#2067)
* Make esp-wifi build on stable, again. Bump to 0.9.1

* CHANGELOG.md

* MSRV check esp-wifi

* ESP32-S2 doesn't support Bluetooth
2024-09-03 16:10:20 +02:00
Dániel Buga
447411fb58
Rework hal initialization (#1970)
* Rework hal initialization

* Turn sw interrupt control into a virtual peripheral

* Return a tuple instead of a named struct

* Fix docs

* Remove SystemClockControl

* Move software interrupts under interrupt

* Re-document what's left in system

* Update time docs

* Update sw int docs

* Introduce Config

* Fix tests

* Remove redundant inits

* Doc

* Clean up examples&tests

* Update tests

* Add changelog entry

* Start migration guide

* Restore some convenience-imports

* Remove Config from prelude
2024-09-02 13:38:46 +00:00
Scott Mabin
b620e35ebe
automatically apply status:needs-attention to new esp-hal issues (#2030) 2024-09-02 11:43:36 +00:00
Scott Mabin
6b4079be3a
release prep xtensa-lx-rt@0.17.1 (#2060) 2024-09-02 11:11:36 +00:00
Dániel Buga
8e6411bd31
Random cleanups in non-checked packages (#2034)
* Deduplicate feature check macros

* Re-enable rust-analyzer for most of the workspace

* Cargo fix

* Turn off defmt

* Only build xtask

* Clippy pls

* Fix CI

* Fix paths

* Always create doc directory first

* Revert r-a

* Update esp-hal-procmacros/src/lp_core.rs

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

---------

Co-authored-by: Dominic Fischer <14130965+Dominaezzz@users.noreply.github.com>
2024-08-30 14:45:54 +00:00
Dániel Buga
99c238d19d
HIL: Don't skip cleanup (#2024)
* Don't skip cleanup

* Make sure the power is off for a short while
2024-08-28 20:17:10 +00:00
Dániel Buga
d0f98b6c1f
Remove files after test (#1993) 2024-08-26 13:50:40 +00:00
Dániel Buga
341db16874
Use uhubctl to disable and enable usb ports (#1997) 2024-08-26 13:46:32 +00:00
Dániel Buga
686037be4d
Run HIL tests as part of PR checks (#1959)
* Run HIL tests as part of PR checks

* Cancel pending HIL runs

* Only run for ready PRs
2024-08-20 11:48:49 +00:00
Scott Mabin
361a6c58b7
make contribution docs more visible (#1947) 2024-08-15 07:58:06 +00:00
Dániel Buga
9e87792fb9
Update probe-rs, prebuild xtask for HIL tests (#1939)
* Update probe-rs

* Differentiate jobs

* Explicitly print that probe-rs's execution failed

* Do not capture stdin/stderr

* Pre-build xtask binary

* Use current_directory

* Print more info when a file can't be read

* Do not erase flash after a failure

* get_time: fail faster

* Make xtask runnable
2024-08-14 15:47:52 +00:00
Sergio Gasquez Arcos
2e8937a90f
Update probe-rs version (#1914)
* docs: Update probe-rs version

* feat: Simplify probe-rs args

* ci: Update the checkout action to use the fork
2024-08-09 14:11:29 +00:00
Sergio Gasquez Arcos
6ac56a25dc
Update channels being used in CI jobs (#1910)
* ci: Use stable to build HIL tests

* ci: Remove useless line

* fix: Avoid setting toolchain based on the target
2024-08-08 08:37:22 +00:00
Sergio Gasquez Arcos
e58b4d8d89
Check packages with nightly for RISC-V devices (#1881)
* ci: Check pacakges with nightly

* ci: Remove duplication

* perf: Nightly clippy fixes

* revert: Revert unsafe changes

* ci: Use an action to remove duplication

* ci: Update trigger conditions

* ci: Update S2 serial port

* ci: Rename action
2024-08-07 13:32:48 +00:00
Sergio Gasquez Arcos
0c29c4381c
ci: Use stable channel for RISCV devices (#1896) 2024-08-01 17:42:49 +00:00
Jesse Braham
81f3776aa7
Deny warnings in CI (#1877)
* Deny warnings when building in CI

* Build RISC-V using `stable` release channel again
2024-07-30 07:38:57 +00:00
Scott Mabin
e8b0a376eb
Check all features and targets in CI when linting (#1824)
* Check more features and targets in CI when linting

* Address clippy lints

* Address clippy lints for esp-wifi

* Expand println and storage checks

* Remove uneeded clippy lint

* Check every package for each target

* resolve esp-wifi clippy lints

* use defmt when building esp-wifi

* clean up

* fix warning in meta crate

* simplify CI workflow

* split up clippy jobs
2024-07-24 11:45:41 +00:00
Scott Mabin
c090191afb
try to fix espflash command not found in HIL CI (#1848)
* try to fix espflash command not found in HIL CI

* Specify espflash port

---------

Co-authored-by: Juraj Sadel <juraj.sadel@espressif.com>
2024-07-23 17:38:44 +00:00
Sergio Gasquez Arcos
32be53d618
CI Improvements - Part 1 (#1821)
* ci: Fix condition to erase-flash

See https://docs.github.com/en/actions/learn-github-actions/expressions#example-of-failure-with-conditions

* ci: Remove path-ignore attributes to avoid CI not being triggered

* ci: Build documentation

* ci: Install nightly toolchain

* ci: Deny warnings for building docs

* fix: Documentation warnings

* ci: Remove duplicated step
2024-07-17 15:55:27 +00:00
Jesse Braham
dcc6c896de
Housekeeping: fix warnings, rename some examples, etc. (#1786)
* Build HIL tests for ESP32 in CI, fix resulting build errors

* Fix some warnings in the `hil-test` package

* Fix warnings in examples

* Remove "esp_" prefix from Wi-Fi example file names

* Resolve the last of the known warnings
2024-07-12 09:35:55 +00:00
Sergio Gasquez Arcos
786682c0b2
HIL: Erase flash on failure (#1748)
* ci: Erase flash on failure

* docs: Add espflash install instructions and fix format
2024-07-04 07:50:40 +00:00
Sergio Gasquez Arcos
3af45a2ed0
Update changelog CI (#1725)
* docs: Add missing changelogs and unify format

* ci: Check changelog update for all the packages

* ci: Update actions/checkout version
2024-06-28 14:15:01 +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
Demo for summer'23
c864c8a982
Fix: allow defmt-espflash + auto configuration @ esp-println (#1687)
* esp-println: Fix 'defmt-espflash,auto' feature combination

* formatted according to instructions

* restructure, compiles also on 'esp32'

* Added CI check for compiling with 'dfm-espflash' feature

---------

Co-authored-by: Asko Kauppi <akauppi@gmail.com>
2024-06-24 13:26:08 +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
Björn Quentin
f125c20cf2
Add auto-detection feature to esp-println (#1658)
* Add auto-detection feature to esp-println

* CHANGELOG.md

* Minor README change

* Build `esp-println` in CI
2024-06-05 10:44:17 +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
Scott Mabin
4d9441ef99
Enable the CI feature to check more features in MSRV checks (#1641)
* enable the CI feature to check more features in MSRV checks

* Rename eh1 feature in esp-lp-hal
2024-05-30 14:22:03 +00:00
Scott Mabin
4dbe5d35a6
Build the extras/ crates in CI (#1640) 2024-05-30 13:07:40 +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
Sergio Gasquez Arcos
a0a02ce2a8
ci: Define GH token (#1584) 2024-05-23 13:56:33 +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
Björn Quentin
1eb22a27a6
Fix absolute links to API-GUIDELINES.md (#1573) 2024-05-22 08:00:39 +00:00
Björn Quentin
683a0e072c
Add API-GUIDELINES.md (#1543)
* Add `API-GUIDELINES.md`

* Address review comments

* Reference the API guidelines in contributing guide, README and PR template
2024-05-21 16:36:36 +00:00
Kirill Mikhailov
68628fc008
Add format subcommand to xtask (#1551) 2024-05-14 13:49:26 +00:00
Sergio Gasquez Arcos
0c95668e7a
ci: Update build-test name to match the required CI jobs (#1536) 2024-05-06 06:22:47 +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
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
1a5ca65eed
Enable S3 HIL (#1338)
* feat: Add HIL support for S3

* ci: Add dummy s3 job

* test: Filter interrupt test for Xtensa devices

* ci: Install Xtensa toolchain
2024-04-16 12:09:18 +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
e4c985e8dd
Eliminate the rt and vectored features from the esp-hal package (#1380)
* Eliminate the `vectored` feature

* Eliminate the `rt` feature

* Update `CHANGELOG.md`

* Fix typo in comment
2024-04-02 23:21:39 +00:00
Jesse Braham
99b0c774ac
Use fewer embedded-hal@0.2.x traits in examples, build HAL without default features in CI (#1372)
* Clean up `embedded-hal-02` related imports

* Clean up some random warnings

* Update various examples to no longer depend on `embedded-hal-02` feature

* Build `esp-hal` without default features enabled in CI
2024-04-01 17:33:23 +00:00