Hi all,
I'm developing a custom esp32 board with different flash memory. I'm using AT45DB641E (64-Mbits = 8MB) flash memory. I'm using Arduino IDE and it keeps showing that the flash memory size is not recognized while the ID seems detected (image attached).
I have done the GPIO0 trick as well as GPIO2 trick by connecting it to the GND during uploading firmware.
Could you help me to figure out this problem?
Thanks in advance,
Ghozali
Custom flash memory: "Could not auto-detect Flash size" when flashing
-
- Posts: 2
- Joined: Mon May 10, 2021 1:09 pm
Custom flash memory: "Could not auto-detect Flash size" when flashing
- Attachments
-
- Error message
- image_2021_05_10T09_26_16_956Z.png (45.55 KiB) Viewed 10309 times
Re: Custom flash memory: "Could not auto-detect Flash size" when flashing
Hi Ghozali,
According to the datasheet for the AT45DB641E flash chip (Table 12-1) this is the correct JEDEC ID returned by this flash chip. There's no rule that says the ID has to encode the flash size, it's just that all of the chips currently supported by ESP32 do this so we use it.
In esptool.py you can override the flash size by passing it as a command line argument instead of having esptool.py detect it.
It looks like esptool is not crashing because of the flash id (it ignores this and continues to try and write to the chip), however it's crashing because this chip doesn't behave as expected when writing data to flash. There is no common standard for SPI NOR flash chips, so they don't all respond to the same commands and many of them have subtle differences. I don't believe anyone has successfully used AT45DB641E with ESP32 before.
I don't know why writing to flash isn't working, but the datasheet shows that this chip only supports standard "single SPI" read commands and not any Dual or Quad read modes. This means that even if you can somehow flash it with esptool.py, you won't be able to boot the ESP32 from it as ESP-IDF only supports these modes. Sorry to be the bearer of bad news.
According to the datasheet for the AT45DB641E flash chip (Table 12-1) this is the correct JEDEC ID returned by this flash chip. There's no rule that says the ID has to encode the flash size, it's just that all of the chips currently supported by ESP32 do this so we use it.
In esptool.py you can override the flash size by passing it as a command line argument instead of having esptool.py detect it.
It looks like esptool is not crashing because of the flash id (it ignores this and continues to try and write to the chip), however it's crashing because this chip doesn't behave as expected when writing data to flash. There is no common standard for SPI NOR flash chips, so they don't all respond to the same commands and many of them have subtle differences. I don't believe anyone has successfully used AT45DB641E with ESP32 before.
I don't know why writing to flash isn't working, but the datasheet shows that this chip only supports standard "single SPI" read commands and not any Dual or Quad read modes. This means that even if you can somehow flash it with esptool.py, you won't be able to boot the ESP32 from it as ESP-IDF only supports these modes. Sorry to be the bearer of bad news.
-
- Posts: 2
- Joined: Mon May 10, 2021 1:09 pm
Re: Custom flash memory: "Could not auto-detect Flash size" when flashing
Hi ESP_Angus,
Thanks for your reply. So basically AT45DB641E can only be used as an additional flash memory with common SPI communication. Am I right?
Regards,
Ghozali S. Hadi
Thanks for your reply. So basically AT45DB641E can only be used as an additional flash memory with common SPI communication. Am I right?
Regards,
Ghozali S. Hadi
Re: Custom flash memory: "Could not auto-detect Flash size" when flashing
That's right, it should definitely work fine if you use the SPI driver to send commands to it manually for read/write/erase/etc.
It may also be possible to use the "secondary SPI flash" support in the spi_flash driver to talk to it via SPI flash APIs. However as it seems like there is something different in the commands used when writing to the chip, it's possible this won't work as-is. It is technically possible to write a new chip driver for this chip's specific "quirks", and then use it as external storge via the SPI flash APIs. If you're feeling adventurous then take a look in the spi_flash component for examples of existing flash chip drivers.
It may also be possible to use the "secondary SPI flash" support in the spi_flash driver to talk to it via SPI flash APIs. However as it seems like there is something different in the commands used when writing to the chip, it's possible this won't work as-is. It is technically possible to write a new chip driver for this chip's specific "quirks", and then use it as external storge via the SPI flash APIs. If you're feeling adventurous then take a look in the spi_flash component for examples of existing flash chip drivers.
Re: Custom flash memory: "Could not auto-detect Flash size" when flashing
I got the same issue Can you please check it because I don't get any proper response over this forum Maybe flash issue.
https://www.esp32.com/viewtopic.php?f=2&t=22813
https://www.esp32.com/viewtopic.php?f=2&t=22813
Re: Custom flash memory: "Could not auto-detect Flash size" when flashing
I had the same issue,
I used an external power supply (modified usb cable on another usb port on my laptop) to all the attached modules and it worked perfectly
I used an external power supply (modified usb cable on another usb port on my laptop) to all the attached modules and it worked perfectly
Who is online
Users browsing this forum: No registered users and 184 guests