-
Notifications
You must be signed in to change notification settings - Fork 7.6k
ESP32 Flash size read via API is wrong when flash is in modes qio, dio, qout
#7157
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
Labels
Status: Awaiting triage
Issue is waiting for triage
Milestone
Comments
qio, dio, qout
qio, dio, qout
At boot you also can see the clock-div. This function is also reading what's set during build: uint32_t EspClass::getFlashChipSpeed(void)
{
esp_image_header_t fhdr;
if(flashRead(ESP_FLASH_IMAGE_BASE, (uint32_t*)&fhdr, sizeof(esp_image_header_t)) && fhdr.magic != ESP_IMAGE_HEADER_MAGIC) {
return 0;
}
return magicFlashChipSpeed(fhdr.spi_speed);
} |
@Staars did find a way. Credits for this go to him! Correct Flash Chip ID can be read in all modes with:
AND when this is correctly fetched the flash size can be done :-) Example to get Flash Chip ID and real Flash Chip size
|
4 tasks
1 task
Repository owner
moved this from In Review
to Done
in Arduino ESP32 Core Project Roadmap
Sep 7, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Board
esp32 devkit 4 MB
Device Description
Plain Devkit board, nothing connected
Hardware Configuration
none
Version
v2.0.4
IDE Name
Platformio latest release
Operating System
macOS 12.5.1
Flash frequency
40 Mhz
PSRAM enabled
no
Upload speed
115200
Description
Get flash size correctly when in flash modes
qio, qout, dio
as it does when in flash modedout
.The standard Arduino function get flash size is useless in most cases, since it just reads the values which are set from the IDE and it does not detect the real flash size
Sketch
Sketch to test https://github.com/Jason2866/ESP32_Show_Info
Can be run with Arduino IDE too.
The test sketch shows too that flash mode is not correct when queried via the API (qio and qout never shown)
Debug Message
Second (wrong) output in mode qio (shown wrong dio too)
The text was updated successfully, but these errors were encountered: