#circuitpython-dev

1 messages Ā· Page 83 of 1

manic glacierBOT
#

Fixed signed-ness bug in State_Machine.c:use_existing_program() where state_machine was unsigned but tested for less than 0. This was causing wrap-around indexing and other incorrect behavior resulting in a hang-up.

Fixed processor-dependent includes that would cause RP2350 builds not to use third PIO.

Fixed hard-crash when de-initing PIO state machine that did not completely init due to exhaustion of PIO state machines.

Fixes #10157.

onyx hinge
#

unsigned i; return (i>=0) doesn't trigger any kind of warning? Oh, it needs -Wtype-limits, enabled by -Wextra, which we don't.

#
-Werror=type-limits]
  244 |                 if (*sm_out >= 0) {
      |                             ^~
```would have caught it. and there are more interesting diagnostics that stem from adding this flag.
manic glacierBOT
#
[adafruit/circuitpython] New branch created: issue10175
#

This fixes an unlikely problem with the USB host implementation on rp2350 that would not have detected failure to allocate a DMA channel.

Together with #10186 this should give a clean build. As such, this PR includes the current version of #10168 changes. If that PR is rebased, this PR should be rebased as well. The change of interest is https://github.com/adafruit/circuitpython/commit/8097e3dde6645ff1ee63c588fa8949e61153aab5

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I just copied the existing W5100S-EVB-Pico2 then compared with the existing W5500-EVB-Pico. I pulled the MP_QSTR_SDA and MP_QSTR_SCL lines from Commit 40cc500 which maps SDA and SCL to GPIO26 and GPIO27. The GPIO layout for the two boards is identical, so it made sense to keep them the same. I missed the fact that the W5100S-EVB-Pico2 mpconfigboard.h had #define CIRCUITPY_BOARD_I2C_PIN set to GPIO4 and GPIO5. (I also have no idea how the CIRCUITPY_BOARD_I2C defines relate to/dif...

mortal kernel
#

@onyx hinge You've ninja'ed me in the best way possible. Thank you for #10188!

onyx hinge
#

It didn't cross my mind to check whether you'd started on it.

mortal kernel
#

Absolutely no problem at all.

lone axle
#

It seems that the lists at https://circuitpython.org/contributing did not get generated or included in the page properly, all of them are blank. I don't see any failed actions runs that jump out as responsible though.

manic glacierBOT
#

I may have done the same thing with the W5100S-EVB-Pico2 since the W5100s and W5500 EVB Pico boards were the only WIZnet definitions at the time.

I misspoke above, I may have been looking at the PR and not the current code. The original Pico1 Wiznet boards do now have all three Singletons defined in pins.c. The UART and SPI pins are called out in mpconfigboard.h, but there are no pin aliases for UART pins GP0 and GP1..

Maybe we decide what's right for this board, then decide how muc...

manic glacierBOT
#

CIRCUITPY_PYSTACK_SIZE is currently 1536 for all boards except one specialized board. We have seen "pystack exhausted errors on PyPortal projects with this size, such as https://forums.adafruit.com/viewtopic.php?t=217498. I was able to get that NASA image project working by increasing PYSTACK to 2048. Other threads in the forums have increased it to 4k or greater, though they may have not tried to determine the minimum size.

Currently CIRCUITPY_PYSTACK_SIZE can be set in settings.toml,...

jaunty juniper
#

I ran a debug build to try to catch the safe mode that will happen sometimes when running a httpserver, but instead it was freezing with this:

jaunty juniper
#

that's not much though 🤷 maybe because it's "corrupted"

0x420152e9: range_subscr at ports/espressif/../../py/objrange.c:182
 (inlined by) range_subscr at ports/espressif/../../py/objrange.c:162
tulip sleet
#

no, unfortunately. maybe the use of range() could found. It may be being passed a bad object

onyx hinge
manic glacierBOT
#

If we ignore the existing boards and approach this one fresh, it's a Raspberry Pi Pico 2 (The board pinouts/GPIO/peripheral assignments are identical) with a W5500 ethernet chip hardwired to GP16-GP21. I would suggest:

  1. Start with the standard pin config from the existing Pico 2 board.

  2. Add the six pin aliases associated with the hardwired W5500 - currently MOSI, MISO, SCK, W5500_CS, W5500_RST and W5500_INT. I used these names to match the existing WIZnet boards, but w...

manic glacierBOT
mortal kernel
#

How do I go about correcting a pinout pdf?

manic glacierBOT
manic glacierBOT
#

The latest version of the animation is pushed to https://github.com/FoamyGuy/Adafruit_CircuitPython_FruitJam_Animation

This version uses new sprites with a reduced color palette which has lowered the overall RAM usage. This does seem to have had a positive impact, but hasn't resolved it entirely.

With this version the behavior I see now is: With the animation saved as code.py, the device boots up and runs the animation with the slow / choppy graphics for about 1 minute, and then the next l...

lone axle
manic glacierBOT
mortal kernel
#

@danh I'm having some difficulties getting a serial console on the debug uart pins of a Metro ESP32-S3. I've soldered headers to DEBUG_RX/TX, connected them to a Pico running debugprobe (just to get the serial port), built with a modified mpconfigboard.h with these lines added:

#define CIRCUITPY_CONSOLE_UART_RX   &pin_GPIO44
#define CIRCUITPY_CONSOLE_UART_TX   &pin_GPIO43

put the whole thing together with an Adafruit plastic mounting plate #275, and nothing out on uart ā˜¹ļø

mortal kernel
lone axle
#

@mortal kernel which GPIO pin number is incorrect? If we can't get the SVG source file, I'm imagining the next best option at this point is to modify the biggest raster image and then use that as the new one.

#

Also is this the pinout that you are meaning?

tulip sleet
#

from the schematic:

#

I usually use a USB-serial adapter on this, and just connect the TX pin (don't forget ground too)

#

happens with DEBUG=1 builds

mortal kernel
tulip sleet
#

the TX pin is the one closer to the center of the board

mortal kernel
tulip sleet
#

the pin assignment should happen automatically via CONFIG_CONSOLE_UART_DEFAULT et al in sdkconfig when a debug build is enabled

#

i'm doing a debug metro s3 build to check the settings...

mortal kernel
#

I've got both my console and IDF debug output with the mpconfigboard.h changes. Very useful to have both. And right there is the answer to #10004, double memory release.

tulip sleet
mortal kernel
#

BTW, those mounting plates you suggested are THE BOMB.

tulip sleet
#

yes, very convenient for wiring, since the arduino-shaped boards are not breadboardable

mortal kernel
#

A Pico with debugprobe installed makes a fine serial adapter, too.

tulip sleet
#

lots of variations on that

manic glacierBOT
#

common_hal_pulseio_pulseout_deinit() lacks a guard against calls where the pulseio_pulseout_obj_t is already deinit'ed. With that fixed, there's a repeating:

E (518334) rmt: rmt_tx_wait_all_done(595): flush timeout
I (518340) gpio: GPIO[46]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (518448) gpio: GPIO[46]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
E (518448) rmt: rmt_tx_wait_all_done(595): flush timeout
I (518452) gpio: GPIO...
manic glacierBOT
slender iron
#

@tulip sleet need anything from me?

tulip sleet
#

I thought we'd finish the bug triage on the 9.x.x milestone, but doesn't have to be today. I have been doing a little of that myself.

manic glacierBOT
#

It looks like boards with built-in displays don't like pointer references to the display structures, I was unsuccessful getting a pointer/array combination of variables to work so I think I'll either have to look at the way the boards with builtin displays are accessing the structures or consider leaving the compile time portion of the array in place and just access the dynamically allocated array elements for display indexes > (compile time)CIRCUITPY_DISPLAY_LIMIT.

Fun for another n...

#

I suspect this is because the table of attributes for board is in ROM IIRC. That means it can't be updated on the fly. I'm not sure what a better approach is.

I ended up dynamically allocating memory for any displays beyond those defined with the compile time parameter and then used some c macros to select either the compile time or dynamic storage based on the display index.

I'm thinking it probably wouldn't be too difficult to move from this version to one that simply allocated the...

lone axle
lone axle
#

I think it might be an action on the circuitpython-org repo that updates the live page at circuitpython.org/contributing, but I do think it uses the adabot tool to generate it.

mortal kernel
#

@onyx hinge Maybe the changes I made to PSRAM init in my timing tests will get it working overclocked to 264 MHz.

mortal kernel
#

(I was running 240 MHz, but 264 MHz would still be in range without having to adjust the PSRAM timings again)

#

Line 100-128 set the burst wrapping and 155-162 adjust the timing. Otherwise, it's Scott's original code.

manic glacierBOT
mortal kernel
#

@onyx hinge The critical setting is MIN_DESELECT. It needs to work out to be > 50ns to allow time for PSRAM refresh between block bursts.

onyx hinge
#
#ifndef RP2350_PSRAM_MIN_DESELECT_FS
#define RP2350_PSRAM_MIN_DESELECT_FS (50000000)
#endif
```I think it's trying to obey that requirement in the code I have
edgy flax
#

lost my dev environment, and all my notes....so rebuilding on a new box with the goal of getting back to contributing. Are the guides still up to date as far as pylint, black, pre-commit? I'll be using pycharm community so are there any gotcha's to consider in rebuilding? I hear we moved from black to ruff? Thanks in advance - and I'm open to any devs that have helpful suggestions regarding their own dev environments......

onyx hinge
manic glacierBOT
#

Generated an ELF map for the waveshare_esp32_s3_eth at the documented commit hash with DEBUG=1. In all 3 cases, watchdog is firing on one of the CPUs while the other is looping in a non-code area of flash. Ignoring the top backtrace frame (which is garbage), and manually reconstructing, looping CPU is going into the weeds in either gc_alloc or gc_realloc called from socketpool_socket_recv_into() called from socketpool_socket_accept().

Likely same bug as #9003.

manic glacierBOT
manic glacierBOT
#

@dhalbert I tried CircuitPython 9.2.6 (uploaded the .bin file to a Feather v2 through Web ESPTool). Would that include TinyUSB or should I be installing it differently on this board?

The Feather v2 + Max3241 was not able to detect my microSD card.

Adafruit CircuitPython 9.2.6 on 2025-03-23; Adafruit Feather ESP32 V2 with ESP32

Finding devices:
Finding devices:
Finding devices:
Finding devices:
manic glacierBOT
#

I tried testing with an I2C display (BUSDISPLAY) and a DVI display (FRAMEBUFFERIO). It seemed like the I2C display output was usually getting lost when the DVI was primary, I could get the I2C to display if I did a displayio.release_displays() and then ctrl-D.

The most recent commit attempts to do a better job of determining if one of the display structure elements is being used by an active display although I don't understand the mechanism that sets the object type element so there's pro...

lone axle
#

I seem to recall there being something about some kind of extra "plumping" needed in the core for classes to be extendable and get all of the functionality of the parent. I've found this case where I am seeing that a subclass seems to have access to a function but gets the wrong / different result of the base class calling the same function with all other things being equal:

from displayio import TileGrid, Bitmap, Palette

palette = Palette(1)
palette[0] = 0x0

bmp = Bitmap(100, 100, 1)
tg = TileGrid(bitmap=bmp, pixel_shader=palette, tile_width=100, tile_height=100)
print(tg.contains((50, 50, 0)))

class SpecialTileGrid(TileGrid):
    def __init__(self, **kwargs):
        super().__init__(**kwargs)

special_tile_grid = SpecialTileGrid(bitmap=bmp, pixel_shader=palette, tile_width=100, tile_height=100)
print(special_tile_grid.contains((50, 50, 0)))

# outputs:
# True
# False
#

Does this indicate that something else needs to be hooked up for contains() to work properly or the same as it does for the base class?

manic glacierBOT
#

I found it a little hard to find information on that, but I managed to request the "report protocol" from the mouse. Based on the code from the Feather USB Host guide I added the following. You could use wValue=0 to set to boot protocol I believe.

REQDIR_HOSTTODEVICE = 0
REQTYPE_CLASS = 1 << 5
REQREC_INTERFACE = 1 << 0
HID_REQ_SetProtocol = 0x0B

bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_C...
manic glacierBOT
#

Well.... After banging at the code for a bit I decided to test the I2C display I'm using with the current version (no PR) of CircuitPython and it behaves in almost the same way as the PR so the odd behavior seems to be a quirk of the I2C display or my soldering. I'm using a featherwing doubler with a Feather RP2350 & a FeatherWing OLED.

So now I'm thinking the last commit should be dropped although I don't think it's doing any harm so I'll leave it for now.

manic glacierBOT
#

I was able to get a Feather RP2350 displaying on a DVI display, an I2C display and an SPI display using CIRCUITPY_DISPLAY_LIMIT=3 in settings.toml.

Tomorrow I'll try setting up multiple displays on an Espressif micro controller .

During my testing I've noticed pressing ctrl-D without performing a displayio.release_displays() seems to cause a Safemode Crash which I need to track down (possibly related to #10084)

edgy flax
manic glacierBOT
lone axle
tulip sleet
lone axle
#

Oooh, that does seem like a good possibility

#

inside TileGrid shared bindings most properties use displayio_tilegrid_t *self = native_tilegrid(self_in); but contains() is different and doesn't use native

#

Yep, that was it. Thank you!

#

for some reason, not using native_tilegrid() was causing the values for self->tile_width and self->tile_height in core code in shared-bindings not to get proper values. Which then made the contains conditions change.

manic glacierBOT
#

I am now able to test with the recomended #define CIRCUITPY_PSRAM_CHIP_SELECT (&pin_GPIO47) commented out to disable PSRAM with the newer sprites that are smaller than the previous ones. I confirmed with this that it worked:

>>> import gc
>>> gc.mem_free()
138448

I do still see the slower rendering for the first minute or so after a boot up with this build so I think perhaps this rules out the issue being related to storing assets in PSRAM.

#

@EmergReanimator Thank you for your patience and persistence. I've updated the .toml PR, but as I noted there the update does not change the jinja-generated genhdr/devices.h.

I suspect there's a deeper problem in atmel-samd-specific flash support code. I will pick this up again later in the week when my hardware order arrives.

// Wait until both the write enable and write in progress bits have cleared.

Why the flash is ready when the WE...

#

Does the CIRCUITPY device mount with a size < 8MB?

8.4 MiB to be precise.

[11205.487427] usb 2-7.1.2: new full-speed USB device number 28 using xhci_hcd
[11205.573863] usb 2-7.1.2: New USB device found, idVendor=239a, idProduct=80b6, bcdDevice= 1.00
[11205.573873] usb 2-7.1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[11205.573878] usb 2-7.1.2: Product: SAM E54 Xplained Pro
[11205.573881] usb 2-7.1.2: Manufacturer: Microchip
[11205.573885] usb 2-7.1.2: SerialNumber: 0A...
manic glacierBOT
#

I tried the artifact build on a PyPortal with a 4GB SD card in the slot.

With no code.py I can see some attempt to mount the SD card, but it does not complete. From /var/log/syslog:

2025-03-28T11:00:38.921872-04:00 cod kernel: sd 4:0:0:1: [sdc] 7744512 512-byte logical blocks: (3.97 GB/3.69 GiB)
2025-03-28T11:00:38.923918-04:00 cod kernel: sdc: detected capacity change from 0 to 7744512

But it never shows up in mount or df. This is on Ubuntu 24.04. sdb1 is CIRCUITPY.
...

manic glacierBOT
#

Some more testing. The detected capacity change shown above is not typical. This is from a cold start, no code.py, PyPortal, with either a 4GB or a 64MB card in the SD slot:

2025-03-28T11:36:40.581905-04:00 cod kernel: scsi 4:0:0:0: Direct-Access     Adafruit PyPortal         1.0  PQ: 0 ANSI: 2
2025-03-28T11:36:40.581939-04:00 cod kernel: scsi 4:0:0:1: Direct-Access     Adafruit PyPortal         1.0  PQ: 0 ANSI: 2
2025-03-28T11:36:40.582861-04:00 cod kernel: sd 4:0:0:0: Attached scs...
manic glacierBOT
#

@gamblor21 It just occurred to me that mix hasn't been implemented within this effect. I think that needs to be added before considering a merge into main.

For this effect, I think the following mix graph is applicable (red=dry, blue=wet). Since you're already blending in the dry voice as the "1st" voice, a direct linear mix with sample_word (aka dry) should be all that is needed to achieve this (no additional mixdown required either).

![406611767-778a2132-a267-4d98-aaeb-d64628771c4...

#

This is possibly not a core issue at all, or is something related to time keeping if so I believe.

It seems in the first few test runs at least that using:

time.monotonic()

instead of

adafruit_ticks.ticks_ms() / 1000

In the animation code makes this issue go away.

The rest of the code was written using seconds units so it was dividing the ticks_ms() value from adafruit_ticks to get to seconds. Maybe the division slows it down for the first minute for some reason? Or maybe ...

#
manic glacierBOT
#

I tested several more times on HDMI with 9.2.6, main, and 9.2.x UF2s from the S3 page, and all have run well and rendered smoothly.

It sounds like I was just misusing ticks_ms(). It wrapping around at the 65th second meant that my mis-use was more problematic during that window of time than after it wrapped. time.monotonic() seems to work fine so I'll stick with that for now.

#

With some debug tracing added and using the test server from #9428, I'm seeing socketpool_socket_accept() getting invoked almost continuously, each time allocating another socketpool_socket_obj_t. This is due to polling from adafruit_httpserver/server.py at line 503. Although not an error, it's definitely putting memory management through its paces. I suspect it's related. Set up now to trap an allocation failure and running...

manic glacierBOT
#

Tested successfully on Fruit Jam with the Set card game that I am working on, as well as this more simple reproducer code:

from displayio import TileGrid, Bitmap, Palette

palette = Palette(1)
palette[0] = 0x0

bmp = Bitmap(100, 100, 1)
tg = TileGrid(bitmap=bmp, pixel_shader=palette, tile_width=100, tile_height=100)
print(tg.contains((50, 50, 0)))

class SpecialTileGrid(TileGrid):
    def __init__(self, **kwargs):
        super().__init__(**kwargs)

special_tile_grid = Spec...
#
  • Fixes #10138

This removes the ability to use the old displayio bus bindings, and also removes CIRCUITPY_9_10_WARNINGS and the associated warnings.

@tannewt It was my understanding it's OK to remove these warnings now, because they were meant to be present in 9.x.x (though we messed up on that a bit). If this is wrong, I can restore them.

There are no more uses of the old bindings in the library bundle.

Tested on a PyPortal Titano with the NASA image project.

manic glacierBOT
orchid basinBOT
#

Bumps json from 2.10.1 to 2.10.2.

Release notes
Sourced from json's releases.

v2.10.2
What's Changed

Fix a potential crash in the C extension parser.
Raise a ParserError on all incomplete unicode escape sequence. This was the behavior until 2.10.0 unadvertently changed it.
Ensure document snippets that are included in parser errors don't include truncated multibyte characters.
Ensure parser error snippets are valid UTF-8.
Fix JSON::GeneratorError#detailed_me...

manic glacierBOT
manic glacierBOT
#

@relic-se I started to work on this, but I'm unfamiliar with the code. Re the struct biquad_filter_state and the associated routines in synthio/Biquad.h: should these be moved to BlockBiquad, or are they completely unnecessary? The are used in audiofilters/Filter.c, synthio/Note.c etc.

Also, is the AnyBiquad type now unneeded? Are they going to be a BlockBiquad? Should we consider renaming BlockBiquad to just Biquad, deprecating BlockBiquad, and removing the old name in CPy...

#

Perfect. I'll PR a more general solution later that includes the nvm.toml update. If I'm not mistaken, you're unblocked for now.

Yes, you can say so. @eightycc Thanks for you eager support!

Just for your information:
I am maintaining NXP port of the CPY. It was a while since NXP-fork was synchronised with upstream - CPY V8.0;
I was going to updated NXP port fork to 9.x; But first I tried the same54_xplained board before adding NXP port to 9.x.

manic glacierBOT
#

@eightycc I was going to do this and then saw you already did! It just needs a merge conflict fixed.

I would also like to get the Module Support Matrix to include an annotation that describes which _bleio is actually supported. This PR will make that easier: we can add entries to ADDITIONAL_MODULES in docs/shared_bindings_matrix.py like:

    "_bleio (native)": "CIRCUITPY_BLEIO_NATIVE",
    "_bleio (HCI co-processor)": "CIRCUITPY_BLEIO_HCI",

I also had another thoug...

slender iron
manic glacierBOT
#

I had some time to try this today. My results:

  • CIRCUITPY_DISPLAY_LIMIT=2 works great
  • CIRCUITPY_DISPLAY_LIMIT=3 works but Ctrl-C-ing and restarting a program results in a ValueError: GP17 in use, as if I wasn't calling displayio.release_displays() (Perhaps it's only releasing N-1 displays?)
  • CIRCUITPY_DISPLAY_LIMIT=4 works but the system seems very slow now. Display updates are slow, REPL is slow, USB negotiation is slow
  • With 3 or more displays, CircuitPython would occasionally cra...
#

I've been keeping an eye on this thread and your PR for the past few weeks. Thanks so much for your efforts! I've dug out the old T-Keyboard-S3, so if you're looking for some more Espressif testing, let me know.

I was thinking that I would follow this PR up with a settings.toml parameter that allowed the sharing of DC/RST pins, something like CIRCUITPY_FOURWIRE_SHAREPINS. But since that's not available yet, If...

manic glacierBOT
#

I was thinking that I would follow this PR up with a settings.toml parameter that allowed the sharing of DC/RST pins, something like CIRCUITPY_FOURWIRE_SHAREPINS.

This is another one I need to follow-up on. I vaguely recall that there were some FourWire changes since I last tested.

Edit: Oh wait, the T-Keyboard-S3 doesn't have an official CP build yet....

That was something I was working on initially, but chose not to merge in the board definitions until we could get the all of the dis...

manic glacierBOT
#

The reason we didn't do defaults is because, at least for Pico, MicroPython and the SDK sometimes differed on defaults. See https://github.com/adafruit/circuitpython/issues/4121 and https://github.com/adafruit/circuitpython/issues/5041. But now that they have designated pins in the pinout diagram, maybe we should reconsider. It would still be better if they put it on the silk. We've tended to say it needs to be on the silk or on a specific connector.

I'll merge this for now, thanks!, and w...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

mp_hal_delay_ms() starts out by calculating end_tick by converting port_get_raw_ticks() to ms, but adjusts remaining ticks using port_get_raw_ticks() without conversion.

I only see the delay being converted from ms to ticks. The rest is all done in ticks.
https://github.com/adafruit/circuitpython/blob/25216c88c7083fba1162946e4a5c1271f4bf5714/supervisor/shared/tick.c#L102

The issue is not with floats, it's because the actual sleep time is in milliseconds, and there's 1024 ticks i...

manic glacierBOT
#

CircuitPython version and board name

Adafruit CircuitPython 9.2.6 on 2025-03-23; Adafruit Feather ESP32S2 with ESP32S2

Specifically ESP32S2 w/ BME280 sensor and 2.13" HD Tri-Color eInk display attached. However, these devices are not interacted with when triggering the fault

Code/REPL

#!/usr/bin/env python3
import wifi
import mdns

import alarm

import time
import os

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

wifi.radio.connect(ss...
manic glacierBOT
#

I believe the ctrl-D safemode crash has been resolved thanks to a planning comment by tannewt :grin:

I left the shared SPI pin hack in this version to help with testing but will pull them out before the final version.

I haven't been able to get set_primary_display (supervisor.runtime.display=display) to work yet and I suspect the logic for setting/determining the "primary_display_number" isn't working either. But that's another nights problem....

lone axle
austere acorn
#

Ohai, anyone know what is up with this error I'm getting in my local circuitpython fork ?

I am not working at all in that folder, never modified it, and there are no actual changes to be staged.
I tried discarding the changes, deleting the folder completely and rebasing, nothing works, this message keeps coming back.

jaunty juniper
austere acorn
jaunty juniper
#

ok that doesn't ring a bell, what's the diff ? could it be a permission issue ?

austere acorn
#

there are a whole bunch of changes in diff

jaunty juniper
#

if I git submodule update from an empty sdk directory I get f6c93ee too with no changes (I usually leave the submodule directories empty for ports I don't build for)

manic glacierBOT
manic glacierBOT
#

I'm not sure if leaving the hack will cause regressions elsewhere in CircuitPython, but I would like to have that included in this PR.

I believe Scott was worried that allowing the pins to be shared would not let people know if they chose pins being used for other functions. If/when this PR gets merged, I plan to submit a second one that would enable the sharing of the pins by setting a second settings.toml parameter. That way the user protection Scott was looking for would be in place b...

manic glacierBOT
#

I think this is mostly working except for the "Set Primary Display" (supervisor.runtime.display=display) but either I misunderstand what that function does or it's also not working on current builds for anything but dvi displays. In 9.2.x or my artifacts, If I try to set the primary display manually the display is not identified as active and the following somewhat misleading message is displayed

TypeError: Display must be of type AnyDisplay or None, not ILI9341

Based on my reading o...

#
  • CIRCUITPY_DISPLAY_LIMIT=3 works but Ctrl-C-ing and restarting a program results in a ValueError: GP17 in use, as if I wasn't calling displayio.release_displays() (Perhaps it's only releasing N-1 displays?)

I haven't seen this in my testing, I'll try and reproduce your setup and see if I can make it happen.

*Hopefully the hard faults you were seeing are fixed, I haven't seen any since my last commit.....

#

I believe Scott was worried that allowing the pins to be shared would not let people know if they chose pins being used for other functions.

For the user protection side of things, I agree with this so long as it doesn't limit board design.

There aren't many examples of multiple displays, and there's even fewer examples of shared DC and RST pins.

My guess is that while it works, it's sub-optimal. But... it might also be that creators haven't ported CircuitPython to their multi-disp...

manic glacierBOT
manic glacierBOT
#
  • CIRCUITPY_DISPLAY_LIMIT=3 works but Ctrl-C-ing and restarting a program results in a ValueError: GP17 in use, as if I wasn't calling displayio.release_displays() (Perhaps it's only releasing N-1 displays?)

I haven't been able to reproduce this with three displays (all the I2C I have :grin:). I'm assuming you have the program in code.py and you are just pressing ctrl-D to restart after Ctrl-C-ing?

manic glacierBOT
manic glacierBOT
#

CircuitPython version and board name

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

Code/REPL

"""
filter Q over 1.41 causes glitches in the filter at certain frequency
"""

import time, board, synthio, audiobusio, audiomixer

SAMPLE_RATE = 44100
BUFFER_SIZE = 2048
i2s_bck_pin = board.GP20
i2s_lck_pin = board.GP21
i2s_dat_pin = board.GP22

audio = audiobusi...
#
  • CIRCUITPY_DISPLAY_LIMIT=3 works but Ctrl-C-ing and restarting a program results in a ValueError: GP17 in use, as if I wasn't calling displayio.release_displays() (Perhaps it's only releasing N-1 displays?)

