Skip to content

Shutdown the WiFi subsystem gracefully dynamically #4639

@renkenono

Description

@renkenono

Bug description

Discussion initially documented in https://github.com/esp-rs/esp-hal/discussions/4631

To Reproduce

  1. See https://github.com/renkenono/esp-hal/blob/fix/wifi-deinit-flow/examples/wifi/embassy_sntp/src/main.rs.
    1. Relying purely on Drop trait, see renkenono@7b6baef.
    2. Gracefully shutting down the controller by disconnecting then stopping it, see renkenono@79a032c.

Expected behavior

  • No crashes.
  • WiFi HW is powered off completely.
  • WiFi dynamically allocated memory is freed.

Environment

  • Target device: [e.g. ESP32-S3] ESP32C6
Chip type:         esp32c6 (revision v0.1)
Crystal frequency: 40 MHz
Flash size:        4MB
Features:          WiFi 6, BT 5
MAC address:       f0:f5:bd:2b:d9:34

Security Information:
=====================
Flags: 0x00000000 (0)
Key Purposes: [0, 0, 0, 0, 0, 0, 12]
Chip ID: 13
API Version: 0
Secure Boot: Disabled
Flash Encryption: Disabled
SPI Boot Crypt Count (SPI_BOOT_CRYPT_CNT): 0x0

  • Crate name and version: [e.g. esp-hal 0.20.0] esp-hal v1.0.0

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Review

Relationships

None yet

Development

No branches or pull requests

Issue actions