#circuitpython-dev

1 messages ยท Page 86 of 1

onyx hinge
manic glacierBOT
jaunty juniper
# onyx hinge oh no is there yet another uf2 performance bug on macs !? https://rasterweb.net...

I see the Finder (or BBEdit) lock up on rare occasions, usually when something is going wrong with the board and I have to unplug it to recover. I believe I also have rare cases of renaming a file in the Finder leading to maybe some corruption (like the file disappears), leading me to erase_filesystem() some boards, as well as experimenting with remounting the drive rather than erase to solve it: https://gist.github.com/Neradoc/c1d0f74c0a3ee7d514d40d38686add7a

manic glacierBOT
#

@tannewt (Scott),

You have wayyyy too much confidence in my abilities. The last time I compiled code was for the 6502 CPU. back in the 70s and 80s. My first programming experience was using Fortran in the mid 60s on the IBM 1620. (Not Fortran II, III, IV) I also learned Assembly on that machine. I had it compute e to 400 decimal places. It took hours!

Bruce

P.S. @bablokb, You too. ;-) Wayyyy too much confidence.

P.S.S.
It is the job of the programmer to make the user's life easy, no...

tiny peak
#

However, I don't tend to leave boards plugged in when I'm not actively working on code. So, if the issue is something that depends on the board staying plugged in for an extended time, maybe my rsync + sync method is irrelevant.

manic glacierBOT
#

This makes the following functional changes:

  • TilePaletteMapper now has tilegrid as an argument instead of width, and height
  • TileGrid now allows pixel_shader argument to be None or omitted. But _add_layer() now validates that it it isn't None before it can be added to a Group to be shown on the display.
  • TileGrid is refactored to have a displayio_tilegrid_mark_tile_dirty() function that gets called by set_tile
  • TilePaletteMapper makes use of the new `displayio_tilegri...
tiny peak
#

Does anybody know where things ended up with refresh rates for Fruit Jam's DVI out? I just tried 10.0.0-alpha.4, and it booted with 640x480 @72Hz. That refresh rate is too high for my capture card to sync to, and my TV initially didn't like it. After a reset, the TV seemed okay. Is there any plan to use 640x480@60Hz?

#

also, if I try messing with microcontroller.cpu.frequency = ..., it breaks the timing for USB host mode, so I can't do that as a workaround.

manic glacierBOT
#

FWIW, I got tripped up by this again on 10.0.0-alpha.4. I'm trying to do a Playground guide that uses USB Host and DVI out. I'd like to use my HDMI capture card to take clean images for the guide. At the moment, the best I'll be able to do is photographing a fuzzy upscale off the TV.

After a fresh firmware install, the Fruit Jam boots to 640x480@72Hz (according to my TV). Sync with the TV is marginal (initially refused to sync, then did okay after a reset). Sync with my capture card doesn't...

lone sandalBOT
manic glacierBOT
slender iron
tiny peak
manic glacierBOT
manic glacierBOT
tiny peak
lone sandalBOT
slender iron
manic glacierBOT
manic glacierBOT
#

This is just a pull to add the Waveshare RP2350 USB-A board (https://www.waveshare.com/wiki/RP2350-USB-A)

I have tested the USB host capabilities with the example from the adafruit usb host descriptors library and it appeared to work flawlessly. Onboard LED also appears to be working just fine straight out of the box.

Sorry, haven't done many pull requests in my time, so I'm a little nervous I've forgotten something

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Resolves: #10314

Temporarily remove the weblate badge from the readme file before building latex versions of docs and replace the original readme afterward.

I've made this against main, I'm not sure if it needs to be made for 9.2.x, maybe not if the PDF gets created at release time and then cached somewhere. I'm not certain where all this PDF ends up or when the published ones gets generated. If it gets regenerated in-between releases then we may want to have the same fix for 9.2.x...

mortal kernel
#

@lone axle It's almost as if you read my mind ๐Ÿ‘

manic glacierBOT
#

I have customers who are interested in circuitpython support for our Propeller 2 Multicore Microcontroller.

General info:
Code object exchange:
Quick bytes:
Forums:

I'm asking if any developers would be interested in porting it to the P2. Some level of support from Parallax would be av...

mortal kernel
#

@lone axle If you like, I can review 10322.

lone axle
# mortal kernel <@382939733107408897> If you like, I can review 10322.

Yeah that would be great, thank you. I think my change falls in line with Scott's proposal in the issue, and it'll be nice to get it in if we can so that PRs can stop failing. I can always make further tweaks later on if/when Scott or Dan have a chance to look and think there are better ways to handle.

manic glacierBOT
lone axle
#

Now you're reading gamblor's mind! ๐Ÿ˜„

mortal kernel
#

I'm getting good at hitting that big green button ๐Ÿ˜€

blissful pollen
#

Haha my work laptop is updating so I had a few moments to read it. Figured this was important to get in

tiny peak
slender iron
#

no, I don't think many people would need it. Just build it yourself

tiny peak
#

eh, not worth it then. thanks. I'll just make do with how things are now.

mortal kernel
#

@slender iron I've gone through the 10.0.0 milestone issues and selected these to work on: 9171, 9491, 10153, 9381, 9992, 10197, and 10224. That should keep me busy for a few beats. If you have any others that you'd like me to work on, please let me know.

slender iron
#

your capture card is the only one I have heard of that doesn't work

slender iron
#

nordic ppk2 is my goto

mortal kernel
manic glacierBOT
manic glacierBOT
#

I noticed that this change is showing some edits to the .pot file that I did not knowingly make. I ran pre-commit locally and it seems to have made some of those changes even though they appear unrelated to TileGrid or TilePaletteMapper. I'm not sure if that is a git or update / merge issue or something else. Let me know if I need to do anything further in that file though.

It looks fine to me. I'm not sure why Weblate didn't do it but it seems to be active. Updating these here is fine.

manic glacierBOT
#

Scott,

How about a third option where nobody can write/read it and it goes away? I know I am being a bit flippant, but...

Will it be switchable real time from within CP. e.g. Red LED, write by CP. Green LED, write by PC. Red or Green read by both.
I assume a status can be tested for completion of any write before code.py flips the LED colors. (Two LEDs, Bi/Tri color LED, or NeoPixel)

Default or boot.py or code.py option.
SD_Card = 0: No write/read Drive gone. Default and availa...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

The latest commit swaps this over to how you describe. pixel_shader is required for TileGrid as it was originally. TPM no longer accepts width, height, or tilegrid. The new internal bind function links a TPM to a TileGrid and is called when the TileGrid is created with a TPM pixel_shader, or has its pixel_shader set to a TPM.

Tested successfully on fruitjam with the circuitpython matrix code, and the latest version of text editor updated to use the new API.

manic glacierBOT
manic glacierBOT
#

Can you think of an obvious reason this occurs only with HTTPS, or could it just be a fluke that we haven't observed it with HTTP yet?

This happens with HTTP, too. The test case I've been working with is a simple HTTP server from #9428. The root cause isn't a networking issue at all, which is kind of surprising. Instead, it's due to the socket polling loop using NLR (Non-Local Return) for every iteration that eventually corrupts the Xtensa windowing registers. In its implementation, NLR us...

steady mulch
#

Hi, I've got a situation on Pico W where c5c7d11 causes PulseIn to miss input in elaborate circumstances that include "only happens when on wifi", and is only noticeably affecting one type of IR sensor and not a slightly different one. Any ideas where I'd go from here?

#

Also I wasn't paying attention and did make fetch-all-submodules which takes up several gigabytes, so is there an easy way to undo that or would I just need to delete the clone and make it again?

#

Also, where can I find the detailed breakdown of RAM and flash usage for the build that I vaguely remember seeing somewhere?

short marsh
#

My PR was merged, woohoo: https://github.com/adafruit/circuitpython/pull/10309

Cool experience contributing and having my updates usable for all!

In what stable release version will these changes be included in, and made available on the .UF2 download page (specifically for the PyBadge) (https://circuitpython.org/board/pybadge/)

GitHub

Added an end method to the MixerVoice class within the auidomixer library.
Calling this method will set the object&#39;s loop flag to False. This is different than the stop method, which ends t...

The Adafruit PyBadge an all-in-one compact dev board programmable in CircuitPython. Full of features squeezed onto a 3 3โ„8 ร— 2 1โ„8 inch rounded credit card sized rectangle. Itโ€™s a perfect wearable badge, but can be used for many projects.The PyBadge is powered by our favorite microcontroller, the...

lone axle
blissful pollen
slender iron
slender iron
manic glacierBOT
#

CircuitPython has support for a single COM serial port.

On the Pico, the only way I see to get it is to sacrifice the console:

boot.py
import usb_cdc
usb_cdc.enable(console=False, data=True) # Disable console, enable data

That's a very awkward solution because programming MicroPython without a console is too hard.

Somewhere the documentation says that there are difficulties in this area with some devices, without giving specifics.

So I don't even know which device to buy to get the re...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

But I don't understand what your issue is, you intentionally disable the console to reduce the number of com ports ?
But you also want the console at the same time ?

This is supported on RP2040:

import usb_cdc
usb_cdc.enable(console=True, data=True)

The ESP32 S2 and S3 for example (and some other ports) don't have enough USB endpoints to support the drive, HID and 2 serials at the same time, that's why there is that warning.

manic glacierBOT
#

I don't understand what your issue is, you intentionally disable the console to reduce the number of com ports ? But you also want the console at the same time ?

This is supported on RP2040:

import usb_cdc
usb_cdc.enable(console=True, data=True)

Not intentionally. Not my choice. While it MAY be supported as you write on some RP2040 devices which I don't know what they are, it is not supported on the Pico. I cannot see a single piece of evidence on the web hat shows how it wo...

manic glacierBOT
#

it is not supported on the Pico

Yes it is, on EVERY raspberry pi board, since this is unrelated to the board, only to the chip's USB support.

It's true that the use of usb_cdc kind of lacks a dedicated guide. See this learn guide though:
https://learn.adafruit.com/customizing-usb-devices-in-circuitpython/circuitpy-midi-serial#usb-serial-console-repl-and-data-3096590
This is a guide that uses usb_cdc.data for "Remote Procedure Calls" from a Macropad to a host:
https://learn.adafruit.com/ma...

manic glacierBOT
#

This PR resolves issues where Espressif parts with Xtensa cores would crash intermittently, typically while idling with socket polling taking place. Crashes were most often double-faults or WDT timeouts. The root cause of the crashes was use of a version of longjmp in ROM that exposed a window of about 6 instructions that manipulated register windowing control registers. If an interrupt occurred inside this window, a register windowing control register could become corrupted due to interact...

steady mulch
#

We didn't notice the issue until recently because it hadn't been tested with the affected sensor on wifi, only with the unaffected sensor on wifi and the affected sensor not on wifi

#

We're talking about non-modulated IR with pulses a few microseconds long

manic glacierBOT
#

A few more changes in the latest commit:

  • fix the pixel_shader property name which was previously palette. I'm guessing that was something I originally intended to change when ColorConverter support was added, but didn't do at the time.
  • Add tilegrid property to the locals table
  • Set tilegrid to None when the TPM is constructed
  • disallow TPM to be bound if its TileGrid isn't None still i.e. TPM can only be bound to a single tilegrid one time, a new one would have to get...
manic glacierBOT
#

Yes it is [supported], on EVERY raspberry pi board, since this is unrelated to the board, only to the chip's USB support.
Not on the Pico.

If I do in boot.py:
usb_cdc.enable(console=True, data=True)

and nothing else

then I lock myself out of the console and I don't even see safe mode. The CIRCUITPY drive disappears and I have to nuke flash the board.

My request is about the Pico. The docs say it is supported but so far I haven't seen anyone report success with it.

manic glacierBOT
lone axle
#

I wonder why socketpool listing here is so much more specific than the rest

manic glacierBOT
#

Not sure if this is an actual issue that could be guarded against or just a neat way for the user(me) to be an idiot, but the following code causes a hard fault in CircuitPython.

Occurs when using .send() instead of .asyncio_send(). .asyncio_send() in the same code works just fine.

Hardware: Adafruit RP2040 RFM95 915Mhz

Code:

import board
import digitalio
from adafruit_rfm import rfm9x
import asyncio

class TestCode:
    def __init__(self):
        # Define radio frequency in MHz. M...
manic glacierBOT
#

The docs say it is supported but so far I haven't seen anyone report success with it.

I have done this before and it was fine. I don't believe you've specified your CircuitPython version in this report.

That is all I needed to hear. If you say that it worked for you with the Pico, then it must be my operating system. I tried the latest CP versions so that can't be the problem.

I will re-install Windows and then see whether I get 2 comm ports. I deleted the USB device multiple times...

manic glacierBOT
#

Adafruit CircuitPython 10.0.0-alpha.4-5-g07ec0c6d09 on 2025-05-08; Adafruit Metro ESP32S2 with ESP32S2

Attempted to reproduce using the Python program at the top of the issue. Using the various connection methods listed in the table, could not reproduce the problem. Dots appear on the serial console at a steady rate regardless of what I do with web workflow. Tried both file browser and full code editor.

It appears that ESP-IDF 5.4.1 resolved this issue.

To be thorough, I will test wi...

manic glacierBOT
manic glacierBOT
#

Could not reproduce the problem (using the method and program at the top of the issue) at 9.2.7, so went back to 9.2.4 and then to 9.0.3, and could not reproduce it. Thinking it might have something to do with tinyuf2, reverted that to 0.18.2, and still could not reproduce the problem. I've been testing on a Metro ESP32S2, the only S2 I have on hand. Next up is Neradoc's program and method.

manic glacierBOT
#

Tesing using three pairs of QT Py boards, one of each pair running 10.0.0-alpha.4, the other running artifacts from this PR:

  • (2) ESP32-S2 running HTTP server
  • (2) ESP32-S2 running HTTPS server
  • (2) ESP32-S3 running HTTPS server

Looks good so far. Each of the 10.0.0-alpha.4 boards has already encountered a safemode. None of the PR#10328 boards have had any issues. Approving, but will let it run for a few days and report if anything unexpected happens.

HTTPS Server code.py

`...