I haven't been able to reproduce this with three displays (all the I2C I have 😁). I'm assuming you have the program in code.py and you are just pressing ctrl-D to restart after Ctrl-C-ing?

Yes, I had it as code.py and was just Ctrl-C-ing then Ctrl-D-ing.

But I just trie...

mortal kernel
#

@tulip sleet While playing around with pico-mac, I built a Pico SDK board header for Adafruit Metro RP2350. Is there a preferred process for sending these upstream?

manic glacierBOT
onyx hinge
# mortal kernel <@329766224093249548> While playing around with pico-mac, I built a Pico SDK boa...

@mortal kernel https://github.com/raspberrypi/pico-sdk/pull/2363 dan's PR is in draft mode, I don't know the deets (but hopefully it's written there)

GitHub

Fixes Add Adafruit Fruit Jam boardĀ #2362.

Add Adafruit Fruit Jam "Mini RP2350 Computer" board. https://www.adafruit.com/product/6200. Description:

RP2350B dual 150MHz Cortex M33...

mortal kernel
#

@danh I've gotten my head scrambled re: HSTX signal polarity in the pico sdk PR #2363. If you've got a FruitJam schematic handy, it's probably worth giving it look.

tulip sleet
tulip sleet
mortal kernel
#

@danh The adafruit/pico-sdk fork is slightly out of date. It's at 2.1.0, current is 2.1.1. CP uses upstream raspberrypi/pico-sdk at 2.1.1. I'm not sure how the Adafruit fork gets used.

