https://toitlang.org/ logo
jag flash raises EXCEPTION error.ILLEGAL_UTF_8
# help
a
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
here's the full terminal output:
k
Looks like you're trying to flash using a binary image, but the Jaguar tooling expects this to be a Toit envelope.
The error message is rather unpleasant, so maybe we can give a friendlier error if the provided firmware isn't in the right format.
a
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
k
You can probably use
build/esp32c6/firmware.envelope
instead of the
.bin
file.
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.
Oh, wait. This is probably the Jaguar snapshot that was built against 174 with no modifications.
a
I did a few patched to the sdk
yes
k
You'll probably want to build Jaguar yourself with the updated SDK.
a
will check this thanks!
k
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.
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.
Yeah, it does look like you may need to tweak the makefile slightly.
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.
f
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.