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

spiram: Fix corrupting 1 kB of noinit data in spiram in 2T mode (IDFGH-11243) #12405

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jovermann
Copy link

The function psram_2t_mode_check() in esp_psram_impl_quad.c overwrites the first kilobyte of every megabyte with 0xff upon startup which may overwrite noinit data which should be preserved over reboots.

This patch fixes this by saving/restoring the tested memory.

The test size has been reduced from 41024 bytes to 4512 bytes just to keep the stack usage of the fuction within resonable limits (was 2048 bytes, now 1536 bytes).

Fixes #12395
(IDFGH-11231)

…H-11231)

The function psram_2t_mode_check() in esp_psram_impl_quad.c
overwrites the first kilobyte of every megabyte with 0xff upon startup
which may overwrite noinit data which should be preserved over reboots.

This patch fixes this by saving/restoring the tested memory.

The test size has been reduced from 4*1024 bytes to 4*512 bytes just
to keep the stack usage of the fuction within resonable limits
(was 2048 bytes, now 1536 bytes).
@CLAassistant
Copy link

CLAassistant commented Oct 13, 2023

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link

Messages
📖 Good Job! All checks are passing!

👋 Welcome jovermann, thank you for your first contribution to espressif/esp-idf project!

📘 Please check Contributions Guide for the contribution checklist, information regarding code and documentation style, testing and other topics.

🖊️ Please also make sure you have read and signed the Contributor License Agreement for espressif/esp-idf project.

Pull request review and merge process you can expect

Espressif develops the ESP-IDF project in an internal repository (Gitlab). We do welcome contributions in the form of bug reports, feature requests and pull requests via this public GitHub repository.

  1. An internal issue has been created for the PR, we assign it to the relevant engineer
  2. They review the PR and either approve it or ask you for changes or clarifications
  3. Once the Github PR is approved, we synchronize it into our internal git repository
  4. In the internal git repository we do the final review, collect approvals from core owners and make sure all the automated tests are passing
    • At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
  5. If the change is approved and passes the tests it is merged into the master branch
  6. On next sync from the internal git repository merged change will appear in this public Github repository

Generated by 🚫 dangerJS against 7b187b6

@espressif-bot espressif-bot added the Status: Opened Issue is new label Oct 13, 2023
@github-actions github-actions bot changed the title spiram: Fix corrupting 1 kB of noinit data in spiram in 2T mode spiram: Fix corrupting 1 kB of noinit data in spiram in 2T mode (IDFGH-11243) Oct 13, 2023
@espressif-bot espressif-bot added Status: Selected for Development Issue is selected for development and removed Status: Opened Issue is new labels Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Selected for Development Issue is selected for development
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1024 bytes of .ext_ram_noinit cleared after esp_restart() with CONFIG_SPIRAM_2T_MODE=y (IDFGH-11231)
4 participants