manic glacierBOT
slender iron
#

@mortal kernel I'm excited to get your stablity fixes out

mortal kernel
#

I liked the register re-work you did in #10325. Just saw your review request, I'll get right on it. Any testing you'd like done?

slender iron
#

Since I'm not sure exactly when pointers are only in registers

mortal kernel
#

What I'll do for RISC-V is back out my fix and test. That should show that your change is working for RISC-V. For other targets, the best I can think of is a close reading of the code. So far in my reading I don't see anything that's unclear.

slender iron
#

I'm willing to test in the wild in an alpha too. That's why I marked it ready to review

manic glacierBOT
manic glacierBOT
#

I have downloaded and installed a fresh copy of Windows 10 on the same computer. No other competing devices. See device manager screen shot.

When I plug in the Pico, then Windows installs the drivers and as before, I get only 1 COM port, This time is easier than before because there is no other hardware with competing serial ports over USB. From my perspective, the CircuitPython software exposes only one serial port.

On the CIRCUITPY drive I installed adafruit-circuitpython-raspberry_pi_pic...

mortal kernel
#

@slender iron I'm close to done for the week. If you'd like, I can take up the interpreter crash on Monday. It's failing without backing out my change to parse_compile_execute.

slender iron
#

It fails even with your change?

mortal kernel
#

Yes, which is unexpected.

slender iron
#

I'm done too. Next week is fine. No release with this code anyway

mortal kernel
#

Have a great weekend! We've got the annual beer festival at the fair grounds I live next to. This year's theme is "The Great Lebrewski". I've got my bathrobe ready.

manic glacierBOT
#

According our expectations, this should be seen as a bug because we seem to agree that 2 COM ports should be available.

Not quite. By default, you only get one USB CDC ("COM") port. This goes to the CircuitPython REPL.
If you want a second CDC port for non-REPL data transmission, then you must do:

import usb_cdc
usb_cdc.enable(console=True, data=True)

in boot.py and power-cycle / hard reset the board to re-execute boot.py.
The [default usb_cdc setting](https://docs.circuitpy...

manic glacierBOT
manic glacierBOT
#

FWIW: I have been preoccupied so haven't had a great deal of use with recent builds but since Web Workflow was released I've seen issues similar to those reported here. In my case they seem to come and go, a few times I came close to working up a repeatable recipe only for the problem to go away. I eventually wrote it off to WiFi strength issues as my office is on the edge of WiFi coverage for most of the micro controller boards. I've thrown 10.x on the two continually running WiFi boards and...

manic glacierBOT
manic glacierBOT
#

Thanks for submitting a pull request to CircuitPython! Remove these instructions before submitting.

See https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github for detailed instructions.

  • Consider whether to submit this PR against main or against (if it exists) the branch for the current stable release or an upcoming minor release. The branch will be named i.j.x, for example, 9.2.x. Bug fixes and minor enhancements can be submitted against the stable release b...
cobalt grail
blissful pollen
cobalt grail
#

I did not, as I can't find any instructions on what to run?

blissful pollen
#

just make translations I think (or to that effect if you type make on its own it gives you the commands). Do that in the root directory.

cobalt grail
#
make: *** No rule to make target `translations'.  Stop.```
blissful pollen
#

After that locale/circuitpython.pot should be updated and is required.

#

I'm not sure if you have the local pre-commit scripts running, they can flag this as well (for the future)

cobalt grail
#

Lol. Found a bug in the Makefile as well, I don't have a "python" command on my system.

#

Ok, all checks have passed. Thanks!

manic glacierBOT
manic glacierBOT
mortal kernel
#

@slender iron I couldn't resist, so I spent a few minutes on the RISC-V crash with #10325. It was quick and easy to fix, so I submitted a PR. I also verified that with #10325, #10301 is no longer needed, so I reverted it in the same PR #10337.

manic glacierBOT
manic glacierBOT
tiny peak
#

@lone axle In case it's relevant to what you're doing with Fruit Jam input devices, I've started working on a USB configuration and HID report descriptor parser as part of a gamepad tester project. The configuration descriptor parser works pretty well, but I'm just getting started on the HID report side. My goal is to be able to distinguish between different types of gamepads, including those that use generic HID with different report structures (e.g. old style DInput vs. new Switch compatible). Link: https://github.com/samblenny/fruit-jam-gamepad-tester

manic glacierBOT
manic glacierBOT
#

Thinking that a configuration difference between boards might be involved, I rebuilt CP 9.0.3 for the Metro ESP32S2 with these additional lines from unexpectedmaker_feathers2_neo added to its mpconfigboard.mk:

CIRCUITPY_BITBANG_NEOPIXEL = 1

# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel

I was still unable to reproduce the original issue. It's possible that the WiFi signal, as described by @RetiredWizard, may have bee...

lone axle
jaunty juniper
#

@mortal kernel heh I was running tests and adding to my post when you posted on the issue. Running alpha 4 on the Feather ESP32 S2, with this code:

import board
import time
import neopixel
import adafruit_dotstar

pixel = neopixel.NeoPixel(board.NEOPIXEL, 90)
pidots = adafruit_dotstar.DotStar(board.SCK, board.MISO, 90)

while True:
    for color in [0x200020, 0x002020]:
        pixel.fill(color)
        pidots.fill(color)
        time.sleep(0.5)

The board crashes within 15 seconds (never mind the ctrl-C issue I mention)
(wifi.radio.ap_info.rssi is -41)

tiny peak
# lone axle That looks quite nifty! thank you for sharing.

I plan to do more on parsing the HID report descriptors, but not sure how deep into it I'll go. The descriptors supposedly describe the different possible HID reports and how the button bitfields, hat-switch controls (dpad), joystick analog values, etc. are laid out. From what I read, it sounds like the cheaper DInput protocol gamepads are really quirky with non-standard device-specific reports. Probably a lot easier to deal with Switch compatible controllers that are still HID but more standardized. (XInput is non-HID but it's also pretty easy to deal with)

mortal kernel
#

@jaunty juniper It looks like we're seeing different behavior. The current tip of main has trouble due to #10325. If that's what you're testing with, that may be why your testing is failing while mine isn't.

lone axle
jaunty juniper
#

I restested with alpha 4 right now, I don't have a Metro to see if it's different

mortal kernel
jaunty juniper
#

esptool could give the ROM version ?

mortal kernel
#

Good suggestion, let me see...

jaunty juniper
#

I can get that

Detecting chip type... ESP32-S2
Chip is ESP32-S2FNR2 (revision v0.0)

#

(I did chip_id, which also results in Warning: ESP32-S2 has no Chip ID. Reading MAC instead.)

mortal kernel
#

I'm having usb/serial problems. I'll need to reboot, back in a minute or two.

#

I'm back. esptool.py does not want to connect to the Metro. Maybe I need to somehow exit tinyuf2?

jaunty juniper
#

you need ROM bootloader mode

#

(the holding boot while resetting mode)

mortal kernel
#

Thanks, that worked. Seeing the same info you were:

#
Warning: ESP32-S2 has no Chip ID. Reading MAC instead.
MAC: 60:55:f9:da:bb:f4
jaunty juniper
#

what about the revision ?

mortal kernel
#

v0.0

jaunty juniper
#

well ๐Ÿคท

mortal kernel
#

The chip's tin says it's ESP32-S2-WROVER, but no ECO number visible.

jaunty juniper
#

I wonder if the wifi network could affect it ๐Ÿคท

#

note that beyond the test code, I originally encountered the issue because I have a QTPY piloting 2 LED strips while running a server with a web page to change the animations and colors, and opening Discotool Manager would be enough to make it freeze. Discotool Manager scans MDNS for CP boards and does 3 or 4 requests to get the board info (to which I added some delays to try to mitigate the issue). So I would put the board in safe mode so I could edit the code without moving the board.
I now switched to a QTPY S3, since the issue is harder to reproduce there.

jaunty juniper
#

I also tried erasing the feather and putting the alpha 4 bin directly with the same result

#

(situations where 2 people see different results have been related to the version/presence of the bootloader in the past even if it seemed to make no sense)

mortal kernel
#

I've tried tinyuf2 0.18.2, 0.21.0, and 0.30.0, all with the same results.

manic glacierBOT
manic glacierBOT
#

CircuitPython version and board name

Adafruit CircuitPython 9.2.6 on 2025-03-23; Raspberry Pi Pico 2 W with rp2350a

Code/REPL

import os
import wifi
import adafruit_connection_manager
import adafruit_requests

ssid = os.getenv("WIFI_SSID")
wifikey = os.getenv("WIFI_PASSWORD")

wifi.radio.connect(ssid, wifikey)
pool = adafruit_connection_manager.get_radio_socketpool(wifi.radio)
ssl_context = adafruit_connection_manager.get_radio_ssl_context(wifi.radio)

with o...
steady mulch
#

Hi, I've got a situation on Pico W where

lone axle
#

<@&356864093652516868> The weekly meeting is set to occur here on discord at the usual time 11am US Pacific / 2pm US Eastern here on discord. That is about 1 hour and 15 minutes from now. Feel free to fill in your status updates and hug reports to the document ahead of time if you like https://docs.google.com/document/d/1SeffJXPObzSCRRPUpaYE8T5QIz8m8bc2UfMYpH9Rop0/edit?tab=t.0 we look forward to hearing from everyone.

manic glacierBOT
turbid radish
#

Thanks Tim!

mortal kernel
#

Thank you, Tim.

uncut nexus
#

Thanks, foamyguy, for all that talking ๐Ÿ™‚

lone axle
#

Thanks everyone, have a great week!

lone axle
#

Here is the notes document for next Mondayโ€™s CircuitPython Weekly Meeting. It is at the normal time of 11am Pacific / 2pm US Eastern here on Discord. Add your hug reports and status updates to the document before the meeting. If you are unable to attend but would still like to contribute, feel free to add your notes and weโ€™ll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/19MYKsKO3_4BN_Xw3mpOf1Tfc3urLAIPSewX-TWIro2E/edit?usp=sharing

manic glacierBOT
#

The issue persists Pico 2 W on 9.2.7 (same result and error as 9.2.6).

