guild icon
Toit
#Make jag flash not care about Snapshot vs envelope version
Thread channel in help
addshore
addshore 10/09/2024 09:24 AM
I updated to v2.0.0-alpha.163.10+2a13c0d6 for my envelope, as it includes https://github.com/toitlang/toit/commit/08b379eb4de139f10c29f6a97bb9cf49bee3c3ed that I need, and i dont want to have the random line floating around in my own fork or something etc.

However trying to flash now using a freshly built envelope I see the following

) jag flash build/esp32c3/firmware.envelope Error: Snapshot was built by SDK v2.0.0-alpha.163, but envelope is for SDK v2.0.0-alpha.163.10+2a13c0d6. Error: exit status 1

I don't see a way to make jag flash ignore this error? is it possible?
addshore
addshore 10/09/2024 11:43 AM
One part of thee answer here is that the custom envelope build outputs a command using esptool to flash the FW onto the device
using this (and not using jag) has the side affect of not including the wifi creds out of the box, but at least the code flashes
floitsch
floitsch 10/11/2024 12:50 PM
If you have Toit checked out, then I recommend to work with it directly:
- set JAG_TOIT_REPO_PATH to the path of the SDK.
- make in the Jaguar repository.

This will then direct Jaguar to build and use the SDK from the checked out repository.
addshore
addshore 10/08/2025 07:52 AM
I seem to be back in this situation, but entirely inversed? :๐Ÿ˜„:

~/dev/github/toitlang/jaguar (main) ./build/jag flash --chip esp32c6 Error: Snapshot was built by SDK v2.0.0-alpha.188.14+ffc3b1be, but envelope is for SDK v2.0.0-alpha.178. Error: exit status 1

