guild icon
Toit
#jag flash raises EXCEPTION error.ILLEGAL_UTF_8
Thread channel in help
AbedN
AbedN 03/17/2025 07:32 AM
Hi,
I am running into the above issue when running jag flash build/esp32c6/toit-firmware.bin --chip esp32c6. it works with idf.py flash though when running jag monitor afterwards the device doesn't connect to network
AbedN
AbedN 03/17/2025 07:32 AM
here's the full terminal output:(edited)
AbedN
AbedN 03/17/2025 07:33 AM
bitphlipphar
bitphlipphar 03/17/2025 07:45 AM
Looks like you're trying to flash using a binary image, but the Jaguar tooling expects this to be a Toit envelope.
bitphlipphar
bitphlipphar 03/17/2025 07:46 AM
The error message is rather unpleasant, so maybe we can give a friendlier error if the provided firmware isn't in the right format.
AbedN
AbedN 03/17/2025 07:47 AM
Thanks, I am getting this now when flashing the enevlepe file : abood@abdalrahimps:~/final_test_toit_EI/toit_edge_impulse$
jag flash firmware.envelope --chip esp32c6
Error: Snapshot was built by SDK v2.0.0-alpha.174, but envelope is for SDK v2.0.0-alpha.174.1+2c98a602.
Error: exit status 1
bitphlipphar
bitphlipphar 03/17/2025 07:47 AM
You can probably use build/esp32c6/firmware.envelope instead of the .bin file.
bitphlipphar
bitphlipphar 03/17/2025 07:49 AM
Have you added anything to the envelope? It smells like you've done some modifications to the SDK, but at least one of the snapshots in the envelope wasn't compiled with the updated compiler. Now it is very likely that you haven't changed the compiler so the check is a little annoying here.
bitphlipphar
bitphlipphar 03/17/2025 07:50 AM
Oh, wait. This is probably the Jaguar snapshot that was built against 174 with no modifications.
AbedN
AbedN 03/17/2025 07:50 AM
I did a few patched to the sdk
AbedN
AbedN 03/17/2025 07:50 AM
yes
bitphlipphar
bitphlipphar 03/17/2025 07:50 AM
You'll probably want to build Jaguar yourself with the updated SDK.
AbedN
AbedN 03/17/2025 07:51 AM
will check this thanks!
bitphlipphar
bitphlipphar 03/17/2025 07:51 AM
The trick is to have an environment variable point to your updated SDK (JAG_TOIT_REPO_PATH) and then just run make in the Jaguar checkout.
bitphlipphar
bitphlipphar 03/17/2025 07:52 AM
That will build the SDK if necessary (you may need to enable c6 support somewhere, because I think we just build the regular esp32 by default) and you'll have a build/jag that you can use.
👍1
bitphlipphar
bitphlipphar 03/17/2025 07:54 AM
Yeah, it does look like you may need to tweak the makefile slightly.
bitphlipphar
bitphlipphar 03/17/2025 07:55 AM
This is where we build for the regular esp32:
https://github.com/toitlang/jaguar/blob/main/Makefile#L87

If you were to add ESP32_CHIP=esp32c6 to that line, you'd probably get what you want.
(edited)
floitsch
floitsch 03/17/2025 05:23 PM
Fwiw, here is my workflow:
- Set the JAG_TOIT_REPO_PATH.
- Run make once.
For subsequent developments:
- in the toit repository: make esp32, or make esp32s3, ...
- if the branch in the toit repository changes, I just recompile the Jaguar snapshot without running a full make: ../toit/build/host/sdk/bin/toit compile -O2 --snapshot -o build/assets/jaguar.snapshot src/jaguar.toit
- I typically use the firmware update of Jaguar to push newly compiled envelopes: build/jag firmware update or build/jag firmware update esp32s3...

Also make sure to run build/jag monitor (with the JAG_TOIT_REPO_PATH set) and not just jag monitory. This should give you better stacktraces in C crashes.
20 messages in total