#circuitpython-dev

1 messages · Page 84 of 1

manic glacierBOT
wraith crow
#

@slender iron Did you miss the PR I made to your pathlib fork or am I missing something about the proposed fixes?

slender iron
#

ya, I didn't see it

#

lemme look

slender iron
wraith crow
#

Looks like you got one of the commits, but I don't see the second one

manic glacierBOT
manic glacierBOT
slender iron
#

@lone axle the clicks are garbage collections

lone axle
#

The "loud chirp" or more "scratchy" sound? or both are the same root cause?

slender iron
#

I think the chirp

#

lunchtime and then I'll keep poking at it

manic glacierBOT
slender iron
#

@mortal kernel you around?

#

I'm looking at rp2 psram stuff

mortal kernel
slender iron
#

got time to chat?

mortal kernel
#

You bet.

lone axle
#

Nice! the audio sounds clean to my ear.Tthe letters disapearing and white static visual artifacts seem gone as well. The fly-on and sprite frame animations feel a bit slower than before. Was the color sweep causing issues?

manic glacierBOT
slender iron
#

The letters disappearing was caused by DMAing the audio out of PSRAM

#

working on a more robust fix for it now

manic glacierBOT
blissful pollen
slender iron
#

I removed the use of enumerate

#

it generates tuples that then get unpacked immediately

#

but still need to be collected

blissful pollen
#

ah cool, thanks for the info. Good to know.

jaunty juniper
#

oh that's sneaky

slender iron
#

yup, I kinda want to look into how it is implemented

#

in case I can pass the iterator a "I'm going to throw away the tuple" flag so it can reuse one

blissful pollen
#

I guess the other option is to disable the GC during the animation (or similar high processing times) but not sure if that has any side effects

jaunty juniper
#

I wonder what the Micropython people think about that

slender iron
#

it is pretty large in this case because the bitmaps are loaded into it

#

the collect was taking 120ms

manic glacierBOT
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
>>> board.DISPLAY.rotation = 0

Behavior

This causes a black screen with blinka in the corner.
Note that it doesn't change the rotation, the default being 0.
A quick test of builds from S3 seems to point to #10208

Description

No response

Additional information

No response

mortal kernel
#

@danh A big thank you for the flashing tips! Just got back around to it about 10 minutes ago and that's all it took to build and flash the uf2 bootloader. The J-Link .deb package installed without a hitch and JFlashLiteExe worked on my first try.

#
UF2 Bootloader v3.16.0-19-g4365018 SFHWRO
Model: SAME54 Xplained
Board-ID: SAME54P20A-Xplained-v0
manic glacierBOT
onyx hinge
#

Miss y'all. Here are some snaky snakes.

stuck elbow
onyx hinge
#

ooh good guess! It's actually https://en.wikipedia.org/wiki/Tarot_Garden but the artist Niki de Saint Phalle was inspired by Gaudi.

The Tarot Garden (Italian: Il Giardino dei Tarocchi, French: Le Jardin des Tarots) is a sculpture garden based on the esoteric tarot, created by the French-American artist Niki de Saint Phalle (1930–2002) in Pescia Fiorentina, località Garavicchio, in the municipality of Capalbio, province of Grosseto, Tuscany, Italy. The park was opened to t...

orchid basinBOT
mortal kernel
#

For anyone struggling with OpenOCD, I've found pyocd to be a great alternative.

hazy nebula
#

Hi @tulip sleet this is ross from mchp

tulip sleet
#

mchip curiosity

manic glacierBOT
manic glacierBOT
#

Fixed some lost changes that should have been in the last commit, I think I missed adding changes and reset them by accident. Hence the mismatched macros etc.

I'm having no luck even calling rclc_support_init(&_my_default_support, 0, NULL, &_my_default_allocator); with the default allocation settings, as an isolated call with no followup. Is there any kind of memory protection I need to be taking into account here? It seems like other modules use m_malloc etc without much issue.

manic glacierBOT
#

Okay, I may have changed my mind. What if we did create a new audioreverbs module, renamed this effect to "RoomReverb" or "Freeverb". Then, we could aim for "SpringReverb" and "PlateReverb" additions in the future? I'm not certain exactly how those would work or if they're feasible for the target platforms, but it would definitely give us sufficient variety. Other potential reverb types could be "ReverseReverb" and "Flerb" (has a "flanging" sound).

@tannewt @dhalbert Any preference on ...

#

The advantage of a separate module is that we can turn it off if there are space problems. So I don't think it's bad. Didn't we have audioeffects for a while but it became too big?

As for further reverbs, how different are they in terms of code? Could you make a parameterized reverb that handles all of those in a single class with parameters, or is there something different in the calcuations?

manic glacierBOT
manic glacierBOT
#

The advantage of a separate module is that we can turn it off if there are space problems. So I don't think it's bad. Didn't we have audioeffects for a while but it became too big?

There was never a singular audioeffects module to my knowledge since we moved to separate modules in initial talks. Nonetheless, I am in agreement.

As for further reverbs, how different are they in terms of code? Could you make a parameterized reverb that handles all of those in a single class with pa...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

CircuitPython version and board name

Adafruit CircuitPython 9.2.7 on 2025-04-01; Adafruit Metro RP2350 with rp2350b

Code/REPL

# No code needed to trigger the bug, just:
# 1. Connect HSTX DVI adapter to an HDMI capture card with HDMI passthrough to a TV
# 2. Power up the board with an empty code.py
# 3. Let CircuitPython supervisor initialize the default picodvi.Framebuffer config

Behavior

When I connect the Metro's HSTX port to a DVI adapter and co...

tulip sleet
#

SST flash debugging

manic glacierBOT
manic glacierBOT
#

CircuitPython version and board name

Not working:
Adafruit CircuitPython 10.0.0-alpha.2 on 2025-04-04; Adafruit Feather RP2040 USB Host with rp2040
Adafruit CircuitPython 10.0.0-alpha.2 on 2025-04-04; Adafruit Metro RP2350 with rp2350b
Adafruit CircuitPython 9.2.7 on 2025-04-01; Adafruit Metro RP2350 with rp2350b

Working:
Adafruit CircuitPython 9.2.7 on 2025-04-01; Adafruit Feather RP2040 USB Host with rp2040

Code/REPL

# SPDX-FileCopyrightText: Copyright (c...
zinc walrus
#

@jaunty juniper, I know you've got a lot on your plate at the moment, so this is not at all pressing, but I've raised an issue on your CircuitPython_hsvtorgb_rainbow repo.

I'm busy too, so I can't troubleshoot in detail today, but I'll probably revisit it this weekend. Any suggestions you might have on how to debug would be welcome.

GitHub

The rainbow_wheel() function is extremely convenient, with higher resolution than the original FastLED 8-bit algorithm, however its return values can't be directly fed to NeoPixels because they...

manic glacierBOT
#

Tested with the Fruit Jam next and got some more positive results there.

Adafruit CircuitPython 9.2.7 on 2025-04-01; Adafruit Fruit Jam with rp2350b
Adafruit CircuitPython 10.0.0-alpha.2 on 2025-04-04; Adafruit Fruit Jam with rp2350b

Both find the gamepad and are able to read data from it.

I'm going to try swapping to a known good USB A breakout. All of the Metro testing was done with a new one that I haven't used previously. I have a few that I've used successfully with mice and ...

#

