One "gotcha" that I remember from when we did it the first time to watch out for is make sure that mpy-cross is works with any typing syntax that you end up adding. In the past there were some situations where some syntax was supported in CPython but not by mpy-cross so we had to leave it out of the circuitpython libraries at the time. I know we've updated mpy versions a few times since then though.
#circuitpython-dev
1 messages Β· Page 72 of 1
Im trying to use from __future__ import annotations and if TYPE_CHECKING where/when posible, so im hoping it wont break anything (or very little)
I don't think the HSTX buys us much over using DMA + SPI or PIO. We don't have an existing bug for this so I'll tweak it to be non-HSTX specific.
I'm therefore pretty convinced now that the code should go into
boards/<board>/, and the documentation generation problem needs to be solved as a separate follow-up. I presume it should be possible to include board-specific docs somewhere somehow eventually, right?
Ya, that'd be a good idea. I think it'd help folks.
[adafruit/circuitpython] New comment on issue #9521: Third sleep option: RAM-preserving "deep" sleep
Is that correct?
Yup!
However it does sound like quite an effort to implement. I assume the alarm module would have to know about wifi, ble, SPI, I2C, ... and determine which of these are active and which are not.
It isn't easy to implement but gives a consistent API across all ports. I'd ignore this complexity first though and just make sure you are getting the power savings you are hoping for. Once you confirm that, then add in things like wifi and ble.
You'll probably want ...
ran into another typing problem now, mypy complains about doing len(ReadableBuffer) because the TypeAlias does not "implement"(no idea what's the set-theory term) Sized...
im no typing expert, but this seems to do the trick:
ReadableBuffer: TypeAlias = TypeVar(
"ReadableBuffer",
Sized,
bound=Union[
array.array,
bytearray,
bytes,
memoryview,
"rgbmatrix.RGBMatrix",
"ulab.numpy.ndarray",
],
)
```it currently is defined as: ```py
ReadableBuffer: TypeAlias = Union[
array.array,
bytearray,
bytes,
memoryview,
"rgbmatrix.RGBMatrix",
"ulab.numpy.ndarray",
]
... and same treatment would go for WritableBuffer i guess
can anyone confirm whether that looks right, before i open a PR for it? π
Hi, I was wondering about unloading modules to reclaim RAM. Deleting from sys.modules does seem to work to some extent, but isn't a supported API, and doesn't work for modules in a package that's otherwise still in use. Has there been any discussion about this?
I wouldn't do it. you can reset the VM instead
We can't do that because of wanting to maintain other hardware state
unloading isn't really a thing
It's not really a thing in desktop Python either but would have uses for embedded
Though I can understand if it's architecturally impractical
Or maybe it would be micropython's business
Draft because I will be fixing anything else I find while i working on Adafruit_CircuitPython_BLE's type hints
I just found out this because mypy complained that add_to_service was missing a positional arg (self and service were expected based on comment, but it really is a classmethod and only service has to be passed in)
This also lead me to seeing __init__ is not defined... Does that mean that trying to run Characteristic() will raise? If so, should we perhaps change ...
I think it will save some memory but not all
interned strings will still be kept for example
I have been importing and deleting modules from globals() and sys.modules since forever, with very limited success.
For my stuff I tend to just.. exec(compile(read())) in a more complicated way.
This method is the clunkiest of clunky, but can yield net 0 memory usage.
Splitting a big file into tiny files run like this makes stuff run at virtually no ram.
It wont work for libraries really though.
You can of course rewrite em to work with this method if you want though.
Ah also did I forget to mention it's slow? Like really slow?
Nope, espcamera upsteam is still using old adc api, so it's not happening yet. Imma shelve the code.
Me: Misclicks in S3 artifacts
The circuitpython build:
Actually, why am I not using the pirate version for everything?
down to from 184 to 67, it has been an exhausting evening π€
@mMerlin I had the same issue and I noticed that when I commented this out:
pool = socketpool.SocketPool(wifi.radio)
Then it stopped doing that. I'm running CP 9.1.1 on an ESP32-S3 Feather
nrf52832
I guess the only thing i've been able to find is the following
https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Fhardware_driver_gpiote.html
High accuracy: An independent GPIOTE event is used to detect changes on the pin. If a pin is configured to be controlled in this mode, a high frequency clock is required.
Low accuracy/low power: A PORT event senses level changes on the pin. One PORT event can be used for multiple pins....
CircuitPython version
Adafruit CircuitPython 9.2.0-alpha.2350-19-gc53a0cb864 on 2024-08-19; Raspberry Pi Pico 2 with rp2350a
Code/REPL
import time, board, touchio
touchin = touchio.TouchIn( board.GP2 )
while True:
print( touchin.value )
time.sleep(0.1)
Behavior
Pin GP2 has a 1M resistor going to GND.
code.py output:
Traceback (most recent call last):
File "code.py", line 2, in
ValueError: No pulldown on pin; 1Mohm recommen...
as a workaround, I switched to bitbangio.I2C for my qtpy esp32-s2.
@todbot and @tyeth do you have wifi credentials in settings.toml? Dan repro'd this using a manual import wifi after USB comes up instead of settings.toml.
I've spent all day debugging this with little progress. The USB interrupt fires, enqueues the event but the tinyusb task never runs to pull from the queue. This happens after esp_wifi_start() is called.
I'm having a very similar issue with I2C on QT-PY-ESP32-S2. I've come at it all kinds of ways, with one or multiple I2C devices and varying the I2C bus speed from 10_000 to 400_000.
With these i2c devices:
-
adafruit_ssd1306 -
adafruit_seesaw (rotaryio: product number 4991)
When I do a i2c.scan() it never shows any devices, but I can "speak" to the rotaryio. When I enable the ssd1306, I get:
main.py output:
sys.implementation=(name='circuitpython', versi...
@tedder notes:
as a workaround, I switched to bitbangio.I2C for my qtpy esp32-s2.
@mMerlin I'm experiencing the same issue. ESP32-S3 Feather TFT REV, CP 9.1.1.. Basically just connecting to wifi in beginning of script and reading the voltage on A4 inside of a while loop. I go into safemode from the same watchdog timer expiration error after about 20min.
This could be an artifact of our tick speed change from 100 to 1000. That shortens timeouts like:
I did try changing the number of ticks to 1000 in I2C.c. Unfortunately, I still got the same ETIMEDOUT. I agree it should be fixed as you mentioned.
If I wanted to do some "printf debugging" out a UART on the raspberrypi and espressif ports, what's the magic make incantation? (if there is one, maybe I'm mis-remembering)
@todbot and @tyeth do you have wifi credentials in settings.toml?
In my test two weeks ago, I did not have a settings.toml file. Nor did I test WiFi, just if the board came up on USB. I just now created a settings.toml on the FunHouse with that firmware, giving a proper CIRCUITPY_WIFI_SSID &CIRCUITPY_WIFI_PASSWORD and the device appeared to immediately reset and disappear off USB. The FunHouse display does come up and says "Wi-Fi: No Ip" but is otherwise a brick.
As in: enabling CP core's debugging prints or making Python-level print() go into UART instead instead of REPL (or both?)
If former, i would guess it is just something like DEBUG=1
@Timeline8 @bill88t Hey guys, whatβs the status on this? Iβm also experiencing this issue on 9.1.1 on an esp32 s3 feather. Using adc on A4 while connected. Runs for about 15 - 20 min and get the watchdog error.
Sorry, yes. I'm building CircuitPython and doing tests in C. I believe DEBUG=1 gets turned into CIRCUITPY_DEBUG which I don't see doing anything specific beyond printing a backtrace in espressif port. I'm looking for concrete, known solutions, not "well it should work like this"
Yeah, didnt mean it as an actual answer, but trying to specify what the question meant
Okay looks like it used to be UART_DEBUG_TX & UART_DEBUG_RX and is now perhaps CIRCUITPY_CONSOLE_UART_TX & CIRCUITPY_CONSOLE_UART_RX from https://github.com/adafruit/circuitpython/issues/5904 and https://github.com/adafruit/circuitpython/blob/main/supervisor/shared/serial.c#L145
Has anyone else noticed that SSL (loading web pages) works on esp32-c3 and s2 etc, but not on generic esp32 ?
@dave4jr I did perform some more tests, force-feeding watchdog, so we get no watchdog resets, only to get a hang.
(Where the watchdog does not save us from.)
I cannot get a crash dump, so I cannot debug this any further.
The only workarounds currently confirmed working are:
- Having bluetooth paired.
- Configuring CONFIG_FREERTOS_UNICORE at compile time.
Notes inside my head that could prove useful:
- IDF5.3 fixed the similar temperature bug, perhaps tracking back the commit wi...
This was tested, so if you are seeing a problem, please open an issue with a small example. Test using 9.1.1 or the latest main version (or both).
CircuitPython version
Adafruit CircuitPython 9.1.0 on 2024-07-10; Waveshare RP2040-Zero with rp2040
Code/REPL
import sys
help(sys.stdout)
Behavior
object is of type FileIO
Description
Docstring for stdio indicates "FileIO", which is a binary IO stream. As detailed in #553, stdio is not binary by design; its docstring should indicate "StringIO".
Additional information
No response
If you would like to make a pull request to fix this that would be great. If you have other doc fixes you can combine them into one PR.
Fixes #9543.
Docstring for stdio indicates "FileIO", which is a binary IO stream. As detailed in #553, stdio is not binary by design; its docstring should indicate "StringIO".
Yup, this is the way to do it. There is a console_uart printf for it too
@tulip sleet are you going to get the MP merge out for review today?
Thank you! MicroPython probably has this issue as well. This is code from them.
@dave4jr , as @bill88t mentioned, this was never resolved unfortunately. In the meantime I have reluctantly been trying out DS18b20 "1 -Wire" bus temperature sensors which work well enough but they come with their own set of inconveniences and problems not present when using a simple thermistor (which mean extra coding just to try and protect against these added problems). My preference would be to go back to my thermistor setup but this ADC bug makes that impossible on S3 modules when also u...
as described in the Pico-SDK docs?
That code may pre-date the pico-sdk having an API for it. :-)
There is an errata around pull downs and input too. That will likely impact this too.
I have a couple of builds that are too big. I'm going to look at those, but I could also forget about that now and just un-draft the PR and fix those later.
I spent a long time on a test failure that was a double bug and was ultimately unimportant.
Go ahead and undraft. I'll look today. Not sure how much I'll be around later in the week
I'd like to get it merged since its been pending for a while
me too!
we can bug fix after
@dhalbert This is ready for a final look.
Ready for review. There are two builds failing due to space issues. This is a bit surprising, but I don't think this should hold up reviewing the whole thing. I'm thinking there may be some extra math code or something like that. I will look and see what grew.
This looks good, and I'm depending on @ZodiusInfuser for the details like VID/PID, etc.
For the record. USB PIDs are publicly documented here: https://github.com/raspberrypi/usb-pid/blob/96bdf45629c09004f2d628b9573d7a901a64eb23/Readme.md?plain=1#L187-L190
[also put in OP]
Update: out of draft mode.
Everything builds except for two too-large builds, which I will fix soon, either here or in a later PR. Smoke tests work.
- I added quite a few more
CIRCUITPY-CHANGEannotations. They are more or less complete now. - I updated the https://github.com/adafruit/Adafruit_CircuitPython_asyncio library. The changes are currently in a branch: https://github.com/adafruit/Adafruit_CircuitPython_asyncio/tree/v1.22-merge. That branch is what is...
Funhouse has DotStars attached to SPI that exercises this bug. Most boards are NeoPixel and avoid this.
Fixes #9486
should I back port the fix to 9.1.x instead?
Thanks for doing this! Just a few minor things. Mostly typos
// CIRCUITPY-CHANGE: enable FAT32 support
Is this right?
# CIRCUITPY-CHANGE: use $(Q)
// CIRCUITPY-CHANGE: supports signed
// CIRCUITPY-CHANGE: prevent warnings
@slender iron I'm looking for advice on general approach to tracking down USB stack bugs... I'm having trouble with writing USB gamepad drivers where stuff that works in PyUSB on Debian doesn't work with usb.core + max3421e.Max3421E on ESP32-S3. I'm seeing 0 or None Python values that make me suspect unhandled error conditions somewhere in C-land.
Context: I've had good luck with reading button press reports from an 8BitDo SN30 Pro USB gamepad (wired version) on CircuitPython. But, when I try to talk to an 8BitDo Universal Wireless Adapter 2, various weird stuff happens. For example, sometimes core.find(idVendor=0x045e, idProduct=0x028e) will give me a device, but then when I try to read the .idVendor or .idProduct, they come back as 0. Or, sometimes I will catch a usb.core.USBError that has an empty description string and None for its .errno.
From Wireshark captures, I know that this wireless adapter does stuff that might exercise the Max3421E or usb.core error handling. For example, it changes its vid:pid abruptly when a bluetooth gamepad connects. Also, when polling for gamepad button reports, the first read always gives an error (on debian PyUSB, it's errno 75, "Overflow"), but a second read immediately following that error usually works. When I try the double-read approach in CircuitPython, it never works.
To me, this smells like certain USB error conditions, perhaps at the max3421e.Max3421E level, or maybe higher up in usb.core, are not getting handled. Since the Max3421E has an interrupt pin, I worry maybe there's some complex stuff going on at the IDF level. Or, maybe it's an easy fix. I'm interested in looking into this (maybe a PR if I can figure it out?), but I'm not sure where to start looking. Do you have any advice on a general approach to tracking this down?
You might want to try it with the fix I just posted
You can try replicating it from tinyusb code without circuitpython
you mean this one? https://github.com/adafruit/circuitpython/issues/9486
Will a CI build for that turn up automatically if I wait a day or two?
what board are you on? I can build it for you
oh wow, thanks. there's no rush. but, I'm using Feather TFT ESP32-S3
it's one of the 4MB flash ones where the .BIN file works, but the .UF2 method has trouble because there's not enough space on the CIRCUITPY drive for the firmware file
Yay! Yes, backport to 9.1.x
the PR is for 9.1.x
excellent
@tiny peak adafruit_feather_esp32s3_tft
by "replicating from tinyusb code without circuitpython", do you mean making an Arduino version of my code?
oh wow, cool! I'll try the .bin file. Thanks!
I was thinking plain C. There is an examples folder in the repo
oh, okay. I'll see if I can figure out what's up with the examples folder
or you could print from within circuitpython too
do you have any guesses about which part of the Max3421E or usb.core code might be doing something weird if it happens to be the case that there's some kind of unhandled error condition around reading from an endpoint on a device that's been configured okay?
are you getting the product string? https://github.com/adafruit/circuitpython/blob/main/shared-module/usb/core/Device.c#L115
sometimes?
the pattern to a lot of this stuff is that something weird happens on the first try, but then it behaves better if you repeat the request
Tested on FunHouse. import wifi works!
https://github.com/adafruit/circuitpython/blob/87f7bc9fcc74e8ada4f255a8d7824f46a039995c/py/circuitpy_mpconfig.h#L473 will print tinyusb debug stuff to a uart too
With some consistency, I can get to the point where the device is configured and I can read from the endpoint, but then I get weird exceptions with no error message string
the Device.c code I linked to doesn't do much error checking
oh wow, CIRCUITPY_DEBUG_TINYUSB looks like it might be really useful. that should send stuff out on the TX pin then?
I think you need to set the uart console too
because you don't want it going out usb
okay. I can work with that. I'll try that build you sent me and see if I can get any interesting debug messages from tinyusb. Thanks!
you'll need your own build to enable the debug message stuff
okay... I figured out how to do that for some of the SAMD boards a while back, so hopefully I'll be able to figure it out for espressif.
I'll give it a try
the building circuitpython guide has instructions for esp too
esp-idf is a bit different from samd
are they current? seems like I recall discussions here about all the docs being wrong?
ya, the building guide is up to date. it's the extending one that is out of date
oh, okay, fabulous
thanks again. I'm gonna stop here to copy some of these notes out into a non-scrolling-away-by-the-minute document, then try some of your suggestions.
np π
After merging #9545 into main, this looks better to me. On restart it does glitch a little but it doesn't during the while True:.
Please retest after that fix propagates.
I did :), and forgot to remove the comment.
Oops. I run pieces of this at a time.
It is possible this was caused by #9545 because the display release will deinit the SPI bus incorrectly. Let's see if the next release has this problem.
I'm unable to reproduce this. I can do microcontroller.reset() just fine. Does it happen with the latest main for you?
Does this crash in 9.1.1? It doesn't for me.
Hey, @slender iron pointed me here. i have a P4 devkit and would like to start trying to port CircuitPython over to it. I've gotten to the point where it builds, but it's not running yet (invalid header on boot, I think it's the flash setup). I have the fork here. I'll keep working on it, but should I post this as a WIP PR? Does anyone else here have the P4 devkit and want to pitch in ? https://github.com/adafruit/circuitpython/compare/main...bwhitman:circuitpython:main
just tested again with Adafruit CircuitPython 9.2.0-alpha.2350-23-ge5e9c5ca84 on 2024-08-21; Adafruit Feather ESP32S3 No PSRAM with ESP32S3 and i had the same result with windows 11
In the REPL, try doing:
import _bleio
_bleio.adapter.erase_bonding()
and see if that makes any difference.
i tried that and it did connect for a second but then disconnected and said "driver error" under devices. tried on macOS ventura and the same result occurred- connects for a second and then disconnects. i tried on iOS and it will connect but i can't get a key input to transfer and on the CircuitPython side the REPL is recognizing the button input
I tried your alpha build. The USB weirdness still happened, and it seemed to act pretty much the same as with a normal 9.1.1 build.
Not to muddle up this topic but I also noticed a maxlen limit of 128 pulses on an ESP32-S3 QTPy no PSRAM. My main issue was that PulseIn doesn't work at all to capture a set of pulses (<128) from a constant pulsed data stream. Details here
I have almost finished fixing the typing of BLE lib and didnt find any more issues with respect to _bleio stubs, ready for review here (:
Ideas about the __init__ question i posted in the PR's description? π
Thanks for workign on this.
This also lead me to seeing
__init__is not defined... Does that mean that trying to runCharacteristic()will raise? If so, should we perhaps change the type hint from-> Noneto-> NoReturnor the like?
Yes, calling the constructor raises an exception:
>>> from _bleio import Characteristic
>>> c = Characteristic()
Traceback (most recent call last):
File "", line 1, in
TypeError: cannot create 'Characteristic' instances
The `...
My concern was not really showing vs not showing the __init__ signature on the docs/stubs, but being able to type-hint it correctly.
Skipping it on the doc-comment, {MyPy/Intellisense/whatever} would assume we have a "default" def __init__(self) -> None signature, which is valid to call, while having it marked as -> NoReturn would explicitly mark it is a forbidden operation....
However, i've been testing locally for a bit and can't find a way to "describe" this behavior su...
OK, I see what you mean. In pure Python, I think you always have an __init__(), explicit or implicit, that is callable. We are circumventing that because the class implemented natively and we can prevent that.
This is interesting: https://stackoverflow.com/questions/46779046/correct-type-annotation-for-init. It says that the return type annotation could just be omitted.
Im not sure about this, but i think that adding -> None is required for type checkers to "look into" your function's body. Without the explicit typing (and given the lack of typed arguments), tooling will/could say "oh, this function is yet to be typed, im not running any analysis on its body"; so, even if if is not required, i think it is nice to add.
The idea for NoReturn (or Never) is to represent a function that never has an actual return endless loop, sys.exit killing the ...
Nice job getting it building! Go ahead and post a draft. Iβm out today but will look when I have a chance
@spare jacinth re the return type of __init__(). As https://stackoverflow.com/questions/46779046/correct-type-annotation-for-init points out, __init__() actually returns None. The constructor returns an object with the type of the class. We have been saying __init__() returns a typed object, but that's not really what's going on.
@spare jacinth oh never mind, it is already -> None! I was misremembering.
you can't call the constructor directly, but I wonder if you can call __init__() on an already-constructed Characteristic directly.
it's a bit confusing because the signature is being overloaded with the constructor arguments
yeah, and the problem is that, since ClassName() is (internally):
class_name = ClassName.__new__(*, **)
class_name.__init__(*, **)
``` we apparently can't tell (and it is reasonable, because this is not happening on a Python, but C level) the type system that the second part of that will fail (but first one wont, as we can instantiate by other means)
.... or something like that π€£
anyway, I think it's fine to leave it alone as None
so, as said... leaving it be, no red underline when (if) user mistakenly does a ClassName() and they will simply crash at runtime
there is no pure python analog to what we are doing
yes, so I don't see how to mark it as an error
(then they read the message and fix their code, and everyone is happy)
ok, so I will go ahead and approve the PR, unless you want to do anything else
is good for me, worst case i can always open a second one
dang, i just found another one π€£
@deshipu Note that I had to shrink pewpew_lcd by turning off the samd module, because of one translation that was too large. If you want to turn off something else instead, go ahead with a PR. See https://github.com/adafruit/circuitpython/pull/9469/commits/28887ab3b021f1232ce82cbeee2d2282eea77221.
Here, prefixes is definitely not a ScanEntry (or is it? π€ ) but what is a mp_buffer_info_t
ReadableBufferIterable[ReadableBuffer]- else
//| class ScanEntry:
//| """Encapsulates information about a device that was received during scanning. It can be
//| advertisement or scan response data. This object may only be created by a `_bleio.ScanResults`:
//| it has no user-visible constructor."""
//|
//| def __init__(self) -> None:
//| """Cannot be instantiated directly. Use `_bleio.Adapter.start_scan`."""
//| ...
//|
//| def matches(self, prefixes: ScanEntry, *, match_all: bool = True) -> bool:
//| """Returns True if the ScanEntry matches all prefixes when ``match_all`` is True. This is stricter
//| than the scan filtering which accepts any advertisements that match any of the prefixes
//| where ``match_all`` is False."""
//| ...
static mp_obj_t bleio_scanentry_matches(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
bleio_scanentry_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);
enum { ARG_prefixes, ARG_match_all };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_prefixes, MP_ARG_OBJ | MP_ARG_REQUIRED },
{ MP_QSTR_match_all, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} },
};
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
bool match_all = args[ARG_match_all].u_bool;
mp_buffer_info_t bufinfo;
mp_get_buffer_raise(args[ARG_prefixes].u_obj, &bufinfo, MP_BUFFER_READ);
return mp_obj_new_bool(common_hal_bleio_scanentry_matches(self, bufinfo.buf, bufinfo.len, match_all));
}
static MP_DEFINE_CONST_FUN_OBJ_KW(bleio_scanentry_matches_obj, 1, bleio_scanentry_matches);
it is a readable buffer. It's usually a bytes or bytearray
mypy says: adafruit_ble/advertising/__init__.py:353: error: Argument 1 to "matches" of "ScanEntry" has incompatible type "bytes"; expected "ScanEntry" [arg-type]
trying with adafruit_typing.ReadableBuffer now, then
that did the trick, nice
lets not merge this one until i have everything solved locally π
Automated website update for release 9.1.2 by Blinka.
@slender iron That LWN article you mentioned from a few weeks ago is free now: https://lwn.net/Articles/984216/
I made this change in main but we need it in 9.1.x also. Not urgent, as I'll ignore the build error for the 9.1.2 release now.
would love some testing/feedbacks here, TIA π
https://github.com/adafruit/Adafruit_CircuitPython_BLE/pull/200
there are a couple of places with typing hard/imposible (at least with my knowledge) to represent....
however, i didnt feel like breaking API and just made a couple of hacks to (eg if TYPE_CHECKING: @overload blocks, assert, and a couple of type: ignore), but it's hopefully not too gross for a merge π
https://blog.adafruit.com/2024/08/22/circuitpython-9-1-2-released/
Highlights of this release
- Fix Adafruit FunHouse build, which was not working.
- Correct pins for Adafruit Feather ESP32-C6.
- Allow wider range of counts for Counter, FrequencyIn, and IncrementalEncoder.
- Prevent crash or hang on nRF boards when stopping VM and BLE is not running.
Automated website update for release 9.2.0-alpha.2351 by Blinka.
New boards:
- adafruit_vindie_s2
- cytron_iriv_io_controller
- espressif_esp32s3_devkitc_1_n16
- lilygo_twatch_s3
- pimoroni_pga2350
- pimoroni_pico_plus2
- pimoroni_plasma2350
- pimoroni_tiny2350
- sparkfun_pro_micro_rp2350
- unexpectedmaker_omgs3
- unexpectedmaker_rgbtouch_mini
Not sure how to tell if #9545 is in new 9.1.2 (uf2 downloaded half an hour ago), but still get the display glitches with that version.
Port for this board: https://github.com/WeActStudio/WeActStudio.MiniSTM32H723
- includes:
- support for the QSPI Flash as the main CIRCUITPY drive
- support for OLED display
- support for the SD card
same, i just tested 9.1.2 the alpha 2351 and am still seeing the same glitches on the display
#9545 and its equivalent are in both 9.1.2 and 9.2.0-alpha.2351.
https://blog.adafruit.com/2024/08/22/circuitpython-9-2-0-alpha-2351-released/
Highlights of this release
- Fix Adafruit FunHouse build, which was not - working.
- Correct pins for Adafruit Feather ESP32-C6.
- Prevent crash or hang on nRF boards when stopping VM and BLE is not running.
- Many new RP2350 boards.
- Update to Espressif ESP-IDF V5.3.
- Merge MicroPython updates from v1.22.2.
only this is left to finish my PR fixing typing```
adafruit_ble/services/nordic.py:82: error: "Characteristic" has no attribute "read" [attr-defined]
adafruit_ble/services/nordic.py:94: error: "Characteristic" has no attribute "readinto" [attr-defined]
adafruit_ble/services/nordic.py:103: error: "Characteristic" has no attribute "readline" [attr-defined]
adafruit_ble/services/nordic.py:108: error: "Characteristic" has no attribute "in_waiting" [attr-defined]
adafruit_ble/services/nordic.py:112: error: "Characteristic" has no attribute "reset_input_buffer" [attr-defined]
adafruit_ble/services/nordic.py:116: error: "Characteristic" has no attribute "write" [attr-defined]
as far as i can tell, the problem is here: (removed some useless details)```py
class UARTService(adafruit_ble.services.Service):
_server_tx = StreamOut()
_server_rx = StreamIn()
# FYI: these two classes inherit from ComplexCharacteristic
def __init__(self, service: Optional[_bleio.Service] = None) -> None:
super().__init__(service=service) # <--- there's some magic here with getattr and settatr
self._rx = self._server_rx
self._tx = self._server_tx
sorry for the ping @slender iron but the magic code there is (at least partially) yours, and it is better and faster to ask than trying to understand what is going on there...
can you confirm whether that code does some things that are not obvious, and _rx and _tx end up being CharacteristicBuffer's? (i think that's the actual type because of the methods being called on them, but im not too positive on that either).
instead of reading/understanding, may as well just run an example and call type(uart._tx) but i dont have any hw to do so π¦
CircuitPython version
Adafruit CircuitPython 9.1.2 on 2024-08-22; Adafruit Feather ESP32-C6 4MB Flash No PSRAM with ESP32C6
Code/REPL
import board
from digitalio import DigitalInOut, Direction, Pull
pwr = DigitalInOut(board.NEOPIXEL_I2C_POWER)
pwr.direction = Direction.OUTPUT
print(pwr.value)
pwr.value = True
print(pwr.value)
Behavior
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:...
Bumps rexml from 3.3.3 to 3.3.6.
Release notes
Sourced from rexml's releases.
REXML 3.3.6 - 2024-08-22
Improvements
Removed duplicated entity expansions for performance.
GH-194
Patch by Viktor Ivarsson.
Improved namespace conflicted attribute check performance. It was
too slow for deep elements.
Reported by l33thaxor.
Fixes
Fixed a bug that default entity expansions are counted for
security check. Default entity expansions should not be counted
b...
that typing is better but still doesnt pass all checks π€ π€
I think thatβs right. Complex characteristics replace themselves with another type
only this one left π adafruit_ble/services/nordic.py:119: error: "CharacteristicBuffer" has no attribute "write" [attr-defined]
by the way, for the readinto(buffer, nbytes) syntax to work i had to tweak comments once again (commit) but there's a comment:
static const mp_stream_p_t characteristic_buffer_stream_p = {
.read = bleio_characteristic_buffer_read,
.write = bleio_characteristic_buffer_write,
.ioctl = bleio_characteristic_buffer_ioctl,
.is_text = false,
// Disallow readinto() size parameter.
.pyserial_readinto_compatibility = true,
};
but... looking for pyserial_readinto_compatibility (or even readinto_compatibility) i only see it on the typedef struct declaration, and some objects setting the flag to true... is it not accessed anywhere? π€
that type doesnt have a write either π , maybe a BoundWriteStream which does pass mypy's checks
descriptors are really a pain to reason about, they are very cool and come handy, but once there's a non-trivial usage of them.... my brain leaves the room
oh yeah, that would match {StreamIn, StreamOut}.bind return type, which is Union[_bleio.CharacteristicBuffer, BoundWriteStream] (depending on direction of the conn)
LGTM
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO5) },
I think we also want GPIO19 here for enabling the battery monitoring, it's BAT_ADC_EN on the schematic.
What is the purpose of this? Don't you also need
https://github.com/adafruit/circuitpython/blob/main/ports/espressif/boards/ai-thinker-esp32-cam/mpconfigboard.h#L16-L19
for this to work? And don't you want to add it to the module globals then?
I reproduced this. It's mysterious. Debugging.
I have come across this as well on the Qualia S3.
I tested both 9.1.2 and 9.2.0-alpha.2351 and both do have the glitchy screen pixel artifacts.
I tested releases back to 9.0.5 and found it to be the most recent one that has a clean display for this project: https://learn.adafruit.com/1d-chomper-tabletop-arcade-game/overview
that has been my experience as well, 9.0.x has no glitching
CircuitPython version
n/a
Code/REPL
n/a
Behavior
n/a
Description
I'm trying to set up an Espressif build environment from scratch, and I hit a couple documentation snags.
- Looking at the main CircuitPython README, I had a hard time locating where I should start looking for build documentation. Eventually I realized there's a BUILDING.md file, which was helpful, but that file is hard to notice amidst many other top level files. Before t...
Did you look at https://learn.adafruit.com/building-circuitpython ? We don't really try to keep the README's up to date, and should probably remvoe most of them.
Yes, I eventually your guide and have been working through its instructions. That's where I ran into the order of operations trouble with fetching submodules relative to installing the esp-idf with install.sh.
If it would be helpful, I could make a PR with some edits (maybe CONTRIBUTING.md and ports/espressif/README.md). Not sure which branch the PR should be made against though.
Thanks - I would like to have the info in the guide, rather than in the README's, because it's easier to maintain. But I know this goes against the grain of having build info in the source code. Nevertheless, the build setup is complicated enough that I'd rather just cross-reference to the guide.
It can go against main.
- Fixes #9551
espressif_board_reset_pin_number() was being used on many boards to set certain pins high or low on startup. However, it was using basic gpio functions without ensuring that the IOMUX for pin was set to GPIO. This meant the GPIO settings were not necessarily taking effect. This may have caused issues on other boards we didn't know about besides the Feather C6 from #9551.
I added a helper routine to ensure that gpio_config() was called before setting the pin level. ...
[adafruit/circuitpython] Pull request opened: #9554 Make Building CircuitPython guide easier to find
These documentation edits are meant to steer new CircuitPython core developers towards the Building CircuitPython Learn Guide.
This relates to issue #9552 , which describes a couple minor problems I had with navigating the build documentation to set up a build environment for the Espressif port on Linux.
Thanks for this. One spelling typo only. I'm also interested in Scott's opinion about what should be in these files.
The CircuitPython core is implemented mostly in C. If you want to add support
@samblenny: You should also have a look at the Readme and scripts in .devcontainer. These scripts (start with install_build_env.sh) are tailored to run on a Github codespace, but changing REPO_ROOT and setting CP_TOOLCHAIN=esp-idf and CP_PORT=espressif should make them run on a PC too.
fantastic, thank you Dan! i tested with the C6 and the pin is high without having to manually set it. also tested with an s3 TFT feather and s3 feather no psram and both of those were still functioning properly
tested with C6, s3 tft and s3 no psram feathers
Keep stdout as StringIO, but revert stdout.buffer type back to FileIO.
Earlier commit changed stdio docstring/type to StringIO and included stdio_buffer_obj in that. Reviewing history for that object, it is intended to implement (e.g.) stdout.buffer, which is a binary stream.
Missed this in the previous PR to update to Node.20. This should get rid of the last warning we're seeing on the builds.
actually experiencing this issue,
i was trying some stemma qt boards and i noticed they are not automatically Powered ON in circuit python.
i need to manually turn it on, but i believe this shouldn't be needed:
import digitalio
digitalio.DigitalInOut(board.NEOPIXEL_I2C_POWER).switch_to_output(value=True)
# using board.STEMMA_I2C() or board.I2C() apparently doesn't matter in this board as they are the same pins
@migs35323 try installing this build artifact bin file from https://github.com/adafruit/circuitpython/pull/9553: https://github.com/adafruit/circuitpython/actions/runs/10519459507/artifacts/1845423644
this fixes the power pin issue
@migs35323 try installing this build artifact bin file from #9553: https://github.com/adafruit/circuitpython/actions/runs/10519459507/artifacts/1845423644
this fixes the power pin issue
yep, it fixed it apparently! breakout board is powered on automatically, not even needed to create the i2c
while testing my changes to doc-comments, i've run make stubs and noticed that within its output there were several warnings for some untyped stuff, and im trying to get those sorted
on this function am i understanding correctly that it modifies the bitmap in place, and also returns a reference to it? in other words... should should it be -> displayio.Bitmap, -> None, else?
attempted to submit an api example to adafruit_requests and getting a new ruff error never encountered before. any ideas?
not that im a ruff expert, but to me that sounds like a warning similar to:
hey, you've told me to run the check named "PLC2401", but i'm not running it because that's an experimental(preview) feature and you haven't enabled the preview mode
... or something similar
(and same for the other code names, of course)
Fixed in 9.1.x (no release yet) by #9553. Will be merged into main soon.
Currently only merged PR's to main are uploaded to https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin. This is an attempt to upload merges for all branches ending in .x, so 9.1.x, etc.
The string operations available in if statements in the CI yaml files are limited. There are ways to do regexp, etc., that involve generating a result and then using it, but it's clumsier. However, I think doing it for *.x branches is probably good enough.
Only way to test this...
In-case it can be useful, I put together a small reproducer that shows the glitchy qualia screen.
import time
import board
from adafruit_qualia import Qualia
from adafruit_qualia.graphics import Displays
import adafruit_imageload
import displayio
# Create the Qualia object for the 240x960 display PID 5799
qualia = Qualia(Displays.BAR240X960)
# OR create the Qualia object for the 320x960 display PID 5805
# qualia = Qualia(Displays.BAR320X960)
display = qualia.display
...
The warnings about preview can be ignored. The ruff-format hook that failed is basically the new version of black. So that just means that the format got modified when it ran the formatting tool. You should be able to just run pre-commit again and it will not fail the second time since it does the formatting automatically when it fails.
I wannabe a deepdiver @slender iron
(I saw a YT notification, so I have no excuse)
yeah i tried that and failed with the same message. i just sync'd my repo with requests. posted the file in there manually in my github website repo and it went through.
i'm running a custom pre-commit with powershell so my guess is i need to change something with it. :/
Done!
not too sure what your environment/setup is... but would likely be a better idea to develop under WSL than messing with powershell π π
Oh I went through a lot of trouble to get that powershell script working with pylint, black, and pre-commit. π https://adafruit-playground.com/u/DJDevon3/pages/github-desktop-crlf-to-lf-powershell-workaround
yeah, i remember reading some of the messages back then... my point being that if your windows is recent enough to be compatible with WSL (thus the "i dont know your setup" part), i would use it (it's a builtin Linux "virtual machine") rather than messing with Windows<->Linux conversion issues running stuff on cmd/powershell
I know ruff is a recent addition and likely what is throwing off my script since I'm not accounting for ruff.
i tried WSL and it presented issues of its own. i'd rather just use windows.
im now curious what those were π€£
and they might have been easier to solve than the powershell hackaround
anyway, i dont see anything that looks wrong on your previous message, with regards to pre-commit's output
as foamyguy said, the pre-commit check "failed" because ruff-format introduced changes (aka: reformated some of your files)
unless those changes were some CRLF/LF changes, you just git add the files (or maybe they already get added after being format, idk) + try and commit again?
I was trying to use the stemma pins on some feather or qt py adafruit boards without using i2c (using other interfaces or simply the underlying gpios)
and i noticed that there is no easy way to identify these pins without consulting code, datasheets or other resources...
while one can use board.STEMMA_i2C to create the i2c interface, i believe there should be a way to use these pins with other interfaces.
example1:
import board
import digitalio
led1 = digitalio.DigitalInO...
Follows up on the conversation in https://github.com/adafruit/circuitpython/issues/9463 and in Discord.
Draft PR, should be working but not tested in every possible way, posting for discussion purposes.
What this patch does:
- On ports without native USB, don't consider the console connected once there have been no new bytes for a while
- Configure UART wakeup(Note: the initial few bytes will always be lost with the hardware UART in sleep)
- Enables tickless idle but does not actua...
A small update: here are two scope traces of this code:
import time, board, touchio
while True:
try:
touchin = touchio.TouchIn(board.GP5)
touchin.deinit()
except ValueError as e:
pass
The first one (RP2040 Pico) shows what I would expect: signal goes high for 10 us, then nice exponential decay to ground. The second one (RP2350 Pico2) shows the weirdness. After the 10us wait, it holds at ~2.2V until the pin is deinited.

CI failed because it's not an actual thing, unsure what to do
can you just omit it? we don't have to annotate everything, or does mypy complain bitterly
you could make it Any
yeah, that was my line of thought
i haven't run mypy on it, not directly at least... i just noted some [WARN] lines when i ran make stubs and fixed them π
no idea which tool is used for that π€£
see circuitpython/Makefile stubs: target. It runs some scripts
in particular tools/extra_pyi.py, which uses ast
as far as i can tell, the codeop.compile_command function is a tiny wrapper for mp_builtin_compile_obj, whose return seems to be of type mp_type_code.... and im guessing all C/Py types should be somehow import-able from Python level, right?
yeah figured that much... i mean i dont care what is being run, i simply wanted to silence it
Anyway, i will just omit proper typing
Well, there is such a type:
dafruit CircuitPython 9.0.5 on 2024-05-22; Adafruit Circuit Playground Bluefruit with nRF52840
>>> import codeop
>>> c = codeop.compile_command("1+2")
>>> type(c)
<class 'code'>
yeah, i've gotten that far on my REPL too, but dont know where code can be imported from
you can't import it, any more than you can import int
was not in the "implicit namespace" (whatever the proper naming is), nor in builtins
It's not visible in CPython either:
ython 3.12.3 (main, Jul 31 2024, 17:43:48) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import codeop
>>> c = codeop.compile_command("1+2")
>>> type(c)
<class 'code'>
>>> code
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'code' is not defined. Did you mean: 'codeop'? Or did you forget to import 'code'?
>>>
so, Any it is
I don't see any type annotations that use code in CPython either
nobody seems to have bothered to write type annotations for the builtin functions/modules
or at least they are not in the documentation
PR ready to go from my end, lets see if CI is happy as well
time for me to go bed, 4AM already here (:
and thx for the feedback!
good night!!
is there a reason not to generate stubs for the micropython module? namely: prevent typing issues with from micropython import const, but there might be other types/functions in there that im not aware of and would also be nice to stub
ok, i think i've answered myself
- it comes from
py/notshared-bindings/(i first thought it was a CP-specific extension to access MP things) - micropython doesn't add comments to document the python-exposed API
- adding them would (probably) cause merge conflicts
- ...and keeping a separate
.pyifile doesn't sound like the best of ideas, as it could easily end up out of sync
any ideas on how (if) to handle this?
@spare jacinth @tulip sleet ```>>> c = codeop.compile_command("1+2")
isinstance(c, types.CodeType)
True
I think the correct annotation is CodeType
is that in CPython?
yes
sounds good
Nice, thanks
I thought types wasnt in CircuitPy and didnt even check it, should have done it
Though it doesnt even matter as the import is on a pyi file which CircuitPython wont ever see π€¦ββοΈ
right, since CircuitPython totally ignores all the annotations
[adafruit/circuitpython] New comment on issue #9521: Third sleep option: RAM-preserving "deep" sleep
Makes sense π
One last thought: While this ensures a consistent API, the actual power consumption achieved by light sleep would become somewhat inconsistent (entering light sleep at different points in the code might result in different power consumptions). And forgetting to deinit a certain peripheral could result in an unexpected higher power consumption. Debugging this could become rather challenging.
But this issue could maybe be solved by adding a new optional flag argument to `light...
... so I figured that making a subclass of DemuxKeyMatrix is a bit of a pain and instead just made a cardputer_keyboard module.
The module exposes the KEYBOARD object as well as the functions detach_serial, attach_serial and key_to_char.
As previously, the board starts with the serial "attached". If the user does not need it, they can do something like:
import cardputer_keyboard
cardputer_keyboard.detach_serial()
...
event = cardputer_keyboard.KEYBOARD.events.get()
...
Just FYI, there's the micropython-stubber project:
https://github.com/Josverl/micropython-stubber/
And some relevant discussion of documenting more of MicroPython inline:
GitHub
Generate and maintain stubs for different MicroPython ports to use with VSCode and Pylance, PyRight, Thonny, PyCharm or MyPy - Josverl/micropython-stubber
Hello everyone, I'm so glad to join you all. Excuse my ignorance at this point. I have spent last 48hs studying and making tests with my CLUE devide. I have managed to use several of the examples and do some changes. But now, I'm was trying to use the adafruit_ble_broadcastnet to broadcast the pressure. I managed to broadcast but there's no sense in the hexadecimal values I get from the Bluefruit Connect App. I should be receiving something like 1030.98 hPA in hexa, but I'm unable to find how to convert it. I know that 2208 0303 0002 0A0A is all part of the manufacturer data and company, but, after that I do get 54 E0 80 44. 4 octetcs that should represent my flot of the preassure. And I'm struggling so hard because I make no sense of it. Would you be so kind as to give me some tips?
I did resolve this with a Govee devide with no problems, but with this Adafruit CLUE it feels I know nothing π¦
you might want to ask this on #help-with-circuitpython, this channel is for the development of circuitpython itself
Found the project while Googling around, didnt see the discussion, will read it now. Thanks
Thank you! I'll do that, sorry for the confusion!
Huzzah, it worked! From S3:
Sorry to bypass the approval checking, but I thought I was going to have to debug this and run the approval merge several times.
Stable-release builds (*.*.x) were not being uploaded to S3. Fixed by #9557.
@samblenny Would you say this issue is fixed now, by #9554, or would you like some additions to the Building CircuitPython guide?
But for that drive-strength setting in DigitalInOut.c, why is it this:
hw_write_masked(&pads_bank0_hw->io[pin], PADS_BANK0_GPIO0_DRIVE_VALUE_12MA << PADS_BANK0_GPIO0_DRIVE_LSB, PADS_BANK0_GPIO0_DRIVE_BITS);and not:
gpio_set_drive_strength(pin, GPIO_DRIVE_STRENGTH_12MA);as described in the Pico-SDK docs?
I think that API might not have been present in early versions of pico-sdk. I'm preparing a PR ...
For this issue, yeah. Fixed.
There might be some opportunity to revise the guide by arranging things into a more linear sequence, with less need to follow cross-reference links. But, I don't feel like I have enough experience with the build system to say much about about that. I'm sure there are lots of edge cases to consider.
@tulip sleet Last night I managed to get make working for the espressif port. Was able to successfully build and flash a firmware image for Feather TFT ESP32-S3 with your 9.2.0 alpha stuff. Only other documentation glitch I encountered was that the esp-idf/install.sh fights with pip3 install --upgrade -r ../../requirements-dev.txt over the version of setuptools. ESP-IDF wants version 71.0.0, but pip upgraded to version 73.0.1. Once I re-ran the install script, it was fine.
So, the procedure that worked for me was: 1) run install.sh, 2) run the pip install stuff, 3) run install.sh again
I am not sure that the erratum RP2350-E9 is the cause of this after all, even though we are seeing the 2.1V "stuck" value.
TouchIn doesn't use the internal pulldown at all. Yet I am seeing stuckness even on simple DigitalInOut:
On RP2350:
[attach jumper between A0 and 3.3V]
>>> import digitalio, board
>>> a0 = digitalio.DigitalInOut(board.A0)
>>> a0.value
True
[remove jumper]
>>> a0.value
True
RP2040 does not show this.
There is a fundamental differenc...
I was wrong above: gpio_set_function() is called by gpio_init(), which we do call.
just peeping at the datasheet there's also the new "pad isolation" bit for each GPIO (but this bit should also be correctly set by gpio_set_function())
I am seeing this 2.2V latchup (actually 2.4V here) with the pulls not set at all, ever, and even with a 1M pull-down on the pin. I am testing with GP0 on the Tiny2350 instead of A0, which has the ADC attached and might have different reset characteristics.
Example:
Create a DigitalInOut on GP0.
GP0.value is False.
Pull GP0 high with a jumper direct to 3.3V, or a 1M resistor to 3.3V
GP0.value is True.
Remove jumper. GP0.value remains True, even if 1M resistor is then co...
I am going to try to reproduce these problems with some simple pico-sdk programs.
I filed an issue with raspberry-pi: https://github.com/raspberrypi/pico-feedback/issues/401
Yes, I think I did something like that, though maybe no intentionally. I normally run with a venv all the time in Ubuntu 24.04, but when I am doing espressif builds, I deactivate the vent. I think i ran install.sh, did pip3 -r ../../requirements-dev.txt, and then did the export.sh
yeah, I was a little surprised to figure out that the espressif scripts set up their own venv. But, they do it in such a way that it doesn't add the (venv) $ prefix to my shell prompt, so it's not obvious that a venv is active.
I initially assumed that I would need to make my own venv as is often the case with other stuff, but that didn't work. So, then I read more closely and figured out esp-idf has its own thing in $HOME/.espressif
@lone axle @slender iron let me know if you'll be able to read your usual parts in the State of CircuitPython section today.
I will be. π
@onyx hinge I'll be missing the meeting because I have family in town.
@slender iron OK, got it. @tulip sleet let me know if you can read the state of the core section today!
sure, no problem
thank you!
@onyx hinge https://github.com/raspberrypi/pico-feedback/issues/401#issuecomment-2310001946 can be deleted now. GitHub removed those users and their posts
oh good
I'd say idf5.3 is stable
howdy all and in particular <@&356864093652516868> -- I'm back and I'll be running the weekly meeting in a little under 30 minutes! Please add your notes at https://docs.google.com/document/d/1AlQdjcpzMwWRF_2UsoXykCqwJVCPx5kSR14VG4ozEOo/edit?usp=sharing and just leave a little note if you need me to read them out for you. TTY soon
Google Docs
CircuitPython Weekly Meeting for August 26, 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 would...
@spare jacinth is your contribution in "In the Weeds" meant to go in "Status Updates"?
Desiphu, I don't quite understand what you mean. I was doing the tests by trial and error, you know? Without these lines, the code compiled, but the camera didn't work. Since the Xiao Esp32-S3 Sense uses the same camera as the AiThinker Esp32 Cam, I did the test with the same header that was available in the code. And with that, I managed to get the camera to work.
@spare jacinth mic sounded crackly and went in and out, like a bad connection
rebooting the headset now
Thanks
Thanks for hosting Jeff. Have a great week everyone!
resolves #9505
Adding math.dist() with same functionality as CPython version.
I'm having a very similar issue with I2C on QT-PY-ESP32-S2. I've come at it all kinds of ways, with one or multiple I2C devices and varying the I2C bus speed from 10_000 to 400_000.
With these i2c devices:
-
adafruit_ssd1306 -
adafruit_seesaw (rotaryio: product number 4991)
When I do a i2c.scan() it never shows any devices, but I can "speak" to the rotaryio. When I enable the ssd1306, I get:
main.py output:
sys.implementation=(name='circuitpython', versi...
@Casa-Machinalia I could not duplicate the OP problem on ESP32-S2, so I've made your issue be a separate issue: https://github.com/adafruit/circuitpython/issues/9561.
I tested with a seesaw board on an ESP32-S3. I get ETIMEDOUT starting at CircuitPython 9.0.0. It works in 8.2.10. There have been no significant changes to ports/espressif/common-hal/busio/I2C.c for several years, so I think it's an ESP-IDF upgrade issue. I also rebuilt 9.1.2 with
-CONFIG_FREERTOS_HZ=1000
+CONFIG_FREERTOS_HZ=100
and it still fails. CONFIG_FREERTOS_HZ was changed to 1000 post 9.0.0 anyway.
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/1BXYMbOxPWUug-6WwltLdcvqv7i_de3059noqBx0Sn-M/edit?usp=sharing
Google Docs
CircuitPython Weekly Meeting for September 3, 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...
This PR adds the following boards:
- Challenger+ RP2350 WiFi/BLE5
- Challenger+ RP2350 BConnect
Would it be possible to just use LittleFS for everything? FAT isn't power failure tolerant, which would be a nice feature to have .
The PC USB side could use a virtual network device and a web file manager, or MTP, or an emulated fake FAT32 interface as has been done on some boards.
Early on, we considered MTP. But there is no MTP support for macOS, sadly.
Is your concern about FAT that you are doing local writes in CircuitPython code to the filesystem, or that writes from the host might be interrupted?
CircuitPython has chosen FAT because it makes the workflow easy: no extra programs are required on the host computer. We prevent some problems by making the filesystem readonly to the CircuiPython code but not to the host, or vice versa. When MicroPython used FAT mo...
There is already a 2432S028C board, which is very similar.
Be aware of the battery charging chip: this is a chip targeted at power-banks. It will kill smaller LiPos, since it uses 1A for charging. Also, sleep-modes won't work because this chip will cut power if the current is too low. And since the USB-power is also routed via this chip, this not only affects battery, but also normal plugged operation.
Now I don't own this board, but I own two very similar boards so I just assume it is ...
How does this compare to the scripts in .devcontainer? In the end, the Github codespaces are also docker containers, but the casual developer does need to have a working docker runtime environment installed on their system.
github codespaces are a proprietary development environment hosted in the cloud with free access limited based on hours per month. This feature seems to be something that a user can run locally on their own hardware. These can both be important considerations for developers.
If both are ultimately "made of" docker images, it would be nice if the code for creating the development environment could be shared between them, but I don't know enough to say how feasible this is.
(maybe it's possible for devcontainer to be run locally? I don't actually know anything about them or use them; I inferred from your comment, possibly incorrectly, that devcontainer ONLY works with github codespaces)
The reported code used an invalid sample rate. This improves the error message so that it is not a generic IDFError.
The new error message says:
ValueError: sample_rate must be 20000-2000000
I verified at a sample rate of 20000 that I could read both 0 and 65535 using a jumper wire to another GPIO pin configured as a digital output.
My test code, run on a feather esp32 v2:
import digitalio, board, analogbufio, array
N = 30
rate = 20000
buffer = array.array("H"...
(the rate range is a bit different for each microcontroller, so esp32s3 for instance might display a different range in its error message)
My point is a bit different: the scripts in .devcontainer are just simple shell scripts. When you create a docker-container, you can run anything. That is what is going on behind the scenes of Github codespaces.
So the question is if the existing scripts can be modified in a way that allows them to run outside of the Github codespace environment in your own docker containers. I think only a few changes should be necessary (e.g. the scripts currently hardcode REPO_ROOT but they could be...
Ah, I thought there might be a catch! Apple compatibility issues always seem to cause trouble!
My big concern is that any application that periodically writes to flash will wear much faster than it needs to, and not have any power failure tolerance.
It seems like Dhara's checkpointing features would at least partially fix the power fail issues though, as long as there's not too many writes in between closing or syncing a file.
I assume FatFS probably syncs at smart times as one would expe...
Oh, and I just had a short read here: https://code.visualstudio.com/docs/devcontainers/containers
So it seems the existing stuff should also run locally. I will put this on my TODO list and try if this works.
It is still not that simple for casual developers, because they need a local docker environment, but setting this up is a one time task so that should be possible.
In practice, we have not had reports of flash wearing out. People who are doing a lot of logging and the like tend to use SD cards.
I had not heard of dhara before, and found it here: https://github.com/dlbeer/dhara. Thanks for the pointer. I don't know if it is still being maintained.
I assume FatFS probably syncs at smart times as one would expect, not in the middle of metadata operations.
I'm not sure what you mean here. The writes to flash are cached in RAM and are done periodi...
Ah, I thought there might be a catch! Apple compatibility issues always seem to cause trouble!
They didn't want MTP because it allowed support of competitors to iPod. I think it's a dead issue now but they have no incentive to implement MTP now because it's not used very much, but that's partly a chicken-and-egg problem. We'd love to be able use a higher-level transactional filesystem on the host side.
I'm not sure what you mean here. The writes to flash are cached in RAM and are done periodically. FatFS itself does not do the writes. There's code in
supervisor/sharedthat handles that.
I just found Dhara in a comment earlier up in the thread, but it seems to have some limited atomic transaction support.
So if you create a new checkpoint every time FatFS issues a sync ioctl, and you don't do too much in between syncs(It automatically makes its own checkpoints periodically), then ...
The problems we see with corrupted filesystems are mostly due to:
- User presses reset when the host is writing or there's a write happening on the board side.
- User unplugs (same issues)
- Host delays writes for a lengthy period of time.
- This was a big problem with Windows a long time ago, and supposedly was fixed in Windows 10 not too long ago (a year or two or three?). In particular, FAT12 had much longer write delays than larger FAT formats, which may have been left over from the...
Linux has modest delays, but waiting a few seconds or typing sync or the equivalent fixes the issue.
@dhalbert : the simplest solution is to mount the CIRCUITPY-drive with mount -o sync .... There will be no OS-level buffering anymore and once the file is closed it is on the drive. This also fixes problems with editors not doing the flush().
Yes thank you for the fix π
One pre-commit issue. Good otherwise!
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register
This is fine with me!
Want to try tweaking the make stubs command to include this? https://github.com/adafruit/circuitpython/blob/main/Makefile#L266 Once it is in the stubs, then it should be made available in the API docs.
My big concern is that any application that periodically writes to flash will wear much faster than it needs to, and not have any power failure tolerance.
What devices are you interested in using? We could switch all non-native USB devices over to littlefs on a major version boundary. Only USB MSC exposes the block level to an external computer. Without it, we could switch to littlefs.
Thanks for this. One spelling typo only. I'm also interested in Scott's opinion about what should be in these files.
Stuff in the repo should be things we want the community to be able to contribute to. The espressif port is mainly maintained by us (Adafruit folks) so we can slim it down and link out if we like. Other ports may have more details here if they were added by other folks.
I'd only use Learn for Adafruit maintained things.
Thanks for these corrections! I added a couple questions.
//| You may reduce this maximum read using the ``nbytes`` argument.
I think we usually document this as __init__ instead of new. Want to make this align with that?
Thanks for the initial PR!
Any idea of what functionality will need to disable this light sleep and can you add the "disable" calls for that? Adding it here will make it easier when we find other things impacted by this change.
Please breakout the 60 * 1024 * 5 into a macro that is documented with what it means.
Is either that or adding pass/..., otherwise we get invalid syntax due to function having no body. Thought a generic comment was slightly better π
def foo(
bar: baz,
) -> None:
def next_docstring_line():
Example 1 makes sense to me. Example 2 is harder because of the nested object.
Im not sure if there is a slight semantic difference between hinting is as __new__ and __init__.
I agree that moving to __init__ sounds reasonable (this is the only //| ... def __new__ line in the repo too.
Commit on its way :D
This is a generic STM VID/PID. If you don't work for WeAct you can request a USB PID from: https://pid.codes/ If you do work for WeAct, then you should sublicense a unique PID from STM or acquire your own VID from the USB folks.
Does this break other H7 boards?
Thanks for the changes! I'd love to support the 723. However, I'm concerned that some of these changes will break the existing H7 support.
What is the last byte used for?
[adafruit/circuitpython] New comment on issue #9521: Third sleep option: RAM-preserving "deep" sleep
And forgetting to deinit a certain peripheral could result in an unexpected higher power consumption. Debugging this could become rather challenging.
Ya, I think this is a good point. However, I'm not exactly sure how to define when to raise an exception or warning. I always think that folks optimizing power should use a PPK2 to check they are getting the consumption they need. Lots of things on a board (like neopixels) can have a big impact too.
Maybe we could add an attribute of "ex...
I think pass is better for __init__ because the class level comment is used for it too.
I'm not exactly sure what would need to disable it, but I think it should
be handled already by the ESP-IDF's wake locks API, the ESP won't sleep if
one of those is held
On Tue, Aug 27, 2024, 2:56β―PM Scott Shawcroft @.***>
wrote:
@.**** requested changes on this pull request.
Thanks for the initial PR!
Any idea of what functionality will need to disable this light sleep and
can you add the "disable" calls for that? Adding it here will make it
easier wh...
Oh.. I got very weird idf breakage.
Under Beryllium OS, specifically on the cardputer, when the wifi is not connected, the standalone tty (kb input, display output) hangs on artifact PR9526 (idf pr) while it does not on the one before..
Furthermore, it's undebuggable, cause the moment I attach usb or another serial (uart or telnet) it immediately fixes itself..
Why does it always have to be I find the weird bugs..
I'll nuke usb serial and send stuff out with print() I guess
oh that reminds me, there was a question around how to declare the type of the __init__ of a class that can't be constructed. It can be typing.NoReturn or typing.Never. This passes mypy --strict: ```import typing
class K:
def init(self) -> typing.Never:
raise RuntimeError("Cannot construct K instances")
NoReturn is probably better, as it is in 3.6; Never was added in in 3.11.
i tried several things and none seemed to integrate nicely with both mypy and vscode's intellisense
maybe i did something wrong though
yeah I only tested mypy
also, from my understanding of the documentation, even though they both mean the same "do not do it, you will blow up", seems like Never is more for attributes/arguments, and NoReturn should be used for funcs
i even recall seeing some example as in def func(args: Never) -> None to mark that you should never fed arguments into the function... which is quite a weird syntax imo
def never_call_me(arg: Never) -> None:
pass```it's true that there's an argument of type Never shown in the Python documentation. (https://docs.python.org/3/library/typing.html#typing.Never)
yeah, and i can't see how that differs from def never_call_me() -> NoReturn which looks a lot more obvious
I think that's just some type theory stuff, I can't see why it's useful. (because once you take away the int and str type possibilities from the type annotation int | str you have an empty range of type possibilities, or the so called "bottom type")
never_call_me does always return None, though.
yeah, but hinted as "never call me" perhaps means that "function" is not real code but a stub (.pyi) and needed some "fake" body for being valid syntax (pass)
anyway, i guess both ways get the thing done... no big deal
but i really didnt like how NoReturn/Never integrated with __init__ and left it as is π
a lot of type annotations are very practical. the Never argument type seems much less so, but clearly important to theoreticians. https://en.wikipedia.org/wiki/Bottom_type π€ π΄
In type theory, a theory within mathematical logic, the bottom type of a type system is the type that is a subtype of all other types.
Where such a type exists, it is often represented with the up tack (β₯) symbol.
When the bottom type is uninhabited, a function whose return type is bottom cannot return any value, not even the lone value of a unit type
brain boom right here
that's quite irrelevant for python, though, because python's type system is not consistent or sound anyways
so you can't really reason about it using the category theory
I think the core problem is that we've dropped the PSRAM speed from 120 MHz to 80 MHz. The IDF included new warnings about PSRAM stability at 120MHz.
I'll bump it up to 120MHz for this board only.
Thanks @tannewt I had not figured out that change occurred
@onyx hinge were you looking at that bug too?
@slender iron That's the one I'd intended to look at first (I think I said rgbmatrix in the internal meeting but that's the issue I meant) but I grabbed that analog sampling one first so I had not spent much time on it. Toe status: absolutely not stepped on.
@onyx hinge Quick question, I'm looking at synthio for a random idea and general learning and wondering if you had any references for the direct digital synthesis it uses? If you don't have anything handy don't worry.
This allows us to push more pixels and reduce tearing.
Flash is bumped to 120 MHz too because there is no tuning to run PSRAM at 120 but flash at 80. It should be stable at 120 anyway.
Fixes #9477
@blissful pollen "direct digital synthesis" is just a fancy word for how synthio generates frequencies that don't exactly divide the sample rate. I don't have a good reference about it offhand
say you are at 44.1kHz sample rate, and you want to generate a 440Hz note with a square waveform made up of 2 data points in the sample. Each output sample you need to advance by 440*2/44100 ~= .01995... input samples. If you scale this by some convenient factor like 65536 and then round it, you find you need to advance by 1308/65536 samples.
Then each time you want to generate an output sample, you just add 1308 to an accumulator, subtract off any excess part of the number, and divide by 65536 to find out which input sample to use. (which is a bit shift so it's quick to do)
Wherein The Chicken
I canβt seem to crack my obsession with Direct Digital Synthesis. I had to learn rather a lot about it as part of working on bFunc last year. Even though Iβve sort of decided to not build a second version of bFunc, I still find the concept of digital frequency synthesis really interesting. Itβs a fun little mix of analog and digital signal proce...
Oh cool thanks. That makes sense. I kept seeing many DDS example all with sine waves but that is basically the waveform in synthio (by default the square wave). That helps a lot!
https://github.com/adafruit/circuitpython/blob/main/shared-module/synthio/__init__.c#L227 is the code that does the "add, subtract off excess, scale, & index".
the rate calculation is dds_rate = (sample_rate / 2 + ((uint64_t)(base_freq * waveform_length) << (SYNTHIO_FREQUENCY_SHIFT - 10 + octave))) / sample_rate; on line 180
which today-me is glad that it was yesterday-me who figured THAT line out.
Coincidentally that is the line I have opened and highlighted in my editor now trying to wrap my head around all this!
(for MIDI note numbers; synthio_frequency_convert_scaled_to_dds is called for Note objects)
do you have a goal or project with this beyond better understanding?
I have been thinking if it would be possible to do more reverb/echo effects, but that requires buffering more of the output to feed back into the loop. The 2350 may have the power to pull it off
that would be cool. It would probably be a post processing step similar to the rudimentary IIR digital filtering, I'm imagining.
you might also look whether audiomixer could do it, especially since timchinowsky has contributed some work towards real time audio processing. if it doesn't have to be limited to synthio but could be done with mp3 files, sampled audio, etc., it could be pretty versatile
https://github.com/adafruit/circuitpython/pull/9421 & https://github.com/adafruit/circuitpython/pull/9438
GitHub
This PR contains part of the changes necessary to implement the processing of live sampled audio as described in #2676. Here audiocore.RawSample is changed so that the sample can present itself ei...
Hmm I had not thought about that. I was poking through that code to see how the whole audio train of components works and makes sense.
Doing it on a per channel in synth would be nice but nothing lost to try a more general cause in mixer and then it could be used for any audio played that way too.
I tested this on the 1D Chomper game from the learn guide in the issue and it does seem to have resolved the issue, the display is back to rendering smoothly. Thanks for the fix!
Print output buffer gets stuck when usb is not attached
No wdt, just waits
resumes instantly when plugged
This is on repl so I should be able to replicate on a feather with just this for loop
imma make the bug report
Huh, no it doesn't happen on the feather..
Weird, maybe the cardputer keyboard thing is confusing it?
CircuitPython version
Adafruit CircuitPython 8.2.7 on 2023-10-19; Adafruit QT Py ESP32-S3 4MB Flash 2MB PSRAM with ESP32S3
vs.
Adafruit CircuitPython 9.1.2 on 2024-08-22; Adafruit QT Py ESP32-S3 4MB Flash 2MB PSRAM with ESP32S3
Adafruit CircuitPython 9.2.0-alpha.2351 on 2024-08-22; Adafruit QT Py ESP32-S3 4MB Flash 2MB PSRAM with ESP32S3
Code/REPL
# Adafruit CircuitPython 8.2.7 on 2023-10-19; Adafruit QT Py ESP32-S3 4MB Flash 2MB PSRAM with ESP32S3
...
[adafruit/circuitpython] New tag created: v1.22.0
[adafruit/circuitpython] New tag created: v1.22.1
[adafruit/circuitpython] New tag created: v1.22.2
- Backport #9564 to 9.1.x.
I was going to do a 9.1.3. May as well include this too.
Not sure what I need to do here, github says I can't commit the suggested change =)
CircuitPython version
Attempted update from 8.0.4 to 9.1.2.
Code/REPL
C:\Users\Devon\Downloads>esptool.py --chip esp32s3 erase_flash
esptool.py v4.6.2
Found 2 serial ports
Serial port COM3
Connecting...
Chip is ESP32-S3 (revision v0.1)
Features: WiFi, BLE
Crystal is 40MHz
MAC: xxx
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 19.4s
Hard resetting via RTS pin...
...
aaaand I just noticed I installed the UF2 instead of the bin. disregard.
[adafruit/circuitpython] New comment on issue #9521: Third sleep option: RAM-preserving "deep" sleep
There could be a verbose/debug bool option that before actually entering sleep lists the things that will be disabled and the estimated current use.
alarms.suspend_until(alarms=myalarm, verbose=True)
I2C: suspended
Wi-Fi: powered off
spi: state stored
usb: cannot be suspended
Estimated microcontroller draw: 14mA
Entering sleep..
But it would be a bit of a pain to estimate the draw of each thing.
I think the checklist would be good enough, since it'd tell the user what...
I would probably drop this from the 9.2.0 milestone. While I don't actually have any RP2350 hardware for testing, I believe the ROSC based RNG is currently working on both chips, so this is not urgent missing functionality.
Now, try_lock (SPI & I2C) & begin_transaction (display bus core) will check that the related objects are still valid first; if they are not, the lock/begin transaction will fail by returning false, rather than "other things" such as raising a Python exception where it is not permitted, accessing invalid memory, etc.
I tested by running a version of the #9426 reproducer on a Raspberry Pi Pico. It was able to complete & soft reset multiple times with no error. I also made sure that basic dis...
I hope that works .. that was an annoying bug and it'd be nice to lay it to rest.
nice soft fail. thanks!
@onyx hinge @slender iron should we maybe have an issue triage and assignment meeting today or soon?
I'm out a chunk of the afternoon to catch up with a friend but I should be back by 1h before the evening meeting
Is it desirable to update the buttons for the bootloader updater UF2 files on this guide page? https://learn.adafruit.com/adafruit-itsybitsy-nrf52840-express/update-bootloader-use-uf2 They're currently pointing to 0.8.2 version of the bootloader with 0.9.2 being the latest release https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases. If there isn't a specific reason the are held back I can update them to say and point to the 0.9.2 versions
yeah, I was just waiting for https://github.com/adafruit/Adafruit_nRF52_Bootloader/issues/334
that would be fine
I haven't had a lot of cycles to look at CP recently, but this sounds similar to https://github.com/adafruit/circuitpython/issues/9253
Similar, but not really..
The cardputer accepts Ctrl+Alt+Del which force-reloads the code regardless of the program state (the core handles that event), and that doesn't work there, even though it works in every other state, indicating it hang.
I'll try to debug it in the core.
Oh yeah, KeyboardInterrupt (ctrl+c) and ReloadException are exceptions, so this code with a bare except is functioning exactly as standard Python. So this is likely not a fixable bug, it's just part of how ReloadException works. However, maybe there's a spot in the documentation where this could be better explained -- https://docs.circuitpython.org/en/latest/docs/library/builtins.html#builtins.ReloadException doesn't directly mention anything for example.
One (probably not particularly...
2pm pacific works for me
Okay.... If I'm remembering properly, I originally thought the issue was tightly associated with the auto-reload but then I thought I re-created it with auto-reload disabled so I was just using the auto-reload as an easy trigger to reproduce the error. When I get a chance to dig back into this, I'll have confirm the problem happens with auto-reload disabled and then see if an auto-reload is somehow being triggered even though they've been disabled or if there's another path to hanging the dis...
@gilded cradle do you know if there is a known issue that leads to this error when attempting to select the host folder on the beta code.circuitpython.org site?
Also I started working on a fix for the duplicate serial messages after disconnect/reconnect multiple times and think I found a solution. But didn't notice until after I started working that there are both main and beta branches. Which one is the preferred one to submit PRs against?
Thanks! Sorry I didn't do it here first. I wasn't sure we'd have a 9.1.3.
CircuitPython version
CircuitPython 9.2.0-alpha.2351
Code/REPL
No code executed
Behavior
[13:24:07.365] Connected to /dev/ttyACM0
I (623) esp_image: segment 0: paddr=00010020 vaddr=3c150020 size=3acc0h (240832) map
I (660) esp_image: segment 1: paddr=0004ace8 vaddr=3fc9f200 size=05330h ( 21296) load
I (664) esp_image: segment 2: paddr=00050020 vaddr=42000020 size=14718ch (1339788) map
I (869) esp_image: segment 3: paddr=001971b4 vaddr=3fca4...
I'm not exactly sure what would need to disable it, but I think it should be handled already by the ESP-IDF's wake locks API, the ESP won't sleep if one of those is held
Ah ok. So we rely on the IDF to prevent sleep if we have things going on? Sounds good to me.
Progress with the TAC5xxx codecs using rp2pio posted here: https://github.com/timchinowsky/tac5.
Next is (1) add a background read to rp2pio to complement the background write which is already there and (2) ponder how to connect the reads to the writes with some CP signal processing, integrating with existing audiocore paradigms where possible.
Looks good! Unfortunately one SAMD21 board overflowed.
Weird! The newline at the end needs to be removed.
[adafruit/circuitpython] New comment on issue #9521: Third sleep option: RAM-preserving "deep" sleep
I like that idea but don't think the core code should do it. Storing strings is expensive and printing from within a library is weird. Instead, we could add state that python-level code could read to determine this.
That is so odd. On the first commit it complained I was missing a newline and now it wants to get rid of it π I'll revisit my fork tomorrow and try to figure out what i'm doing wrong here.
Can you reproduce this on an Adafruit or Espressif board? I don't have either of the ones that fail.
I'd suggest installing pre-commit locally. It'll fix it for you.
I just tried the Matrix Portal S3 and it worked fine as well. I'm guessing it has to do with the 666 dotclock display init in board.c but I don't think I have any Adafruit/Espressif boards that initialize a dot clock display automatically.
[adafruit/circuitpython] New comment on issue #9521: Third sleep option: RAM-preserving "deep" sleep
Yes, all we'd really need is some attr bools in the alarm module to implement this.
alarm.will_suspend_xxxx or alarm.will_suspend.xxxx
Then python code could do the heavy lifting.
Another difference between the boards that are failing for me, is that I update the firmware by first flashing combined.bin and then copying the UF2. All the other S3 boards I've tested will bring up the boot loader drive via a button press sequence. I don't have any idea if the boot loader could be a factor in this type of issue.
If you are editing files through the GitHub web interface, it is sometimes hard to get the last lines correct. Pushing from a local copy will make sure that what you think is in the file is really there.
@occasional-contributor Let me know if you have a discord handle, I'd rather talk there than a closed issue :/
Is there any chance you could post the identifying string from the back side of your board? After applying this PR, my display is rotated 270 degrees in a portrait mode, just like your "Before" photo so it appears our two devices have different rotation requirements.
If the ID on your board is the same as mine, I'll just submit a PR that adds a comment to the board.c file indi...
@RetiredWizard That's mildly infuriating. I will post a pic of the backside when I'm home.
I was on Discord, once upon a time. Then I went on an IM/social media detox trip.
I was just about to start hacking up the Makerfabs board.c file to try and identify the cause and discovered that the Makerfabs board doesn't actually init the display in board.c so that's not the source of the problem after all.
Thanks for the discussion! When I wrote this I wanted to make a tool that (1) exemplified and expanded on the published build procedure while making it easier and (2) provided an example of how Docker can be used to make all sorts of jobs like this less painful (at least if you run Linux). I looked at the CI scripts and decided that something simpler might be more helpful to others.
Commenting out these two lines from mpconfigboard.h
#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO43)
#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO44)
and these lines from sdkconfig
CONFIG_ESP_CONSOLE_UART_CUSTOM=y
CONFIG_ESP_CONSOLE_UART=y
CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_0=y
CONFIG_ESP_CONSOLE_UART_NUM=0
CONFIG_ESP_CONSOLE_UART_TX_GPIO=43
CONFIG_ESP_CONSOLE_UART_RX_GPIO=44
CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200
prevents the boot loop on the Makerfabs board. Is...
0.6.0 had a buffer issue that is fixed in 0.6.1. Now we can use upstream.
I started working on updating to the new 5.x.x ESP-IDF driver, @tannewt pointed out esp-camera is not yet updated, and the two drivers can't coexist. So I'll put any update on hold. @tannewt has done some of this update already.
Need to test on another board we have.
this caused problems.
Closes #9406
Closing for now since we haven't heard back.
It looks to me like in addition to the Hacktablet and Makerfabs TFT 7" boards, the Espressif ESP32S3_LCD_EV and possibly (I don't know if non-S3 boards are affected) the Lilygo twatch_2020_v3 may be affected by this issue. I don't have either of those devices to test with.
maybe set interrupt character to something non-functional
We discussed whether this should happen deliberately or not. The web workflow is available even on user connection. Someone might start using, kind of like user-initiated displays, which stick around past the VM finishing.
The difference I see is that the original one I configured only has the one
usb port and this one, with the same model number, has both micro and type
c, and also a differently configured LCD, apparently.
On Wed, Aug 28, 2024, 7:35β―p.m. Occasional Contributor <
@.***> wrote:
PXL_20240828_223158275.2.jpg (view on web)
https://github.com/user-attachments/assets/f29d5b7c-f6b1-4e3f-9a91-add8185cd312β
Reply to this email directly, view it on GitHub
<https://githu...
I suggest we create two different boards. I am not sure if more variants exist and/or how to tell them apart without visual inspection.
There are so many versions of this board on AliExpress. There's no way to identify the display driver chip, is there?
I think this is all that is needed to add the C6.
I don't think it's worth trying to set up different firmware variants for these CYD boards that have the same silk screened model number. They appear to be cloned left and right and who knows what other differences may show up. The screen orientation can probably be dealt with in software by releasing the board.DISPLAY object and re-initializing the display with the proper rotation.
CircuitPython version
Adafruit CircuitPython 9.1.1 on 2024-07-23; FeatherS3 with ESP32S3
Board ID:unexpectedmaker_feathers3
UID:0740D1DA1CCA
Code/REPL
import board
from adafruit_ble import BLERadio
from adafruit_ble.advertising.standard import ProvideServicesAdvertisement
from adafruit_ble.services.nordic import UARTService
import neopixel
import time
def monitor():
ble = BLERadio()
#uart = UARTService()
#advertisement = ProvideServ...
Tiny 2040 has three variant on page https://shop.pimoroni.com/products/tiny-2040
The original link goes by default to one of the two 8MB variant. Someone wanting the 2MB variant need to click on the 2MB (PIM593) once in the page or follow the link I provided.
PS: Not touching the 8MB page yet... but maybe one day Pimoroni will do a 16MB and similar issue will come.
Trivia: "This is not the Tiny you are looking for..."
My Tiny is the 4M (only option) Tiny 2350: https://shop.pimoroni.com/products/tiny-2350?variant=42092638699603
Hopefully also supported: https://circuitpython.org/board/pimoroni_tiny2350/
Still, the PR make change to distinguish two products.
Well, this isn't linked to web workflow in thos state as it wasn't enabled on that board at all.
CircuitPython version
Adafruit CircuitPython 9.2.0-alpha.2351 on 2024-08-22; Raspberry Pi Pico 2 with rp2350a
Code/REPL
import board
import time
import board
from digitalio import DigitalInOut, Direction, Pull
tasterSchwarz = DigitalInOut(board.GP28)
tasterSchwarz.direction = Direction.INPUT
tasterSchwarz.pull = Pull.DOWN
while True:
if tasterSchwarz.value == 1:
print("key down")
Behavior
The state of the pin does...
Is it possible to add a display rotation property to settings.toml (or whatever is used for setting WiFi credentials)? That way, if a particular board needs display rotation, we do not need multiple versions.
This is a hardware bug in the RP2350, unfortunately. See #9541 and https://github.com/raspberrypi/pico-feedback/issues/401. Also see https://forums.raspberrypi.com/viewtopic.php?t=375631. We are awaiting further information for Raspberry Pi about their path forward on this.
Closing this in favor of #9541, but thank you for reporting, so that we know that typical users are hitting this problem as well. Multiple people and companies are encountering
This adds support for
@zodiusinfuser: FYI - any preference who prepares the files for the circuitpython.org download site?
This adds support for https://shop.pimoroni.com/products/tinyfx?variant=42086044827731
Looks good to me!
@ZodiusInfuser: FYI - any preference who prepares the files for the circuitpython.org download site?
I'm happy for you to prepare if you would like, though let me see if our photographer can get the required image sizes generated for you from our originals.
I'm happy for you to prepare if you would like, though let me see if our photographer can get the required image sizes generated for you from our originals.
Fine. Just forward the images and will prepare the rest. I will take the text from the shop-site. When I am done, I will send you the link to my branch for review.
CircuitPython version
Adafruit CircuitPython 9.1.2 on 2024-08-22; Raspberry Pi Pico W with rp2040
Code/REPL
Sourcecode for Python is in my public repository at
https://github.com/watermark-woods/GateController/blob/main/code.py
It relies on a Google Apps helper script to pull and format a Google calendar for schedule.
https://github.com/watermark-woods/GateController/blob/main/googlecloudcode.js
You can watch the test harness after power on at ht...
I reproduced this once on an Adafruit Feather ESP32-S3 TFT and 9.2.0-alpha.2351-7-g19e5cf3d8f using a very simple test program that eliminates adafruit_httpserver:
import errno
import wifi
import socketpool
def wrap_accept(s):
try:
return s.accept()
except OSError as e:
if e.errno == errno.EAGAIN:
return None, ("", 0)
raise
socket = socketpool.SocketPool(wifi.radio)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
...
ESP32-C6, at least: board.UART() or busio.uART() on GPIO16 and GPIO17 is returning "Invalid pins".
Discovered by a user in Discord. I'm debugging this: may have to do with HP vs LP UARTs and which pins work for each kind. Also found there is incomplete cleanup when the busio.UART() constructor raise an exception.
I got a PID from the Seeed folks and updated here. The docs build failure is separate.
Darn, my #9460 reproducer has still not reproduced a 2nd time. There must still be an unknown factor.
I did eventually get a 2nd crash with just about the same code. That run took almost 1 hour to crash.
<details>
[11:44:01] Traceback (most recent call last):
[11:44:01] File "code.py", line 1
[11:44:01] SyntaxError: invalid syntax
[11:44:01]
[11:44:01] Code done running.
[11:44:01] Press any key to enter the REPL. Use CTRL-D to reload.
[11:44:02]
[11:44:02] Adafruit CircuitPython 9.2.0-alpha.2351-7-g19e5cf3d8f on 2024-08-28; Adafruit Feather ESP32-S3 TFT with ESP32S3
...
it did finally crash again but this time with hard fault, not wdt
looks like the docs build is broken under 3.12
I'm looking into the RTD issue
looks like an autoapi update that broke us
it removes stdlib methods
AutoAPI 3.3.0 release broke our build. So, pin at a lower version for now.
@slender iron so autoapi change is a big one?
not big. just breaks us
Maybe merge to 9.1.x and then we'll merge to main. I have another thing from 9.1.x too
kk, lemme switch it
I am about to make a fix for ESP32-C6 UART for 9.1.x.
-
Fixes #9577.
-
ESP32-C6 and ESP32-P4 have a new "low-power" UART, which has less functionality and only works on certain pins. It is in the regular UART numbering scheme. Don't use it, at least for now (it has some wake-up ability for sleep, so it might be interesting in the long run).
-
UART()constructor was not cleaning up whenuart_set_pin()failed. -
Also removed redundant
CIRCUITPY_ESP_USB_SERIAL_JTAG = 1from a C6 board. It's already set by default. (I had removed that lin...
Thanks for a quick fix!
Thanks for figuring this out!
@slender iron github is having issues. The "Actions" item has disappeared from the horizontal list of things at the top, at least for me. For you, too? https://www.githubstatus.com/ is reporting problems
ack, I was trying to disable actions on MY repo.
my fault
i was getting spurious micropython builds
π
i wonder how we can trigger them again for the PR's
I amended my last commit, just changing the message slightly, and the push -f
@tulip sleet this usb issue is in tinyusb. think I should switch us to a fixed repo or just wait for thach to merge in the fix? it is simply turning on an interrupt on resume
which issue is it? We could ask him to merge a PR tonight, if it's kinda obvious.
ya, as long as he's working it should be an easy merge
is it something that should go in 9.1.x?
this: https://github.com/adafruit/circuitpython/issues/9454 and probably the MSC version too
i would put that in 9.1.x since it's a significant regression: might break macropad, etc, Is it just Espressif?
yup, just espressif
I suspect this is the same as #9454. The ESP usb code wasn't detecting a resume correctly. It is fixed in https://github.com/hathach/tinyusb/pull/2784. We'll update CP as soon as that is merged in.
I've debugged this down into TinyUSB. The ESP usb code wasn't detecting a resume correctly. It is fixed in https://github.com/hathach/tinyusb/pull/2784. We'll update CP as soon as that is merged in.
@slender iron I think only q is whether there are other changes we should know about that we would pick up with an update to master that includes this
is it a regression in TinyUSB or did it never actually work?
ok, so then I wouldn't worry for 9.1.x after all
https://github.com/hathach/tinyusb/pull/563/files adds the interrupt handler support but doesn't enable it (added four years ago)
9.1.x fixes are for significant bugs, especially regresions, or new boards that need a stable release, etc. -- that's been my thinking
- #9553
- #9557
- #9566
- #9578
- #9579
I think the solution is to migrate to esp_now_set_peer_rate_config(). I've asked on the ESP forum what the values for the other parameters (phymode, ersu and dcm) should be so that it is backwards compatible.
@slender iron rtd jobs are still failing (maybe in a different way) in 9.1.x builds; it's confusing to me whether it's just failing because it's failing to fetch the badge?? WARNING: Could not fetch remote image: https://readthedocs.org/projects/circuitpython/badge/?version=latest [502]. That is actually fetchable when I try
not holding me up
Automated website update for release 9.1.3 by Blinka.
https://blog.adafruit.com/2024/08/29/circuitpython-9-1-3-released/
Highlights of this release
- Fix Espressif ESP32-C6 UART creation.
- Adafruit Qualia ESP32-S3 RGB666: fix display tearing.
- Pull request merge builds for stable branches, not just the
mainbranch, are now uploaded to AWS S3. - Fix Espressif board-specific pin initialization. This fixes
board.NEOPIXEL_I2C_POWERinitialization on the Adafruit Feather C6.
Any chance this will be available in a beta release soon?
Verified that 9.1.3 works. No display content tearing.
Yeah, I dont know what to do now. I installed pre-commit and it fixed the files. ran git add ., git commit and pushed it. Still no dice .
Don't worry about the doc build failure -- we know about that and it is unrelated.
The good news is, your last push did resolve the pre-commit problem during CI.
The failure was in building the documentation, which is not due to your PR. It can be ignored. (should be fixed by #9580)
The other problem that needs to be fixed is that your latest change also changes the Pico-PIO-USB submodule. Using git add . or git commit -a (rather than individually choosing each file to commit in a program like git gui) is very prone to including more than you intended to change, e...
oh git & github, it's so easy to not get everything exactly right.
we're waiting for a few more PR's and then will make another 9.2 alpha or maybe beta release
The "posix port" aims to enable compile-time tests that we currently do with the "unix port", but with a build that uses as much of the CircuitPython shared-bindings & supervisor as possible. Once we have to stop maintaining changes within micropython's unix port, this removes one of the hassles of merging micropython changes into circuitpython. It may also enable testing new parts of the shared-modules libraries (for instance, gifio has become testable though this change)
Locally this tes...
I reached a milestone of 0 failed tests so I felt it would be worth PR'ing. The list of conflicts is pretty extensive so I'll probably need to rebase this. This work is not an Adafruit priority so I'll also reserve the possibility of just closing this up so it doesn't linger in draft status.
not getting very far on #9460 -- haven't actually had any crashes so far today.
I tried to determine whether it's a problem up in Python object land or down in lwip internals land. For instance, I totally bypassed actually calling lwip_accept and got 0 crashes in 1 hour. But since then I've gotten 0 crashes in about 3 hours with the original code. so it's not a conclusive test.
I think I have figured this out but if someone knows to confirm, for audio buffers if it is stereo the buffer object is LRLRLR... vs mono would just be MMMMM? Then I2S can just take L/R to transmit of double M to MM to transmit out both channels?
the chip I use lets you pick which channel to use
@blissful pollen roughly yes, I think "standard" I2S always has to transmit 2 channels, so one way to deal with a mono sample is to just replicate it before outputting. the C function audiosample_convert_u16m_s16s does this and is used e.g., on espressif when plaing a mono stream on i2s. I don't see where rp2040 does this.
Thanks. I had seen in the 2040 if you just pass 16 bits to pio it replicates them to the top 16 as well (as it has to deal with 32 bits) so you get a free βcopyβ.
Been trying to think through how audio effects could be built to work for any type of audio channel. So if I want reverb could add it to a mixer or synth channel or wav, etc. Have a long drive this weekend to think about it more
oh yeah that data replication feature would do it
This skips the need to do the PMIC init for sane default usage.
Pending testing and consideration of which ldo's to enable on boot.
I didn't find any further useful information during today's debugging session, and I'm not planning to work further on this issue right now.
This fixes #9569 boot loop for the Hacktablet and Makerfabs 7" TFT ESP32-S3 666 Dotclock display boards.
It looks to me like in addition to the Hacktablet and Makerfabs TFT 7" boards, the Espressif ESP32S3_LCD_EV and possibly (I don't know if non-S3 boards are affected) the Lilygo twatch_2020_v3 may be affected by this issue. I don't have either of those devices to test with but could add the same sdkconfig changes for those boards if that makes sense?
Ready to go. Tested by a different board revision and my own unit.
This ensures even on early revisions which lack AXP2101 default settings, everything will work out of the box and removes the need of having to configure pmic.
Converting to draft for now. The latest commit has started refactoring these to be module functions instead of class functions on Circle and Rectangle, that will ultimately lead to de-duplication of this logic.
As of now only the new implementations are added, the old class functions are not removed yet. Once I do remove them and any other requisite changes I'll mark this ready.
CircuitPython version
Adafruit CircuitPython 9.1.3 on 2024-08-29; Seeed XIAO nRF52840 Sense with nRF52840
Adafruit CircuitPython 9.1.2 on 2024-08-22; Seeed XIAO nRF52840 Sense with nRF52840
Adafruit CircuitPython 9.1.0 on 2024-07-10; Seeed XIAO nRF52840 Sense with nRF52840
Adafruit CircuitPython 9.0.5 on 2024-05-22; Seeed XIAO nRF52840 Sense with nRF52840
Code/REPL
import microcontroller
microcontroller.on_next_reset(microcontroller.RunMode.BOOTLOADER)
...
[adafruit/circuitpython] New comment on issue #9521: Third sleep option: RAM-preserving "deep" sleep
Or may an "active power users" list.
This sounds pretty straightforward. Essentially this would be a python API that internally just accesses the bitmap used in prevent_light_sleep() that you mentioned earlier.
Yes, all we'd really need is some attr bools in the alarm module to implement this.
alarm.will_suspend_xxxx or alarm.will_suspend.xxxx
I'm not sure I understand the idea. To me, e.g. alarms.will_suspend.wifi sounds like a constant, that indicates whether wifi would be...
[adafruit/circuitpython] New comment on issue #9521: Third sleep option: RAM-preserving "deep" sleep
alarms.will_suspend.wifi == True means thar wifi will be suspended, yea.
Not a constant.
If wifi is connected for example, it could turn False indicating it'll not be suspended.
IMPORTANT! Some early engineering units have efuses that incorrectly attempt to charge the batteries to 4.35V.
Even on factory fw.
This last commit will forcefully set the charging target to be 4.2V as intended.
Has anyone ever broached adding the ability to redirect sys.stdout to a valid alternative stream?
Just skimming back through I don't see a discussion, though I'm sure it'll be somewhere buried.
you can use the second usb uart for this
To redirect stdout?
to use it in place of stdout
you don't get the repl and error messages on it too, so it's easier to handle
Ah, right I see what you mean - no, I specifically want to redirect the repl. exec() by longstanding and perfectly sensible design doesn't return output like eval(). In CPython you can redirect stdout to any valid stream (for example, a file, or an arbitrary serial object).
hmm, webrepl does it, but it's C
Yeah, I imagine it would be relatively straightforward under the hood in the firmware and I expect it's far less simple at the higher level
MicroPython has something called multiterminal which we inherited from upstream but which we eventually turned off /removed
Can't blame you for streamlining, my use case is undoubtedly niche
there are ways to redirect it to a UART in addition via compilation options
Most of the time when you want to view the REPL other than via web or cdc you can just use terminalio
Ah right, this would be via BLE - I know finishing up BLE Workflow is on the cards eventually anyway so I may as well just be patient.
there is already code to send the REPL back and forth over BLE. It is enabled by CIRCUITPY_SERIAL_BLE, which is turned on for nordic boards and espressif with _bleio
I may have misread the active PRs and Issues, thought there were issues being worked out for Espressif BLE
that is true, I think, but it was working for nordic
i have forgotten which apps or browser apps support BLE REPL, if any
ok, it's available via https://code.circuitpython.org
but I haven't tried it
@slender iron @onyx hinge there is a new PR for esp-camera to switch to the new I2C driver API: https://github.com/espressif/esp32-camera/pull/677
Yeah, that's what I remembered too
Righto, no worries - and certainly not worth contemplating unearthing a crusty bit of MP/CPython
that's promising
I loaded this artifact and it runs my clock program fine, I didn't test any of the charging components but as far as I can see everything seems to be working as it should. (display, speaker, touchscreen)
This was a terrifying find, very grateful to @brazen hatch for clocking the minor difference in reg values!
I just saw #9584, and I can't get it to work again. I thought I just tested on a Feather nRF52840, but it indeed goes back to CircuitPython. Saw same thing on Itsy nRF52840. On the chance it might be the bootloader, I tried with 0.9.3, 0.8.2., and 0.6.1, but they all go to CIRCUITPY.
Sorry - I had retested #9423, and thought it was working. I've reopened that issue, which has a little more detail, and will close this one as a dupe of #9423. I'll ping you in #9423 so you can track it.
@jordan1110 watch this issue, which is the same as your #9584.
I'll get trickle charging in too, one moment.
Alright this is now ready to go, hopefully no more "discoveries".
Tested it, it now charges @ 500mA until it reaches approx 4.185V.
I'm not very knowledgeable in battery chemistry but I have a feeling I shouldn't permit full 4.2V charge.
Verified with a "Battery Doctor" and the pmic adc reading.
If anyone here knows battery chemistry please let me know. I can set it to charge all the way up to 4.2V, stopping only when there 0mA current draw from the cell.
But this means imperfect readings could charge the battery to 4.21V.
Should I set it to charge to 4.2 or 4.185 like I have it with the 25mA stop limit?
Do batteries even have an acceptable tolerance at 4.2V?
Images automagically compressed by Calibre's image-actions β¨
Compression reduced images by 61.6%, saving 6.00 MB.
| Filename | Before | After | Improvement |
|---|---|---|---|
| assets/images/boards/large/adafruit_feather_esp32c6_4mbflash_nopsram.jpg | 136.45 KB | 62.72 KB | -54.0% |
| assets/images/boards/large/adafruit_feather_rp2350.jpg | 181.05 KB | 120.08 KB | -33.7% |
| assets/i... |
As of #9164 (MAX3421E support), SPI.deinit(), only on Espressif, waits for the lock to be unlocked before proceeding with the deinit(). If there is nothing else that is going to unlock the lock, CircuitPython hangs and cannot be interrupted.
// Wait for any other users of this to finish.
while (!common_hal_busio_spi_try_lock(self)) {
RUN_BACKGROUND_TASKS;
}
This caused adafruit_dotstar.DotStar.deinit() to hang forever. DotStar grabs the lock when cons...
CircuitPython version
Adafruit CircuitPython 9.1.3 on 2024-08-29; Adafruit Feather ESP32-S3 TFT with ESP32S3
Code/REPL
# Packages (adafruit_imageload and adafruit_st7789) came from:
# https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/download/20240827/adafruit-circuitpython-bundle-9.x-mpy-20240827.zip
from board import SPI, TFT_CS, TFT_DC
from displayio import (Bitmap, Group, Palette, TileGrid, release_displays)
from fourwire import Fo...
I forgot to include the PNG and BMP spritesheets.
This is sprites.png (it's smol, 8x16px):
GitHub won't let me upload the BMP, but you can get it from the reproducer repository I linked to above.
Maybe this would help, https://github.com/adafruit/tinyuf2/pull/406/files check the reset reason and only check for double reset for EN/nRST pin
From a bit of browsing it seems as though 4.2 is the safe cut off for LiPo chemistry unless explicitly binned as high voltage
I did test it on my unit and it took about 3 hours to finish charging (it was trickle charging).
Meanwhile the 25mA limit only took like 20 minutes trickling.
So judging by the fact no devices trickle for 8 billion years it's best to leave it at 25mA cuttoff.
PR is good to go.
I probably missed this when the pico2 first came out but when I build the pico2 firmware locally my device doesn't boot, no serial device, no CIRCUITPY drive. If I grab the "absolute newest" from circuitpython.org the device boots normally, I've been building espressif boards without issue but it's been a while since I've built an RP2040 board, is there a raspberry SDK update I have to do locally or something?
There is a pico-sdk submodule update but I don't think it would even build without that. The board page is here: https://circuitpython.org/board/raspberry_pi_pico2/
also make sure you have the right version of gcc
I did a make remove-all-submodules and then make fetch-all-submodules again just to make sure, the firmware builds but doesn't boot. I did download the absolute newest from the board page and that works fine. My gcc version is 11.4.0.
we are using gcc 13.2rel1
okay, I'll try getting that updated π
okay, it has been a long time since I looked back at the learn guides π
@danh @stuck elbow That did it! Thanks π
interesting, and glad that it did. I wonder what is better in the newer compiler
I was actually using version 10.3 of the cross compiler, 11.4 was the native gcc....
I guess it's really been a while since I've built raspberry images π
hello! I'm pretty far along on a big project and I would like to add some error logging. Sometimes I get hangs/crashes after long run times and I thought if I periodically log to file, I could investigate the crashes. SO, I looked at the website and they show that you need to change the file IO to (a) PC can write files to (b) CircuitPython can write files. And their recommendation is is to use hardware pin and some code in boot.py. I don't like the idea of adding a pin-read. Has anyone actually worked with this file switcheroo functionality?
Actually, I could use the push button that is already on the system. boot.py would read only on start-up, so my procedure would be to hold that button down on boot. Still I would really like to hear if someone has worked with this functionality
i dont think anything would be more convenient than the button, but you could eg store a bit on nvm that controls whether computer or circuitpython gets access to the filesystem (being toggled on each boot)
I already have an NVM read on boot and it has been working reliably for months now. I quite like it
if the PCB was designed that way, you could perhaps check whether power comes from USB port (likely PC, but might be some other thing with a USB cable in it), or from some other input... to then configure filesystem accordingly
but yet again, and specially when you already have a button, i think that's the best solution
that's just my personal preference, ofc
yeah, I think you are right. Thatnks for kicking this around a bit. I think I have a good way forward now
I wanted to try using a Pico2 with a piCowbell DVI or a Pimoroni Pico DV base so I built a Pico2 firmware with picodvi enabled. I'm guessing that the Framebuffer_RP2350 routine has been updated to support HSTX and dedicated(?) pins associated with that peripheral since it kicks out the PIO pins used by the older Pico DV devices as invalid.
This may only be a short term issue until new HSTX versions of these devices become available but it would be nice if there was some legacy support to r...
One other thing maybe worth changing for the challenger_rp2350_wifi6_ble: board.ESP_RXD is actually the TX-pin (from the perspective of the MCU). Same with board.ESP_TXD, which is the RX-pin. The very similar challenger_rp2040_wifi_ble has this right (but using the pin-names board.ESP_RX, board.ESP_TX).
I would also keep the pin-names in sync. I assume there will be users upgrading from the rp2040_wifi_ble and they will certainly be more happy if they don't need to change their pro...
Files for the newly added board (Pimoroni Tiny FX).
See https://github.com/adafruit/circuitpython/pull/9575
@ZodiusInfuser: FYI
Guys, about VID and PID from Seeed, read this:
https://github.com/adafruit/circuitpython/issues/9507#issuecomment-2298119726
Seeed Xiao ESP32-S3
VID: 0x2886
PID: 0x8056
Guys, about VID and PID from Seeed, read this:
https://github.com/adafruit/circuitpython/issues/9507#issuecomment-2298119726
Seeed Xiao ESP32-S3
VID: 0x2886
PID: 0x8056
OK, this looks good to me. @deshipu and @tannewt are you ok with this?
I was told that I should at least mention my CP issue here, since it "might be a regression in the socket code" (I hope those words mean something) from 9.05 to 9.1.0. The linked post includes code to duplicate the problem.
[answered in #help-with-circuitpython as I think it's an intentional change]
I've used a digital pin to enable / disable writable mode for a handful of projects on several different micro-controllers and never had any issues.
I suppose if it lost power while circuitpython was trying to write it might lead to the drive being in a corrupted state though. Maybe best not to do it on a battery powered project unless you also have active battery monitoring and can disable "risky" behaviors like writing when the power is low.
Truthfully though if you can work in an SDCard to the circuit then it's more convenient than writing to CIRCUITPY drive IMO. You get way more capacity and don't risk corrupting the microcontroller storage + you don't have to set up and use the pin to switch states during boot since your SDCard can just always be writable.
Thanks for the response. Just what I wanted to hear was someone's experience over multiple projects. I'll keep the SD card in mind. Many of my projects are on the larger side and adding features that are for ME and for development just make sense. I had a great big push button in the project and so now I'm reading that during startup. So, to go into dat-logging and error-loggin mode, I just hold down the button during power-on. Seems to be working ok (<24 hrs)
How about the reset signal? as soon as I screw the enclosure shut, I seem to need to do a hard reset. Do you have experience using a reset button? perhaps less of an issue now that I'm using a powered USB hub with a push-on/off button.
Using numpy greatly increases graphics drawing for complex geometry.
Some microcontrollers expose the reset pin on a header that you could then extend out to the outside of your case if you needed. The raspberry pi pico famously does not have an on-board reset button so if you want to reset it you must either attach your own to the exposed pin or just use a jumping wire to connect it to GND.
I use reset buttons frequently, but don't use enclosures that much, and when I do I typically end up with ones that leave the on-board reset pin exposed either on an edge or with a hole cutout to poke it with something skinny.
Could you conditionalize this so the new code is used only #if CIRCUITPY_ULAB is true, and the old way is used otherwise? It's possible to set up complations that way, so that _eve is enabled but ulab is not, and it would be good to support that combination. Thanks.
@tranquil ether When wiring up an enclosure external reset switch, for microcontrollers that only have a reset button and no GPIO reset (such as the QT Py) you can bodge some wire to the physical reset button. It won't be pretty but it will work. Any Feather is super easy in comparison as Feathers have 2 GPIO for hard reset (RST to GND or EN to GND).
Thanks for submitting this! I have some questions though...
- Didn't this configuration work once upon a time?
- Does removing the sdk uart configuration have any downsides, like preventing visibility of early boot messages?
- I found 4 boards with CONFIG_ESP_CONSOLE_UART=y in sdkconfig but this PR changes 2. Any reason to leave the other two unchanged?
#9532 has been merged
It's difficult to report detailed error information from the constructor of a PWMOut object, because the constructor is designed to never throw an exception; instead, it can return one of a small number of generic failure reasons.
It was written this way so that the code could safely be called outside the VM, specifically so that LCD backlight objects could be created at board initialization time.
As for why it fails now and did not in the past, it is probably due to changes in esp-idf ...
@tranquil ether in addition to that, many Adafruit boards have undocumented test points for reset & boot mode that can be seen on the PCB designs. these are used for factory test. For instance, qt py esp32-s2 has SWC1 for rset and SWC2 for BOOT0. It is tricky but you can solder fine wire to these pads and bring it out to a physical button. There's no silk for these pads so you'll want to import the design files into an eagle-compatible PCB editor so you can locate it. https://learn.adafruit.com/adafruit-qt-py-esp32-s2/downloads
- Didn't this configuration work once upon a time?
Yes it did, the boot loop didn't occur in 9.1.2/9.1.3.
- Does removing the sdk uart configuration have any downsides, like preventing visibility of early boot messages?
On the two boards I have/tested, I was still able to connect to the REPL over the UART but you are right, the early boot messages are no longer visible :cry:
- I found 4 boards with CONFIG_ESP_CONSOLE_UART=y in sdkconfig but this PR changes 2. Any reason to l...
The early boot messages are no longer visible
I think this is fine, because this is just noise to most users anyway. I would prefer these be suppressed for ordinary use.
I would prefer these be suppressed for ordinary use.
Okay, but remember that at least on the boards I'm testing, their are two USB connectors, for ordinary use you would connect to the connector labeled USB which brings up the CIRCUITPY drive and shows up as /dev/ttyACM0, that connection doesn't show the early boot messages anyway. If you're connecting to the UART connector /dev/ttyUSB0 you don't get the CIRCUITPY drive and you're probably doing some debugging. That's the connection that...
@RetiredWizard Ah, sorry, I misunderstood. Maybe I am seeing the boot messages on the non-full-USB boards.
<@&356864093652516868> The weekly CircuitPython meeting (delayed one day due to a US holiday) will be in 1.5 hours, at 2pm US Eastern time. Add your notes to https://docs.google.com/document/d/1BXYMbOxPWUug-6WwltLdcvqv7i_de3059noqBx0Sn-M/edit?usp=sharing. ttyl!
@RetiredWizard Ah, sorry, I misunderstood. Maybe I am seeing the boot messages on the non-full-USB boards.
Now I'm not sure, I did some retesting and there is a smaller set of the boot messages on the normal port....
Do you know if in 8.2.7 frequency=1 actually gave a 1Hz PWM signal?
I didn't measure it precisely, just observed that an LED pulsed approximately once per second. I've used this in the past on other ports, and it works fine on ESP32-S2 in CP9.
TinyUSB didn't turn on the interrupt it needed.
Fixes #9454
The MagPi magazine
-
Pico 2. Raspberry Piβs latest microcontroller board is the ideal engineering and education platform. It brings the brand new RP2350 processor into a hackable, makable board with GPIO input and output pins. Weβve secured interviews with the engineering team about this electronic marvel.
-
RP2350. With its higher clock speed, double the...
Yes, picodvi is HSTX specific on RP2350. For Pico you can use: https://learn.adafruit.com/adafruit-dvi-sock-for-pico
Thanks for the board def! Please get a proper USB VID and PID for it.
Where did you get this? It doesn't look legit. You may want to request one from pid.codes.
[adafruit/circuitpython] New branch created: tannewt-patch-2
The bug impacting us was fixed
(was just going to ask about the merge) π
π
Thanks for hosting Dan. Have a great week everyone.
@tulip sleet need any help/assistance on the 1.23 merge? It'd be good to have that in 9.2
Was waiting for the lock necessary for MAX3421E, or should deinit() ignore the lock?
I switched to a proper lock for ESP32 because the TinyUSB task is run in a different FreeRTOS thread. I think it'd be ok to check ctrl-c but we need to think about the case where another task is using the bus when deinit is called.
[adafruit/circuitpython] New comment on issue #9521: Third sleep option: RAM-preserving "deep" sleep
This sounds pretty straightforward. Essentially this would be a python API that internally just accesses the bitmap used in
prevent_light_sleep()that you mentioned earlier.
Yup, then you can introspect relevant state. A library can even verify sleep for you if needed.
@konstantint Waiting for you to reply before merging.
I haven't worked on it since last week, but it's my next thing. I'll let you know!
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/13FWJDCzuchjYlYK_5Q_3zCgKl5-x6oX0YLFo-AkJMJM/edit?usp=sharing
Thanks for tracking this down externally and reporting it:
https://github.com/readthedocs/sphinx-autoapi/issues/478
xg24 is a network issue. bdmicro vina d21 is fixed in a separate PR.
Looks good! I don't have an _eve setup to test this, but obviously you are testing this. The conditionals look fine.
Getting our young port up and running for the first time...the MSC device mounts correctly but shows up as a USB drive (not "CIRCUITPY"). Windows wants to format it before I can use it...I'm doubting that's advised as I can't see that anywhere in documentation. Is there anything special I have to do for Windows to recognize the filesystem properly?
@wanton dirge I suspect the formatting code that CP is doing isn't working
how are you storing the filesystem? CP has an "internal" mechanic or an "external" one
Internal currently, but wanted to get the REPL up before I was really able to test my internal_flash.c/.h. It is totally possible that my flash FS driver is the culprit.
do you have a way to do debug printing? you could dump the first few bytes of every read and write
to make sure the subsequent reads match what was written
At this point I have the USB-CDC, so I could try dumping to that with mp_printf?
that'll only work once USB is going
Ah, right
and the flash formatting happens before that. have you done busio.UART yet?
(you could also use your own uart code)
Doesn't get set up until after boot, right. No haven't done busio.UART but I'm not too far off; I did add in a serial.c for the supervisor at least which I can perhaps mangle into that module.
what does your current serial do?
busio.UART just means the standard "CONSOLE_UART" stuff will work
Nothing in particular, I had it as a placeholder to test out after getting the REPL up. That happened about 30 minutes ago π
Was intending to perhaps use it as a debug UART for me to develop with
it may be quicker to just init a sdk UART for debug prints
busio.UART may get you into pin mapping earlier than you want to
I do have a lot of the preliminary pin scaffolding done, but I think using a simple debug UART to debug the FS stuff should be pretty simple. Thanks, I'll give that a shot!
π good luck!
I think your error is "usb is working ok but the MSC bytes back don't have a file system"
Yep, that sounds about right. Just wanted to make sure that was the right path before diving in again
there is normally a "safe mode" message that says "CIRCUITPY drive could not be found or created." which should show up in the REPL when you press reset.
Making sure this makes sense, after doing some research and testing with audio effects best bet to make an issue to track my ideas? There is one (https://github.com/adafruit/circuitpython/issues/8974) but is specific to AudioMixer and I have an idea that may work more generic. Probably better this way to discuss any API issues before a draft PR?
I think its fine to discuss there even if you don't think it'd be done in audiomixer
Thanks sounds good. My rough idea is maybe an audioeffects library but I'm trying to come up with a way it can then be used for any audio library if an interface is added.
Welp. I suspect this is due to not implementing Descriptor. HID uses this to distinguish different report characteristics.
β¦converting to the appropriate fixed-point internally.
No more fiddly 8.8 / 1.15 fixed-point math in user code.
Confirmed on EVE hardware
This is a breaking change to the API. The API is _eve, not eve, so is this somehow considered an internal change, hidden by some library? You are the original submitter of _eve, so you're the expert on this.
I don't really have any idea what the client base of _eve is in CircuitPython.
We generally make breaking changes on a major-version boundary, in this case 10.0, which is not imminent by any means. We often try to make the intermediate versions handle both cases for a whil...
Side comment re development practices. Instead of submitting PR's from your main branch, we recommend creating a branch for the PR's. That way your main is tied to upstream's main. See https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github/always-work-on-a-branch.
Right, these methods() are visible to the end user: _eve is the base class for eve.
I'll look at a better implementation that's backwards-compatible.
And thanks, a branch per PR is a good idea.
I took a quick peek at the make stubs you mentioned and it seems I'd need more than 20 minutes to figure out what exactly needs to be done. So far I haven't found that extra time :)
I'd probably prefer merging this now as-is and looking into how to generate the documentation a bit later, to avoid this hanging for uncomfortably long (e.g. I'm probably too busy this weekend to take a look).
thanks - will mark this as "Changes Requested"
I wanted to add effects on synth channels and saw this issue also about adding audio effects. After some discussion on discord and looking through the code and some other audio libraries I see all the audio code uses get ..._get_buffer_structure and ..._get_buffer to pass information from one to another. In this way audio components can be chained together. E.g. synthio.Synthesizer can play into audiomixer.Mixer which can play into audiobusio.I2SOut to get to the speaker.
My idea...
MicroPython probably has this issue as well. This is code from them.
@tannewt Thanks for the pointer; I just had PR micropython#15708 approved for this, and there were a few recommendations that I'd like to bring back here. I have a branch ready for PR, but I want to check my approach.
I've just cherry-picked from to my mp branch to a cp branch. This double-upstream scenario is new to me, though; is there a preferred way to bring changes down from mp?
This is a custom board that i developed it using the same footprint as pi zero.
the PID was obtained from Espressif https://github.com/espressif/usb-pids/pull/33
I have already build and tested circuitpython on it, and so far all is good
I tested the camera with CircuitPython 9.1.3 and it works. Here a snippet to test it:
import board
import displayio
import struct
import cores3
import adafruit_ticks
cam = cores3.camera(framebuffer_count=2)
display = board.DISPLAY
display_bus = display.bus
display.auto_refresh = False
display_bus.send(42, struct.pack(">hh", 0, 319))
display_bus.send(43, struct.pack(">hh", 0, 239))
t0 = adafruit_ticks.ticks_ms()
while True:
frame = cam.take(1)
if isins...
I noticed that this message is printed during a failed build. ```common-hal/rp2pio/StateMachine.c: In function 'common_hal_rp2pio_statemachine_get_pc':
common-hal/rp2pio/StateMachine.c:1102:13: error: unused variable 'offset' [-Werror=unused-variable]
1102 | uint8_t offset = _current_program_offset[pio_index][sm];
| ^~~~~~
cc1: all warnings being treated as errors
-e See https://github.com/micropython/micropython/wiki/Build-Troubleshooting
../../py/mkrules.mk:14:HELP_BUILD_ERROR ?= "See \033[1;31mhttps://github.com/micropython/micropython/wiki/Build-Troubleshooting\033[0m"
I was going to take that out, but hadn't done it yet. I can do it as part of the v1.23 merge
I think it snuck in, in the v1.22 merge
-e whatever
```system that use dash as /bin/sh may print the -e because it's not a recognized flag by the built in echo command.
@tulip sleet thanks
I'm not sure it's all that helpful a message even if we pointed it to, say, the Learn Guide
If StateMachine.run needs to contain a JMP instruction, the offset property can be used to correctly encode the target address.
StateMachine.pc is useful for debugging, as it can give an overall statistical idea of which state machine instructions are executing, or show the instruction where the machine is stalled.
You could point to this discord channel
I wasn't sure of that, but good idea, maybe the guide and discord
@onyx hinge if you are in PIO land, you could look at the new additions in the rp2350
@slender iron good idea. I'm also a bit interested in doing ps2io in pio, I don't think we have it on rp2xxx yet.
That isn't valid. I don't know how they came up with it. Let's not propagate it.
What happened to the Feather S3 that you requested the PID for? It is weird you are reusing it.
USB_MANUFACTURER = "CircuitArt"
I wouldn't do mixer.voice[0].addeffect(effectName). Instead, I think the effect could be a separate object that you'd "play" into the mixer voice or vice versa.
I like the idea of separate modules for different effects.
@todbot and @jepler may have thoughts too.
I've just cherry-picked from to my mp branch to a cp branch. This double-upstream scenario is new to me, though; is there a preferred way to bring changes down from mp?
Cherry picking is fine. It'll be re-done when we merge from MP but that's ok. No need to wait for us to merge MP in with the fix.
my Feather S3 project was canceled and replaced with the zero version, I opened new pull request in espressif pid requesting changes on the pid name as well
See extmod/modasyncio.c.
Remove push_head, push_sorted, and pop_head.
Also remove from asyncio library, if safe to do so.
In py/circuitpy_mpconfig.h remove CIRCUITPY_8_9_WARNINGS and its uses elsewhere.
@onyx hinge What day(s) are planning to be at the Vintage Computer Festival? We'll be going up on Saturday, I think
@uncut nexus I'm planning to be there both days, driving in from Nebraska friday & driving home monday.
@onyx hinge OK - I'll be the tall old guy saying things like "haven't we got one of those in the basement?"
I'd be happy to meet you. I think I'll mostly be wandering around seeing what people have at their exhibition tables.
Us too. I'll keep an eye out for you. Hard to meet up with so many folks around
BLE HID was broken because the descriptor wasn't marked as readable. This fixes #9430.
Also add read/write support for client. Servers can only set the initial value. Setting it later will raise a NotImplementedError.
Setting a user_description will also raise a NotImplementedError. This can help us find cases that use it.
blue hair help
my hair has mostly faded/grown out since pycon
oh well
I think this might be the issue: https://github.com/espressif/esp-idf/issues/13962
I'll update the IDF now to 5.3.1.
The _eve implementation now works in legacy mode by default. This preserves the existing behavior.
When switched into "new" mode it accepts the new argument formats. It wasn't much more code to handle this.
I've added coverage in my test cases for both modes, and it passes on rp2040.
(Note that I had to turn off _eve for the metro_m4_airlift_lite board, as it overflowed the flash. I don't think anyone is using _eve on this tiny board.)
The
_eveimplementation now works in legacy mode by default. This preserves the existing behavior.When switched into "new" mode it accepts the new argument formats
So, just to clarify my understanding: is the 2-ints-vs-1-float difference a difference in the eve displays themselves, from older to newer versions, or do they all have the same firmware?
I was thinking you could decide which computation to do based on the number of args to each transform function: if two args (in...
So, just to clarify my understanding: is the 2-ints-vs-1-float difference a difference in the eve displays themselves, from older to newer versions, or do they all have the same firmware?
This is an EVE hardware function, and it works in fixed-point coordinates. What this change is doing is hiding the fixed-point math, so the user code can use floats.
I was thinking you could decide which computation to do based on the number of args to each transform function: if two args (in...
uh oh... simply adding import wifi to a <200 line code.py running Adafruit CircuitPython 9.1.3 on 2024-08-30; FeatherS2 with ESP32S2 causes it to crash/hang (but no safemode) ...I'll see if I can narrow it down
Incorporating stdio recommendations from micropython#15708.
Thanks! It was good to get Damien's take on this.
The Metro M0 build German build is overflowing by 16 bytes. Tomorrow I will see about shrinking this build slightly. The other build failures are transient CI issues.
@tannewt just thought to let u know know that Espressif-pid has been changed successfully
https://github.com/espressif/usb-pids/pull/179
@dhalbert sorry for late response. This does not ring any bell to me, I am not quite sure, but I remember to see this randomly (not very often). The flow would be around CPY is_writable_cb() usage
- when is_writable = false tinyusb will reject WRITE_10 command
- host will send TEST_UNIT_READY/REQUEST_SENSE for previous failed reason, currently is SCSI_SENSE_DATA_PROTECT
- normally host will attempt to re-write again later
not sure what went wrong, maybe we could use a not sense such as ...
@todbot Addressing the original issue: I was able to implement TouchIn using a 1M pull-up instead of a pull-down, testing on an RP2040. The sense code just pulls the pin down instead of up and then measures the time to flip from logical low to high. The code changes are simple. The calibration may need to change due to the transition voltage not being exactly in the middle, but in principle it works.
However, this method doesn't yet work on RP2350 because of the latch-up. I need to impl...
@fading stirrup how'd the P4 work go? I've got a devkit coming tomorrow
Hey folks, I'm checking in again on the FS component for my young port: FS is mountable -- proper drive name and all! I can't write to it from the OS at the moment, but working on that.
- CIRCUITPY drive mounts, and includes a bout_out.txt and an empty code.py. REPL works and I don't get any safe mode messages in REPL or boot_out.txt, even after pressing reset.
- Quite a lot of FS artifacts seem to be in "CIRCUITPY:" on first startup...is this okay, or does it indicate some error condition I should be concerned about?
- I'm having issues writing files to the drive. For example if I try to modify code.py, the OS errors out and says it cannot be written. Seems to break the REPL once I do this. It comes back if I press RST though. Is there something about the workflow I may be missing when the OS tries to write this back to the CIRCUITPY drive?
CircuitPython version
Adafruit CircuitPython 9.1.3 on 2024-08-29; Adafruit Feather ESP32-C6 4MB Flash No PSRAM with ESP32C6
Code/REPL
import time
import board
import digitalio
led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT
while True:
led.value = True
time.sleep(0.5)
led.value = False
time.sleep(0.5)
Behavior
When running the blink code above, I try to initiate a connection with htt...
The .tmp files are not ours, but all the rest are created when CIRCUITPY is created. They prevent macOS from creating junk files, suppress the trash can, etc.
Might the .tmp files be being created by your editor or by some utility program on your host computer?
These may be created by Notepad++ when the attempt to write into code.py crashes. I was able to delete them, eject the drive, then reset via the button and the drive comes back without those files and without issue.
notepad++ does not do a flush when writing files, which means files may go unwritten for a number of seconds. See https://learn.adafruit.com/welcome-to-circuitpython/recommended-editors
Okay, that did the trick; thanks very much for linking that article. I do get one strange error when trying to run code.py...I'm not trying to import anything and I don't see code.py files usually including any if " __name__ == '__main__' or similar. Is this something that should resolve as I add more modules?
we don't need to use if __name__ == "__main__" generally, because code.py just runs. I'm not sure about your error, I don't see the underscores, and there are a lot of extra spaces.
Adafruit CircuitPython 9.1.3 on 2024-08-29; Adafruit Metro ESP32S3 with ESP32S3
>>>
>>> __name__
'__main__'
>>>
Hmmm okay, I will try and dig in on it a bit more then on my end. I get the same output for the __name__ variable as above.
could you upload your code file using the + to the left. Also here is how to paste code: #welcome message
As in my code.py? Here...
a = 5
b = 10
c = a + b
I tried a print("hello") as well but got the same issue.
I don't know where the name ' ' is not defined is coming from
No worries, I will try and inspect it a little more. Thanks for the help in any case!
MOVED TO HELP-WITH-CIRCUITPYTHON: Is there anywhere I can look to find information on how to connect BMP390 sensor with circuitpython to adafruit io? Thanks!
ask in #help-with-circuitpython ; this channel is for core development questions, or ask in #help-with-wippersnapper-and-adafruitio
nice work @wanton dirge !
thanks @slender iron!
@tulip sleet you around?
the rp2350 issue looks like clock startup delay issue again
just wondering if you have any context on the 64 setting
it makes no sense to me that it uses the xosc to count the delay
did you already set the MULTIPLIER
I tried several multipliers and 64 seemed safe. 32 was too low
i'll look at pico-sdk...
i think a q is what's different about our component choices? do the other RP2350 boards use the MULTIPLIER?
It was removed from this file in the RP2350 PR.
I made a minimal change to their logic and delay computation to be able to lengthen it by a lot. That was how I did my initial PR to pico-sdk
the code now relies on the xosc peripheral to time the delay
based on the xosc input!
all I did was include the multiplier in here: #define STARTUP_DELAY ((((XOSC_HZ / KHZ) + 128) / 256) * PICO_XOSC_STARTUP_DELAY_MULTIPLIER)
my change set the multiplier back to 1 for everything
I see it wait 57 ms or so now
that sounds about right. yes, it does count cycles. The original idea was to let the amplitude go up. What I saw was that it was oscillating at a higher frequency than the 12MHz, or was jittering. So I made it count a lot more cycles.
The XOSC is not immediately usable because it takes time for the
oscillations to build to sufficient amplitude.
yup, that's what I'm seeing too. it is counting too fast during start up
I saw that on the Saleae and/or an oscilloscope
we are not using the specified crystal
most other people are
Surprise surprise...it was a file I/O issue. I had fudged some math on the write_blocks that gave me an issue which only cropped up deeper into the FS. So the file text was getting written over a different array and the lexer only saw "0xff"s all the way down.
All good now though. Thanks again for the help folks!
Thanks for the debugging!
Tested HID with an iPhone. Works! Thanks!
@slender iron I will shoot for another alpha release tomorrow after I fix the board overflow in #9598 and maybe see about #9583. I'm just starting to work on getting the V1.23 merge to compile, but no big stumbling blocks. There are some calls I have to change pervasively due to signature changes or newly available obj creation routines.
after the merge we can move to a beta.0, I guess
Sounds good!
@dhalbert, agreed, this is what I found when I was hacking too. I didn't consider it a viable alternative since it changed the API of touchio and would break existing examples. My concern was if the API changed to support both directions, shared_module/touchio size would grow, putting it at risk of being excluded from SAMD builds.
The API is the same: it's just that you use an external pullup instead of a pulldown. The code difference is very slight, and can be determined at compile-time. See https://github.com/adafruit/circuitpython/compare/main...dhalbert:circuitpython:rp2350-touch. Also, SAMD21 doesn't use the generic touchio: it uses the proprietary SAMD21 hardware touch, so it's not affected by this.