I have JAG_TOIT_REPO_PATH set and am using it, and gather thats where the v2.0.0-alpha.188.14+ffc3b1be part is coming from
Just need to figure out the v2.0.0-alpha.178 part?
floitsch
floitsch 10/08/2025 07:54 AM
I think I also screwed up some dependency in the build system.
floitsch
floitsch 10/08/2025 07:55 AM
You might need to erase the sdk dir, or maybe just make rebuild-cmake
floitsch
floitsch 10/08/2025 07:55 AM
The envelope is the version of the firmware (what is installed on the device).
floitschfloitsch
You might need to erase the sdk dir, or maybe just make rebuild-cmake
addshore
addshore 10/08/2025 07:55 AM
in jaguar or toit?
floitsch
floitsch 10/08/2025 07:55 AM
Toit
addshore
addshore 10/08/2025 07:56 AM
after remake cbuild and make of jag
~/dev/github/toitlang/jaguar (main) ./build/jag flash --chip esp32c6 Error: Snapshot was built by SDK v2.0.0-alpha.188, but envelope is for SDK v2.0.0-alpha.178. Error: exit status 1
floitsch
floitsch 10/08/2025 07:57 AM
Start by figuring out what the toit version is.
addshore
addshore 10/08/2025 07:57 AM
~/dev/github/toitlang/toit ((HEAD detached at v2.0.0-alpha.188))
floitsch
floitsch 10/08/2025 07:57 AM
Ok. That indicates that you haven't yet flashed the new firmware.
addshore
addshore 10/08/2025 07:58 AM
Right, but the command Im trying to run is the flash ?(edited)
floitsch
floitsch 10/08/2025 07:58 AM
or firmware update.
floitsch
floitsch 10/08/2025 07:58 AM
ah. right. Now I see the flash.
floitsch
floitsch 10/08/2025 07:58 AM
Ok step back.
You need 4 things to work together:
addshore
addshore 10/08/2025 07:58 AM
so at a guess this is the jaguar envelope being the wrong version for this jag and toit version?
floitsch
floitsch 10/08/2025 08:00 AM
1. the sdk binary (toit. build/host/sdk/bin/toit version)
2. the compiled snapshot (jaguar. build/jag.snapshot ?)
3. the envelope (toit. build/esp32/firmware.envelope)
4. the installed firmware.
floitsch
floitsch 10/08/2025 08:00 AM
2 needs 1. 4 needs 3.
floitsch
floitsch 10/08/2025 08:00 AM
When JAG_TOIT_REPO_PATH is set, Jaguar tries to use the envelope from that directory.
floitsch
floitsch 10/08/2025 08:01 AM
I can see that you are using esp32c6, so you might need to explicitly make esp32c6 in the toit repository.
floitsch
floitsch 10/08/2025 08:01 AM
I think Jaguar has a way to build all envelopes but that's probably not worth it.
floitsch
floitsch 10/08/2025 08:01 AM
in your case it would then be build/esp32c6/firmware.envelope for item 3.
addshore
addshore 10/08/2025 08:03 AM
~/dev/github/toitlang/jaguar (main) ./build/jag toit tool firmware show -e ${JAG_TOIT_REPO_PATH}/build/esp32 c6/firmware.envelope Envelope format version: 8 Kind: esp32 SDK version: v2.0.0-alpha.178 Chip: esp32c6 Containers: system: Kind: snapshot Id: 5d36ae78-ef49-4250-458b-b98b6db7cbdb Size: 167204 Flags: - trigger=boot - critical
floitsch
floitsch 10/08/2025 08:03 AM
What I mentioned above: if the sdk has a bad version (and I think it might not be visible with toit version) then the jag.snapshot thinks that it is compiled for the wrong firmware.
So if jag.snapshot claims that it isn't the version of toit even though you just compiled it, then you want to rebuild the sdk (either clear it, or try with make rebuild-cmake)
addshoreOPaddshore
``` ~/dev/github/toitlang/jaguar (main) ./build/jag toit tool firmware show -e ${JAG_TOIT_REPO_PATH}/build/esp32 c6/firmware.envelope Envelope format version: 8 Kind: esp32 SDK ver...
floitsch
floitsch 10/08/2025 08:04 AM
Yep. that looks like you need to build the esp32c6 firmware.
๐Ÿ‘1
addshore
addshore 10/08/2025 08:09 AM
back to a classic
'/home/adam/.espressif/python_env/idf5.4_py3.10_env/bin/python' is currently active in the environment while the project was configured with '/home/adam/.espressif/python_env/idf5.3_py3.10_env/bin/python'. Run 'idf.py fullclean' to start again.
addshore
addshore 10/08/2025 08:10 AM
Right, the makefile of toit just uses python$(EXE_SUFFIX)
floitsch
floitsch 10/08/2025 08:16 AM
Sounds like you sourced the export.sh yourself.(edited)
floitsch
floitsch 10/08/2025 08:16 AM
I always let the buildscript do that, so that I don't run into this situation.
floitsch
floitsch 10/08/2025 08:17 AM
unless this is part of your custom firmware (which sounds likely now).
floitsch
floitsch 10/08/2025 08:17 AM
In that case, idf.py fullclean sounds like the right solution.
addshore
addshore 10/08/2025 08:26 AM
so, in a new shell session, make esp32c6 results in the python env issue again
running ./third_party/esp-idf/install.sh and make esp32c6 again results in the same

Doing /home/adam/.espressif/python_env/idf5.4_py3.10_env/bin/python ./third_party/esp-idf/tools/idf.py fullclean in either python env resulted in telling me there was nothing to clean / it refused

rm -rf /home/adam/dev/github/toitlang/toit/build was the golden ticket
After this make esp32c6 seemed to work

unless this is part of your custom firmware (which sounds likely now).
I have no custom FW right now, this is just the plain v2.0.0-alpha.188 toit branch, with only a couple of modifications in the jaguar repo
addshore
addshore 10/08/2025 08:26 AM
./build/jag flash --chip esp32c6 works great now!
floitsch
floitsch 10/08/2025 08:26 AM
hmm. Interesting.
floitsch
floitsch 10/08/2025 08:26 AM
Actually. Makes sense now.
floitsch
floitsch 10/08/2025 08:27 AM
I think you would need to run the fullclean inside the toolchain directory.
floitsch
floitsch 10/08/2025 08:27 AM
It's just easier if you remove the build/esp32c6 directory.
floitsch
floitsch 10/08/2025 08:27 AM
If you have ccache recompilation is super fast anyway. (and if you don't you should install it).
addshore
addshore 10/08/2025 08:34 AM
@floitsch last question down this rabbit hole,
So i changed some of the .toit files in the jaguar repo, and want that to end up on my device
I think thats the makefile target assets?
However doing make assets results in
Unhandled error: Get "https://github.com/toitware/registry/info/refs?service=git-upload-pack": dial tcp: lookup github.com on 10.255.255.254:53: read udp 10.255.255.254:56319->10.255.255.254:53: i/o timeout

Whats it doing with github? :๐Ÿ˜›:
(edited)
floitsch
floitsch 10/08/2025 08:44 AM
I have a $JAG_TOIT_REPO_PATH/build/host/sdk/bin/toit compile -O2 -o build/jag.snapshot src/jaguar.toit (or something like that) in my shell history.
floitsch
floitsch 10/08/2025 08:44 AM
You should be able to find the correct command in the Makefile.
floitsch
floitsch 10/08/2025 08:44 AM
I guess the github is to download dependent packages.
floitsch
floitsch 10/08/2025 08:45 AM
(toitware/registry is where the official registry is located).
45 messages in total