I tested a build from this branch on PyPortal with the Cleveland art project and confirmed it is able to run with this version without having any stack size declared in settings.toml now.
#circuitpython-dev
1 messages · Page 84 of 1
Looks like we condition the second drive on CIRCUITPY_SDCARDIO but not the stricter automounting test:
I don't know why the drive letter would change.
- Set working directory for subsequent file.
- Add
pathlibfor easy file discovery.
Thanks for submitting a pull request to CircuitPython! Remove these instructions before submitting.
@slender iron Did you miss the PR I made to your pathlib fork or am I missing something about the proposed fixes?
Should be in my branch now. I force pushed it
Looks like you got one of the commits, but I don't see the second one
It looks like you missed the second commit.
This line results in the parent being returned as "Slash" which didn't function as a posixpath object. Changing to the following returns "/" which does function properly
return pathlib_posixpath_from_str(MP_OBJ_NEW_QSTR(qstr_from_str("/")));
Same issue as below:
return pathlib_posixpath_from_str(MP_OBJ_NEW_QSTR(qstr_from_str(".")));
@tannewt,
The The drive letter may have been changed because I connected another MCU to the USB cable I was using to see what would happen. It came up as O:. When I reconnected the Alpha board to the same cable the drive letters were swapped. HTH
I just did it by eye. Thanks for commenting on the PR
@lone axle the clicks are garbage collections
The "loud chirp" or more "scratchy" sound? or both are the same root cause?
Well the user code displays seem to be working with m_malloc now. I've held off working on moving displays to the static storage as I think that will be related to the primary display features and I thought it would be better to work on that in a follow up PR.
Right here.
got time to chat?
You bet.
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?
Fixed up CI by adding an additional CIRCUITPY_BOOT_BUTTON_NO_GPIO pre-processor macro for RP2 boards w/o a BOOTSEL GPIO pin connection. All RP2 boards are now coded this way, but I don't think there's any advantage to special-casing the ones that do have a GPIO pin connection.
Noticed an opportunity for a bit of code refactoring and took it.
I think the color sweep was stuttering the audio a bit
The letters disappearing was caused by DMAing the audio out of PSRAM
working on a more robust fix for it now
Writes the wifi MAC address in the boot_out.txt making it better documented and discoverable.
This is what is done on pico W. P4 and H2 are excluded by testing for the wifi module.
The ESP already uses the MAC as UID, but with nibbles in a different order and it's not made clear that it is.
Just curious how did you stop the gc from interfering with the display/audio?
I removed the use of enumerate
it generates tuples that then get unpacked immediately
but still need to be collected
ah cool, thanks for the info. Good to know.
oh that's sneaky
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
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
I wonder what the Micropython people think about that
it is pretty large in this case because the bitmaps are loaded into it
the collect was taking 120ms
This places the VM heap in PSRAM by default. audio_dma now directly allocates its buffers to ensure they are dma_capable.
[adafruit/circuitpython] Issue opened: #10241 Setting the rotation on a display loses the REPL in 10
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
@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
Not completely related, but I noticed that the top status bar disappears when setting the rotation in 9.x, until ctrl-D.
This looks good, very close to Pico W code (and a little better, because it defaults to the weak version completely if no wifi). Thanks!
Miss y'all. Here are some snaky snakes.
Enjoy Barcelona
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...
Should help curate the home page a bit better so we can limit guides with blurry images or guides that are out of date, etc.
For anyone struggling with OpenOCD, I've found pyocd to be a great alternative.
Hi @tulip sleet this is ross from mchp
mchip curiosity
Sounds good! Can you have the first display use the single static allocation?
You mean if it hasn't been used by picodvi, board.DISPLAY, or anything else yet. Yea, if I do that it will save allocating the dynamic storage for a single user display. I'll give it a go :grin:
Actually maybe I'm misunderstanding, I think it already grabs the static storage first.
Refactor looks good! One other question before approving.
Do you only want this if there is no separate BOOT button?
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.
Okay, I may have changed my mind. What if we did create a new
audioreverbsmodule, 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?
Switching to draft while I track down an issue with I2C displays not showing up until after a ctrl-D restart. I think it has something to do with the bus not being a dedicated display bus but I'm going to need to stare at it for a bit more....
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
audioeffectsfor 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...
@dhalbert I believe this PR is ready for merge (pending a review with write access), but would you like me to rebase it 9.2.x or keep it on 10.x (main)?
@dhalbert I believe this PR is ready for merge (pending a review with write access), but would you like me to rebase it 9.2.x or keep it on 10.x (main)?
With an answer to 9.2.x or 10.x I can do a final review/merge too, to save others time.
It's there for some flexibility that we may not need. For example, an individual board could undefine CIRCUITPY_BOOT_BUTTON_NO_GPIO and define a GPIO pin with CIRCUITPY_BOOT_BUTTON.
We don't have anything else in the 9.2.x pipeline right now, so this may not appear in a 9.2.8 that soon. If you feel this is an important bug fix, you can do 9.2.x and it will be merged over to main. But otherwise main is fine, and you can point people to the 10.0.00 alpha and beta releases.
Note there is a failed build.
Making active again, this is the second time the SH1107 I2C display has sent me down a wild goose troubleshooting path. I'll open an issue on the library and hopefully remember now that when the I2C display starts acting flaky that it might not be the core code....
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...
SST flash debugging
If you want an executive decision, I'd say leave it in main, because we want to steer people toward trying the 10.0.0 builds.
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...
@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...
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 ...
I tried with a different USB Host cable breakout on the Metro RP2350 and confirmed it still is unable to find the SNES like gamepad under both 9.2.7 and 10.0.0-alpha.2
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.
Apparently the AF Feather RP2350 does it also.
I bet we can scale the HSTX clock down to get 60hz. 720x400 may work better for you because that mode is ideally 70hz.
I'd suggest getting a backtrace via a DEBUG=1 build. That should explain further why it is crashing.
m_malloc will crash if the VM isn't active but if you are doing an import rclcpy then it should be.
I'd assume that CIRCUITPY_BOOT_BUTTON would take precedence.
Note we generally don't use defined/undefined for CP macros. Instead we always test their value and have a default value #ifndef in py/. This ensures the code that uses it includes the correct headers.
Ok, sorry about that. I hadn't looked at the updated code. Will do shortly!
Will DEBUG=1 override the Circuitpython USB with the esp monitor? I was looking around for docs on that but didn't come up with anything initially. Currently trying a new build with the Espressif Devkit C.
I'd go further and put this in a freeverb module (check pypi to make sure it doesn't exist). That way each reverb implementation can have its own module and inclusion.
@wraith crow have time for a voice/video chat about the display limit changes?
Just posting this to highlight the question of whether this memory cleanup is necessary or would be done by the port_free(_heap) called by stop_mp
Sure, probably voice only, my video setup is not in great shape
sure, pythonisita is fine
Whoops, looks like this is actually a wifi coordination issue:
assert failed: tcpip_send_msg_wait_sem /IDF/components/lwip/lwip/src/api/tcpip.c:449 (Invalid mbox)
This is actually the kind of problem I expected, just not for it to manifest as a hardfault. I'm glad it's not a problem the allocator.
Any idea when As7343 will be released?
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!
@hathach Want to take a look at this? Maybe a low speed device that doesn't work when directly connected.
@slender iron supervisor_background_tick iterates the displays (via displayio_background) to perform refreshes do we still want that functionality?
Ah, yes we will.
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.
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
okay, I'll work on that approach
thank you!
Looks good to me, and was an easier change than I thought. But it will reduce performance on boards with PSRAM -- I wonder by how much. We may need to revisit this in some way.
This is kind of tricky, because it involves knowing where the PSRAM base and the SRAM base are. But there's plenty of other magic here, like 0x11000000. Unfortunately there don't seem to be good #defines for this in the pico-sdk header files. There is XIP_NOALLOC_BASE for RP2040, but that's not the right value for RP2350 start of PSRAM.
I'd like to re-run the failing job, but I think this is too old to re-run. It was a transient failure, though, I believe, so never mind.
[adafruit/circuitpython] New comment on pull request #10238: Two enhancements for Fruit Jam launcher
@RetiredWizard Thanks for the additional comments. I'll need to be better about testing my Claude generated code. I've fixed in a slightly different way by fixing the QSTRs.
- Fixes #9595.
- Related to https://github.com/adafruit/Adafruit_CircuitPython_asyncio/pull/71
Remove deprecated task queue operations. Use the shorter names instead:
push_head->pushpush_sorted->pushpop_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.
[adafruit/circuitpython] New comment on pull request #10238: Two enhancements for Fruit Jam launcher
I was planning on giving pathlib a pretty thorough workout by incorporating into the PyDOS directory system. Currently I'm using a Python workaround for the vfsFat mount point issue (can't traverse up a path to the root) and was hoping that I might see a way to put the workaround in the pathlib core code. I'll probably put that on the back burner now though :grin:
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.
Can you do a Shift-reload? I see it on Firefox 137.0 on Linux and also on Firefox 137.0.1 on macOS 15.4.
I just installed Firefox on iOS, it’s never loaded the site, and see a similar issue:
Similar results in Safari iOS. Safari MacOS looks as expected.
I'm still not seeing this problem, either on iOS (Safari or Firefox), or any other platform. Do you have an iOS phone? Any difference between on WiFi and cellular data?
@jwcooper Any ideas about this?
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...
@todbot should be fixed, if you can test with a shift-reload. Your displays are too good!
Thanks @Neradoc!!
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...
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.
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...
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: ...
@lone axle @short tendon https://forums.adafruit.com/viewtopic.php?t=217785 some typos in the secrets.py cleanup. Not sure who did the PR for this.
Thank you, that is updated now. It was in a code block directly on the page, not in the repo code.
@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
!
only pointer is the type field?
is there a bit available to indicate that?
would framebuf fall into that category?
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
If there are also objects with nothing but data except for the type field (e.g.g array.array), could also save time
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
oh, I didn't realize there was a separate allocation of the holder object vs the data block
this is an excellent idea
I think there often is
and we can change it if there is
here is array and bytearray: https://github.com/micropython/micropython/blob/db854270719bfa4dda003d38893c1b8f39bf58de/py/objarray.c#L110
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
interesting that 1161 says all allocated chunks have a type word
(from 2015)
I could just mimic FTB
for now
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?
@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...
mp_printf(&mp_plat_print, ...)
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.
I've been making some additions to Awesome CircuitPython
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.
I've identified two root causes that are causing this bug:
- 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.
- 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...
I've had my best results connecting a J-Link to the debug connector on a Metro ESP32-S3 board. Getting it to work requires blowing a configuration fuse on the ESP32-S3 and externally strapping a GPIO pin. Here's an incomplete gist that explains it up through blowing the fuse and external strapping: https://gist.github.com/eightycc/b27d0da6d2864b758d59eeb083552344
idk if I can swing that haha
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.
I guess I'm seeing now that using the jtag pins in general requires an irreversable fuse burn
Yup. I did try to use the CMSIS-DAP that gets exposed on the USB port, but could never get it to work.
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?
Actually the fuse I documented leaves it configurable by external strapping.
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
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.
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.
this is some pain, probably worth an addition to the readme
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.
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
You'll need to add these lines to ports/espressif/Makefile:
ifeq ($(ENABLE_JTAG), 1)
CFLAGS += -DENABLE_JTAG=1
endif
sorry I didn't mean to sound like a jerk judging your gist right after you offered help 😱
No worries, you didn't.
When you build, add ENABLE_JTAG=1 to your make command line.
I wonder why that's not in there by default
🤷♂️
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
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"
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
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.
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
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.
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
For CYW43, is this different from https://github.com/adafruit/circuitpython/pull/6976 ? (issue is still open in MicroPython)
FWIW, I believe NINA firmware uses PS_MIN_MODEM by default.
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.
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
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
espressif or raspberrypi?
espressif, 9.2.7
I was actually using your tcp_server_CircuitPython_NATIVE.py to do some tests
would be interesting to repro, thought that was fixed a year ago
do you have an issue reference ?
on latest, this code cause this output (with a telnet to the IP, and a ctrl-D in the middle)
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...
it then gets better but it took around 2 minutes of regular ctrl-D for listen() to not raise EADDRINUSE
there's the usual web of issues and PRs, but this is the key one I think implementing setsockopt and SO_REUSEADDR https://github.com/adafruit/circuitpython/pull/8954
does it fix to add setsockopt to work across reloads? https://github.com/adafruit/Adafruit_CircuitPython_HTTPServer/blob/09e5431071d9e484726df87841a5b9bbe33b6d76/adafruit_httpserver/server.py#L271
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
BlockInputsupport 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...
yeah it does
cool, I should update the server examples to be more robust
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...
I'll make a note to open an issue, a reload (and therefore close/deinit of the listening socket) should still not keep an "addr in use" I don't think ?
Thanks for getting this merged, @dhalbert !
looks like our CYW43 power settings
https://github.com/adafruit/circuitpython/blob/main/ports/raspberrypi/bindings/cyw43/__init__.h
are different than MicroPython in various other ways
https://github.com/georgerobotics/cyw43-driver/blob/dd7568229f3bf7a37737b9e1ef250c26efe75b23/src/cyw43.h#L604
I seem to recall a bit of discussion about this, but can't find it. IIRC, without setsockopt, the server could re-bind after some timeout. I think the EADDRINUSE arises if the code exits abnormally and the socket is left in TIME_WAIT state... looks like that may be happening at a low enough level to survive reload? although there could be something else going on here
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
CP has a number of sdkconfig files that get merged together depending on the mk settings
boards can also supply one
After talking with Tannewt I'm going to try and get dynamically allocated displays working without the VM managed display and bus arrays. I don't think that approach is going to bear much resemblance to this attempt so I'm closing this now and will hopefully have a new PR within the next week or so.
Made CIRCUITPY_BOOT_BUTTON_NO_GPIO default to 0, changed usage to #if from #ifdef. Added compile-time check prohibiting CIRCUITPY_BOOT_BUTTON and CIRCUITPY_BOOT_BUTTON_NO_GPIO.
I downloaded the 9.7.2 for ESP32-S3 and not my feather screen will not work. I can still get to the Feather TFT screen so I know my screen is not broken. It's almost like the drivers are not correct and will not communicate. any help would be appreciated.
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
Hi, I can't reproduce your issue:
- what board are you using ? I assume the Feather ESP32-S3 TFT ?
- what UF2 file are you installing ? Make sure it's not the reverse TFT on the non-reverse feather or vice versa.
https://circuitpython.org/board/adafruit_feather_esp32s3_tft/
https://circuitpython.org/board/adafruit_feather_esp32s3_reverse_tft/
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...
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...
Additional info:
When I call:
import microcontroller
microcontroller.on_next_reset(microcontroller.RunMode.BOOTLOADER)
microcontroller.reset()
I get a "new" COM-Port and a "bad" ESP32S3 device in the Windows "device manager"
I just tested the UF2 code above on a ESP32-S3 Reverse TFT Feather with a fresh install of CircuitPython 9.2.7, and it works correctly, it reboots into the FTHRS3BOOT UF2 drive.
What version is your TinyUF2 Bootloader ?
Also: I am asking this in part also, because with all three boards I can not get into the .UF2 "drive by pressing the BOOT / RESET combination.
Is the UF2 bootloader even installed ? How did you install Circuitpython if you can't get into the UF2 bootloader ? The installer on the board page ? (you want the full/uf2 install) Or did it work and no longer does ?
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.
You can download the UF2 bootloader from the tinyuf2 repo
Not sure why it's not linked on the download page.
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...
Holding BOOT and pressing RESET puts the board in the ROM bootloader.
The UF2 bootloader should start by double pressing RESET -- you may need to try a few times to get the timing right -- see more details here
I think the CI errors may be build errors?
i suppose no further development :(. Do you still have the modified Makefile?
I ran a script to list available bootloaders from tinyuf2 (0.21.0) on ESP32S2/3 and match with board ids, adding bootloader_id to those boards. There are maybe some more that could be added manually after checking that they are the right ones (like the espressif_esp32s2_devkitc_1 variants).
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,...
Yeah possibly, please try to update pio-usb 0.7.1 which includes this fix https://github.com/sekigon-gonnoc/Pico-PIO-USB/pull/176 for direct low speed attach
I tried today with pico-usb 0.7.1 on Metro RP2350 with the controller directly connected to the metro USB host pins, it is still not finding the device during the scan on that version as well.
@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?
got it; let's see if @slender iron has any thoughts about that
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_lockto indicate that the flash part requires use of the global block protection ...
@slender iron Just got pinched by this, again. I think it's worth making nvm.toml truly cascade similar to CSS.
I don't want to keep using nvm.toml in the long run anyway. With the move to Zephyr, we'll just do whatever they do
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).
then it is probably race condition of some kind, I will try to order the gamepad along with mouse that cause repeated hub connection issue as well for troubleshooting. Quick question, does it work now with rp2040 ?
I tried with a build for the Feather RP2040 USB Host using pio-usb 0.7.1. I am still seeing the same behavior on that version as with circuitpython 10.x on that device. No devices found with scan and unable to read data.
I guess it does some heuristics to decide that a deletion and addition was a move, but my understanding is that there is actually no notion of "move" or "rename" inside git, it's just how it's presented when reading the changes. Some tools can extract more information by analyzing the history, but for example renaming a file or directory breaks that file's history in git/github
we've had this problem a lot when merging MicroPython. It tries too hard to mark things as move with edits
Interesting. It's innocuous in this case, but slightly disconcerting how well it "hides" the deletion from the reviewers front end in github.
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
<@&356864093652516868> weekly meeting is in less than hour. Add your notes here: https://docs.google.com/document/d/1q0T9l-qybjcu0ID3zVOcn2vIgiXJgV_teC48ew8GNrI/edit?tab=t.0
@EmergReanimator Please re-test with the build artifact from #10249. Thank you!
@tomiahola Please re-test with the build artifact from #10249. Thank you!
Interview with Kwabena Agyeman from OpenMV https://openmv.io/
Embed AI into anything, anywhere, running on batteries for years with the OpenMV N6 and AE3.
We are a backer!
Website: https://openmv.io
LinkedIn: https://www.linkedin.com/compan...
In systems engineering, information systems and software engineering, the systems development life cycle (SDLC), also referred to as the application development life cycle, is a process for planning, creating, testing, and deploying an information system. The SDLC concept applies to a range of hardware and software configurations, as a system ca...
@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...
Join Ladyada as she breaks down how recent tariff shifts impact electronic component availability and pricing, reshoring trends, and what may happen to engineering/BOM and DIY project costs. Get the inside scoop on navigating supply chain challenges while keeping your builds affordable and excellent!
Visit the Adafruit shop online - http://www...
I unplug and replug it on the same port.
I have the same code running on both builds.
Still the waveshare_rp2040_geek gives me the wrong descriptor after several tests, but raspberry_pi_pico works without issues.
I can test with different ports later this week, but I'm pretty sure the results will be the same.
I will test with current firmware ofc
It does work with circup (when it's build suceeds at least)
I think typically this would not happen. Is there an instance of one library in two different bundles that you know of?
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.
Thanks all!
Thanks for hosting Scott, have a great week everyone!
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 ?
Have a fine week, everyone!
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.
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.
So circup will not be confused if a library move from one bundle to another?
not confused in a way that makes a functional difference as far as I understand it.
timecodes in the doc will tell you how long each section is. repetitive stuff at the beginning is three minutes or so. The tradeoff would be editing time to add it
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
Google Docs
CircuitPython Weekly Meeting for April 21, 2025 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates before the meeting, alphabetically by your username. During the meeting, we go through them in order. If you can’t make the meeting and would st...
The 27mhz pixel clock ones could be interesting! I don't think we'll want to go faster than that.
I'd like to try extending the vblank period to fix this instead of changing the clock rate. Theoretically we can extend vblank to refresh the frame at the intended rate.
Will
DEBUG=1override the Circuitpython USB with the esp monitor? I was looking around for docs on that but didn't come up with anything initially. Currently trying a new build with the Espressif Devkit C.
No, it puts the IDF logging out the default UART.
Need this?
#ifndef CIRCUITPY_BOOT_BUTTON
#define CIRCUITPY_BOOT_BUTTON_NO_GPIO (1)
#endif
One question. Thanks for the update!
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.
Any idea if we could adjust VBLANK instead of changing the pixel clock?
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.
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.
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)
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.
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?
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.
75 MHz. The clock divider for qspi only supports integers, so we're stuck with that at 150 MHz SYS_CLK.
same with the hstx divider
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
I wonder if it'd be worth running the core at 133 so that we can 1:1 flash and psram
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.
right. that'd help everyone though
the lower voltage psram part is rated up to 144mhz
could also just try it 🙂
As long as we made it a setting we could change in the .toml, I'm up for risking it.
This says the USB_PLL can only generate up to 48mhz
the HSTX would need more than that
That's why I thought driving a higher frequency out of FOUTPOSTDIV might be a problem. Weird thing is, it seems to work.
There is an earlier comment suggesting to use USB_PLL for HSTX
I don't see any other documentation about it
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.
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
We're running it x5 now.
so the USB_PLL would need to be less than 150
for pixel clocks between 25 and 27mhz
I think we could risk going over 150 by a smidge. In practice, the RP2 parts have a crazy amount of overclocking headroom.
what refresh rate and resolution are you targeting?
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.
I added a little of that to CP
I saw that. It's what got me thinking along those lines.
I wouldn't do anything more than 60 fps
unless it is 720x400 which bottoms out at 70
I referenced https://en.wikipedia.org/wiki/Extended_Display_Identification_Data#Structure,_version_1.4 bytes 35-37 for the most supported modes
Yeah, we're kind of stuck down in that range. Here's a better reference: https://glenwing.github.io/docs/VESA-DMT-1.13.pdf
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.
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
Sounds good. I'll give 133 a try. I did have a thought re: gc collect scan of psram allocations. Maybe use uncached accesses?
ya, could but that'd be more rp2350 specific
the selective collect has the nice property of benefitting everything that enables it
Good point, there I go thinking the RP2 parts are the whole world...
🙂 all of the esp parts with psram will benefit too
anything with a bunch of ram you want big buffers in
OK, I think we've beaten this one up enough. Appreciate the chat.
thanks!
@gamblor21 I've tested your updates, and can confirm that the mix property is working as intended now. I've also tested BlockInput on all 3 properties, mix, roomsize, and damp. Everything works great!
- 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 ...
One extra change and please add comments in the pio files that explain what the permutation is. Thanks!
I doubt you want to change this.
sorry - that was left over from Microchip debugging in the same clone.
CI is weird, as of this moment, it has only done the doc build.
Update asyncio library to enable moving forward on #10244.
Update other frozen libraries as well.
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
>>>
@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...
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...
I agree with your conclusion -- not sure why it was the other way. I checked the other uses and the meaning you suggest remains consistent.
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...
Path('.').exists() was failing for the root folder (and mounted root '/sd') but by using the resolved path the '.' is converted to an absolute path which works. I think this partially resolves the issue of parsing up through sd mount points as well.
if (path_exists(mp_obj_str_get_str(((pathlib_posixpath_obj_t*)common_hal_pathlib_posixpath_resolve(self))->path_str))) {
[adafruit/circuitpython] New comment on pull request #10238: Two enhancements for Fruit Jam launcher
I'm not sure how the stem/name/suffix methods will be used but there were some minor differences in the results of paths that contained '.' or '..' elements between this version and cpython. Other than that, I gave most of the methods at least a brief test and everything seems to be working.
@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?
if you find the call that uses the routine in rtc_io_ll.h on github, you can use "Blame" to find out when that code was last changed, which will lead you to the PR.
blame is also available locally, but I always use it on the website
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.
which rtc_io_ll.h are you looking at?
components/hal/esp32s[2,3]/include/hal/rtc_io_ll.h
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.
"already incorporated upstream" says fixed upstream, I guess. Are you looking at this branch https://github.com/adafruit/esp-idf/tree/circuitpython-v5.3.2 or the default branch https://github.com/adafruit/esp-idf/tree/release/v4.4-circuitpython (which shouldn't be the default branch anymore)
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.
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
Ah, a true mystery. Maybe @slender iron can shed some light...
You are amazing. That looks like it's it.
that fix is way after my comment, though
@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
My intention is to use the port-specific busio implementation when we add support for it. We'll do zephyr_* implementations for the fixed busses.
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
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.
Yup, UART buffers incoming data. Others block
Oh...sweet!
Thanks for the input as always 🙂 I will work on my branch some more and hopefully PR soon.
great! I'm out in three weeks but dan and eightycc will be around
Might be stuck on some ROS issues for a little bit:
microrosinitialization 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 withrcutils_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, ...
Just a couple more comments to hopefully make it easier to maintain.
Please explain the naming too.
Please add the filename here so it's clear where it came from.
This is what 720x400 @ 70hz has been for me. It is close to 16:9. Works on my TV at the office and at home. My XR1 Lite ($60) can also capture it just fine.
I tested this today on a Feather RP2040 USB Host with the gamepad connected thru a CH334F USB hub and it does work that way, same as the Metro RP2350.
Just a couple small things and a CI to fix. Thanks for the new module!
m_malloc will raise an exception on its own. If you want null back then use the _maybe version.
self->buffer[0] = m_malloc_maybe(self->buffer_len);
This script will fix the zephyr build for you: https://github.com/adafruit/circuitpython/blob/main/ports/zephyr-cp/cptools/update_board_info.py
@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...
Adding Feather RP2350 Adalogger board def
I'm making some minor edits. Don't merge yet.
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 (
TXbeforeD0,RXbeforeD1). This affects which name is used to print the pin out. - Dropping
D12: no silk for it, I think.D4isIO4, andD4would be the name to use. - Use
D7instead ofIO7. - Drop
D13as an alternate name forLED. It'sD7, andLEDis the preferred name for examples, notD13.
the D12/D13 are included in the feather hstx board def as well, should they also be dropped?
Eh, sorry. I am now looking at https://learn.adafruit.com/adafruit-feather-rp2350/pinouts, and I see the names as shown. I even approved this: https://github.com/adafruit/circuitpython/pull/9668, but I'm not so sure I like it now. But may as well make it consistent with the existing board. I will make another suggestion to merge.
{ MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) },
{ MP_ROM_QSTR(MP_QSTR_D12, MP_ROM_PTR(&pin_GPIO4) },
{ MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO7) },
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 = ...
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO4) },
Updated asyncio library and now passes tests. Ready for review.
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...
@tannewt I can confirm that reverting the changes made to ports/raspberrypi/audio_dma.c (using m_realloc and m_free instead of port_realloc and port_free) fixes the error. If moving over to the port_... implementation is better for future-proofing, there is likely an underlying issue that needs to be fixed rather than reverting those changes.
This function's docstrings don't match its behavior in two ways.
- Currently if you pass
-1for x2 or y2 as specified in the docstring it will raise an exceptionValueError: 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...
I successfully did this on the 4MB Feather S3, and understand what the user sees when the wrong bootloader is present, etc.
common_hal_os_stat doesn't seem to like paths that end with a '/' so we probably need to add a pre-check before calling path_exists to either modify the path sent or perform the exists check another way on those paths.
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.
Just tested with adafruit-circuitpython-espressif_esp32s3_devkitc_1_n8r2-en_GB-9.2.0.bin, the same issue. As soon I init ESPNow, the issues start!!
By the way, ESPNow works very well as I expect.
Latest is 9.2.7. Can you test with that ?
Responding to closed issues makes it hard to follow, please open a new issue, share your code, a minimal version that reproduces the issue if possible, and the detail of what you see.
What pin? GPIO11-20 are on ADC2, which can't be used reliably during wifi usage.
See the Limitations section a few paragraphs down at this link: https://docs.circuitpython.org/en/latest/shared-bindings/analogio/index.html#analogio.AnalogIn
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...
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?
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.
I know that circuitpython will "degrade" exceptions when it fails to allocate the memeory for them -- for example, will remove the message, etc. but I never saw it falling back to a superclass of the exception
do you know what is the memory situation at that point?
gc.mem_free() reports free: 193504 just before the call to alphablend() which ends up raising the RuntimeError
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"));
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
tapsparameter flexible, but any suggestions are welcome. synthio.BlockInputis not supported at this time. I don't see any immediate benefits from adding in that feature.- This feature could be included into ...
perhaps there is an error during the error string interning, maybe a hash collision?
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.
I think the hash values could be different on different ports
but it could also be some error in how the strings are handled
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...
Any further word on this? I'm having the same issues with Adafruit CircuitPython 9.2.7 on 2025-04-01; VCC-GND YD-ESP32-S3 (N16R8) with ESP32S3.
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.
@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.
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...
This internal function was only used in espressif but became a no-op in 5e26862b2c1dcdb6579d007437762462b602dba3 so it should just be removed.
does what the comment says to do :)
gamepad is in shipping, it may take a few days. Will test/troubleshoot this once I got this on my hands.
@tulip sleet got time to talk memory allocation/gc changes?
ya sure
[adafruit/circuitpython] New comment on pull request #10238: Two enhancements for Fruit Jam launcher
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.
I suspect this is due to the Python VM heap taking up most of the outer heap (allocated via port_malloc using tlsf). It might be simplest to use m_malloc on RP2040 and port_malloc on RP2350. The goal is to put the buffers into internal RAM. DMAing from PSRAM gums up DMA.
[adafruit/circuitpython] New comment on pull request #10238: Two enhancements for Fruit Jam launcher
I'm going to close this and split it into to PRs:
- Adding working_directory
- Fixing OS
@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
it'd make the primary display stuff simpler
still want separate SRAM vs PSRAM pools?
@slender iron I like this approach, too.
Looks like this is the last bit needed to actually setup mov_status_type and mov_status_n for a state machine.
I've been successfully using it with Adafruit_CircuitPython_PIO_UART modified to support RTS/CTS hardware flow control.
mov_status_type can also be 'rxfifo' on the RP2040.
Would a patch to add "rp2pio.out_waiting" (or whatever you'd prefer it to be called) exposing pio_sm_get_tx_fifo_level be welcomed as it would be helpful to know how much can be written to the FIFO before it's going to block?
if you think there's a use case, sure
are there things in micropython or pico-sdk support that we don't have?
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
This makes sense to me. Not tested. Thanks!
It's from pico-sdk, I couldn't find anything in micropython to get the txfifo level either.
This allows subfolders to be treated similar to / for multiple apps within different folders.
Also, fix up the internal current working directory so it doesn't depend on volumes.
Fixes #9045 and fixes #8409.
By selectively collecting an allocation, we can skip scanning many allocations for pointers because we know up front they won't have them. This helps a ton when large buffers are being used and memory is slow (PSRAM). In one Fruit Jam example GC times drop from 80+ms to ~25ms. The example uses a number of bitmaps that are now no longer scanned.
- 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 ...
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...
@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?
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.
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...
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...
Symbol ESP_ROM_ELF_DIR is not getting set, resulting in CI failure on all ESP boards. Oddly, this error does not occur building on my local machine. This is a know problem, see https://github.com/espressif/esp-idf/issues/15035.
@slender iron I'm wondering whether we need to coordinate an ESP-IDF update to v5.4.1 with TinyUSB?
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...
I think this is usually done on a per-board basis. We should have different kconfig fragments for the different speeds.
We don't usually need to. I think we do all USB separate from IDF. The only thing that may be overlapping is the init code
It is. I've added support for 48 MHz to the ESP-IDF fragment for ESP32H2 that meshes with CP's Kconfig fragments. All good with that. Now I'm on to a problem that's breaking CI which is fixed on the ESP-IDF 5.4 branch but is not included in the v5.4.1 tag.
Bundle updates are getting killed due to rate limiting: https://github.com/adafruit/circuitpython-org/actions/runs/14512434132/job/40713999002
you can go past the tag if you want. I've just had mixed luck with doing so
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?
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
@lone axle maybe time to work on this again
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.
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...
I have this branch with debugging prints and checks: https://github.com/tannewt/circuitpython/tree/debug_gc_selective_collect
@tulip sleet any object to me carving out double conversion support for samd21s
not sure what you mean
looks like samd21 boards have f2d and d2f that take at least 280 bytes
I want to disable those
if they are not used, sure
I think it'd impact printf and arrays with type 'd'
i have an issue opened with some big savings for samd21, let me find it
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.
which size flash on ESP32-S2? We are about to double the image size on 4MB boards: https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51/update-the-uf2-bootloader. I was originally doing this only on S3 boards, but this PR is for all 4MB Espressif.
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.
Flash overflow is on ESP32-S2. It's the espressif_esp32c6_devkitm_1_n4, 4MB flash.
that's what my PR does, but TinyUF2 0.30.0 was only certain S3 boards.
i'm confused, S2 or C6?
My bad, C6.
gcc is a bit overzealous with inlining.
i doubt the performance gain is worth it in many cases
-Os should help, but I thought we were already doing that for the RISCV chips
C<n> chips are all RISC
you can do make V=commands BOARD=... to see the command lines
maybe turn off PYCAMERA for now
or ULAB, just temporarily, until https://github.com/adafruit/circuitpython/pull/10265 is merged
the RAM issue may require some sdkconfig tuning
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!
- Use 0 bytes for QSTR hash. Fixes #10151
- Update libgcc used on SAMD21 to 14.2. Reduces test build by over 100 bytes.
- Turn off 'd' typecode support on non-full builds.
Hopefully #10269 will make enough space for this.
Hopefully https://github.com/adafruit/circuitpython/pull/10269 will make enough space for this.
ESP has a lot of code loaded into iram that may squeeze DRAM.
I don't see any code size mentions here: https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/migration-guides/release-5.x/5.4/index.html
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().
Yup. I see that:
.dram0_reserved_for_iram
0x3ffb8000 0x14d64
0x3ffccd64 . = ((ORIGIN (dram0_0_seg) + _iram_end) - _iram_start)
*fill* 0x3ffb8000 0x14d64
.dram0.data 0x3ffccd70 0x3d30
0x3ffccd70 _data_start = ABSOLUTE (.)
it's support for a separate chip.
I see. Now to find atomic functions in ESP-IDF...
probably fine, but make sure lib/tinyusb's submodule commit is up to date
TinyUSB looks fine, last commit is 4/3/2025. The wanted atomic is present in esp-idf's newlib component, but it looks like something has changed in the macro defines that get from__atomic_test_and_set in the <stdatomic.h> to SYNC_LOCK_TEST_AND_SET in newlib.
Is updating ESP-IDF always so complicated?
No, but there are always API changes. Might be worth looking at the esp-idf/examples, if any of them use the atomic op
@tannewt this is ready for review again.
fyi I have an audio fix for rp2 in the works too
switching the dma setup so readaddr always gets reset
@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...
More intuitive and easier to maintain if we match MicroPython. But the differences are more than the swapped constants, jepler may recall why the values for each differ from MP.
I had tested our DISABLED vs. our STANDARD (I think MP's default) for #6976. I don't think I gave too much attention to AGGRESSIVE or PERFORMANCE. Not sure how important power savings is on raspberrypi.
The missing atomic is a known ESP-IDF regression that appeared with v5.4: https://github.com/espressif/esp-idf/issues/15167. According to the issue, the fix was supposed to go into v5.4.1, but it did not make it. I'll patch our branch.
The symbol __atomic_test_and_set is missing in ESP-IDF v5.4.1 causing several boards to fail to build. This is a known regression in v5.4: https://github.com/espressif/esp-idf/issues/15167. Will workaround by adding the commit referenced by the issue to branch circuitpython-v5.4.1 of our ESP-IDF fork.
maybe worth using the tip of the release/v5.4 branch instead of the 5.4.1 tag?
That feels risky to me. I've resolved all of the build issues except the dram0 overflow on ESP32-S2 parts.
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
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.
I was not aware of this, I would have though it would be a linker segment thing, not needing to be copied, but it sounds like that's not true. @slender iron may know more
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.
you read this already, I assume: https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-guides/memory-types.html
i'm out for a couple of hours momentarily
@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)
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")```
This channel is for CircuitPython core development discussions, please use https://discord.com/channels/327254708534116352/537365702651150357 or https://discord.com/channels/327254708534116352/330406777009209346
@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.
The flash overflow will be solved by https://github.com/adafruit/circuitpython/pull/10265 if these are 4MB boards.
so turn, off, say ULAB, for now, mark it as temporary, and we'll turn it back
after that merges
What do think about removing ESP_CAMERA from ESP32-S2?
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
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.
all the boards with "cam* in their name are either ESP32-S3 or plain ESP32
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
Good point. I was going to bring up testing. I've done nothing more than smoke testing on ESP32-S3 at this point.
The "Internet test" that's in all the guides is plenty
For BLE I install adafruit_ble and use https://github.com/adafruit/Adafruit_CircuitPython_BLE/blob/main/examples/ble_uart_echo_test.py, which acts as a BLE "UART" peripheral. Then I try connecting to it with the UART page from Adafruit's Bluefruit Connect app on my phone. If you can type at it, hit enter, and it echoes back what you typed, it's working.
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?
This would be a micropython core thing. Note that MicroPython/CircuitPython don't use reference counting for gc: they use mark and sweep
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
so weakref is not as important if the circular references are unconnected to another known object
the circularity will get gc'd
I did notice that while digging through things, hence the possibility of an extra step to create the weakref instance. Assuming MICROPY_ENABLE_FINALISER is enabled in the build, it might be feasible without having to mess with the base MicroPython object model (mp_obj_t ).
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?
This was briefly discussed in:
https://github.com/micropython/micropython/issues/646
https://github.com/micropython/micropython/issues/1878
yes, you could just implement a no-op weakref
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
Found this: https://pypi.org/project/micropython-weakref/
Yeah, I had seen those (I did dig a little before posting...), but they were a bit old
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)
You may have also already seen https://docs.micropython.org/en/latest/genrst/index.html#micropython-differences-from-cpython
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.
note that for typing we just try/except the import, since CP ignores type hints anyway, so there's no need for dummies
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).
there is no accessible saved data structure to get that info
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).
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
Hadn't even considered this for builtin/native calls - that could get sticky. For my purposes, it would always be Python code (i.e. a method/function/lambda/closure)
(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
I see no thoughts about inspect.signature for MPy anywhere
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
can you do this checking at compile time with mypy or something?
Yeah, the inspect module in general doesn't get much love. I was a bit surprised about that.
Technically yes, effectively no. I don't need it for my code - I'm building a framework with a specific goal of making things easier for non-programmers, so this has to work all the way back to code.py. The majority of my "target audience" wouldn't have a clue what mpy modules are....
(and I realize this is also a goal for CircuitPython - I'm just adding some extra layers)
I was thinking of the "mypy" checker as a pre-processor here
The concept of a preprocessor is great - I'm a huge fan of DSLs, code generation, etc. and I've done some absolutely bizarre stuped Python self-modifying code hacks.
@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.
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, ....
-30336 is look-up-able; doesn't look like we got that before, though (searches don't turn up any matches0
It's this MBEDTLS error: "0x7680 SSL - No CA Chain is set, but required to operate"
You could ask about whether inspect.signature() is possible in, say, https://github.com/orgs/micropython/discussions. But a Signature object is a kind of complex thing, and that's a lot of extra code in the firmware, with little demand right now.
aha, ok, that should be defaulted to include the standard root cert bundle. There's a config option for that which should be turned on already. I wonder if they changed the API
yeah, a full blown Signature would probably be a lot of work and is way more than what I need
or it might be a build thing that's not running: it re-creates the bundle as needed.
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
My good luck that you looked at it.
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
I can re-test with a non-5.4.1 CP 10, if that helps.
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
Probably is 5.4.1. At least I've got a thread to start pulling...
esp-idf-config/sdkconfig.defaults
101:CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE_PATH="../../lib/certificates/data/roots.pem"
maybe this is an mbedtls problem
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)
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.
The MBEDTLS version in ESP-IDF is a an Espressif fork at 3.6.2. Unchanged from v5.3.2.
There are large changes in crypto with v5.4.1.
I'll see if I can come up with a simple way to reproduce the problem
(I have it working, just need to figure out a repeatable way to crash it)
I can take a look at this if you have other fish to fry
This is the big fish in my pan right now.
Which reminds me, it's time for late lunch.
If you do want to have a peek, ESP-IDF 5.4.1 is here: https://github.com/eightycc/esp-idf/tree/circuitpython-v5.4.1, the corresponding CP pull is: https://github.com/adafruit/circuitpython/pull/10267. Any help is accepted with gratitude.
@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
thanks, that is extremely helpful. I didn't start on this yet
i may not get to this until monday or even tuesday
No problem, I'm done for the week, as well.
but it should be straightforward. I've been the one to deal with cert issues for a while now
Feel free to clue me in on what's involved.
either I will munch the roots.pem into their format, or else just use their default list (which may or may not be too big for us). https://github.com/adafruit/certificates/issues is quite pruned
but partly is was pruned because the .pem's are large
I was working on nina-fw with Thach (https://github.com/adafruit/nina-fw/pull/70). That's the firmware used on AirLift co-processors. for certs, in particular: https://github.com/adafruit/nina-fw/pull/70/commits/74339a4809d21f4f39ebac911ecffbbc7d668d4c.
the arduino-esp32 Board Support Package for Arduino IDE uses the defaults cert bundle
Tested on a Pico2 worked great for me. Sounded like the demo you previously showed me.
Code looks good to me. Great work, thanks again!
@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.
Code looked good to me, but when I tried it and set the channels to one I lose the echo effect for freq_shift=True. It works for stereo.
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...
Great! I have a recollection of Scott doing this on some builds or other, but I might be wrong.
Scott gave me a hint in this direction, but I lacked the context to fully understand. Now I do.
Code looked good to me, but when I tried it and set the channels to one I lose the echo effect for
freq_shift=True. It works for stereo.
I believe there's an issue with how the buffer index is updated in mono. I fixed it within the audiodelays.MultiTapDelay effect, but I haven't tackled it here. I'll take a swing at it soon.
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.
Sparkfun has a USB VID, how are boards added ? Have they added them themselves ? Are PID requested or documented somewhere ?
- 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...
Adafruit_CircuitPython_asyncio repository description in GitHub has an uppercase I after C, so CIrcuitPython instead of CircuitPython. I could issue, but should I?
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...
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...
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...
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.
Fixed all the times this occurred.
I fixed that -- it was just a settings change. Thanks!
Seeed Xiao ESP32-C6 has an LED on GPIO15 for general use in user programs. Commonly these LEDs are defined for the board. So would be good to add this LED pin definition. Schematic showing LED connected to GPIO15 (sheet4, zone D2) - https://files.seeedstudio.com/wiki/SeeedStudio-XIAO-ESP32C6/XIAO-ESP32-C6_v1.0_SCH_PDF_24028.pdf
@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
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).
<img width="106" alt="le...
Sorry! I pushed another commit to fix the zephyr builds, and it only rebuilt the zephyr builds. The older artifacts are here: https://github.com/adafruit/circuitpython/actions/runs/14554565710. Scroll way down past the errors to find the artifacts list. (I wish there was a better link to the artifacts.)
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)
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...
I am not seeing this on PIco W (only one tried yet), but I am using a local build. I'll try the artifact.
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.
The crashes @anecdata is seeing are totally unrelated to this PR. I am seeing the same crashes on the tip of main right now, so main is busted in some way.
55b0f157c7bb2bfd7f09b5283e6f5c54f5d90774, part of #10260, is causing crashes, as evidenced by https://github.com/adafruit/circuitpython/pull/10271#issuecomment-2817392221. I am only testing with @anecdata's test program in #10271 on a Pico W.
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...
-- 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.
@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
Change looks good to me. Did not test on hardware.
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.
I’m out but will try this, this afternoon.
@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.
Does esptool.py also fail?
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...
No! Flashed the ESP32-C6 with esptool.py and it's fine with ESP-IDF 5.4.1.
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.
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.
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.
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.
I think they give them out through the forum. I've also gotten some by emailing them
I wouldn't move freertos stuff to flash because I imagine we may use them when flash is disabled to write it.
With FreeRTOS functions in flash, I'm able to write successfully to CIRCUITPY, so perhaps that's not an issue.
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.
@mortal kernel just to be clear, you are trying to flash the ESP32 to 0x0000, and you're flashing firmware.bin?
Yes.
That makes sense. At higher resonance, you can get large volume peaks. I think some other filter emulations handle this by having a rate-limiter or some other cheap way to "soft-saturate" the output.
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, we put it in sum_with_loudness().
Didn't take me too long to figure out pip install setuptools==71.0 cryptography=42, although it certainly was longer than it would have been if I had read https://github.com/adafruit/circuitpython/issues/10191 first...
(FWIW I had to do that with ESP-IDF 5.3 - want a known good build working before trying ESP-IDF 5.4.1 and https://github.com/adafruit/circuitpython/pull/10267)
<@&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.
Google Docs
CircuitPython Weekly Meeting for April 21, 2025 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates before the meeting, alphabetically by your username. During the meeting, we go through them in order. If you can’t make the meeting and would st...
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
...
@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.
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 ...
Try absolute newest CircuitPython. I believe it has newer TinyUSB in it and we've been fixing things like this.
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?
eightycc is off for a bit starting today. The most interesting testing would be with boards with/without PSRAM, 4MB vs 8MB (or more) flash, etc. Similar boards with similar modules would be expected to work -- we don't test against all boards by any means.
I have some debugging and fixing to do on v5.4.1 for TLS and plain ESP32 builds
other testing to do would be I2C, especially on S3, wifi testing, and BLE testing
My question is why device preform auto reload or sw reset even the copy file is not code.py
This matches USB behavior because it doesn't know what file was modified.
Yup! That's what I'm thinking.
Please subscribe
@blissful pollen you are unmuted
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?
Thanks
Thanks everyone, have a great week 👋
Sorry guys switching from my car to my AirPods somehow decided to unmute me
Thanks! If you have BNO055/BNO085 you could try those on ESP32-S3. They don't currently work on Espressif: see https://learn.adafruit.com/i2c-addresses/troublesome-chips. I am not expecting this to be fixed but it would be interesting if it were.
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.
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?
If you've ever ordered and wire up a 9-DOF sensor, chances are you've also realized the challenge of turning the sensor data from an accelerometer, gyroscope and magnetometer into ...
yes, but I doubt it will 🙂
I didn't do a backup recording. I could read it again if you really want to. I think it is fine without anyway
true, but it should be easy to try once I've got the EDP-IDF 5.4.1 CP firmware working on an S3
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
Google Docs
CircuitPython Weekly Meeting for April 28, 2025 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates before the meeting, alphabetically by your username. During the meeting, we go through them in order. If you can’t make the meeting and would ...
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.
@slender iron you're using ARM gcc 14 for a while now? Shall we update main to that?
@slender iron does the current Fruit Jam board build have support for the IR rx, ESP32-C6 airlift, etc. yet?
not for C6 yet, but main thing there is finishing the NINA-FW software for it. It will use the ESP32SPI library, it will not be import wifi
we have existence proof of C6 working in a breadboarded setup
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.
I should be getting one soon as well, so far I've been mocking it up
do you know if the schematics for the latest board rev are up someplace publicly accessible yet?
I think so. I don't actually remember when it updated
I don't think so but I have access
so I can answer any questions you have
IR rx pin?
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
you can always use microcontroller.pin.GPIO29, etc.
or maybe those are GPnn or IOnn I don't remember
they are is identical to the board pins
I'm mainly wondering about changes that may have happened across board revisions and whether those are reflected in the port defines yet
they are. I'm working off rev b
@tulip sleet samd shrink pr is ready for a final look https://github.com/adafruit/circuitpython/pull/10269
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 :
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,
...
I'm using board.board_id as the key to find the right mapping based on the actual running controller.
instead of using strings, could you use the microcontroller.pin names
the board and microcontroller.pin objects are the same internally
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
about 7 months ago, we changed the hostname from LS2Mini to lolin_s2_mini. I cannot find WemosS2Mini, though
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.
ok, I didn't know whether they were all S3 or whatever
I used strings to get around this. Ultimately, "GPIO21" will end up being filled in as getattr( microcontroller.pin, "GPIO21")
Thanks, I note that the LED is active low. In cases like that we have used
LED_INVERTED. Most of the times having both, with the presence of the "inverted" alias making 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).
Good idea. I added LED_INVERTED
This is only for D1 Mini (pin) compatible controllers, but there are quite a few ESP32 flavors out there compatible with the standardized physical pin locations (5V/3v3/GND, plus usually default SDA/SCL) but widely varied internal pin names / assignments.
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)?
board_id is CIRCUITPY_BOARD_ID, which is name of the board directory, can you check where and in what version you get WemosS2Mini ?
for all 4MB ESP32 boards (making space for BLE support on S3 and C3 for example)
for i2c usually you can just use board.I2C() and it will use the default pins
CIRCUITPY is going to remain the same size. The "ota0" partition (the "app" partition) for firmware will double the size
right, it frees up space for Circuitpython not for the drive
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.
you can check boot_out.txt for the exact version
@tulip sleet did you mean to approve the samd pr?
I'm doing a couple of smoke tests on a trinket
[adafruit/circuitpython] Pull request review submitted: #10269 Shrink non-FULL builds (SAMDs mostly)
Trinket M0 is 184424 bytes here, tip of main is currently 185492, looks good! Also did some very simple smoke tests on Trinket M0.
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.
you could flash a different partition .bin and achieve that. For audio, it's going to be a tight squeeze in any case, without an SD card. Maybe the extra 1.4MB would help in certain applications
@slender iron interestingly a trinket m0 with gcc14 isntead of gcc13 is 100 bytes larger
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.
I'm not surprised. I doubt they test that per-release
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)
but metro m4 is 130 bytes smaller on gcc14
🤷♂️
after the next alpha release I'll bump the version, I think, maybe too much churn for now
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...
Follow-up Question:
I’ve noticed that auto-reload only happens when the device is powered by battery — it does not happen when connected via USB.
Do you know why this behavior differs between USB and battery operation?
It seems intentional, but I’d love to understand the reason or logic behind this design.
Thanks for this.
I am not so sure having both LED and LED_INVERTED is the clearest solution, but it's been the trend up to now, as @Neradoc noted, so we can leave it.
When I began testing FTP functionality, I discovered the Adafruit_CircuitPython_BLE_File_Transfer library and its examples. I tested the ble_file_transfer_stub_server.py example using the Glider app, and it worked as expected.
That example is a "stub", it doesn't actually do anything and uses a fa...
This allows audio buffers to be filled during display refresh. However, this only works during explicit refreshes though because background tasks cannot be recursive.
Also, on RP2, disable a finished audio DMA so it isn't accidentally triggered and restart the channels if needed.
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.
@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...
@tiny peak did you try the extended back porch? my tv seems fine with a longer back porch
With a
DEBUG=1build 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.
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=1build flashed onto a Feather Huzzah ESP32, double faulting early in startup:
I am getting the same problem on the tip ofmainfor 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...
No. wasn't aware that was a thing that could be adjusted. How did you make the change? Doesn't appear to be an argument for picodvi.Framebuffer().
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).
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.
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...
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) {
...
@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.
It's fishy. I'm thinking the same thing you are, something's moving in memory that's tickling the bug. Based on your testing, I also think that it's only related to IDF 5.4.1 due to where things fall in memory. Hopefully JTAG will show something more definitive.
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
hello, I have been trying to compile the latest circuitpython firmware for the rp pico with my main.py code within a uf2. I have been following this guide and have been able to make uf2s but none have my code baked in. any help would be greatly appreciated. flashing 200 boards drag and drop is tedious https://learn.adafruit.com/building-circuitpython/build-circuitpython
you can set up a single Pi Pico with what you want, and then use picotool to produce a .uf2 that is a dump of everything in the flash, including what's in CIRCUITPY
https://github.com/raspberrypi/picotool#save
https://embeddedcomputing.com/technology/open-source/create-custom-uf2-file-for-easy-circuitpython-flashing
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
thank you @tulip sleet i will give this a try
I've not looked, but it seems that whatever
audiofilters.Filteris doing is different. That is, by moving to using anaudiofilterinstead 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...
b431b47 Add graphic for circuitpython.org - TheKitty
cc4b854 Delete assets/cprcuitpython-org.png - TheKitty
ab39229 Delete awesome_circuitpython.png - TheKitty
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...
I think it is mostly the migration guide. The scripts can help update more broadly if things are removed
Sure! Feel free to make a PR. Thanks for the testing!
Looks more correct to me! Please make a PR. Thanks!