Unknown esp32 ROM loader status error?
Posted: Tue Jul 02, 2019 7:27 pm
So I'm currently working on a project to upload a precompiled binary for an esp32 from an embedded device. I've been following the wiki on the protocol, and I've been looking at the esptool.py to put together my own uploader.
Problem is, my uploader seems to work sometimes and fail other times. In the status byte of a response packet I get 0x0108: 0x01 to state that there's an error with an error code of 0x08. However that wiki only mentions 4 ROM Loader error status codes, and 0x08 isn't one of them. Is there any other documentation to help me with this error code?
More background on my issue:
The python esptool.py NEVER throws errors using the same binaries, boot loaders, and settings (no stub, no compress, same flash freq, etc). I can even see that the data packets being sent are exactly the same as when esptool.py uploads this... I'm at a loss for what I could be missing that'd throw this unknown error code.
When it does happen, it generally throws the error on the same address of my binary (0x00031000). Oddly enough, it throws it sometimes when I'm uploading the bootloader_dio_80m.bin which I grabbed from the Arduino board package... so its pre-compiled and known to work (will error at address 0x00003000 sometimes).
In case this helps at all, a summarized version of my upload process goes like this:
Problem is, my uploader seems to work sometimes and fail other times. In the status byte of a response packet I get 0x0108: 0x01 to state that there's an error with an error code of 0x08. However that wiki only mentions 4 ROM Loader error status codes, and 0x08 isn't one of them. Is there any other documentation to help me with this error code?
More background on my issue:
The python esptool.py NEVER throws errors using the same binaries, boot loaders, and settings (no stub, no compress, same flash freq, etc). I can even see that the data packets being sent are exactly the same as when esptool.py uploads this... I'm at a loss for what I could be missing that'd throw this unknown error code.
When it does happen, it generally throws the error on the same address of my binary (0x00031000). Oddly enough, it throws it sometimes when I'm uploading the bootloader_dio_80m.bin which I grabbed from the Arduino board package... so its pre-compiled and known to work (will error at address 0x00003000 sometimes).
In case this helps at all, a summarized version of my upload process goes like this:
- Sync packets for handshake
- Read date reg to check esp32 vs esp8266 (I can do both and 8266 has been working fine with no errors)
- Read registers for chip description, features, and mac address
- Attach SPI flash command
- Detect flash size from SPI
- Set flash parameters
- Then for each binary I upload:
- update flash parameters for this image if its a bootloader (flash mode, size/freq)
- flash begin command for total size of binary at specific address
- use block number from flash begin to Flash Data each block (of around 1040 bytes in size)
- finally send md5sum packet to check hash of uploaded bin