onyx hinge
#

@tulip sleet fwiw I am using your PR branch for pico-mac and haven't noticed any problems

tulip sleet
tulip sleet
#

I will leave it draft until Limor has tested completely.

onyx hinge
#

yes

#
    - name: get pico-sdk
      run: git clone --depth=1 -b adafruit-fruit-jam https://github.com/adafruit/pico-sdk ../pico-sdk
tulip sleet
#

thanks - that makes me think it will be fine as is once we know it's really final. I was churning it too much in advance

manic glacierBOT
#

CircuitPython version and board name

Circuit 9.2.6

Code/REPL

import board
import analogbufio
import array

length = 1000
mybuffer = array.array("H", [0x0000] * length)
rate = 500000
adcbuf = analogbufio.BufferedIn(board.A0, sample_rate=rate)
adcbuf.readinto(mybuffer)
adcbuf.deinit()
for i in range(length):
    print(i, mybuffer[i])

Behavior

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Trace...
tulip sleet
#

Random GitHub tidbit: when typing markdown to GitHub, you can use ctrl-E to wrap selected text in backticks. If nothing is selected, it will insert an empty pair of backticks you can type into.

manic glacierBOT
#
  • Fixes #10201.

  • Fix analogbufio.BufferedIn pin validation on RP2350B.

  • Usepico-sdk-supplied ADC_BASE_PIN instead of figuring it the base pin ourselves.

  • Disallow using board.A3 (GPIO29) on Pico W and Pico 2 W for analogbufio.BufferedIn, and document that. GPIO29 pin has a voltage divider attached to monitor VSYS, and is also shared with SPI SCK connected to the radio module. AnalogIn special-cases A3 to make it available, but that was complicated, and I think the use c...

manic glacierBOT
#

CircuitPython version and board name

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

Code/REPL

import time, board, audiobusio, synthio, audiofilters

