Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esp32c6 needs bigger heap than esp32s3 #1613

Closed
bugadani opened this issue Nov 22, 2023 · 3 comments
Closed

esp32c6 needs bigger heap than esp32s3 #1613

bugadani opened this issue Nov 22, 2023 · 3 comments
Labels
chip:esp32c6 Issue related to ESP32-C6 chip package:esp-wifi Issues related to the esp-wifi package

Comments

@bugadani
Copy link
Contributor

bugadani commented Nov 22, 2023

My S3 can enable wifi just fine with the default heap, but C6 immediately runs out of memory:

C6:

[INFO] - Initializing Wifi driver
[INFO] - esp-wifi configuration Config { rx_queue_size: 16, tx_queue_size: 16, static_rx_buf_num: 32, dynamic_rx_buf_num: 16, static_tx_buf_num: 12, dynamic_tx_buf_num: 16, ampdu_rx_enable: 1, ampdu_tx_enable: 1, amsdu_tx_enable: 0, rx_ba_win: 8, max_burst_size: 0, country_code: "CN", country_code_operating_class: 0, mtu: 1492, heap_size: 65536, tick_rate_hz: 200, listen_interval: 3, beacon_timeout: 6, ap_beacon_timeout: 300, failure_retry_cnt: 1, scan_method: 0 }
[WARN] - Unable to allocate 2216 bytes
[WARN] - esp_wifi_init_internal(&G_CONFIG) returned an error: 257
[ERROR] - panicked at 'unwrap failed: esp_wifi ::
[ERROR] - initialize(EspWifiInitFor :: Wifi, resources.timer, resources.rng,
[ERROR] - resources.rcc, clocks,)'
[ERROR] - error: `WifiError(InternalError(EspErrNoMem))`

S3:

[INFO] - Initializing Wifi driver
[INFO] - esp-wifi configuration Config { rx_queue_size: 16, tx_queue_size: 16, static_rx_buf_num: 32, dynamic_rx_buf_num: 16, static_tx_buf_num: 12, dynamic_tx_buf_num: 16, ampdu_rx_enable: 1, ampdu_tx_enable: 1, amsdu_tx_enable: 0, rx_ba_win: 8, max_burst_size: 0, country_code: "CN", country_code_operating_class: 0, mtu: 1492, heap_size: 65536, tick_rate_hz: 200, listen_interval: 3, beacon_timeout: 6, ap_beacon_timeout: 300, failure_retry_cnt: 1, scan_method: 0 }
[INFO] - Wifi driver initialized

Increasing the heap size to 98304 immediately resolves this problem. My guess is that the various buffers might take up more space, maybe due to a different feature set, but might be good to dig into it a bit more.

@MabezDev
Copy link
Member

The heap is now configurable via the config so I think we can close this now.

@bugadani
Copy link
Contributor Author

The heap size has been configurable some time before I opened this issue. I understand it's not exactly actionable, but the 1.5x memory requirement is still something that at least should be investigated, or at least acknowledge the problem. Because reserving a bit more than a quarter of available RAM may be a problem.

@MabezDev MabezDev reopened this Feb 29, 2024
@bjoernQ bjoernQ transferred this issue from esp-rs/esp-wifi-sys May 27, 2024
@bjoernQ bjoernQ added the package:esp-wifi Issues related to the esp-wifi package label May 27, 2024
@tom-borcin tom-borcin added the chip:esp32c6 Issue related to ESP32-C6 chip label Aug 13, 2024
@MabezDev
Copy link
Member

I think we're somewhat at the mercy of how the WiFi drivers themselves decide to allocate memory. From an impl perspective from esp-wifi's side there isn't much difference. Closing for now.

@github-project-automation github-project-automation bot moved this from In Progress to Done in esp-rs Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chip:esp32c6 Issue related to ESP32-C6 chip package:esp-wifi Issues related to the esp-wifi package
Projects
Archived in project
Development

No branches or pull requests

4 participants