I want to look into the safe mode reset in particular; I don't know about all the rest.
#circuitpython-dev
1 messages · Page 77 of 1
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.
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.
I kinda think of it as an infinite sample. coordinating the buffers could be tricky
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.
Hurray. Are there any requirements regarding silicon revision?
I don't think so. I have chip version 0.1.
I think the CI failures are due to the code being compiled for platforms that don't support it. I may be missing some guard macros. I'll take a look soon.
There are TinyUSB build errors, it looks like.
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?
@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...
Okay adding guard macros has allowed the CI checks to pass. Should this be merged? I'm not sure what remains to be done.
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_
DMA can be enabled for S2/S3 as well as they share pretty much same usbip.
- For P4, it use DCache and will need memory align 64 (variable must also occupies the whole cache line 64).
- For S2/S3, aligne 4 bytes are good enough.
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 ...
Hi & thanks for your report! This is expected: bluetooth support is not yet implemented in circuitpython for the pico w or pico 2 w.
If you like, you can subscribe to notifications on the existing feature request: https://github.com/adafruit/circuitpython/issues/7693
- [X] Replace touchscreen library with the correct one.
- [ ] Include a working library for the radio.
- [ ] Include
gnssand test GPS.
I have a feather rp2350 that I soldered a psram to (that one part adafruit sells). I haven't done much with it, but I noticed that it fails to enter the bootloader other than at power-on, which is weird.
I've seen odd behavior on both a hand-soldered feather rp2350 and a pimoroni pico plus 2w. I'm not seeing any weirdness entering the bootloader, how's it failing for you?
@mortal kernel neither the bootloader or circuitpython seem to start when holding boot and pressing reset. Holding boot while plugging in works
(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...
@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.
@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.
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??
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
Agreed. I'll open an issue and give reworking #9783 with the new hardware_xip_cache in SDK 2.1.0 a try.
@onyx hinge I'm not seeing your issue on the PSRAM-equipped boards I've tested.
Maybe the place for this board is the recycling bin
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.😜
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
Anyone know where I can find the source for flashnuke? It doesn't seem to fully erase a newer 16MB flash.
[adafruit/circuitpython] Issue opened: #9846 RP2050 with PSRAM Intermittent Fails after POR or Reset
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...
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...
I'd recommend asking for coding help in #help-with-circuitpython - this channel is for the development of CircuitPython itself.
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
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...
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
[adafruit/circuitpython] New comment on issue #9762: TTGO T8 V1.7 ESP32 board lacks PSRAM management
the PR for this has been merged https://github.com/adafruit/circuitpython/pull/9824
please @robertoseno please close this bug
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]
make sure to set your PATH to use the toolchain you installed
Thank You for the explanation.
I got "web workflow" working and understand why the drive is not "visible".
Question: Is there an API using the IP connection that makes the drive accessible like "web workflow" is offering?
This could speed up data transfer to and from the drive significantly.
I don't think there's anything that uses the web workflow API like that. I hope someone picks up the idea of making it webdav compatible, which would make it possible to treat it somewhat like a network drive: https://github.com/adafruit/circuitpython/issues/6644
perfect, thank you! something like this got me going: echo /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/bin | sudo tee -a /etc/paths [turns out i also had a very old install of v8 of the toolchain that was found first, and I needed a new shell to pick up the path]
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?
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
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...
yeah
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...
Images automagically compressed by Calibre's image-actions ✨
Compression reduced images by 27.5%, saving 534.45 KB.
| Filename | Before | After | Improvement |
|---|---|---|---|
| assets/images/boards/large/0xcb_gemini.jpg | 55.25 KB | 42.18 KB | -23.7% |
| assets/images/boards/large/0xcb_helios.jpg | 68.13 KB | 51.64 KB | -24.2% |
| assets/images/boards/large/barduino.jpg | 70.00 KB ... |
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...
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...
@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...
thank you very much to everybody for speed and efficacy
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 ...
@tulip sleet re https://github.com/adafruit/circuitpython/issues/9847 do you recall if there's a reason cdc & msc come before hid? if a hid boot device has to be first.... it's inconvenient!
GitHub
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(manufa...
Hi All, I am having an issue with MQTT that might be related to this. My hardware is an ESP32-S3 Feather running Adafruit CircuitPython 9.2.1 on 2024-11-20. I have the latest MiniMQTT library installed.
I am sending discovery packets to Home Assistant. The packets can be different lengths depending on the composition of the MQTT device I am describing. Have noticed that after a cer...
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...
This allows use of PIO programs that need to control pin direction from the side set portion of the instruction.
Closes #9630
Will need an associated update to rp2pio to enable the assembler directive
ping @jchawks -- I wrote this but didn't test it. Please test if you have a chance.
pio/i2c/i2c.pio:.side_set 1 opt pindirs
pio/onewire/onewire_library/onewire_library.pio:.side_set 1 pindirs
```pico-examples uses this for i2c and onewire implementations fwiw
On behalf of @TomWhitwell at Music Thing Modular, here's a first cut at a board definition for the Workshop System synth.
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
Do you just want the delays? CIRCUITPY_AUDIOEFFECTS = 1 will give you filters (and future ones) as well.
Couple of comments, obviously could not test myself.
This is the Adafruit VID, was the PID assigned by them? Just making sure.
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.
You are correct. This is a typo. TomW got the VID/PID from Raspberry Pi: https://github.com/raspberrypi/usb-pid
Yep, I want both. Even though RP2040 can barely do some of these, it still can do them at times.
You could get rid of the AUDIODELAYS line (effects should contain filters and delays), but doesn't do any harm having it there.
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...
I think you are already proceeding on this, but I think I tested it with the current setup.
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...
Here's a comment I wrote years ago in `supervisor/shared/usb/usb_desc.c:
// CDC should be first, for compatibility with Adafruit Windows 7 drivers.
// In the past, the order has been CDC, MSC, MIDI, HID, so preserve that order.
if I remember right, some older BIOS's don't even support a composite configuration descriptor for boot devices.
I missed that comment, thanks.
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...
There is a detailed writeup of the problem here: https://docs.circuitpython.org/en/latest/shared-bindings/digitalio/index.html#digitalio.DigitalInOut. See the "Warning box" further down the page.
@onyx hinge are you continuing on this at the moment? I have Windows available and am trying things out.
@tulip sleet the USB thing? No, I didn't have anything else I knew of to check on Linux.
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.
CIRCUITPY_BLEIO = 0 in mpconfigport.mk or mpconfigboard.mk`
sorry typo
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?
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))
@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 ...
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
@somber gazelle unfortunately, we recently introduced a bug in the BLE library. It looks like a fixed version hasn't been released yet. https://github.com/adafruit/Adafruit_CircuitPython_BLE/issues/208 for more details. You can try the fixed version by grabbing the file marked "bundles" from https://github.com/adafruit/Adafruit_CircuitPython_BLE/actions/runs/12090444392?pr=209 and manually putting it on your device (note: you have to be logged into github to see/use that "bundles" link)
or you can also grab the previous version https://github.com/adafruit/Adafruit_CircuitPython_BLE/releases/tag/10.0.9
Out of personal curiosity, I implemented the E9 workaround in pure CircuitPython code: https://gist.github.com/jepler/81eef2bab4bb130bd2034d95f9c22b1d and lightly tested it on a Feather RP2350 using an pin with nothing connected to it.
I will close this for now. In #9851 I added only a few lines to to vectorio fix an off by 1 issue and even that overflowed a few devices. Seeing that, I'm afraid even a pared down version of this is likely going to be to big for some of these. If I return to this I'll plan to move it to it's own module so that it can be disabled independently from the rest of vectorio.
<@&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!
Google Docs
CircuitPython Weekly Meeting for December 2, 2024 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates before the meeting, alphabetically by your username. During the meeting, we go through them in order. If you can’t make the meeting and woul...
I just made a release of ta proposed fix. Please try https://github.com/adafruit/Adafruit_CircuitPython_BLE/releases/tag/10.0.11
If it doesn't work, let us know.
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 ...
Just lurking today, no notes or anything
@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
(Matt Trentini) MicroPython continues to grow in popularity. But why? What is it about this pint-sized version of Python that makes it so darn compelling? What are the best bits of MicroPython?
Join me in this talk for a whirlwind tour of some of the most exciting features of this modern embedded programming language.
Slides available her...
The video of my "MicroPython: The Best Bits!" talk from the recent PyCon AU is now online:
https://www.youtube.com/watch?v=EVRDuu-Sez0
Slides are also available:
As usual, PyCon AU was a great conf, thanks to th...
Sorry for the abbreviated newsletter, I was sick for a few days
and the full latest pre-commit file, which you can hopefully just copy into a lib (rather than using cookie cutter again) https://github.com/adafruit/cookiecutter-adafruit-circuitpython/blob/main/{{ cookiecutter.__dirname }}/.pre-commit-config.yaml
@turbid radish we want you to take care of your self & get better. we can wait for the hot python news if necessary.
Thank you for the info @onyx hinge
cryptography, not complicated money laundring.
me too 🙂
zephyr would also help us manage background tasks on other cores (think synthio on a second core and displayio too)
👍
@onyx hinge Cool use of memorymap.
@still zephyr which thing did you change to version 5.0.0? I didn't see any version 5 in https://github.com/jposada202020/CircuitPython_BMP581/blob/master/.pre-commit-config.yaml
oh that file's a year old
Hello I changed in this library https://github.com/jposada202020/CircuitPython_scales/blob/main/.pre-commit-config.yaml
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0```
I think the enable/disable needs to be in a critical section to guarantee it's going to be done in time.
I have just found out this morning
there was some discussion of this in the philhower core issue on E9
[I think @still zephyr is not listening to us live but I hope you'll listen later]
yes I will 🙂
I like the idea in the abstract 🙂
so the parameter type for e.g., DigitalInOut's first parameter would be Pin | PinConfiguration ?
Thanks Liz!
Thanks everyone and to Liz for hosting!
Thanks for hosing Liz. Have a great week everyone!
Thank you very much for the explanation.
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
New mtm_computer board just got merged to CircuitPython. Here's the circuitpython.org info for it.
hcd_int_handler errors will be fixed by https://github.com/hathach/tinyusb/pull/2895
@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 ...
Yup! I think this is fine. Thank you!
This isn't a high priority for us because the C2 is very limited.
If you want to look yourself, then I'd suggest tweaking the sdkconfig to limit code loaded into RAM to execute. There may be optimization code that can live on flash instead.
Why do these need to be frozen in?
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...
The cache is not purged during port initialization, so when coming out of initialization after a reset stale cache entries may persist.
I think the BootROM may do this before calling the application.
Thank you! Good work debugging this!
I think there is nothing good for the radio still, so i'll drop that from the task list, but I think the gps stuff should be included, since the plus ships with gps onboard.
I haven't gotten to testing it yet. The PR is still a draft.
Getting the libraries frozen makes for a wonderful user experience.
No need to copy things in for using the hw the board ships with.
I think the BootROM may do this before calling the application.
That's what I thought, but the code says otherwise. I can see where it might make sense to leave cache maintenance up to the app.
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.
@lone axle unless it's the board.DISPLAY, no.
More generally, is there a way to stash variables in a similar place to where board.DISPLAY lives, that persist across Ctrl-Cs?
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 =...
I don't know which all devices support it but alarm.sleep_memory provides a way to store raw bytes that persists across ctrl-c / ctrl-d, but is lost if power goes away.
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...
I don't think it's quite the same as how board.DISPLAY works, but provides similar functionality
Do you have a link to any sample code for this offhand (I can google it if not don't go searching). Curious if MP can do it if there is something that could be used.
resetting the VM after boot.py and on reloads is a design choice for CP though, it's not MP doing anything special
... I wouldn't do
board.D5.configurationbutPinConfiguration(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
PinorPinConfigurationin one argument or keepPinseparate and replacepulletc with `PinConfigurati...
Have any of the Community Library Authors have tried the workflow to publish on Pypi lately. I have <<Username/Password authentication is no longer supported>> error. Tried to change the Github action yaml file, with some examples that I found, but with any success. If any can point me in the right direction it will save me some time. Thanks 🙂
https://github.com/jposada202020/CircuitPython_BMI160/actions/runs/12132932832/job/33827619137
@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.
It would be absolutely fine to have CIRCUITPY_BLEIO_NATIVE and CIRCUITPY_BLEIO_HCI and not CIRCUITPY_BLEIO. There should be check that both are not set.
A similar thing is CIRCUITPY_TOUCHIO and CIRCUITPY_TOUCHIO_NATIVE. Should probably be CIRCUITPY_TOUCHIO_GENERIC and CIRCUITPY_TOUCHIO_NATIVE.
when these flags were first invented, they were disjoint across ports, and there was less conflict. But not so true anymore.
"The vpath mechanism will always select the native source modules if both are selected" should be "..if both are present."
If you feel like making a PR, that would be welcome.
I can do that. I'd like to find a more durable solution than continuing to use vpath for the second problem.
I think this could be done by using the source list concatenation mechanism used when enabling other modules. In other words, if CIRCUITPY_BLEIO_NATIVE and CIRCUITPY_BLEIO_HCI were treated as completely separate modules, would it regularize things? Then the vpath special case could be removed.
Good idea. I'm not gonna say vpath is the root of all evil, but it's up there on my list.
@danh Is there an Adafruit breakout that works with devices/ble_hci/common-hal/_bleio?
Anything that says AirLift. Also PyPortal and anything else with an ESP32 coprocessor.
If you already have a plain ESP32 board, you could wire it up as an airlift.
I do think that you need to use an API token now instead of the password. The environment variable names are the same I believe so I don't think the actions script itself needs to change iirc. To get your token log in to pypi.org go to account settings and look for API token section.
I'm having the same issue. Timeout parameter appears to be ignored.
Because of this blocking, I can't fallback on a static IP if DHCP fails.
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
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 ❤️ ❤️
I intend on redoing this. Lemme find the issue
this is interesting https://github.com/micropython/micropython/pull/15620#pullrequestreview-2476302499
GitHub
Depends upon RP2350 support: #15619
This is a rough draft gathering our PSRAM support code - with a dash of SparkFun's - and attempting to get it into the right shape for mainline.
TODO:
P...
a GC stack size setting
yeah, I've been following this
Are you looking at the BootROM code? I'm pretty sure pinned cache lines are wiped out unless you use the special wake function stuff. Section 4.4.1.3:
The bootrom clears the tag memory upon entering the flash boot or NSBOOT (USB boot) path, but watchdog scratch vector reboots can boot directly into pinned XIP cache lines.
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...
Are you looking at the BootROM code?
Yes. There's a single entry point to s_varm_api_crit_flash_flush_cache_impl which implements the complete cache invalidation. Aside from linkage through the dispatch table for the SDK I cannot find any other calls. Maybe I'm missing something?
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...
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)
I ran the code as-is and got None. Then I removed the banana line and replaced it with a time.sleep(1) and got the AP IP address. I suspect there is a slight delay in how long it takes for the AP IP address to become accessible.
n/m, it's working now
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...
That might be it, I will test. Thanks!
Correct, it works for me as well.
Can this be added to the documentation?
I tried time.sleep(0.01), it also works.
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_...
Let's leave this issue open, there may be a fix possible in the software, so that the call to set the address doesn't return until the address is valid. iirc, there was a similar issue for Station that was fixed like that.
you could do while not wifi.radio.connected: inside the function, and add some time limit or other exit trigger to the conditional if desired
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
Thanks! Will someone handle closing #7454?
CircuitPython version
Adafruit CircuitPython 9.2.1 on 2024-11-20; VCC-GND Studio YD RP2040 with rp2040
Code/REPL
import microcontroller
print(microcontroller.cpu.temperature)
Behavior
it prints: -1479.79
Description
No response
Additional information
No response
[adafruit/circuitpython] New comment on issue #9859: wrong temperature on RP2040 (it shows -1479.79)
Please see issue #8403. The Studio YD board has an ADC_VREF solder jumper that needs to be closed for CPU temperature to function.
Maybe an explicit call to esp_netif_dhcps_get_status() before returning? But what to do if it's not yet started? Check in a loop for some max time and raise an exception if it's still not started?
Thanks for the tip, I will try that! Cheers!
Yup, that works great! Thanks again!
As I am not familiar with the CircuitPython code internals I would like to know, what I would have to change in a sdkconfig file to achieve that goal. If it is too complicated I can live with the reported issue for the moment as I was more interested in interfacing my 'eric-ide' to this board.
[adafruit/circuitpython] New comment on issue #9859: wrong temperature on RP2040 (it shows -1479.79)
Thanks for linking to the solution to this @eightycc !
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...
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...
Thanks! This seems like a good idea. I have some comments, though.
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...
The requests-module (to be specific: the Session class) only maintains a single request. In your request handler, you create a new request while processing the old one (this closes the old request). So this might be something that later trips the native method wrap_socket().
@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?
Yes please. I think you’re right about where I came from. I’ll try to get to it in the next week or so.
I copied over a lot of code from audiodelays, so I'll defer to @blissful pollen on this.
However, I can update audiofilters separately if needed, but it'd be better to make all of these updates within a single PR.
Noticed during review of #9861
This saves 88 bytes on Feather RP2350. Should not represent any functional change, as a setter function is never called directly.
ping for interest: @pdw-mb @gamblor21 @relic-se
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...
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?
As discussed during a recent meeting. Split raspberrypi processor family into rp2040 and rp2350
@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.
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...
@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 🙂
Good with me! I had some free time, so I've already updated the setters and created the PR (see above). I didn't quite get your 88 bytes per setter result, but I think that may have been due to filesystem block segments in your previous PR if you're using UF2 output size as the metric. With FLASH_FIRMWARE, it's more 35 bytes per setter.
my example also removed a probably unique error string, mp_raise_ValueError(MP_ERROR_TEXT("level must be between 0 and 1"));
Yeah, that must have been it. Regardless, less is more!
ugh it's distressing that we're so close to full on m4 express boards now 😦 https://github.com/adafruit/circuitpython/pull/9861 is failing on itsybitsym4 ja translation
GitHub
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 ...
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 ...
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.
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.
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.
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"
I'm not sure they're saying "we don't know what would work". It's true you have to specify the use case via the API, viz. https://github.com/adafruit/circuitpython/issues/9541#issuecomment-2341792598.
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.
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
@dhalbert points out that my workaround code probably doesn't 100% work in practice, and a different physical design should be used to avoid the E9 erratum. Specifically, interrupts, gc, or background tasks can run between when the input buffer is enabled and the GPIO value is sampled. During that time, the extra leakage current might pull the input back up to HIGH.
The example I gave in the memorymap doc shows how to use xor and bit flip to make the GPIO control register accesses atomic. This allows use of a register shared by multiple GPIOs that in turn might be shared by user and IRQ-level code. It's atomic, but might not be suitable for the purposes you're discussing.
[adafruit/circuitpython] New comment on issue #9859: wrong temperature on RP2040 (it shows -1479.79)
It looks like the same is true to control the neopixel, there is a jumper one needs to solder. Thanks for sharing, I would have never realized it.
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...
@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))
@mortal kernel superficially I don't know a reason not to.
Ah, I did wonder about that, and yes, very much a copy-and-paste job. Fixed in 372759f728.
looks good to me too, assuming it's the same across all
@onyx hinge does nlr_push_jump_callback() call the routine and then still raise the exception?
@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"
Thanks to you both. That's what I was hoping.
I have seen the old way of basically doing try-catch in C. This is nice. Thanks.
yeah it might be worth reviewing if there are other places to use it. however, micropython didn't use it much yet either.
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...
The new test verifies that the first part of an MP3 decodes as expected even when the "open" method is used.
Closes: #9705
Thanks! One particular board build is failing, but this is not an error in your change. Rather, the board's flash space is full. We'll have to do something to shrink that build before we can pull in this PR, so thank you for being patient about that.
@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
...
239 if is_ssl:
240 socket = ssl_context.wrap_socket(socket, server_hostname=host)
fwiw the failing call is to ssl_context.wrap_socket.
We take the default esp-idf configuration and restrict allocation of mbedtls data to internal SRAM:
choice MBEDTLS_MEM_ALLOC_MODE
prompt "Memory allocation strategy"
default MBEDTLS_INTERNAL_MEM_ALLOC
...
@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...
This is a speculative fix. No testing performed. (it builds for magtag though)
Closes: #8968
@mortal kernel don't spend too much time improving the makefiles. I'm hoping to replace them with my zephyr migration
CircuitPython version
Adafruit CircuitPython 9.2.1 on 2024-11-20; Raspberry Pi Pico 2 with rp2350a
Code/REPL
import board
import picodvi
import framebufferio
import displayio
displayio.release_displays()
# Setup for Raspberry Pi Pico 2 - RP2350 - with DVI_Sock installed
fb = picodvi.Framebuffer(320, 240, clk_dp=board.GP14, clk_dn=board.GP15,
red_dp=board.GP12, red_dn=board.GP13,
g...
Thanks @andibing and @wtuemura
I’ll restrain myself. I’m doing just enough to get serial HCI or native BLE working for raspberry pi. The factoring makes it easier.
#9828 adds pdm support
// BOOT button labeled simply as "B" on silkscreen
Want to add a B name too?
The pins on the board most are labeled simply as 1, 2, 3, etc. and those have aliases of D1, IO1 but not "1", so keeping with the rest of the board, maybe not add the "B". However as I just noted should I instead add IO0 to be consistent with the rest of the aliases?
@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.
...
@tulip sleet @slender iron itsybitsy m4 being full is blocking a number of otherwise good PRs. I'm not sure what to disable. floppyio?
I think that makes sense
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?
ok, we didn't disable terminal fonts for ja/ko/ru translations on itsybitsy m4 yet. we had on metro m4 previously.
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?
@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.
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...
Hi, there is already an issue for this, here: #7693. You can subscribe to that for updates.
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...
@mortal kernel I'm not sure what you mean by "dead". An incorrect (missing some files) list of input files will usually cause a link time error.
Update :
If I use usb_midi.set_names(audio_control_interface_name="potato_midi") (if I do not use all the parameters), it works. The name changes, and the device works.
The pasted code above has a broken line, with missing text at the end. Maybe this is just a copy-paste error into the issue? Could you check that and edit your original post, if necessary?
Any errors in boot.py will be reported in boot_out.txt.
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.
Just to be clear, did you mean after it is defined ?
That's amazing and as you say, weird. Thank you for the explanation, I now understand.
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.
By "dead" I meant "assigned after last read". After reading Jepler's explanation I see that my assumption of assignments happening in textual order was bad.
Completely agree. Thought I'd found something, but never mind...
It was a copy/paste error, I corrected the above post.
No error reported in boot_out.txt
OK, just be careful lest you become a makefile expert in the process.
Hah! Like becoming the shop JCL expert once upon a time.
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.
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)
IBM mainframe. Job Control Language. Used to this day by z/OS.
The updates look great to me so far, and I'm happy with the updates to audiofilters.Filter. Namely, the rewrite of common_hal_audiofilters_filter_set_filter and removal of reset_filter_states.
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 ...
I used MidiOX, MidiView and Bome to verify I could talk to the midi device or not. Every time I change the name, I delete the device from the device manager so that it can be detected again with the proper name. Otherwise, the old name "sticks".
I will try more scenarios and report back.
Using the same names that CircuitPython uses by default, it works :
usb_midi.set_names(streaming_interface_name="CircuitPython MIDI", audio_control_interface_name="CircuitPython Audio", in_jack_name="CircuitPython usb_midi.ports[0]", out_jack_name="CircuitPython usb_midi.ports[0]")
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.
@lone axle sorry not sorry for stepping on your toes on that turtle issue. what can I say, it piqued my interest. [re https://github.com/adafruit/Adafruit_CircuitPython_turtle/pull/45]
and thanks for the review of course
😄 I appreciate it honestly. I imagine I could have made it to the solution but it would have definitely taken me much longer and adding many prints to get there.
@relic-se can you comment on this specifically?
this is making me doubt that a BlockBiquad with varying inputs is even working right in Filter with a single Filter and no mixer since it is using buffer_size of 512 bytes which might or might not be 256 samples.
If I reduce the length audio_control_interface_name="new_audio_control_interface_name" by 1 character, it works.
Example :
usb_midi.set_names(streaming_interface_name="new_streaming_interface_name", audio_control_interface_name="new_udio_control_interface_name", in_jack_name="new_in_jack_name", out_jack_name="new_out_jack_name")
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...
Commenting to follow. (I was the guy in the original forum post.)
Not really sure what else I can try. Is there a way to confirm if it's a length issue for the fields in usb_midi.set_names?
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...
@relic-se @gamblor21
It seems like there is a length issue. If you use a shorter name, it's working fine for you now? We'll look at the length issue and fix it.
Correct. If I do not use the provided example and use shorter values instead, it works. So, this is solved for me.
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...
@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...
Additionally, the added file(s) in this module need to be separately listed in the UNIX port (ports/unix/variant/coverage/mpconfigvariant.mk). This is the cause of the CI failures that prevent per-board builds from starting.
It would be nice if at least one basic test of the distortion functionality is added to tests/circuitpython so that this functionality is smoke tested during CI.
as detailed in https://github.com/adafruit/circuitpython/issues/9872 the distortion class needs to take responsibility for ticking the blocks it uses.
does it actually perform well enough to call complicated floating-point math functions 7 times per sample? I am .. stunned, actually.
all floating point constants should use MICROPY_FLOAT_CONSTANT(...).
Use synthio_block_slot_get_limited here?
Ha ha, yes it does on the RP2350. But of course, this is an area which needs work. I'd like to move these operations over to integer calculations where possible.
Yes, I'll be following your recent examples on this as well as removing the following unnecessary kwarg setters:
audiofilters_distortion_obj_set_drive
audiofilters_distortion_obj_set_pre_gain
audiofilters_distortion_obj_set_post_gain
audiofilters_distortion_obj_set_mode
audiofilters_distortion_obj_set_mix
Thank you for the review, @jepler ! I'll dig in as soon as I get the chance.
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...
Sorry I found it.
https://github.com/adafruit/circuitpython/issues/7656
There are too few related examples, and the library's documentation doesn't provide any explanations.
@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...
I feel your pain about single_channel_output. As far as I can tell from source code searches this was needed by samd51 analog AudioOut but not any other audio output, and we should restructure things so that not every audio source has to bear a code size and complication cost for it.
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
@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...
no bootloader yet
but someone had requested a uf2 id
Thanks. I'm going to reopen this, because I think there may be an off-by-one error that doesn't allow names larger than a certain length. But there's any easy workaround, so it's not a blocker.
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?
This channel is more for core circuitpython development. If you don't get an answer here, ask in #help-with-circuitpython
display.root_group.hidden = True
has error:
RuntimeError: Read-only
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.
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_bleioimplementation is part of this build. Automatically set.CIRCUITPY_BLEIO_NATIVE: Selects the port's native_bleioimplementation.CIRCUITPY_BLEIO_HCI: Selects the serial HCI implementation.
Marked as work in progress. Using CI builds to verify correct builds for all ports/boards.
adding support for the Waveshare ESP32-S3-Matrix board
- USB VID/PID taken from Espressif USB customer-allocated PID repository
- onboard NeoPixel array tested sucessfully
- onboard QMI8658C IMU/acceleration sensor tested sucessfully
display.root_group.hidden = True
has error:
RuntimeError: Read-only
_Originally posted by @bh1rio in https://github.com/adafruit/circuitpython/issues/2791#issuecomment-2525231538_
This started happening between 9.0.0-beta.0 and 9.0.0-beta.1.
This is due to #8923.
@jepler
display.root_group.hidden = True was previously recommended as a way to hide the terminal. Now that the root group is read-only, it can no longer be made hidden. I can't remember if there is an alternate way to hid the terminal now.
I think it's display.root_group = None
@jepler That makes sense, thanks! @bh1rio that should work for you. Please reply if not.
Per #9880, the way to do this now is: display.root_group = None
More on this: https://forums.adafruit.com/viewtopic.php?p=1019617#p1019617
@tannewt see your comments there.
More on this: https://forums.adafruit.com/viewtopic.php?p=1019617#p1019617
@tannewt see your comments there.
en...... set root_group to none, does not have effect
Per #9880, the way to do this now is:
display.root_group = None
CIRCUITPY_TERMINALIO=0 has been removed?
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...
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.
it have effect in a vm, e.g. code.py.
after it run, display recovery.
if you use thonny, thonny will run help('modules'), and get dir list.
For the 320 * 240 LCD of M5Stack, it will take four to five screens to display all of these contents.
Perhaps it would be better for me to compile a bin with CIRCUITPY_TERMINALIO=0 by myself.
thanks.
CIRCUITPY_TERMINALIO=0 is not a perfect solution either. By doing so, both the built-in terminalio and fontio modules will be gone, and there may be other modules that I haven't noticed are missing as well.
I think so, that's why it would work to hide the root_group if you don't want the REPL to ever show up outside of a hard reset. Which, if I understand correctly, there's no way to do in the current version anymore ?
You can try putting board.DISPLAY.root_group = None in boot.py. In my testing, this produced nothing on the screen when ctrl-C'ing a program, or when using Thonny.
ESP_IDF_ARCH was used in mpconfigport.mk to determine CIRCUITPY_ALARM setting but was not yet defined. Move definition from espressif/Makefile to mpconfigport.mk.
Hopefully, these builds will still fit.
Thanks @Kevin in discord, who asked why it wasn't available on a particular 4MB ESP32 board.
Thank you! I updated the family to rp2040. The raspberrypi family is now split up into the different processors, but the PR that made that change came it essentially the same time as this one.
<@&356864093652516868> Our weekly meeting will be starting in about 1-1/4 hours, at 2pm US ET. Add your notes to https://docs.google.com/document/d/1aZ43h3GXE9me3MBCjRob9WCtkmxUE2rZCtBT9z7Z4p8/edit?tab=t.0
This WIP branch saves just shy of 1kB on feather rp2350: https://github.com/jepler/circuitpython/tree/audioio-remove-single-buffer -- that gives an idea of the best possible savings. other platforms will save less.
yup!
yup!
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.
Thanks all and to Dan for hosting!
Thanks all - have a good week
thanks! see y'all around
Thanks for hosting Dan, have a great week everyone.
bye thanks everyone!
@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
ya, you could even disable output for the intermediate pins from pio
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
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
using the IP address/code/ works.
Raised https://github.com/circuitpython/web-editor/issues/273
I'm doing this work to support an ILI9488 display, which accepts 18 bit of color in 24 bits.
related issue: #9286
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.
Depends on #9882 for the ILI9488 display.
product page https://www.elecrow.com/esp32-display-3-5-inch-hmi-display-spi-tft-lcd-touch-screen.html
wiki (including schematics) https://www.elecrow.com/wiki/esp32-display-352727-intelligent-touch-screen-wi-fi26ble-320480-hmi-display.html
@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..
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.
As written, it would give this result which is not right...
8388606
8388607
4294967295
4294967295
@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 -
$
basically not call pio_gpio_init on that pin right? so the pinmux is still set to gpio, presumably
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! 🤗 🐮 ❤️🐍
@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.
I'd like to wait until we have a clear resolution for block ticking outside of synthio before including it within this PR. I will keep this conversation open in case that occurs before this PR is merge-able.
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...
If you're interested in trying this, see
https://learn.adafruit.com/how-to-add-a-new-board-to-circuitpython
and for general background on doing builds:
https://learn.adafruit.com/building-circuitpython
The easiest thing would be to copy an existing W5500-capable board and modify as needed.
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.
There are a few boards with a W5500 interface, but they are RP2040 based. Would that work?
Do you think I have enough info with the wiki page from waveshare to attempt this? I'm just a simple user, not a dev...
Thank you to you and the maintainers for Mu. It's really nice to see such careful thought and planning going into sunsetting Mu, it's appreciated.
I appreciate the neutraility. For CircuitPython, we have several known alternatives already, including our own code.circuitpython.org (browser-based). For CPython users, that is a different audience, and it will be interesting to see how that goes.
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.
You will actually have to merge a suitable ESP32-S3 board definition with a W5500 board-definition. You need the basic setup including source-code position below ports/espressif/boards from the first and the SPI-definitions (adapted for your pins) from the second.
I've noticed a few areas within audiodelays.Echo and audiofilters.Filter which weren't using the practices you've outlined in your comments, @jepler. I've included those updates in a separate commit within this PR.
I will require some hand holding...
Trying to setup the build environment on Ubuntu 22.04, I run into this issue : on the page https://learn.adafruit.com/building-circuitpython/espressif-build , it says to
cd circuitpython/ports/espressif
esp-idf/install.sh
However, the install.sh script is missing...
Thoughts?
I always recommend to use the instructions from .devcontainer/Readme.md. This creates a complete dev-environment in the cloud automatically and you don't have to mess with installing everything yourself.
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...
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 ...
I'd like to manually snoop the SPI line with the factory firmware but the pitch IT8951 is pretty tiny, I'd be nervous putting on magnet wire.
found the missing compiler and added it to the path with
export PATH=/home/codespace/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/bin:$PATH
Now, I get a new error :
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...
huh this project gets totally different styling than the normal readthedocs. I wonder what I need to fix. https://adafruit-blinka-rp1pio.readthedocs.io/en/latest/_generate/adafruit_rp1pio.StateMachine.html#adafruit_rp1pio.StateMachine
Ok, I did that.
I am not sure. If you follow the instructions verbatim, you won't have any problems with missing compilers, environments and so on. It is just a number of clicks and then you are ready to build your board.
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...
P.S.
for this line, I'm unsure how to set it to english :
"make -j $(nproc) BOARD=whatever TRANSLATION=xx_XX"
@stanelie -C3 boards do not have native USB, so do not have a CIRCUITPY drive.
Try TRANSLATION=en_US
You do want to match chip/module, and flash and RAM. UnexpectedMaker S3 boards have 16MB flash and 8MB RAM, probably others too. Pins and special features will differ. You'll also need VID/PID from Waveshare (or https://github.com/espressif/usb-pids).
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?
I've just tried flashing the UnexpectedMaker ProS3 firmware to the ESP32-S3-ETH, and it doesn't go any further then creating the virtual boot drive (PROS3BOOT, in this case). I am unable to load the .uf2 file. What should I try next?
Does this help? It's from the setup instructions for the Arduino IDE :
the waveshare may not have the UF2 boot loader, you could use esptool or the web tool to load the .bin firmware
It looks as though it is copying the file to the PROS3BOOT drive, and when done, it dieconnects the drive, but when it comes back, it is still the PROS3BOOT drive, and I cannot connect REPL
The UnexpectedMaker PRO S3 does indeed have the same memory chip, as I found on this picture. Exact same marckings on the Winbond chip :
https://www.tinytronics.nl/image/cache/catalog/products_2024/unexpected-maker-pros3-esp32-s3-development-board-usb-c-1-1500x1500.jpg
best guess is there's some incompatible difference in the ProS3 UF2. I don't know if it matters, but ProS3 has 80MHz QIO for flash and RAM
It's from a pybind11 project template, not adafruit circuitpython cookiecutter...
In case this is useful, here is what the stub says when connecting to the board from the esptool.py flash page:
Stub is now running...
Detecting Flash Size
FlashId: 0x1840EF
Flash Manufacturer: ef
Flash Device: 4018
Auto-detected Flash size: 16MB
I will try this other dev board firmware
Oh!!
The yd_esp32_s3_n16r8 works, it boots fully! I have a CIRCUITPOY drive and REPL is connected! Woohoo!
Thanks @anecdata !!
Oh sorry, I am not too familiar with pybind11 (or Blinka, tbh). I think all that is needed is this:
import sphinx_rtd_theme
html_theme = "sphinx_rtd_theme"
I'll try it
I am definitely not certain since there may be other requirements to get that working on RTD.
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](...
Fix in progress. Awaiting test by discord user.
Tiny typo
//| """A type representing of the strings ``"auto"``, ``"txrx"``, ``"tx"``, ``"rx"``, ``"txput"``, ``"txget"`` or ``"putget"``. These values are supported on RP2350. For type-checking only, not actually defined in CircuitPython."""
Also should be one of the strings, not of the strings.
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.
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...
I looked at the doc build output and it looks good!
In what way does the built firmware not work... errors during build, no serial, no CIRCUITPY, boot looping, etc.?
Perhaps if you're up for submitting a draft PR, folks could help spot the issue.
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...
It's possibly boot-looping, but you may have to connect to separate debug part pins (if exposed) to see it? (that's the way it used to be, not sure if it still is)
If you're using the devcontainer process, maybe bablokb or someone else can help with how to turn that into a PR.
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!
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?
It works the same
@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?
@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.
@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...
[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...
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.
I think it is being overriden by the first line in ports/raspberrypi/mpconfigport.mk, which is
LONGINT_IMPL = MPZ
so just change that and rebuild
after make clean
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...
Is it really necessary to limit the width? Having it expand to actual width seems way more logical
Line in question: https://github.com/adafruit/circuitpython/blob/27456d525e645acc68126a3d4ad831aa01aa2281/supervisor/shared/web_workflow/static/style.css#L2
will it be available in circuitpython?
I don't know that these other objects need a
blocksproperty. But they need to callshared_bindings_synthio_lfo_tickonce per 256 samples(*) to set the global data that causessynthio_block_slot_getto actually advance the LFOs that are used.
blocksis 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...
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.
looks like memorymap is assuming longints (which it will certainly need), so you'll need to turn off memorymap too.
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.
ideally memorymap being on should be guarded to require longints
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!
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,...
@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 ...
We are soon releasing the PicoADK v2 https://circuitpython.org/board/datanoise_picoadk_v2/ with an SD attached via SDIO (with UHS support). Would be great to also have support for it in CircuitPython. The main SDK so far is Arduino and a bare C.
@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...
If you test the above examples with a large buffer_size on the effect, let's say 16384, you can clearly hear the stepping in the delay time of the output. Though it is very unlikely that a user would use a buffer_size of this amount, it does bring up a valid case for keeping lfo ticking to SYNTHIO_MAX_DUR intervals.
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...
@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
[adafruit/circuitpython] Pull request review submitted: #9883 add support for Elecrow Crowpanel 3.5"
Just needs an id tweak. Thanks!
@andywarburton added it. They may have an opinion.
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!
@tulip sleet now I remember the fancy typing stuff was a pr by someone
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.
@andywarburton added it. They may have an opinion.
Aye it was a was a while ago but generally super long lines are considered bad for readability (see https://baymard.com/blog/line-length-readability for example).
I’m not especially tied to the decision though so feel free to revert if folks think something else is better.
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.
@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?
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?
can you give a few examples? Do you disagree with the nomenclature, for instance?
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)
"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?
Very good question. I can definitely look that up. I apologize if I came off as rude about this
The previous translators were @ajs256 and @lisapple.
Also, I really must say here that I am not trying to criticize or undermine anyone
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.
Ah! 10-4. That makes sense. I can focus on concision. French does tend to go all verbose
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.
I know that l'Office de la langue française (the Québec entity that oversees the language) does have an official glossary for technical terms. I can refer to those and compare with the French (from France) entity, to ensure that the translations don't have too much of a regional bias
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?
Yes, I live in Québec. I do however tend to prefer International French terms instead of Québec-specific terminology (like how we say "courriel" for email in Québec whereas in France they use e-mail or even mail)
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.
That is one big can of worms to let loose though! But yes, if there's interest in having a French Canadian translation, I am willing to help
@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.
Excellent. I'll send them a message!
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.
Sounds good!
Those are in the spec I think. You don’t want to change them
that's surprising, but yes, it looked like some given name.
I will move on in any case.
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.
This is the channel for discussions about CircuitPython core development. Try https://discord.com/channels/327254708534116352/330406777009209346 and it would be helpful if you provided a link to the device you're trying to connect to the Funhouse.
Oh sorry! Will move it thank you! Have a good day!
Done by #9530. The Sense is the base board with an add-on board. The same build can be used for both.
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...
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?
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?
@ilikecake could you post a simple test program that causes the errors? Why do ten errors in a row cause a crash?
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...
Your retry logic is retrying as fast as possible instead of delaying between retries.
Previous testing in this issue has mostly been using the the library and its example program, I think: https://github.com/adafruit/Adafruit_CircuitPython_LC709203F/blob/main/examples/lc709203f_simpletest.py. That does a single try, and waits one second before trying again.
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:
...
err_msg = [
f"Error: retrieving latest release information failed on '{repo['name']}'.",
f"Information Received: {repo_release_json['message']}",
]
self.output_file_data.append("".join(err_msg))
return [ERROR_OUTPUT_HANDLER]
```it looks like this represents adabot having trouble retrieving info from github. I don't think it's related to CI actions failures.
ERROR_OUTPUT_HANDLER = "A programmatic error occurred"
those items seem to have readthedocs configuration that doesn't match what is expected. For instance https://app.readthedocs.org/projects/circuitpython-pixelmap/ while the script is looking for /api/v3/projects/adafruit-circuitpython-pixelbuf/builds
Read the Docs is a documentation publishing and hosting platform for technical documentation
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.
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 ?
there is data in the repo, it's not json but the board files have a structure, with a feature list in the top section. https://github.com/adafruit/circuitpython-org/tree/main/_board
there's also the data generated when building Circuitpython that lists available modules in the files.json file: https://github.com/adafruit/circuitpython-org/tree/main/_data
it's not a very detailed list of features
like SD card is not part of the listed features
PR #9841 (ESP32-P4 USB support) caused USB to stop working on ESP32-S2 and ESP32-S3 builds. The boards no longer appear on USB. CircuitPython is still working: a blink program still blinks.
I did a bisect to reduce the problem to #9841.
On other ports, like nordic and atmel-samd, USB still works.
- Fixes #9888.
#9841 set CIRCUITPY_USB_DEVICE_INSTANCE to 1 as the default for all Espressif boards. However, on nearly all boards, it should be 0, not 1. The ESP32-P4 dev board uses 1 to use the second interface by default.
@tannewt should be it 1 for all ESP32-P4 boards, or does it depend on the board wiring?
@FoamyGuy i have added real photos of our boards.
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.
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. 😉
I quickly loaded this artifact onto my MatrixPortal S3 and it does bring back the CIRCUITPY drive that didn't appear using the "absolute newest" build, however I ran into another apparently unrelated safemode issue. I'll open a new issue on that shortly.
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()
...
<@&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
Google Docs
CircuitPython Weekly Meeting for December 16, 2024 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates before the meeting, alphabetically by your username. During the meeting, we go through them in order. If you can’t make the meeting and wo...
sure can
Is this new since 9.2.1? If so it could be https://github.com/adafruit/circuitpython/pull/9865 which was supposed to fix a problem with an incorrect initialization leading to a crash, but maybe I got it wrong.
Indeed, the problem starts with adafruit-circuitpython-adafruit_matrixportal_s3-en_US-20241205-main-PR9865-2bb9fc4.uf2. The build just prior to that one does not exhibit the issue.
Thanks for testing that. We may just want to revert that PR in its entirety, since it only caused problems when a mistake was made in matrix initialization, rather than breaking them entirely.
[adafruit/circuitpython] New branch created: revert-9865-rgbmatrix-cleanup-failure
Thank you @odeevee and @SKRRRRRRT
Reverts adafruit/circuitpython#9865
According to @retiredwizard this led to the problems reported in #9891.
Since the fix was only for failed matrix initialization, it seems we're better off just reverting it until it can be solved again properly.
thanks everyone!
thanks @lone axle !
happy holidays
Thanks everyone, have a good week!
☝️
Looks like your #9892 changes to ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk are still needed for space reasons.
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>
Google Docs
CircuitPython Weekly Meeting for January 6, 2025 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 t...
I loaded the matrix S3 artifact and it appears to have resolved the safe mode issue. Thanks!
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...
P4 boards will have the choice to use full speed or high speed USB. Instance 1 is the high speed (480) usb. I was thinking full speed would be usb host.
I updated the branch to leave the itsy config changes & merge latest main.
@RetiredWizard My USB fix #9889 was just merged, but that is not in this PR.
Reopening due to #9891 and reversion of #9865.
I cloned CP after Scott merged Dan's fix and then built using Jeff's changes here and everything seems to be working great. The issue I was seeing when unplugging the USB looks like it was on my end. Either one of my power bricks died or I pulled loose one of the cables....
@RetiredWizard thanks for testing. I'll merge if/when the builds finish successfully.
Some MIDI controllers expose more than one MIDI interface, and I need to recreate that using Adafruit_CircuitPython_MIDI.
//| """You cannot create an instance of
usb_midi.PortOut.
//|
//| PortOut objects are constructed for every corresponding entry in the USB
//| descriptor and added to theusb_midi.portstuple."""
...
@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.
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. ...
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?
Same issue. Connecting and disconnecting loop with prior message exchange either alternating between two connections or one connection only. Tried different timings and enhanced double cleanup mechanism.
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...
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
I did a bisect. It's f14b4c6636e769fecdc8c24b51e7bd6f7dbebd5a, in #9659.
Pinging @timchinowsky for interest. picodvi uses DMA IRQ 1. #9659 added use of that IRQ for PIO: previously PIO was only using IRQ DMA 0, if I understand correctly.
adding @lone axle to this thread. You can submit a pull request to remove them. Which ones are they? Someone else may want to take them over.
So is the PicoDVI IRQ handler being clobbered by the PIO handler I added? I would have thought the compiler would complain about that.
generally the tag order is done by the declaration order which is also the tag number.
I think the order may be coming out different due to the __dict__ or something.
I think the 00 is a bug because 15 is an anonymous struct iirc. The 00 may be an incorrect tag number
you could sort it by id first
__mro__ handles inheritance I think too
I wrote an __mro__ like thing to return the class and all the superclasses.
Mostly the sensor libraries. I can do the PR just wondering how to deal with the adabot part of it.
adabot gets the list of libraries dynamically
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.
Yes the problem is I not sure how to remove the submodule☺️. Ill google it or copilot it 😇
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.
@tulip sleet you setup o test usb host? My guess is that the memory protection is causing an issue on the second core
I can do some kind of testing. I have the Pimoroni RP2350B breakout and could wire it up with a USB-B breakout.
I can also test it on an RP2350A
Either should be fine. I doubt it is pin specific
maybe what you suggest or is it using high-bank pin numbers?
I have to look...
uses GPIO 32, 33
I think PIO support for high GPIOs in CircuitPython was a "?". I never tested it.
Ah that could be the problem too. Worth verifying it works on lower pins first
If anyone has a free moment sometime and could review: https://github.com/circuitpython/CircuitPython_Library_Screenshot_Maker/pull/26 it's appreciated. This repo doesn't seem to allow requesting review from circuitpython librarians.
since it's in the circuitpython org, it doesn't have the adafruit team
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
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)
replied in github.
@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':...
I was confused because I thought it was literally trying to match the string from module.submodule import *.
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.
so the comment made me more confused 🙂
Would it be good to add more details to the comment about how findimports transforms the import string?
You could just say "findimports may return an import like foo.bar.*
In Framebuffer_RP2350.c I'm seeing the IRQ1 handler is https://github.com/adafruit/circuitpython/blob/2d2fa28b4f290cba9ba403d8608cfadf043a0441/ports/raspberrypi/common-hal/picodvi/Framebuffer_RP2350.c#L118-L130
while the handler for PIO is tucked into audio_dma.c:
The handler for IRQ0 is multiplexed to handle both audio_dma and rp2pio interrupts. So, a ...
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_0will make that function the handler for theDMA_IRQ_0on 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...
@tulip sleet did you try usb host yet?
i'm just making sure it's working on an RP2040 first. It's being flaky.
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
Ok nice! Metro issue must be the high PIN numbers
@danh Are you testing with SDK 2.1? There are a number of changes there to high numbered pins on the RP2350.
I saw all that and was worried about it.
but we haven't moved forward yet
I was thinking that without SDK 2.1 you might have problems with high numbered pins. PR 9831 advances to 2.1. Maybe you're testing with the older SDK in error?
maybe -- I did have to revert a PR, but I don't remember whether I reverted it on the tip of main or not. I'll look
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)
The Pimoroni Plus 2 exposes some high numbered pins on the SP/CE connector. Testing with that might help indicate if it's SDK or Metro.
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
Let me know if there's any way I can help.
Added the following boards:
waveshare_rp2350_geekwaveshare_rp2350_lcd_0_96waveshare_rp2350_lcd_1_28waveshare_rp2350_onewaveshare_rp2350_plus(no longer carry 16MB variant, only 4MB)waveshare_rp2350_tinywaveshare_rp2350_touch_lcd_1_28waveshare_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...
If that is not possible, then being able to choose the MIDI "cable number" would already be helpful.
Looks like all I'd need is a way, from Python, to change the 0 to 1 there:
The current USB MIDI descriptor is fixed, and describes one MIDI device with two ports, one In and one Out. Do you want one device with four ports, two In and two Out? Or do you want two independent MIDI devices?
rp2pio does not yet support GPIO numbers >31 and has some RP2040-specific includes. Generalize it for RP2350.
Perhaps for now we should revert #9659 and then carefully fix the use of DMA IRQ handlers so they are set up dynamically everywhere rather than using the fixed isr_dma_0 and isr_dma_1 routines.
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()
...
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...
I am looking for either
- One device with dour ports, two In and two Out (I assume this makes the second set of ports use MIDI cable 1 rather than 0), or (if this is easier)
- A way to send and receive on MIDI cable 1 rather than 0
Pico SDK 2.1 corrects hard-coded CYW43 pin numbers in the SDK. #9831 picks up SDK 2.1.
supervisor/port.c hard codes CYW43 pin numbers guarded by CIRCUITPY_CYW43.
@danh Would you like me to pick up #9897?
I had a discord discussion with a user who was having similar issues. I think we may have recently changed the way we check for the presence of a USB connection, which is making deciding whether to do real or fake sleep more difficult. It would be worth doing some tests with older versions, and doing a bisect as needed.
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.
Let me take a closer look. I'll put what I find in the issue and let you know if it fits my skill set.
@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);
I will also consult with management about the timing of the impl.
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"
@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?
@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.
let's ask "management"
I could sure spend an hour on it once my metro arrives later today though
i have little experience with PIO or its impl, except to change neopixel timings
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).
@onyx hinge I had a misunderstanding above. I'll delete that. Don't bother to reply.
pin base is not GPIOBASE
I may be confused too, we'll see
@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?
maybe the arg is a bool: allow_high_gpios or use_high_gpios or some name like that.
gpiobase: Literal[None, 0, 16] = None (meaning infer from arguments)
and only 0/None are accepted if you're not on 2350B
what is the max number of consecutive pins that can be used?
[and I think that None should result in 16 for the "does it wrap or not" case]
32
this will be constructor argument #41 😭
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
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
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.
I think this wraparound case is "here's something the hardware happens to do", not "this is a honking great idea"
it's a hack. They should have made the bit registers 64 or 128 bits wide in RP2040
(and not implement the upper parts)
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)
is clearer, I think
the PIO instance either addresses pins 0-31 or 16-47 based on \ref pio_set_gpio_base
widening everything to 48 or 64 bits must have taken too much area or made them miss timings or something
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?
"pio_claim_free_sm_and_add_program_for_gpio_range" oh goodie
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?
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
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
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
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.
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?
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
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?
bleh, I see
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"
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
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
this sounds ok, since the wraparound case is already rare, I think. I've never seen anyone do such a design.
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)
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
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
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.
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!
ha! and no one said "but why not?". home free
"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!
Well that would be a little sad :wink: but you gotta do what you gotta do. I see that RP2350 also has a DMA_IRQ_2 and DMA_IRQ_3, could RP2350 PicoDVI be tweaked to use one of those, as a less disruptive temporizing measure, until dynamic setup can be fixed for real?
I see that RP2350 also has a DMA_IRQ_2 and DMA_IRQ_3, could RP2350 PicoDVI be tweaked to use one of those, as a less disruptive temporizing measure, until dynamic setup can be fixed for real?
This also crashes on RP2040, sadly. On a Feather DVI board, 9.2.1 doesn't even start properly because the picodvi.FrameBuffer is created in board.c. 9.2.0 is fine on that board.
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?
Is it getting a null object (hence not showing anything)? That would cause the exception
It seems to be good on the python side, and the other functions (audiosample_get_buffer_structure and audiosample_get_buffer) follow a similar path. I currently don't have a way to debug CircuitPython firmware line by line, but that may be what's needed.
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?
I was able to figure out how to use mp_printf(&mp_plat_print, ...). I'm surprised I hadn't used it before, tbh.
Years from now when I've forgotten everything else, that line will be burned into my brain.
I've narrowed it down! I should be able to take it from here. Thanks!
I can't spot anything with a quick glance now, but my guess is for some reason it is coming in NULL.
And great!
Alas. So in the dynamic setup of the future, how would the different modules that want to use these resources need to coexist? If the RP2040 Feather DVI board uses PIO for both DVI and neopixel, you're not going to be able to do any I2S on there, right?
Here is a proposed change to adabot to support this naming update https://github.com/adafruit/adabot/pull/391
GitHub
In trying 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. I ran across...
I"m wondering if they need exclusive access to the IRQ's or get away with shared access. There might glitches, but it's better than not being able to do everything at once.
Thank you! I've got a few other things to tackle first, but I've added this to my list to take a closer look at and test out locally.
@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)
@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. 🤷
OK, I won't worry about it then!
By the way, I know you're pretty busy, but if you ever want to go over the audioeffects updates that are waiting for review, I'd be happy to dive in.
I know - thanks for being understanding of that.
I'm on vacation (just at home) after Friday so feel free to poke me if you need reviews. I should have more time.
Of course! And great work on the RP1 PIO updates. That's huge. 😮
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?
Now that it has been released, can we start transplanting?
Now that https://github.com/creationid/creators/pull/80 is merged, these IDs are "live"
If you would like to work on a port, we would be happy to accept pull requests. We do not have plans to do this ourselves.
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
hunh, that's too bad :/
I was thinking how about switching the RTD theme to a dark mode one ?
@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).
@jaunty juniper can it be made to obey the browser preference?
seems that no, not for sphinx_rtd_theme. https://github.com/readthedocs/sphinx_rtd_theme/issues/224
blink and that issue will be 10
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;
}
@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.
Thank you for working on this
@stanelie OK, holidays approaching, but if I get some time I'll make a PR. I must have a newer revision of the board, my silkscreen says "RGB" rather than "IO26".
yeah there's an extension to add a toggable dark mode, but that does not default based on the browser setting apparently... I guess browser extensions for forcing dark mode on websites exist 🤷
do you have printf logging? You can enable it within tinyusb. you can also use a usb sniffer to see how far it gets
@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 */ }
Thanks @slender iron, I'll give both a shot.
I have a new small change for the screenshot utility if anyone gets a moment and can review: https://github.com/circuitpython/CircuitPython_Library_Screenshot_Maker/pull/27 This adds adafruit_connection_manager to the list of libraries that will trigger settings.toml to be included in the screenshot.
approved
Thank you
@errant grail I'll forget it before next meeting but please accept this hug report for nau7802 library!
You’re welcome! Was very happy to see it become part of the Adafruit library family.
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 ...
Tell me if there is anything I can do to help.
Cheers!
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...
I hadn't noticed until now that the tins were different between PicoW / Pico2W (both blank), and the RM2 (FCC labeling). MicroPython presumably would have also encountered this (?) but I don't spot a mention of SPI in their PR (16057).
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 ...
Here is a screenshot illustrating the phase error for an RM2 response to a read of the gSPI test register:
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...
Testing performed: on a Metro RP2350 prototype, used neopixel_write on pin A0 (GPIO41) & scoped it.
Also, the built in neopixel still works.
i believe you! but maybe @dhalbert can do a more 👁️ review
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.
@tulip sleet USB D+ is green right?
ah yes https://www.adafruit.com/product/4449 says so
green-colored wire? I don't know! and the cables might not be consistent. I was using
it's not working?
no, no errors, but not working.
White D+, green D- is standard coding.
maybe the production description is wrong
most likely the code is wrong
I was using this, which has embossed labels https://www.adafruit.com/product/3629
oh! oh ! ```>>> pwr = digitalio.DigitalInOut(board.USB_HOST_5V_POWER)
pwr.switch_to_output(True)
list(usb.core.find(find_all=True))
[<Device>]
🎉
is green D+ on that then?
@tulip sleet yes
Kicking off #CircuitPython2025! I'm excited to hear what everyone is looking forward to. https://blog.adafruit.com/2024/12/20/circuitpython-in-2025-circuitpython2025-python-circuitpython/
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.)
I've opened #9902 so that I can edit my own top post. Thanks for opening this earlier.
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.
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
digitaliothat uses the Zephyr API. - [ ] Default CIRCUITPY storage.
- [ ]
west buildsupport that uses async Python to build the CircuitPython bits.
We should be able to support BLE on everything Zephyr supports BLE on.
The fixed implementation versions of I2C, UART and SPI will live in modules separate from busio but act the same way. busio is reserved for dynamic pin construction.
@slender iron 🎉 to you as well re: zephyr
🙂 Seems promising
i believe you! but maybe @dhalbert can do a more 👁️ review
@slender iron ❤️ what you're doing with Zephyr.
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
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
@slender iron it "should" appear in the device list, as it has to be in that list so you can detach the "kernel driver"...
OK, it's something that happens when you busy-wait but not when you time.sleep. I'll file an issue.
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...
@onyx hinge thanks from me on working on the high PIO stuff and figuring out so many angles on it.
All boards are ported from their waveshare_rp2040_... counterparts with updated board descriptions and specifications. Boards were added to CircuitPython in this PR: https://github.com/adafruit/circuitpython/pull/9896.
Huh, when did heapq disappear
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
you will need to copy it into lib I suppose
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
I think it might have been moved in micropython, and then the change came to circuitpython with one of the updates
That'd make sense
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! ❤️
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.
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.
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.
