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

Wrong flash size detected for mxic flash chip (128 kbytes v 8192 kbytes) with v5.1.1 (IDFGH-11041) #12222

Closed
3 tasks done
RobMeades opened this issue Sep 11, 2023 · 8 comments
Closed
3 tasks done
Labels
Status: Opened Issue is new Type: Bug bugs in IDF

Comments

@RobMeades
Copy link

RobMeades commented Sep 11, 2023

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

v5.1.1

Operating System used.

Linux

How did you build your project?

Command line with idf.py

If you are using Windows, please specify command line type.

None

Development Kit.

u-blox NINA-W15

Power Supply used.

USB

What is the expected behavior?

Detect the 8 megabyte mxic flash chip used within the u-blox NINA-W15 module (ESP32) as being of size 8192 kbytes, e.g. as below, which is what version 5.0.1 did.

spi_flash: detected chip: mxic
spi_flash: flash io: dio
spi_flash: Detected size(8192k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
cpu_start: Starting scheduler on PRO CPU.
cpu_start: Starting scheduler on APP CPU.

What is the actual behavior?

With version 5.1.1, ESP-IDF now thinks that the 8 megabyte mxic flash chip only has 128 kbytes of flash:

spi_flash: detected chip: mxic
spi_flash: flash io: dio
spi_flash: Detected size(128k) smaller than the size in the binary image header(2048k). Probe failed.

Steps to reproduce.

Attempt to run a build made with ESP-IDF v5.1.1, as opposed to ESP-IDF v5.0.1, on a u-blox NINA-W15 (ESP32 with 8 Megabyte mxic chip) module, which I am perfectly happy to do to investigate/test any proposed fix.

Debug Logs.

See above.

More Information.

No response

@RobMeades RobMeades added the Type: Bug bugs in IDF label Sep 11, 2023
@espressif-bot espressif-bot added the Status: Opened Issue is new label Sep 11, 2023
@github-actions github-actions bot changed the title Wrong flash size detected for mxic flash chip (128 kbytes v 8192 kbytes) with v5.1.1 Wrong flash size detected for mxic flash chip (128 kbytes v 8192 kbytes) with v5.1.1 (IDFGH-11041) Sep 11, 2023
@RobMeades
Copy link
Author

RobMeades commented Sep 11, 2023

Binary-chopping indicates that v5.0.3 does NOT have the issue but both v5.1 and v5.1.1 DO have the issue.

@mythbuster5
Copy link
Collaborator

mythbuster5 commented Sep 12, 2023

I didn't remember any changes about this part from 5.0 to 5.1. Could you please get the mxic size by esptool.py flash_id. And did you modify any sdkconfig?

@RobMeades
Copy link
Author

RobMeades commented Sep 12, 2023

Hi, and thanks for the swift response. esptool.py reports:

Detecting chip type... ESP32
Chip is ESP32-D0WD-V3 (revision v3.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: e8:31:cd:da:6a:00
Uploading stub...
Running stub...
Stub running...
Manufacturer: c2
Device: 2537
Detected flash size: 8MB

In terms of sdkconfig, find it attached (renamed as .txt): lots of stuff in it but it is "boilerplate" as far as we are concerned, we haven't touched it in a long time and very little of it matters to us.

sdkconfig.defaults.txt

@RobMeades
Copy link
Author

RobMeades commented Sep 26, 2023

<cough />

@RobMeades
Copy link
Author

Any suggestions as to how to move forward with this?

@michaelw-inno
Copy link

I have the same problem with the NINA-W106 10B-00 with 8MB flash. @RobMeades as you said IDF < 5.1 works, IDF >= 5.1 does not work. I investigated the issue today and I found out that there is a patch 4c66d7e which implements a size_detect function for MXIC chips. This function correctly detects the size of the flash used in the u-blox chips. It can be cherry-picked to 5.1 to fix the issue as a workaround. (I only tried 5.1.2, but I assume it also works for other patch versions)

@espressif is there any plan to port this patch to the newer IDF versions?

@RobMeades
Copy link
Author

Woohoo! Thank you @espressif!

@RobMeades
Copy link
Author

...and @michaelw-inno of course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Opened Issue is new Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

4 participants