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

Fix Wi-Fi failing to connect on non PSRAM hardware with SPIRAM configuration #2837

Merged
merged 3 commits into from
Dec 5, 2023

Conversation

alberk8
Copy link
Contributor

@alberk8 alberk8 commented Dec 3, 2023

Description

WIFI will not connect when using firmware with PSRAM option on non PSRAM hardware. For example using ESP32_PSRAM_REV3 firmware on ESP32 WROOM hardware.

Motivation and Context

Reported the issue espressif/esp-idf#11971 in ESP IDF and the same issue also happens in micropython. The issue arise due to the way ESP-IDF allocates cache memory for WIFI when PSRAM/SPIRAM option is enabled. On runtime WIFI cache will still be allocated when PSRAM is unavailable and this causes OOM.

This fix will check for PSRAM availability at runtime and disable the WIFI cache thus allowing for WIFI to connect.

How Has This Been Tested?

Tested on ESP32 REV0, REV3 (with and without PSRAM), ESP32 S3

Screenshots

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue with code or algorithm)
  • New feature (non-breaking change which adds functionality to code)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dev Containers (changes related with Dev Containers, has no impact on code or features)
  • Dependencies (update dependencies and changes associated, has no impact on code or features)
  • Documentation (changes or updates in the documentation, has no impact on code or features)

Checklist

  • My code follows the code style of this project (only if there are changes in source code).
  • My changes require an update to the documentation (there are changes that require the docs website to be updated).
  • I have updated the documentation accordingly (the changes require an update on the docs in this repo).
  • I have read the CONTRIBUTING document.
  • I have tested everything locally and all new and existing tests passed (only if there are changes in source code).

@nfbot nfbot added the Type: bug label Dec 3, 2023
nfbot and others added 2 commits December 3, 2023 02:28
Automated fixes for code style.
…37a-b4a6-4816-813a-286ec24595f2

Code style fixes for nanoframework/nf-interpreter PR#2837
@alberk8 alberk8 changed the title Fix Wifi connection failed on non PSRAM hardware with SPIRAM configuration Fix Wifi failed to connect on non PSRAM hardware with SPIRAM configuration Dec 3, 2023
@josesimoes josesimoes added the Platform: ESP32 Everything related specifically with ESP32 platform label Dec 5, 2023
Copy link
Member

@josesimoes josesimoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice finding! Thank you for providing a fix. 👍🏻 🥇

@josesimoes josesimoes merged commit cb5ce4f into nanoframework:main Dec 5, 2023
13 checks passed
@josesimoes josesimoes changed the title Fix Wifi failed to connect on non PSRAM hardware with SPIRAM configuration Fix Wi-Fi failing to connect on non PSRAM hardware with SPIRAM configuration Dec 5, 2023
@alberk8 alberk8 deleted the fix-wifi-on-nonpsram-hw branch August 2, 2024 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: ESP32 Everything related specifically with ESP32 platform Type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants