#circuitpython-dev

1 messages · Page 77 of 1

manic glacierBOT
onyx hinge
#

OK I assigned those.

#

I don't know in particular what i2sin would "do" -- act like a sample type so it could go through the new audio filters? or what?

#

honestly I don't know how the new stuff all fits together into a cohesive whole.

fleet hollow
#

Definitely agree here. PIO does the job in a lot of cases, but once you try to force input data into the AudioSample API (via RawSample), it gets messy. I started working on an I2SIn class within the core on a local fork, but I haven't wrapped my head around the adjustments needed within the audio dma routines to get it working.

slender iron
fleet hollow
# slender iron I kinda think of it as an infinite sample. coordinating the buffers could be tri...

It could open up the door to diy effects pedals built on CircuitPython. I have this draft PR for a distortion effect which would be the first thing that comes to mind. https://github.com/adafruit/circuitpython/pull/9776 Would be really cool to control these kind of effects with a variety of sensors which aren't necessarily easy to integrate with within other environments.

GitHub

New audio effects class, audiofilters.Distortion, to distort audio samples using one of the available modes available in the audiofilters.DistortionMode enum.
Todo:

Reduce floating point computat...

manic glacierBOT
manic glacierBOT
native sandal
#

Can I fix tinyusb to get rid of the #warning "This header file has been moved, thus#include <xtensa/xtensa_api.h>is deprecated. Please use#include <xtensa_api.h> instead"?

#

Or does that come from somewhere else?

manic glacierBOT
#

@bablokb Thank you for opening the issue and providing the diagnostic. I was able to easily reproduce the performance glitch.

Capturing a trace with WireShark, I can see that TCP PSH/ACK packets from the server are sometimes delayed by up to 500 ms. Interestingly, the delayed packets always arrive on exact 500 ms offsets from the start of the trace, i.e., +4.620 ms, +5.120 ms, and so on. This tells me that ACKs from the client aren't always causing an IRQ or the IRQ is getting ignored. Th...

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.2.1 on 2024-11-20; ESP8684-DevKitC-02-N4 with ESP32C2

Code/REPL

import wifi

Behavior

Traceback (most recent call last):
  File "", line 1, in 
MemoryError: Failed to allocate Wifi memory```

### Description

Importing the wifi module fails with a MemoryError. WiFi functionality is non-functional thereafter.

### Additional information

_No response_
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.2.1 on 2024-11-20; Raspberry Pi Pico 2 W with rp2350a

Code/REPL

from adafruit_ble import BLERadio
ble = BLERadio()

Behavior

Traceback (most recent call last):
  File "", line 1, in 
  File "adafruit_ble/__init__.py", line 166, in __init__
RuntimeError: No adapter available

Description

Bluetooth adaptor not found in pico 2 w port
I've looked at the configs and everything is ...

manic glacierBOT
manic glacierBOT
mortal kernel
#

@danh I've been seeing some odd issues starting up an RP2350 board with PSRAM cold. Nothing reproducible, usually manifests as miscellaneous thrown errors running code.py or main.py.

onyx hinge
mortal kernel
onyx hinge
#

@mortal kernel neither the bootloader or circuitpython seem to start when holding boot and pressing reset. Holding boot while plugging in works

manic glacierBOT
#

(This issue is an offshoot of #1270.)

A number of open issues (#1270, #6009, #7206, #8315, #8941, #8945, #9373, #9821, #9823) have asked for the ability to set pin drive mode, drive strength, or a pull for various *io and other objects. Currently these classes provide limited access to some of these settings, and sometimes don't provide them at all. For instance, drive strength is not available at all, and specific pull settings are not available in classes that could use them.

In mor...

tulip sleet
#

@onyx hinge @mortal kernel It would be good to open an issue about this. 9.2.1 has a PSRAM fix to supposedly handle cache flushing properly. I'm not sure if this would cause failure to start up properly though.

onyx hinge
#

@tulip sleet it's hard to see how my issue can be circuitpython code, since whatever condition this is occurs when exiting reset, no circuitpython application code could run. however, the psram module could be in a different state that messes things up, I guess..

#

eightycc's issue yes, that could be the cache flushing thing.

tulip sleet
#

there has been a lot of discussion of PSRAM stuff in the RPi forums and in pico-sdk. I haven't looked in pico-feedback yet, but I think I am subscribed to the repo. It could be some start-up race condition, but I don't know why the bootloader would try to use PSRAM at all: I"d assume it isn't. Maybe a bus issue??

onyx hinge
#

is there a RP2350 reference design with psram? One totally un-verified thing I wondered about was whether the psram's CE/ line is not being driven high, so it might start interfering on the shared bus. https://datasheets.raspberrypi.com/rp2350/hardware-design-with-rp2350.pdf 3.2 on page 12 shows such a pull up resistor (R13). It's labeled DNF but then the text says "To be able to use this device, it will obviously have to be populated , as well as R11 (0Ω), and R13 (10KΩ)."

#

feather rp2350 has a resistor pull up so that's not it

#

R15 is populated on this board

mortal kernel
onyx hinge
#

Maybe the place for this board is the recycling bin

mortal kernel
#

Soldering that PSRAM chip isn't easy. I vacillated between using hot air or an iron, but went with my trusty Hakko set at 675 with a hoof tip.

#

I keep a candy jar for dead parts. Someday if someone really gets under my skin I'm going to offer them the contents.😜

onyx hinge
#

I'm reasonably sure the solder job is OK (no two pins shorted) but I'm no pro and I could well have messed up something else while I was there

#

I originally ordered 2 feather rp2350s but the 2nd one has not turned up so I haven't been able to test a second one

mortal kernel
#

Anyone know where I can find the source for flashnuke? It doesn't seem to fully erase a newer 16MB flash.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.2.0-45-g68cdc535b2-dirty on 2024-11-29; Pimoroni Pico Plus 2 W with rp2350b

Code/REPL

Any `code.py` or `main.py` will do.

Behavior

After power-on reset or button push reset, main.py or code.py script fails to start or terminates with a random error. More occasionally board will reboot into safe mode. Occurs on about 1 in 10 attempts. Only seeing this on PSRAM equipped boards. There are also a ver...

manic glacierBOT
#

This is because for some HAL layers, the pin is not alway set up by GPIO operations. For instance, in ESP-IDF, pulls are sometimes specified at the driver level for a particular peripheral, in a driver-specific configuration structure.

I said that above, but it's possible that perhaps it's not really necessary, and the parameters could be changed later. In that case, here's a simpler alternative:

Add properties .drive_strength, .pull, .drive_mode to Pin, and/or add a `.configu...

soft kernel
#

Good evening

#

can someone please help me with coding?

random junco
fathom sand
#

Adafruit CircuitPython 9.2.1 on 2024-11-20; Waveshare ESP32S3 LCD 1.28 with ESP32S3
I have problems with this board / this CP version.
There is only a CH343 UART but no CIRCUITPY drive or any other USB-Device!
I can access the REPL over the COM-Port and use Thonny to see the file system on the board.
The REPL output shows on the TFT fine!
Also connecting to Wifi works good.
I can not use WEBREPL because adafruit_wgsi is not locally available.
Copying this library into the Lib dir worked.
But: I can not find adafruit_webrepl anywhere to install locally....

Can someone take a look at the build parameters for this board?
Also, a UF2 file for this build would be desirable instead of the .BIN file which needs to be uploaded by webrepl.
BTW: I bought 2 of these board and both behave identically.

#

Here the modules on the board:
​``​ help("modules") __future__ canio math storage __main__ codeop max3421e struct _asyncio collections mdns supervisor _bleio countio memorymap synthio _eve digitalio microcontroller sys _pixelmap displayio micropython terminalio adafruit_bus_device dualbank msgpack time adafruit_bus_device.i2c_device epaperdisplay neopixel_write touchio adafruit_bus_device.spi_device errno nvm traceback adafruit_pixelbuf espidf onewireio ulab aesio espnow os ulab.numpy alarm espulp paralleldisplay ulab.numpy.fft analogbufio fontio paralleldisplaybus ulab.numpy.linalg analogio fourwire ps2io ulab.scipy array framebufferio pulseio ulab.scipy.linalg atexit frequencyio pwmio ulab.scipy.optimize audiobusio gc rainbowio ulab.scipy.signal audiocore getpass random ulab.scipy.special audiomixer gifio re ulab.utils audiomp3 hashlib rgbmatrix usb binascii i2cdisplaybus rotaryio usb.core bitbangio io rtc vectorio bitmapfilter ipaddress sdcardio warnings bitmaptools jpegio sdioio watchdog board json select wifi builtins keypad sharpdisplay zlib busdisplay keypad_demux socketpool busio locale ssl

manic glacierBOT
#

I ported iperf to CircuitPython: https://github.com/bablokb/circuitpython-iperf. Might be useful for anybody tweaking network code.

Still needs some polishing and it is currently only tested with a Pico-W. The results reproduce what we already know:

> iperf3 -l 4K -c 192.xxx.x.xxx
Connecting to host 192.xxx.x.xxx, port 5201
[  5] local 192.xxx.x.xxx port 35514 connected to 192.xxx.x.xxx port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00...
jaunty juniper
# fathom sand Adafruit CircuitPython 9.2.1 on 2024-11-20; Waveshare ESP32S3 LCD 1.28 with ESP3...

What do you mean by webrepl ? That's a Micropython thing.
The web workflow is documented here:
https://docs.circuitpython.org/en/latest/docs/workflows.html#web

I quickly looked at the board page, and it seems like the native USB is not broken out to a USB port, only the CH343 ? So there would be no way to have CIRCUITPY or the tinyUF2 bootloader.
https://www.waveshare.com/esp32-s3-lcd-1.28.htm
From the What's On Board section:

5. CH343P
   USB to UART chip
11. USB Type-C connector
    USB to UART, for programming and log printing
manic glacierBOT
hollow ether
#

i'm trying to build circuitpython (main) for the first time and getting a gcc version error when I try to build for my board. is this the right place to ask for help? [i'm on Mac M1, installed arm-gnu-toolchain-13.2.rel1-darwin-arm64-arm-none-eabi.pkg, successfully did gmake -C mpy-cross but gmake BOARD=nullbits_bit_c_pro in ports/raspberrypi gives me lots of "Minimum GCC version 13" errors]

stuck elbow
fathom sand
jaunty juniper
hollow ether
fathom sand
# jaunty juniper I don't think there's anything that uses the web workflow API like that. I hope ...

For development purposes, a plugin for Thonny would be a first big step.
https://github.com/thonny/thonny/wiki/Plugins
A general network drive implementation would be a "catch all" for most needs but would require either big modification of the code running in the board or a driver for each OS.
I saw your: https://github.com/Neradoc/discotool-circuitpython-manager
may this be a starting point?

GitHub

Python IDE for beginners. Contribute to thonny/thonny development by creating an account on GitHub.

GitHub

An app to manage files and library bundle dependencies on Circuitpython boards, via USB, Web Workflow and BLE Workflow. - Neradoc/discotool-circuitpython-manager

jaunty juniper
#

The idea of implementing WebDAV is that it is already supported by many many applications and operating systems, but it still needs a bunch of addition to the http API, and maybe some deeper changes to keep data in sync.
As for the app, I need to get back to it, one of my goals was to feature a "sync" mode that would allow editing the files of the board locally with any software you want and auto sync any changes (or with the press of a button), but I have been away from Circuitpython stuff for a while and am just coming back

fathom sand
#

You: > "but it still needs a bunch of addition to the http API, and maybe some deeper changes to keep data in sync."
I: >but would require either big modification of the code running in the board

That's what I meant...

jaunty juniper
#

yeah

fathom sand
#

I will investigate what it takes to create a Thonny plugin that can read and write files from and to the internal file system using the existing API.
If an app needs to publish and consume outside files, this task can be handled easily inside the app with some sample code for the app devs.
A light weight -importable- FTP-server module comes to mind here...

orchid basinBOT
manic glacierBOT
#

I have never encountered this error but I haven't used this specific CP version but mainly something older like 9.0.x and 9.1.x. The boards I use are the iLabs Challenger-RP2350+Wifi/BLE (8MB PSRAM, A-type chip), Pimoroni Pico-Plus-2 and Pimoroni Pico-Plus-2W. The last two have 8MB PSRAM and the B-type chip and the last one was definitely tested with a post 9.2.1 version (board support was added after 9.2.1).

When I am back home I will retest with the most current CP-version to see if I c...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.2.1 on 2024-11-20; Raspberry Pi Pico with rp2040

Code/REPL

# in boot.py file
import usb_hid
import supervisor
supervisor.set_usb_identification(manufacturer='HyperX', product='Pulsefire Haste 2', vid=0x0951, pid=0x16e4)

    usb_hid.disable()
    usb_hid.enable((usb_hid.Device.MOUSE,), boot_device=2)
    usb_hid.set_interface_name("HyperX Pulsefire Haste 2")

Behavior

# Powershel...
manic glacierBOT
#

@bablokb This one is more difficult to reproduce than I've described it. I just retried a few dozen times and cannot get a fail.

Before we chalk this up to random noise in my head there is an RP2350 XIP cache maintenance operation that is missing from CP: The cache is not purged during port initialization, so when coming out of initialization after a reset stale cache entries may persist. Whether that's a real problem depends on whether or not the RP2350 purges the cache on a non-POR reset...

manic glacierBOT
manic glacierBOT
#

I tried reproducing your report on a Feather RP2350 and the following boot.py (all lines shown):

# in boot.py file
import usb_hid
import supervisor
supervisor.set_usb_identification(manufacturer='HyperX', product='Pulsefire Haste 2', vid=0x0951, pid=0x16e4)
#usb_hid.disable()
usb_hid.enable((usb_hid.Device.MOUSE,)
        #, boot_device=2 # Specifying this causes safe-mode reset (why?)
        )
usb_hid.set_interface_name("HyperX Pulsefire Haste 2")
print("done")

I'm ...

onyx hinge
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adadruit Circuitpython 9.2.1. Board LILYGO® TTGO T-Display ESP32 4M

Code/REPL

import gc
print(gc.mem_free())

Behavior

116768

Description

Despite the available amount of ram ( 520kB) with circuitpython the available ram is just 116768 kB (~22%). It seems a little weird to me as other boards like adafruit feather nrf52840 or raspberry pico w, with less than 300kB of ram, both show 137kB (>50%) of available ram in circui...

manic glacierBOT
lone sandalBOT
manic glacierBOT
manic glacierBOT
devout jolt
# manic glacier

I have a question on this PR. pre-commit is failing in the CI but I have pre-commit installed and it ran. What's going on?
Weird. if I run pre-commit run --show-diff-on-failure --color=always --all-files like in the CI, it fixes the problems. I have already run pre-commit install but it wasn't running. nevermind, I guess I have a workable solution

manic glacierBOT
manic glacierBOT
#

Resolves: #8742

When the mirrored axis are applied we need to subtract one so that pixel index 0 becomes index 319 on a display that has width of 320px without this we attempt to use index 320 which is out of the display bounds and ignored.

Testing on a pyportal with the tft reproducer from the issue now correctly shows the green outline around all 4 sides of the display in all 4 rotations.

lone sandalBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.2.1 on 2024-11-20; Raspberry Pi Pico 2 with rp2350a

Code/REPL

import time
import board
import digitalio

pin = board.GP15
gpio = digitalio.DigitalInOut(pin)
gpio.direction = digitalio.Direction.INPUT
for _ in range(4):
    gpio.pull = digitalio.Pull.UP
    print("read 1:", gpio.value)
    time.sleep(1)
    gpio.pull = digitalio.Pull.DOWN
    print("read 2:", gpio.value)
    time.sleep(1)
gpio.dein...
tulip sleet
manic glacierBOT
#

This was a relatively small change, but it still overflowed a few of the tightest builds. I thought I could shave a little bit of space by removing a duplicated debug message, but that doesn't save anything because of the way they're set to void by default anyhow.

I opted to disable vectorio for the two m4 express boards without built-in displays and disabled flopyio for the openbook_m4, the others had already disabled it and this one has a built-in eink display so vectorio is a bit mor...

tulip sleet
#

if I remember right, some older BIOS's don't even support a composite configuration descriptor for boot devices.

onyx hinge
#

I missed that comment, thanks.

manic glacierBOT
#

Based on what you describe, you are encountering an erratum in the RP2350 silicon. The RP2350 datasheet proposes a workaround, but we elected not to implement it in CircuitPython for the following reasons:

Without adding additional API specifically to support the RP2350, there is no way to inform CircuitPython in various use cases, "well, yes, this is a weak input signal, so do the workaround". The only hint...

tulip sleet
#

@onyx hinge are you continuing on this at the moment? I have Windows available and am trying things out.

onyx hinge
mortal kernel
#

Is there a way to exclude a common-hal module for a given board?

#

I'd like to exclude _bleio entirely for non-W Pico boards.

tulip sleet
#

sorry typo

mortal kernel
#

The problem I'm having is that there appears to be a mechanism in the build that's compiling and linking everything in ports/raspberrypi/common-hal. I'm looking for a way to control that.

#

@danh Maybe this is the first port where this is desirable?

mortal kernel
#

Spotted why all the common-hal code is getting compiled. In ports/raspberrypi/Makefile starting at line 699 there's this:

SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \
                          $(addprefix shared-bindings/, $(SRC_BINDINGS_ENUMS)) \
                          $(addprefix common-hal/, $(SRC_COMMON_HAL))

SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) \
                             $(addprefix shared-module/, $(SRC_SHARED_MODULE)) \
                             $(addprefix shared-module/, $(SRC_SHARED_MODULE_INTERNAL))

# There may be duplicates between SRC_COMMON_HAL_EXPANDED and SRC_SHARED_MODULE_EXPANDED,
# because a few modules have files both in common-hal/ and shared-module/.
# Doing a $(sort ...) removes duplicates as part of sorting.
SRC_COMMON_HAL_SHARED_MODULE_EXPANDED = $(sort $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED))
...(elided lines)
OBJ += $(addprefix $(BUILD)/, $(SRC_COMMON_HAL_SHARED_MODULE_EXPANDED:.c=.o))
manic glacierBOT
#

@podpah

I believe https://stackoverflow.com/questions/39395751/how-can-a-hid-device-control-the-description-shown-for-it-in-windows-device-mana is noting that Windows does not list the supplied interface name, unfortunately. Other OS's do better.

I searched the Windows registry for "CircuitPython HID', and did not find it. So it's not recording the name. The name also does not show up in this tool: https://www.uwe-sieber.de/usbtreeview_e.html, which lists a lot of information. The name ...

somber gazelle
#

hi all! why BLE HID doesnt work on CP 9 on a nice!nano? no matter what i try, it always ended with "adafruit_ble" library line 445, in _init_devices TypeError: 'int' object is not iterable

onyx hinge
manic glacierBOT
manic glacierBOT
candid sun
#

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

tulip sleet
#

If it doesn't work, let us know.

manic glacierBOT
#

See https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-guides/memory-types.html. The 520kB of RAM is not uniform but is divided up into different areas with different possible uses. E.g. one example of that from that page:

There is 520 KB of available SRAM (320 KB of DRAM and 200 KB of IRAM) on the ESP32. However, due to a technical limitation, the maximum statically allocated DRAM usage is 160 KB. The remaining 160 KB (for a total of 320 KB of DRAM) can only be allocated at ...

blissful pollen
#

Just lurking today, no notes or anything

lone axle
onyx hinge
#

@honest nova very old pylint doesn't work with newer python. in the adafruit libraries we have bumped the pylint version, I think. in the long term we are moving to ruff for linting. Looks like we were using v2.17.4 before switching to ruff. https://github.com/adafruit/cookiecutter-adafruit-circuitpython/commit/a3622a12f11cb4f2c86f0cdfea801ce27f9cf872#diff-5fc0fdfcce62208c1e92b0458d4586847ec66365ca0bd44595053abd7e83e4acR21

lone axle
turbid radish
#

Sorry for the abbreviated newsletter, I was sick for a few days

onyx hinge
#

@turbid radish we want you to take care of your self & get better. we can wait for the hot python news if necessary.

still zephyr
#

Thank you for the info @onyx hinge

onyx hinge
#

cryptography, not complicated money laundring.

slender iron
#

me too 🙂

#

zephyr would also help us manage background tasks on other cores (think synthio on a second core and displayio too)

#

👍

mortal kernel
#

@onyx hinge Cool use of memorymap.

onyx hinge
#

oh that file's a year old

still zephyr
onyx hinge
#
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v5.0.0```
tulip sleet
still zephyr
#

I have just found out this morning

tulip sleet
#

there was some discussion of this in the philhower core issue on E9

onyx hinge
#

[I think @still zephyr is not listening to us live but I hope you'll listen later]

still zephyr
#

yes I will 🙂

onyx hinge
#

I like the idea in the abstract 🙂

#

so the parameter type for e.g., DigitalInOut's first parameter would be Pin | PinConfiguration ?

turbid radish
#

Thanks Liz!

errant grail
#

Thanks everyone and to Liz for hosting!

lone axle
#

Thanks for hosing Liz. Have a great week everyone!

candid sun
#

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

manic glacierBOT
#

@bablokb, you could do that for your patch as well.

I think we discussed this and the decided against doing it. We would have to change many existing board files to add this additional parameter only to support an obscure hardware-implementation. And my displays aren't e-paper, so the kwarg would go to BusDisplay which is used much more often in the code-base.

I don't remember that but my brain is sleep deprived. I think it's fine to PR in and just change all of the spots. It's ...

#

Overall, I like the PinConfiguration object idea. I wouldn't do board.D5.configuration but PinConfiguration(board.D5) to make it clear it is a shared settings container. I also like that the object given the configuration is still responsible for actually setting the values (and maybe changing them over time.)

Do we want to accept Pin or PinConfiguration in one argument or keep Pin separate and replace pull etc with PinConfiguration?

Add properties .drive_strength, `.p...

manic glacierBOT
lone axle
#

When an external display is initialized with displayio it stays alive beyond the end of code.py. Is it possible to re-use that same display instance in subsequent runs of code.py? Currently all of the scripts that do this call release_displays() and then re-initialize it. I'm curious if it's possible to just keep using the instance that is already initialized.

onyx hinge
#

@lone axle unless it's the board.DISPLAY, no.

devout jolt
#

More generally, is there a way to stash variables in a similar place to where board.DISPLAY lives, that persist across Ctrl-Cs?

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.2.1-13-g617915ee80 on 2024-12-02; Adafruit Feather ESP32-S3 Reverse TFT with ESP32S3
Adafruit CircuitPython 9.2.1 on 2024-11-20; Adafruit MatrixPortal S3 with ESP32S3

Code/REPL

import board,displayio,gifio,time
import digitalio
led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT

disp = board.DISPLAY

odgcc = gifio.OnDiskGif('classic40.gif')

with odgcc as odg:
    cs =...
lone axle
manic glacierBOT
#

Thank you!! I got sidetracked and have been unable to get traction on this.
Will try this shortly.


From: Jeff Epler @.>
Sent: Sunday, December 1, 2024 11:18 AM
To: adafruit/circuitpython @.
>
Cc: Curren, Joe (All Sensors) @.>; Mention @.>
Subject: Re: [adafruit/circuitpython] rp2pio: Add sideset_pindirs parameter to StateMachine constructor (PR #9849)

WARNING

**This message has originated from an External Sou...

lone axle
#

I don't think it's quite the same as how board.DISPLAY works, but provides similar functionality

devout jolt
lone axle
#

I see, I'm less familiar with the micropython ways. That would be cool though if we could initialize a display or other things in boot.py and retain access to it later in code.py and across re-runs.

blissful pollen
jaunty juniper
#

resetting the VM after boot.py and on reloads is a design choice for CP though, it's not MP doing anything special

manic glacierBOT
#

... I wouldn't do board.D5.configuration but PinConfiguration(board.D5) to make it clear it is a shared settings container. I also like that the object given the configuration is still responsible for actually setting the values (and maybe changing them over time.)

The use of such "factory" functions is pretty rare in Python, so that's OK with me.

Do we want to accept Pin or PinConfiguration in one argument or keep Pin separate and replace pull etc with `PinConfigurati...

still zephyr
mortal kernel
#

@tulip sleet This is what I asking about yesterday regarding _bleio HCI vs. native selection. I wrote it up mostly to clarify my thinking. This isn't an urgent issue, so please have a look when you have time.

tulip sleet
#

when these flags were first invented, they were disjoint across ports, and there was less conflict. But not so true anymore.

mortal kernel
#

"The vpath mechanism will always select the native source modules if both are selected" should be "..if both are present."

tulip sleet
#

If you feel like making a PR, that would be welcome.

mortal kernel
tulip sleet
mortal kernel
mortal kernel
#

@danh Is there an Adafruit breakout that works with devices/ble_hci/common-hal/_bleio?

tulip sleet
#

If you already have a plain ESP32 board, you could wire it up as an airlift.

lone axle
manic glacierBOT
onyx hinge
# still zephyr Have any of the Community Library Authors have tried the workflow to publish on ...

I recommend checking out https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ as the current best practice. However, cookecutter doesn't set things up for this method. Instead, it uses an older method where you generate a token: In github the secret pypi_username is set to __token__ and the secret pypi_password is set to the token value pypi-..... https://pypi.org/help/#apitoken

still zephyr
#

Hello thanks Jepler and Foamyguy, Yes my libraries used the method included with the cookiecutter and it worked very welll indeed, however it stop working saying that the username/password method. Not sure way because the method works currently for the Adafruit Libraries. Anyway I setup the new method after a lot of trial of error using this article
https://medium.com/@blackary/publishing-a-python-package-from-github-to-pypi-in-2024-a6fb8635d45d
Combined with the GH actions included here
https://github.com/adafruit/workflows-circuitpython-libs/blob/main/release-pypi/action.yml

The result was this
https://github.com/jposada202020/CircuitPython_BMI160/blob/master/.github/workflows/release_pypi.yml

Just for future reference if any other persone find the same problem as I did

Thank you for all the inoput and help ❤️ ❤️

slender iron
#

a GC stack size setting

manic glacierBOT
#

I've run into this problem on a similar board (unexpected maker FeatherS2)

CircuitPython version

Adafruit CircuitPython 9.2.1 on 2024-11-20; FeatherS2 with ESP32S2
Board ID:unexpectedmaker_feathers2
UID:487F3027BD2B
boot.py output:

Here's a complete code snippet that reproduces the error. It is based on the code above. I'm using the latest versions of adafruit_connection_manager, adafruit_requests and adafruit_httpserver. Also worth mentioning. I have the CircuitPy...

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.2.0 on 2024-10-28; Waveshare ESP32-S3-Zero with ESP32S3

Code/REPL

import wifi
import ipaddress

ip_address_str = 0

ipv4 = ipaddress.IPv4Address("2.0.0.2")
netmask = ipaddress.IPv4Address("255.0.0.0")
gateway = ipaddress.IPv4Address("2.0.0.1")

def create_wifi_AP():
    wifi.radio.set_ipv4_address_ap(ipv4=ipv4, netmask=netmask, gateway=gateway)
    wifi.radio.start_ap("potato", "barbecue_chips", chan...
crimson ferry
#

is it just me or is anyone else having trouble commenting on issues in GitHub?

#

(#9855: there seems to be a small delay between setting the AP IP and it becoming available)

manic glacierBOT
crimson ferry
#

n/m, it's working now

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.2.0 on 2024-10-28; Waveshare ESP32-S3-Zero with ESP32S3

Code/REPL

import wifi
import time

def connect_to_wifi():
    try:
        print(f"connecting wifi")
        wifi.radio.connect("my_ssid","my_password", timeout=5)
    except ConnectionError as e:
        print(f"{e} . Retrying...")
        time.sleep(1)
        connect_to_wifi()
        
connect_to_wifi()

Behavior

When trying to con...

manic glacierBOT
#

Nevermind :
This is a recursion problem, with the connect_to_wifi() launching itself. My bad.

A way to do it that doesn't crash :

import wifi
import time

def connect_to_wifi():
    try:
        print(f"connecting wifi")
        wifi.radio.connect("sticks","patateaufour")
    except ConnectionError as e:
        print(f"{e} . Retrying...")
        time.sleep(1)
        
while True:
    if wifi.radio.connected:
        print("connected!")
    else:
        connect_...
manic glacierBOT
#

CircuitPython version

adafruit-circuitpython-m5stack_core2-en_US-9.2.1
adafruit-circuitpython-m5stack_core2-en_US-9.2.0
adafruit-circuitpython-m5stack_core2-en_US-8.2.9

Code/REPL

# cannot run any code

Behavior

cannot run any code

Description

Once flashed, the board disconnects USB serial after producing the following message:

Serial console setup

The board can be restarted by a short press on the power button and will produce a ...

#

Currently the BOOT button, which is labeled simply as "B" on the silkscreen, is not defined in the BOARD module of Circuit{Python and therefore to use this button as an input requires

import microcontroller
button = DigitalInOut(microcontroller.pin.GPIO0)

This change adds "BUTTON" & "D0" aliases for the GPIO0 pin.

For reference, Waveshare ESP32-S3-Zero schematic is here: https://files.waveshare.com/wiki/ESP32-S3-Zero/ESP32-S3-Zero-Sch.pdf

manic glacierBOT
manic glacierBOT
manic glacierBOT
lone sandalBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

This PR exposes MixerVoice.loop as a mutable Python property.

The motivation here is to make it possible to stop a looping sample at the end of its current loop. Without this, it is only possible to use stop() to stop the sample immediately.

My specific use case is a backing sound loop for a game, which then needs to transition into another sample. Without this feature, I can't use the loop option, as I can't stop the sample at the end of a loop. With this feature, I can set `voic...

manic glacierBOT
#

I just ran another test :

When I try to connect my ESP32-S3-zero to a wifi that has the DHCP disabled with wifi.radio.connect(SSID, PASSWORD, timeout=5), it just sits there, without timing out. But then, I enable the DHCP server on the access point AFTER the timeout period has expired, and I receive a WiFi connection timed out. message in REPL!

So, some of the timeout function is working, somewhere...

manic glacierBOT
#

for a property setter, there's no need to support kwargs. I notice that you were probably just copying the style of audiomixer_mixervoice_obj_set_level within this same file so what you wrote is understandable, but would be better to write it similar to this more usual setter:

static mp_obj_t synthio_synthesizer_obj_set_envelope(mp_obj_t self_in, mp_obj_t envelope) {
    synthio_synthesizer_obj_t *self = MP_OBJ_TO_PTR(self_in);
    check_for_deinit(self);
    synthio_synth_envelop...
onyx hinge
#

@blissful pollen @fleet hollow Heya! After writing my review comments on #9861 I noticed this nonstandard setter-with-kwargs style in audiodelays & audiofilters, too. Likely it was all propagated from an example in audiomixer.

Removing the kwarg handling will probably reduce code size a bit (it did by 88 bytes for the case in audiomixer), so it might be worth doing. I found the following likely candidates: ```c
shared-bindings/audiodelays/Echo.c:static mp_obj_t audiodelays_echo_obj_set_delay_ms
shared-bindings/audiodelays/Echo.c:static mp_obj_t audiodelays_echo_obj_set_decay
shared-bindings/audiodelays/Echo.c:static mp_obj_t audiodelays_echo_obj_set_mix
shared-bindings/audiodelays/Echo.c:static mp_obj_t audiodelays_echo_obj_set_freq_shift
shared-bindings/audiofilters/Filter.c:static mp_obj_t audiofilters_filter_obj_set_filter
shared-bindings/audiofilters/Filter.c:static mp_obj_t audiofilters_filter_obj_set_mix

Would you like me to file issue(s) about this?
blissful pollen
fleet hollow
fleet hollow
manic glacierBOT
#

Based on text search, the following getters in audiofilters & audiodelays modules can have their kwarg handling removed. Each instance may save ~80 bytes of code/flash space:

shared-bindings/audiodelays/Echo.c:static mp_obj_t audiodelays_echo_obj_set_delay_ms
shared-bindings/audiodelays/Echo.c:static mp_obj_t audiodelays_echo_obj_set_decay
shared-bindings/audiodelays/Echo.c:static mp_obj_t audiodelays_echo_obj_set_mix
shared-bindings/audiodelays/Echo.c:static mp_obj_t audiodela...
onyx hinge
#

OK, issue filed. Thank you in advance for addressing it.

#

@tulip sleet the other day you said something about critical sections with respect to the E9 workaround. What situation is it trying to prevent? Is that something that can be implemented in pure CircuitPython?

orchid basinBOT
fleet hollow
#

@onyx hinge Just read over your issue. Do I need to be a part of the adafruit organization on GH to be assigned to an issue? I don't want to step on any toes, but I don't have any issue with an elevated role so that I can better contribute to CircuitPython.

manic glacierBOT
#

Updated the following setters within audiodelays and audiofilters which were unnecessarily using kwargs in accordance with @jepler 's research within https://github.com/adafruit/circuitpython/issues/9863.

shared-bindings/audiodelays/Echo.c:static mp_obj_t audiodelays_echo_obj_set_delay_ms
shared-bindings/audiodelays/Echo.c:static mp_obj_t audiodelays_echo_obj_set_decay
shared-bindings/audiodelays/Echo.c:static mp_obj_t audiodelays_echo_obj_set_mix
shared-bindings/audiodelays/Echo...
onyx hinge
#

@fleet hollow yeah I think it's probably a github feature that I can't assign "random people on the github" an issue within an organization. So your involvement will have to be on the honor system 🙂

fleet hollow
onyx hinge
fleet hollow
onyx hinge
manic glacierBOT
#

I did not reproduce the exact problem reported; however, I reproduced that a failure to construct an RGBMatrix object would leave CircuitPython in an inconsistent state with a display bus registered but not working:

>>> import rgbmatrix, board; rgbmatrix.RGBMatrix(width=64, bit_depth=1, rgb_pins=[], addr_pins=[], clock_pin=board.A0, latch_pin=board.A1, output_enable_pin=board.A2)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: The length of rgb_pins must be ...
tulip sleet
# onyx hinge <@329766224093249548> the other day you said something about critical sections w...

From the erratum:

To read the state of a pad pulled-down
GPIO from software, enable the input buffer by setting GPIO0.IE immediately before reading, and then redisable immediately afterwards.
So if an interrupt occurred in these "immediately" gaps, the reading could come out wrong. Earl Philhower and I discussed the difficulty of doing this here: https://github.com/earlephilhower/arduino-pico/issues/2380#issuecomment-2334997756 and for several posts afterward.

#

I don't think it is worth coming up with a software fix for normal use. It's easier to make sure the hardware is set up so the condition doesn't happen.

onyx hinge
#

yeah I don't think I'll polish my work any further

#

I dunno how long it is between the Python change to the IE bit -> digitalio read but surely it's most of a millisecond. and yet my code seemed to work.

tulip sleet
#

I'm sure it would work nearly all of the time. The problem is the small probability it would not work, due to a gc, an extended interrupt, etc.

#

The ease of using memorymap is admirable -- it's just in this case we really need an atomic section to guarantee correctness.

onyx hinge
#

If I understand this graph right, the excess leakage current exists during a particular voltage range. If IE is off long enough for the voltage to drop BELOW that, then it will stay low. (screen grab of the current official documentation for E9)

#

We won't be providing a software workaround in the SDK as it isn't clear what you'd do. The user can use an external resistor[.]
TFW the datasheet says there's a workaround and the sdk devs say "it isn't clear what you'd do" lolsob

tulip sleet
#

I feel like they've avoided describing the fault in a way that would make it clearer when it "latches", when it doesn't, etc. "Here's the chip schematic; here's why it occurs." That explanation is missing.

onyx hinge
#

I've never seen that level of detail in an erratum. But I do miss the part of datasheets that show "output equivalent circuit", "input equivalent circuit", etc. This went out of style somewhere along the line.

#

once we weren't thinking about how many "TTL loads" we had on a gate output anymore I guess

manic glacierBOT
mortal kernel
manic glacierBOT
manic glacierBOT
#

Here's a standalone test to run on the unix port. Each time the first buffer's RMS should be zero. but instead in the reopen case it's nonzero:

import audiomp3, audiocore
import ulab.numpy as np

TEST_FILE ="tests/circuitpython-manual/audiocore/jeplayer-splash-44100-stereo.mp3"
def normalized_rms_ulab(values):
    values = np.frombuffer(values, dtype=np.int16)
    # this function works with ndarrays only
    minbuf = np.mean(values)
    values = values - minbuf
    samples_su...
#

I tried to recreate the original post code, but with latest CircuitPython and libraries, and use of ConnectionManager (due especially to multiple uses of sockets). I'm not sure why the partial original gets a memory exception, but this version looks fine with regard to use of RAM:

code.py output:
# ...snip...
after stop gc.mem_free()=1978416

<details>
<summary>code.py...</summary>

import time
time.sleep(3)  # wait for serial

import gc
print(f"code start {gc.m...
mortal kernel
#

@danh @onyx hinge I'm factoring this code out of individual port Makefiles into circuitpy_defns.mk. It looks like it's generic for all ports. Is there any reason not to?

SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \
                          $(addprefix shared-bindings/, $(SRC_BINDINGS_ENUMS)) \
                          $(addprefix common-hal/, $(SRC_COMMON_HAL))

SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) \
                             $(addprefix shared-module/, $(SRC_SHARED_MODULE)) \
                             $(addprefix shared-module/, $(SRC_SHARED_MODULE_INTERNAL))

# There may be duplicates between SRC_COMMON_HAL_EXPANDED and SRC_SHARED_MODULE_EXPANDED,
# because a few modules have files both in common-hal/ and shared-module/.
# Doing a $(sort ...) removes duplicates as part of sorting.
SRC_COMMON_HAL_SHARED_MODULE_EXPANDED = $(sort $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED))
onyx hinge
#

@mortal kernel superficially I don't know a reason not to.

tulip sleet
#

@onyx hinge does nlr_push_jump_callback() call the routine and then still raise the exception?

onyx hinge
#

@tulip sleet It's a newer thing in micropython. According to the documentation, the callback gets called when nlr is unwinding the stack past the location of the node; otherwise, if no exception is thrown, it gets forgotten and is never run.

#

"do this in case of exception, let exception propagate"

mortal kernel
#

Thanks to you both. That's what I was hoping.

tulip sleet
#

I have seen the old way of basically doing try-catch in C. This is nice. Thanks.

onyx hinge
#

yeah it might be worth reviewing if there are other places to use it. however, micropython didn't use it much yet either.

manic glacierBOT
#

Re: @bablokb
Maybe I'm confused here. But there's the request object being passed into my method from adafruit_httpserver and the requests object coming from adafruit_requests that I am defining in my code. You're suggesting the two are conflicting somehow?

Re: @anecdata
I ran your code snippet and it failed with a memory error. Here's the output:

code start gc.mem_free()=7745728
after imports gc.mem_free()=7668720
after AP gc.mem_free()=7668544
after mDNS gc.mem_free...
#

@chadj I haven't reproduced that (yet?). I added some code in the middle to allow clients to connect (my phone, connected to the S2 AP, then connecting to the HTTP server by IP address) and that worked too in brief testing.

<details>
<summary>code.py...</summary>

import time
time.sleep(3)  # wait for serial

import gc
print(f"code start {gc.mem_free()=}")

import os
import wifi
import mdns
import socketpool
import adafruit_requests
import adafruit_connection_manager
...
lone axle
#

@short tendon Do you think you may have some time to look into https://github.com/adafruit/Adafruit_CircuitPython_WSGI/issues/21 ? This library worked prior to the esp32spi switch to connection_manager but wasn't converted for the new way. I had a look into it with an eye towards making the necessary changes but I'm feeling a bit lost. If you do have some time and want to try to tackle converting this one or even could try to point me in the right direction it would be most appreciated.

GitHub

Hello, Since this conversion happened: adafruit/Adafruit_CircuitPython_ESP32SPI#198 esp32spi_wsgiserver.py will need to be updated please to fix the import to socketpool instead of socket And the s...

manic glacierBOT
slender iron
#

@mortal kernel don't spend too much time improving the makefiles. I'm hoping to replace them with my zephyr migration

manic glacierBOT
mortal kernel
manic glacierBOT
manic glacierBOT
#

@jepler
I built the espressif-mbedtls-psram branch from your fork to test the proposed fix. I flashed it. I then looked at boot_out.txt to verify that the new version was running. And sure enough, my code now runs.

Surprise twist though. I flashed back to stock 9.2.1 and tried my code again. And surprise, my code worked! I verified boot_out.txt. I'm running stock 9.2.1 from 2024-11-20 and it executes now without throwing a MemoryError. So there might not be an issue to begin with.
...

onyx hinge
#

@tulip sleet @slender iron itsybitsy m4 being full is blocking a number of otherwise good PRs. I'm not sure what to disable. floppyio?

onyx hinge
#

I don't know how on the edge itsybitsy m4 is, whether we're in for a sea of such problems coming right up. I could go look but I really don't want to know.

#

floppyio was already off 😧

#

msgpack? zlib?

#

rgbmatrix?

onyx hinge
#

ok, we didn't disable terminal fonts for ja/ko/ru translations on itsybitsy m4 yet. we had on metro m4 previously.

lone axle
#

Does anyone with knowledge of seesaw have a moment to take a look at the trio of https://github.com/adafruit/Adafruit_CircuitPython_seesaw/pull/137, https://github.com/adafruit/Adafruit_Seesaw/pull/105/, and https://github.com/adafruit/Adafruit_seesawPeripheral/pull/28. They are all related to adding support for the ATtiny416. The changes seem in-line with existing code in the respective repos to my eye, but I know basically nothing about the seesaw internals. Or anyone know who might be a good person for this?

mortal kernel
#

@danh @onyx hinge In a few cases in py/circuitpy_defns.mk SRC_COMMON_HAL is augmented after it is dead. This affects handling of CIRCUITPY_TOUCHIO_USE_NATIVE, CIRCUITPY_SSL_MBEDTLS, CIRCUITPY_AUDIOMP3_USE_PORT_ALLOCATOR, and CIRCUITPY_HASHLIB_MBEDTLS. The fix is easy, but the bug's been there a long time which makes me hesitate to try.

#

Might be related to issue 9624.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.1.1; Raspberry Pi Pico 2 W with rp2350

Code/REPL

import _bleio

try:
    ble = _bleio.BLERadio()
    print("BLE initialized successfully!")
except RuntimeError as e:
    print("Error initializing BLE:", e)

import _bleio

adapter = _bleio.adapter
if adapter:
    print("BLE adapter is available:", adapter)
else:
    print("No BLE adapter found.")

Behavior

soft reboot
Traceback (most rec...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.2.0 on 2024-10-28; Waveshare ESP32-S3-Zero with ESP32S3

Code/REPL

import usb_hid, usb_midi

usb_hid.disable()
usb_midi.enable()
usb_midi.set_names(streaming_interface_name="new_streaming_interface_name", audio_control_interface_name="new_audio_control_interface_name", in_jack_name="new_in

Behavior

On my device, if I input this code in the boot.py file, it does indeed change the midi device name i...

onyx hinge
manic glacierBOT
onyx hinge
#

I am GUESSING here that you might have an incomplete idea of how make calculates values (because everyone, including me, does)

default:
    @echo ALL_FILES=$(ALL_FILES)
    @echo ALL_FILES_SORTED=$(ALL_FILES_SORTED)
    @echo ALL_FILES_SORTED_CAPTURED=$(ALL_FILES_SORTED_CAPTURED)

WHATEVER = baz.c
ALL_FILES = $(WHATEVER) $(STUFF)
ALL_FILES_SORTED = $(sort $(ALL_FILES))
ALL_FILES_SORTED_CAPTURED := $(sort $(ALL_FILES))
WHATEVER += foo.c bar.c
STUFF := quux.c baz.c
make -f surprising.mk 
ALL_FILES=baz.c foo.c bar.c quux.c baz.c
ALL_FILES_SORTED=bar.c baz.c foo.c quux.c
ALL_FILES_SORTED_CAPTURED=baz.c

A variable is expanded "when it is used", so surprisingly ALL_FILES_SORTED contains foo.c and others when it is expanded during the execution of the default rule, even though the default rule appears before the definition of all the values. A := assignment expands the value right away, so it only includes baz.c. The GNU Make manual refers to these as "deferred" and "immediate" assignments. (as a total aside a recent update to the POSIX standard standardizes ::= and :::= to match two slightly different existing implementations of :=. not joking)

This is weird and contrary to the expectations we have from a lot of languages.

tulip sleet
mortal kernel
onyx hinge
#

That doesn't mean we shouldn't re-order things in the Makefiles "if it makes sense to do so". that would include for clarity or consistency.

#

OTOH tannewt has said he hopes to jettison the makefiles at some point in the future (replacing the build system has been something he's itched to do for years!) so doing real work is probably better than block moving lines of variable assignments for no net change in functionality.

mortal kernel
mortal kernel
manic glacierBOT
onyx hinge
#

OK, just be careful lest you become a makefile expert in the process.

mortal kernel
onyx hinge
#

is that the thing that has to appear at the top of a print job?

#

no that must be something else

#

oh that's PJL. I knew PJL once, never JCL.

slender iron
#

Yes, in my Zephyr work I'm using async python to build the circuitpython bits instead of make.

#

(and really happy with it so far)

mortal kernel
manic glacierBOT
#

Just as a data point, I put the updated code in the boot.py of my Metro M4 Grand Central and reset it with the reset button. Using Linux lsusb to list information about USB devices I can see that all 4 of the strings are shown as supplied:

$ sudo lsusb -vv -d 239a:8032 | grep new_
      iInterface              8 new_audio_control_interface_name
      iInterface              7 new_streaming_interface_name
        iJack                   9 new_in_jack_name
        iJack           ...
#

OK, it's helpful to know it's not specific to a single piece of Windows software, and that it's probably not a problem with cached device info (unless all three of those programs have device info caches with the exact same bug which is unlikely)

I tested on a different microcontroller than you did (just because of what was at my workspace), but the USB descriptor code is the same for every kind of device as far as I know.

#

I spent a long time debugging a similar problem on macOS : https://forums.adafruit.com/viewtopic.php?t=212247. I think I replicated your problem, using MIDITools to list the devices. I also deleted the device from Device Manager each time, and even rebooted once.

It might be worth searching the Windows Registry for the original jack names after deleting the device. The fact that it works when you restore the original jack names, even explicitly, suggests to me some kind of caching problem.

onyx hinge
#

and thanks for the review of course

lone axle
manic glacierBOT
#

Ok
I now have a code snippet that reliably reproduces the MemoryError on the FeatherS2 from a fresh boot. It's based on code from @anecdata but with a few more imports (for audio handling).

On stock 9.2.1 it fails. With the patch from @jepler it works. So the change to allow mbedtls psram allocation solves this problem.

import time
time.sleep(5)  # wait for serial

import gc
print(f"code start {gc.mem_free()=}")

import os
import wifi
import mdns
import socke...
#

@jepler Since the synthio.BlockInput system relies on an actively running instance of synthio.Synthesizer to operate, it isn't currently possible to use audiofilters.Filter without also using audiomixer.Mixer with two voices, one reserved for synthio.Synthesizer (even if it isn't doing anything other thank BlockInput calculations).

Here's an example of this in action: https://gist.github.com/relic-se/77e48df1920b20d3e50762cbc06d1bb9#file-audioeffects_microphone-py-L111-L112.

I...

#

Just like using an LFO, math, or other object with a block input with two synthesizer objects is undefined, so is using an LFO with a synthesizer and an audiofilter...:

//|     Using the same LFO as an input to multiple other LFOs or Notes is OK, but            
//|     the result if an LFO is tied to multiple Synthtesizer objects is undefined.          

so sadly I have to say that the code linked above is relying on undefined behavior. I wish I had looked more closely at the use...

manic glacierBOT
#

CircuitPython version

main

Code/REPL

# https://gist.github.com/relic-se/77e48df1920b20d3e50762cbc06d1bb9

Behavior

It depends on LFO & math block side effects that are unintended

Description

No response

Additional information

audiofilters should have their own independent LFOs and should properly "tick" them every 256 samples when generating output samples. LFOs and other BlockInputs should never be shared between different audio-gen...

manic glacierBOT
#

USB limits "string descriptors" to 126 Unciode code points. I skimmed the USB MIDI standard and did not see any additional restriction imposed on the interface names. However, we also can't effectively argue with whatever it is Windows is doing.

Is the "fix" to note in the documentation that "some operating systems (Windows) require descriptors be at most 31 ASCII letters or 31 Unicode code points? It'd be too bad to break someone's working project on Linux, which did not appear to have an...

manic glacierBOT
#

@jepler Properly fixing this situation would require a rewrite of the audiosample API to always fill buffers in 256 sample segments and process BlockInput objects globally in between these segments. This is possible, but I wouldn't call it ideal and it would definitely be a breaking-change to existing code. Buffer sizes would also need to be validated to ensure that they fit this scheme.

It still may not be the best solution, but adding a blocks property to all modules which use `Bloc...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.2.1-22-gb481f1fa8e on 2024-12-05; Pimoroni Pico Plus 2 with rp2350b

Code/REPL

import audiobusio
import audiodelays
import board, time
import synthio

audio = audiobusio.I2SOut(
    bit_clock=board.GP0,
    word_select=board.GP1,
    data=board.GP3,
)

synth = synthio.Synthesizer(
    sample_rate=22050,
    channel_count=2,
)

effect = audiodelays.Echo(
    max_delay_ms=200,
    delay_ms=500,
...
#

CircuitPython version

Adafruit CircuitPython 9.2.1 on 2024-11-20; Adafruit Feather ESP32-S3 Reverse TFT with ESP32S3

It seems there isn't such a function. Is it necessary to verify the server certificate after enabling SSL?

Code/REPL

# 创建 SSL 上下文并禁用证书验证
ssl_context = ssl.SSLContext(ssl.create_default_context())
ssl_context.check_hostname = False
# ssl_context.(ssl.CERT_NONE, None)  # 禁用证书验证
ssl_context.set_default_verify_paths()

Behavior

F...

manic glacierBOT
#

@gamblor21 @jepler for interest.

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 buffer into two halves (left + right) and offsetting the buffer where necessary. I've done my best to support single_channel_output as well, but I'm not exactly sure how to test that (I2SOut uses left/right pairs).

I've also f...

#

This was added originally because it was needed on the first chips that had stereo output (samd51). However, of all the audio HW we support, this is only required for samd51 analog AudioOut, and only in certain cases (8-bit stereo or swapped 16-bit stereo). Supporting single_channel_output has been a hassle that is spread across all audio sources.

Instead, move the handling down into samd51 in a way that doesn't require support in each audio source, or have samd51 expand & channel swap int...

wraith crow
#

Using absolute newest for the ESP32-P4-Function-EV-Board I now see the CIRCUITPY drive 🎉 and tio can connect over the USB-OTG port...
I noticed there is now a UF2 file being built, is there a UF2 bootloader available somewhere? I took a quick look at tinyusb and didn't see anything for the P4

manic glacierBOT
#

@dhalbert @jepler thank you both for your support with this. Since it's a Windows issue I guess it'll be fine for my use case (and now that I think about it my own mouse/keyboard aren't named either and they're from a somewhat large brand too.

Also a note on the boot_machine thing:

This is probably because I did not deactivate CDC and MSC (part of what is not shown in your reduced boot.py I guess?)

Yup. `The HID boot device must usually be the first or only device presented by Circ...

slender iron
#

but someone had requested a uf2 id

manic glacierBOT
silent torrent
#

I’m using a pi and blinka to draw and redraw this solar charge panel. I note that every time it draws a new object, it slows down the pi. Is there a way to speed it up by just “filling” objects already drawn with a diff colour?

tulip sleet
manic glacierBOT
onyx hinge
#

Is there any way to make usb_cdc.data.write ignore "connected" and write anyway? or is that nonsense? (like pyserial(dsrdtr=False))

The host is considered to be connected if it is asserting DTR (Data Terminal Ready). Most terminal programs and pyserial assert DTR when opening a serial connection. However, the C# SerialPort API does not. You must set SerialPort.DtrEnable.

manic glacierBOT
#

Allows selection of _bleio impementation by board within a port. Makes explicit HCI device inclusion by replacing use of vpath.

Changes meanings of CIRCUITPY_BLEIO* flags as follows:

  • CIRCUITPY_BLEIO: Any _bleio implementation is part of this build. Automatically set.
  • CIRCUITPY_BLEIO_NATIVE: Selects the port's native _bleio implementation.
  • CIRCUITPY_BLEIO_HCI: Selects the serial HCI implementation.
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Huh, I tested it here:

Adafruit CircuitPython 9.2.1-21-g7c28ec69cd-dirty on 2024-12-04; Adafruit Floppsy RP2040 with rp2040
>>> import board
>>> board.DISPLAY.root_group = None

After I hit enter on the 2nd line the TFT was set to all black.

I see two things from the forum thread:

  • first, you're using an epaper display ("pimoroni badger2040 which has a built in Epaper Display"). circuitpython will defer the refresh of an epaper display for a long time, sometimes minutes, ba...
onyx hinge
#

huh I wonder if hidden = True used to not get reset across soft-reboots

#
    common_hal_busdisplay_busdisplay_set_auto_refresh(self, true);
    circuitpython_splash.x = 0; // reset position in case someone moved it.
    circuitpython_splash.y = 0;
    supervisor_start_terminal(self->core.width, self->core.height);
    if (!circuitpython_splash.in_group) {
        common_hal_busdisplay_busdisplay_set_root_group(self, &circuitpython_splash);
    }
}
```seems we used to reset the offset [which is code that could be deleted if we leave the entire splash group read-only] but not the hide flag.
manic glacierBOT
manic glacierBOT
jaunty juniper
manic glacierBOT
manic glacierBOT
orchid basinBOT
tulip sleet
manic glacierBOT
onyx hinge
tulip sleet
slender iron
#

yup!

onyx hinge
#

yup!

onyx hinge
#

Karel is an educational programming language for beginners, created by Richard E. Pattis in his book Karel The Robot: A Gentle Introduction to the Art of Programming. Pattis used the language in his courses at Stanford University, California. The language is named after Karel Čapek, a Czech writer who introduced the word robot in his play R.U.R.

#

so pushy 🙂 in a git way.

errant grail
#

Thanks all and to Dan for hosting!

random junco
#

Thanks all - have a good week

onyx hinge
#

thanks! see y'all around

lone axle
#

Thanks for hosting Dan, have a great week everyone.

tulip sleet
#

bye thanks everyone!

onyx hinge
#

@slender iron (use your mental model of RP2 because that's what I'm doing 🤣 ) if only one state machine is running I could just OUT all the pins but only the ones with PIO set in their function would actually be reaching the GPIO pins, right? I won't shed too many tears if nobody else can PIO while running a HUB75 display. Because, yes, the pins are very much non-sequential.

still haven't found anything that says that the PIO pin numbering differs from the GPIO pin numbering but who knows. There are a lot of layers of software between here and there and I haven't looked at them all

slender iron
tulip sleet
#

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

willow totem
#

Is it known on 9.2.1 that the hostname access for circuitpython.local (but device name version) doesn't work for /code/
e.g. http://cpy-s3_reverse_tft-70041dce0bc4.local/code/ gives the wifi/ble/usb choice then choosing wifi gives

manic glacierBOT
lone axle
#

Currently when you try to import a module that requires longint support the stacktrace doesn't seem to be able to give you any more information beyond the import line. i.e.

code.py output:
Traceback (most recent call last):
  File "code.py", line 1, in <module>
OverflowError: No long integer support

raised from

from adafruit_hx711.hx711 import HX711

But nothing about which line inside of hx711 were problematic.

Is there any better way than just looking around inside of the library to find the parts that utilize the longint?

#

Also, do we have / should we have some mechanism that knows which libraries require longint support? With such a mechanism circup could warn if you attempt to install a library that relies on it onto a device without it.

onyx hinge
#

@lone axle ```py
# Convert to 32-bit signed integer
if value & 0x800000:
value |= 0xFF000000


I'm not sure that line is *correct*, fwiw. I think it should be `if value & 0x80_00_00: value -= 0x1_00_00_00` which should also happen to avoid the long integer.

The line written there might make sense in C/C++/Arduino when dealing with a signed 32-bit type, and was copied without testing.

```py
for i in (0x7f_ff_fe, 0x7f_ff_ff, 0x80_00_00, 0x80_00_01):
    if i & 0x80_00_00: 
        i -= 0x1_00_00_00 
    print(i)
```prints

8388606
8388607
-8388608
-8388607

#

as for detecting it, we don't have a pre-made tool for it. HOWEVER, mpy-tool (which helps with freezing in modules) in the circuitpython source tree has a line about it: ``` elif is_int_type(obj):
if mp_small_int_fits(obj):
# Encode directly as a small integer object.
return "MP_ROM_INT(%d)" % obj
elif config.MICROPY_LONGINT_IMPL == config.MICROPY_LONGINT_IMPL_NONE:
raise FreezeError(self, "target does not support long int")

My gut says it's not worth spending the time, especially since you'd need a different mpy-tool for each circuitpython version in the bundle, but this program could help with the checking you want to perform..
lone axle
# onyx hinge <@382939733107408897> ```py # Convert to 32-bit signed integer i...

Ah, thank you! I found that line is indeed the one that causes it in that library. It got me curious about the more general question while looking into it.

also thank you for the insight about it's functionality. Bit manipulation particulars are something I'm still not quite fully in tune with. I did not / would not have been able to spot the other issue with that line.

onyx hinge
#

As written, it would give this result which is not right...

8388606
8388607
4294967295
4294967295
onyx hinge
#

@lone axle as a proof of concept, mpy-cross could gain a new flag "-mno-long" which causes it to error when building an mpy file. https://gist.github.com/jepler/181ab2c5ccd4175d3635d459ee739e2c

Hypothetically, circuitpython-build-tools would try building a module with this flag. If it errors, it would store a new piece of metadata (where?) noting that the package needs long integers, and then mpy-cross it without the flag to get a working file.

$ echo 'def f(): return 0x7 << 31' | ./build/mpy-cross -mno-long -o /dev/null -
OverflowError: 
$ echo 'def f(): return 0x7 << 31' | ./build/mpy-cross -o /dev/null -
$ 
onyx hinge
plucky flint
#

Good morning folks... Not sure where else to post this, but it feels relevant here: https://madewith.mu/mu/users/2024/12/10/retirement-plans.html

TL;DR - we're sunsetting Mu in 2025, and the link is to our retirement plan so we honour and respect our users with minimum disruption.

More context: Mu has had a good run, there are now plenty of alternatives and (most importantly for me personally), we're all volunteers and life moves onto other fun stuff, so sunsetting with a final release is the right thing to do.

Thank you, and season's greetings to all Adafruit friends! 🤗 🐮 ❤️🐍

Made With Mu

Photo by Nick Scheerbart on Unsplash

tulip sleet
#

@plucky flint I just saw this announcement this morning in the repo, and am sorry to see this. Thank you all very much for Mu, which served us so well as the "easy editor" for beginners. Given the long time since the last release, we have already been thinking about how to move on. I started a discussion thread in #help-with-circuitpython about the alternatives that people see. I would also be interested in what you see as the alternatives, in case we have missed some.

manic glacierBOT
#

CircuitPython version

N/A

Code/REPL

N/A

Behavior

How do I go about having CircuitPython work on this device?

Wanting to do some ethernet to ESPnow, I got myself a Waveshare ESP32-S3-ETH, a ESP32-S3 device with a W5500 WIZnet ethernet port. I only now realize that this board is not supported by CircuitPython. I've tried to install a few of the ESP32-S3 builds for other devices on it, without luck.

Here is the wiki link for it : https://www.w...

plucky flint
# tulip sleet <@354682505271443468> I just saw this announcement this morning in the repo, and...

We discussed if we should mention alternatives and decided against simply because we don't want to appear to endorse one thing over another (which may not be known to us). The community will work it out and, to be honest, this is very much a case of something must die for something else to be born. A Mu-ish hole will appear and folks will fill it with something wonderful... I'm excited to see what that might be... and hope for something creative, compassionate and playful.

manic glacierBOT
random junco
tulip sleet
plucky flint
#

Quite. One of the most important aspects of Mu was that we wanted folks to graduate away from it. We did our job if folks could take their first steps with Mu and gain the confidence to move elsewhere for a "proper" editor experience - as their needs and understanding developed.

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I'm continuing to work on this but I'm struggling to get a screen clear test working. I've been working from the datasheet, official M5Drivers and a prior attempt at porting this driver to Circuitpython. From these sources, the display update process is as follows:

  • Send a command packet with a code indicating that an image data transaction should start
  • Send a data packet with endian, BPP, and rotation information
  • Send data packet...
manic glacierBOT
#

Ok, I did that.
I am now encountering some errors trying to compile for a device I own (so I can test the setup is working correctly). How do I go from here? Should I continue in this thread or elsewhere?

-- Found assembler: xtensa-esp32s3-elf-gcc
CMake Error at esp-idf/tools/cmake/project.cmake:564 (__project):
  The CMAKE_C_COMPILER:

    xtensa-esp32s3-elf-gcc

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the ...
manic glacierBOT
manic glacierBOT
#

The commands are added o the path when you "source" the "export.sh" script" (from the espressif specific page of the guide linked above):

After this, in each fresh terminal window in which you are doing builds, you need to use esp-idf/export.sh in order to set up the correct PATH and other environment variables.
Note that export.sh sets up a Python venv (virtual environment). If you are already using a venv, maybe beca...

onyx hinge
manic glacierBOT
#

Thanks for this info!
I managed to build a firmware for my ESP32-C3 device (as a test) and load the .bin on an actual Maker Go ESP32C3 Supermini. I don't see the virtual disk drive, but it boots and shows up in Thonny. Great!

Now, which device should I clone as a starting point for this Waveshare ESP32-S3-ETH device? I'm guessing the kind of memory chip for the rom is important, as well as the address for it?
The wiki page for this device on the waveshare website says it has a 16 MB flas...

fleet hollow
# onyx hinge huh this project gets totally different styling than the normal readthedocs. I w...

Looks like you selected the alabaster theme in conf.py, https://github.com/jepler/Adafruit_Blinka_rp1pio/blob/53991ceebaec95e931a9d81942696406db76a00b/docs/conf.py#L114. Seems like that configuration is the default sphinx one. Did you use cookiecutter to create the repo?

GitHub

Contribute to jepler/Adafruit_Blinka_rp1pio development by creating an account on GitHub.

manic glacierBOT
onyx hinge
manic glacierBOT
fleet hollow
fleet hollow
manic glacierBOT
#

So, I'm not having much succes. After much faffing about, I decided to restart from the beginning.

I built the current yd_esp32_s3_n16r8 in the online build environment with the line
time make -j 2 BOARD=yd_esp32_s3_n16r8 TRANSLATION=en_US . After a while, it spits out a firmware.bin in the build directory, and I use https://adafruit.github.io/Adafruit_WebSerial_ESPTool/ to flash it to my ESP32-S3-ETH board. It does not work.

If I flash the .bin file from [the circuitpython website](...

manic glacierBOT
lone sandalBOT
manic glacierBOT
manic glacierBOT
#

I've optimized a few areas of this algorithm where it was feasible to reduce floating point calculations, but audiofilters.DistortionMode.OVERDRIVE requires the most by far. My simple testing so far has been promising, but if processing time is still a concern, I think we'll have to research an alternative algorithm to implement and move away from this one or even remove this mode altogether in favor of audiofilters.DistortionMode.CLIP.

manic glacierBOT
#

Still can't build the firmware myself, but I can reiterate that the yd_esp32_s3_n16r8 firmware works very well, even if there are a lot of missing IO pins and it is mislabeled. I was able to make the Wiznet W5500 run perfectly, responding to ping and pulling web pages from the net.

Initialization of the onboard W5500 :

cs = digitalio.DigitalInOut(board.GPIO14)
spi_bus = busio.SPI(board.GPIO13, MOSI=board.GPIO11, MISO=board.GPIO12)

I also had Espressif generate a PID USB cod...

manic glacierBOT
manic glacierBOT
#

The build for the yd device completes without errors. I then flash the
firmware on the actual board, and then, nothing. No serial, no drive, it
makes my keyboard and mouse lag every few seconds, I have to disconnect the
board from my computer to keep working.

Where should I send my draft files?

On Wed, Dec 11, 2024, 16:12 anecdata @.***> wrote:

In what way does the built firmware not work... errors during build, no
serial, no CIRCUITPY, boot looping, etc.?

Perhaps...

manic glacierBOT
#

Yes, I've been using the codespace as suggested by @bablokb. I thought that building a firmware in the codespace build environment was the same as the automated system used by the Circuitpython community to generate the builds for every supported board. I looked at the firmware I got and compared it to the one from the Circuitpython download page with a hex editor, they are not the same at all!

lone axle
#

does LONGINT support work differently on raspberrypi ports than on others say atmel? i.e. if I made a build for an rp2040 device with LONGINT_IMPL = NONE in mpconfigboard.mk would it be expected to raise the same OverflowError: No long integer support that an atmel device would if too large of a value appears in the code?

fleet hollow
#

@onyx hinge I've been thinking about your comment on audiofilters.Distortion regarding BlockInput ticking here: https://github.com/adafruit/circuitpython/pull/9776#discussion_r1872006686. Would you like me to go ahead and add a blocks property to the class and handle the ticking of those objects just as synthio does? Or are we still debating the best way to approach this problem?

GitHub

New audio effects class, audiofilters.Distortion, to distort audio samples using one of the available modes available in the audiofilters.DistortionMode enum.
Todo:

Reduce floating point computat...

blissful pollen
#

@fleet hollow @onyx hinge Just a FYI I've seen the tags on github on a few audio things, just have not had time / brain space to keep up. If there is something you really need my eyes on just ping me here.

onyx hinge
#

@fleet hollow I don't know that they need a blocks property. But they need to call shared_bindings_synthio_lfo_tick once per 256 samples(*) to set the global data that causes synthio_block_slot_get to actually advance the LFOs that are used.

blocks is used as a way to tick blocks that aren't actually used by anything. or which aren't necessarily used by anything. So for instance if you wanted to have an LFO that is polled from CircuitPython code in order to set an LED color. Or, if you have an LFO that you want to keep advancing its phase regardless of whether it's associated with a playing note.

For the first case, having some object that is not a synthesizer/audio source at all might be the right solution.

For the second case, I don't know if that is applicable to the e.g., an audio echo effect.

(*) shared_bindings_synthio_lfo_tick could have a "number of samples" parameter added to the C function, so that you could calculate a different number of samples each time. Of course, since the arithmetic is all discrete you could get slightly different results from advancing LFOs by 256-sample@44.1kHz units vs advancing them at 256-sample@8kHz or 512-sample@24kHz rates...

manic glacierBOT
#

[copied from Discord]

I don't know that these other objects need a blocks property. But they need to call shared_bindings_synthio_lfo_tick once per 256 samples(*) to set the global data that causes synthio_block_slot_get to actually advance the LFOs that are used.

blocks is used as a way to tick blocks that aren't actually used by anything. or which aren't necessarily used by anything. So for instance if you wanted to have an LFO that is polled from CircuitPython code in ord...

lone axle
# tulip sleet It works the same

It would appear there is something strange going on with the build process perhaps. I am making builds for adafruit_feather_rp2040 and there doesn't appear to be a difference in the resulting build whether or not I have LONGINT_IMPL = NONE in the mpconfigboard.mk file. I noticed these outputs during the build show the exact same numbers whether or not I include that line in the .mk file

FLASH_FIRMWARE:      865904 B      1020 KB     82.90%

On both builds with and without that line I can open the repl and run this:

>>> 0xFF000000
4278190080

and get the same results. On a different device i.e. atmel with longint disabled putting this into the REPL results in the OverflowError.

I checked the hash of the firmware.uf2 with a make clean in between builds with this command and it outputs the same hash for both builds.

echo -n build-adafruit_feather_rp2040/firmware.uf2 | sha256sum 
7df4a376f4e0398b6add5f8b8b6f17cb4af6410b1a05656a7fc7c70f3d0b106d  -

I'll look a more into it tomorrow. Maybe I've somehow messed up my environment and it's not picking up changes to the mk file or something.

tulip sleet
#

so just change that and rebuild

#

after make clean

manic glacierBOT
#

I looked at the firmware I got and compared it to the one from the Circuitpython download page with a hex editor, they are not the same at all!

They will never be. The files on the download page are created from a specific commit, you are probably building from the current state of CircuitPython. Depending on what went in since the last official download version, the bleeding edge version might or might not work. But it will definitely be different.

Some things to check: size of the b...

#

I thought that building a firmware in the codespace build environment was the same as the automated system used by the Circuitpython community to generate the builds for every supported board.

This might or might not be true. The devcontainer-builds follow the instructions from the document linked in the post above by Dan. It is more or less only a scripting solution for the steps he describes.

The automa...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I don't know that these other objects need a blocks property. But they need to call shared_bindings_synthio_lfo_tick once per 256 samples(*) to set the global data that causes synthio_block_slot_get to actually advance the LFOs that are used.

blocks is used as a way to tick blocks that aren't actually used by anything. or which aren't necessarily used by anything. So for instance if you wanted to have an LFO that is polled from CircuitPython code in order to set an LED co...

#

@jepler I've taken some time to look into how the block ticking is actually handled, and I still don't think that the block system is ready to have this update to audioeffects classes.

audiocore.RawSample -> audiodelays.Echo -> audiobusio.I2SOut

In the example layout above, it would make sense to include shared_bindings_synthio_lfo_tick within audiodelays.Echo. Otherwise, synthio.BlockInput values would not be updated.

synthio.Synthesizer -> audiodelays.Echo -> a...
lone axle
# tulip sleet I think it is being overriden by the first line in `ports/raspberrypi/mpconfigpo...

I tried changing MPZ to NONE in ports/raspberrypi/mpconfigport.mk. With that change the build doesn't seem to succeed fully. There are some errors about mp_obj_int_get_uint_checked that don't get printed during a build without this change. The flash size table does get printed, and does show different sizes so it does seem that at least some parts of the build suceed.

arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: build-adafruit_feather_rp2040/shared-bindings/memorymap/AddressRange.o: in function `memorymap_addressrange_make_new':
AddressRange.c:(.text.memorymap_addressrange_make_new+0x32): undefined reference to `mp_obj_int_get_uint_checked'
arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: AddressRange.c:(.text.memorymap_addressrange_make_new+0x66): undefined reference to `mp_obj_int_get_uint_checked'
Memory region         Used Size  Region Size  %age Used
  FLASH_FIRMWARE:      853412 B      1020 KB     81.71%
             RAM:       61348 B       256 KB     23.40%
       SCRATCH_Y:          0 GB         4 KB      0.00%
       SCRATCH_X:          2 KB         4 KB     50.00%
collect2: error: ld returned 1 exit status
make: *** [Makefile:752: build-adafruit_feather_rp2040/firmware.elf] Error 1

However there is no resulting firmware.uf2 file that gets written.

tulip sleet
#

looks like memorymap is assuming longints (which it will certainly need), so you'll need to turn off memorymap too.

lone axle
#

I don't necessarily need to get a raspberrypi build without longints. It just happened to be one of the devices I grabbed to test something and I was perplexed by the results. The value in the port mk file taking precedence makes sense and solves what was the most mysterious part in my mind.

tulip sleet
#

ideally memorymap being on should be guarded to require longints

lone axle
#

ahhh, I see shared-bindings/memorymap... in there now. I'll try one with that turned off.

#

Yep, that did the trick and I do now have a successful build without longint that does behave the same as the others. Thank you!

manic glacierBOT
#

In either of the two examples above, the global block ticking variables (ie: uint8_t synthio_global_tick) would be updated by two separate entities

This is why the rule exists that a block can only be associated with one audio source and associating it with more than one audio source is an undiagnosed error or undefined behavior, however you want to call it.

Here's why (I think that) a single global tick is sufficient, given that rule: synthio_global_tick is only ever compared for e...

#

so with two synthesizers, a block used in synth A will see synthio_global_tick values like 0, 2, 4, ... and a block used in synth B will see ticks like 1, 3, 5, .... But it doesn't matter, since the tick value is always "different than the last time".

Why does the synthio_global_tick exist at all? So that synthio_block_slot_get knows whether it needs to call a particular block's tick or just return the old value. So for instance if you use the same LFO as the pitch bend of two notes,...

manic glacierBOT
#

@jepler I see what you mean and why the uneven synthio_global_tick values wouldn't make a difference.

I put in some work to separate those three global variables into a struct that is passed through to all necessary block functions: https://github.com/adafruit/circuitpython/compare/main...relic-se:circuitpython:local_block_ticking. I'm good to scrap this in favor of your approach.

I've also changed my mind on the 256 sample increments, and I think I'll make the audioeffects just tick ...

manic glacierBOT
#

@jepler I've updated shared_bindings_synthio_lfo_tick to support a variable number of samples and all audio effects to implement this call. I see there is a conflict with your PR, #9804 (https://github.com/adafruit/circuitpython/pull/9804/files#diff-8b26aff15abcdd9f17032d54412d3c7eda19e104eb216351be5836a441a97f83R244). Let me know how we'd like to handle that situation (I'm not ticking block biquads within this PR, btw).

I've tested the following script with and without the update and ca...

manic glacierBOT
#

I've moved the block value calls around in order to force SYNTHIO_MAX_DUR intervals within the audio effects buffer loop. This fixes the large buffer issue. Here's another example to demonstrate this:

import audiobusio
import audiocore
import audiofilters
import board
import synthio

audio = audiobusio.I2SOut(
    bit_clock=board.GP0,
    word_select=board.GP1,
    data=board.GP3,
)

wave_file = open("StreetChicken.wav", "rb")
wave = audiocore.WaveFile(wave_file)

imp...
slender iron
#

@tulip sleet I wrote the tlv stuff. I'd say strip what needs to be stripped to work on CP. We always have the original version

manic glacierBOT
#

I would instead / or additionaly like to see a "maxcol" and "maxline" setting/style.
Lately, I have been working on a project with an "Adafruit Qualia ESP32-S3 for TTL RGB-666 Displays" board.
And "struggle" with the serial output of the different LCD panels.
"Somewhere" is the information about the currently used font and also the information about the currently connected LCD panel.
Bringing this together would be helpful!

slender iron
#

@tulip sleet now I remember the fancy typing stuff was a pr by someone

tulip sleet
#

hah, I had to just throw it all out. Getting closer. Now on AES fixups.

#

I am thinking that maybe there might be a separate Adafruit_CircuitPython_MiniCircuitMatter library that stays pruned, so the other one can be fancier or have better type checking.

manic glacierBOT
manic glacierBOT
#

generally super long lines are considered bad for readability

Well, the messages are long anyway, except its scroll able right now.
It doesn't wrap lines/break the lines.

So removing the max width has no downside, other than having it be able to display longer lines if your screen width is wider..
Your point would only make sense if the console had wrap lines enabled, which it doesn't.

image

tulip sleet
#

@slender iron There are a couple of places in session.py which use a fixed nonce for encrypting with AESCCM, e.g.

        s2k_cipher = AESCCM(
            s2k,
            tag_length=crypto.AEAD_MIC_LENGTH_BYTES,
        )
        sigma2.encrypted2 = s2k_cipher.encrypt(b"NCASE_Sigma2N", bytes(tbedata.encode()), b"")

Do you remember this? The doc says never ever reuse a nonce, so was this meant to be just temporary?

keen jay
#

Hi everyone. I'm not sure if this is the right channel to use, but I've started working on French translations and I had a question about how to proceed if I noticed there were potential inconsistencies in tone or nomenclature with certain previously translated strings. In such cases, should I just add comments on the relevant string/glossary page or should I just go ahead and replace?

tulip sleet
keen jay
#

Of course. One good example is regarding "safe mode". It was previouly translated as mode sûr, however this doesn't reflect the way safe mode is translated currently. Windows has been using the phrase mode sans échec, which better describes what that mode entails. Another example would be the currently registered glossary term for "in use". Currently, the selected translation for that word is "utilisé". Without context, this connotes past tense. "En utilisation" would be more apt

#

(granted, I understand that there are several ways to approach this)

tulip sleet
#

"le truc est en utilisation" et pas "le truc est utilise'" ?

#

are there academie francaise guidelines for CS techinical terms, or are they useless or ignored?

keen jay
tulip sleet
#

The previous translators were @ajs256 and @lisapple.

keen jay
#

Also, I really must say here that I am not trying to criticize or undermine anyone

tulip sleet
#

no, not at all. I am an low-ish intermediate French speaker, but I know that there have been tussles about what terms to use when: e-mail, courrier, etc.

#

One issue has been that French is one of the most verbose translations, just due to the nature of French, so there may have been some effort to make the translations shorter.

#

You don't need to apologize at all. I am just trying to figure out if there's any guidance at all that we could point to.

keen jay
tulip sleet
#

If a single translation causes a build to be too big, we shrink the build (often by turning off features) for everyone, so we don't favor one language over another.

keen jay
tulip sleet
#

if you see inconsistencies, it's fine to rectify those. Alsowhen words are reused, it makes the translation smaller. The two previous translators I know of: one is in the San Francisco Bay Area, but could be a native speaker, and the other is in France. And you are in Quebec?

keen jay
tulip sleet
#

we coudl have a a quebecois translation, but that's more work. We recently took a vacation to QC and I remember some podcasts that dicussed a few computer terms that differed from Metropolitan French.

keen jay
tulip sleet
#

@jaunty juniper here is in France, and you might bounce things off him if that would be helpful.

There is even an "en_gb" translation, which is almost the same as the en_us, but has a few spelling differences.

We are very grateful for you working on the translation! I don't want to hold you back at all. It would be nice for it to be more complete.

keen jay
#

Excellent. I'll send them a message!

tulip sleet
#

I would say if you find that the QC nomenclature is noticeably different than Metropolitan, we can start a new translation. But start out with the current one and see how it goes.

keen jay
#

Sounds good!

slender iron
tulip sleet
#

I will move on in any case.

keen timber
#

Hi all! Trying to drive a coin hopper and quite new to this. Just wanted to see if this wiring seems correct. I’m hoping to use the Adafruit Funhouse (https://learn.adafruit.com/assets/102128) for driving it.

Pin 1 Supply - Using external power supply (positive)
Pin 2 Ground (0v) - Using external power supply (negative)
Pin 3 Motor on +ve - Use A0 - VCC
Pin 4 Motor on -ve - Use A0 - A0 pin (use CircuitPython to set pin direction to INPUT and then Pull.UP

Some additional info from the hopper’s datasheet is here, thank you so much:

Provide Pin 1 with 24vDC and Pin 2 with 0v constantly.

Motor On+ should be pulled high to a reference voltage of between 5vDC and 12vDC for interfacing ‘directly’ with host machine control circuitry. If connection of Motor On+ to a higher voltage is desired, then use of a pull up resistor is recommended to limit the current to between 8mA and 23mA. To drive the hopper the host machine must pull Motor On- down to below 1.0v DC. This can be achieved by use of a switch, relay or open
collector transistor.

austere acorn
keen timber
digital shoreBOT
#
adafruit
Owner

.adafruit

Members

38,538

Roles

36

Category Channels

8

Text Channels

64

Voice Channels

7

Threads

11

Boost Count

20 Boosts (Tier 3)

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

And "struggle" with the serial output to the different LCD panels. "Somewhere" is the information about the currently used font and also the information about the currently connected LCD panel. Bringing this together would be helpful!

I don't know if this addresses the issues you're having, but this code has helped me deal with different display dimenstions:

import board
from displayio import CIRCUITPYTHON_TERMINAL
from terminalio import FONT

height = round(board.DISPLAY.heig...
lone sandalBOT
shut copper
#

In the https://circuitpython.org/contributing/library-infrastructure-issues page there is an initial section titled "A programmatic error occurred"
All of those CI builds appear to be passing. Setting up the adabot locally as it looks like this output may come from there, although at current gtihub API rate limiting this may take days to run. Am I looking in the right area? Or where can I see what those programmatic errors might be?

manic glacierBOT
#

Sorry to bring this back up. I am getting OSError(s) from this device in the latest Circuit Python.

Adafruit CircuitPython 9.2.1 on 2024-11-20; Adafruit Feather ESP32S3 4MB Flash 2MB PSRAM with ESP32S3

I am seeing 1-2 errors per minute if I read at 1hz from the device. I added retry code to the read and write functions in the library and that mostly fixes it, but I occasionally see >10 errors when reading, which causes a crash. Do I need to update something to help with this?

manic glacierBOT
manic glacierBOT
#

Sorry, I should have been more specific, the code crashes after 10 errors because I told it to retry 10 times and then raise the error if that doesn't fix it.

When looking at this a bit more, I am actually reading from the device once ever .2 seconds, or 5Hz. This is still not that fast, but might be faster than the device is capable of? I slowed it down to 1Hz, and the errors still occur, but less often. I still see the errors once every few min. A pared down version of the code that caus...

manic glacierBOT
#

True. In the case of my program (a more complicated version of what I shared above), I have a bunch of other things going on and I don't want the sensor read functions to block for 1 second or it will mess up the timing of the rest of the code. It appears that adding in the 10 retries as I have shown above catches most issues. I coupled that with a try/except in the cell_voltage and cell_percent functions like this:

    @property
    def cell_voltage(self) -> float:
      ...
onyx hinge
#

ERROR_OUTPUT_HANDLER = "A programmatic error occurred"

#

I don't think there's anything you can do about it as a contributor. @lone axle might be able to put it on a list to check.

pallid creek
#

What is the single source of truth for CircuitPython boards? I’d like to make a tiny search page for boards so you could look for , say, all boards with an SD card and get code snippets to use them. Similar to the main boards page. https://circuitpython.org/downloads

#

Is there a JSON file or similar for each board in a repo somewhere ?

jaunty juniper
#

it's not a very detailed list of features

#

like SD card is not part of the listed features

manic glacierBOT
manic glacierBOT
orchid basinBOT
lone axle
# shut copper In the https://circuitpython.org/contributing/library-infrastructure-issues page...

Some of the ones listed on that page can be tricky to troubleshoot due to the tooling being set up to run on everything at once. For any individual issue on that page the easiest way to learn about what it is indicating is to grep for the message on the page inside of the adabot repo. i.e. git grep -n "A programmatic error occurred" will find the area of code inside adabot that generates that portion of the page, from there you can trace it backwards to find the failing conditions that led to it's inclusion.

For the API rate limit thing, the limit is much lower for anonymous requests with no token associated with them. If get a github API token for your account and make an environment variable named ADABOT_GITHUB_ACCESS_TOKEN with your token as the value, then run adabot in that environment it will use your token for the requests which raises the limit high enough that it can finish running locally in a more reasonable time.

thorny jay
# tulip sleet we coudl have a a quebecois translation, but that's more work. We recently took ...

I am French speaking Belgian... my feeling is that in Belgium we use more English words for IT stuff than what French would use.
Also I learned about computer reading the English manual of my ZX81 first computer... and when I started to use the internet, the internet was only in English while French people were still on the "Minitel" (A kind of state sponsored BBS on dump terminal).
I am not sure a Belgian-French (like my AZERTY keyboard) would make a lot of sense... but I would sure enjoy reading a diff between French-French and Quebec-French. 😉

manic glacierBOT
#

CircuitPython version

S3 Bucket: 2024-12-06T15:01:20.000Z adafruit-circuitpython-adafruit_matrixportal_s3-en_US-20241206-main-PR9873-c41d452.uf2:
Adafruit CircuitPython 9.2.1-26-gc41d4527b1 on 2024-12-06; Adafruit MatrixPortal S3 with ESP32S3

Artifact from #9889:
Adafruit CircuitPython 9.2.1-33-gbb49f770a1 on 2024-12-15; Adafruit MatrixPortal S3 with ESP32S3

Code/REPL

import board, displayio, framebufferio, rgbmatrix

displayio.release_displays()

...
onyx hinge
#

<@&356864093652516868> Howdy friends! We're about 35 minutes away from our last meeting of the year. Join us in the CircuitPython voice chat, and add your notes to https://docs.google.com/document/d/1aGwPWHpPvQm2wmEwwj1MR9NBBY96ah5IbBDRB9N8zag/edit?usp=sharing

onyx hinge
#

sure can

manic glacierBOT
turbid radish
random junco
manic glacierBOT
#
[adafruit/circuitpython] New branch created: revert-9865-rgbmatrix-cleanup-failure
slender iron
#

thanks everyone!

onyx hinge
#

thanks @lone axle !

slender iron
#

happy holidays

lone axle
#

Thanks everyone, have a good week!

wraith crow
#

☝️

manic glacierBOT
lone axle
#

Here is the notes doc for the next meeting https://docs.google.com/document/d/1f2Em2jVmoOt-aoOyxfzj5u1yUQXcxz6sGIjCWcWIAHY/edit?usp=sharing It will be held on January 6, 2025 at the usual time of 2pm US Eastern / 11am US Pacific. Enjoy the next couple of weeks off, and we hope to see you for the next meeting on January 6th! <@&356864093652516868>

manic glacierBOT
#

I think i've tried all possible ways to flash the firmware and it won't boot.

So went back to Arduino IDE to restore the original factory sketch hoping that may help. Upon doing so i've noticed that Arduino IDE board info outputs the following:

BN: LilyGo T-Display
VID: 0x1A86
PID: 0x55D4
SN: 5864031904

Well, i tried flashing "TTGO T-Display ESP32 16M" CircuitPython 9.2.1 firmware and it booted up all the way into REPL being available over USB serial. Sure, the screen and probably...

#

Well... This artifact doesn't have Dan's USB fix so maybe that's contributing to this latest behavior, but using this artifact, when I don't have the USB cable connected the matrix doesn't initialize, and if I disconnect the USB cable while the RGB matrix is active the board appears to crash (it's hard to tell exactly what's happening since the USB port isn't working for terminal or CIRCUITPY use without Dan's fix).

I've recently replaced my computer and perhaps this is an excuse to test a...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Some MIDI controllers expose more than one MIDI interface, and I need to recreate that using Adafruit_CircuitPython_MIDI.

https://github.com/adafruit/circuitpython/blob/79fd8b7efcbceaa87456a971af8e1692e58807c2/shared-bindings/usb_midi/PortOut.c#L21-L24 says

//| """You cannot create an instance of usb_midi.PortOut.
//|
//| PortOut objects are constructed for every corresponding entry in the USB
//| descriptor and added to the usb_midi.ports tuple."""

...

tulip sleet
#

@slender iron my TLV issues may be do to tag ordering. Mine may be different due to lack of __mro__ and vars() in CPy. Still looking at that.

In the Matter TLV spec, they specify a canonical ordering:

A.2.4. Canonical Ordering of Tags
Where a distinguished ordering of tags is required (e.g. for the purposes of generating a hash or
cryptographic signature of elements within a structure), the following ordering rules SHALL be
used:
• Anonymous tags SHALL be ordered before all other tags.
• Context-specific tags SHALL be ordered before profile-specific tags.
... [ etc.]
Are you enforcing this in some way? I don't see that, but might have missed something.

#

@slender iron also, I'm getting different results when doing .encode() vs .encode_into(). e.g. in test_chunked_message.py, I was doing .encode() to just check the encodings, and saw that in test_only_one() .encode() produced:
15-00-36-00-04-00-04-01-04-02-04-03-18-28-02-24-ff-0b-18
but .encode_into() produced
15-36-00-04-00-04-01-04-02-04-03-18-28-02-24-ff-0b-18.
The second byte 00 is not in the latter. The way you go through the pieces is different. Not sure if this is a bug or just a difference. I'll look further.

manic glacierBOT
#

The current MIDI descriptor we use is here: https://github.com/adafruit/circuitpython/blob/main/shared-module/usb_midi/__init__.c

To construct this dynamically would be a lot of code, and would not fit on some smaller boards that currently provide MIDI. An alternative would be to let the user supply their own descriptor, or some part of it. We allow that for custom HID devices.

If you could record and supply the fancier USB MIDI descriptor from an Arturia device, that would be helpful. ...

shut copper
#

I went on a journey to understand the example naming rules based on the https://circuitpython.org/contributing/library-infrastructure-issues page and the Good First Issue to begin contributing. And that all led to these repos in the list of missing sensor/library name:
https://github.com/adafruit/Adafruit_CircuitPython_Requests
the examples directory consists of more directories, however each directory contains correctly named files, i.e. requests_xxx.py
https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI
here there is a mix of directories and files, although again all the example .py files are correctly named.
https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout
again flagged although all naming appears correct.

That led me to adabot, and a dive into the ruleset enshrined in the code. So I can see why these are getting flagged and it is a pretty simple fix to make this work accordingly. However after testing these three now passed but these new ones now failed:
https://github.com/adafruit/Adafruit_CircuitPython_TestRepo
This one is interesting because the repo says it exists to test adabot, and the naming used is example directory named testrepo_xxx but it seems the content of the directory does not conform to the naming rule of testrepo_xxx.py.
https://github.com/adafruit/Adafruit_CircuitPython_Radial_Controller
This one too has directories named radial_controller_xxx containing anything goes .py files.

So which ruleset is correct or should both be correct?

lone sandalBOT
manic glacierBOT
manic glacierBOT
#

Thanks @dhalbert. All I am looking for is to have 2 MIDI PortIn and 2 PortOut instead of 1 each, on the Pi Pico.

Currently I have:

midi = adafruit_midi.MIDI(midi_in=usb_midi.ports[0], midi_out=usb_midi.ports[1], in_channel=0, out_channel=0, in_buf_size=512, debug=debugging_on)

I would like to add:

midi1 = adafruit_midi.MIDI(midi_in=usb_midi.ports[2], midi_out=usb_midi.ports[3], in_channel=0, out_channel=0, in_buf_size=512, debug=debugging_on)

So are you sayi...

still zephyr
#

Hello I am in the process of archiving some old repos that I am not longer maintaining. What would be the process to remove them from the community bundle library? Thanks

manic glacierBOT
tulip sleet
manic glacierBOT
slender iron
tulip sleet
slender iron
slender iron
#

__mro__ handles inheritance I think too

tulip sleet
still zephyr
tulip sleet
lone axle
#

Indeed, I think if you submit a PR to the bundle removing the submodule of the library and it's entry in the list file the rest should get taken care of automatically after it's merged.

still zephyr
#

Yes the problem is I not sure how to remove the submodule☺️. Ill google it or copilot it 😇

lone axle
# shut copper I went on a journey to understand the example naming rules based on the https://...

I'm not entirely sure what the specific rules around directory name vs. filename and their usage of library name prefix. The .py files should generally be prefixed with the library name because there are some tools that assume that will be the case, though I'm not sure what all of them are specifically. Directory names, and names of files inside the directory I don't know about for certain.

the rotary controller one, I think your instinct about why it's flagged is correct. these files https://github.com/adafruit/Adafruit_CircuitPython_Radial_Controller/tree/main/examples/radial_controller_rotary_trinkey are named boot.py and code.py as a sort of "full set" of files that can be copied to the device to make it do it's thing.

I don't think there are a whole lot of libraries where we'd have that "full set" checked in to the repo, but in some cases like this one it does make sense and I'd be inclined to say the tooling should allow it. However I don't know of / what other ramifications it could cause. As long as care is taken to check on the relavent guide pages that could embed this code and make sure they continue to work and show the appropriate code I think it would be okay to change it so that this issue won't get flagged in the report.

slender iron
#

@tulip sleet you setup o test usb host? My guess is that the memory protection is causing an issue on the second core

tulip sleet
#

I can also test it on an RP2350A

slender iron
#

Either should be fine. I doubt it is pin specific

tulip sleet
#

maybe what you suggest or is it using high-bank pin numbers?

#

I have to look...

#

uses GPIO 32, 33

onyx hinge
#

I think PIO support for high GPIOs in CircuitPython was a "?". I never tested it.

slender iron
#

Ah that could be the problem too. Worth verifying it works on lower pins first

lone axle
tulip sleet
lone axle
#

It's got a big list of indivuduals and adafruit-adabot. These are probably also a member of circuitpython org. I wonder if it's possible to make the team a member of both orgs

tulip sleet
#

I think the scope of a team is an org, but we could make an identical team

#

but has to be maintained by hand

#

@lone axle I'm confused:

# check if it's a wildcard import e.g.
                # from module.submodule import *
                if cur_import.name.endswith(".*"):
#

but it's looking for .*, not just *

#

or <whitespace>* (use a regexp for that)

stuck elbow
#

@lone axle you know that split takes an optional argument that tells it how many times to split, and also there is rsplit that goes from the right side?

#

so you can do things like if "foo.py".rsplit('.', 1)[-1] == 'py':...

tulip sleet
#

I was confused because I thought it was literally trying to match the string from module.submodule import *.

lone axle
#

rsplit I think maybe I knew about, but don't often think to use it in the moment. optional args for split I did not know, that is handy. Thank you.

tulip sleet
#

so the comment made me more confused 🙂

lone axle
#

Would it be good to add more details to the comment about how findimports transforms the import string?

tulip sleet
#

You could just say "findimports may return an import like foo.bar.*

manic glacierBOT
#
#

I'm looking at https://www.raspberrypi.com/documentation/pico-sdk/hardware.html.

Defining the interrupt handler explicitly in your application (e.g. by defining void isr_dma_0 will make that function the handler for the DMA_IRQ_0 on core 0, and you will not be able to change it using the above APIs at runtime). Using this method can cause link conflicts at runtime, and offers no runtime performance benefit (i.e, it should not generally be used).

audio_dma.c uses the global routi...

slender iron
#

@tulip sleet did you try usb host yet?

tulip sleet
#

Sometimes it works, sometimes it doesn't.

#

@slender iron a USB Host Feather RP2040 is working, but when I try a jumpered USB socket on different pins on the same board, I get RuntimeError: usb_host in use even after a power cycle

#

aha, ok, it's hardwired in board.c to construct the usb_host object in advance

#

I'll use a regular RP2040 Feather to test that

#

ok, got that working.

#

@slender iron ok got test program working on D10 and D11 on a Feather RP2350

#

Metro will arrive this afternoon, and I'll test

slender iron
#

Ok nice! Metro issue must be the high PIN numbers

mortal kernel
#

@danh Are you testing with SDK 2.1? There are a number of changes there to high numbered pins on the RP2350.

tulip sleet
#

but we haven't moved forward yet

mortal kernel
tulip sleet
#

I reverted 9659 on the tip of main and gave that to Limor to test. But I just got the Metro board myself and will do some more testing.

#

we may still be assuming something incorrect in pio about the pin numbers

#

I was going to test host usb, and then test simple PIO stuff on higher-numbered pins (neopixel would be an easy test)

mortal kernel
tulip sleet
#

i have that board, but now I have the 2350B metro too, and it's a lot easier to get to the n>31 pins. I don't have a breakout cable for the SP/CE connector, just the connector to the wifi addon board.

#

also I bought the 2350B PGA board, and then realized just today it has no USB connector 😦

#

too much trouble to wire it up and UPS was delivering the metro today anyway

mortal kernel
#

Let me know if there's any way I can help.

manic glacierBOT
#

Added the following boards:

  • waveshare_rp2350_geek
  • waveshare_rp2350_lcd_0_96
  • waveshare_rp2350_lcd_1_28
  • waveshare_rp2350_one
  • waveshare_rp2350_plus (no longer carry 16MB variant, only 4MB)
  • waveshare_rp2350_tiny
  • waveshare_rp2350_touch_lcd_1_28
  • waveshare_rp2350_zero

Beyond moving from the RP2040 to RP2350 and a few flash memory module changes, the modifications to these boards were minimal and most of the code here is ported from their relevant RP2040 v...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.2.1 on 2024-11-20; Adafruit Metro ESP32S3 with ESP32S3

Code/REPL

from alarm import exit_and_deep_sleep_until_alarms
from alarm.time import TimeAlarm
from time import monotonic

def main():
    # This will run each time the board wakes from deep sleep.
    print("I woke up")
    seconds = 8
    ta = TimeAlarm(monotonic_time=monotonic() + seconds)
    exit_and_deep_sleep_until_alarms(ta)

main()

...

manic glacierBOT
#

TL;DR: I suspect there are two related problems: 1) a series of deep sleeps may not allow enough non-sleeping time for USB to enumerate, and 2) CircuitPython's mechanism for simulated deep sleeping does not seem to reliably re-activate when the board has been real deep sleeping on battery power and then gets re-connected to a USB port.

Long version... Using the code below for code.py lets me jumper A3 to GND with a wire to get a loop of ESP32 light sleep. With the jumper disconnected, it d...

manic glacierBOT
manic glacierBOT
mortal kernel
#

@danh Would you like me to pick up #9897?

manic glacierBOT
tulip sleet
# mortal kernel @danh Would you like me to pick up #9897?

I was going to work on this myself or as @onyx hinge about it, but your help or doing it would be welcome, if you think it's not a big job. Do you feel you already have experience on this, or have studied it? It's needed to get USB Host to work on the upcoming Metro RP2350B. It's more than just making things uint64_t.
I looked at https://github.com/micropython/micropython/pull/15619.
RP2350 adds GPIOBASE to PIO to specify whether to start pin numbering at 0 or 16, so you can use pins 0-31 or 16-47. In MicroPython, this setting is exposed directly. I think we could instead determine the setting by examining the specified pins in the constructor (and complaining if they're out of range).

There are also some include paths with /rp2040/ in the current impl, and I haven't looked at what should be done with those.

manic glacierBOT
mortal kernel
onyx hinge
#

@tulip sleet I would prefer to avoid having users manually track whether they're using the "high" or "low" pins. The sdk structures will track which banks in the pinhi field of pio_sm_config. we can check for configurations that span banks with code similar to the parameter checking there ... ```c
#if PICO_PIO_USE_GPIO_BASE
uint used = (~config->pinhi >> 4) & PINHI_ALL_PIN_LSBS;
// configs that use pins 0-15
uint gpio_under_16 = (~config->pinhi) & (~config->pinhi >> 1) & used;
// configs that use pins 32-47
uint gpio_over_32 = (config->pinhi >> 1) & used;
uint gpio_base = pio_get_gpio_base(pio);
invalid_params_if_and_return(PIO, gpio_under_16 && gpio_base, PICO_ERROR_BAD_ALIGNMENT);
invalid_params_if_and_return(PIO, gpio_over_32 && !gpio_base, PICO_ERROR_BAD_ALIGNMENT);

tulip sleet
onyx hinge
#

in fact I guess we can just check for return of PICO_ERROR_BAD_ALIGNMENT and say "you can't mix pins GPIO0..15 with pins GPIO33..47"

tulip sleet
#

@onyx hinge how do you feel about working on this? Maybe it is a quick job for you, but also you may be taking time off?

onyx hinge
#

@tulip sleet I'm working regular-ish hours through the end of this week anyway. but I'm not sure where the priority lies between this & my pi5 rgbmatrix work.

tulip sleet
#

let's ask "management"

onyx hinge
#

I could sure spend an hour on it once my metro arrives later today though

tulip sleet
#

i have little experience with PIO or its impl, except to change neopixel timings

manic glacierBOT
#

I fear this turns out to be a bit wrinkly. I have a jumble of thoughts:

  • GPIO base is per PIO, not per SM. So, we have a new problem when allocating SMs, that we have to know whether we want the high or low bank and whether a PIO has any other SMs associated with it. (pico-sdk solves this by requiring the PIO base register be set before calling pio_sm_set_config and erroring if it clearly doesn't match)
  • There's an inherent ambiguity: On rp2040 & rp2350A, having a pin base of 20 and a c...
#
  • here's an inherent ambiguity: On rp2040 & rp2350A, having a pin base of 20 and a count of 20 addresses pins 20..31 & 0..7 (wrap around arithmetic). on 2350b, should this address 20..39 or the same pins as on 2040?

GPIOBASE can only be 0 or 16. From the datasheet description on GPIOBASE

Relocate GPIO 0 (from PIO’s point of view) in the system GPIO numbering, to access more than 32 GPIOs from PIO.
Only the values 0 and 16 are supported (only bit 4 is writable).

tulip sleet
#

@onyx hinge I had a misunderstanding above. I'll delete that. Don't bother to reply.

#

pin base is not GPIOBASE

onyx hinge
#

I may be confused too, we'll see

tulip sleet
#

@onyx hinge we could add an arg to specify GPIOBASE, defaulting to 0. So that would specify the low wraparound (or not) on the RP2350B too, if I understand correctly. Then it's just something to document. As to whether the PIO is set to 0 or 16, that's a matter of bookkeeping, and makes finding a free SM a little harder, but still possible.

#

Maybe on RP2350A, specifying GPIOBASE=16 should just be an error? I don't see that there's a use for that.

#

is the register avialable on RP2350A?

onyx hinge
#

No, not available

#

Nor on rp2040

tulip sleet
#

maybe the arg is a bool: allow_high_gpios or use_high_gpios or some name like that.

onyx hinge
#

gpiobase: Literal[None, 0, 16] = None (meaning infer from arguments)

#

and only 0/None are accepted if you're not on 2350B

tulip sleet
#

what is the max number of consecutive pins that can be used?

onyx hinge
#

[and I think that None should result in 16 for the "does it wrap or not" case]

#

32

#

this will be constructor argument #41 😭

tulip sleet
#

so if the first pin is 8, what is the last pin if you ask for 24 pins on RP2350B. GPIOBASE has to be zero.

#

on RP2040 the last pin is 0

onyx hinge
#

from what I understand it would be 0 on RP2350B as well, (8+24)%32 + GPIOBASE

#

I wonder if that's accepted or rejected now. I honestly don't think that's something anyone DOES on purpose. unless you stuck yourself with a real bad pinout and that was your only way out

#

especially since what, 29 through 31 don't actually have IO pads on 2040? but they do on 2350B

#

and on pico W you'd be stomping on the wifi chip pins

tulip sleet
#

i don't see that said explicitly in the datasheet, hmm. I looked for all instances of GPIOBASE. I think maybe it could be inferred. Not saying you're wrong, just trying to find something clear.

onyx hinge
#

I think this wraparound case is "here's something the hardware happens to do", not "this is a honking great idea"

tulip sleet
#

it's a hack. They should have made the bit registers 64 or 128 bits wide in RP2040

#

(and not implement the upper parts)

onyx hinge
#

Relocate GPIO 0 (from PIO’s point of view) in the system GPIO numbering
I'm saying that based on this sentence (though I thought there was a figure)

onyx hinge
#

the PIO instance either addresses pins 0-31 or 16-47 based on \ref pio_set_gpio_base

onyx hinge
#

widening everything to 48 or 64 bits must have taken too much area or made them miss timings or something

tulip sleet
#

so "infer" above means if the base pin is >=16, then set GPIOBASE? Is the number of pins in the arguments or only in the program?

onyx hinge
#

"pio_claim_free_sm_and_add_program_for_gpio_range" oh goodie

tulip sleet
#

I am worried about inferring.

#

being ambiguous

#

does the PIO program itself know the base pin, or are its pin numbers all relative to the base pin set up in the SM registers?

#

i.e. do you have to write a different program if GPIOBASE is 16 vs 0?

onyx hinge
#

there are 3 PIO blocks each with 4 State Machines. GPIOBASE is per PIO. There are also the "{in,out,set, sideset}" bases & counts that are per state machine. When your program says "nop side 0", the affected pin(s) depend on the PIO GPIOBASE, the SM sideset base, and the SM sideset count.

#

same for an out instruction, it depends on the PIO GPIOBASE, SM out base, and SM out count.

#

wait gpio depends on PIO GPIOBASE but not any SM base register

tulip sleet
#

so the neopixel program is the same in all cases, you just need to set the base to be the neopixel pin and the count is 1

onyx hinge
#

yeah, and because there's just 1 pin there's no worry about the wrapping

#

say the actual pin is 24, you could put it in a PIO with GPIOBASE=0 and set the sideset base to 24, or GPIOBASE=1, sideset base 8

tulip sleet
#

so when you say "infer", how would it determine the GPIOBASE? Clearly if the pin# is >31, it's 16. But if the base pin is >=16 but the base_pin + count is >31, then it's ambiguous.

onyx hinge
#

Suppose my imagined gpiobase constructor parameter for StateMachine is the default, None, and you have a base < 32 and base+count >=32, then it would choose gpiobase 16, because I don't mind making the person who wants wraparound behavior ask for it

#

as a not entirely unconnected thought, how do you write in CircuitPython "if the pin's number is >= 16"? I don't think you can?

tulip sleet
#

I am thinking just make the default be 0, and allow 16 on RP2350B, and complain starting pin is out of range.

#

but don't provide None

onyx hinge
#

there's the connection, you found it

#

you're writing generic library code that a user will pass some pins into, how do you know what value for gpiobase?

tulip sleet
#

bleh, I see

onyx hinge
#

there are around 32 uses of StateMachine constructor in the adafruit bundle

#

gpiobase=None seems like the best shot at compatibility before/after adding support for these high gpios without adding complications to every StateMachine user. So maybe: don't add gpiobase= now, implement only what gpiobase=None would give you and add gpiobase=0/16 later if needed. along with "here's how to get a pin number, officially"

tulip sleet
#

re the huge number of args, many are defaulted, right? Could have a "Config" data class that doesn't take zillions of args, and gets passed to constructor, or has a factory function. Not sure that huge number of args is any better than setting a bunch of attributes.

#

or maybe we need a Python wrapper that makes the setup easier instead of putting it all in C

onyx hinge
#

and so this hypothetical person who had a bad design based on rp2040 that needed wraparound, re-spun it with an rp2350b, but didn't change the pinout and didn't otherwise use the new GPIO30 & GPIO31 (since wraparound is stomping these pins) can contribute support for gpiobase=0 to force their compatible wrapping for their very dubious design

#

Yes most of the arguments are defaulted

#

and many more are automatically determined by pioasm and passed via **pio_kwargs

tulip sleet
onyx hinge
#
        self._sm = rp2pio.StateMachine(
            program.assembled, 
            frequency=125_000_000,
            first_out_pin=first_pin,
            out_pin_count=14,
            auto_pull = True,
            pull_threshold=14,
            **program.pio_kwargs)

a typical constructor call uses only a few of the parameters

#

(and "more modernly", out_pin_count and following parameters can ALSO come from pio_kwargs; so it's not that bad from the coder's point of view)

tulip sleet
#

the main thing right now is just to support the usb host pins. another use might be sdio on the Sd card pins, which also spill into the upper pins

onyx hinge
#

though we don't have sdio support in circuitpython at all yet, so 🙂

#

our sdk does have pio_claim_free_sm_and_add_program_for_gpio_range so yay

tulip sleet
#

so you don't really even need to add the arg right now, you can infer from the base pin

#

and that would be documented and that's that for now

#

maybe I would say base pin must be >=32 to cause GPIOBASE=16

#

add the case like 16+10 would just default to the wrap behavior for now. Eventually someone will be using something like the PGA2350B and complain.

onyx hinge
#

turns out we already always rejected wraparound. ```#define NUM_BANK0_GPIOS _u(30) // pico-sdk rp2040

// our code
static uint64_t _check_pins_free(const mcu_pin_obj_t *first_pin, uint8_t pin_count, bool exclusive_pin_use) {
uint64_t pins_we_use = 0;
if (first_pin != NULL) {
for (size_t i = 0; i < pin_count; i++) {
uint8_t pin_number = first_pin->number + i;
if (pin_number >= NUM_BANK0_GPIOS) { mp_raise_ValueError(MP_ERROR_TEXT("Pin count too large"));
}

So base=8, count=24 would error when it got to checking pin 30
#

so no worries about preserving that behavior yay!

tulip sleet
onyx hinge
#

"free" still is feeling like at least an afternoon's work but it's all good 🙂 not being tied by this past weird behavior I only dreamed up is good!

manic glacierBOT
fleet hollow
#

I'm working on creating a new audio input class which works with the audiosample API. When debugging an instance of the class (with CIRCUITPY_AUDIOCORE_DEBUG enabled), I can run audiocore.get_structure(audio_in) and audiocore.get_buffer(audio_in) without any issue, but audiocore.reset_buffer(audio_in) throws the following error: "TypeError: '' object does not support 'protocol_audiosample'". They both call mp_proto_get_or_throw(MP_QSTR_protocol_audiosample, sample_obj), but I don't know why reset_buffer specifically wouldn't work here. I'm thinking the empty object qstr might be a clue, but the object name works in other cases (ie: print(audio_in)). Any leads I could follow?

blissful pollen
fleet hollow
blissful pollen
#

If the code is somewhere I could take a look (likely later today). My most common method is just using printf debugging too, if you know how to do that in CP?

fleet hollow
fleet hollow
blissful pollen
fleet hollow
blissful pollen
#

I can't spot anything with a quick glance now, but my guess is for some reason it is coming in NULL.

And great!

manic glacierBOT
shut copper
manic glacierBOT
lone axle
onyx hinge
#

@fleet hollow huh did you figure out a cause? it works here (CircuitPython 9.2.1-19-gb5c38c2600-dirty on 2024-12-04) with a RawSample. I do notice that the tests don't seem to ever call audiocore.reset_buffer though. ```>>> a = audiocore.RawSample(b'123')

audiocore.get_structure(a)
(1, 0, 3, 1)
audiocore.get_buffer(a)
(0, <memoryview>)
audiocore.reset_buffer(a)

fleet hollow
#

@onyx hinge The problem was with the specific class I was working on. I have already fixed it (but stumbled onto other issues, of course). Ended up being a bad pointer when setting up audio dma. 🤷

onyx hinge
fleet hollow
onyx hinge
blissful pollen
fleet hollow
olive vessel
#

slowly but surely I am making progress on this port for an STM32L433-based board. At @tulip sleet's prompting I connected an STLINK and managed to step debug my way towards solving a few issues with the flash setup and pin mapping. I have reached the end of main.c and it looks like CircuitPython is running with no faults, but I am not seeing a CIRCUITPY drive on my machine. I've enabled CIRCUITPY_USB_MSC so I am not sure what's up, esp since I'm not seeing a fault and the device isn't in safe mode. My port is here: https://github.com/blues/circuitpython/tree/blues_cygnet/ports/stm/boards/cygnet. Is there anything I've missed in mpconfigboard.mk or any other reason this would be the case?

GitHub

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

manic glacierBOT
manic glacierBOT
onyx hinge
#

hmmm gcc doesn't seem to warn about this. There's a diagnostic -Wnarrowing but that's only in C++ for some reason. int32_t f(void) { uint64_t result = ~0ull; return result; } Ah, it's -Wconversion but this throws tons of errors so I can't enable it

jaunty juniper
#

I was thinking how about switching the RTD theme to a dark mode one ?

manic glacierBOT
#

@stanelie are you still pursing a PR on this? I have this board now, and would be happy to help review / test a PR, or I could start a PR.

The Waveshare docs have some errors, specifically for the RGB pixel. With help on Discord from Dan, ultimately found through trial-and-error the Neopixel pin: IO21 (which unfortunately is also one of the pins broken out on the headers).

onyx hinge
#

blink and that issue will be 10

onyx hinge
# onyx hinge hmmm gcc doesn't seem to warn about this. There's a diagnostic `-Wnarrowing` but...

it's making the change bigger but I'm introducing structures to hold the masks, which forces me to touch every location (since conversion between scalar and structure is always an error)

I think I'm getting close. it builds again and "low neopixel" still works.

e.g.,

     for (size_t pin_number = 0; pin_number < NUM_BANK0_GPIOS; pin_number++) {
-        if ((pins_we_use & (1 << pin_number)) == 0) {
+        if (PIO_PINMASK_IS_SET(pins_we_use, pin_number)) {
             continue;
         }
manic glacierBOT
#

@anecdata I'm not pursuing anything, I don't know how. However, I am indeed using the ESP32-S3-ETH on one of my projects, with the YD firmware, and it works great.

It's strange that you have a neopixel on your device, I don't have one on mine. the pads are there for it, but no LED package (identified as IO26 on the silkscreen).

So, at least, I am confident that the info concerning the Wiznet chip and its pinout is accurate, since it works for me.

tulip sleet
manic glacierBOT
jaunty juniper
slender iron
onyx hinge
#

@jaunty juniper I'm not an expert but there are CSS selectors that access the browser preference. css @media (prefers-color-scheme: dark) { /* Dark theme styles go here */ } 
 @media (prefers-color-scheme: light) { /* Light theme styles go here */ }

olive vessel
#

Thanks @slender iron, I'll give both a shot.

lone axle
lone axle
#

Thank you

onyx hinge
#

@errant grail I'll forget it before next meeting but please accept this hug report for nau7802 library!

errant grail
manic glacierBOT
#

I've worked through removing hard coded pins so that I can build CP for an RP2040 Pico with an RM2 attached to pins 10, 11, 12, and 13. It runs, but the RM2 fails to initialize. Hooking up a scope while reducing the SPI clock to 625kHz reveals something interesting.

The SPI clock phase for the RP2040 to RM2 is as expected, bits are output on the falling edge of the clock. However, the RM2 is outputting bits on the rising edge of the clock which is causing words read from the RM2 to be off ...

manic glacierBOT
#

Allow tremolo-style effects using audiomixer.MixerVoice by implementing block input on level property.

LFO ticking is not completely implemented yet because it relies on changes to shared_bindings_synthio_lfo_tick introduced in #9776 to allow for a duration less than SYNTHIO_MAX_DUR.

Demonstration:

import audiobusio
import audiocore
import audiomixer
import board
import synthio
import time

DELAY = 3.0

wave_file = open("StreetChicken.wav", "rb")
wave = au...
lone sandalBOT
manic glacierBOT
manic glacierBOT
#

There could be different versions of the RM2 floating around? The one I'm testing with is from Pimoroni and does have FCC markings. An aspect of working with the CYW43439 and RM2 that adds difficulty is that the old Cypress Semi data sheet is incomplete and diverges from the actual parts. I read through 16057 again and there is mention of stability problems with an RM2 breakout. The closest the issue comes to pointing at gSPI is adjustment down of the CLK, presumably to compensate for signal ...

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.2.1 on 2024-11-20; Waveshare RP2040-Plus (16MB) with rp2040
Board ID:waveshare_rp2040_plus_16mb

Code/REPL

import array
import time
import audiobusio
import board
import math

# Constants
SAMPLE_RATE = 22050  # Sample rate in Hz
DURATION = 0.4      # Recording duration in seconds
BUFFER_SIZE = int(SAMPLE_RATE * DURATION)  

# Prepare a buffer to record into
buffer = array.array("H", [0] * BUFFER_SIZ...
manic glacierBOT
#

Clearly someone else has been here before. By changing the PIO program to spi_gap0_sample1 the RM2 functions as expected. I think the comment "for lower cpu speed" should read "for lower gSPI clock rate". It appears that the CYW43439 and RM2 have some sort of gSPI clock speed detection that governs the selection of clock/data phasing. Looks like I've got a Pico SDK issue in my future.

https://github.com/raspberrypi/pico-sdk/blob/95ea6acad131124694cda1c162c52cd30e0aece0/src/rp2_common/pi...

onyx hinge
#

@tulip sleet USB D+ is green right?

tulip sleet
#

it's not working?

onyx hinge
#

no, no errors, but not working.

tulip sleet
#

it would be safe to just swap them

#

but maybe first test to make sure where +5 is

mortal kernel
#

White D+, green D- is standard coding.

tulip sleet
#

maybe the production description is wrong

onyx hinge
#

most likely the code is wrong

tulip sleet
onyx hinge
#

oh! oh ! ```>>> pwr = digitalio.DigitalInOut(board.USB_HOST_5V_POWER)

pwr.switch_to_output(True)
list(usb.core.find(find_all=True))
[<Device>]

slender iron
#

🎉

tulip sleet
#

is green D+ on that then?

onyx hinge
#

@tulip sleet yes

slender iron
manic glacierBOT
#

We'd like to use Zephyr as the common real-time operating system (RTOS) across all of CircuitPython. This will allow us to:

  • Utilize an RTOS for sharing computation like synthio and displayio across multiple cores.
  • Unify Bluetooth, WiFi, Thread and Mobile APIs onto one underlying API.
  • Unify flash and time management.
  • Unify build system.
  • Minimally support every Zephyr supported platform. (AKA Reduce the engineering cost of supporting new platforms.)
mortal kernel
#

I'm celebrating getting an RM2 to work with an RP2040. At this stage it's a hack pending resolution of an upstream issue spread across the Pico SDK and cyw43-driver. Having this working allows capturing gSPI activity, which is a small step forward on a couple of issues. Hugs to everyone here, I hope to "see" more of you in the coming year.

manic glacierBOT
#

Establish a baseline ports/zephyr that works for every Zephyr board.

Include:

  • [ ] Fixed implementations of I2C, UART and SPI that are linked into board.
  • [ ] Flexible digitalio that uses the Zephyr API.
  • [ ] Default CIRCUITPY storage.
  • [ ] west build support that uses async Python to build the CircuitPython bits.
onyx hinge
#

@slender iron 🎉 to you as well re: zephyr

slender iron
#

🙂 Seems promising

manic glacierBOT
mortal kernel
#

@slender iron ❤️ what you're doing with Zephyr.

onyx hinge
#

huh this is weird. my keyboard doesn't appear in the device list until I press a key on it... ```Adafruit CircuitPython 9.2.1-43-gaf0cdc4065-dirty on 2024-12-20; Adafruit Metro RP2350 with rp2350b

paste mode; Ctrl-C to cancel, Ctrl-D to finish
=== import board, digitalio, time, usb, usb_host
=== pwr = digitalio.DigitalInOut(board.USB_HOST_5V_POWER)
=== port = usb_host.Port(board.USB_HOST_DATA_PLUS, board.USB_HOST_DATA_MINUS)
=== pwr.switch_to_output(True)
=== print("Here are the devices (but believe in yourself):", list(usb.core.find(find_all=True)))
=== _=input("but believe in yourself and hit enter on USB-attached keyboard")
=== print("Here are the devices now:", list(usb.core.find(find_all=True)))
=== for dev in usb.core.find(find_all=True):
=== print(f"{dev.idVendor:04x}:{dev.idProduct:04x}: {dev.product} {dev.manufacturer}")

Here are the devices (but believe in yourself): []
but believe in yourself and hit enter on USB-attached keyboard
Here are the devices now: [<Device>]
046d:c313: USB Multimedia Keyboard LITEON Technology

#

I've tried adding a sleep as long as 8s but it didn't make a difference.

#

@slender iron does that ring any bell for you ^^ ? I'll test with a USB Host Feather (the RP2040 one) just in case I introduced this by mistake

slender iron
#

Keyboards are handled by tinyusb for us

#

Not sure how that interacts with the device list

#

@mortal kernel working to migrate us to a zephyr baseline so we can share lots of the common things

#

Make new platforms easier too

onyx hinge
#

@slender iron it "should" appear in the device list, as it has to be in that list so you can detach the "kernel driver"...

onyx hinge
#

OK, it's something that happens when you busy-wait but not when you time.sleep. I'll file an issue.

manic glacierBOT
#

CircuitPython version

d73473b647d76516d15c7c483951afb5cfd1af81 (#9901) on Metro RP2350

Code/REPL

import board, digitalio, time, usb, usb_host
pwr = digitalio.DigitalInOut(board.USB_HOST_5V_POWER)
port = usb_host.Port(board.USB_HOST_DATA_PLUS, board.USB_HOST_DATA_MINUS)
pwr.switch_to_output(True)
usb.core.find(find_all=True)
print("Here are the devices", list(usb.core.find(find_all=True)))
print("Sleeping 3s")
time.sleep(3) 
print("Here are the devic...
tulip sleet
#

@onyx hinge thanks from me on working on the high PIO stuff and figuring out so many angles on it.

orchid basinBOT
nimble sparrow
#

Huh, when did heapq disappear

nimble sparrow
#

Yep, and it's various default builds - I have code going back a bit that used it but haven't had to for a while

stuck elbow
#

you will need to copy it into lib I suppose

nimble sparrow
#

It's definitely been enabled on rp2 builds in the past, so I wonder if I just missed a discussion about it being unstable on rp2350

#

It's no trouble, I can work around it for now

stuck elbow
#

I think it might have been moved in micropython, and then the change came to circuitpython with one of the updates

nimble sparrow
#

That'd make sense

fleet hollow
# blissful pollen I'm on vacation (just at home) after Friday so feel free to poke me if you need ...

Hey @blissful pollen, I hope your vacation is going well so far! Here's the main PR that needs review if you have the time. It adds another effect to audiofilters, but the main update is that it addresses LFO ticking outside of synthio.Synthesizer on all audioeffects classes which implement BlockInput. I have a few other PRs that will likely need to be updated if this ends up merging. So, I think this is the one to get moving on first. https://github.com/adafruit/circuitpython/pull/9776 Thanks! ❤️

GitHub

New audio effects class, audiofilters.Distortion, to distort audio samples using one of the available modes available in the audiofilters.DistortionMode enum.
Todo:

Reduce floating point computat...

blissful pollen
#

Cool, I'll take a look at it the next day or two. Hopefully push me to make a couple changes I need to as well. I have to catch up on some of the discussion you guys have had.

blissful pollen
# fleet hollow Hey <@228322543507865601>, I hope your vacation is going well so far! Here's the...

Caught up on the discussions. Have to wrap my head around the Block stuff. I added it on a suggestion (and like the idea) but haven't looked into it much.

I do get the pain with stereo/mono it drove me crazy when I was looking at it. (same with 16/8bit). I have thought for some effects is it worth making it only say 16 bit or only stereo. Is there enough use of the other cases to justify the complexity.

Also this may have been mentioned but when I was working initially a lot was based on AudioMixer which I realize is fairly old at this point. There could be a point where we take a step back at the whole audio system, but I don't want to bite off something too huge / potentially breaking.

fleet hollow
# blissful pollen Caught up on the discussions. Have to wrap my head around the Block stuff. I add...

There's discussion of removing the single channel output feature since it's only used on a small handful of boards (which I think could split the interleaved data at the end of the chain). I think that would simplify the stereo situation greatly. This PR fixes a few of the issues with stereo within audiodelays.Echo, https://github.com/adafruit/circuitpython/pull/9876, but I'd rather focus on get the distortion one out first in order to get LFOs squared away.

GitHub

@gamblor21 @jepler for interest.
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 whe...