On the Metro RP2350 the gamepad is able to be found and have data read from it when it is connected via a CH334F USB hub (https://www.adafruit.com/product/5999). All testing prior to this comment was performed with the USB jack breakout (https://www.adafruit.com/product/4449) connected directly to the Metro.

On the Metro RP2350 under both CircuitPython 9.2.7 and 10.0.0-alpna.2 the gamepad does work if it's connected thru a CH334F hub, but not when connected directly.

manic glacierBOT
manic glacierBOT
manic glacierBOT
slender iron
#

@wraith crow have time for a voice/video chat about the display limit changes?

manic glacierBOT
wraith crow
slender iron
#

np

#

I'll hop in cp voice

wraith crow
#

sure, pythonisita is fine

manic glacierBOT
nimble dawn
#

Any idea when As7343 will be released?

manic glacierBOT
#

We just chatted about this. I'd like to see the environment variable removed and the dynamic array removed as well. Instead, we should return the static allocation for the first display allocation and then return dynamic ones after. The dynamic ones should deinit on their own when finalized. This should remove much of the code and remove the dynamic cap entirely.

Thanks for working on this @RetiredWizard!

wraith crow
#

@slender iron supervisor_background_tick iterates the displays (via displayio_background) to perform refreshes do we still want that functionality?

wraith crow
#

I can (at least temporarily) maintain a list of displays for refresh purposes. I suspect there also may be a way to have the displays register a refresh routine when it's allocated but if that's possible I'd need to do some research to figure it out.

slender iron
#

ya, I think you'll want a list somewhere that isn't the VM heap. if it is in a VM object, then it'll keep all of the displays around

wraith crow
#

okay, I'll work on that approach

slender iron
#

thank you!

manic glacierBOT
manic glacierBOT
#

Remove deprecated task queue operations. Use the shorter names instead:

  • push_head -> push
  • push_sorted -> push
  • pop_head -> pop

I'm going to make this a draft for now. When https://github.com/adafruit/Adafruit_CircuitPython_asyncio/pull/71 is merged and released, I will update the frozen libraries so we get the new versions and can run the tests.

manic glacierBOT
manic glacierBOT
#

The CYW43 driver does have something equivalent to listen_interval. See https://github.com/georgerobotics/cyw43-driver/blob/dd7568229f3bf7a37737b9e1ef250c26efe75b23/src/cyw43.h#L627C24-L627C38. In MicroPython, you can choose one of three power modes for wifi, but it could also be more flexible: https://docs.micropython.org/en/latest/library/network.WLAN.html#network.WLAN.PM_PERFORMANCE

So I'll fix this, and open an issue for CYW43 support.

orchid basinBOT
orchid basinBOT
#

Can't repro on Firefox or Safari, does it load on reloading the page ?
Can you have the "network" panel open in firefox when loading the page and not seeing the logo ?
Any errors in the console ?

I can actually see an error in the srcset:

/assets/images/logo-dark.png 1x, /assets/images/logo-dark@2x.png 2x, /assets/images/logo-dark3x.png 3x

The 3rd one should be logo-dark@3x.png.
If I understand the srcset, it picks an image depending on the screen "retina" type. On my mac I have 4...

manic glacierBOT
#

I tried cpu.frequency clock settings at 1MHz increments between 104MHz and 150MHz for 720x400. Most of those worked on my circa-2013 Samsung TV (60Hz, 70Hz, 72Hz, and 75Hz refresh). But, none would sync with my AverMedia GC551G2 capture card. According to the EDID info as detected by Linux display settings, the card only supports 640x480, 720x480, 720x576, 1280x720, 1280x800, and 1920x1080.

When I forum searched previously to see what people like for taking 720x400 captures from old DOS ga...

gusty siren
#

For those familiar with CAN bus and canio, I made a (very limited) CircuitPython-friendly database "file" generator / parser that takes in a kcd file and spits out a CircuitPython file. I don't love working in CAN and don't want to really be on the hook for maintaining the thing, but is this something that Adafruit would like to see and inspect if it is worth supporting? If so, I can send the source code <150 lines to Adafruit with an MIT license/whatever or figure out how to use the cookie cutter thing and publish some open source package.

manic glacierBOT
#

Figured out how to actually read and decode the capture card's EDID info using edid-decode on Debian.

This is the relevant part of the output for the video modes supported by the AverMedia GC551G2:

$ ls /sys/class/drm/*/edid
...[listing of edid files to try]
$ edid-decode /sys/class/drm/card0-HDMI-A-2/edid
...
Block 1, CTA-861 Extension Block:
  ...
  Video Data Block:
    VIC  63:  1920x1080  120.000000 Hz  16:9    135.000 kHz    297.000000 MHz (native)
    VIC  97:  3840x2160   60.00...
manic glacierBOT
#

hmm... that previous video mode list may have been inaccurate. I managed to accidentally plug the USB cable in only part way. So maybe the capture card was running in USB 2.0 mode instead of 3.x? This is the result I got from edid-decode after I fixed the cable and started over. It's pretty similar:

  Video Data Block:
    VIC  97:  3840x2160   60.000000 Hz  16:9    135.000 kHz    594.000000 MHz
    VIC  96:  3840x2160   50.000000 Hz  16:9    112.500 kHz    594.000000 MHz
    VIC  95: ...
tulip sleet
lone axle
slender iron
#

@tiny peak I want to see if we can make vblank longer to get our refresh rate lower

#

@tulip sleet I had a really good idea (hopefully) for improving gc collect times..... leaf allocations!

#

ones that promise to not include pointers

tulip sleet
#

only pointer is the type field?

#

is there a bit available to indicate that?

slender iron
#

no, for allocations that aren't objects at all

#

there isn't I'd have to add it

tulip sleet
#

would framebuf fall into that category?

slender iron
#

I kinda think we could redo the vm gc to mimic tlsf it has metadata per-allocation instead of separate tables

#

the framebuf object wouldn't but the buffer itself would

#

basically the specific types would know they are leaf allocations

tulip sleet
#

If there are also objects with nothing but data except for the type field (e.g.g array.array), could also save time

slender iron
#

the actual bytearray for example

#

exactly

#

bitmaps too

#

I was hacking this by allocating the bitmap via port_malloc

#

adding leaf allocations to the vm though means it still gets marked and swept

tulip sleet
#

oh, I didn't realize there was a separate allocation of the holder object vs the data block

#

this is an excellent idea

slender iron
#

I think there often is

#

and we can change it if there is

#

just doing bitmaps yesterday dropped gc time from 200ms to 40ms

#

(for a bitmap heavy fruit jam program)

#

I think the psram is pretty slow

slender iron
#

interesting that 1161 says all allocated chunks have a type word

#

(from 2015)

#

I could just mimic FTB

#

for now

ionic elk
#

could somebody remind me what the best call is for sending runtime string information to the REPL? I just need to print an integer error code

#

I know there are a few options but I've forgotten which is safest.

#

is it mp_printf?

manic glacierBOT
#

@blackketter @EternityForest : I have started on a PR to fix this. One thing I noticed it there seems to be a standard of "min", "max", and "none" for power savings / power management. I've seen the same terms used in ESP-IDF and in the CYW43 driver. It's something like this (this is from my work in progress):

//|     MIN: PowerManagement
//|     """Minimum power management (default). The WiFi station wakes up to receive a beacon every DTIM period.
//|        The DTIM period is set by th...
tulip sleet
manic glacierBOT
#

For my case, I just want to disable wifi power savings as much as possible to reduce latency and improve reliability. My experience with ESP32 on my network (Apple AirPort Extreme, mostly) was that connectivity was unreliable until I disabled power savings when developing on Arduino.

Indeed, I've found that the circuitpython web workflow can be unreliable and I'm betting that this is the cause.

lone sandalBOT
turbid radish
#

I've been making some additions to Awesome CircuitPython

ionic elk
#

Is it possible to use the esp32-s3's built-in jtag while running circuitpython, over the USB or UART port? Using the devkitC, which has both. Circuitpython docs have a TODO section for the S3. Want to check before I go all in on using my jlink.

manic glacierBOT
#

I've identified two root causes that are causing this bug:

  1. Failure to set the IOC bit in the flash configuration register was causing the part's WP# and HOLD# pins to be incorrectly configured for quad SPI operation. Additionally, a bug in CP flash initialization was causing the IOC bit to be reset after it was set.
  2. Sector protection scheme unique to this flash part was resulting in quiet failure of sector erase commands. A special ULBPR command is necessary during flash initialization...
mortal kernel
ionic elk
#

idk if I can swing that haha

mortal kernel
#

There's also an issue with CP resetting the JTAG pins that needs to be dealt with. Let me know if you do want to try and I'll fill you in on more details.

ionic elk
#

I guess I'm seeing now that using the jtag pins in general requires an irreversable fuse burn

mortal kernel
#

Yup. I did try to use the CMSIS-DAP that gets exposed on the USB port, but could never get it to work.

ionic elk
#

Disabling Jtag from ever working over USB again. I'd rather just use USB, if it's an option

#

is there a debug flag that will disable CPY drive access and allow JTAG to work over the USB line?

mortal kernel
#

Actually the fuse I documented leaves it configurable by external strapping.

ionic elk
#

oh I see yes, STRAP_JTAG_SEL

#

That probably does make the most sense and should also work on my DevkitC

#

is the 33 in espfuse.py --chip esp32s33 -p /dev/ttyACM0 burn_efuse STRAP_JTAG_SEL a typo?

#

guess it must be, not in the help option

mortal kernel
#

Yes.

#

fixed it.

ionic elk
#

it's also espefuse.py, not espfuse.py

#

thanks for the link! I've just burned that and I'll see if it gets me up and running.

mortal kernel
#

Good eyes and lousy typing on my part🙏

#

You'll need to patch the ESP Makefile and add a flag to the build command to stop CP from resetting the JTAG lines. Let me look it up.

ionic elk
#

this is some pain, probably worth an addition to the readme

mortal kernel
#

It's a WIP. I've moved on to some other issues for now but do plan to do a more complete write-up as time allows.

ionic elk
#

oh no not yours sorry! I meant the general espressif readme for circuitpython

#

your readme is great and this info would be great to share more widely

#

thank you for sharing it

mortal kernel
#

You'll need to add these lines to ports/espressif/Makefile:

ifeq ($(ENABLE_JTAG), 1)
    CFLAGS += -DENABLE_JTAG=1
endif
ionic elk
#

sorry I didn't mean to sound like a jerk judging your gist right after you offered help 😱

mortal kernel
#

No worries, you didn't.

#

When you build, add ENABLE_JTAG=1 to your make command line.

ionic elk
#

I wonder why that's not in there by default

mortal kernel
#

🤷‍♂️

ionic elk
#

any advice on the actual openocd command to run? The ones from my old notes are apparently obsolete

#

can't use openocd -f interface/jlink.cfg -f boards/esp32s2-saola-1.cfg etc

#

also, weird that the espefuse tool says 'STRAP_JTAG_SEL' (Set this bit to enable selection between usb_to_jtag and pad_to_jtag through strapping gpio10 when the docs clearly say gpio3

mortal kernel
#

Yes, I noticed the inconsistencies in the ESP doc re: the pin number, too. GPIO3 is the one that works!

#

For OpenOCD you want to pick up is the one provided by ESP-IDF. The easiest way to do that is to run the openocd command from inside the ESP-IDF venv.

#
openocd -f interface/jlink.cfg -f target/esp32s3.cfg -c "adapter speed 2000"
ionic elk
#

Ok, that's pretty much what I've been running so far

#

we'll see if the new build with ENABLE_JTAG puts it over

mortal kernel
#

Don't forget the strap!

#

BTW, DEBUG=1 is the way to go on the build. Otherwise, you don't get symbols and compiled code is too optimized to make sense of.

ionic elk
#

yep got that in already

#

trying to get some info out of a precompiled library so I've run into the limits of what mp_printf can get me

mortal kernel
#

Took me a ton of time to figure this all out, so I'm delighted to share it.

#

From my perspective, it's an indispensable tool to have in the kit.

ionic elk
#

hmmm, still no chip info

Open On-Chip Debugger v0.12.0-esp32-20240318 (2024-03-18-18:28)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
adapter speed: 1000 kHz
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : J-Link V11 compiled Apr 27 2021 16:36:21
Info : Hardware version: 11.00
Info : VTarget = 0.000 V
Info : clock speed 1000 kHz
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: esp32s3.cpu0: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
Warn : [esp32s3.cpu0] Unexpected OCD_ID = ffffffff
Error: [esp32s3.cpu0] Examination failed
Warn : target esp32s3.cpu0 examination failed
Warn : [esp32s3.cpu1] Unexpected OCD_ID = ffffffff
Error: [esp32s3.cpu1] Examination failed
Warn : target esp32s3.cpu1 examination failed
Info : starting gdb server for esp32s3.cpu0 on 3333
Info : Listening on port 3333 for gdb connections
manic glacierBOT
mortal kernel
#

Not to worry, I've seen that. First, check your strapping. The ESP32 stores it internally on a full POR, so just a reset won't change the JTAG selection.

#

If that's not the answer, double tap the board into the bootloader and give it another try.

#

I'm going AWK for an hour or so, I'll check back then.

ionic elk
#

I messed up some JTAG pins. I think I'm good now!

#

Thanks again for your help @mortal kernel !

#

I may try and get this stuff compiled in some public espressif port documentation

jaunty juniper
#

oh I'm getting a EADDRINUSE on bind() after an auto reload, I'll make a note and re-explore it later see if I can repro, some socket/status is not cleaned up at the end of code or there's some async in it, it seemed to resolve itself after a moment

crimson ferry
#

espressif or raspberrypi?

jaunty juniper
#

espressif, 9.2.7

#

I was actually using your tcp_server_CircuitPython_NATIVE.py to do some tests

crimson ferry
#

would be interesting to repro, thought that was fixed a year ago

jaunty juniper
manic glacierBOT
#

I tested with a Metro RP2040 and a two-channel I2S audio amp (Adafruit Pi Speaker Bonnet). The channels are swapped most of the time but not quite all the time. There are actually four different PIO programs in the code for left_justified or not, and for swapping the order of bit_clock and word_select or not. Those two pins must be consecutive, but we allow them to be in either order.

| bit_clock | word_select | left_justified | Left/Right swapped | using swapped bit_clock/word_s...

jaunty juniper
#

it then gets better but it took around 2 minutes of regular ctrl-D for listen() to not raise EADDRINUSE

crimson ferry
manic glacierBOT
#

Unless you want to take a swing at allowing independent dry/wet mix control globally, I vote we keep it standardized for now and then expand all effects in the future to support this functionality. This question might be better poised on a separate issue/PR, but how would you handle BlockInput support in that scenario?

I think I may leave it and get this PR in and we can look at how to handle mix better across the board later. I think for BlockInput on separate wet/dry I'd just let t...

crimson ferry
#

cool, I should update the server examples to be more robust

manic glacierBOT
#

For CYW43, is this different from https://github.com/adafruit/circuitpython/pull/6976 ? (https://github.com/micropython/micropython/issues/9455 is still open in MicroPython)

@anecdata: Well, that's interesting! I had no idea that was in cyw43. I'm adding it to wifi.Radio.

❗ Note this bug, fixed this fall: https://github.com/georgerobotics/cyw43-driver/issues/122. I am not sure if we have updated to that or not.

I can take advantage of that in the code I'm writing.

FWIW, I believe N...

jaunty juniper
crimson ferry
ionic elk
#

This is a dumb question I'm sure but how is Circuitpython handling the espressif configuration steps normally handled by menuconfig? I've gotta figure out how to port some settings from a kconfig file to a circuitpython-appropriate format

slender iron
#

CP has a number of sdkconfig files that get merged together depending on the mk settings

#

boards can also supply one

manic glacierBOT
manic glacierBOT
#

With (much) older versions of CircuitPython I was able to get into .UF2 boot mode from inside a running CircuitPython app.
The current instructions / documentation in circuitpython.org for version 9 suggest to code like so:
import microcontroller
microcontroller.on_next_reset(microcontroller.RunMode.UF2)
microcontroller.on_next_reset()
However, this currently does not work for me for any ESP32S3 boards I have access to.

Any ideas ?

Thomas

manic glacierBOT
#

I would ask: what does "does not work" mean ? But you have the last line wrong, so if that's the code you are actually using (and not a typo here), you would have gotten a TypeError: function takes 1 positional arguments but 0 were given exception.

This is what you want:

import microcontroller
microcontroller.on_next_reset(microcontroller.RunMode.UF2)
microcontroller.reset()

It works for me (tested on a TFT feather and a QTPY).
If you code was correct and you still get the issu...

manic glacierBOT
#

I tried this with a:

  • adafruit_feather_esp32s3_reverse_tft
  • firebeetle2_esp32s3
  • yd_esp32_s3_n16r8
    I tried with all of them under 9.2.7
    With the firebeetle2_esp32s3 I also tried 9.0.5 to see for me if it was working in an earlier version but it did't

What does not work mean:

  • all three board are not showing a USB drive after the reset I "see" the debug com port.
  • I do not see a Typerror Message!

Here what I get in PUTTY:
Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit...

manic glacierBOT
manic glacierBOT
#

I will try again with CP 9.2.7 I falsely stated above that I tested with the Reverse TFT Feather with 9.2.7 but when I checked it was version 9.2.4.

I updated the bootloader from https://circuitpython.org/board/adafruit_feather_esp32s3_reverse_tft/ using the open installer.
After a manual reset the drive FTHRS3BOOT appeared.

Also when typing now:
import microcontroller
microcontroller.on_next_reset(microcontroller.RunMode.UF2)
microcontroller.reset()

The FTHRS3BOOT appears.

Thank you snkY...

#

I have no idea how I got "rid of" the bootloader on the adafruit_feather_esp32s3_reverse_tft

On the firebeetle2 there is no bootloader option on https://circuitpython.org/board/firebeetle2_esp32s3/
So I uploaded firmware.bin at pos 0 with the help of the website: https://adafruit.github.io/Adafruit_WebSerial_ESPTool/
Can anyone give me idea how / where I can find the bootloader for the firebeetle2 and with what parameters I need to upload the UF2 Bootloader into the board.

manic glacierBOT
manic glacierBOT
#

After using combined.bin from tinyuf2-firebeetle2_esp32s3-0.30.0.zip and rebooted, the drive FIRE2BOOT appeared.
Then I copied the CP 9.2.7 .UF2 file into the FIRE2BOOT drive.
After a reset the CIRCUITPY drive appeared and I can confirm that the sequence:

import microcontroller
microcontroller.on_next_reset(microcontroller.RunMode.UF2)
microcontroller.reset()

Brings me again into the FIRE2BOOT drive!

Great!

One small thing remains and this may be specific to the firebeetle2:

When I press...

manic glacierBOT
manic glacierBOT
orchid basinBOT
manic glacierBOT
#

At startup, RP2350-based boards do not run boot stage 2. This is due to a change in the way _stage2_boot() is invoked. For the RP2040, boot stage 2 was invoked directly by boot ROM. For the RP2350, stage 2 is invoked by crt0.S under the control of PICO_EMBED_XIP_SETUP. Since CP does not set PICO_EMBED_XIP_SETUP, it defaults to 0, causing _stage2_boot() to not be copied onto the stack and executed. See https://github.com/raspberrypi/pico-sdk/issues/1903.

RP2350 boot ROM tests flash,...

manic glacierBOT
manic glacierBOT
mortal kernel
#

@tulip sleet The cascade mechanism implemented for nvm.toml does not allow overrides once a key has been set in one of the upper sheets. Maybe we want to change that?

tulip sleet
#

got it; let's see if @slender iron has any thoughts about that

manic glacierBOT
#

For most flash memory parts, the sector protection mechanism can be disabled by clearing the part's status register. The Microchip SST26VFxxxB parts do not use status register bits to control sector protection. Instead, they require issue of a global block protection unlock (0x98) to disable sector protection. This PR does the following:

  • Implements a new flash configuration parameter use_global_protection_lock to indicate that the flash part requires use of the global block protection ...
mortal kernel
slender iron
lone axle
#

How does git decide what is a file deletion and what is a change to a new file? I've realized in this PR: https://github.com/adafruit/Adafruit_Learning_System_Guides/pull/3014/files#diff-fd7f25eb86acad20ec568992e5a8b5c883efb0d83da8d8ec3662374ca9767885 the file PyPortal/PyPortal_NeoPixel_Color_Picker/secrets.py was deleted as far as I can tell. But git / github seems to report that this file was actually moved to create a settings.toml file in a different subdirectory.

The result of this behavior, which is why it caught my attention, is that the deletion of of that secrets.py file is not really listed in the list of changes on the PR. Searching "NeoPixel" in the 'filter changed files' reports no results either, where-as a search for "User_Interface" does return a result for a different directory which also had files from inside of it deleted (which git counted as a real deltion instead of a move).

manic glacierBOT
manic glacierBOT
jaunty juniper
tulip sleet
#

we've had this problem a lot when merging MicroPython. It tries too hard to mark things as move with edits

lone axle
#

Interesting. It's innocuous in this case, but slightly disconcerting how well it "hides" the deletion from the reviewers front end in github.

tulip sleet
#

this is about the other way round, but there may be some clues about how to prevent it. One way is to split it across commits

tulip sleet
manic glacierBOT
manic glacierBOT
lone axle
manic glacierBOT
#

@HidingCherry, are you doing a full reset or power cycle of the RP2040-GEEK board? The boot.py file is only run on hardware reset.
Also, most OSes cache USB descriptors, so some changes like manufacturer & product strings, will not be updated in lsusb.
Whenever I change supervisor.set_usb_identification() settings, I plug it into (another) computer that's been freshly power-cycled. This guarantees I'm not hitting any OS USB descriptor cache and that boot.py is being run.
btw, the...

lone axle
turbid radish
#

Please subscribe if you have not to date

#

No ads, no spam

manic glacierBOT
lone axle
#

It does work with circup (when it's build suceeds at least)

thorny jay
#

A library could be in two bundles...

#

If yes, just add those 3?

lone axle
#

I think there is nothing technologically preventing it. But I also think it wouldn't break anything if it were to happen off the top of my head at least.

turbid radish
#

Thanks all!

lone axle
#

Thanks for hosting Scott, have a great week everyone!

jaunty juniper
#

if a library is in 2 bundles, circup would use the first it finds in order of bundles I assume, unless the last one overwrites the first one ?

mortal kernel
#

Have a fine week, everyone!

thorny jay
#

Could the repetitive part be pre-recorded?
Do we know how much time each section takes?
The juicy parts are "hug report", "status update" and "in the weed".
I could live without the number of pull request or updated libraries.

lone axle
#

That is true, It could be ambiguous which bundle it would pull from or go by whatever order happens to be hardcoded in circup. Theoretically the actual library files should both the same though as they should both be built from the same git release automatically in each bundle.

thorny jay
#

So circup will not be confused if a library move from one bundle to another?

lone axle
#

not confused in a way that makes a functional difference as far as I understand it.

slender iron
slender iron
#

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

manic glacierBOT
mortal kernel
#

I'm back. Here's where I left off: I can change PLL_SYS output to any multiple of 48 MHz. Initially, I'm setting it to 144 MHz. At a small performance hit, that frees up PLL_USB to drive the HSTX clock domain exclusively.

#

With this config, CLK_SYS, CLK_PERI, CLK_USB, and CLK_ADC are all on PLL_SYS or CLK_SYS.

slender iron
#

Any idea if we could adjust VBLANK instead of changing the pixel clock?

manic glacierBOT
#

It would be great if the vblank extension thing you're suggesting could avoid slowing down the main clock.

For 27MHz modes, my impression is that many displays and capture cards probably support 16:9 480p. I wonder if it would be possible to use the HSTX config to automatically put a frame of black, or perhaps a configurable color, around smaller frame buffers, so long as they fit within 720x480.

mortal kernel
#

I'm guessing that wouldn't work because it's likely that the pixel clock is the issue with the capture card, not the vertical frequency.

slender iron
#

it is weird to me that the pixel clock matters given that it is within the range of what the capture card can do (higher reses have faster clocks)

mortal kernel
#

Without knowing how it's logic work, I couldn't say. My model for how I think it works imagines it setting up timing for each mode.

#

The DMT spec gives just a +/- 0.5% on the pixel clock.

slender iron
#

I think it'd be fine to do that. I'm curious about vblank though too

#

I don't know a ton about it though

#

@tiny peak related pixel clock discussion ☝️

#

@mortal kernel where did you leave off on the psram optimization?

#

is it mostly blocked on the stage2 stuff?

mortal kernel
#

No. That's an issue for overclocking and flash. On the PSRAM, I've got an outstanding pull pico-mac that implements PSRAM up to 133 MHz. I've tested it successfully on a Metro RP2350.

slender iron
#

what does CP run it at?

#

that's where I'm interested in the improvement

mortal kernel
#

75 MHz. The clock divider for qspi only supports integers, so we're stuck with that at 150 MHz SYS_CLK.

slender iron
#

same with the hstx divider

mortal kernel
#

Yeah. Thing is that for ones that do support fractions, like PIO, you get jitter with non-integer dividers.

#

Here are some notes I made on pixel clock:

    // Note: By default, the HSTX clock domain AUXSRC mux selects CLK_SYS as its
    // source. Also by default, the HSTX clock divider is set to 1, so the HSTX
    // clock domain runs at 150 MHz. The selected HSTX_CTRL CLKDIV is 5, so the
    // effective pixel clock is 30 MHz. At 640x480, this results in a slightly
    // out of spec vertical frequency of 75 Hz. To be in spec for 640x480 at 75 Hz
    // the pixel clock would need to be 31.5 MHz +/- 0.5%.

    // For 720x400 at 85 Hz, the required pixel clock is 35.5 MHz +/- 0.5%. At
    // 30 MHz, this one is far off spec.

    // See "VESA Display Monitor Timing Standard", Version 1.0, Rev. 13, 2013.

    // PLL and clock divider settings(*) to achieve selected resolutions/pixel clocks:
    // 640x480@60: 25.175 5 125.875 126.0 1 126 1512 6 2
    // 640x480@75: 31.5   5 157.5   157.5 1 105 1260 4 2
    // 720x400@85: 35.5   4 142.0   142.0 2 213 1278 3 3
    //                                                 ^---PD2
    //                                               ^-----PD1
    //                                           ^---------VCO
    //                                       ^-------------FBDIV
    //                                     ^---------------REFDIV
    //                               ^---------------------Actual HSTX_CLK
    //                        ^----------------------------Desired HSTX_CLK
    //                     ^-------------------------------CLKDIV
    //              ^--------------------------------------Desired Pixel Clock
    // (*)PLL settings determined by vocalc.py
slender iron
#

I wonder if it'd be worth running the core at 133 so that we can 1:1 flash and psram

mortal kernel
#

I've pre-calculated the parms for the PLL, and in these three cases I can hit the desired clock within the spec.

#

We'd lose the ability to free the USB_PLL at 133 unless we're willing to risk overclocking part of the clock tree.

slender iron
#

right. that'd help everyone though

#

the lower voltage psram part is rated up to 144mhz

#

could also just try it 🙂

mortal kernel
#

As long as we made it a setting we could change in the .toml, I'm up for risking it.

slender iron
#

This says the USB_PLL can only generate up to 48mhz

#

the HSTX would need more than that

mortal kernel
#

That's why I thought driving a higher frequency out of FOUTPOSTDIV might be a problem. Weird thing is, it seems to work.

slender iron
#

There is an earlier comment suggesting to use USB_PLL for HSTX

#

I don't see any other documentation about it

mortal kernel
#

Sometimes the doc isn't correct. You can see from my table that I'm counting on an HSTX clock of up to 157.5 MHz off the USB_PLL.

#

That's so the HSTX logic has enough headroom to keep DVI fed.

slender iron
#

doesn't the hstx clock need to be pixel clock * 10?

#

8 bits in, 10 tmds bits out?

#

or pixel clock * 5

#

since it is ddr

mortal kernel
#

We're running it x5 now.

slender iron
#

so the USB_PLL would need to be less than 150

#

for pixel clocks between 25 and 27mhz

mortal kernel
#

I think we could risk going over 150 by a smidge. In practice, the RP2 parts have a crazy amount of overclocking headroom.

slender iron
#

what refresh rate and resolution are you targeting?

mortal kernel
#

640x480@60 and 75, 720x400@85.

#

I was thinking about reading the monitor's EDID pages and going completely adaptive. But, that's just me thinking.

slender iron
#

I added a little of that to CP

mortal kernel
#

I saw that. It's what got me thinking along those lines.

slender iron
#

I wouldn't do anything more than 60 fps

#

unless it is 720x400 which bottoms out at 70

mortal kernel
#

I'll keep poking at it on my own time. I like the idea of going to 133 MHz to see if we can get better overall performance with fully-clocked PSRAM.

slender iron
#

maybe 640x350 and 640x400 are worth trying since they are both 31.500

#

you can try the 133mhz psram thing on a couple hours of adafruit time

#

the hstx clock thing doesn't seem like a huge blocker to me now

#

I only know of the one capture card that is unhappy

mortal kernel
#

Sounds good. I'll give 133 a try. I did have a thought re: gc collect scan of psram allocations. Maybe use uncached accesses?

slender iron
#

ya, could but that'd be more rp2350 specific

#

the selective collect has the nice property of benefitting everything that enables it

mortal kernel
#

Good point, there I go thinking the RP2 parts are the whole world...

slender iron
#

🙂 all of the esp parts with psram will benefit too

#

anything with a bunch of ram you want big buffers in

mortal kernel
#

OK, I think we've beaten this one up enough. Appreciate the chat.

slender iron
#

thanks!

manic glacierBOT
#
  • Fixes #10230.

The left and right stereo channels were reversed for most cases of audiobusio.I2SOut on raspberrypi. See the table in https://github.com/adafruit/circuitpython/issues/10230#issuecomment-2797995431 for details.

This was not a problem for audiopwmio.PWMAudioOut, and not a problem for Espressif on SAMD I2SOut. The problem was that the data was in the opposite channel order expected. Interestingly, the sample programin

Fixed by flipping the LRCLK in three out of ...

manic glacierBOT
manic glacierBOT
wanton dirge
#

Hi folks! Coming back around to this, I was just finishing up my BUSIO support getting ready for the PR, but then I noticed the new Zephyr port (which is super exciting!). Running it on my trusty AD-APARD32690-SL board, it works great, but doesn't appear to instantiate any BUSIO support.

Modules

>>> help("modules")
__main__          collections       micropython       struct
array             digitalio         os                sys
board             gc                random            time
builtins          microcontroller   storage           zephyr_serial
Plus any modules on the filesystem

We have quite a few boards well supported in Zephyr, so thought I'd try it. I also noticed some strangeness with the board module and the boot configuration. Sorry for the lateness, feel free to get to this tomorrow. I have a couple questions about the Zephyr port:

  • Is it possible to get BUSIO support for our boards with some simple tweaks?
  • I'm assuming the port pulls info from the board's DT files? Why do I see so many strange repeated entries below? Is there any way of setting up specific configuration for CircuitPython vs. our Zephyr configuration?
  • Anything I should do to resolve the boot log message at the end here? Looks like it fails to retrieve a UID.
#

Board (apard32690//m4)

>>> import board
>>> help(board)
object <module 'board'> is of type module
  __name__ -- board
  board_id -- apard32690
  D5 -- board.D5
  D4 -- board.D4
  LED3 -- board.LED3
  LED2 -- board.LED3
  LED2 -- board.LED2
  LED1 -- board.LED2
  D10 -- board.D10
  D6 -- board.D6
  D7 -- board.D7
  D13 -- board.D13
  S2 -- board.S2
  D12 -- board.D12
  D11 -- board.D11
  D9 -- board.D9
  D8 -- board.D8
  LED1 -- board.LED1
  LED -- board.LED1
  LED0 -- board.LED1
  D2 -- board.D2
  D0 -- board.D0
  D3 -- board.D3
  D1 -- board.D1
  D14 -- board.D14
  D15 -- board.D15
  A0 -- board.A0
  A1 -- board.A1
  A2 -- board.A2
  A3 -- board.A3
  A4 -- board.A4
  A5 -- board.A5

Boot Log

*** Booting Zephyr OS build 8f4225038bcf ***
Init heap at 0x20007b48 - 0x20020000 with size 99512
Init heap at 0x200d0000 - 0x200e0000 with size 65536
Init heap at 0x20020000 - 0x20040000 with size 131072
Init heap at 0x20040000 - 0x20060000 with size 131072
Init heap at 0x20060000 - 0x20080000 with size 131072
Init heap at 0x20080000 - 0x200a0000 with size 131072
Init heap at 0x200a0000 - 0x200c0000 with size 131072
Init heap at 0x200c0000 - 0x200d0000 with size 65536
hello from flash init
flash 0x10025bb8 flash_controller@40029400
  16 pages
  page 0: 0 4000
  page 15: 3c000 4000
  16 uniform pages
setup flash
  erase page size 16384
  write row size 512
  blocks per page 32
Adafruit CircuitPython 10.0.0-alpha.2-13-g4a16ed1856 on 2025-04-14; AD-APARD32690-SL with max32690
Board ID:apard32690
UID retrieval failed: -88
UID shorter 0 than defined length 32
UID:0000000000000000000000000000000000000000000000000000000000000000

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

Code done running.

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

Adafruit CircuitPython 10.0.0-alpha.2-13-g4a16ed1856 on 2025-04-14; AD-APARD32690-SL with max32690
>>> 
manic glacierBOT
#

@gamblor21 @dhalbert for interest.

This PR has been rewritten and resubmitted from its original state (https://github.com/adafruit/circuitpython/pull/9876) for compatibility with 9.2.x and to fix conflicts with other recent changes to audiodelays.Delay.

This has been an issue that I've been aware of since the inclusion of audiodelays in 9.2.0. Echo buffer positions weren't being properly managed when handling stereo input/output. I've resolved this issue by separating the echo buf...

manic glacierBOT
#

I believe the intention of this helper function is to have if_required1 be relvant for x1 and y1 and have if_required2 be relevant for x2 and y2.

That would mean that it is possible to control the required-ness of x1,y1 and x2,y2 independently.

As it is written now instead if_required1 is relevant for x1 and x2 and if_required2 is relevant for y1 and y2. If this functionality does match the intention then I would propose if_requiredX and if_requiredY as mor...

manic glacierBOT
manic glacierBOT
#

This will simplify the path by removing '.' and '..' entries as the cpython version does:


    pathlib_posixpath_obj_t *abs_path = common_hal_pathlib_posixpath_absolute(self);
    GET_STR_DATA_LEN(abs_path->path_str, path_str, path_len);
    int new_path_len = path_len;

    // Allocate new string
    byte *new_str = m_new(byte, path_len + 1);

    // Copy original path
    memcpy(new_str, path_str, new_path_len);

    // Remove trailing slash if present
    if (new_str[pa...
manic glacierBOT
mortal kernel
#

@slender iron In the IDF mods there's a patch to rtc_io_ll.h that checks for other pins mux'ed to the RTC before turning off the mux enable. The code has changed substantially w/5.4, rtcio_ll_iomux_func_sel() no longer touches iomux_clk_gate_en. I suspect the underlying issue is fixed, but I'd like to test it to be sure. Can you point me to the original issue?

tulip sleet
#

blame is also available locally, but I always use it on the website

mortal kernel
#

I did that, and the changes are too large to pin down what they were addressing. I was hoping to get back to the CP issue that prompted the patch.

#

ESP did a huge amount of refactoring, presumably to simplify code for their growing family of parts.

mortal kernel
#

components/hal/esp32s[2,3]/include/hal/rtc_io_ll.h

tulip sleet
#

I am not sure there is an issue for this; it may have just been found when we were upgrading esp-idf

#

see https://github.com/adafruit/circuitpython/pull/7486

I checked our changes to release/v4.4 against this. No conflicts. @slender iron's adafruit/esp-idf#10 fix has already been incorporated upstream. There are some additional fixes in that file for other things.

mortal kernel
#

I'm looking at circuitpython-v5.3.2.

#

I'll do a bit more sleuthing in the ESP-IDF code to see if there's still a similar bug in the refactored code. I haven't been able to find anything in the old CP issues that looks like it, so it likely was found by inspection.

tulip sleet
#

I don't know why I said it was incorporated upstream. It is not in esp-idf master in that particular file

#

but maybe it was fixed elsewhere

mortal kernel
#

Ah, a true mystery. Maybe @slender iron can shed some light...

mortal kernel
#

You are amazing. That looks like it's it.

tulip sleet
#

that fix is way after my comment, though

slender iron
#

@mortal kernel to tickle that bug in circuitpython I think you'd need to do pin wake on multiple

#

or it could be ULP related

slender iron
#

The build does autogenerate the friendly pin names based on the Zephyr DTS. The simplest way to change those is by modifying the DTS.

#

we haven't updated to zephyr 4.1 yet. it definitely feels like the future of CP but we won't likely get back to it until next year when I'm back full time after paternity leave

wanton dirge
#

Awesome. Thanks for the info. I really like both platforms a lot, and it could save a lot of work porting things over. But I'll probably be poking at CP one way or another for a while anyway. One more question -- is there any preference for whether or not the BUSIO implementation uses interrupts or not? I currently have UART using interrupts and other things blocking. I want to make that consistent before I PR but wanted to see if there's a preference.

slender iron
wanton dirge
#

Oh...sweet!

#

Thanks for the input as always 🙂 I will work on my branch some more and hopefully PR soon.

slender iron
#

great! I'm out in three weeks but dan and eightycc will be around

manic glacierBOT
#

Might be stuck on some ROS issues for a little bit:

  • microros initialization is failing, with a generic error code (error 1). Could be for any number of reasons, but it's hard to tell because microros logging is not printing when set up with rcutils_logging_set_output_handler(my_custom_log_handler);. Might need to double-check if I'm missing a build setting on the pre-built library and recompile.
  • ESP JTAG gives limited visibility because I don't have debug symbols in the library, ...
#

@EmergReanimator Please re-test with the build artifact from #10249. Thank you!

Yup. Now it works correctly:

Adafruit CircuitPython 10.0.0-alpha.2-14-g52336ef192-dirty on 2025-04-15; SAM E54 Xplained Pro with same54p20
Board ID:same54_xplained
UID:96A8371F32543753202020392D1C04FF
Adafruit CircuitPython 10.0.0-alpha.2-14-g52336ef192-dirty on 2025-04-15; SAM E54 Xplained Pro with same5...
manic glacierBOT
manic glacierBOT
#

Hi, some changes to make this more consistent with other boards:

  • Adding whitespace to group pins and to group aliases together.
  • Put preferred name first (TX before D0, RX before D1). This affects which name is used to print the pin out.
  • Dropping D12: no silk for it, I think. D4 is IO4, and D4 would be the name to use.
  • Use D7 instead of IO7.
  • Drop D13 as an alternate name for LED. It's D7, and LED is the preferred name for examples, not D13.
manic glacierBOT
#

CircuitPython version and board name

Adafruit CircuitPython 9.2.7 on 2025-04-01; Raspberry Pi Pico W with rp2040
Board ID:raspberry_pi_pico_w
UID:E6614103E7356B37
MAC:28:CD:C1:01:1C:6A

Code/REPL

#######################################
# Diagnostics
#######################################
import ipaddress
import supervisor
import microcontroller
addr = os.getenv("PING_ADDRESS")
ip1 = ipaddress.ip_address(addr)
print("pinging", ip1, 'from', IP)#, end=' ')
t = ...
manic glacierBOT
slender iron
manic glacierBOT
#

CircuitPython version and board name

# Tested without error
Adafruit CircuitPython 9.2.7 on 2025-04-04; Waveshare RP2040-PiZero with rp2040
Adafruit CircuitPython 10.0.0-alpha.2 on 2025-04-04; Waveshare RP2040-PiZero with rp2040

# Tested with error
Adafruit CircuitPython 10.0.0-alpha.2-16-g8f7496c069 on 2025-04-15; Waveshare RP2040-PiZero with rp2040

Code/REPL

# waveshare rp2040-pizero with waveshare audio hat (requires i2c pull-ups)

import time
import boa...
#

This function's docstrings don't match its behavior in two ways.

  1. Currently if you pass -1 for x2 or y2 as specified in the docstring it will raise an exception ValueError: x2 must be 0-80

We could update the validation to accept -1 but this same validation helper in used in multiple other places and I'm not sure if all of them share the same support for and meaning of -1 value.

In any case the current code already provides None as a value that does make it get taken as...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I am having issues with ESP32-S3 and latest CircuitPython: adafruit-circuitpython-espressif_esp32s3_devkitc_1_n8r2-en_US-8.2.9.bin

In my case, I am using ESPNow, which means wifi is enabled. If I try to read ADC before init of ESPNow, it works as expected but just after, it fails and read the max value possible. And if I try to read 2 ADCs channels, and put like 50ms delay between the readings, it works mostly but there are errors, probably 0 values or lower values.

manic glacierBOT
manic glacierBOT
#

Thanks everyone, my issue is solved. It was an hardware issue! I am using a TJA1050 that is powered / just works at 5V and I was connecting the lines directly to ESP32-S3, and seems the ADC of ESP32-S3 does not work well when I put another IO pin at over 3.3V... but for some reason, the issue just happened after enabling ESPNow / Wifi.
Everything was working great, only after I added that TJA1050 at 5V Vcc, I got this issue -- took me some time to realize.

Sorry for commenting on this closed...

copper crescent
#

There doesn't currently seem to be a way to get the rp2pio txfifo level, pio_sm_get_rx_fifo_level is exposed via rp2pio.in_waiting but from what I can see there isn't an "rp2pio.out_waiting" or similar for pio_sm_get_tx_fifo_level?

lone axle
#

Anyone have an idea of what could cause the core to raise a RuntimeError when it is trying to raise a ValueError? I'm noticing that when it attempts to raise the exception from here: https://github.com/adafruit/circuitpython/blob/main/shared-bindings/bitmaptools/__init__.c#L369
Instead it results in:

Traceback (most recent call last):
  File "code.py", line 101, in <module>
RuntimeError: 

In a local build I added print statements before and after the value error raise. I see the before print and then this generic RuntimeError with no details about what the problem is.

stuck elbow
#

do you know what is the memory situation at that point?

lone axle
#

gc.mem_free() reports free: 193504 just before the call to alphablend() which ends up raising the RuntimeError

lone axle
#

It seems to be somehow tied to what string is given to the error. If I change it to lowercase first letter

mp_raise_ValueError(MP_ERROR_TEXT("bitmap size and bits per value must match"));

It works and does raise the ValueError with the message.

However it can also output the capital 'B' as long as there aren't "too many" other characters with it seemingly. This works:

mp_raise_ValueError(MP_ERROR_TEXT("Bitma"));

and this does not:

mp_raise_ValueError(MP_ERROR_TEXT("Bitmap"));
manic glacierBOT
#

Adding a variation of a standard digital delay (no frequency shifting) which allows for multiple "tap" positions to draw from the delay buffer. Rhythmic delay effects can be achieved by using irregular tap positions, ie: dotted quarter notes.

Notes:

  • I've tried to make the taps parameter flexible, but any suggestions are welcome.
  • synthio.BlockInput is not supported at this time. I don't see any immediate benefits from adding in that feature.
  • This feature could be included into ...
stuck elbow
lone axle
#

Does that process differ by port? I've just noticed that on ESP32-S3 with the same code the ValueError does get raised successfully with it's full original message.

#

I'm not familiar with string interning. If something is hashing the strings per word though that could definitely be where the culprit is. If I use

mp_raise_ValueError(MP_ERROR_TEXT("Bitmaq size and bits per value must match"));

it works and raises the ValueError and full message. So it seems like the specific string "Bitmap" is the trigger for it in this instance.

stuck elbow
#

I think the hash values could be different on different ports

#

but it could also be some error in how the strings are handled

manic glacierBOT
#

I've found that the ValueError that the core attempts to raise from here: https://github.com/adafruit/circuitpython/blob/main/shared-bindings/bitmaptools/__init__.c#L369

ends up instead raising a blank RuntimeError when it executes on a PyPortal (tested on 9.2.7, 10.0.0-alpha.2, and build from main)

Traceback (most recent call last):
  File "code.py", line 101, in 
RuntimeError: 

I have this reproducer code that causes the problem that should raise the ValueError:

import gc
impo...
manic glacierBOT
#

Right now, we don't have the resources to work actuvely on ESPNow support, which was done by community members. If anyone would like to take a look at this and other issues, you are very welcome to, and we are happy to provide support to come up to speed on working with CircuitPython. We are working on updating ESP-IDF to 5.4.1, and will continue to update as new releases of ESP-IDF come out.

tulip sleet
#

@lone axle it does seem like a translation string processing error. Could you open an issue with "at this exact commit (or this release) this doesn't work, but if I change this one thing, then it does", then we can look at the generated translation data to see what's up.

manic glacierBOT
#

Surprisingly this leads to some code size savings on itsybitsym4, even though LTO optimization should have let the compiler deduce (almost) all of this.

When a compiler knows a call can never return, it is possibly able to avoid emitting code, such as saving caller-saved registers to the stack, or doing ANYTHING affter the function returns, explaining why code size savings is possible with this attribute.

With the exception of raise_deinited_error, these were found by checking the fun...

manic glacierBOT
slender iron
#

@tulip sleet got time to talk memory allocation/gc changes?

tulip sleet
#

ya sure

manic glacierBOT
#

Dan and I chatted about this and he pointed out that pathlib could just be a Python library. In fact, micropython already has a simple version here: https://github.com/micropython/micropython-lib/blob/master/python-stdlib/pathlib/pathlib.py I'm going to take the native implementation out in favor of the Python one.

I do still want to fix the os implementation of cwd because pathlib will build on it and there are existing bugs filed for it.

slender iron
#

@tulip sleet we could merge the outer heap and the VM heap in CP 11 and use tlsf for it all

#

then we don't need VM heap splitting or growing at all

#

and keep object alive outside the vm

tulip sleet
#

that makes sense, once you have the no-collect

#

it's a big simplification!

slender iron
#

it'd make the primary display stuff simpler

tulip sleet
#

still want separate SRAM vs PSRAM pools?

slender iron
#

ya, for dma_capable vs not

#

and you'd add a sweep bit

#

vs explicit free

mortal kernel
manic glacierBOT
copper crescent
tulip sleet
#

are there things in micropython or pico-sdk support that we don't have?

slender iron
#

tlsf on used blocks is 4 bytes for allocation size. It uses the lower two bits for metadata. We could likely pack into that too

manic glacierBOT
copper crescent
manic glacierBOT
manic glacierBOT
manic glacierBOT
#
  • Fixes #9533
  • Fixes #10229

Change the 4MB Espressif builds to use a partition table with a single larger app partition ('ota0'), dropping the second app partition used for possible OTA.

Drop some module omissions on a number of boards. Some boards still have espcamera turned off, since it requires a lot of pins. But those could be looked at again.

This is a draft PR for now until we get the documentation for upgrading the boards squared away.

Turned on _bleio on ESP32. It ...

manic glacierBOT
#

CircuitPython version and board name

Adafruit CircuitPython 9.2.7 on 2025-04-01; Adafruit Feather RP2040 USB Host with rp2040

Code/REPL

import usb
list(usb.core.find(find_all=True))

Behavior

Returns an empty array

Description

I'm trying to connect another RP2040 board with CircuitPython to the Feather RP2040 USB Host via the USB connection. However, as I've put in the Code/Behavior sections, the Feather is not finding this board.

The USB dev...

mortal kernel
#

@slender iron ESP-IDF does more strict checking for valid use of CONFIG_ flags. It now checks that all used flags are defined somewhere in the chain of Kconfig files for the target processor. This applies not just to flags that are defined, but also to flags that are commented out. Although CP does not use Kconfig, these checks are still performed. CP config files all pass, except when building for the ESP32H2. CP configures this for a 48 MHz flash spi clock, but according to Kconfig this isn't a valid setting. The valid setting are 16, 32, and 64. Is this a typo in CP or a setting we want?

manic glacierBOT
manic glacierBOT
#

I'm testing now on a Pimoroni Pico Plus 2 with 8MB of PSRAM. Is this basically what we're thinking of? I can get a PR up for this, but I want to do a bit more testing.

#ifdef PICO_RP2350
dma->buffer[0] = (uint8_t *)port_realloc(dma->buffer[0], max_buffer_length, true);
#else
dma->buffer[0] = (uint8_t *)m_realloc(dma->buffer[0],
    #if MICROPY_MALLOC_USES_ALLOCATED_SIZE
    dma->buffer_length[0], // Old size
    #endif
    max_buffer_length);
#endif
dma->buffer_length[0] = max_buffer_le...
manic glacierBOT
#

ESP-IDF does more strict checking for valid use of CONFIG_ flags. It now checks that all used flags are defined somewhere in the chain of Kconfig files for the target processor. This applies not just to flags that are defined, but also to flags that are commented out. Although CP does not use Kconfig, these checks are still performed. CP config files all pass, except when building for the ESP32H2. CP configures this for a 48 MHz flash spi clock, but according to Kconfig this isn't a valid se...

mortal kernel
#

@slender iron I'm wondering whether we need to coordinate an ESP-IDF update to v5.4.1 with TinyUSB?

manic glacierBOT
#

CircuitPython version and board name

Adafruit CircuitPython 9.2.7 on 2025-04-01; S2Mini with ESP32S2-S2FN4R2

Code/REPL

import supervisor
import time
import board
import audiomp3
import audiobusio
import busio

import sdcardio
import storage
import os

# --- configuration   ---

# SD-card (SPI)
PIN_MISO = board.IO10
PIN_MOSI = board.IO6
PIN_CLK  = board.IO8
PIN_CS   = board.IO4
PINS_I2S = [board.IO11,board.IO12,board.IO9] # BLCK, WSEL, DATA

# --- mount SD-ca...
slender iron
slender iron
mortal kernel
slender iron
#

you can go past the tag if you want. I've just had mixed luck with doing so

mortal kernel
#

I'm wondering if I want to cherry pick the patch on our v5.4.1 branch or temporarily work around the problem in CMake?

slender iron
#

I haven't looked at the error. Either is fine with me. You can also rebase on a commit from their 5.4 branch instead of the tagged one

tulip sleet
lone axle
#

fwiw I think that action is for the contributing pages not necessarily the bundles page. Currently https://circuitpython.org/libraries shows adafruit bundle 20250415 and community bundle 20240417, both of which are the most update to date bundle released for each one as far as I can tell.

manic glacierBOT
#

I flashed https://github.com/ataradov/usb-sniffer-lite onto a spare Pico and got these results which aren't too revealing as to what the problem could be:

CircuitPython:

1381732 : --- RESET ---
   ... : Folded 450 frames
  1000 : SOF #504
    16 : SETUP: 0x00/0
     3 : DATA0 (8): 80 06 00 01 00 00 08 00 
     9 : ACK
   ... : Folded 7 frames
  1000 : SOF #512
    16 : IN: 0x00/0
     2 : DATA1 (8): 12 01 00 02 00 00 00 40 
    10 : ACK
   972 : SOF #513
    16 : OUT: 0x00/0
     3 : DAT...
slender iron
#

@tulip sleet any object to me carving out double conversion support for samd21s

tulip sleet
#

not sure what you mean

slender iron
#

looks like samd21 boards have f2d and d2f that take at least 280 bytes

#

I want to disable those

tulip sleet
#

if they are not used, sure

slender iron
#

I think it'd impact printf and arrays with type 'd'

tulip sleet
#

i have an issue opened with some big savings for samd21, let me find it

slender iron
#

👀

#

both of my PRs are overflowing on samds

tulip sleet
mortal kernel
#

Any advice for shrinking dram0 usage on ESP32S2? I'm overflowing by 376 bytes. ☹️

#

Also out of flash on ESP32S2 for some national languages: ru, pt.BR, ja, fr, de_DE.

#

I've also got some missing symbols to chase down, so I'm not blocked.

tulip sleet
#

Also if OPTIMIZATION_FLAGS = -Os is not set (-O2 instead) that will help a lot

#

@slender iron think we should drop the OTA partition for all 4MB boards, including ESP32 and ESP32-S2? We didn't ask Thach to do that, just the S3 boards.

mortal kernel
#

Flash overflow is on ESP32-S2. It's the espressif_esp32c6_devkitm_1_n4, 4MB flash.

slender iron
#

yes all 4mb

#

that way it is consistent

#

thach will only need to change s2

tulip sleet
#

that's what my PR does, but TinyUF2 0.30.0 was only certain S3 boards.

mortal kernel
#

My bad, C6.

#

gcc is a bit overzealous with inlining.

#

i doubt the performance gain is worth it in many cases

tulip sleet
#

-Os should help, but I thought we were already doing that for the RISCV chips

#

C<n> chips are all RISC

mortal kernel
#

Let me check...

#

Yes, -Os for RISCV.

tulip sleet
#

you can do make V=commands BOARD=... to see the command lines

#

maybe turn off PYCAMERA for now

#

the RAM issue may require some sdkconfig tuning

mortal kernel
#

That should get me by on the flash, I'll need to look at the elf.map to see what to try trimming for the dram0 overflow. Thanks!

manic glacierBOT
slender iron
mortal kernel
#

Is the USB IP on the ESP32-S2 an Analog MAX3421? The reason I'm asking is that CIRCUITPY_MAX3421E is getting set by default in espressif/mpconfigport.mk. That's causing a missing __atomic_test_and_set in tinyusb's hcd_mac3421.c:hcd_edpt_xfer().

mortal kernel
tulip sleet
mortal kernel
#

I see. Now to find atomic functions in ESP-IDF...

tulip sleet
mortal kernel
#

Is updating ESP-IDF always so complicated?

tulip sleet
#

No, but there are always API changes. Might be worth looking at the esp-idf/examples, if any of them use the atomic op

manic glacierBOT
slender iron
#

fyi I have an audio fix for rp2 in the works too

#

switching the dma setup so readaddr always gets reset

manic glacierBOT
#

@anecdata There was a bug (https://github.com/georgerobotics/cyw43-driver/issues/122) in cyw43-driver that pointed out the "AGGRESSIVE" and "PERFORMANCE" power management driver settings were wrong, and seemingly backwards. This was fixed by https://github.com/georgerobotics/cyw43-driver/pull/126 in August, 2024.

We have updated cyw43-driver in CircuitPython, but the settings constants, which we had duplicate definitions of, were not corrected.

This may explain your original bug #6958...

mortal kernel
manic glacierBOT
tulip sleet
mortal kernel
#

That feels risky to me. I've resolved all of the build issues except the dram0 overflow on ESP32-S2 parts.

tulip sleet
#

You could advance that as they move toward 5.4.2

#

got it; testing with the tip could show you if the DRAM overflow is inherent or not, but it probably is

mortal kernel
#

It's grown very slightly, but just enough to overflow. I can work around it by eliminating PYCAMERA as that uses quite a bit. I don't understand (yet) why iram reserves such a large chunk of dram.

#
.dram0_reserved_for_iram
                0x3ffb8000    0x14d88
                0x3ffccd88                        . = ((ORIGIN (dram0_0_seg) + _iram_end) - _iram_start)
 *fill*         0x3ffb8000    0x14d88 

.dram0.data     0x3ffccd90     0x3d30
                0x3ffccd90                        _data_start = ABSOLUTE (.)
#

For comparison, from an ESP32-S2 build with v5.3.2:

.dram0_reserved_for_iram
                0x3ffb8000    0x14c04
                0x3ffccc04                        . = ((ORIGIN (dram0_0_seg) + _iram_end) - _iram_start)
 *fill*         0x3ffb8000    0x14c04 

.dram0.data     0x3ffccc10     0x3c74
                0x3ffccc10                        _data_start = ABSOLUTE (.)
#

@tulip sleet My understanding is that all of the text (compiled code) in iram is copied into dram, presumably to work around the access alignment limitations of iram. If I'm understanding this correctly, it should be possible to shrink the text in iram, and thereby claw back some dram, by making more nuanced adjustments to gcc's optimizations controls, specifically inlining.

tulip sleet
mortal kernel
#

I'm not clear re: when the text gets copied. It could be linker or crt0.

#

I've scanned through dram0.data, and I don't see anything obvious that can be tuned out by adjusting ESP-IDF confg parameters.

tulip sleet
#

i'm out for a couple of hours momentarily

mortal kernel
#

@tulip sleet No luck adjusting compile flags. I did learn that the optimization flag settings in CP's Makefile are overridden for ESP-IDF modules. For ESP-IDF, optimization flags are set indirectly by the CONFIG_COMPILER_OPTIMIZATION_* parameter. CP already configures this as CONFIG_COMPILER_OPTIMIZATION_SIZE=y.

#

(this is effectively -Os)

tardy current
#

Hi I'm using the Adafruit FT232H breakout (https://www.adafruit.com/product/2264) and I want to send output to one of the GPIO pins. I'm running a simple example with Adafruit_Blinka and it seems to connect fine, but the board doesn't send any signal outside of when it turns on. Another weird thing is no power is coming out of either the 3V or 5V pin - could be a defective board? Here's the script I'm running. Any help appreciated. ```import time
import board
import digitalio

PIN = board.D5

led = digitalio.DigitalInOut(PIN)
led.direction = digitalio.Direction.OUTPUT

while True:
led.value = True
time.sleep(0.5)
led.value = False
time.sleep(0.5)
print("turned led on/off")```

mortal kernel
#

@tulip sleet I've removed ESP_CAMERA from the ESP32-S2, and it no longer overflows DRAM. This may have to be a long-term solution unless there is something else that we'd prefer to remove.

#

The last issue with ESP-IDF 5.4.1 completely passing CI is flash overflow on the ESP32-C6 for certain translations. ESP_CAMERA and ESP_ULP are already removed. Any suggestions?

#

For jp, we need to claw back 3312 bytes.

tulip sleet
#

so turn, off, say ULAB, for now, mark it as temporary, and we'll turn it back

#

after that merges

mortal kernel
#

What do think about removing ESP_CAMERA from ESP32-S2?

tulip sleet
#

well, I think there may be some ESP32-S2 boards that have cameras on board (not sure about that), but other things could be turned off for those. I can try to mess with it later. It would be nice to turn it back on. I turned it back on for many boards in that PR, without RAM overflow

mortal kernel
#

You won't hit the DRAM overflow until IDF 5.4.1 is integrated. I wonder about the utility of a camera on the ESP32-S2 because it has so little DRAM.

tulip sleet
#

have you done some wifi or BLE testing on the 5.4.1 builds?

#

if not I would make that part of my review

#

after it's merged, I'll rebase my partition-change PR and see how the build goes

mortal kernel
#

Good point. I was going to bring up testing. I've done nothing more than smoke testing on ESP32-S3 at this point.

tulip sleet
#

The "Internet test" that's in all the guides is plenty

tulip sleet
full plume
#

Is there a reasonably accurate and maintained roadmap for MicroPython/CircuitPython development? There are a few specific features I'd really like to see which don't appear be actively pursued (based searching issues, etc. on GitHub), such as

#
  • weakref
    • compatible semantics for using a weakref.ref instance, i.e. someRef() returns the original object or None and merely holding an instance does not introduce a circular reference blocking gc
    • extra steps for creating the initial weakref.ref instance might be OK , and potentially avoid overhead for all instances
#
  • extract valid keyword argument names from a function/method/closure ( i.e. inspect.signature(...) )
#

Is this the right place for questions like these?

tulip sleet
turbid radish
#

The annual CircuitPython 202x posts each January solicits input from the community. That and how the industry is shaping up through the year. GitHub issues and PRs help.

#

Yes, aas CircuitPython is a fork of MicroPython, core functionality is typically added to MP and then rolled into CP

tulip sleet
#

so weakref is not as important if the circular references are unconnected to another known object

#

the circularity will get gc'd

full plume
full plume
# tulip sleet the circularity will get gc'd

hmm, then maybe all I need is a wrapper that emulates weakref semantics and implements them by conditionally importing weakref or replacing it with a pass-through which lets the gc deal with it if import weakref throws?

tulip sleet
full plume
#

My main issue with weakref is that I'm using some techniques which definitely require weakref to break circular references on a reference counting/CPython implementation, and I'd prefer to have the same codebase working on standard CPython and CircuitPython.

#

So a no-op weakref sounds like a winner for now

tulip sleet
full plume
tulip sleet
full plume
#

Actually I think I'd prefer an explicit replacement (i.e. a module that supports weakref semantics and uses the weakref implementation if available but is not named weakref) for my purposes, as it would add near zero overhead but leaves some hint in the source that you're using a weakref_-ish_ thing which may or may not behave similar to a CPython weakref (specifically with del / scoping and finalization timing ). And I can do that in pure python without any changes to the CircuitPython firmware. (Already did something similar for typing)

tulip sleet
#

we try not to change the MicroPython interpreter core very much. We do have a few differences involving traceback and maybe certain aspects of property support: I forget much about the latter.

jaunty juniper
#

note that for typing we just try/except the import, since CP ignores type hints anyway, so there's no need for dummies

full plume
#

The other issue - extracting valid keyword argument names - is potentially more significant. Use case is allowing callbacks to be registered (often through decorators), and wanting to provide optional keyword arg values when invoking them only if the callback expects them (or takes **kwargs).

tulip sleet
#

there is no accessible saved data structure to get that info

#

that info is compiled away

full plume
# tulip sleet that info is compiled away

yeah, given the dearth useful bits on a function instance, and the inability to set an attribute on a function / closure, I figured it might not be low hanging fruit

#

But there's logic that throws an exception if you pass in an unexpected keyword parameter, so it seems plausible that you ought to at least be able to ask "will this Callable accept these keyword parameter names" (although it might require some compiled extension code to get there).

tulip sleet
#

hmm, maybe. The name checking is part of the arg parsing logic. Sometimes there is a table, but sometimes not. For example, in busio_i2c_make_new() in shared-bindings/busio/I2C.c, there's this table:

    static const mp_arg_t allowed_args[] = {
        { MP_QSTR_scl, MP_ARG_REQUIRED | MP_ARG_OBJ },
        { MP_QSTR_sda, MP_ARG_REQUIRED | MP_ARG_OBJ },
        { MP_QSTR_frequency, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 100000} },
        { MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 255} },
    };
#

but there's no way to get at those tables, and sometimes the arg validation is more ad hoc.

#

and that's just for native modules

#

so hmm, yes, maybe there is some dict somewhere

#

for python code

full plume
#

(oops, ignore the reply bit...)

#

TL;DR I want to make it easy to create callbacks to do do the basics without having to write (or understand) def myCallback( **optionalStuffIDontNeed ): ... but that can use optional extras if they're asked for

tulip sleet
#

I see no thoughts about inspect.signature for MPy anywhere

full plume
#

I'm considering creating a callback "wrapper" that traps "unexpected keyword argument" and tracks which arguments it will accept. Kludgy and adds overhead, but plausible

tulip sleet
#

can you do this checking at compile time with mypy or something?

full plume
full plume
#

(and I realize this is also a goal for CircuitPython - I'm just adding some extra layers)

tulip sleet
#

I was thinking of the "mypy" checker as a pre-processor here

full plume
mortal kernel
#

@tulip sleet Dang, something's broken in TLS:

code.py output:
ESP32-S2 WebClient Test
My MAC address: ['0x34', '0x85', '0x18', '0x9b', '0x54', '0x4c']
Available WiFi networks:
        ATTiPdMEuI              RSSI: -48       Channel: 6
        Bevs wifi               RSSI: -89       Channel: 1
        TMOBILE-E0B2            RSSI: -86       Channel: 5
Connecting to ATTiPdMEuI
Connected to ATTiPdMEuI
My IP address: 192.168.1.213
Pinging 'google.com' took: 24.0 ms
Fetching text from http://wifitest.adafruit.com/testwifi/index.html
----------------------------------------
This is a test of Adafruit WiFi!
If you can read this, its working :)
----------------------------------------
Fetching json from https://www.adafruit.com/api/quotes.php
Traceback (most recent call last):
  File "code.py", line 55, in <module>
  File "adafruit_requests.py", line 711, in get
  File "adafruit_requests.py", line 639, in request
  File "adafruit_connection_manager.py", line 347, in get_socket
  File "adafruit_connection_manager.py", line 249, in _get_connected_socket
OSError: -30336

Code done running.
full plume
#

but part of the KISS requirement is that I don't want to have any specific IDE required - it needs to "just work" whether you're using https://code.circuitpython.org/, Thonny, VSCode, ....

tulip sleet
mortal kernel
#

It's this MBEDTLS error: "0x7680 SSL - No CA Chain is set, but required to operate"

tulip sleet
tulip sleet
full plume
tulip sleet
#

by fetching from mozilla or something

#

i just spent too much time on this a few weeks ago

#

discovering that the bundle was there already

#

wait, wait, but we build our own bundle, we don't use the default, so maybe that's not working

mortal kernel
tulip sleet
#

sorry, it's taking a bit to come back to me (I was using arduino-esp32)

#

we just stuff all the .pem's together and put it somewhere in the firmware. lib/certificates is the submodule with roots.pem

mortal kernel
#

I can re-test with a non-5.4.1 CP 10, if that helps.

tulip sleet
#

I was thinking of switching to the ESP-IDF default. It's in a more compact format

#

well, I think I did test alpha.2 and later stuff. I just used the wifi test program with the partition-changing PR, and it worked fine there

#

so this seems like a 5.4.x thing

mortal kernel
#

Probably is 5.4.1. At least I've got a thread to start pulling...

tulip sleet
#

maybe this is an mbedtls problem

full plume
#

I'm getting a "Hard fault: memory access or instruction error." and switched to safe mode after attempting some optimizations based on class RGB(namedtuple('RGBBase', ['r', 'g','b'])):...

#

I suspect it's related to also having get/set properties defined for r/g/b (retrofitting an existing class, slots doesn't seem to help)

tulip sleet
#

It's fine to open an issue, but if you can also reproduce it in MicroPython, it would be good to file an issue there.

mortal kernel
#

There are large changes in crypto with v5.4.1.

full plume
#

(I have it working, just need to figure out a repeatable way to crash it)

tulip sleet
mortal kernel
#

This is the big fish in my pan right now.

#

Which reminds me, it's time for late lunch.

mortal kernel
#

@tulip sleet Found in the v5.4 release notes breaking changes section:
"Security / ESP Cert Bundle: Due to changes in the certificate bundle format to reduce RAM usage, the use of pre-generated certificate bundles using the older format would now be incompatible with the newer application binaries. You now need to either use the default ESP-IDF build system method for attaching the certificate bundle while building applications or update your pre-generated certificate bundle binaries by generating them using the latest gen_crt_bundle.py script."
https://github.com/espressif/esp-idf/releases/tag/v5.4

tulip sleet
#

i may not get to this until monday or even tuesday

mortal kernel
#

No problem, I'm done for the week, as well.

tulip sleet
#

but it should be straightforward. I've been the one to deal with cert issues for a while now

mortal kernel
#

Feel free to clue me in on what's involved.

tulip sleet
#

but partly is was pruned because the .pem's are large

#

the arduino-esp32 Board Support Package for Arduino IDE uses the defaults cert bundle

manic glacierBOT
mortal kernel
#

@tulip sleet I read "ESP32-S2 Technical Reference Manual" section 3 "System and Memory" to gain a better understanding of how this part addresses its various memory address spaces. My understanding of how iram/dram works was incorrect. Both are mapped onto the same internal SRAM. The contents are not copied, rather they are shadowed from the individual iram/dram address spaces onto the same SRAM section.
Reconsidering iram use led me here: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/performance/ram-usage.html. In the section "Optimizing IRAM Usage" there are several recommendations for reducing iram usage. Implementing the first recommendation, moving FreeRTOS functions to flash, resolved the dram overflow without sacrificing the ESP_CAMERA component.

manic glacierBOT
manic glacierBOT
#

Hi @tannewt ,
could help understand circuitpython behavior regard ftp service

What’s happening in your setup:

You're running CircuitPython 9.2.7 on a Feather nRF52840 Express.

Your code.py uses BLE only for advertising, but no explicit BLE file transfer code is included.

The Glider app connects, and you can:

Create folders

Write files

After each file/folder operation (when running on battery, not USB), the device:

Performs an automatic soft reset

On reconnect (reopen app), the wri...

tulip sleet
mortal kernel
#

Scott gave me a hint in this direction, but I lacked the context to fully understand. Now I do.

manic glacierBOT
jaunty juniper
#

it's kind of funny to see on the display of a C6 board "Autoreload is on. Simply save files over USB". Like sure you could over USB serial, but I wonder if we should rephrase it altogether or remove the USB mention on non-USB boards. Or if it doesn't matter at all.

jaunty juniper
#

Sparkfun has a USB VID, how are boards added ? Have they added them themselves ? Are PID requested or documented somewhere ?

manic glacierBOT
#
  • Fixes #10170.

wifi.radio.listen_interval was inadvertently not added when #9476 was merged. Instead of fixing that directly, I've redone wifi power management so the same API can be used for both Espressif and CYW43 (Pico W et al).

The old cyw43 API is still available, but now there a property wifi.radio.power_management which can take values wifi.PowerManagement.{MIN,MAX,NONE}. On CYW43, these correspond to the "PERFORMANCE", "AGGRESSIVE", and "DISABLED" CYW43-specific values...

lapis sapphire
#

Adafruit_CircuitPython_asyncio repository description in GitHub has an uppercase I after C, so CIrcuitPython instead of CircuitPython. I could issue, but should I?

manic glacierBOT
#

CircuitPython version and board name

Adafruit CircuitPython 9.2.7 on a Feather nRF52840 Express.

Code/REPL

import asyncio
import time
import _bleio
import neopixel
import os
import board
import busio
import digitalio
import gc
import supervisor

from adafruit_ble import BLERadio
from adafruit_ble.advertising.standard import ProvideServicesAdvertisement


mac_address = 0
sw_version = "v1_2_9"

def parse_uname_output(uname_output):
    return {'version': uname...
lone sandalBOT
manic glacierBOT
#

Hi, Auto reloading when a file is changed is the expected behavior, this allows rerunning when you make a change to the code, imported modules or files used by the code. You can disable autoreload in code via the supervisor module.

import supervisor
supervisor.runtime.autoreload = False

From the issue you opened in the adafruit_ble_file_transfer library, it seems that you want to use the file transfer library...

manic glacierBOT
#

Thanks for the fast and detailed response!

I'd like to add some additional details to help clarify and fully explain the issue.

Our product is an IoT device, and we make extensive use of the BLE-based FTP service. Because of this, automatic reloads (auto-reload) after file transfers are problematic for our use case.

We have a dedicated folder where we store new recipes sent by the client. While we’re not currently using FTP as part of our OTA (Over-The-Air) update mechanism, it's still a c...

manic glacierBOT
#

This script will fix the zephyr build for you: https://github.com/adafruit/circuitpython/blob/main/ports/zephyr-cp/cptools/update_board_info.py

Thanks, took a bit to realize how it all worked. Just a note for the future, if someone (me) has stale/old folders in the shared-bindings directory it can cause problems. Wasn't hard to fix after but a small "gotcha".

I think the other issues were mostly the fact I submitted this PR before zephyr, and that should not happen again for others.

tulip sleet
manic glacierBOT
crimson ferry
#

@danh for PR Wifi power management #10271, the latest commit seems to have removed the artifacts for espressif and raspberrypi. Is there somewhere else to find them?

#

oh n/m, I figured how to get at them

#

n/m the n/m, the artifacts aren't there, only the build output

manic glacierBOT
#

Thanks, I note that the LED is active low. In cases like that we have used LED_INVERTED. Most of the times having both, but the presence of the "inverted" alias makes it discoverable that the LED is inverted. (And sometimes only LED_INVERTED like on the Xiao M0, but it has multiple LEDs and labels them with colors).

https://github.com/adafruit/circuitpython/blob/ceda2f0545d0b16261563aeef92f4bef576bf01d/ports/espressif/boards/ai-thinker-esp32-cam/pins.c#L32-L33

<img width="106" alt="le...

tulip sleet
crimson ferry
#

I'm getting safemodes ( memory access or instruction error) consistently on Pico W and ESP32-S2 QT Py, should I put more info here, or in the PR?

#

(haven't tried custom power modes yet)

manic glacierBOT
#

Trying on ESP32-S2 QT Py & Pico W. Not yet exercising the new get/set power APIs. Consistently get Hard fault: memory access or instruction error somewhere right after the wifi connection (after printing the IP address. Code runs w/o safemode on 9.2.7.

adafruit-circuitpython-adafruit_qtpy_esp32s2-en_US-20250420-main-PR10271-f8ed46a.uf2
Adafruit CircuitPython 10.0.0-alpha.2-22-gf8ed46adce on 2025-04-20; Adafruit QT Py ESP32S2 with ESP32S2

adafruit-circuitpython-raspberry_pi_pico_w-e...

tulip sleet
#

OK, reproduced with artifact

#

@crimson ferry I'm seeing these crashes on the tip of main, so they are totally unrelated to #10271. The tip of main is broken in some way.

manic glacierBOT
manic glacierBOT
#

I fixed this by removing the NORETURN from NORETURN mp_obj_t MP_WEAK rtc_get_time_source_time(void) in shared-bindings/time/__init__.c. Since this is an MP_WEAK function, sometimes it's NORETURN, and sometimes it's not, and declaring it NORETURN here appears to be messing up the other cases.

There is another example of NORETURN on an MP_WEAK function, which I'll remove. Also #10260 doesn't consistently declare/define functions as NORETURN in both the .h and .c files, an...

manic glacierBOT
#

-- Fixes #10274

As described in #10274, #10260 added NORETURN to some MP_WEAK functions, which were not always NORETURN. Only the NotImplementedError versions of these functions were not return. This caused crashes.

Note there was already one MP_WEAK NORETURN functions, common_hal_socketpool_socketpool_raise_gaierror_noname(), but it always raises, so it's always NORETURN.

mortal kernel
#

@tulip sleet I'm working through my collection of Espressif boards testing the ESP-IDF upgrade. I've run into a problem with an older Feather Huzzah ESP32. I've followed the instructions in the Primary Guide, erasing and flashing CP with the WebSerial ESPTool. On reset, this message repeats on the usbserial:

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
invalid header: 0x61646100
invalid header: 0x61646100
invalid header: 0x61646100
invalid header: 0x61646100
invalid header: 0x61646100
invalid header: 0x61646100
invalid header: 0x61646100
ets Jul 29 2019 12:21:46
manic glacierBOT
tulip sleet
mortal kernel
#

@tulip sleet NP, To be clear, this is happening with ESP-IDF 5.4.1. Earlier builds work correctly. I'm seeing a similar problem with an ESP32-C6 feather.

tulip sleet
manic glacierBOT
#

Was this the PR you were looking at some help to get past some technical hurdles? I think I may have time to help if you wanted me to poke at this as well. I will have to get some hardware that can do I2S input still.

There have been a couple of changes to audio dma recently. I likely need to revise a lot of this before pushing for a review. I also think the recent changes to garbage collection may improve this feature and was likely why the performance was unacceptable in the first plac...

mortal kernel
manic glacierBOT
#

Took a quick look, the waveform (in Audacity) looks like a overflow error. Quickly traced it back and in:
https://github.com/adafruit/circuitpython/blob/ceda2f0545d0b16261563aeef92f4bef576bf01d/shared-module/synthio/__init__.c#L272

there is a likely overflow error (int32_t * int16_t into a int32_t) that Jeff noticed when we were discussing fixed point. I think this is the same error that was causing some random distortion I was getting with louder volumes and multiple voices.

full plume
# mortal kernel <@329766224093249548> I'm working through my collection of Espressif boards test...

If you can give me a link/version for grabbing the ESP-IDF upgrade and a branch/tag for CircuitPython, I'd be willing to try getting it set up and tested on some ESP32s in my collection too. I haven't done much directly yet with ESP-IDF, but I've got plenty of experience with complex build systems. I was already planning to try migrating some of my C++ stuff to ESP-IDF (currently using PlatformIO) before I started playing with CircuitPython.

blissful pollen
#

Does the code ever really use int64_t and if I had to is that "slow"? This is for a synth fix where I think we are overflowing. I could scale the 32bit value signal down first but then if it is a quiet sound we risk loosing the original all-together.

The alternative (and maybe "right" way) is to go through to all the places we do calculation and ensure we scale into an int16_t value and don't let a in32_t value live too long.

mortal kernel
# full plume If you can give me a link/version for grabbing the ESP-IDF upgrade and a branch/...

There are a couple of show stoppers we're working through, so the updates aren't merged yet. If you'd like to give it a try in its current state, the build artifacts are in this PR: https://github.com/adafruit/circuitpython/pull/10267. TLS is not working due to a certificate format change, and the older ESP32 parts that don't support the uf2 bootloader may also have problems. If you do find other regressions, please document them in https://github.com/adafruit/circuitpython/issues/10191.

#

@tulip sleet The Feather Hussah ESP-32 fails differently when flashed using esptool.py. Here's what I see on the serial:

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0040,len:400
load:0x40078000,len:14048
load:0x40080400,len:4
load:0x40080404,len:3108
entry 0x40080554

After that, nothing.

slender iron
slender iron
mortal kernel
full plume
#

uf2 bootloader support cuts out quite a few, but I still have a variety of S2 and S3 boards (primarily Wemos/Lolin, Lilygo, and Freenove). I'm not directly using TLS, most of my experimentation has been with uf2/CIRCUITPY and USB console/REPL.

tulip sleet
#

@mortal kernel just to be clear, you are trying to flash the ESP32 to 0x0000, and you're flashing firmware.bin?

manic glacierBOT
full plume
lone axle
#

<@&356864093652516868> The weekly meeting will occur here on discord at the usual time today 2pm US eastern / 11am US pacific. That is in about 1 hour and 15 minutes from now. You can add your notes and hug reports to the shared document: https://docs.google.com/document/d/1kpHthhyD6M3mV8NQJG-J0e0iFCaIiq1rwGCaE1qnFzM/edit?usp=sharing We look forward to catching up with everyone.

manic glacierBOT
#

With a DEBUG=1 build flashed onto a Feather Hussah ESP32, double faulting early in startup:

configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:6592
load:0x40078000,len:16684
load:0x40080400,len:4
load:0x40080404,len:4268
entry 0x40080658
I (29) boot: ESP-IDF v5.4.1-6-gf50ec8ecdb 2nd stage bootloader
I (29) boot: compile time Apr 21 2025 09:39:10
...
mortal kernel
#

@tulip sleetThe ESP32 is double faulting early in startup. I'll need to hook up JTAG. Fortunately, the pins are exposed on the Feather Huzzah ESP32.

orchid basinBOT
#

This would serve as sort of "relief valve" for the long stalled actions task. The configuration is documented here: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idtimeout-minutes making it give up and get cancelled sooner if it gets stalled.

The default value is 360 which matches the 6 hours that the actions run lasts when it gets stalled.

I believe with it set to 150 minutes it should get cancelled and stopped after 2.5 hours maximum ...

manic glacierBOT
full plume
#

I have the current main branch / ESP-IDF 5.3 built, loaded, and running successfully in a Lolin/Wemos S2 Mini. I'll setup another build with ESP-IDF 5.4.1 and https://github.com/adafruit/circuitpython/pull/10267 later today. I have a Lolin/Wemos S3 Mini, Lilygo T7-S3 / T-Energy S3 / T-Display S3, FreeNove ESP32-S3 WROOM, SeeedStudio Xiao ESP32Sense, and a couple of generic S3 dev-kit / micro S3 / ESP32-Cam boards available. Not all of those have their own port yet, but should be easy enough to get working. My current focus is the Wemos D1 Mini compatible boards (Lolin S2/S3 Mini, Lilygo T7-S3), but I could test a few others. Any preferences on priority?

GitHub

Upgrade ESP-IDF from v5.3.2 to 5.4.1.
Draft pull for now to check for CI errors and obtain build artifacts.
Resolves #10191.

tulip sleet
#

other testing to do would be I2C, especially on S3, wifi testing, and BLE testing

slender iron
turbid radish
#

Please subscribe

slender iron
#

@blissful pollen you are unmuted

lone axle
full plume
# tulip sleet eightycc is off for a bit starting today. The most interesting testing would be ...

I don't think I have any S2/S3 boards without PSRAM and I haven't done much with BLE (and that only with Arduino libraries in C++). But I intend to test the LilyGo T7-S3 configured to use the full 16MB flash (and 8MB PSRAM), and I could test the FreeNove S3 with 8MB flash and 8MB PSRAM. Unfortunately I don't think I have any Adafruit ESP32-S2/S3 boards, but I do have a couple dozen Stemma QT modules (plus a handful of Sparkfun Qwiic and a bunch of general I2C breakout boards) so I can give I2C a workout. Any particular I2C / Stemma QT bits you'd specifically like to see tested on an S3?

thorny jay
#

Thanks

lone axle
#

Thanks everyone, have a great week 👋

blissful pollen
tulip sleet
lone axle
#

I've just realized that my recording stopped after Dan's status update :(. I was trying to take a timestamp for Scott and accidentally had focus on OBS instead of the doc. I didn't realize what had focus at the time, or that the space bar in the timestamp caused OBS to stop recording.

Unforunately this means Scott's status report and the wrap up will not be included in the video / audio recordings this week unless anyone happens to have been running a backup recording.

full plume
# tulip sleet Thanks! If you have BNO055/BNO085 you could try those on ESP32-S3. They don't cu...

Don't have the Stemma QT BNO055, but I did find a https://www.adafruit.com/product/2472 in my parts box. If it's been fixed in the new ESP-IDF release, should the existing adafruit_bno055 module work with it just fine?

tulip sleet
#

yes, but I doubt it will 🙂

slender iron
full plume
#

true, but it should be easy to try once I've got the EDP-IDF 5.4.1 CP firmware working on an S3

lone axle
#

I'm adding an extra note at the top of the YT description mentioning to see the notes doc for full details of the last few minutes.

#

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

manic glacierBOT
#

I also hear distortion at times with many voices that I bet it's due to this. So if we find a good cheap fixed-point saturation algorithm, maybe we put it in sum_with_loudness().

I use one already in Reverb so when I have a moment I'm going to look through synthio and try to catch places where we are letting things get too large. Probably should be its own issue but your report is easy to reproduce. I never could find a magic way.

tulip sleet
#

@slender iron you're using ARM gcc 14 for a while now? Shall we update main to that?

tiny peak
#

@slender iron does the current Fruit Jam board build have support for the IR rx, ESP32-C6 airlift, etc. yet?

tulip sleet
#

we have existence proof of C6 working in a breadboarded setup

tiny peak
#

ok. I think I'll have my hands on a board pretty soon. Could potentially test firmware builds out if there are things you'd like some extra eyes on. Planning to write some Playground guides.

tulip sleet
#

I should be getting one soon as well, so far I've been mocking it up

tiny peak
#

do you know if the schematics for the latest board rev are up someplace publicly accessible yet?

slender iron
slender iron
#

so I can answer any questions you have

tiny peak
#

IR rx pin?

slender iron
#

Looks like it is shared with the red led

#

so GPIO29

tiny peak
#

or, generally, are the pins from the schematic already defined in the circuitpython port? In that case, I can just dig around until I find the right defines

tulip sleet
#

or maybe those are GPnn or IOnn I don't remember

#

they are is identical to the board pins

tiny peak
#

I'm mainly wondering about changes that may have happened across board revisions and whether those are reflected in the port defines yet

slender iron
#

they are. I'm working off rev b

tiny peak
#

awesome. thanks!

#

this is exciting.

slender iron
full plume
#

I'm working on a framework with support for a variety of Wemos D1 Mini-compatible expansion boards. All the C++/Arduino docs and examples are primarily based on using the original ESP8266 Wemos D1 Mini controllers, so I've "normalized" pin assignments such that my driver code will "just work" using the original pin names. This is done using a mapping from the actual pins for the ESP32-* D1 Mini "compatible" to the original pins. For example :

manic glacierBOT
#

I've not looked, but it seems that whatever audiofilters.Filter is doing is different. That is, by moving using an audiofilter instead of a per-Note filter like below, the glitches are gone (but there are odd bumps in volume at the glitch frequencies)

""" .... set up audio system including a mixer and synth """

filter1 = audiofilters.Filter(buffer_size=1024,
                              channel_count=CHANNEL_COUNT,
                              sample_rate=SAMPLE_RATE,
         ...
full plume
#

I'm using board.board_id as the key to find the right mapping based on the actual running controller.

tulip sleet
#

the board and microcontroller.pin objects are the same internally

full plume
#

One thing that seemed odd is that I've had my S2 Minis show up as both "lolin_s2_mini" and "WemosS2Mini" in board.board_id

tulip sleet
full plume
# tulip sleet instead of using strings, could you use the `microcontroller.pin` names

I don't think that will work - the idea is to provide a single source set of configurations that works with any of the mapped boards. So if, for example, the original D1 "A0" pin mapped to microcontroller.GPIO40 on a given controller, but another controller doesn't have microcontroller.GPIO40 available, I can't have the main mappings in a single source file.

tulip sleet
#

ok, I didn't know whether they were all S3 or whatever

full plume
#

I used strings to get around this. Ultimately, "GPIO21" will end up being filled in as getattr( microcontroller.pin, "GPIO21")

manic glacierBOT
full plume
#

So I think I saw mention that CircuitPython 10 is going to drop the OTA partition? Which would presumably free up more space on the CIRCUITPY drive (for controllers with uf2 support)?

jaunty juniper
jaunty juniper
stuck elbow
#

for i2c usually you can just use board.I2C() and it will use the default pins

tulip sleet
#

CIRCUITPY is going to remain the same size. The "ota0" partition (the "app" partition) for firmware will double the size

jaunty juniper
#

right, it frees up space for Circuitpython not for the drive

full plume
# jaunty juniper board_id is CIRCUITPY_BOARD_ID, which is name of the board directory, can you ch...

I'm fairly certain I've always used https://circuitpython.org/board/lolin_s2_mini/ for my S2 Mini boards, and all my CircuitPython installs have been in the last two or three months.

The LOLIN S2 Mini is a small (33.4 mm x 25.4 mm) development board. The form factor is almost the same as the well-known LOLIN D1 mini. This means that there is a high chance that the D1 Mini Shields could also be uses with this board.Technical details ESP32-S2FN4R2 WiFi SoC Xtensa® sin...

stuck elbow
slender iron
#

@tulip sleet did you mean to approve the samd pr?

tulip sleet
#

I'm doing a couple of smoke tests on a trinket

full plume
# tulip sleet CIRCUITPY is going to remain the same size. The "ota0" partition (the "app" part...

Oh well, I was hoping for a little more CIRCUITPY space. OTOH, sounds like there have been some audio fixes that might actually be better - my main problem is that I need to use audiomixer to play multiple samples at a time (and to have volume control) . My attempts to do so with audiomp3 sounded terrible. So I switched to WAV files - which sounded much better, but they chew up way too much of the CIRCUITPY drive.

tulip sleet
#

@slender iron interestingly a trinket m0 with gcc14 isntead of gcc13 is 100 bytes larger

full plume
# tulip sleet you could flash a different partition .bin and achieve that. For audio, it's goi...

Yeah, that was part of the motivation for getting set up to build CircuitPython locally. But I'd really prefer to avoid any dependencies on a custom build out of my framework framework bits. I definitely intend to add some native code (ideally dynamic native modules, but not sure if those are ready yet...) but they'd mostly be optimizations, so the "user" code works (abliet potentially slower) whether or not they're using a custom firmware build. Although as far as the CIRCUITPY drive size goes, moving up to an 8 or 16MB flash controller should help far more than dropping the OTA partition if someone wants more audio.

slender iron
jaunty juniper
#

on 4MB boards, the no-ota-no-uf2 partition has a ~2MB drive, with a ~2MB ota0, while the no-ota version has ~1MB drive with a 2.8MB ota0 (since it just fuses ota0 and ota1 rather than change the drive size, which avoids corrupting the drive)

tulip sleet
#

🤷‍♂️

#

after the next alpha release I'll bump the version, I think, maybe too much churn for now

full plume
#

Gotta go find that S3 mini, firmware build just finished. I'm used to some rather large builds - 16 cores, 96GB ram, and fast SSDs usually make them manageable - but this one had me wanting more coffee...

manic glacierBOT
manic glacierBOT
full plume
#

lolin_s2_mini build (w/ ESP-IDF 4.51, ...) finished and runs just fine.

#

The lolin_s3_mini build does not - after copying in firmware.uf2 it stops booting. Can't even git back to the UF2 bootloader.

#

I can still go back and reinstall 9.2.7 from the beginning and it works fine (CIRCUITPY drive appears normally, USB REPL works)

#

But if I restart in UF2 bootloader mode (which is press-release RST/RESET followed quickly by press-release 0/BOOTLOADER - instructions are wrong on CP download page for Lolin S2/S3 mini) and then copy in the new fimware.uf2 (exact same process I used with lolin_s2_mini) it drops/reconnects USB but CIRCUITPY drive does not appear nor can Thonny find the USB REPL/console.

#

But this time I can still get back to the UF2 bootloader on the S3 mini.

#

So since the S2 Mini build worked fine, I think it's time to make clean BOARD=lolin_s3_mini and try again later...

#

I don't see anything obvious in the files changed (https://github.com/adafruit/circuitpython/pull/10267/files) related to either of those boards which would explain it. Although CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y gets added to sdkconfig-esp32s2.defaults, but sdkconfig-esp32s3.defaults remains unchanged (and does not set CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH). Guess I'll try that if the clean build still fails.

manic glacierBOT
#

@gamblor21 I began to encounter issues with buffer positions when using a synthio.LFO on delay_ms. In the process of working it out, I decided to implement the split buffer in stereo (1st half = left channel, 2nd half = right channel) on both delay modes (freq_shift=False/True) and always keep separate buffer positions for left and right channels. This fixes the single_channel_output problem, simplifies the code slightly, and fixes the issues I was having with the aforementioned `dela...

slender iron
#

@tiny peak did you try the extended back porch? my tv seems fine with a longer back porch

manic glacierBOT
#

Recent additions in #10240 throw buffer allocation errors on RP2040 devices. The exact cause is unknown, but is likely "due to the Python VM heap taking up most of the outer heap (allocated via port_malloc using tlsf)." @tannewt

The RP2040 does not support PSRAM, so port_malloc should be unnecessary in this case. All relevant code is reverted to the original implementation if compiling for an RP2040-based device.

Tested on a Waveshare RP2040-Zero and Pimoroni Pico Plus 2 with I2S audi...

#

With a DEBUG=1 build flashed onto a Feather Huzzah ESP32, double faulting early in startup:

I am getting the same problem on the tip of main for Feather Huzzah32, so this appears not to be a v5.4.1 problem. I'll do a bisect between there and alpha.2, which works OK.

It turned out this double faulting crash only occurs with DEBUG=1 on main for Feather Huzzah ESP32. It also occurs with a DEBUG=1build on 10.0.0-alpha2.mainand10.0.0-alpha.2are fine withoutDEBUG...

tiny peak
manic glacierBOT
#

Testing now on all six boards. If it behaves like it used to, the more aggressive power management settings may cause the wifi connection to drop as the time between requests increases. But, the field values for each setting are quite different than they used to be, so they may all work. I'll update tomorrow, once they have run long enough to confirm whether wifi stays connected at each power management level (it used to fail between 5-10 minutes on Pico W with increased power management).

tiny peak
#

I've just been planning to use 320x240 or 640x480 with my capture card and call it good. If that gives me any trouble, I might end up getting an Extron video scaler off ebay.

#

I looked to see if I could find any XR1 Lite capture cards for sale. Seems that model must have been discontinued or something. Didn't find much except for a few ebay listings at higher prices than what you mentioned.

manic glacierBOT
#

Thanks! I should've tried the alpha release before asking. I also discovered my local CircuitPython git was a few weeks behind.

Both the 10.0.0-alpha.2 and main branch work when plugging in my RP2040 devices, even with CircuitPython, save for one...
On one of the CircuitPython devices I enabled the USB CDC data stream (usb_cdc.enable(console=True, data=True)). The configuration descriptor for this device is now 284 bytes, which exceeds the CFG_TUH_ENUMERATION_BUFSIZE=256 set in `supervis...

manic glacierBOT
#

This seems to be a problem with DMA-buffers being overwritten from I2S side thus corrupting memory for SPI. I managed to fix this with this change:

diff --git a/ports/espressif/common-hal/audiobusio/__init__.c b/ports/espressif/common-hal/audiobusio/__init__.c
index 226e371c5b..d07a0b521b 100644
--- a/ports/espressif/common-hal/audiobusio/__init__.c
+++ b/ports/espressif/common-hal/audiobusio/__init__.c
@@ -184,7 +184,7 @@ void port_i2s_play(i2s_t *self, mp_obj_t sample, bool loop) {
   ...
tulip sleet
#

@mortal kernel It's fishy that on ESP32 I got the double fault with DEBUG=1 on the tip of main, but without that it ran normally. So the DEBUG=1 crash may be different than the failure of #10267. Or it might be something like a storage overflow somewhere, which is provoked on #10267 and on the increased size of things due to DEBUG=1. I think it might be worth doing your tracing on both DEBUG and non-DEBUG builds to see if they are related.

#

I do see a hang or crash on non-DEBUG on #10267, as did you.

mortal kernel
tulip sleet
#

I will stop working on this and move on the root certs change

#

I did look to see if there were any interesting changes in sdkconfig settings by doing a menuconfig to get the defaults, but I didn't see anything immediately interesting. The number of differences between the default sdkconfig and the one our builds generate is small. But it could be just one thing I missed. @slender iron what was your procedure for finding necessary sdkconfig changes/additions? I tried running some of your scripts in tools/ but didn't get that far

candid crag
tulip sleet
#

a custom build is not needed with this technique

#

the uf2 will be big and will take a long time to flash

#

but it's a one-step thign

candid crag
#

thank you @tulip sleet i will give this a try

manic glacierBOT
#

I've not looked, but it seems that whatever audiofilters.Filter is doing is different. That is, by moving to using an audiofilter instead of a per-Note filter like below, the glitches are gone, but there are odd bumps in volume at the glitch frequencies.

audiofilters.Filter uses a different code (and we have discussed removing the synth specific but I can't remember the outcome). So the Filter class won't overflow the same way synthio filters are. I am still going to try to fix the...

lone sandalBOT
manic glacierBOT
#

The original issue with more aggressive power management on Pico W in #6958 was [Errno 2] No such file/directory, typically after about 5 minutes, requiring a reset to recover. The wifi connection to the AP was not lost.

I have not seen that behavior on either espressif or raspberrypi port, using any of the new power management settings (NONE, MIN, MAX) running overnight, with intervals between requests of 40 minutes and more. Also no wifi disconnections at all.

Trying to re...

slender iron
lone sandalBOT