-
Notifications
You must be signed in to change notification settings - Fork 491
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
sdk_spi_flash_erase_sector + sdk_spi_flash_write doesn't work #538
Comments
I just realized if the flash mode is set to QIO then it works but if it's DIO it doesn't. |
How do you set QIO mode? I have several modules with Flash ID C84016 (sdk_spi_flash_get_id() returns 1640C8, but I think this number must be byte swapped to get the correct ID). With these modules, everything works fine. But I am now using other modules with flash ID E04016 (different manufacturer) and flash does not work. I have tried using both sdk_spi_XXX functions, and spiflash_XXX functions without success. Maybe my problem is the same as yours. |
I use esptool.py with --flash_mode qio parameter. I suspect this makes the device to stay in that mode. |
OK, I found out that the way was easier than expected: using the download tool. I tired first downloading my application with all the modes, and none worked. Then I noticed that the bootloader was run before my application, so flashed the bootloader with QIO mode and... voila! It works :) Anyway, it is a bit nasty that the flash write functions return success even when they are failing. Maybe this can be improved, so they return failure when erasing/writing fails due to misconfiguration. |
I use the combination of sdk_spi_flash_erase_sector + sdk_spi_flash_write to write out same data to the flash memory. But after reading it back the result still contain what it was already there previously. In other words it doesn't change the content of the sector.
Here is an example code that tries to update the 100th sector.
The text was updated successfully, but these errors were encountered: