#CircuitPython - LOLIN S3 MINI Download

1 messages · Page 1 of 1 (latest)

ocean cloud
#

@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?

rotund ocean
ocean cloud
#

In my experience, the WebSerial tool won't always give feedback when something goes wrong, in particular anything involving a timeout.

rotund ocean
#

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.

little raft
#

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?

ocean cloud
#

@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.

little raft
#

circuitpython-firmware.bin is incomplete, despite the name

rotund ocean
ocean cloud
#

@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.

rotund ocean
# ocean cloud <@375390851595108353> It took longer than I expected, but I've gotten to the roo...

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?

ocean cloud
# rotund ocean ***not fully materialized a compiled function pointer when garbage collection wa...

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.

rotund ocean
#

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

ocean cloud
rotund ocean
#

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...???

ocean cloud
#

That's an VT escape sequence that Thonny's serial terminal isn't handling. I don't think it's an issue.

rotund ocean
#

At the moment, I have

  • lolin_c3_mini build
  • 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!")
GitHub

CircuitPython - a Python implementation for teaching coding with microcontrollers - adafruit/circuitpython

#

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),
ocean cloud
#

It's possible this isn't a new regression. Does the Thonny timeout occur with 9.2.7?

rotund ocean
#

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
rotund ocean
#

Initial test with 9.2.7 does not replicate the problem - Stop/Restart backend works normally so far

ocean cloud
#

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.

rotund ocean
#

appears to be related to wifi

#

works fine with an empty settings.toml

ocean cloud
rotund ocean
#

problem is back once I set ```CIRCUITPY_WIFI_SSID = ""
CIRCUITPY_WIFI_PASSWORD = "
"

#

it went into a "soft reboot" loop ...

ocean cloud
#

Is the Thonny issue happening with 9.2.7?

rotund ocean
#

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/

A mini Wi-Fi & Bluetooth LE board based on ESP32-C3FH4.Features based ESP32-C3 WIFI & Bluetooth LE RISC-V Single-Core CPU Type-C USB 4MB Flash Clock speed: 160 Mhz 12x Digital IO ADC, I2C, SPI, UART Size: 34.3 mm x 25.4 mm Weight: 2.6g Compatible with LOLIN D1 mini shields Compa...

ocean cloud
#

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.

rotund ocean