On 10.0.0-alpha.4 on the Pico 2 W, requests.get() times out. I added some print statements to check how far it got (as it looked like it wouldn't return at all), but eventually it exits with ETIMEOUT. Revised test code (with print statements), as follows, along with 10.0.0-alpha.4 output:

import os
import wifi
import adafruit_connection_manager
import adafruit_requests

ssid = os.getenv("WIFI_SSID")
wifikey = os....
slender iron
#

I think I'll do an alpha.5 after #10332 is in

orchid basinBOT
#

Previous numbers were from S3 direct logs. Cloud front requests from S3 on cache miss only. The user agent was also cloud front instead of the actual requester. Cloud front logs have the actual user agent and we use it to filter out bot requests.

So, the old numbers (relatively) under counted popular boards and over counted boards that only bots cared about. These numbers should be truer to reality.

slender iron
#

#10332 passed CI for whenever someone is ready to review

manic glacierBOT
manic glacierBOT
#

It was discussed at the time when we implemented circuitpython_setboard but iirc we thought that it could lead to confusion and be more complex to support.

Having it be a comprehensive list means that it could list many pins and other properties that are not valid or relevant to the device the user has plugged in. Seeing things like board.I2C() and board.SPI() listed for raspberry Pi Pico and Pico2 could be very confusing for somehow who does not realize those device do not actually h...

manic glacierBOT
mortal kernel
#

@danh When you have time, I'd like you to help me sanity check a couple things re: RP2 IRQs. No hurry.

manic glacierBOT
tulip sleet
mortal kernel
#

I've been working out how to implement #9992. First off, after reading through the SDK implementation of external interrupts, I think we want to use DMA_IRQ_0 on core 0 and DMA_IRQ_1 on core 1. The reason we need to keep these separated is that the SDK only supports a shared vector table, so the only way I can see to ensure routing these IRQs to the proper core is by splitting them up like this.

#

(This is essentially what we're doing now)

tulip sleet
#

looking at some stuff...

tulip sleet
#

So my impression from the above is that when you set up the handler, it's for the core that the setup routine was running on, and gets routed properly. I don't think you need to keep them separate. The underlying handlers take care of this, it appears?

#

though I see this: https://forums.raspberrypi.com/viewtopic.php?t=336613#p2014763

  1. Currently by default (we will add a #define option to address this) the same exception vector table is shared between the two cores. This is not usually a problem, as most people don't want to enable the same IRQ on both cores....
  2. ... the problem with enabling the IRQ on both cores, is that both cores will keep taking the IRQ until one of them has serviced it....
  3. ... this is one of the reasons for having multiple DMA IRQs, such that you can divvy the DMAs IRQs up between core1) Currently by default (we will add a #define option to address this) the same exception vector table is shared between the two cores. This is not usually a problem, as most people don't want to enable the same IRQ on both cores....
  4. ... the problem with enabling the IRQ on both cores, is that both cores will keep taking the IRQ until one of them has serviced it....
  5. ... this is one of the reasons for having multiple DMA IRQs, such that you can divvy the DMAs IRQs up between cores.s.
mortal kernel
#

Your final reference agrees with my reading of the SDK code.

tulip sleet
#

so you don't have to use separate irq's, since you can find out the current core, and only handle the IRQ if it's for you.

#

whether it's better I'm not sure. If a core gets an irq and says, that's not for me, it doesn't take a lot of time.

#

are we currently doing DMA on more than one core?

mortal kernel
#

OK, but then would there be any utility to having the IRQ fire on both cores?

tulip sleet
mortal kernel
#

Yes, RP2040 DVI, for example.

mortal kernel
#

Not really, since each core has its own NVIC, it can mask off IRQ sources its not interested in.

tulip sleet
#

well, I think my idea when writing the issue is that we could use a shared irq, and use the shared-irq API to take care of that. RIght now they are separate irq's because the code was written without considering that that API ws available. Basically I didn't want statically-allocated irq's, because we run out really fast

#

so maybe that's in line with your conclusion,

mortal kernel
#

Agree we need to share. Just saying that we share IRQ_0 on core 0 and IRQ_1 on core 1. And that gets us to the next interesting topic, sharing an IRQ.

tulip sleet
#

there is something in one of those links about "the SDK doesn't do x yet", but I can't find it now again (I was looking at dozens of forum threads)

tulip sleet
#

but now the sharing issue...

mortal kernel
#

Right. What it doesn't do is support a vector table per core.

#

First off, I see something in the current implementation that looks like a problem.

tulip sleet
#

I guess it could demux that in software, but it doesn't do that yet? Is that what they were saying?

mortal kernel
#

Less than that, it's completely, totally not there. If the control to turn it on is set, it will throw a pre-processor error.

mortal kernel
#

Back to the current implementations. In isr_dma0, when a DMA_IRQ_0 comes in, it scans playing_audio, background_pio_read, and background_pio_write for DMA channels in use and calls everyone it finds indicating the DMA transfer is complete.

#

The called code doesn't check whether the DMA has actually finished. When concurrent DMA is in use, this could cause problems, like weird audio artifacts.

tulip sleet
#

yeah, so I thought using the shared_handler mechanism would help us without having to put that code explicitly in the fixed handler (and we don't want to use the fixed handler)

mortal kernel
#

Well, the problem there is that at the IRQ level, it's completely non-specific as to which of several sources might be causing the IRQ to get fired.

tulip sleet
#

there isn't a register with the DMA control block address or whatever?

#

eh, so what good is a shared handler? I thought it could demux it

#

shared DMA IRQ use has to be serialized then, can't be parallel?

mortal kernel
#

There is, but the NVIC knows nothing about it. When a shared IRQ comes in, all of the sharing clients get invoked in priority order. It's just a raw xxx(void) call, no context.

mortal kernel
#

So, what I'm proposing is a layered approach.

#

We register a shared handler in audio_dma and another in rp2pio. Each of those handlers looks at the interrupt status bits in the DMA block along with whether an object is attached to its table (playing_audio, for example) and then calls when it needs to signal completion of a DMA transfer.

tulip sleet
#

this makes sense, and I was just reading this post, which I think proposes exactly what you said https://forums.raspberrypi.com/viewtopic.php?p=2123216

Yes, that's the definition of shared handler - with shared handlers, all of the handlers will get called for each IRQ (from both sources), and the handlers have to check if it's "for them" and return quickly if not.

The overhead of doing this is small (a few instructions (the beginning of each handler should be to read a status register, check if the relevant bit is set, and if not return without doing anything), so for many purposes it's acceptable.

#

the whole thread is about exactly this

mortal kernel
#

Yes, that's the essence of what I'm proposing. Clearly I'm not the first getting here.

tulip sleet
#

great minds think alike

mortal kernel
#

I have been to this particular rodeo a few times.

tulip sleet
#

so yes, doing shared irq's forces such a mechanism. The current code was done at a time when there was so little being done with DMA IRQ's that only two seemed necessary. (Some lack of foresight, i guess).

The SDK API could help with this but doesn't, I guess.

#

I appreciate your careful thinking on this, and your experience

mortal kernel
#

Going back to what we're currently doing, sorting out which DMA channel(s) is causing the IRQ could clear up some intermittent weirdness.

tulip sleet
#

definitely, at the very least it would be clearer when one thing was starving out another. the whole "which is worse: flickering RGB matrix or glitchy audio" is kind of a use case thing, and I'm not sure we want to provide a choice on that right now (ideally the glitches are actually due to the kind of bug you suggested rather than just lack of memory bandwidth), but we don't know now, I think

mortal kernel
#

I'm going to go ahead. I appreciate your help and expertise vetting this. Thank you!

tulip sleet
#

not sure if I have expertise, but I always think "someone else has already had this problem, there must be a discussion" of it

manic glacierBOT
orchid basinBOT
ionic elk
#

is there a safe way to use load when debugging espressif with gdb? Seems to put my boards in a reset loop if I use it. I assume that has something to do with the bootloader.

manic glacierBOT
#

The new automount feature of sdcardio added in https://github.com/adafruit/circuitpython/pull/10129 is great for devices which host an SD card connector directly on board. This feature is currently unavailable on devices which have an SD card added on via a breakout or some other daughter board. In my case, I am using a Raspberry Pi Pico 2W with a Camera PiCowbell.

I suggest that new constants be added to settings.toml to define the pins, SPI device, and other properties used by this fea...

tulip sleet
ionic elk
#

My esptool offset is 0x0 so I'm not sure what extra info I'd be including. It's the equivalent .elf file for the bin yes

#

Something might be borked with my whole setup though. GDB is giving me blatantly wrong information on variable values and it won't respect stepping over functions with n. My feeling is it probably originates from my pre-compiled microros library, which has been the source of a lot of frustration since it only seems to compile on linux and has limited information on how to compile with debug symbols.

mortal kernel
# ionic elk My esptool offset is 0x0 so I'm not sure what extra info I'd be including. It's ...

I've never had any luck with gdb load with Espressif parts. Breakpoints and stepping are also problematic. This doc has some useful tips: https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-guides/jtag-debugging/tips-and-quirks.html. When your shell is in the ESP-IDF virtual environment (source esp-idf/export.sh) the toolchain that matches the version of ESP-IDF you're using, including gdb, is in your path. I've found that's the best one to use.

ionic elk
#

I am using the esp-idf gdb, particularly since it's xtensa-specific

mortal kernel
ionic elk
#

I'm on the esp32s3. I could maybe just use advice on my overall strategic approach. I've been trying to pin down why rclc_support_init in my microros port is returning a failure, which has been challenging since microros does not support human-readable logging. I pre-compile the library on ubuntu 24.04 and have gotten it to include debug symbols, but since GDB is not providing accurate variable prints and isn't stepping as expected, it hasn't been helpful in identifying the cause of the failure.

manic glacierBOT
ionic elk
#

Really what I need to do is be able to break on various lines within the execution of the rclc init process and bisect to see where the error return value originates. But that's hard to do when I can't get it to correctly print what the return value actually is.

#

It's possible this originates from how I'm building the esp microros component, which is all in CMAKE and it's not entirely clear to me how they're enabling the debug flags in the first place.

mortal kernel
#

The compiler flags you want are: -Og and -ggdb. The first is similar to -O2, but turns off some optimizations that can be confusing when debugging with gdb. The second turns on symbols, so it sounds like you're already doing that.

#

It sounds like the .elf file you're loading into gdb might not match the binary you're flashing into the 'S3.

#

I'm not familiar with microros, so I'm not going to be able to help much there.

#

Generally speaking, when all else fails I resort to an LED on a GPIO pin.

ionic elk
#

If the library is compiled with different debug flags than the final build, would that mess it up? The library has its own debug information

#

I'd typically go with a hardware logic analyzer kind of approach too but the precompiled nature of the esp-idf components is throwing me off.

#

I think I need to understand better how cmake deals with debug flags.

mortal kernel
#

I don't think mixing flags for the various components of your final link would break debugging. I've been doing that with CircuitPython builds with no issues. Are you loading the .elf from the final link into gdb?

ionic elk
#

yes, it's xtensa-esp32s2-elf-gdb build-espressif_esp32s3_devkitc_1_n8r2_ros/firmware.elf

#

I'm seeing some sources say that register storage of variables can throw off what GDB returns?

mortal kernel
#

Since this isn't CircuitPython development specific, we should move to another channel. #help-with-projects maybe?

ionic elk
#

It's for integration of an espressif component into circuitpython's build system, and Scott suggested I post here. That said, we can put it on pause until I research cmake's handling of debug flags more thoroughly. It's weird that I can't even grep for ggdb in the component, despite it building with the symbols I need.

#

That said, if it sounds like I'm doing anything terribly misguided and ought to take a different high level approach, I'd be open to feedback

#

I've been banging my head on this final init failure for over a month now

mortal kernel
#

It can be a bear when the debugging tools require debugging. Factor in a multi-layered build process, and it can be a head-banger deluxe.

manic glacierBOT
slender iron
#

@ionic elk my suggestion would be to get a setup where you can build microros in circuitpython directly. That way you can add ESP_LOG statements into its code. I exclusively debug ESPs with ESP_LOG

manic glacierBOT
slender iron
tulip sleet
slender iron
#

jp is testing it now for me

#

I think thach did test within CP though too

manic glacierBOT
#

nordic doesn't really deep sleep: it light-sleeps with low current draw. There was some logic that tried to be careful about determining the micrcontroller.cpu.reset_reason in such cases, but it didn't work when micrcontroller.reset() was called. This clears some saved state to make sure the reset reason is correct.

Found when helping @bradanlane with a BLE HID problem.

Tested on a CPB that this fix works, using the following test program, which was cobbled from @bradanlane's test...

slender iron
#

ok, draft alpha.5 notes are saved

manic glacierBOT
#

For the ESP32-C6, only pins GPIO0 through GPIO7 may be used for alarms. In low-power states, these are the only pins whose pads are powered. CircuitPython should be throwing a value error on the attempt to use GPIO20 as an alarm. From section 12.4 of "ESP32-C6 Technical Resource Manual":

Eight LP GPIO pins (GPIO0 โˆผ GPIO7): These pins are always powered up and are not affected by any low-power modes, which makes them suitable for working as wake-up sources when the chip is in low-power mode...

ionic elk
#

Especially since I'm hearing that GDB has some unreliability with espressif

#

maybe I should have started out with the stm32 microros port huh ๐Ÿ˜ฎโ€๐Ÿ’จ

manic glacierBOT
#

CircuitPython version and board name

Circuitpython:
Version 9.2.7

Hardware:
1) Adafruit ESP32-S3 feather (4MB FLASH / 2MB PSRAM) + Adafruit Ethernet Featherwing
2) RP2040 PicoW + Adafruit Ethernet Featherwing (with minor modifications to the example code to address the differences between this platform and the ESP32-S3 platform)

Code/REPL

# Experiment with ethernet/ssl/tls and Circuitpython.
# Hardware: Adafruit ESP32-S3 4MB FLASH/2MB PSRAM + Adafruit Ether...
manic glacierBOT
tulip sleet
#

@slender iron I was thinking about how to stage the TinyUF2 no-OTA update, and also how to write it up in the guides. it seems to me that we could update the TinyUF2 version presented for S2/S3 in the web installer, etc., because I don't see any S2 or S3 board that has dualbank turned on. So 9.2.7 would work with the new no-OTA partition scheme. Originally I was wondering the installer shouldchoose the version of TinyUF2 based on CircuitPython, but I think that's not necessary. This also simplifies the guide updates. I wonder if I am missing something.

slender iron
tulip sleet
#

8MB boards, and boards with CIRCUITPY_LEGACY_4MB_FLASH_LAYOUT set.

slender iron
tulip sleet
#

but none of the latter are S2, S3

#

I did test 9.2.7 is OK on various S3 boards, and that dualbank is off

slender iron
#

it looks like CIRCUITPY_LEGACY_4MB_FLASH_LAYOUT only ever applied to non-UF2 builds

tulip sleet
#

yeah, I thought it was for S2 or S3, but apparently not. That's good. So it's a change for those plain ESP32 and C3 and C6 boards, but not terrible. I already made that change in my comprehensive draft PR. I have a Feather S3 only branch I could make into a PR too.

slender iron
manic glacierBOT
tulip sleet
#

@slender iron do you want to do the alpha release or do you want me to do it tomw or whenever? Which unmerged PR's do you want to be in it?

slender iron
#

you can do it. I'm off the clock

#

(trying the linker modification stuff via llm agent)

manic glacierBOT
slender iron
#

should only need to add a note about the usb changes to the release notes

#

and your nordic fix

tulip sleet
#

I am also doing a PR for the Feather S3 4/2 board to use the new layout. WIll assign Limor to review it. We discussed in the meeting. That doesn't have to be in this release, but might make it easier to test.

manic glacierBOT
#
  • This is an interim PR to test the changes needed for #9533 and #10229 for a single board, the Adafruit Feather S3 4MB flash / 2MB PSRAM board.

Currently TinyUF2 Espressif-based boards most have two code partitions: ota_0 and ota_1, which are the same size, and were originally mean to allow over-the-air upgrades. However, the limited size made it not possible to enable BLE on S3 boards, and limited other features on S2 and S3 boards.

This PR combines the ota_0 and ota_1 partiti...

atomic summit
#

Hey folks - on my test jigs, I have a script that allows me to specify a CP version, and have it wget all of that version of CP for each of my boards, backup the old firmware, and set the downloaded firmware as the current one for flashing and testing...

Been working great for years - but now I'm blocked out from grabbing them...

HTTP request sent, awaiting response... 403 Forbidden
2025-05-15 15:18:04 ERROR 403: Forbidden.

Any idea what has changed? I've also tried curl but I also get forbidden.

Fill command for each board is:

wget \
  --user-agent="Mozilla/5.0 (X11; Linux x86_64)" \
  --header="Referer: https://circuitpython.org/board/unexpectedmaker_tinys3/" \
  https://downloads.circuitpython.org/bin/unexpectedmaker_tinys3/en_US/adafruit-circuitpython-unexpectedmaker_tinys3-en_US-9.2.7.uf2
--2025-05-15 15:18:04--  https://downloads.circuitpython.org/bin/unexpectedmaker_tinys3/en_US/adafruit-circuitpython-unexpectedmaker_tinys3-en_US-9.2.7.uf2
Resolving downloads.circuitpython.org (downloads.circuitpython.org)... 18.65.11.76, 18.65.11.190, 18.65.11.59, ...
Connecting to downloads.circuitpython.org (downloads.circuitpython.org)|18.65.11.76|:443... connected.
HTTP request sent, awaiting response... 403 Forbidden
2025-05-15 15:18:04 ERROR 403: Forbidden.
#

I run this script on up to 5 different jigs and it allows me to keep all CP versions current, but also switch to older ones easily for testing/comparisons.

manic glacierBOT
manic glacierBOT
#

CircuitPython version and board name

Adafruit CircuitPython 10.0.0-alpha.4-19-gd52beb2e33-dirty on 2025-05-14; Adafruit Circuit Playground Bluefruit with nRF52840

Also tested with 9.2.7

Code/REPL

# Bluefruit Bluetooth Presentation Remote
# Bradรกn Lane STUDIO (c) 2025
# based on SPDX-FileCopyrightText
# 2020 John Park for Adafruit Industries
# License: MIT

"""
This example acts as a BLE HID keyboard to be used as a presentation remote
uses the Adafruit Circ...
tulip sleet
atomic summit
tulip sleet
#

I just reported it, thanks for this. I thought I had some local problem. It's probably a CloudFront misconfiguration.

tulip sleet
# atomic summit Ahh, ok, I'm glad it's not just a decision to block wget/curl access, thanks for...

I got it to work for now by altering the user agent, e.g.

wget --user-agent "Mozilla/5.0 (X11; Linux i686; rv:10.0) Gecko/20100101 Firefox/10.0" https://downloads.circuitpython.org/bin/unexpectedmaker_tinys3/en_US/adafruit-circuitpython-unexpectedmaker_tinys3-en_US-9.2.7.uf2
--2025-05-15 07:50:42-- https://downloads.circuitpython.org/bin/unexpectedmaker_tinys3/en_US/adafruit-circuitpython-unexpectedmaker_tinys3-en_US-9.2.7.uf2
#

just some random Firefox user agent I plucked off an explanatory webpage

jaunty juniper
#

I don't see mention of audiopwmio for ESP32 in the issues, has there been any discussion on that ?

tulip sleet
tulip sleet
jaunty juniper
#

yeah the Qualia S3 doesn't have easy audio out

tulip sleet
manic glacierBOT
cobalt grail
#

I noticed that my translations are added using my "@bergdahl" Github account, which is my business account. Not sure how this works, but I want it to be my "@cobalt grail" account instead as I am nearing retirement and will eventually close down the business.
How do I change this?

tulip sleet
manic glacierBOT
manic glacierBOT
#

You must use native sdcardio for it to work I believe. What is your code.py?

Here's a stripped down example from my program which is just a basic sd card mounting procedure with card detect:

import board, digitalio, os, storage, time
from busio import SPI
from sdcardio import SDCard

led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT

sd_detect = digitalio.DigitalInOut(board.GP15)
sd_detect.direction = digitalio.Direction.INPUT
sd_detect.pull...
cobalt grail
manic glacierBOT
tulip sleet
jaunty juniper
#

maybe it's the email associated with the commits ? I just noticed weblate used my weblate email which is why it didn't credit me with my github account when I used it. I can change it to my githtub email
(you might need to add your other github email to your weblate account with the "Verify new email address")

tulip sleet
cobalt grail
#

Will try to change the email adress.

lone sandalBOT
manic glacierBOT
#
[adafruit/circuitpython] New tag created: 10.0.0-alpha.5
atomic summit
steady mulch
#

Pico W, trying to change from building 9 to 8, changed the compiler to 10-2020-q4-major, did make fetch-port-submodules, rebuilt mpy-cross, did make clean, and I'm getting this error when trying to build. Have I missed something?

In file included from /home/xubuntu/circuitpython/ports/raspberrypi/sdk/tools/pioasm/pio_disassembler.cpp:10:
/home/xubuntu/circuitpython/ports/raspberrypi/sdk/tools/pioasm/pio_disassembler.h:16:25: error: โ€˜uint16_tโ€™ was not declared in this scope
tulip sleet
#

what is your goal for doing an 8.x.x build, if I may ask?

steady mulch
tulip sleet
#

also do git status to see if any submodules are skewed

steady mulch
#

There are various untracked libs

tulip sleet
#

I have this alias for getting the submodules at the right commits:

alias gitsubupdate='git submodule sync --quiet --recursive && git submodule update --init --filter=blob:none'
steady mulch
#

Ah I thought the other command was supposed to do it

tulip sleet
#

and if you see that various submodules are "modified', you need to inside them and run that as well

#

no, it just fetches, it doesn't correct. You could do make remove-all-submodules at the top level and then do the fetch-port-submodules. Another thing to do is just to clone your fork again, with a different name, so you have a fresh start. Then you don't lose context on main or whateger.

tulip sleet
#

https://blog.adafruit.com/2025/05/15/circuitpython-10-0-0-alpha-5-released/
Highlights:

  • Add stability fixes for Espressif port builds.
  • Add fixes for direct connecting USB devices to PIO USB host.
  • Improve accuracy of time.sleep() and similar functions.
  • Add MixerVoice.end().
  • Change partition layout for Adafruit Feather ESP32-S3 4MB Flash 2MB PSRAM board, allowing BLE and other features to be enabled.
steady mulch
tulip sleet
#

it updates everything. You don't need it if you did make fetch-port-submodules on a fresh clone

steady mulch
#

Looked like it was fetching modules I didn't have yet but maybe I was mistaken

tulip sleet
#

not sure; I think it should not fetch modules that were not inited at all

steady mulch
#

remove-all-submodules and fetch-port-submodules hasn't helped

tulip sleet
#

you mean you still have the uint16_t error?

steady mulch
#

Yes

tulip sleet
#

is this on a fresh clone?

steady mulch
#

No, might have to do that then

tulip sleet
#

i am just trying it on a fresh clone myself

tulip sleet
steady mulch
#

arm-none-eabi-gcc (GNU Arm Embedded Toolchain 10-2020-q4-major) 10.2.1 20201103 (release)

tulip sleet
#

an easy fix seems to be to go into ports/raspberrypi/sdk and there do git checkout 1.5.1.

#

at that point I was able to use gcc 13.2 and the picow build built

#

no wrong, still some issue

orchid basinBOT
tulip sleet
steady mulch
#

I think it's the one the instructions told me to download for circuitpython 8

tulip sleet
#

so it's using a newer /usr/bin/gcc to build pioasm, and that's what's complaining (it's not something in the circuitpython tree). so you might need to roll back the system-installed gcc as well to get it to compile. This is going to be a rathole.

#

CircuitPython 8.2.7 was released Oct 2023, so it was being build on Ubuntu 22.04 more or less, using whatever the standard /usr/bin/gcc was at the time.

#

pico-sdk 1.5.1 helps a lot, but there are further issues about warnings, which I wasn't able to work around

#

could maybe disable the warnings-as-errors flag; I didn't try that

steady mulch
#

Hmm I've got an older VM I can try

mortal kernel
#

@danh This may or may not be a bug, what do you think? Unless deep sleep is entered from code.py or friends in run_code_py deep sleep never happens. For example, executing alarm_io1.py from the REPL by typing import alarm_io1 will not enter deep sleep.

#

alarm_io1.py:

import board
import alarm
import microcontroller
import digitalio

LED_PIN = microcontroller.pin.GPIO15
led = digitalio.DigitalInOut(LED_PIN)
led.direction = digitalio.Direction.OUTPUT
led.value = True

pin_alarm = alarm.pin.PinAlarm(pin=board.IO1, value=False, pull=False)
alarm.exit_and_deep_sleep_until_alarms(pin_alarm)
tulip sleet
#

[hit tab after typing @danh otherwise it does not complete into a username]

mortal kernel
#

From my reading of the code, the reason that code run from REPL doesn't enter deep sleep is that both pyexec_friendly_repl and pyexec_raw_repl don't break out of their process loops on a PYEXEC_DEEP_SLEEP.

tulip sleet
steady mulch
tulip sleet
mortal kernel
tulip sleet
#

i don't remember why I did the exception thing to initiate deep sleep, but it was the easiest at the time

mortal kernel
#

It makes sense. Kind of like NLR. Trying to pass a result up from down deep can be, well, problematic.

steady mulch
tulip sleet
#

what does git log -1 say?

steady mulch
#

It does indeed say the latter

tulip sleet
#

did you checkout 8.2.7 or whatever you wanted to start with? are you going to do a bisect?

steady mulch
#

I did check it out but at some point it seems to have decided to checkout main again for some reason

tulip sleet
#

is it because you started working in a new clone?

steady mulch
#

It was after that. But I'm also pretty sure this board has v8 mpy on it and it's working

#

Confirmed it does

tulip sleet
#

it should build what is checked out -- there's nothing that would alter the current commit

#

make sure you do a clean build

steady mulch
#
git checkout dd9ecc81
cd ../..
make remove-all-submodules
cd ports/raspberrypi/
make fetch-port-submodules
cd ../..
make -C mpy-cross
cd ports/raspberrypi/
make clean BOARD=raspberry_pi_pico_w
make BOARD=raspberry_pi_pico_w
#

And after this, main is checked out, and I have a build that says it's main but appears to be a v8

tulip sleet
#

i don't understand what you mean by "And after this, main is checked out"

steady mulch
#

Git status now says it's on main, rather than detached head at dd9ecc81

tulip sleet
#

I don't see that problem locally

steady mulch
#

My VM just crashed, probably something wrong with it

tulip sleet
#

i just did the above except with an atmel-samd build (to avoid the build issues you saw), and didn't see any change in the checkout.

#

off to bed, good night!

steady mulch
#

Good night

tulip sleet
#

good night and good luck

steady mulch
#

I thought disk might be full again but it's not

steady mulch
#

Worked that time

stuck elbow
manic glacierBOT
#

The provided example is attempting deep sleep on GPIO20, a pin that is not supported for that purpose on the ESP32-C6. Attempting to use an unsupported pin on an Adafruit Feather ESP32C6 correctly results in a Value Error like this code.py:

import board
import alarm
import microcontroller
import digitalio
import time

LED_PIN = microcontroller.pin.GPIO15
led = digitalio.DigitalInOut(LED_PIN)
led.direction = digitalio.Direction.OUTPUT
led.value = True

time.sleep(10)
pin_alarm = ...
manic glacierBOT
manic glacierBOT
#

Further down under exit_and_deep_sleep_until_alarms is:

If CircuitPython is connected to a host computer via USB or BLE the first time a deep sleep is requested, the connection will be maintained and the system will not go into deep sleep.

(But TIL:

If CircuitPython goes into a true deep sleep, and USB or BLE is reconnected, the next deep sleep will still be a true deep sleep. You must do a hard reset or power-cycle to exit a true deep sleep loop.

)

manic glacierBOT
#
import board
import time
import alarm
import time
import digitalio
import microcontroller

LED_PIN = microcontroller.pin.GPIO15
led = digitalio.DigitalInOut(LED_PIN)
m_d8 = microcontroller.pin.GPIO19
m_d9 = microcontroller.pin.GPIO20
led.direction = digitalio.Direction.OUTPUT

for i in range(5):
    led.value = False  # turn on LED
    time.sleep(1)
    led.value = True  # turn off LED
    time.sleep(1)

pin_alarmD2 = alarm.pin.PinAlarm(pin=board.D2, value=False, pull=True) # doesn't work...
manic glacierBOT
#

The builds that are failing have OTA partitions, so after #10346 I think they might all fit.

The size difference on the Feather S3 build is about 50kB larger for the full bundle. This is not terrible and maybe we should just use the full cert bundle, instead of trying to tune which certificates are most common. https://github.com/adafruit/nina-fw/pull/70 (in progress), which revamps NINA-FW extensively, also uses the full bundle and it fits.

ionic elk
#

@slender iron have you had bad experiences with gdb on espressif in the past that influenced you to do only ESP_LOGI debugging? GDB is continuing to be really weird and if this is just inherent to the platform I guess I'll pivot faster than I thought

manic glacierBOT
#

CircuitPython version and board name

Adafruit CircuitPython 10.0.0-alpha.5 on 2025-05-15; Adafruit QT Py RP2040 with rp2040
Adafruit CircuitPython 10.0.0-alpha.5 on 2025-05-15; Raspberry Pi Pico W with rp2040

Code/REPL

print("Hello World!")

Behavior

On reset, REPL prints:

Running in safe mode! Not running saved code.

You are in safe mode because:
CircuitPython core code crashed hard. Whoops!
Hard fault: memory access or instruction error.
Plea...
ionic elk
#

Has anyone gotten GDB with JTAG to actually work on an esp32s3, for that matter?

#

Seems like I must be missing a crucial memory configuration or build flag step

mortal kernel
slender iron
#

since it doesn't stop the world

lone sandalBOT
manic glacierBOT
mortal kernel
#

@tulip sleet Would you like me to have a look at #10355. I can get SWD debug up pretty quick.

tulip sleet
mortal kernel
#

I'll give it shot for an hour or so.

tulip sleet
#

it's an alpha, expectations are not high ๐Ÿ™‚

mortal kernel
#

True that.๐Ÿ˜‰

manic glacierBOT
mortal kernel
#

@tulip sleet No progress on #10355. This was the first time I've tried SWD with debugprobe on the new Mac. A cornucopia of tool failures ensued!

tulip sleet
#

i have never gotten debugging to work on RP2040, but I haven't tried very hard

#

I am working with a user here: https://forums.adafruit.com/viewtopic.php?t=218315, which may be of interest. CPX board. time accuracy is better with 10.0.0-alpha.5, apparently, but there is a MemoryError: might be due to the new collect/no_collect logic. Would you expect an improvement of whole-second sleeps on atmel-samd after your PR?

mortal kernel
#

Which port is that?

tulip sleet
#

CPX is atmel-samd

mortal kernel
#

+/- ~30us

tulip sleet
#

do you think that before your subticks fix whole-second sleeps were noticeably inaccurate? The CPX does not have a crystal. When used with a battery it is going to use its internal RC oscillator for timing. (If USB is connected it can do clock recovery from USB timing)

#

2 minutes in an hour that the user saw seems like a lot

#

i'm not sure they did the testing consistently with USB not connected; have to ask that

mortal kernel
#

It depends on the interrupt rate, but if it's high enough the cumulative error could have been pretty large.

tulip sleet
#

they are using countio to count button pushes, but I think that's the only interrupt. and the neopixel usage is low

#

countio is going to interrupt just on pin transitions

mortal kernel
#

There's usually once a tick clock interrupt.

#

(At least I think there is?)

tulip sleet
#

i think so, but there was also something we did to avoid that, and I can't remember now...

mortal kernel
#

On the RP2040, I suspect it's the factored assembly code for register unloads.

#

That's the only change from 4->5 that's plausible.

#

I'll take a look to see if anything jumps out.

#

On the CPX timing, the issue is that it's improved but you're not sure why?

#

@tulip sleet On M0, the register unload area is too small by 8 bytes. I'm going to patch and test now.

tulip sleet
#

since CPX et al are also M0, same issue, maybe?

mortal kernel
mortal kernel
# tulip sleet since CPX et al are also M0, same issue, maybe?

The unload area size is definitely a bug. With that patched, I'm still falling into safe mode. I've disassembled the code, and it's building with the M0 version of the unload, and it's identical to code it replaces, so there's something else going on. It's not the __ARM_ARCH_ISA_THUMB, I've verified that is correct and the usage is correct. When I've tested, I've been careful to fully nuke the flash between tests. I'll be AWK for the next few hours for my walking club.

mortal kernel
#

@tulip sleet The Mac is causing difficulties that are messing with debug. I've switched back to Linux, and the register unload size patch does correct the safe mode issue. I'm out the door, I'll PR it when I get back.

manic glacierBOT
mortal kernel
#

@tulip sleet I'm giving up on MacOS as development platform for now. There appears to be a new issue that silently prevents uf2 flashing from completing, resulting in an incomplete or corrupted image.

tulip sleet
#

@mortal kernel is that on 15.5? This sounds like a recurrence of an old problem ๐Ÿ˜ฆ

mortal kernel
tulip sleet
#

I'll test your PR on some boards after it complete and make an alpha.6

#

silently is worse; the old bug threw an error

mortal kernel
#

I've spent the last few weeks struggling with my new M4 Mini. It's just not up to being my main development ax. Unfortunately for me, I'm past the return window. It's back to Linux for me.

tulip sleet
#

but you can run Linux on it under parallels?

mortal kernel
tulip sleet
#

but that may not be the non-work workflow you want

mortal kernel
#

I had high hopes for a one system solution.

tulip sleet
#

our CI did not do a good job deciding which builds to do. I'll build some manually and test.

mortal kernel
#

I don't think there's any potential downside to the patch, but the upside is huge. There won't be any code size change. There's no chance of build breakage. After a couple of smoke tests, I'd say ship it!

tulip sleet
#

we're going out for a bit; I'll look more later. If I add print("foo") before the #Create PIN line, it works. If I add it before vcm =0 instead, it does not ??
Nevertheless 10355 works fine on rp2040, so I think I will move ahead

mortal kernel
tulip sleet
#

thank you for the saturday fix!

#

I haven't tried an earlier alpha yet. It works ok with 9.2.7

#

ok, back in an hour or two

mortal kernel
#

My pleasure. See you Monday.

ionic elk
#

If this doesn't work, I may bail on espressif and see if I can implement STM32 or something to salvage the project

tulip sleet
orchid basinBOT
manic glacierBOT
#

We are getting a lot of Failed to restore: Cache service responded with 422 warnings during GitHub Actions builds. This is apparently due to carlosperate/arm-none-eabi-gcc-action not updating its use of actions/cache yet to actions/cache@v4. @carlosperate is planning to fix this: https://github.com/carlosperate/arm-none-eabi-gcc-action/issues/64#issuecomment-2829760318

lone sandalBOT
manic glacierBOT
#

Created a full debug build that does not overflow dram0_0_seg by setting:

CONFIG_ESP_WIFI_IRAM_OPT=n

and that does not overflow flash by using a Makefile extract from #10265 to remove the second OTA partition from flash. Built with DEBUG=1.

Got an assert from socket_select_task:

assert failed: socket_select_task Socket.c:95 (num_triggered > 0)

Backtrace: 0x4002c921:0x3ffd6360 0x40035741:0x3ffd6380 0x40039f65:0x3ffd63a0 0x400b6c02:0x3ffd64c0 0x4003625e:0x3ffd6500
tulip sleet
onyx hinge
manic glacierBOT
#

From https://forums.adafruit.com/viewtopic.php?t=218315

A program mentioned in the thread above happens to trigger a MemoryError in recent 10.0.0 alpha builds. Very slight changes cause the error to go away. This seems like it might be some kind of edge case related to the recent gc changes.

Program is below. This is running on a CPX with 10.0.0-alpha.6. As is, it causes:

MemoryError: memory allocation failed, allocating 1472 bytes

If the line

### a=1 ### uncommenting this c...
thorny jay
#

I am just booting for the first time a Metro RP2350 (10.0.0.-alpha.6) and while contemplating my DVI output, I notice that the blinking cursor is missing.
Maybe it has always been missing, from all the REPL I have seen on an LCD, but there on a big screen where I can compare the serial REPL and the DVI output... it feel like it is kind of missing.
This could become an issue for an editor, I guess I need to watch some streaming when FoamyGuy was working on the FruitJam, and see if there is one or not, or if this issue has already been discussed.

manic glacierBOT
#

CircuitPython version and board name

Teensy 4.0; all versions of CircuitPython

Code/REPL

pass

Behavior

Hello,

I am trying to my Teensy 4.0 with USB libraries and I noticed that none of the USB libraries are supported for the Teensy 4.0, however, they are supported for the Teensy 4.1. As far as I am aware the Teensy 4.0 and Teensy 4.1 have the same USB functionality. Would it be possible to add the USB libraries to the Teensy 4.0?

Descriptio...

manic glacierBOT
#

Can you describe exactly which libraries are missing? I tried the below in the REPL on a Teensy 4.0 and seems like they're all there:

Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPython 9.2.7 on 2025-04-01; Teensy 4.0 with IMXRT1062DVJ6A
>>> import usb_hid, usb_cdc, usb_midi
>>> 

If you're talking about the libraries adafruit_hid or adafruit_midi, those you copy yourself or use circup to install. The official library bundles live at https://circuit...

tiny peak
#

In case folks might be interested in more test code to trigger USB bugs on Fruit Jam, I just posted a guide for the gamepad tester thing I've been working on. It will pretty frequently trigger a glitch where unplugged devices only raise usb.core.USBTimeoutError (which is indistinguishable from normal timeouts) rather than a usb.core.USBError (useful for detecting unplugs, but doesn't always happen). https://adafruit-playground.com/u/SamBlenny/pages/fruit-jam-gamepad-tester

#

I haven't found a way to reliably reproduce the glitch, but it seems to be more likely with a Full-Speed device than with a Low-Speed device.

#

Feels like some kind of a race condition thing. Perhaps involving the interaction of display updates and USB polling.

#

It's also possible to induce more glitchy behavior by doing display updates that take longer. For example, re-drawing 5-lines of text in a bitmap_label every time an analog joystick axis changes its value is a pretty good way to bog things down and trigger strange behaviors. Drawing a one line hexdump in a bitmap_label is generally fine though.

tiny peak
#

oh, also, if I try to flash new code while a USB device is connected and actively being polled for input, that will pretty frequently lock up the board (host computer is M1 mini with Sequoia). As long as I unplug the USB device before flashing new code, it's usually fine. The behavior I've mentioned happens on 10.0.0-alpha.6.

lone axle
# thorny jay I am just booting for the first time a Metro RP2350 (10.0.0.-alpha.6) and while...

As far as I am aware there never has been a visible cursor in the REPL that can be seen on the microcontroller display. If you are connected to the REPL from the PC it can show a cursor on the PC side depending on what software you use for connecting. But on the microcontroller display there is no visible cursor, when you type the characters just start appearing.

For the editor app that I've been working on there is a visible editor that is currently handled "manually" in the editor app code. It keeps track of cursor location, and uses the tilepalettemapper module to inverse the colors of the location the cursor is at. It's solid inverted instead of blinking.

Inside of terminalio.Terminal in the core technically there is some cursor position variables and logic IIRC, but it's internal only and not currently "hooked up" to do anything. It is on my radar to eventually try to implement proper visible cursor handling inside of terminalio.Terminal, which if it were to exist could allow the REPL to show a visible cursor on the MCU display.

lone axle
thorny jay
# lone axle As far as I am aware there never has been a visible cursor in the REPL that can ...

It is just a "nice to have" feature.
Maybe if you can add that (optional) to terminalio.Terminal, then you could avoid specific code in the editor.
There might be a lot of good reason to not always enable the cursor... like e-Ink screen, or if one use terminalio to display stuff, but there is no user input expected.
It is just my first feelting when testing my "Franken Fruit Jam", there was something missing, and it took me a few seconds to figure out why that terminal was uncanny.

mortal kernel
#

@tulip sleet I did some noodling around with the OTA partition change on an Adafruit Metro ESP32-S2 device. Using tinyuf2 0.31: On a fully erased device, I can install tinyuf2 and then load my new CP firmware.uf2 using the newly installed tinyuf2, but it will not boot CP on a subsequent reset. I can flash the same firmware.uf2 with esptool.py and that boots successfully on reset.

tulip sleet
mortal kernel
#

Yes, I mistyped. .bin.

thorny jay
manic glacierBOT
#

The "Upload stubs to PyPi" step when doing a new release is now complaining about a version issue. See this build:
https://github.com/adafruit/circuitpython/actions/runs/15088880323/job/42414925264#step:13:34

Maybe could be due to #10312, but I'm not at all sure.

Run # python -m build was run by 'make stubs'
  # python -m build was run by 'make stubs'
  [ -z "$TWINE_USERNAME" ] || echo "Uploading dev release to PyPi"
  [ -z "$TWINE_USERNAME" ] || twine upload circuitpython-stubs/dist/*
 ...
mortal kernel
tulip sleet
#

@lone axle will you be making a backup recording?

#

if not I will start one

lone axle
tulip sleet
#

thanks!!

lone axle
turbid radish
tulip sleet
#

btw, diagram below was generated by Claude Code, given the .csv files as input, and tweaked with several further requests (please center this, please make this taller so it's legible, etc.)

lone axle
#

Thanks for hosting Bob. Have a great week everyone!

tulip sleet
#

Thank you, Bob!

orchid basinBOT
#

A few users have confused the original Feather HUZZAH32 and Fthe eather ESP32 V2. Add some cautionary text. The latest user with this issue also asked that the name include "HUZZA32" (which is on the bottom of the board).

I also added some alert boxes already in the two guides.

I deliberately took the link to the original HUZZAH32 Feather out of the description of the V2. I also removed some obsolete "it's early" language from the original description.

lone axle
#

Here is the notes document for next Mondayโ€™s CircuitPython Weekly Meeting. It is at the normal time of 11am Pacific / 2pm US Eastern here on Discord. Add your hug reports and status updates to the document before the meeting. If you are unable to attend but would still like to contribute, feel free to add your notes and weโ€™ll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/11ZlI_p6ie_kbPV95FjjcOoiUu-Hy6aI8pnxyoOxxGXk/edit?usp=sharing

manic glacierBOT
manic glacierBOT
#

Since #10040 (9.2.5 and after) this happens with the i2ctarget example:

code starting...
9.789: INFO - read request to address '0x40'
Traceback (most recent call last):
  File "code.py", line 38, in 
AttributeError: 'I2CTargetRequest' object has no attribute 'deinit'

This is apparently because the new default __exit__ requires the presence of deinit in the object's dictionary, and I2CTargetRequest doesn't have one. It has a close() though, (which incidentally doesn't have ...

manic glacierBOT
#

CircuitPython version and board name

Adafruit CircuitPython 10.0.0-alpha.6 on 2025-05-17; Adafruit Metro RP2350 with rp2350b

Code/REPL

= TilePaletteMapper(shader_palette, 2, SCREEN_WIDTH, SCREEN_HEIGHT)

from https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/54ab01feadf4206fa5ec1b5f22c6e2f646e2c0bc/Metro/Metro_RP2350_CircuitPython_Matrix/code.py#L67

(works fine in 9.x and fail in 10.0.0-alpha6)

Behavior

  File "code.py", line 67...
#

That is true that the API changed and the old code is no longer working. Sorry, I have updated versions for the new API but have not PR'd them yet.

Under the new API you need to create the TilePalletteMapper first with no height or width, and then assign it to the TileGrid as a pixel_shader like normal. When that asignment happens the TilePaletteMapper gets the appropriate height and width from the TileGrid automatically now.

Here is the updated code section for the initialization of tpm a...

manic glacierBOT
#

I think this is the following omission: if you look in the dict_table for, say I2CTarget, you'll see:

    { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&i2ctarget_i2c_target_deinit_obj) },
    { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&i2ctarget_i2c_target_deinit_obj) },

The presence of the __del__ entry is true for all objects with a finaliser, which should be true for enter/exit objects. In i2ctarget_i2c_target_make_new(), the object created is created with `mp_obj_malloc_wit...

spice gate
#

I wrote a RISC-V emulator in pure Python (https://github.com/ccattuto/riscv-python) and ported CircuitPython to it (https://github.com/ccattuto/riscv-python/tree/main/advanced/circuitpython). It features an emulated UART backed by a pseudo-terminal on the host, an emulated block device backed by a filesystem image, interrupt-driven timer and tick support, CTRL+C support for tight Python loops, autoreload, and a little more.

GitHub

RISC-V Emulator in pure Python (RV32I, machine mode, Newlib support, memory-mapped IO) - ccattuto/riscv-python

manic glacierBOT
#

@eightycc: since you self-assigned this, please have a look at my PR. It works fine on all of my systems. And in contrast to the discussion, it does not "change semantics" (except for a single academic border case which is not relevant for any practical real-life scenario).

It does change the documentation bringing it in line with reality. The docs currently claims things that the code does not stand up to and never will ("It does not shut down WiFi, BLE, or other communications, or ongoin...

manic glacierBOT
manic glacierBOT
#

From what I can see, the USB OTG2 pins that could be used on the teensy 4.0 are the two pads on the bottom of the board (that despite their placement are actually not the same as the USB connector. So, it looks like it should be possible to enable USB host via those pins, but I don't know if replicating the configuration from the Teensy 4.1 will work.
Also, I don't want to solder on the bottom pads of my teensy for testing and I don't know if it needs additional components.

I've made a commi...

manic glacierBOT
#

An example of the hangup:

ESP-IDF verbose debug tracing with additional log messages:

D (124289) socket_select_task: select
D (124443) socket_select_task: num_triggered: 1
D (124443) socket_select_task: waking CP
D (124443) supervisor_web_workflow_background: workflow_background
D (124445) supervisor_web_workflow_background: workflow_background calls socketpool_socket_accept
D (124454) socket: socketpool_socket_accept
D (124459) socket: register_open_socket fd: 57
D (124464) socket: CP p...
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I'm curious - beyond searching the Adafruit and community bundles, is there any standard(-ish) process to search for method usage in a wider body of existing CircuitPython code? Obviously it needs to be something a bit more intelligent than simply grep close ..., but there are a variety of options for finding references to python method use that (try to and usually succeed at least partially) filter on the type, i.e. find invocations of close() on an I2CTargetRequest. But I'm n...

manic glacierBOT
manic glacierBOT
#
  • Fixes #10362.

Removes visible I2CTargetRequest.close() method. Adds I2CTargetRequest.deinit(). Does close() and deinit() in I2CTargetRequest.__exit__(). Makes I2CTargetRequest have a finalizer: __del__() calls deinit().

I tried testing with the more extensive example in the I2CTarget documentation, which tries to write and then read a value to an I2C register. It did not work, but I could not get that example to work with 8.2.9 or 9.2.3 either.

@Neradoc if you or ...

solar whale
#

@tulip sleet FYI -- just followed the guide to update the bootloader on an esp32s3 feather with 4Mbyte Flash 2Mbyte PSRAM and loaded 10.0.0 -alpha6 -- My espcamera (OV5640) test code runs well! I no longer have to do a "custom build"

#

I had one "glitch" updating the boot loader -- After erasing the flash, My Chromium Browser would not reconnect to the board -- I rebooted the computer (Raspberry Pi 5) and everything went well after that -- loading the combined.bin and then the .uf2.

solar whale
#

Also -- I went through the process on a second board and it all worked fine. No glitch.

tulip sleet
solar whale
#

Yes - I unplugged it several times -- finally resorted to reboot.

tulip sleet
#

did you also try shutting down and restarting Chromium?

#

sometimes I see the boards switch ports from ACM0 to ACM1, etc.

solar whale
#

yes -- that too -- appeared to be something odd with the port detection.

#

No problems at all on the second board

#

This wa using the WEB Flasher

tulip sleet
#

I can add a warning about that.

Right now the main procedure is to load the "Factory Reset + UF2" .bin. We plan to update those .bin's, we think.

#

So the somewhat tortured instructions now of "use these instructions", but use this other ".bin" will not be soe tortured

solar whale
#

It was clear to me what to do.

tulip sleet
#

good ๐Ÿ™‚

solar whale
#

This is only implmented for the 4Mbyte/2MBPSRAM board now, correct? not for the reverse TFT.

tulip sleet
#

We wanted to do just one board, to vet the procedure, before doing a big bang. We really appreciate your testing.

solar whale
#

No problem -- just curious -- It's nice to have this one available -- without needing the custom build any more.

manic glacierBOT
manic glacierBOT
#

The following test code triggers the issue in 9.2.7 and works as expected with this PR.

Controller code (running on a tiny2350)

import busio
import board
import random
import time
from adafruit_bus_device.i2c_device import I2CDevice

i2c = busio.I2C(board.SCL, board.SDA)
device = I2CDevice(i2c, 0x40)
buffer = bytearray(1)

while True:
    try:
        with device:
            device.readinto(buffer)
            print(f"device responded with #{buffer[0]:02X}")
       ...
#

Could we have the call to common_hal_i2ctarget_i2c_target_close in deinit ? It is possible (though ill advised) to not use the context manager and call deinit manually, in which case I believe close wouldn't be called.
And then we could remove the custom __exit__.

I considered that, but wasn't sure if there was another use case. But I think not. I'll do that, yes, thanks.

manic glacierBOT
manic glacierBOT
#

I found my Teensy 4.0 with a USB jack soldered to it and tested this out. Yep, works!

It works with a USB hub too. But if you unplug the hub and then go back to the device plugged in directly, it's not recognized. Is this a known bug? I've not played with USB host stuff recently in CirPy.

Anyway, here's what my Teensy 4.0 USB host wiring from six years ago looks like:

Image

Also, since `usb.core.Devi...

#

Fixes #10360 by enabling USB host on the USB host pads.
I did not enable it by default in board.c, maybe it should be like it is on the teensy 4.1 ?

Thanks @todbot for testing.

Test code:

import time, board
import usb, usb_host

port = usb_host.Port(board.USB_HOST_DP, board.USB_HOST_DM)

while True:
    for device in usb.core.find(find_all=True):
        print(device.product, device.manufacturer, hex(device.idProduct), hex(device.idVendor), time.monotonic())
    time.sl...
jaunty juniper
#

@tulip sleet I wonder if we should have the i2ctarget fix in a 9.2.8 ?

tulip sleet
manic glacierBOT
#

You can change the GPIO voltage by setting bits in the UICR (search for that in the datasheet, etc.). Is everything 1.8V? I am not sure if there is brownout detection setup in the bootloader, in https://github.com/adafruit/Adafruit_nRF52_Bootloader. Look to see.

https://devzone.nordicsemi.com/ is the Nordic forum area, which may have answers for other questions you may have.

Yes, everything 1.8V. You mean the REGOUT0? It seems only work in high voltage mode, but my circuit is not ...

manic glacierBOT
manic glacierBOT
#

Just chiming in to say I think I'm having the same issue. I've designed a custom circuitpy board based around a raytac module but it uses the a split 1.8/3.3v rail where the nrf52480 and nvm run off 1.8v (VDD and VDDH are tied so it's in 'normal' mode). My status led's post circuit python uf2 upload seem to be working and suggest it's running, but I get no usb activity so I can't load programs onto it. The adafruit UF2 bootloader works without issue as well while things are in bootloader mo...

manic glacierBOT
manic glacierBOT
#

Then it sounds like you really have to do nothing except change the device ID for the different flash. The datasheets look pretty much identical except for the Device ID and the voltages (see screenshow below). The flash chips are described in https://github.com/adafruit/nvm.toml, which is a submodule. You could just edit that locally to add the new chip in the winbond directory, or fork it, or submit a PR to add the chip.

In ports/nordic/supervisor/port.c, in port_init(), the brownou...

worn egret
#

are there any circuit python based firmware or kernels for a digital synthesyzer

#

?

#

how much processing power do i need for that ?

fiery pecan
mortal kernel
#

RP2350 Deep Sleep

manic glacierBOT
#

Unclear why the wrong version was used. Compare this with https://github.com/adafruit/circuitpython/actions/runs/14828564282.

I cannot tell where stubs-10.0.0a7.dev0+gd88fe10647.d20250517-py3-none-any comes from.
Here is a zip of two cleaned-up logs for comparison.

alpha-logs.zip

##[group]Run ./.github/actions/upload_aws
with:
source: circuitpython-stubs/dist/*.tar.gz
destination: stubs/circuitpython-stubs-10.0.0-al...
manic glacierBOT
#

Then it sounds like you really have to do nothing except change the device ID for the different flash. The datasheets look pretty much identical except for the Device ID and the voltages (see screenshow below). The flash chips are described in https://github.com/adafruit/nvm.toml, which is a submodule. You could just edit that locally to add the new chip in the winbond directory, or fork it, or submit a PR to add the chip. And you need to change the flash chip name in mpconfigboard.mk.
...

#

Just chiming in to say I think I'm having the same issue. I've designed a custom circuitpy board based around a raytac module but it uses the a split 1.8/3.3v rail where the nrf52480 and nvm run off 1.8v (VDD and VDDH are tied so it's in 'normal' mode). My status led's post circuit python uf2 upload seem to be working and suggest it's running, but I get no usb activity so I can't load programs onto it. The adafruit UF2 bootloader works without issue as well while things are in bootloader mo...

manic glacierBOT
#

CircuitPython version and board name

Adafruit CircuitPython 9.2.7 on 2025-04-01; Raspberry Pi Pico W with rp2040

Code/REPL

import array
import time

import board
import digitalio
import displayio
import rp2pio
import busio
import i2cdisplaybus
import terminalio
import adafruit_displayio_ssd1306
import adafruit_pioasm
from adafruit_display_text.bitmap_label import Label

program = adafruit_pioasm.assemble("""
    pull
    mov osr ~ osr
    set pins 1 [8]
    ...
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

@dmcomm Thanks for the issue!

With #8700, compute_fifo_depth() returns the PIO FIFO depth in 32-bit words, but _transfer() treats it as bytes. This causes _transfer() to select DMA for the transfer for some transfer sizes smaller than the PIO FIFO size. While this isn't a breaking bug, it does shed some light on the results you're seeing.

At the conclusion of _transfer(), a while loop waits for the PIO's stall bit to go off before concluding the operation: https://github.com/adafrui...

manic glacierBOT
digital shoreBOT
#
adafruit
Owner

.adafruit

Members

38,977

Roles

37

Category Channels

8

Text Channels

65

Voice Channels

7

Threads

10

Boost Count

19 Boosts (Tier 3)

manic glacierBOT
manic glacierBOT
#

When I reported this over four years ago, my usage was exactly as described, no BLE or anything else involved -- all six lines of code are there, excepting the text of my print statement which was redacted due to boo-hoo.

The reality is that Pythons aren't a particularly good choice for semi-realtime use due to internals of its design that can make it a pretty bad fit for tight-timing applications. Just as it took about 30 years for Un*x OSes to be usable for "kind of" realtime applications...

#

Then this bug was submitted it took seconds to reproduce. But a LOT has likely changed since then, so all old bets are probably off as to how far this tick has burrowed down.

I think this still might be a bug, so I'm reopening it. @slaxor505: which version of CircuitPython were you using? How often does it appear? If you could re-test with 10.0.0-alpha.6, which has some time stuff rewritten, that would be great, but if it takes a potentially long time for t...

manic glacierBOT
#

I can repro in 9.2.7, though it took some time (I pressed keys in the terminal to unblock in this case)

   455.072 -  27.475098 <--
   514.549 -  13.310059 <--

In alpha 6 I get a different pattern with smaller waits, but still an issue.

Adafruit CircuitPython 10.0.0-alpha.6 on 2025-05-17; Adafruit CLUE nRF52840 Express with nRF52840

    14.740 -   0.485001 <--
    30.436 -   0.829002 <--
    36.513 -   0.766998 <--
    47.760 -   0.552002 <--
    79.700 -   0.687012 <--

Off...

manic glacierBOT
#

I think this still might be a bug, so I'm reopening it. @slaxor505: which version of CircuitPython were you using? How often does it appear? If you could re-test with 10.0.0-alpha.6, which has some time stuff rewritten, that would be great, but if it takes a potentially long time for the extra-long sleep to appear, it might be hard to test.

I tried on both 9.2.1 and 9.2.6 - the same behaviour. Bug appears randomly - sometimes I can use the device for an hour...

manic glacierBOT
#

What I get on windows (10)

    21.964 -   0.227997 <--
    34.988 -   0.264008 <--
    45.696 -   0.618988 <--
    47.172 -   0.142990 <--
    71.120 -   0.332001 <--
    88.958 -   0.605011 <--
   103.320 -   0.342010 <--
   109.096 -   0.602020 <--

What I get on a Pi 3:

    20.142 -   0.973999 <--
    72.701 -   0.415009 <--
    76.340 -   0.936005 <--
    80.227 -   1.208984 <--
   136.793 -   0.801025 <--

That's different from the patterns I had with 9.x.
_Also, to be sure...

manic glacierBOT
#

Hi,
I'm a fan of Helium LoRaWAN IoT, Python and SenseCAP T1000-A GPS tracker.
This device is closed-source and ready for endusers and applications.

This tracker exists as OpenSource variant T1000-E with similar hardware and sensors,
projects like Meshtastic support it already:

It would be cool to have T1000-E as board in official CircuitPython releases!
(MCU is nRF52840, it has only the internal 1MByte flash storage)

=>As experiment I compiled CircuitPython with T1000-E support (it...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

CircuitPython version and board name

CircuitPython 9.2.7, rpi pico rp2040

Code/REPL

class RGBLockStatus(LockStatus):
    def set_lock_leds(self):
        if self.get_caps_lock():
            print("Never print this when use a USB HUB")

    def after_hid_send(self, sandbox):
        super().after_hid_send(sandbox)
        print("always None when use a USB HUB: ", self.hid.get_last_received_report())
        if self.report_updated:
            self.set_lock_l...
manic glacierBOT
manic glacierBOT
#

The stm32f411ve_discovery board build does not come up. I tested older versions: 5.0.0 work, but 6.3.0 and later do not. I tried making a few changes in the build to match the blackpill build more, but did not succeed.

See https://forums.adafruit.com/viewtopic.php?t=218381 for some background.

The board cannot be powered just from the OTG (micro-USB) port. Voltage must be supplied at the mini-USB ST-LINK port. Maybe there's a way to jumper around this.

To load CircuitPython, you can use ...

dusty axle
#

Hi there, I was hoping for some help with my Pyportal, I can't seem to get the sdcard to mount, it's stating that it can't set the block size to 512, (OSError: can't set 512 block size). I've tried both the adafruit_sdcard and sdcardio imports, using the latest circuitpython-9 release at the moment (tried the latest 10 alpha release with the same result previously)

#

wrong channel sorry

manic glacierBOT
#

There have been a lot of USB improvements between CircuitPython 9.2.7 and 10.0.0-alpha.6. Does anything change if you try your code with CircuitPython 10.0.0-alpha.6?

If you want to try writing a minimal program to reproduce the problem in CircuitPython (without KMK), these guides talk about how to use the usb_hid library:

tulip sleet
#

Here is the notes document for next Tuesday's CircuitPython Weekly Meeting. It is delayed one day due to a US holiday. It is at the normal time of 11am Pacific / 2pm US Eastern here on Discord. Add your hug reports and status updates to the document before the meeting. If you are unable to attend but would still like to contribute, feel free to add your notes and weโ€™ll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/11ZlI_p6ie_kbPV95FjjcOoiUu-Hy6aI8pnxyoOxxGXk/edit?usp=sharing

manic glacierBOT
manic glacierBOT
manic glacierBOT
cerulean acorn
#

Hi! I am trying to change the hardcoded resolution on the Pi Zero 2W. I've followed https://learn.adafruit.com/building-circuitpython/linux and gotten to the Run Your Build! step, but I'm getting errors without having made any changes.

../../shared-module/lvfontio/OnDiskFont.c: In function 'get_char_id':
../../shared-module/lvfontio/OnDiskFont.c:327:21: error: a label can only be part of a statement and a declaration is not a statement
  327 |                     uint16_t idx = codepoint - self->cmap_ranges[i].range_start;
      |                     ^~~~~~~~
../../shared-module/lvfontio/OnDiskFont.c:328:21: error: expected expression before 'uint16_t'
  328 |                     uint16_t glyph_id = self->cmap_ranges[i].glyph_offset + idx;
      |                     ^~~~~~~~
../../shared-module/lvfontio/OnDiskFont.c:329:28: error: 'glyph_id' undeclared (first use in this function)
  329 |                     return glyph_id;
      |                            ^~~~~~~~
../../shared-module/lvfontio/OnDiskFont.c:329:28: note: each undeclared identifier is reported only once for each function it appears in
../../shared-module/lvfontio/OnDiskFont.c:327:30: error: unused variable 'idx' [-Werror=unused-variable]
  327 |                     uint16_t idx = codepoint - self->cmap_ranges[i].range_start;
      |                              ^~~
../../shared-module/lvfontio/OnDiskFont.c:327:30: error: this statement may fall through [-Werror=implicit-fallthrough=]
../../shared-module/lvfontio/OnDiskFont.c:331:17: note: here
  331 |                 case 3: { // Direct mapping - need to look up in the table
      |                 ^~~~
cc1: all warnings being treated as errors
-e See https://learn.adafruit.com/building-circuitpython; Adafruit Discord #circuitpython-dev
make: *** [../../py/mkrules.mk:93: build-raspberrypi_zero2w/shared-module/lvfontio/OnDiskFont.o] Error 1

I assume the main branch should build, so -- any idea what I'm missing?

stuck elbow
cerulean acorn
#

I just cloned it and tried to get through the instructions

stuck elbow
cerulean acorn
stuck elbow
cerulean acorn
#

no worries, thank you

jaunty juniper
#

yeah that sounds like a difference in version of gcc ๐Ÿค”

cerulean acorn
#

Is there a different branch I should be using for the broadcom make?

#

I just want to change the resolution so it's not 640x480 ๐Ÿ˜ญ

#

Can I just make a GitHub Action to do the build? I assume that's how the final versions get made?

jaunty juniper
#

it (the CI) seems to use 13.3.rel1 like other ports ?
arm-gnu-toolchain-13.3.rel1-x86_64-aarch64-none-elf.tar.xz

jaunty juniper
cerulean acorn
#

I'll try that first and then go back and try the more recent toolchain if that doesn't work

jaunty juniper
#

hmmmm

#

oh I see the version and the link are wrong, but later in the text mentions "13.2.Rel1"

#

dunno if Dan is still around, I'll leave feedback on the guide

#

looks like the CI uses a different version for M and A, 13.2 versus 13.3

cerulean acorn
#

well, on the one hand, it looks like the CI completed. on the other hand, did it Upload to S3??

#

0s so hopefully not

#

it makes a disk image, not a uf2

jaunty juniper
#

no it doesn't upload

cerulean acorn
#

phew

jaunty juniper
#

ah the update to 13.3 is from after 10.0.0-alpha

#

it was 10.3 before

cerulean acorn
#

ah okay

jaunty juniper
#

(which is main, you'd have to checkout for stables)

cerulean acorn
#

oh, neat

#

so main is alpha

#

so i should change to 13.3

#

thank you! i will try that

#

hm, that also makes a disk img

#
(.py) kevin@tinkerbell:~/circuitpython/ports/broadcom$ make BOARD=raspberrypi_zero2w
- Verbosity options: any combination of "steps commands rules", as `make V=...` or env var BUILD_VERBOSE
Memory region         Used Size  Region Size  %age Used
        READONLY:      976849 B      1536 KB     62.11%
             RAM:       32104 B      1022 MB      0.00%
aarch64-none-elf-objcopy -O binary build-raspberrypi_zero2w/kernel8.elf build-raspberrypi_zero2w/kernel8.img
cp build-raspberrypi_zero2w/kernel8.img build-raspberrypi_zero2w/firmware.kernel8.img
0+0 records in
0+0 records out
0 bytes copied, 5.1987e-05 s, 0.0 kB/s
mkfs.fat 4.2 (2021-01-31)
  adding: build-raspberrypi_zero2w/circuitpython-disk.img (deflated 95%)
jaunty juniper
#

that seems correct, you put that image on the SD card

#

there's no bootloader for pi zero

#

also don't forget that's not a solid port, it's pretty experimental

cerulean acorn
#

oh right

#

got stuck on following the directions, but we use the raspberry pi imager

cerulean acorn
#

Looks like it worked! Thank you!!

#

Weirdly, it's got a bit of a border that I didn't expect to be there, because it goes full screen normally and that's 1920x1080 i think

cerulean acorn
#

Yeah, 1920x1080

#

Which is what I've got coming from the zero

tulip sleet
#

@jaunty juniper @cerulean acorn Sorry, i misread "Pi Zero 2W" as "Pi Pico 2W", and was specifying the version based on that.

manic glacierBOT
#

I'd like to echo the desire to have this functionality added for wave files! I have a couple of long duration effect files that I would like to start playing at random points to give the illusion that it's a unique effect each time it gets played. (If you start at the beginning of the file each time, it's very easy to hear that the same sample is being played)

It would also be great to still allow for looping even if you 'seek' to a certain point in the file if it's possible?

I've tried loo...

manic glacierBOT
manic glacierBOT
#

I'm surprised that this one affected just one board

../../shared-module/usb_cdc/__init__.c:359:8: error: old-style function definition [-Werror=old-style-definition]
  359 | size_t vendor_ms_os_20_descriptor_length() {

it seems to be a function that may only be built when CIRCUITPY_USB_VENDOR is enabled, which has something to do with webserial. but isn't webserial enabled across multiple boards? Is this a vestige?

manic glacierBOT
#

Having tried a few variants of the boot descriptor from above comments and also just
usb_hid.enable((Device.KEYBOARD,), boot_device=1)
as documented here, I am still not able to get a working boot mode keyboard implementation to work with MacOS cold-boot (FileVault) login.

Can anyone confirm that they have boot-mode keyboard working for MacOS? (specifically a cold-boot, FileVault login).

dusty marten
#

Hi Guys
I need help connecting wm8960 audio codec module to raspberry pi pico using circuit python.
How can I do that? I just need to check that pico is connected successfully to wm8960 codec and able to detect it

#

My main objective is to output audio and input microphone voice when connected to computer using that codec. I can later update the code to c++

#

Thanks in advance!!

stuck elbow
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

The problem persists when using CircuitPython 10.0.0-alpha.6. The simple test code is as follows:

# code.py
# While this code is running, press the Caps Lock key on another keyboard once a second and observe if the output is different.


import time
import usb_hid

while True:
    time.sleep(1)
    print()
    for device in usb_hid.devices:
        x = device.get_last_received_report()
        print(x)

After doing some tests, I found that this problem only occurs when this USB HUB i...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I was able to get the display to work with the following (paired down from what I'd been using originally). I had realized that adafruit_il0373 was the wrong driver when I was trying to display bitmaps and was trying to move off of it when I realized that board.DISPLAY was supposed to provide a pre-configured display object.

import board
import displayio
import fourwire
import adafruit_il0373
import terminalio
from adafruit_display_text import label
from adafruit_display_shape...
manic glacierBOT
#

I tested this on a Badger 2040W device with the code provided:

import board
display = board.DISPLAY
print(display)

And it is always outputting the expected result I believe:

code.py output:
<EPaperDisplay>

I tested on both 9.2.7 and 10.0.0-alpha.6

I think that the display was likely released before this code was run when you got the None results. Note that calling displayio.release_displays() clears the display and it stays gone even across soft resets. So if you run `di...

lone axle
#

<@&356864093652516868> The weekly meeting is today on Tuesday this week due to the US holiday yesterday. We'll be meeting here on discord at the usual time of 11am Pacific / 2pm Eastern which is about 2 hours from now. You can add hug reports and status updates to the notes doc any time: https://docs.google.com/document/d/11ZlI_p6ie_kbPV95FjjcOoiUu-Hy6aI8pnxyoOxxGXk/edit?usp=sharing We look forward to hearing from everyone at the meeting.

manic glacierBOT
#

@FoamyGuy, I just tested with a hard reset (this means unpowering, waiting a while, powering back on, right)? and can confirm that what you said works. The minimal example in my initial message and the more complicated example with the text display both produce the expected

code.py output:
<EPaperDisplay>

after the reset. That whole displayio.release_displays() thing is pretty unexpected behavior. I'd only seen display stuff with that included before.

I wonder if it's worth a ...

manic glacierBOT
#

I don' think calling it out on specific board pages makes sense because the same behavior applies to all devices with a built-in display.

We could perhaps add more explicit info about how it persists across soft resets to the release_displays() docs here: https://docs.circuitpython.org/en/latest/shared-bindings/displayio/index.html#displayio.release_displays.

The display is one of the few things in CircuitPython that behaves this way (persisting beyond soft resets of CircuitPython). So i...

thorny jay
#

I am present, but will stay without mic.

onyx hinge
#

hi folks! Just listening in today!

onyx hinge
mortal kernel
#

Thanks, Tim! Have a great week, everyone!

onyx hinge
#

๐Ÿ‘‹

lone axle
#

Thanks everyone! have a great week.

thorny jay
#

Thanks.

#

I have a question about "network stack"...

I am analysing the minimqtt.loop() for either non-blocking or play nicely with asyncio.
Basically, I read all the related Open and Closed issues for hint.

I try to see what are the "usecase" to test if ever I find a fix.

What are the various IP network stack in CircuitPython:

  1. ESP32SPI (aka AirLift) build on some board like PyPortal or as a module
  2. Espressif (ESP32, ESP32S2, ESP32S3, ...) use native network stack
  3. WizNet (Ethernet) use the specific library
  4. PicoW (onboard wifi chip on PicoW, does not support Pico2W)
  5. Anything else?

I have a doubt about PicoW...
Is that a specific stack?
Does this have a name?
Does it only work on/with the RP2040 or Pico"1"W? (not Pico2W)

#

Wait Anne made a nice Networking learning guide... maybe it has some answer?

mortal kernel
thorny jay
#

Updated IP stack list:

  1. ESP32SPI (aka AirLift) build on some board like PyPortal or as a module
  2. Espressif+LWIP (ESP32, ESP32S2, ESP32S3, ... and Pico W + Pico 2W) use native network stack
  3. WizNet (Ethernet) use the specific library
  4. Anything else?
lone axle
#

Here is the notes document for next Mondayโ€™s CircuitPython Weekly Meeting. It is at the normal time of 11am Pacific / 2pm US Eastern here on Discord. Add your hug reports and status updates to the document before the meeting. If you are unable to attend but would still like to contribute, feel free to add your notes and weโ€™ll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1LkWa9fIlK7wzdpeyxYi2RbaUSO2Dx84AvcDQm40nA7s/edit?usp=sharing

manic glacierBOT
#

A useful procedure to learn how a CircuitPython library implementation works is:

  1. Find the importable names of the relevant libraries by looking at learn guide code examples or other docs. In this case, for playing wave files, what you probably want is
    from audiocore import WaveFile
    combined with an audio output class like
    from audiopwmio import PWMAudioOut as AudioOut
    or
    from audiobusio import I2SOut
    or
    from audioio import AudioOut
    (see [Play...
manic glacierBOT
#

@samblenny Thank you for the tips and very detailed reply!

Quick question that I can't find a definite answer to: what is the difference between a module and binding? I see them reference one another in some of the code, and I saw in an Adafruit article that the binding is described as "the plumbing that connects the implementation to the CircuitPython runtime". Is this effectively saying that the module defines the specific functionality and the related binding is what connect that module c...

manic glacierBOT
#

what is the difference between a module and binding?

Honestly... no clue, but I haven't found the mystery of it to be an obstacle. Mostly, I just write higher level CircuitPython code. When I go spelunking through the core, I'm usually looking for answers to questions that aren't obvious from the documentation, or else trying to understand quirky behaviors.

The build system and code layout grew organically out of the original stuff from the MicroPython fork 8+ years ago. Everything is the...

manic glacierBOT
#

Quick question that I can't find a definite answer to: what is the difference between a module and binding?

The shared-bindings directory contains the code that handles Python-style invocation (e.g. when you call wav = audiocore.WaveFile() you're calling shared-bindings/audiocore/WaveFile.c. The shared-binding is where you do the parsing of Python arguments into C variables an...

manic glacierBOT
mortal kernel
#

@tulip sleet I'm considering putting my attempts to use RP2350 power manager aside for now. While it's theoretically possible to achieve significant power savings with this facility, there are too many problems to solve (including possible SDK bugs and/or bad datasheet info) that I think I can better use my time thoroughly testing and tuning the SLEEP and DORMANT states.I have a specific issue with an interrupt window during transition to DORMANT state that I'd like to go over with you.

#

@tulip sleet I looked at #10380 and think it's a worthy fix. Do we have a policy for taking an upstream PR from Micropython outside of the periodic mass merge?

manic glacierBOT
manic glacierBOT
#
  • Fixes #10348

  • Re-initializes BLE properly after a deep sleep.

  • Copy-edit a comment in main.c.

  • Clean up some enums a bit and add a constant for future TouchAlarm support.

I think maybe eventually the nordic sleep code could be further simplified. The NRF_SLEEP_WAKEUP... and the SLEEPMEM_WAKEUP... enums could probably be merged. In the long run nordic should do real deep sleep, which it does not do now. #5318, etc.

manic glacierBOT
empty salmon
#

@mortal kernel & @tulip sleet - THANKS !!

tulip sleet
tulip sleet
manic glacierBOT
manic glacierBOT
#

By the way this is the current compiled CircuitPython firmware for T1000-E for getting the console output above,
just in case someone wants to test it without "getting hands dirty" setting up development environment.

It's the naked firmware, without libraries for directly reading battery level, light level, gyroscope, acceleration, GPS, BLE beacons, WiFi SSID sniffing, and sending data over LoRa-peer-to-peer or LoRaWAN...

[firmware.zip](https://github.com/user-attachments/files/20493965/fir...

digital shoreBOT
#
adafruit
Owner

.adafruit

Members

38,979

Roles

37

Category Channels

8

Text Channels

65

Voice Channels

7

Threads

11

Boost Count

19 Boosts (Tier 3)

manic glacierBOT
manic glacierBOT
manic glacierBOT
#
[adafruit/circuitpython] New tag created: 9.2.8
orchid basinBOT
manic glacierBOT
#

CircuitPython version and board name

CircuitPython main at 116b29b65789dc8c10802b0f5cbb8b4130b07197 (May 27th, post 10.0 alpha 6) on RP2040.

Code/REPL

Adafruit CircuitPython 10.0.0-alpha.6-9-gaf95f3c82a-dirty on 2025-05-28; denki-oto rin with rp2040
>>> import board, rp2pio, adafruit_pioasm
>>> rx = board.RXPIN0
>>> bits = 8
>>> baudrate = 100000
>>> program = adafruit_pioasm.Program(
...     ".program uart_rx_mini\n"
...     ".fifo auto\n"
...     "start:\n...
tulip sleet
manic glacierBOT
ionic elk
#

I need to deinitialize specific objects within my circuitpython module in order - I can't run the cleanup function safely on "Node" objects until all "Publisher" objects have already been cleaned up. Is the best way to do this with a manual registry of objects and cleaning them up in order in my reset function?

fleet hollow
tulip sleet
#

can gc do the cleanup, or does it have to be manual? If you make gc by making __del__() point to deinit(), then gc would clean up everything, but not in any particular order. The deinit functions could be careful and not try to deinit something that is already deinited if deinit is not idempotent

ionic elk
#

There might be multiple publishers per node so they'd need to keep track of other publishers

#

it's a tree that has to be deconstructed from the outside in

#

I'd have the gc do it if it wasn't random in order. My impression is that if I only ran checks on whether something is "valid" to deinit, it'd leave me with leftover objects that I'd have to manually clean up anyway

tulip sleet
#

do they hold resources?

#

if you broke all links to them so they could be gc'd, then all the unconnected-from-the-outside nodes would have __del__() called on them eventually, once each. If they marked themselves as deinited (often by zeroing out a pointer, etc.), then you could use that as a "deinited?" check

#

this is how our current deinit stuff works

tulip sleet
#

so a publisher would just take care of itself, and not try to deinit its nodes. the unmarked (unreachable) nodes would clean up themselves when their finaliser was called.

ionic elk
# tulip sleet do they hold resources?

microros has its own allocation system and manages objects internally, plus it actually has to send a message to a co-operating agent on a linux machine to remove the nodes/publishers from the ros map

#

so this could be considered more like a hardware deinit than a software one, hence why I was thinking maybe a registry

#

Trying to understand the GC here, so a publisher object of type:

typedef struct {
    mp_obj_base_t base;
    rclcpy_node_obj_t * node;
    rcl_publisher_t rcl_publisher;
} rclcpy_publisher_obj_t;

after circuitpython execution ends, would not be linked anywhere, and could be collected. And then once it's removed, the node would not be reached and could also be collected? So this might happen automatically already?

#

in the correct order, I mean

#

ie all I maybe have to do is add the correct _fini calls (microros destroy functions) to the deinits and maybe it will work out the gate?

tulip sleet
#

You'll need to use mp_obj_alloc_with_finaliser() in the make_new() and have something like this in the dict_table:

    { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&busio_i2c_deinit_obj) },
    { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&busio_i2c_deinit_obj) },

When you call the _fini() routines, then NULL out at least one of those pointers so _deinited() can tell. Also you need to check for deinited everywhere. A good example would be, say, shared-bindings/busio/I2C.c (it sets a pin value to a invalid value, but same idea)

manic glacierBOT
#

Notes on progress

  • Had to rebase to include updates to esp-idf.
  • Fixed issue with initialization, after spending a lot of time messing with debug messages. Had to do with connecting to the host linux agent, which will cause a failure at the first initialization, rather than at the publish stage, where I expected it. The module now works successfully for the first reset of Circuitpython.
  • Agent information has been added to the init API.
  • Currently working on reset support, which is a ...
manic glacierBOT
#

CircuitPython version and board name

Adafruit CircuitPython 9.2.8 on 2025-05-28; Raspberry Pi Pico W with rp2040

Code/REPL

import wifi

wifi.radio.connect(ssid="myssid", password="mypass")

Behavior

main.py output:
Traceback (most recent call last):
  File "main.py", line 3, in 
ConnectionError: Unknown failure 1

The RPi Pico W fails to connect to the WPA3 WLAN network; the handshake also does not appear in the hostapd logs at all (as...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
tulip sleet
ionic elk
#

What's the best practice for handling a failure that happens in a deinit function? Given that they can run during GC

#

Ignore? Have a preprocessor option for non-circuitpython debug message?

manic glacierBOT
tulip sleet
manic glacierBOT
manic glacierBOT
#

CircuitPython version and board name

Waveshare ESP32-S3-Zero 10.0.0-alpha.6 with Windows 11

Code/REPL

Doesn't matter

Behavior

After erasing flash and flashing 10.0.0-alpha.6, no CIRCUITPY drive appears after plugging in.
main.py seems to run, but I can't interact with the board via usb serial.
I see the same behaviour on main at https://github.com/adafruit/circuitpython/commit/002881826a04669abaaa4f2d5220379f786cb159.

Flashing 9.2.8 again and ev...

ionic elk
#

What's the recommended way of writing the RST in the shared-bindings layer? I don't see anything about it in the contribution docs. It's kind of fiddly to do by hand

manic glacierBOT
manic glacierBOT
#

If anyone's interested in trying this out, this test script includes the basic functionality of this PR:

import os, wifi, time
import rclcpy
time.sleep(2) # give USB a bit of time to see first session
print("connecting...")
wifi.radio.connect(ssid=os.getenv('CIRCUITPY_WIFI_SSID'),
                   password=os.getenv('CIRCUITPY_WIFI_PASSWORD'))
print("my IP addr:", wifi.radio.ipv4_address)

rclcpy.init("<IP ADDRESS>", "8888")
mynode = rclcpy.Node("foo")
print(mynode.get_name(...
#

CircuitPython version and board name

adafruit-circuitpython-lilygo_tdongle_s3-en_GB-9.2.5.bin

Code/REPL

The REPL never reaches a point to execute code and the CIRCUITPY drive never appears.

Behavior

After flashing the circuitpython binary, no USB drive appears and the REPL prints the following repeatedly.

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x28 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40378b81
SPIWP:0xee
mode:DIO, ...
manic glacierBOT
#

The waveshare_esp32_s3_zero/mpconfigboard.h
file does not have SPI nor IC2 defined. I suspect this board was built off another board and while the SPI and IC2 definitions were correctly removed from the mpconfigboard.h file, they were accidentally left in the pins.c file. So if you call a board.I2C or board.SPI you get an error even though they show up in 'dir (board)'.

The board does not have any silkscreen for these busses nor are the specifically called out in the schematic. https://ww...

manic glacierBOT
#

Is the garbled video that I'm experiencing related to this issue? I'm finally trying HSTX DVI output on Metro RP2350 and the demo code in the Learn Guide is scrambled like the timing is off on my little test HDMI display (see below).
I notice that microcontroller.cpu.frequency defaults to 150 MHz and if I change it to 125 MHz, then the display can parse the output and the image shows up correctly. A handful of other other CPU...