#CircuitPython - LOLIN S3 MINI Download
1 messages · Page 1 of 1 (latest)
@rotund ocean I've been out most of yesterday, so I'm just catching up. Did you try entirely erasing the flash with esptool.py?
No rush, just an FYI. I'm using the https://adafruit.github.io/Adafruit_WebSerial_ESPTool/ instead of esptool.py, but I did do a full erase. Getting all the USB stuff working with WSL just for esptool.py is a pain, but if I can streamline that process with a bit of DevOps sugar coating - which will also help with getting setup for debug support - I might try using esptool.py more.
In my experience, the WebSerial tool won't always give feedback when something goes wrong, in particular anything involving a timeout.
It's seemed fairly solid to me, but my experience only goes back around three months... I'll give it a try with esptool.py later today just to be sure.
you could also erase it completely and install the circuitpython .bin without the UF2 bootloader
e.g. like esptool.py -p /dev/ttyACM0 -b 921600 --before=default_reset --after=no_reset write_flash 0x0000
add .bin as arg
have you tried some generic 4/2 S3 build?
@rotund ocean Something to watch out for when you flash CP is to be sure that you're flashing the correct .bin. The build process will produce two .bin files, the correct one to use is firmware.bin.
circuitpython-firmware.bin is incomplete, despite the name
yep, the docs on building CP did a good job of explaining that
@rotund ocean It took longer than I expected, but I've gotten to the root cause of the C3/C6 Python interpreter crashes. RISC-V gcc code gen had not fully materialized a compiled function pointer when garbage collection was called, resulting in collection and release of compiled code that was subsequently executed. During execution, its freed memory was allocated for other purposes, leading to memory corruption and a crash.
The PR is here if you'd like to give it a try: https://github.com/adafruit/circuitpython/pull/10301
The PR branch is based on the latest CP 10 alpha.3 tag, so it includes ESP-IDF 5.4.1.
not fully materialized a compiled function pointer when garbage collection was called - wow. I've found some compiler bugs in my time, but tracking down something that subtle is quite an achievement. I'll give it a try later today. Do I just need to gh pr checkout 10301 to pull the code? Does that need to be in a clone of the main adafruit/circuitpython or your fork? (I've been testing the ESP-IDF 5.4.1 stuff in https://github.com/eightycc/circuitpython.git) Any specific branch?
If you have a clone of the Adafruit repo, you can git fetch origin pull/10301/head:issue-10298 and then git checkout issue-10298. This creates a new branch in your local repo named issue-10298 and checks it out. If you're working from a clone of my forked repo, git checkout issue-10298. In either case, you'll need to git fetch origin or work from a fresh clone. There's likely a way to do it with gh, too, but I don't know it. My personal convention is to name a branch for the issue number I'm addressing, so in this case 10298 was the issue I was fixing.
Initial results are were promising. No crashes yet, no weird extra characters in USB REPL, file access with Thonny looks good, bulk copy through http://192.168.xx.xxx/fs/#/ works.
Had to reset this morning - left it sitting with connected REPL yesterday. Although I think I reset the WIFI router since then.
Thonny's Stop/Restart backend action is acting odd - it's showing a write timeout
Overall, this is good news. I've seen some "had to reset" behavior here, too. Not sure what that's attributable to, I'll need to catch it with JTAG. Could you give me a step by step for the Thonny problem so I can reproduce it here?
If I reset the C3 Mini, it connects fine - the first time. I do see what might be a few odd characters, but those might actually be normal...???
That's an VT escape sequence that Thonny's serial terminal isn't handling. I don't think it's an issue.
At the moment, I have
- lolin_c3_mini build
- fresh clean clone of https://github.com/adafruit/circuitpython.git
git fetch origin pull/10301/head:issue-10298git checkout issue-10298- typical build ( make fetch-port-submodules, esp-idf/install.sh, ...)
- installed on a Wemos/Lolin C3 mini
- settings.toml configured for local WIFI +
CIRCUITPY_WEB_API_* - copied dependencies for my project into /lib
- these are from adafruit-circuitpython-bundle-9.x-mpy-20250307, updating to latest today
- shouldn't matter because AFAIK they aren't used yet
- code.py is just
print("Hello World!")
Everything looks good when I launch Thonny after a reset. I can close and relaunch Thonny as well.
But after I do Stop/Restart backend
- Thonny gets a
Write timeout(full message same as above screen capture) - Restarting Thonny (without resetting the C3 Mini) shows same error
- doing another Stop/Restart backend usually shows the same error, but occasionally reconnects successfully
- http access through
CIRCUITPY_WEB_API_*still works fine while in this state (Thonny connections failing),
Also, connecting through https://code.circuitpython.org/ (USB) works fine even when Thonny is complaining.
It's possible this isn't a new regression. Does the Thonny timeout occur with 9.2.7?
Two more potentially helpful bits :
- While this appears to be related to something specific to Thonny (timing??), I've been using Thonny as my default USB console out / REPL access for a while with a variety of ESP32-* boards and this is the first time I've seen this behavior
- I also triggered something this morning by doing
help("modules")at the REPL- seemed to freeze up and had no further response
- it might have just triggered the same Thonny-related issue
- unfortunately I hadn't yet realized how Thonny-specific this seems so I did not try accessing with the WebAPI or https://code.circuitpython.org/ (USB) before resetting
- haven't been able to reproduce it - all other
help("modules")so far have worked fined
I don't think I ever loaded 9.2.7 on a C3 -installing it now to check
Initial test with 9.2.7 does not replicate the problem - Stop/Restart backend works normally so far
I'm waiting on an ESP32-C3, should be here Wednesday, so I'll defer debugging the Thonny problem until them. Thank you for testing with 9.2.7!
In the meantime, I've pushed a new branch, issue-10002 to my fork that incorporates everything so far plus it attempts to enable BLE on the C3. I've taken a stab at fixing the boot loop that enabling BLE had caused and I'm hoping you can give it a try. The flash partition map changes, so you'll need to completely erase the flash.
Great data point!
problem is back once I set ```CIRCUITPY_WIFI_SSID = ""
CIRCUITPY_WIFI_PASSWORD = ""
I am seeing something odd with https://code.circuitpython.org/ (USB) after triggering the Thonny issue
it went into a "soft reboot" loop ...
Is the Thonny issue happening with 9.2.7?
tried various CTRL-C /CTRL-D etc, broke out (sorta) and then got
yes, everything since you asked about 9.2.7 is from a fresh 9.2.7 install from the online installer at https://circuitpython.org/board/lolin_c3_mini/
FWIW, just noticed I had multiple https://code.circuitpython.org/ tabs open. Not sure if the other one was connected or not.
OK, since it's not a regression with ESP-IDF 5.4.1, we'll need to track it and triage it as a separate issue. Please open a new issue and note that it is occurring with both 9.2.7 with ESP-IDF 5.3 and 10 alpha with ESP-IDF 5.4.1.
I'm not familiar with how Windows handles it, but Linux and MacOS refuse to have multiple connections to a serial device open concurrently.
So create a new Bug Report at https://github.com/adafruit/circuitpython/issues ? I'll probably dig a little more first to see if/how I can replicate anything without Thonny.