audio = audiobusio.I2SOut(bit_clock=board.GP20, word_select=board.GP21, data=board.GP22)
synth = synthio.Synthesizer(channel_count=1, sample_rate=44100)
effect = audiofilters.Filter(buffer_size=1024, channel_count=1, sample_rate=44100, mix=1.0)
effect.filter = synth.low_pass_filter(...
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

[In #10156 I tried to fix some spurious reformatting of .py code in the mimxrt1011/sdk when pre-commit was run. It didn't actually work. This should fix that.

  • Fix some strange indentation in .pre-commit-config-yaml.
  • Remove some incorrect settings
  • Format only C code using tools/codeformat.py. Use the ruff pre-commit actions to format Python.
  • Make the exclude: settings easier to read, and remove unneeded excludes.
manic glacierBOT
jaunty juniper
manic glacierBOT
tulip sleet
urban vigil
#

How does getting a PID and VID for custom RP2040 boards work? Since it uses CDC, wouldn't that come under RPI's 0x2E8A:0x000A address? I got everything working for my custom board and this is the last thing I need to PR it in!

Edit: the form has been filled and we are just waiting for a reply, but until then, what do we do?

manic glacierBOT
#

Please add support for raw f-strings.

>>> import glob
Traceback (most recent call last):
  File "", line 1, in 
  File "/lib/glob.py", line 319
SyntaxError: raw f-strings are not supported

It looks like MicroPython did this last year, and it didn't even make the code bigger. https://github.com/micropython/micropython/pull/15218

I'll try to apply this patch myself and see if it works, but I might be way out of my depth here.

#

Are the failing writes from code running within CP, or to the mounted MSC filesystem, or both? What is the behavior you're seeing when you try to write?

Sorry, forgot to note it in my previous comment.
There is still an issue in external flash code. It does not work well with SST26VF064B.
But do work correctly with N25Q256A.

I have my older SAME54 Xplained board with N25Q256A flash back. The filesystem works properly with the same binary on that board.

lone axle
jaunty juniper
#

sorry for the ping

lone axle
#

No worries

ornate breach
#

If it’s open source

#

If it isn’t open source, you can purchase a vendor ID from USB IF for like $5k

#

That renews annually

urban vigil
#

It will be open source in the future but not now, and we don't intend on mass manufacturing or selling it so 5k/yr is nonsensical

ornate breach
#

When it’s open source, you can request a VID/PID from the above. You can often test locally with a dummy VID/PID

urban vigil
#

Is there an issue with using the 0x2e8a:0x000a address for the rp2040 cdc devices?

stuck elbow
ornate breach
#

They do give out a limited number of PID if requested

#

Not sure the criteria for that

jaunty juniper
#

000A is like a generic "I'm using the SDK" PID ?

stuck elbow
#

but if it's not unique vid/pid combination, you won't get the board definition merged in the circuitpython repository

jaunty juniper
#

yep Circuitpython requires unique VID/PID (although they can be shared between variants sometimes for simplicity)

urban vigil
ornate breach
#

Lol…

urban vigil
#

We did register for a PID in the list but while that application is being processed, can we not use 0x000A for circuit python

ornate breach
#

You can do builds locally

#

But nothing will be merged in without a unique one

urban vigil
#

Alright, thanks for the info

lone axle
#

It seems like there isn't a doc for todays meeting. I'm going to create and pin one.

#

Here is the notes document for today'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! https://docs.google.com/document/d/1ivqAyDSbfqrDEdh5DtdmgPa8ZEVbA5e5PxGpttQjnyg/edit?usp=sharing

lone axle
fleet hollow
#

I'm currently working on removing synthio.Biquad and replacing it with synthio.BlockBiquad in 10.x. I'm considering merging the biquad_filter_state struct in with the synthio_biquad struct for simpler management (and minimal flash savings), but doing so would make sharing a single Biquad object with multiple audiosample entities have unintended consequences because they'd be sharing the same filter state. Is that acceptable or should I continue managing those two objects separately?

manic glacierBOT
#

I encountered build problems with the espressif port this morning. It looks like ESP-IDF's tools include overcomplicated fragile Python dependency check scripts. Is this related?

$ make -j6 BOARD=lilygo_tdeck
- Verbosity options: any combination of "steps commands rules", as `make V=...` or env var BUILD_VERBOSE
-- Building ESP-IDF components for target esp32s3
-- Checking Python dependencies...
The following Python requirements are not satisfied:
Requirement 'setuptools<71.0.1,>=21' was...
random junco
#

The split ortho keyboard picture on the new circuitpython.org is broken - should I file an issue in GitHub or is someone internal at Adafruit already aware do you think?

blissful pollen
# fleet hollow I'm currently working on removing `synthio.Biquad` and replacing it with `synthi...

Do we have any places where we would reference two Biquad objects at the same time? I think if we document it there wouldn't be a problem. If we can detect a duel use (no clue if that is possible) that would be nice too. Does this basically mean 1 filter to one audio sample use?

I'm not super familiar with it but can try to deep dive into it more if you need, but I'd trust your judgement on it.

fleet hollow
manic glacierBOT
lone axle
#

<@&356864093652516868> The weekly meeting will occur here on discord at the usual time today 11am US Pacific / 2pm US Eastern. That is just under 2 hours from now. Add your notes and hug reports to the doc https://docs.google.com/document/d/1ivqAyDSbfqrDEdh5DtdmgPa8ZEVbA5e5PxGpttQjnyg/edit?usp=sharing We look forward to hearing from everyone.

lunar crown
#

@onyx hinge I would suggest that you add a comment to your Circuit Playground note about making a Random Number Generator, that any transistor that has been operated in base-emitter avalanche mode should not be used as a regular transistor afterwards. Operation in base-emitter avalanche causes the gain of the transistor to drop permanently, and it may no longer meet specifications. The circuit works as you describe, but the transistor in avalanche changes permanently. You can search the internet for something like "Current gain degradation induced by emitter-base avalanche breakdown in silicon transistors."

onyx hinge
#

@lunar crown an interesting point I was unaware of.

#

I'm getting a 500 error trying to edit the note otherwise I'd be sure to add this info

lunar crown
#

@onyx hinge šŸ‘

tulip sleet
orchid basinBOT
manic glacierBOT
orchid basinBOT
manic glacierBOT
random junco
#
MIT OpenCourseWare

This subject is aimed at students with little to no programming experience. It aims to provide students with an understanding of the role computation can play in solving problems. It also aims to help students, regardless of their major, feel justifiably confident in their ability to write simple programs that allow them to accomplish useful goa...

turbid radish
#

Please subscribe for free

mortal kernel
#

Have a great week, everyone! Thank you, Tim.

tulip sleet
#

@lone axle don't forget to convert the raw markdown to formatted text in the notes: copy a section, and then paste over it with right-click "Paste as markdown". Then you can download the formatted it as markdown. No other fixups needed

#

explained in the third paragraph at the top

austere acorn
#

Thanks for the hug report @slender iron ! 😊
Still plenty of work to do on the Daisy, I enabled the audiopwmio module, and playing audio crash-resets the board ...
Fun times ahead, lol

slender iron
#

I'm sure you'll figure it out

lone axle
#

@slender iron for when you get into the editor stuff: Jeff forked a library that provides a subset of Curses, and the editor itself and got them both working under CircuitPython (originally made for CPython). The first paragraph on the overview page https://learn.adafruit.com/circuitpython-text-editor-on-the-go links to the prior work. The main thing that I added to it at the time was a visible cursor. But it's done in a "cheaty" way by having a Label containing a single character put on top of the rest of the editor. TilePaletteMapper should provide an easier way to make the cursor visible without the need for that extra layered object.

slender iron
#

so we can have a games collection

#

and an editor

#

and switcher

#

I've been really tempted to add support for the TPM to the default terminal

tulip sleet
#

@slender iron Thinking we might make a 10.0.0-alpha.1 very soon, so we can get 10.0.0-something into circuitpython.org and then figure out the bootloader stuff, etc. I can merge from 9.2.x once more before I do that.

#

Not sure I would even announce this yet, but we could use a visible placeholder besides the alpha.0 tag

manic glacierBOT
slender iron
#

ok, I think it's fine to do this transition during the alpha phase

tulip sleet
#

we can switch to beta once we settle down the partition scheme for all boards. Could do ESP-IDF v5.4 in alpha too.

slender iron
#

sounds good

#

lunchtime for me

jaunty juniper
#

speaking of partitions and 5.4, BLE is still broken on C3 right ?

tulip sleet
#

in 5.3.2 yes

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/1YPAPoECwKzqUCmavSv04hAZjQAgRlVLxPIYjfHTctbE/edit?usp=sharing

orchid basinBOT
manic glacierBOT
manic glacierBOT
#

I don't think this has been fully implemented.

Okay with that in mind I took another look at the code and I think the immediate issue is that the display type is not being set when a display structure element is allocated (Except in the case of a picodvi_autoconstruct). I could update the display_allocate module to set the field based on a passed in argument but that would touch a lot of files.

I'm thinking perhaps it would be better to merge this as is first and get the primary displ...

slender iron
#

@tulip sleet were you mounting the SD card from a code.py in your testing?

manic glacierBOT
#

CircuitPython version and board name

Adafruit CircuitPython 9.2.6 on 2025-03-23; Adafruit Metro RP2350 with rp2350b

Code/REPL

import audiobusio
import audiocore
import board
import adafruit_tlv320

i2c = board.I2C()
dac = adafruit_tlv320.TLV320DAC3100(i2c)
dac.configure_clocks(sample_rate=44100, bit_depth=16)
dac.speaker_output = True
dac.speaker_volume = -10 # dB
audio = audiobusio.I2SOut(board.D9, board.D10, board.D11)
with open("StreetChicken.wav", "rb") ...
tulip sleet
slender iron
#

I suspect the pyportal library was doing it for you

#

np, i'm around for two more hours

tulip sleet
#

Yeah, maybe so. I was using the NASA image program.

tulip sleet
#

If I don't run any program at all, then I see the second drive show up in /var/log/syslog as /dev/sdc, but nothing is mounted, which makes sense because it wasn't mounted manually, right?

tulip sleet
#

@slender iron this hangs after the second or third print(), with the pyportal artifact from the PR:

import board
import busio
import sdcardio
import storage
import time

spi = board.SPI()
cs = board.SD_CS

sdcard = sdcardio.SDCard(spi, cs)
vfs = storage.VfsFat(sdcard)

storage.mount(vfs, "/sd")

while True:
    print(time.time())
    time.sleep(1)
#

and eventually disconnects

#

the output on the display is essentially the same

slender iron
#

@tulip sleet I'm not going to make it work on pyportal

manic glacierBOT
tulip sleet
#

well, this is so simple it should work on the pyportal too.

slender iron
#

I tried with a sd card that works on rp2 and it doesn't on pyportal

#

I'm doing this for rp2 first and foremost

#

we can always expand it later

manic glacierBOT
slender iron
#

pyportal shares the clock line with the ESP32 and I'm worried that it can mess up the SD card

manic glacierBOT
#

Ok, I've made the MSC LUN -> filesystem checks stricter. Only sdcardio that is not allocated to the VM heap will be exposed my USB MSC. This basically requires the automounting definitions for the board. I've added them to Metro RP2350 in addition to Fruit Jam. Other ports/boards will be need to be added as they can be tested.

I tested on the PyPortal briefly but had issues with sdcardio that I didn't want to debug. The same card works on RP2350. PyPortal shares the clock line between th...

slender iron
#

updating it now

manic glacierBOT
tulip sleet
#

@slender iron on fruit jam will the SD card be shared with the C6 or anything else?

slender iron
#

looks

#

it doesn't look like it

tulip sleet
#

@slender iron ok! works on Win 11 and on macOS 15.3.2 on an M1 Mac Mini.

If I wanted to have the sd card be r/w to the host computer, could I remount it? It is readonly now.

slender iron
#

yup! that should work

#

storage.remount("/sd", False) iirc

tulip sleet
slender iron
#

I'd expect it to work from the repl if the drive is ejected from the host

#

I can look at that more tomorrow. seems like it should raise an exception if it thinks it won't work

manic glacierBOT
#

Tested with a Metro RP2350 on Ubuntu 24.04, Windows 11, and macOS 15.3.2.
All work!

The SD card is normally read-only to the host computer.
If I put import storage; storage.remount("/sd", readonly=True) in boot.py, it becomes R/W to the host. Doing that after USB enumeration, say in the REPL, does not change the host view of the drive, but does not give an error.

  • Maybe raise an error if storage.remount() is attempted after USB starts?
  • Document the feature, maybe after this ...
orchid basinBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#
#
manic glacierBOT
manic glacierBOT
#

After a fruitful chat with @dhalbert getting some traction on debug. Found multi-heap integrity testing code in IDF: heap_caps_check_integrity_all(). Added calls to this in port_malloc(), port_free(), and port_realloc(). After about 1/2 hour running simple server from #9428 I'm getting this:


Core  1 register dump:
PC      : 0x4039367a  PS      : 0x00040036  A0      : 0x00000000  A1      : 0x3fcaeb10  
A2      : 0xffffffff  A3      : 0x00000000  A4      : 0x00000001  A5      : 0x3...
#

Fixes https://github.com/adafruit/circuitpython/issues/10061

  • Replace the deprecated synthio.Biquad with synthio.BlockBiquad (now named synthio.Biquad)
  • Remove synthio.Synthesizer.low_pass_filter, synthio.Synthesizer.high_pass_filter, and synthio.Synthesizer.band_pass_filter
  • Remove synthio.AnyBiquad from documentation
  • Coefficients from biquad_filter_state have been moved into synthio_biquad (biquad_filter_state is still used for input and output state)

These...

#

This will use the default SPI pins chosen in mpconfigboard.h. But the documentation says:

W5500-EVB-Pico2 pinout is directly connected to the GPIO of RP2350 as shown in the picture above. It has the same pinout as the Raspberry Pi Pico2 board. However, GPIO16, GPIO17, GPIO18, GPIO19, GPIO20, GPIO21 are connected to W5500 inside the board. These pins enable SPI communication with W5500 to use Ethernet function. If you are u...

slender iron
#

@lone axle have time today to talk about fruit jam?

lone axle
slender iron
#

that'll be lunch for me. maybe 2 hours from now?

lone axle
#

Yep, that works.

manic glacierBOT
#

That's fair. I came at it from the opposite direction, figuring the WIZnet chip is the only hardwired SPI peripheral on the board, so odds are pretty high that it's the SPI peripheral you're looking for.

As a general rule, if a CircuitPython board has hardwired peripherals that don't have baked-in support (i.e. you have to install a driver in the lib folder and point it at the right peripheral/pins), do we avoid making those the board defaults to ensure users intentionally select the ...

#

As a general rule, if a CircuitPython board has hardwired peripherals that don't have baked-in support (i.e. you have to install a driver in the lib folder and point it at the right peripheral/pins), do we avoid making those the board defaults to ensure users intentionally select the hardwired device?

Not necessarily. There are plenty of boards with displays on the default SPI bus. But this is the first recommendation I've seen to avoid the "default" bus because it's connected to an on...

#

In the case of CIRCUITPY, storage.remount() can only be done in safemode.py or boot.py. Is that also true for CPSAVES and SD?

It is not strictly true for CIRCUITPY. If you can eject CIRCUITPY from your host OS (like Linux can), then you can remount it. What happens is that the USB writable check grabs a lock on the underlying block device. On Linux, this happens before you actually "mount" the drive. It is only released on eject. boot.py runs before this so it always works....

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 9.2.7
orchid basinBOT
slender iron
#

@lone axle I'm around whenever you are free

manic glacierBOT
lone axle
tulip sleet
slender iron
#

@tulip sleet did you push 10.0.0-alpha.0 to the adafruit repo?

tulip sleet
#

I will make a 10.0.0-alpha.1 after a couple more PR's on main

slender iron
#

we may actually need 10 tags after every 9.2.x branch merge

tulip sleet
slender iron
#

I'm not seeing 10.0.0-alpha.0 in my tags after make fetch-tags

#

ah, I do see it

#

with rg

tulip sleet
#

10 doesn't alphabetize as nicely šŸ™‚

slender iron
#

I think our version computation is filtering it out too

#

I think I'll add --first-parent too

#

that way only tags on the main branch will be considered

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 10.0.0-alpha.1
slender iron
#

This is on the merge commit that merged in the one that alpha.0 is on

#

--first-parent ignores it

#

(and will ignore 9.2.7)

manic glacierBOT
manic glacierBOT
slender iron
#

@lone axle The animation is definitely slower with group scale=2

#

I think it'd be ok if we center it and scale=1 though

manic glacierBOT
slender iron
#

animation runs as boot.py.... but has an infinite loop

#

🤦

lone axle
#

Heh, whoops šŸ˜…

#

@slender iron in addition to not looping, it might be nice to ultimately let the user break out with a key press.

manic glacierBOT
slender iron
#

@lone axle can you send me sized group when you have a chance?

slender iron
#

thanks!

lone axle
#

it (and/or GridLayout) may get wonky when used with scales other than 1, I don't think I've tested much.

#

@slender iron here is all of the icons as well. You may have made placeholders already, if not these may help

manic glacierBOT
mortal kernel
#

@tulip sleet @slender iron For Espressif debugging, I'm looking for tips re: setting up and using coredump to uart.

manic glacierBOT
jaunty juniper
#

should we start the CP10 bundle ? (in the bundle releases and circup)

mortal kernel
#

@tulip sleet It doesn't work. After a few hours I've gotten JTAG to work. What a journey.

mortal kernel
#

JTAG requires blowing a fuse on the ESP32-S3, pulling GPIO3 to ground on power-up, connecting a J-Link, starting the Espressif OpenOCD and GDB in the ESP virtual environment, and building CP with DEBUG=1 and ENABLE_JTAG=1. After that, everything needs to be powered up in just the right sequence. Whew.

tulip sleet
mortal kernel
#

No, but the ENABLE_JTAG stops CP from resetting the JTAG pins.

#

The fuse I blew was EFUSE_STRAP_JTAG_SEL. It lets you choose the interface (SWD over USB or JTAG) by strapping GPIO3 at power-up. Once the board is up, GPIO3 is available as usual.

#

I'm writing up a gist so I don't lose the recipe.

#

So far, it's stable. I'm going to call it a day and hopefully I'll have a crash I can poke at in the morning.

tulip sleet
#

We could put it in a Guide later.

mortal kernel
#

Will do.

#

Good night! More fun tomorrow.

tulip sleet
#

thanks!

zinc walrus
#

@jaunty juniper, I noticed that you forked adafruit_fancyled recently and, assuming that was in preparation of adding hsv2rgb_rainbow() to it, might I suggest also making that function capable of handling normalized floats as well.

Your [recent port](#help-with-circuitpython message) of that function was extremely convenient for me when converting some existing code to CircuitPython, but its 8-bit resolution is admittedly somewhat limiting. In my opinion, hsv2rgb_rainbow() would be far more capable if its input could also accept (0.0-1.0) floats similar to rainbowio.colorwheel() and fancyled.CHSV().

I don't want to look a gift horse in the mouth, and I greatly appreciate the time you took to port the existing function, but while it's on your brain's front burner, please consider improving it slightly to meet the fantastic capabilities of other CircuitPython libraries.

manic glacierBOT
manic glacierBOT
lone axle
#

Could we add the CPSAVES drive to Metro RP2350 to make it more closely mimic the Fruit Jam?

tulip sleet
jaunty juniper
mortal kernel
#

@tulip sleet Is 9.2.x closed out? If so, I'll re-base my pending work to main.

tulip sleet
mortal kernel
#

I'll move the BLE macro PR (the conflict is fixed) to main as well.

tulip sleet
#

I thought I merged that already

#

oh, I guess not!

#

yeah, go ahead and move that one. I was a little worried about churn with that.

manic glacierBOT
#

From PR #9878 @dhalbert suggests:

Suppose _bleio for HCI was actually called _bleio_hci. The libraries would do something like:

try:
    import _bleio
except ImportError
    import _bleio_hci as _bleio

Conceivably, one could make a build that would support both, though it's not of much use (though there are compile issues about that, so you don't have to duplicate the shared-bindings code).

slender iron
#

I think it's fine to get it out as-is

#

@lone axle looks like I'm missing the default icon too

slender iron
#

and arrow_*.bmp

lone axle
slender iron
#

k, looks like I have all of the assets

lone axle
#

I figured out that it is specifically Fruit Jam -> XR1 -> 7" HDMI display that is not supported with the 360x200 resolution. It seem that the XR1 does support it and tries to pass it along in a comprable format, but the display itself does not so it gets "unsupported format" error. If you go Fruit Jam -> 7" HDMI display directly it does negotiate a size that it supports.

slender iron
#

but no usb devices working

#

hrm. my xr1 is capturing 720x400 ok

lone axle
#

right, the xr1 supports it, but then it passes it to the display which doesn't

#

I think it's more a problem between the XR1 and the display. Not worth trying to fix from the Fruit Jam, just an unfortunate quirk of those devices together.

slender iron
#

kk, I can look after I get this OS stuff setup

#

gonna add serial input support to the launcher

#

since it isn't finding my mouse

lone axle
#

for the mouse you may need to change adafruit_usb_host_descriptors.find_mouse_endpoint to find_boot_mouse_endpoint

slender iron
#

I uncommented the find_all loop and it doesn't find anything

#

and no keyboard either

jaunty juniper
#

@lone axle would it be interesting to add a function to switch the device mode from boot to report to the usb host descriptors library ? (or is it already ?)

lone axle
jaunty juniper
#

yep

slender iron
#

@tulip sleet hold off on 10.x prerelease. I think usb host may be broken

#

it looks like critical_section_enter_blocking isn't being inlined for me

#

and ending up in flash

manic glacierBOT
tulip sleet
slender iron
#

could be a compiler + settings thing

tulip sleet
#

@slender iron the change in adafruit/pico-sdk caused a failure in CI in the Bazel build. Copilot suggests attribute((always_inline)) instead of __force_inline.

#

The former is available in both gcc and clang

slender iron
#

__force_inline is a macro in the sdk I thought

tulip sleet
#

maybe you are including that macro in the includes where it's used for us, but not in the .h directly.

#

so it's failing on other compiles in their tests

#

so need another include in the .h you changed?

slender iron
#

ya, maybe

tulip sleet
#

that is the include that actually defines __force_inline

slender iron
#

welp, the close endpoints thing breaks us too

manic glacierBOT
slender iron
#

ā˜ļø @lone axle this should fix your usb

hollow gazelle
slender iron
#

it bit me on my build

#

because we run usb host on the core1 with the MPU set to block flash accesses

hollow gazelle
#

( I now scroll back and see how it hit )

hollow gazelle
slender iron
#

the whole firmware is in RAM?

hollow gazelle
slender iron
#

ya, that simplifies things!

lone axle
slender iron
#

my mouse is doing that too

#

not sure why

#

you know, I think the native HID driver sets the mouse back to boot protocol

#

so maybe the non-working mouse is in non-boot mode

lone axle
#

I did end up getting a USBError after ctrl-c / ctrl-D a few times

slender iron
#

hrm. darn

#

I'm out of time for today but will look next time I'm at my desk

manic glacierBOT
lone axle
#

one of my mice is actually a keyboard / trackpad combo, I'll try it with two plain ones.

slender iron
lone axle
#

@slender iron mouse.read() is returning 8 bytes now. and the buffer it's writing to is only 4 bytes in size so that is one issue at least.

slender iron
#

ya, probably a regular report

manic glacierBOT
slender iron
#

it'd help if we actually closed endpoints ourselves

lone axle
#

Building now, I'll try this one

manic glacierBOT
lone axle
#

Is there any way for code to check if a device is going to send 4 byte reports or 8? Or is it best to just assume 8 and always check the returned value from read()?

hollow gazelle
jaunty juniper
#

we can always assume 8 though for simplicity

lone axle
#

The brand new build from that PR that Scott linked maybe does some of the additional mouse setup that you figured out recently but inside the core. So a mouse that on the old (current) version returned 4 byte boot reports is now returning 8 byte reports under this bleeding edge build.

tulip sleet
#

is there any parsing of the incoming HID report descriptor? Or is it assuming it is a "boot" device? In that case the actual descriptor is ignored and a standardized descriptor is used. The descriptor can having anything in it. I don't know whether the USB host code in TinyUSB is doing that work.

lone axle
#

Or maybe it's different from the work you've done. I'm not really sure tbh. But it did return only 4 bytes before I believe and now does 8. I haven't looked closer at what all is in the bytes yet though.

slender iron
#

looks like hid defaults to "report" mode instead of boot

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Maybe we could have a note in the sleep() docs about precision being limited around the millisecond.
I've seen library code with time.sleep(0.00001) or 0.0001 which I don't know if this results in an actual sleep of 1 tick or 0.

Note that C python sleep docs says:

The suspension time may be longer than requested by an arbitrary amount, because of the scheduling of other activity in the system.

For CP, do we guarantee it's at least the time given (by rounding up) ? Do we say it's a "cl...

#

For CP, do we guarantee it's at least the time given (by rounding up) ? Do we say it's a "closest" effort plus overhead ? Do we just say it's an approximation ? Do we promise nothing ?

No guarantees as to whether it's a ceiling rather than a floor, because there are things that can make the interval longer, like gc and interrupt handling. Right now time.sleep(0.00001) doesn't really do anything. For more precise timing, one can use microntroller.delay_us(), which does a busy-wait loop....

tulip sleet
#

@mortal kernel what is your new strategy for fractional tick delays? Are you counting subticks by getting the subtickvalue with get_raw_ticks(&subticks). Or are you using mp_hal_delay_us() for fractional ms?

jaunty juniper
#

The docs page title on latest: https://docs.circuitpython.org/en/latest/README.html is
CircuitPython — Adafruit CircuitPython 1 documentation
and on stable (which would be 9.2.7 ?)
CircuitPython — Adafruit CircuitPython 3 documentation
and on the 9.2.x branch it says 9.2.6

#

not that anybody reads page titles but still

tulip sleet
#

i will check on the stable version

mortal kernel
manic glacierBOT
#

I've seen library code with time.sleep(0.00001) or 0.0001 which I don't know if this results in an actual sleep of 1 tick or 0.

The conversion code in time_sleep first converts the floating time in seconds to milliseconds by floating multiplication and rounds up by adding 0.5. An implicit cast from float to int then truncates the fractional part (standard C). So, a value < 0.5 milliseconds will not sleep while a value >= 0.5 milliseconds will sleep at least 1 millisecond.

For more pre...

manic glacierBOT
#

My update does not support sleep timer resolution beyond integral milliseconds.

Since the underlying timer has subtick resolution (in most cases), it is possible to resolve sleep to ~30 us. Perhaps change mp_hal_delay_ms to mp_hal_delay_us? This would avoid any busy waiting. Is there utility in doing this?

Are you saying change that call? mp_hal_delay_us() typically is a busy-wait, not a tick wait (which will save power, since it uses WFI() or the equivalent.

One issue is if a ...

manic glacierBOT
#

Are you saying change that call? mp_hal_delay_us() typically is a busy-wait, not a tick wait (which will save power, since it uses WFI() or the equivalent.

Because there is not a generic mp_hal_delay_us(), I assumed it didn't exist. My bad. I agree that a busy wait is not a good idea due to power consumption implications. I'll choose another name that clarifies whether the implemented delay is a busy or a timer wait.

manic glacierBOT
#

I'm currently thinking of making a CircuitPython sensor -> ROS factory utility class - so you could just set up your sensor, pass it into the class and it starts publishing on an appropriate topic
I've just implemented the first bit of the shared-bindings layer so I'd love to hear more about what you meant by this. I'm currently basing the module API off of rclpy, but we could make a python wrapper library for other tasks.

manic glacierBOT
tulip sleet
slender iron
manic glacierBOT
slender iron
#

@tulip sleet ā˜ļø

tulip sleet
slender iron
#

I smoke tested it. I was able to rerun code.py without usberror

#

(on fruit jam)

tulip sleet
#

i'll merge after CI finishes

manic glacierBOT
#

CircuitPython version and board name

Adafruit CircuitPython 9.2.7 on 2025-04-01; PCA10059 nRF52840 Dongle with nRF52840
Board ID:pca10059
UID:9B577D0F0B41F302

Code/REPL

##### Central code
import os,gc,zlib,binascii,digitalio
import time,board,busio,_bleio,pwmio
import storage,analogio,microcontroller,supervisor
import adafruit_ads1x15.ads1015 as ADS
from adafruit_mcp230xx.mcp23017 import MCP23017
from adafruit_ble import BLERadio
from adafruit_ble.services.n...
mortal kernel
#

Great! The first one is where every time the current areas fill, gc does a full collect. Lots of small allocations, like return tuples from functions, will cause very frequent collects.

slender iron
#

yup

mortal kernel
#

The other looks more like a bug. When a large allocation is made that is bigger than area size the heuristic wants to allocate, it will cause the heuristic on the next filled area to allocate a new area that is double the sum of all areas, including very large allocations.

#

For example, if a framebuffer is allocated, then the next time an area is added it will eat up most or all of the tlsf heap.

slender iron
#

right

#

how is this causing a crash?

mortal kernel
#

We run out of tlsf heap space so code that allocates outside of the VM cannot allocate. It's not causing the bug I'm working on, but I've hit it playing with framebuffer.

orchid basinBOT
manic glacierBOT
slender iron
#

for the timing bug, why not just round up and call it good?

tulip sleet
#

i've been talking about the timing stuff with Bob when you were gone. I think he's on a good track. There was a bug in the RP2 subticks calculation as well.

manic glacierBOT
slender iron
tulip sleet
#

not at all -- this is fixing some technical debt

slender iron
#

right but that debt doesn't actually break much

tulip sleet
#

these are not big changes. It's an improvement to time.sleep() to do sub-millisecond better and a bug fix

slender iron
#

they just aren't that high priority for me even though they are under 10.x

mortal kernel
#

@slender iron Please let me know what you'd rather I work on and I'll switch to it.

manic glacierBOT
slender iron
#

I can video/audio chat with you about heaps if you want too. Or talk about it on deep dive

mortal kernel
slender iron
#

Sure. It's important to me that you get my brain dumps before I'm on leave though too

lone axle
#

@slender iron did the HSTX display change to 8bit color even for the smaller resolutions like 320x240? The other day Bitmapsaver was working for those displays when I tested, but now I seem to always get ValueError: Display must have a 16 bit colorspace raised even if I change the display to 320x240 in settings.toml.

slender iron
#

yes, I think so. I think you can change bit dept in settings.toml too

lone axle
#

fill_row() function seems to only support 16bit, which is what bitmapsaver uses. Ahh that is good to know.

lone axle
#

maybe we can add support for 8bit fill_row() in FrameBufferDisplay so that screenshots can work.

slender iron
#

sure! should be easy

lone axle
#

I had a quick try it at. It was easy enough to get it to not raise the exception, but I'm not quite understanding where a color conversion needs to occur to account for it. The resulting screeshot comes out with white sections ending up as a mix of yellow and blue, which does seem like a 16bit to 8bit conversion issue where it might be truncating instead of converting to me perhaps. fill_row() ends up using fill_area() from Group and ultimately TileGrid or Vectorio objects. There is some logic inside of TileGrid fill_area() which references 8 bit color depth already, but I'm not sure entire what it's doing or if that part of the code is relavent to the color issue.

#

claude was happy to attempt to modify TileGrid fill_area() in a few different ways, but none that worked. I don't have my head wrapped fully around what is input_pixel and what is output_pixel in the use-case of bitmapsaver / display.fill_row() and which one needs to be converted to what colorspace in order to account for the display being in 8 bit depth. I'll move on for now, but maybe circle back and try some more later.

slender iron
#

looks like it's reading the wrong bits sometimes

#

but looks close

lone axle
#

None of claude and I's attempts at changes inside of TileGrid.fill_area() ended up with improving the colors any.

slender iron
#

I think you'd need to expand the row from 8 bits to 16bits before returning from fill_row

#

because the bitmap saver assumes it is 16bit color

tulip sleet
#

I am setting up to build 10.x bundles, but the 9.x .mpy's will work just fine.

orchid basinBOT
manic glacierBOT
#

Was able to catch a failure with gdb over JTAG running. In the case I caught, crash was due to a double fault on thread 4:

Thread 4 (Thread 1070344812 "No Name" (Name: No Name, State: Running @CPU1)):
#0  _DoubleExceptionVector () at /home/rabeles/Development/cp-development/issue-9937/cp-repo-92x-9937/ports/espressif/esp-idf/components/xtensa/xtensa_vectors.S:564
#1  0x600c0034 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

In this instance the thr...

manic glacierBOT
#

Following up on https://github.com/adafruit/circuitpython/issues/9541, I decided to look into getting touchio working for RP2350 without causing too much API change.

Here's a first attempt. It adds a new boolean pull_dir parameter to touchio.TouchIn. Defaulting to pull_dir=False, TouchIn acts as before. If pull_dir=True and an external 1M pull-up is wired, TouchIn will now also work on RP2350.

I believe this is similar to what DanH was imagining, but much simpler. (It fel...

jaunty juniper
#

hey since we have selectable sockets, is there any code using it ?

manic glacierBOT
#

CircuitPython version and board name

Adafruit CircuitPython 9.2.6 on 2025-03-23; Seeed Xiao ESP32-C6 4MB Flash 512KB SRAM with ESP32-C6FH4

Code/REPL

import board
import alarm
import microcontroller
# LED pin for observing if deep sleep was reached (LED will go out)
LED_PIN = microcontroller.pin.GPIO15
led = digitalio.DigitalInOut(LED_PIN)
led.direction = digitalio.Direction.OUTPUT
led.value = False  # turn on LED
pin_alarm = alarm.pin.PinAlarm(pin=board.D9, ...
ionic elk
#

I've finished a simple compiling implementation of my microROS support module, but unfortunately I'm getting a hardfault on init. Going to be deep diving on why but if anyone would be willing to give my allocator code a glance and tell me if I'm doing something deeply misinformed, I'd be very greatful! https://github.com/adafruit/circuitpython/blob/f171c44c4a72716f37db736f7063e05bf3943610/ports/espressif/common-hal/rclcpy/__init__.c

GitHub

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

#

microros needs an allocator object to be able to store stuff like the strings it uses for node names. I implemented what it recommended with micropython's m_ versions but evidently something has gone wrong

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

You should not need to do this -- there are plenty of other f-suffixed constants. Which compiler and version are you using? I don't see these errors in the CI logs.

In file included from ../../py/obj.h:31,
                 from ../../shared-module/audiodelays/Reverb.h:8,
                 from ../../shared-bindings/audiodelays/Reverb.h:9,
                 from ../../shared-module/audiodelays/Reverb.c:10:
../../shared-module/audiodelays/Reverb.c: In function 'audiodelays_reverb_ge...
manic glacierBOT
manic glacierBOT
#

Hey, I am currently trying to get XIAO ESP32C3 board to go into deep sleep. I don't fully understand why alarm is unavailable for its port. This PR explicitly says that all ESP boards should have it available. I think most ESP32C3 ports don't have it. See for example my board:

https://circuitpython.org/board/seeed_xiao_esp32c3/

alarm module is unavailable for both CirPy v9 and v10.

Can you help me understand the issue?

manic glacierBOT
#

Hi, it's disabled by default on some boards with 4MB of flash or less, but will be added in Circuitpython 10 once we change the partition scheme (which will be relatively painless on C3 boards if you are used to save your files before updating Circuitpython with esptool).
https://github.com/adafruit/circuitpython/blob/ad73d0bc8eea469c852f4f088931d8bbb6c49e7a/ports/espressif/mpconfigport.mk#L280-L288

manic glacierBOT
#

I'm learning how this works, but what I see is that when the palette is modified, the self->current_area_dirty of the shape is not set to true (which seems normal), and its self->ephemeral_dirty_area is empty. It's only redrawn because displayio_palette_needs_refresh returns true on its palette, when vectorio_vector_shape_get_refresh_areas is called.
https://github.com/adafruit/circuitpython/blob/ad73d0bc8eea469c852f4f088931d8bbb6c49e7a/shared-module/vectorio/VectorShape.c#L502-L503
C...

manic glacierBOT
#

CircuitPython version and board name

CircuitPython 9.2.7 RP2040-Zero

Code/REPL

import time
import board
import busio
import adafruit_scd4x
import adafruit_sht4x
import adafruit_sht31d

i2c = busio.I2C(board.GP1, board.GP0)
si2c = busio.I2C(board.GP3, board.GP2)

Behavior

[144854.408519] usb 9-2: new full-speed USB device number 4 using xhci_hcd
[144854.539664] usb 9-2: New USB device found, idVendor=2e8a, idProduct=101f, bcdDevice= 1.00
[144854.5396...

manic glacierBOT
#

Had a few fresh ideas. Found the CP task's stack by exploring its OpenRTOS TCB, and then decoded it manually:

tos:                                0x403818f4	0x4002e2a8
0x3fcc1f98:	0x00060e30	0x820032d8	0x3fcc2050	0x3fcc2178 m_alloc
0x3fcc1fa8:	0x00000001	0x00000001	0x00000004	0x3c1ee794
0x3fcc1fb8:	0x3c1efca0	0x00000000	0x3fcc2020	0x3c1efca8
0x3fcc1fc8:	0x3fcc2054	0x00000004	0x3c1efcac	0x00000017
0x3fcc1fd8:	0x00000000	0x0000001e	0x00000000	0x00000000
0x3fcc1fe8:	0x40056f5c	0x40056f72	0xf...
manic glacierBOT
#

I'm learning how this works, but what I see is that when the palette is modified, the shape is not impacted: self->current_area_dirty is not set to true (which seems normal), and its self->ephemeral_dirty_area is empty. It's only redrawn because displayio_palette_needs_refresh returns true on its palette, when vectorio_vector_shape_get_refresh_areas is called.
https://github.com/adafruit/circuitpython/blob/ad73d0bc8eea469c852f4f088931d8bbb6c49e7a/shared-module/vectorio/VectorShape.c#L...

lone sandalBOT
manic glacierBOT
#

CircuitPython version and board name

Adafruit CircuitPython 10.0.0-alpha.2 on 2025-04-04; Waveshare ESP32S3 Touch LCD 2 with ESP32S3

Code/REPL

import board
import displayio
import time
import vectorio

display = board.DISPLAY
display.auto_refresh = False

pal = displayio.Palette(1)
pal[0] = 0xFF0000
shape1 = vectorio.Circle(pixel_shader=pal, x=50, y=50, radius=30)

main_group = displayio.Group()
main_group.append(shape1)
main_group.append(shape1) # expected ...
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

For the re-used 'Okay' button I think a Bitmap and TileGrid are more likely to be in use than a Vectorio shape. In the case of Bitmap and TileGrid you can have multiple TileGrids that share the same Bitmap, so you could make two TileGrids that re-use the same Ok button graphic Bitmap file and put them in two different Groups.

I haven't traced through all of the code to be sure, but I think that both TileGrid and Vectorio shapes have internal variables related to dirty region and refreshing t...

manic glacierBOT
#

Confirmed that for RP2350, SRAM contents do not survive a POR. This eliminates RESET button press during wait_for_safe_mode_reset() as a viable method for entering safe mode on these parts. Since the Raspberry Pi Pico boards lack a RESET button, using the RUN pin was never an entirely useful option for these boards.

It is feasible to sense the BOOT button during the "wait for reset" interval. When pressed, the BOOT button pulls the flash memory CS wire low. A small routine running from SRA...

manic glacierBOT
#

Good point.

If I strap D9 to ground or 3V3, the board still does not sleep.

I tried with the following alarms individually, all which failed to sleep:

pin_alarm = alarm.pin.PinAlarm(pin=board.D9, value=True, pull=False)
pin_alarm = alarm.pin.PinAlarm(pin=board.D9, value=False, pull=True)
pin_alarm = alarm.pin.PinAlarm(pin=board.D9, value=False)
pin_alarm = alarm.pin.PinAlarm(pin=board.D9, value=True) 
candid sun
#

<@&356864093652516868> We'll have our weekly meeting in about 90 minutes from now in this text channel and in the circuitpython voice channel. Please take the time to add your notes in advance to the document: https://docs.google.com/document/d/1YPAPoECwKzqUCmavSv04hAZjQAgRlVLxPIYjfHTctbE/edit?tab=t.0 -- I look forward to everyone's updates!

lone axle
lone axle
#

Thanks for hosting Liz, have a great week everyone! šŸ‘‹

slender iron
#

@mortal kernel are you going to stay in esp32 debugging land or move to another platform?

#

you could also try doing the esp-idf update

mortal kernel
slender iron
#

ok, sounds good. let me know if you have any questions about any of it

#

There are other esp32 issues to debug as well if you want to do debugging

#

safe mode on rp2350 would be good though

mortal kernel
slender iron
#

updating idf first is probably best though. since it could be a bug on their side

#

anything in 10.0.0 with an esp32* label

mortal kernel
#

Sounds good. I just got into safe mode on my first try of my BOOTSEL update. A bit flaky, but the whole sense the flash CS line thing works. Woot!

slender iron
#

on what board? most boards besides pico can do it as a normal input

#

I wouldn't add something special for pico

candid sun
#

Here is the notes document for next Monday’s CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if you’ll be attending the meeting - it’s super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868>

https://docs.google.com/document/d/1q0T9l-qybjcu0ID3zVOcn2vIgiXJgV_teC48ew8GNrI/edit?tab=t.0

slender iron
mortal kernel
slender iron
#

this is metro rp2350

mortal kernel
#

Hmmm, we've got some variation among boards.

slender iron
#

feather 2350

#

how are you reading it?

#

you should be able to read the usbboot pin rather than cs

jaunty juniper
#

I don't know if most RP2(350) boards supported by CP have the boot button on a pin, do the Waveshare and Seeed ones do it for example ? And then we still want a way to put the pico 2 in safe mode, speaking as someone who does support

mortal kernel
#

I don't see USBBOOT making its way to any of the RP2350 pins on the Feather.

jaunty juniper
#

there's no diode either

#

which is necessary for the button setup I believe

slender iron
#

ah true

#

it seems like a bad idea to mess with cs directly

#

the bootrom can do it because flash isn't active yet

mortal kernel
#

We're early enough in the boot process (no second core started), so it should be safe. But I'm not rejecting your caution. I didn't isolate the reason that SRAM was getting garbaged. Maybe I should take another look?

slender iron
#

the first core is running code from flash

mortal kernel
#

It is, but I jump into SRAM with interrupts disabled to sense the pin.

slender iron
#

I'm curious what the datasheet says about ram clearing

timid igloo
#

heya, not to butt in, but can i ask a quick sanity-checking question? I'm doing a project with some RGBMatrix hub75 displays, on an rp2350, and i have the basic code working which is fine. But my stretch goal is to have an SD card connected via SPI, and stream many frames of 32x32 or 64x64 bitmap data off it, ideally at like 8-10fps (or more of possible but not required) ... i know that sd cards on spi are running the slowest way possible, so I'm wondering if i'm within the ballpark of a doable idea or if i need to think of an alternative

timid igloo
#

got it, ok! , my bad!

slender iron
#

np this channel is for developing CP itself

mortal kernel
#

I went over it carefully. It doesn't say anything specifically about clearing in the hardware, but bootrom code clears it under certain circumstances. What it does say is that the POR does a complete power up on all of the power boundaries.

#

After just now repeating a test on the saved location a number of times, it looks like what I was taking for garbage is actually a repeating pattern. Powering SRAM up/down wouldn't do that. Maybe we're getting clobbered by the much more complex bootrom code?

slender iron
#

yup, that could be. though there is separate bootram too

#

we definitely had that problem on nrf

mortal kernel
#

Mysterious. Let me spend a few more cycles on it.

slender iron
#

looks like we'll have to use the boot button

#

ram is powered down by run

#

@jaunty juniper would safe mode from repl help people?

mortal kernel
#

OK, that issue and the one it links are congruent with what I'm seeing. No SRAM breadcrumbs for us. I wonder if we could use the double-tap hardware flag mentioned in #2043/#2083?

slender iron
#

I don't think so because the bootrom will be triggered then

mortal kernel
#

Yeah, you're right. I'll put it aside for now and wait to hear whether we want to pursue the BOOTSEL path.

slender iron
#

ya, go ahead with reading cs

#

I agree its best to have safe mode working

#

I ran into this myself last week

mortal kernel
#

I've used it, too. So I agree.

slender iron
#

kk, lunchtime for me

#

thanks for getting it working!

manic glacierBOT
jaunty juniper
#

and might end with having to nuke the flash

devout jolt
#

Thank you @candid sun for hosting the meeting! Sorry I couldn't be there

manic glacierBOT
#

Hi - Did you have a chance to listen to the CircuitPython meeting recording for today?

What @tannewt suggested, and makes sense to me, is to add an optional argument to TouchIn, which is the pull direction, and which defaults to DOWN. For native TouchIO, the argument is ignored (we didn't discuss that case in the recording). For boards that support generic TouchIn with a pull-down, the pull argument must be DOWN (which it defaults to, so not change in user code required). Otherwise raise...

#

Just listened now, after having seen the github. doh!

Having an optional argument to TouchIn() is what I originally did (you may've seen my opened-and-quickly closed PR #https://github.com/adafruit/circuitpython/pull/10223) as I realized this would impact all other ports, increase their code footprint, and require me to touch many more files to adjust the touchio API for all ports.

As I listen to the meeting audio, I'm conflicted. I like the simplicity of this change, but dislike ...

wraith crow
#

@slender iron I've started playing with your pathlib branch, I know it's in early dev but when I spot things do you want me to submit PRs to your fork, post issues or just wait until it's further along?

slender iron
#

PRs to my branch are fine! thanks!

manic glacierBOT
#

I saw that PR. I was going to comment that I think it's OK, and preferred, to use digitalio.Pull, because we use that consistently elsewhere. The argument will need to be validated to be of type Pull or None. Yes, it will grow the SAMD21 port slightly. We could #if out the validation on SAMD21 (or anything not TOUCH_NATIVE) to save space if we needed to.

SAMD21 and Espressif are the only two ports with native touchio. So there aren't that many other places to change to add the extr...

#

Changing all ports is the nature of changing a CircuitPython API. It ensures consistency. The reason is to make the up or down choice explicit so folks know to change their setup.

The benefit of adding an additional parameter would be that you can use the common touchio code still. It can support both up and down and only raise an exception on RP2350 with down.

Do we want to split out generic touchio into a new module? That wouldn't change touchio on SAMD and allow both to coexist in th...

#

4mb flash boards of ESPs disable alarm and bleio in favor of dual bank and OTA. Let's switch this for 10. To do so, we need to remove all CIRCUITPY_LEGACY_4MB_FLASH_LAYOUT. This will move all boards to a non-ota partition scheme. We can do all non-S2 and S3 boards because they require a TinyUF2 update.

https://github.com/adafruit/circuitpython/blob/ea91e38c25f9d948a3feea52ded3587c030fa02b/ports/espressif/mpconfigport.mk#L280-L294

This was added in https://github.com/adafruit/circuitpython...

#

As for comments on your questions, I think it is fine to keep reverb in audiodelays. Although it is filter-based, it is mostly associated with delay, and it is unlikely at the moment for us to add multiple reverb-based effects in to warrant a dedicated audioreverbs module (but I am a fan of spring reverb...). It can always be moved around in a future release if need be.

Okay, I may have changed my mind. What if we did create a new audioreverbs module, renamed this effect to "Room...

#

That was my original attempt, however the boards that had displays defined as board.DISPLAY didn't like the dynamic memory allocation. I tried multiple pointer configurations to try and get the compile to work but didn't look into modifying how board.DISPLAY was defined.

I can go back and dig into the board.DISPLAY setup and try and get it to work with the dynamically allocated memory structure if you think that makes sense.

slender iron
#

@lone axle did you try buffering the audio at all?

lone axle
#

I don't know how to buffer the audio from a wave file. Is there example code of that somewhere?

slender iron
#

the 720x400 is definitely more taxing on the memory bus

manic glacierBOT
lone axle
# slender iron Looks like you can provide a buffer: <https://docs.circuitpython.org/en/latest/s...

I tried changing the wave init line to be like this: wave = WaveFile(wave_file, bytearray(1024)) and there are loud chirping and scratching sounds in the audio playback with it that way. Similar to the artifacts that were audible witht he larger .wav files. If I remove the bytearray(1024) argument and run the same code and audio file I don't hear the loud chirping and scratching. This was all with the 360x200 display size. I will try 720x400 in a moment.

manic glacierBOT
#

I still don't have a working understanding of the complete CP memory model so I'm not sure how I would do that, is there a mechanism like port_malloc that would allocate heap space?

Yup, m_malloc and a number of other helpers:
https://github.com/adafruit/circuitpython/blob/ea91e38c25f9d948a3feea52ded3587c030fa02b/py/misc.h#L77-L111

These allocate into split heap chunks that are allocated with port_malloc.

lone axle
#

Essentially the same with 720x400, there is more loud chirping and scratching when using bytearray(1024) than without. Though at that resolution there is some scratching and chirping even without bytearra(1024) The visual artifacts of static and letters disappearing are the same in both cases at 720x400 as well.

slender iron
#

ya, I bet it is just pushing memory bandwidth too hard

#

I remember seeing code.py slow with 720x400 too

#

I wonder if we should make picodvi able to switch modes

#

the problem with starting up in a lower res is that it's unlikely you'll be able to allocate a bigger framebuffer later

#

for a text editor

manic glacierBOT
blissful pollen
#

I have found when the audio doesn't get the CPU cycles required you start to hear more scratchy type behavior. Sometimes (depending what is taking those cycles) a time.sleep(0.01) is enough to help trigger RUN_BACKGROUND_TASKS to go

slender iron
#

@lone axle I wonder if you'd be better off with a better sample

lone axle
#

I don't know. Honestly I have very little experience with audio.

slender iron
#

want me to play with it?

#

I should probably finish the pathlib stuff first

lone axle
# slender iron want me to play with it?

I do not have confidence that I can make it any better than the current version posted to the issue with it running at 360x200 with the reduced size wave file that is attached to the issue.

If there is a desire to improve it beyond that, or run it on the 720x400 resolution display and have the animation run without the blinking in and out and loud audio artifacts then I do not feel like I can do that, so I would need more direct help or ideas from you or someone else.

slender iron
#

ok, I'll do that this week

#

I think mark is onto something because we have to do conversions to match the output format of the i2s

blissful pollen
#

I don't really have time at the moment but feel free to send me something @lone axle and I can take a look at it.

You can also use audiomixer on top of the wave and it allows larger buffers if that helps.

lone axle
slender iron
#

it looks like the i2s output always does a copy too

lone axle
#

(running at 720x400) time.sleep(0.01) inserted into that code after display.refresh() does maybe make the audio slightly better, but still some scratches remain, and the leters are still disappearing.

slender iron
#

I'll look at it later this week

wanton knot
#

I ran into similar things recently. No amount of sleep really helped. Only thing that helped was increasing the buffer size.

#

My dog REALLY hates the 'scratching' sound as you described it.

slender iron
#

ya, not pleasant

#

audio would love a real RTOS

lone axle
slender iron
#

I'd rather get it working without overclocking

lone axle
#

If there is something incompatible with the overclocking technique shown in that video and the Fruit Jam or something else about newer version of circuitpython it might be good to add a warning to the description of that video or as a popout in it if possible.

slender iron
#

my thinking is to put gpio highs and lows around sound processing and display processing to see how they interact

#

I consider overclocking to be you do it at your own risk

lone axle
#

That isn't mentioned in the description or introduction of the video, and the video does kind of make it seem like this is supported functionality IMO.

manic glacierBOT
manic glacierBOT
#

CircuitPython version and board name

Raspberry Pi PicoVerified on 8.x, 9.x, and even the 10 pre-releases. raspberry_pi_pico_w, but also verified on a pico 2w.

Code/REPL

import board
import audiobusio
import audiocore
import time

audioOut = audiobusio.I2SOut(bit_clock=board.GP8, word_select=board.GP9, data=board.GP7)
sound = audiocore.WaveFile("leftright.wav")
audioOut.play(sound)

while audioOut.playing:
	time.sleep(1)
	
print("done")

Behavior

No ...

manic glacierBOT
#

Do this after you've gotten the display object to inspect.

Thanks! moving it is much cleaner.

Maybe add an actual function to get display X that can switch been the static array and the dynamic one.

When you suggest an actual function do you mean the macro functions I'm using in the other modules? I left it out here because there were only a couple instances and thought it was easier to understand without the macro. Or are you suggesting I add a new common_hal function that retur...

mortal kernel
#

@danh I need a small assist getting the UF2 bootloader flashed onto an oddball board, the SAM E54 Xplained Pro. This is for issue #10172. No hurry.

manic glacierBOT
#

Misplaced """. I do this all the time and now prefer to put the closing """ on a separate line to make the mistake less likely. Also touched up the arg description a bit.

//|         :param ~microcontroller.Pin pin: the pin to read from
//|         :param Optional[digitalio.Pull] pull: specify external pull resistor type. If None, assume pull-down or chip-specific implementation that does not require a pull.
//|         """
//|         ...
manic glacierBOT
blissful pollen
#

@lone axle Took a look at the issue and code, and I suspect there is a load of disk loading from the sprite sheets and the wave file that are probably slow. I'll try to see if I can run it on a RP2350 even without a display hooked up (I don't have one).

#

If you want to try a larger buffer with audiomixer you could like:

mixer.voice[0].play(wave)
audio.play(mixer)
manic glacierBOT
#

I wonder if it'd be more fruitful to just try and allocate displays to the CP heap

m_malloc seems to complain (crash) if the VM is not running. I could allocate the m_malloc memory when the display is allocated in the displayio modules allocate_display and allocate_display_bus. I think I'd need to add a new structure to keep track of which displays had not yet had memory allocated as well. None of the dynamic displays would survive the VM but I could copy the primary display to the s...

manic glacierBOT
#

CircuitPython version and board name

Adafruit CircuitPython 10.0.0-alpha.1-19-g380b8bda7a-dirty on 2025-04-08; ESP32-S3-DevKitC-1-N8R8 with ESP32S3
Board ID:espressif_esp32s3_devkitc_1_n8r8
UID:468E334483CD

Code/REPL

import busio
import board
import sdcardio

sd_card_cs_pin  = board.IO15
spi0_module     = busio.SPI(clock=board.IO12, MOSI=board.IO11, MISO=board.IO13)
sd_card = sdcardio.SDCard(spi0_module, sd_card_cs_pin, baudrate=int(250000))

buff_write = by...
manic glacierBOT
#

As mentioned above the Mac seems to cache the old name. To forget the old name on the Mac I seem to be able to:

  1. Run "Audio MIDI Setup"
  2. If the Pico is connected and powered on I can see it in Audio MIDI Setup
  3. Disconnect the Pico (You can't delete the device in Audio MIDI Setup unless you disconnect it)
  4. Select the Pico in Audio MIDI Setup
  5. Delete the Pico
  6. Reconnect the Pico and it will reappear in Audio MIDI Setup

I called usb_midi.set_names() from boot.py per the instru...

manic glacierBOT
#

CircuitPython version and board name

Hello.
Not sure if this is a bug report or a feature request, but I was wondering if there is a way to prevent IO pins from changing state randomly while the device boots?

I use these ESP32-S3-Zero boards to build wireless light sources, I use 4 pins as PWM outputs to drive some LED drivers. While the ESP32 boots circuitpython, before my program runs, the pins go through a cicle of full on - full off, which makes my LEDs go full on while th...
manic glacierBOT
#

The pins may be going from unconnected to pulled up. The default reset state for a pin is to enable the internal pullup, which is roughly 50 kohms: this minimizes power draw, believe it or not. We used to reset the pins to float, but changed it to the standard reset state several years ago.

I think the reliable thing to do here is to put a stronger external pull-down resistor on these pins, like 10k. That will ensure that pin fluctuations during restart don't affect your outputs.

mortal kernel
#

I'm looking for some help getting the uf2 bootloader flashed onto a SAM E54 Xplained Pro board.

tulip sleet
# mortal kernel @danh I need a small assist getting the UF2 bootloader flashed onto an oddball b...

That board has a second microcontroller on it that provides an "EDBG" (Embedded Debugger). The documentation could be better but it says it's usable from Atmel Studio. https://onlinedocs.microchip.com/oxy/GUID-AA358083-AEED-4BA8-8511-9F986D3390A5-en-US-2/index.htmlhttps://ww1.microchip.com/downloads/en/devicedoc/atmel-42096-microcontrollers-embedded-debugger_user-guide.pdf
You can also connect something like a J-Link via SWD: https://onlinedocs.microchip.com/oxy/GUID-AA358083-AEED-4BA8-8511-9F986D3390A5-en-US-2/GUID-561FB075-0555-4441-A9EF-9D50F20850C7.html
Atmel Studio has flash programming features. It is huge to install but oh well.

#

I can't remember, do you have a BlackMagic probe or a J-Link?

manic glacierBOT
tulip sleet
#

J-Link supports JFlashLiteExe, a simple flasher, and I imagine there may be something similar for other SWD probes

mortal kernel
#

I have a J-Link and an Atmel programmer. I wanted to avoid Atmel Studio, but if it must be...

tulip sleet
#

the J-Link would be the simplest, assuming you have the cables

mortal kernel
#

I do.

tulip sleet
#

the Atmel programmer is probably also fine, and there may be standalone tools. I have only used Atmel Studio a few times, to mess with fuses.

#

The UF2 bootloader fixes up the fuses (setting BOOTPROT properly) if it detects they are wrong. It sets the fuses properly and then restarts itself.

#

JFlashLiteExe is part of the J-Link software package

mortal kernel
#

That's a nice feature re: fuses. So I should be able to build the binary and flash with JFlashLiteExe without having to install Atmel Studio?

tulip sleet
#

yes, you can build it in Linux with adafruit/uf2-samdx1 and just flash the .bin

mortal kernel
#

Magnificent. you've saved me a bundle of time.

#

Thank you! Gotta go now...

tulip sleet
#

there are a couple of boards already there that might just work or you just need to tweak: generic-atsame54 and same54_xplained

manic glacierBOT
#

Thanks for the detail issue description, I looked through the modules you covered and I could be mistaken but I think there is an unsigned integer issue.

sdcardio_sdcard_writeblocks/readblocks return mp_uint_t values so the negative errors end up as positive 2s-compliments in common_hal versions of the routines. The mp_unit_t write_blocks routine appears to only return EAGAIN, errors with mangled negative codes or a zero so the return value could be forced negative if non-zero in the calling...

mortal kernel
#

@danh One quick thing before I head out the door: The SAME54-Xplained boards have switched to the SST26VF064 flash part. The new boards with that part are red while the older boards with the original flash part are blue. There may be a few blue boards with the SST26VF064 out there that were made during the chip shortage, but I'm not 100% sure about that. The key difference between the boards (aside from the new red boards not working with CP that I'm fixing) is that red boards have 8MB of flash while the older blue boards have 16MB. This info should go into doc somewhere...

manic glacierBOT
#

I'm assuming that all functions that call ā€œsdcardio_sdcard_writeblocksā€ and ā€œsdcardio_sdcard_readblocksā€ are of int type, so changing the function type to mp_int_t and negating MP_EAGAIN should not break anything.
If do not change the function type, everything will still work. A negative error will become just a large positive number, for example MP_EAGAIN = 11, but if you change it to -11, the functions will return something like 0xFFFFFFF5. But since all calling functions are of int type, t...

#

The project from this learn guide: https://learn.adafruit.com/cleveland-museum-of-art-pyportal-frame

Is unable to run on CircuitPython 9.2.7 on either Pyportal or Pyportal Titano. I did not try earlier versions to find the last working one, but could if that is helpful.

Here is its output include stacktrace. The project code wraps the exception with a message about the SDCard but the rest of the trace shows the root cause is pystack exhausted in the network stack libraries.

code.py ou...
manic glacierBOT
#

CircuitPython version and board name

See AdaFruit Forum:
10.0.0 Alpha-2 created 2 drives

Adafruit CircuitPython 10.0.0-alpha.2 on 2025-04-04; Raspberry Pi Pico W with rp2040
Board ID:raspberry_pi_pico_w

Code/REPL

Any code.py

Behavior

10.0.0 Alpha-2 creates 2 drives on Pico W. One showing the files. The other waiting for the user to insert an SD card in the USB drive. The Pico W does not have an SD card slot.

Description

Extra SD drive

##...