https://toitlang.org/ logo
Two ESP devices that are seemingly the same acting...
# help
a
We have 2 ESPc3s that are seemiingly the same, however post flashing is behaving differently. The bad one ultimately ends up with
Invalid image block, can't boot.
The primary thing we notice is that the `load`s end up with different positions and lengths, so something may be wrong with the bootloader and or partition table, but not sure how this happened (if we caused it)? and how to resolve. Bad
Copy code
ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x1 (POWERON),boot:0xd (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0x48
load:0x00288200,len:0x20c
load:0x08a10862,len:0x20020aa
Invalid image block, can't boot.
And good
Copy code
ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x1 (POWERON),boot:0xd (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0x48
load:0x403cc710,len:0x65c
load:0x403ce710,len:0x2480
entry 0x403cc710
[toit] INFO: starting <v2.0.0-alpha.152>
[toit] DEBUG: clearing RTC memory: invalid checksum
[toit] INFO: running on ESP32C3 - revision 0.4
TLDR; any pointers would be greatly appreciated, as we can't currently identify what makes sense to look at next
k
Do you expect the bits in the flash to be the same on the two devices?
You can use esptool to read them from both devices and compare.
How did you flash them in the first place?
a
jag flash -c ESP32c3
So I think yes we would essentially expect everything to to be and behave the same on both at flash and boot time
This was chris runing this as he says
has the jag esp32c3 image changed since last week? It's probably not that.. but any suggestions? afaik we havent changed anything and the issue has been replicated on 2 new boards
I have taken a look at things and also can't really figure out the direction to investigate in 🙂
The flash output looks the same (left works, right doesnt boot) https://www.diffchecker.com/jl2hEJbN/
So the difference we see is on boot with a second load of
load:0x403cc710,len:0x65c
working, and a second load of
load:0x00288200,len:0x20c
failing, and trying to determine why they are each loading from different places for different lengths given the same flashing operation
k
Have you tried fetching the flash bits using esptool?
a
I'll get chris to have a look at that once he gets out of his meeting, its all currently setup on his desk and these board have a fair few wires attached 😉
k
🙂
k
Yup!
does
jag
flash the bootloader too? I noticed that the suggested flash command once building a custom envelope does for example
k
Yeah, it should flash the bootloader.
The envelope is an ar file, so you can use standard tooling to find the bootloader.bin entry.
Copy code
ar -t ~/.cache/jaguar/v2.0.0-alpha.161/envelopes/firmware-esp32.envelope 
$envelope
$metadata
$firmware.bin
system
$properties
$firmware.elf
$bootloader.bin
$partitions.bin
$partitions.csv
$otadata.bin
$flashing.json
a
I guess my custom envelope is probably irellevant to this, as this happens with the default toit espc3 envelope too
k
So can you reproduce this after reflashing with the esp32c3 envelope pulled from https://github.com/toitlang/envelopes/releases/download/v2.0.0-alpha.163/firmware-esp32c3.envelope.gz ?
(or whatever version is associated with the version of jaguar you use)
jag version
should tell you.
a
So ignore what I said about custom evelopes I think, so far this has all been using
jag flash -c ESP32c3
on jag v1.43.1 v2.0.0-alpha.163 and jag v1.41 alpah 160
and I assume that has fetched the envelopes from the toitlang repos?
If so, then the answer to
can you reproduce this after reflashing with the esp32c3 envelope pulled from
would be yes
Chris just said "oooh i have an idea" and left the room 😛
k
Are you using that capitalization of
ESP32c3
when you flash?
a
nope
Chris has walked back in and it works! It was a hardware issue 😄
Something in the board (that we are not using) was seemingly (potentailly) pulling a pin in a direction that caused all of this, so chopping it out for now has resolved out issue
Thanks for the guidance through trying to figure it out!
k
Freaky 🎉
a
yeah, took a chip off and its working, got to love prototype hardware 😄
6 Views