https://toitlang.org/ logo
unexpected eof error
# help
u
this showed up when i run jag monitor
Copy code
PS C:\Users\bossc\toit> jag monitor -a
Starting serial monitor of port 'COM3' ...
Error: unexpected EOF
i tried resetting it but it didnt work
f
A few things to look at: - did the same setup already work before, or does it work with a different esp32? - is the USB cable of good quality? Unfortunately a very common issue. - is the port correct? If you unplug the esp32, does 'COM3' disappear? - if connected through a USB hub, try to connect directly. - if this is an ESP with built-in USB (C3, S3, ...) it might need an envelope with USB support.
u
it think it was probably cable ploblem,buying new cable.
i have just bought new cable but nothing changed 🙁
my observation is that i can run code on it but when i tried to monitor it code stops immediately
f
Running code is done via WiFi, so that's unaffected by the UART. Can you flash the device?
u
i already did but still the same error
and it used to work as normal last month
f
The question was mainly if the serial port works for flashing. Not that a
jag monitor
automatically resets the device. You can use
-a
(attach) to avoid that.
u
Copy code
PS C:\Users\bossc\toit> jag monitor -a
Starting serial monitor of port 'COM3' ...
Error: unexpected EOF
f
So this is a normal esp32 that you can flash on this port, but you can't use monitor on it?
u
yes
f
I have never seen this... Could you try with the esp-idf to see if it works there?
u
ok,but how can i use toit on esp-idf?
and i just bought new esp but its still the same error
f
You can't. Fundamentally, we are trying to figure out what's going wrong. There are two things we can try: - use
idf.py monitor
instead of
jag monitor
. - use esp-idf on its own, without Toit. That would exclude things.
I'm also thinking of reasons for why things don't work. Could it be that you have another program (like Arduino IDE), ... that tries to grab the port?
Maybe, on Windows, another program can steal the uart port.
u
no i doesnt.i ran only vscode
f
also try
jag monitor -a
.
That doesn't reset the board.
Just to see if that makes a difference.
u
Copy code
PS C:\Users\bossc> jag monitor -a
Starting serial monitor of port 'COM5' ...
Error: unexpected EOF
f
it looks like
jag monitor
just can't read data from the device, or the port is reset frequently.
can you flash the device normally with Jaguar?
u
yes
f
Try this page.
Change the baudrate to 115200
Then connect.
Press the reset button on the device, to make sure some output should be visible.
u
Copy code
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce2810,len:0xdc
load:0x403c8700,len:0x4
load:0x403c8704,len:0xa08
load:0x403cb700,len:0x257c
entry 0x403c8854
E (325) quad_psram: PSRAM ID read error: 0x00ffffff, PSRAM chip not found or not supported, or wrong PSRAM line mode
E (325) esp_psram: PSRAM enabled but initialization failed. Bailing out.
[toit] INFO: starting 
[toit] DEBUG: clearing RTC memory: invalid checksum
[toit] INFO: running on ESP32S3 - revision 0.2
[wifi] DEBUG: connecting
[wifi] INFO: retrying {reason: expired authentication}
[wifi] DEBUG: connected
f
Interesting.
So this really is a program with Jaguar (and thus the Go UART library).
which version do you use?
u
the toit?
f
yes. Jaguar.
u
Copy code
Version:         v1.53.0
SDK version:     v2.0.0-alpha.184
Build date:      2025-06-03T07:57:41Z
f
I think we have released a newer one in the meantime.
Could you try to update and see if that changes things?
u
Copy code
PS C:\Users\bossc> jag firmware update
Failed to ping 'vast-bridge'.
Scanning for device with ID: '8cdf1898-9989-4d3c-8fc9-1cc51f740dc1'
v silly-proposal (address: http://192.168.1.180:9000, 32-bit)
Updating firmware on 'silly-proposal' to Toit SDK v2.0.0-alpha.184

   100%  1474k  |  [################### Jaguar #######################]
why does the version doesnt change?
f
winget upgrade --id=Toit.Jaguar -e
jag firmware update
only updates the device with the firmware of the current Jaguar.
So once you have done a Jaguar update you will need to run the
firmware update
.
u
updated still the same.
f
ok.
I don't have any windows machine to test right now, but I will try to find one. In the meantime just use the web-page as a work-around.
It's not perfect, as it won't automatically decode stack-traces, but that shouldn't be a huge blocker.
What's the version of your Windows?
u
windows 11
I have just discovered new info , the error only occurs to my pc other pc just works as normal
f
On the general chat someone else reported that it worked for them.
Very curious.