#circuitpython-dev

1 messages · Page 76 of 1

manic glacierBOT
#

I've forgotten where I was upto on this. Anyone wanting to take this over is welcome. Be aware that there are at least 2 different boards with resistive touch-screens (and using different display drivers) and the capacitive version is also different, and many of these boards have assorted hardware "bugs" (like wrongly soldered leds and light sensors at least) and other subtle differences between them

tulip sleet
#

Here is the notes document for next week's CircuitPython Weekly Meeting on Tuesday, November 12, 2024. The meeting is delayed one day due to a US holiday on Monday. 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/1PGiFBDcKhh9sPvgxh5OmaNecNwx4Sm3nQsH5KbbKCyA/edit?usp=sharing

crimson ferry
#

I must have missed the raspberrypi-specific setup to build... /bin/sh: arm-none-eabi-gcc: command not found ...am I missing the toolchain?

#

(can't get the custom build Github actions to work either)
I'll try the Codespaces method (...no joy there either: No rule to make target 'lib/tinyusb/src/portable/raspberrypi/rp2040/dcd_rp2040.c')

fleet hollow
lone axle
# fleet hollow <@382939733107408897> I am noticing a few more people using the WM8960 library (...

Yes, it needs 2 things basically and it will get supported by circup automatically: 1) An initial release made for the repo, and 2) A PR submitted to the https://github.com/adafruit/Adafruit_CircuitPython_Bundle repo to add it as a submodule.

I'm not familiar with the WM8960 CODEC or hardware, I see that you've done much of the recent work to that library... Would you consider it ready for an initial release? If so I can make the release and PR the bundle in a little while, although if your interested and willing you can also submit the PR to the adafruit bundle.

manic glacierBOT
#

The PR (https://github.com/adafruit/circuitpython/pull/9788) has been merged into the main branch. This feature should be available within the "Absolute Newest" downloads within https://circuitpython.org/board/raspberry_pi_pico/ in case you aren't building the firmware yourself.

I've got one last quick update to the example using synthio.LFO. To avoid any potential drift between the waveform_loop_start and waveform_loop_end, it would be better to share a single synthio.LFO object b...

fleet hollow
lone axle
# fleet hollow Thanks for the direction! There is potentially one issue that I'm researching in...

Sounds good. There is a learn guide that covers the bundle adding here: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-in-the-community-bundle it's geared toward the community bundle, but the Adafruit bundle is mostly the samed because one was modled after the other. Looking at the prior merged PRs in the adafruit bundle repo can help for a quick look at what changes are needed. I still refer to old PRs when I add to the bundle to make sure I got all the right bits.

manic glacierBOT
crimson ferry
#

Is there some problem with ParallelImageCapture when building for RP2350?

#

oh, that was a red herring, apparently it's this:

In file included from ../../lib/mbedtls_config/mbedtls_port.c:33:
sdk/src/rp2_common/hardware_rtc/include/hardware/rtc.h:11:10: fatal error: hardware/structs/rtc.h: No such file or directory
11 | #include "hardware/structs/rtc.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

#

maybe no one has built RP2350 with ssl yet, and something deep needs a fix

onyx hinge
#

@crimson ferry I think you're right. There's an rp2040 header .../rtc.h but not rp2350.

#

I'll spend 15 minutes looking into it right now

manic glacierBOT
onyx hinge
#

ok, it was 16 minutes 😜

crimson ferry
#

@onyx hinge wow, thank you! I'll test it right away (once there are artifacts)

manic glacierBOT
manic glacierBOT
orchid basinBOT
fathom sand
#

BLE HID and OUT reports.

I can create a "BLE HID Keyboard" using a FeatherS3 which works. (At least some times)

However I can not consume any OUT reports from the host and accessing "self._keyboard_device.get_last_received_report()" gives me an error. ReportIn does not have a member get_last_received_report

Anyway, I am asking myself: why is the not a callback which I can set for receiving OUT reports from the host? Or if this is too complicated, why there is no possibility for setting up a "queue" which holds the OUT reports which did arrive in background?

Mentioning this, it is not my final goal to create a HID keyboard but a HID Braille display which gets its braille dot's by the means of OUT reports from a host.

I have working Arduino code for this using the NimBLE library, but I really want to continue to implement the code using Circuit Python.

So my first question for now: How can I write code in CP 9.2 which gives me the possibility to consume OUT reports from a HOST ?

Is there any example for how to consumer BLE HID OUT reports for CP 9.2?

onyx hinge
# fathom sand BLE HID and OUT reports. I can create a "BLE HID Keyboard" using a FeatherS3 wh...

I am not an expert in BLE, but I looked around our source examples & guides and don't see any use of the received report with BLE HID. It may be that this doesn't work due to bug or oversight. It sounds like you've made a substantial effort to try to find this functionality as well. So at this point I'd suggest filing a github issue about this. (you can file it at https://github.com/adafruit/circuitpython/issues/new?assignees=&labels=bug&projects=&template=bug_report.yml though you must be signed in to github)

If BLE HID OUT reports do work we should have an example or guide showing it working. and if it doesn't, we should implement it or note it as a limitation.

With USB HID the reasons for having the ability to fetch the last report, rather than having a "received report callback" is from a general philosophy that calling back into Python code due to external events is fragile (hard to code in the C core and hard for casual users of CircuitPython to reason about) and so we use other methods whenever possible. For the specific case of HID OUT reports of keyboard LEDs this has not been a limitation, but if the HID OUT reports to a bralle display represent a stream of some sort where you have to receive and act on every message, the "last received report" might not be a good substitute for actually having a chance to receive and act on each OUT report.

fathom sand
#

Thank you for taking a look at what I struggling with!
I understand the complication which comes up from handling received data in low level C code and passing this data "up" to the CircuitPython "level". Initially I think I can live with the current approach of "last data" but I think getting the data in a queue would be preferable. It would be ok if max queue size is limited and in case of an overflow the oldest elements in the queue would be lost...
A time-stamp for the received OUT report would be helpful.
There are Braille displays with 80 characters or more out there and the typical max refresh rate ie 20Hz.
(one 8-Dot Braille character is 1 Byte)

manic glacierBOT
#

Just implemented the fix using a while loop. It won't be as performant as memset, but I couldn't find any alternative. Here's the script I am using to diagnose the output. https://gist.github.com/relic-se/1bf0f95aaf444e4d5a0fd47228c3bb31

I updated audiodelays.Echo as well. In order to test that, you can swap out the module in the prior gist and set mix=0.0. The resulting output is the same.

tulip sleet
# fathom sand Thank you for taking a look at what I struggling with! I understand the complica...

The OUT report handling we have currently was just for keyboard LED's as noted. At the time, the HID code, both CircuitPython and lower-level (USB) had to fit on very memory constrained boards (SAMD21). Now it's more relaxed.

A queue sounds like a good idea. The EventQueue mechanism we use for keypad could be generalized for this use as well. I've wanted to make EventQueue be separable and usable for Python code to queue events as well as C code. But we have some other priorities right now, and this would go on the "Long Term" list.

#

I would encourage you to write this up as an issue.

fathom sand
#

Please Note: I am not talking about USB-HID but BLE-HID.
And: I did not succeed to get LED - Info for a BLE HID connected keyboard.
(LED - Info for a USB connected keyboard works fine.)

tulip sleet
#

I do understand. the BLE OUT issue is a separate issue we should fix. The original OUT support (no queue) was for USB.

#

i'm just saying why the API is the way it is

fathom sand
#

My intention is not to criticize, but to inform about my findings.
For my purpose the BLE OUT "issue" would be the most important / essential one.
As I said before, I think for the moment I could "live" with the "last out by ID" approach.

tulip sleet
fathom sand
#

Will do!

orchid basinBOT
manic glacierBOT
#

Tests so far are promising. On an RP2040, I've got 12 notes running at once, each with a BlockBiquad with LFO on frequency and q_factor. It sounds stable @ 48kHz. I've tested it up to 72kHz successfully, but it stutters at 88.2kHz+. I would assume that faster processors (with FPU) like the RP2350 would be able to handle 96kHz. I haven't tested that myself yet.

import audiobusio
import board
import synthio

audio = audiobusio.I2SOut(bit_clock=board.GP0, word_select=...
#

.. and add a very basic audioeffects test, showing that it plausibly is working

I had to address several build errors that occurred in the Unix build, mostly related to conversion from FP types to integral types (replaced by explicit casts) and by
accidental mixing of regular & f-suffixed floating constants (replaced with the MICROPY_FLOAT_CONST macro)

Particularly this change could use consideration:

-    self->max_echo_buffer_len = self->sample_rate / 1000.0f * max_delay_ms...
fathom sand
onyx hinge
#

thanks @fathom sand !

manic glacierBOT
#

I think your solution to fix the implicit conversion will do the trick. There will be some imperceptible deviation from the actual ms value, but I think that's inevitable. Thanks for scanning through both modules and making those updates throughout. I'll try the filter tests out when I get the chance.

I see you haven't created a test for the audiodelays.Echo yet. When you do, could you make sure that it's testing in stereo? (ie: hard panned sine waves at different intervals) I'm worried ...

manic glacierBOT
manic glacierBOT
olive vessel
#

Making progress on my port for a new STM32L433-based board and I'm now having a few linker errors that I can't make heads or tails of. Here's an example:

/Applications/ArmGNUToolchain/13.3.rel1/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld: build-cygnet/st_driver/stm32l4xx_hal_driver/Src/stm32l4xx_hal_uart.o: in function `HAL_UART_IRQHandler':
/Users/satch/Development/circuitpython/ports/stm/st_driver/stm32l4xx_hal_driver/Src/stm32l4xx_hal_uart.c:2616:(.text.HAL_UART_IRQHandler+0x222): undefined reference to `HAL_UARTEx_WakeupCallback'

As far as I can tell, I have the right includes for the stm32l4xx HAL and the WakeupCallback is defined, but if anyone that has experience with STM32 ports can give me a clue as to what I might be missing, I'd appreciate it.

#

I'm pushing my branch to our fork at the mometn and will share a link once it's up

tulip sleet
native sandal
#

Can I build CP for ESP-IDF by installing ESP-IDF via VS Code?

tulip sleet
#

certianly you can edit with VS Code, but we haven't tried any integration with Code

native sandal
#

oh good to know. I had followed the link to the espressif docs and was going to install from that.

tulip sleet
native sandal
#

Yes. The first thing it said was "Please read the README.md in that directory"

#

And that linked to the espressif docs

tulip sleet
#

maybe that is kind of out of date. Tyr just installing the appropriate prerequisites, and then doing the esp-idf/install.sh and source esp-idf/export.sh

native sandal
#

I'm still waiting on brew to update. I installed sequoia recently and a LOT of stuff is updating.

crimson ferry
#

my Mac is case-insensitive, and I've built for Espressif on it

fathom sand
manic glacierBOT
manic glacierBOT
mortal kernel
#

@danh Which is the preferred arm-gnu-toolchain, 13.2.rel1 or 13.3.rel1?
Related question: Are there any special toolchain considerations for RP2350 Cortex-M33 now that it supports hardware floating point?

tulip sleet
#

in the port makefile. I don't know why it's softfp. I was going to say that m33 is specified

mortal kernel
tulip sleet
#

in pico-sdk they use softfp for clang but not gcc, it looks like. I will see if I can find out why

mortal kernel
lone axle
#

@willow totem a while ago you worked on a fix in the arduino driver for the AM2320: https://github.com/adafruit/Adafruit_AM2320/pull/14 I found this from a thread in a CircuitPython library issue and have attempted a similar fix for the circuitpython driver https://github.com/adafruit/Adafruit_CircuitPython_AM2320/pull/30. I was curious to ask if you know whether it's possible to do similar looping / retry logic in circuitpython as you added to the arduino one? It seems like not possible to me since the i2c.write() function does not return a success value in the same way that the arduino one does, but I'm still very new to bus device driver internals, I didn't know if there was some other way in circuitpython to do it.

tulip sleet
lone axle
tulip sleet
#

You can catch the exception and re-try also, though the increased timeout may fix that. The exception I think is equivalent to the Arduino error code.

lone axle
#

Ahhh

tulip sleet
#

i said the same in the PR

lone axle
#

I will change it to use a loop and match the current arduino driver.

mortal kernel
# tulip sleet in pico-sdk they use softfp for clang but not gcc, it looks like. I will see if ...

Quote from gcc 13.3 doc: "Specifying ‘soft’ causes GCC to generate output containing library calls for floating-point operations. ‘softfp’ allows the generation of code using hardware floating-point instructions, but still uses the soft-float calling conventions. ‘hard’ allows generation of floating-point instructions and uses FPU-specific calling conventions."

I built with both softfp and hard options using the gcc 13.3 toolchain targeting adafruit_feather_rp2350. Minor change in firmware size from 806560 to 805872 bytes (respectively) but I'm not seeing any obvious performance difference. I think that hard is preferable but softfp is fine, too.

manic glacierBOT
#

I don't think there's any more clever way to detect a changed list length. You could use realloc and only initialize any new slots.

But of course not all changes to the filters list would necessarily change the list length. For instance, code could use filters[0] = new_filter_zero. Is the code handling this case?

Another option is to say that the contents of the list are snapshotted on assignment or require the value supplied to be a read-only sequence (tuple).

Is this code enoug...

mortal kernel
#

@danh Digging a bit deeper, the key difference between softfp and hard is that the hard variant of the ABI passes floating-point arguments/returns in floating-point registers whilst softfp uses fixed-point registers. Both softfp and hard generate floating-point instructions inside of procedures.

The only reason we'd want to stick with softfp is for compatibility with separately compiled code that is intended to target parts with and without hardware floating point. I'm not sure whether or not this is a consideration for CP.

tulip sleet
#

thanks for researching this

manic glacierBOT
#

@jepler Using a read-only tuple is the perfect solution here! The filter states would only need assignment within the setter. Thanks for the tip!

As for "equalizer" usage, the only applicable use at this time is to combine LPF and HPF to filter out unwanted signal. The example code in the first comment demonstrates that. Future additions of peakingEQ, lowShelf, and highShelf (from the Audio EQ Cookbook) to BlockBiquad would allow you to build a...

olive vessel
# tulip sleet in this kind of case, I'd just look for where that function was defined, and ass...

Thanks @danh I found the source and resolved that issue, appreciate the help!

I'm having a similar issue now with tinyusb that I can't track down.

/Applications/ArmGNUToolchain/13.3.rel1/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld: build-cygnet/lib/tinyusb/src/device/usbd.o: in function `usbd_int_set':
/Users/satch/Development/circuitpython/ports/stm/../../lib/tinyusb/src/device/usbd.c:1226:(.text.usbd_int_set+0x8): undefined reference to `dcd_int_enable'
/Applications/ArmGNUToolchain/13.3.rel1/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld: /Users/satch/Development/circuitpython/ports/stm/../../lib/tinyusb/src/device/usbd.c:1229:(.text.usbd_int_set+0xe): undefined reference to `dcd_int_disable'
/Applications/ArmGNUToolchain/13.3.rel1/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld: build-cygnet/lib/tinyusb/src/device/usbd.o: in function `tud_init':
/Users/satch/Development/circuitpython/ports/stm/../../lib/tinyusb/src/device/usbd.c:490:(.text.tud_init+0x98): undefined reference to `dcd_init'
/Applications/ArmGNUToolchain/13.3.rel1/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld: /Users/satch/Development/circuitpython/ports/stm/../../lib/tinyusb/src/device/usbd.c:491:(.text.tud_init+0x9e): undefined reference to `dcd_int_enable'

I've dug around in TinyUSB and it looks like everything is there for STM32L433 support and I can confirm everything builds locally for an STM32L4R5 board.

tulip sleet
#

dc_int_enable() is defined in tinyusb/src/portable/st/stm32_fsdev/fsdev_stm32.h and fsdev_ch32.h. Note the .h. Are those mentioned in the working ports?

olive vessel
#

@tulip sleet this file is included in TinyUSB when TUP_USBIP_FSDEV_STM32 is defined, and it looks like that's being defined in TinyUSB as well for the STM32L433xx in src/common/tusb_mcu.h

tulip sleet
olive vessel
#

understood. Just having a hard time seeing what I could be doing in the L433 port that would resolve this...

tulip sleet
#

but maybe you are doing that already

olive vessel
#

I'll do that, thanks for the suggestion

empty salmon
#

I am developing a new board using the SAMD21G18. I started with the ItsyBitsy M0. The primary change was the FLASH chip.

I am testing the SPEAKER which is on A0 which is PA02 (similar to a number of other SAMD21 boards).

With the following code, I get ValueError: Invalid pin when I attempt to use pwmio.PWMOut() :

import board
import time
import digitalio
import pwmio

sound_pwm = pwmio.PWMOut(board.A0, frequency=440, variable_frequency=True)
sound_pwm.duty_cycle = (65535 // 2) #0x8000

At first I thought the pin was not defined but I can use the pin with digitalio.DigitalInOut() and if I toggle it fast enough, it does make a buzzing sound.

Is there a build flag I need to use or some other build change needed?

tulip sleet
#

Espressif has a crossbar, mostly, and so does nRF, but SAMD assignments are very scattered.

empty salmon
#

Thanks @tulip sleet.

To confirm your instructions: I need to look at the Microchip datasheet for the SAMD21 and see which pins support PWM. Then use one of those pins for my SPEAKER.

Correct?

tulip sleet
#

yes, exactly

tulip sleet
empty salmon
#

Cool! Thanks @tulip sleet

native sandal
# tulip sleet maybe that is kind of out of date. Tyr just installing the appropriate prerequis...

Yeah, these steps really aren't working for me. For example, I didn't see an explicit instruction to clone with submodules or update the submodules, so I had to deal with that (and I just now saw instructions for it in "Recent Changes"). Now when I try to run pip3 install --upgrade -r requirements-dev.txt, I get this:

% pip3 install --upgrade -r requirements-dev.txt

[notice] A new release of pip is available: 24.2 -> 24.3.1
[notice] To update, run: python3.13 -m pip install --upgrade pip
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try brew install
    xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a Python library that isn't in Homebrew,
    use a virtual environment:
    
    python3 -m venv path/to/venv
    source path/to/venv/bin/activate
    python3 -m pip install xyz
    
    If you wish to install a Python application that isn't in Homebrew,
    it may be easiest to use 'pipx install xyz', which will manage a
    virtual environment for you. You can install pipx with
    
    brew install pipx
    
    You may restore the old behavior of pip by passing
    the '--break-system-packages' flag to pip, or by adding
    'break-system-packages = true' to your pip.conf file. The latter
    will permanently disable this error.
    
    If you disable this error, we STRONGLY recommend that you additionally
    pass the '--user' flag to pip, or set 'user = true' in your pip.conf
    file. Failure to do this can result in a broken Homebrew installation.
    
    Read more about this behavior here: <https://peps.python.org/pep-0668/>

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
#

Did I miss instructions on setting up python and a venv?

#

Oh I think I found it: "Setting up a Python Virtual Environment (Ubuntu 24.04 and similar only)"

#

I skipped that section because I thought it was for linux

tulip sleet
#

venv will not let you create a venv inside a venv

native sandal
#

The steps are all interleaved in the guide, so it's really not clear what to do when

#

Do I try to do the root pip install before or after running the esp-idf install?

#

esp-idf/install.sh seems to have completed successfully. The guide says now to do something like make BOARD=adafruit_magtag_2.9_grayscale. Two questions:

  1. Do I do that from the ports/esspressif directory? Answer seems to be yes.
  2. Where do I find the list of board name strings? I'm currently targeting the Adafruit MatrixPortal S3. Answer seems to be "ls the boards/ directory, use those names.
native sandal
#

I got an error building unity (?):

% make BOARD=adafruit_matrixportal_s3
- Verbosity options: any combination of "steps commands rules", as `make V=...` or env var BUILD_VERBOSE
GEN build-adafruit_matrixportal_s3/genhdr/mpversion.h
-- Found Git: /opt/homebrew/bin/git (found version "2.47.0")
-- Initialising new submodule components/bootloader/subproject/components/micro-ecc/micro-ecc...
.
.
.
-- Initialising new submodule components/unity/unity...
Submodule 'components/unity/unity' (https://github.com/ThrowTheSwitch/Unity.git) registered for path 'components/unity/unity'
Cloning into '/Users/rmann/Projects/Personal/CircuitPython/circuitpython/ports/espressif/esp-idf/components/unity/unity'...
Submodule path 'components/unity/unity': checked out 'bf560290f6020737eafaa8b5cbd2177c3956c03f'
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /Users/rmann/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/bin/xtensa-esp32s3-elf-gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Users/rmann/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/bin/xtensa-esp32s3-elf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Users/rmann/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/bin/xtensa-esp32s3-elf-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building ESP-IDF components for target esp32s3
-- Checking Python dependencies...
The following Python requirements are not satisfied:
Requirement 'setuptools<71.0.1,>=21' was not met. Installed version: 75.3.0
Requirement 'cryptography<43,>=2.1.4' was not met. Installed version: 43.0.3
To install the missing packages, please run "install.sh"
Diagnostic information:
    IDF_PYTHON_ENV_PATH: /Users/rmann/.espressif/python_env/idf5.3_py3.13_env
    Python interpreter used: /Users/rmann/.espressif/python_env/idf5.3_py3.13_env/bin/python
Constraint file: /Users/rmann/.espressif/espidf.constraints.v5.3.txt
Requirement files:
 - /Users/rmann/Projects/Personal/CircuitPython/circuitpython/ports/espressif/esp-idf/tools/requirements/requirements.core.txt
Python being checked: /Users/rmann/.espressif/python_env/idf5.3_py3.13_env/bin/python
CMake Error at esp-idf/tools/cmake/build.cmake:368 (message):
  Failed to run Python dependency check.  Python: python, Error: 255
Call Stack (most recent call first):
  esp-idf/tools/cmake/build.cmake:502 (__build_check_python)
  esp-idf/tools/cmake/project.cmake:710 (idf_build_process)
  CMakeLists.txt:12 (project)


-- Configuring incomplete, errors occurred!
make: *** [build-adafruit_matrixportal_s3/esp-idf/config/sdkconfig.h] Error 1
#

Seems requirements-dev.txt installed setuptools 75, but the port (board?) build requires < 71.

empty salmon
spare jacinth
manic glacierBOT
#

Well,
After further testing, the micropython implementation is also broken, it doesn't work. I've tried all manner of permutation, setting sta.config(protocol=network.MODE_LR) before or after sta.active(True), using network.phy_mode(network.MODE_LR) instead...

In all my messing, I was able to set the LR mode once, and I can't figure out how. I was not able to get out of it without re-flashing the ESP32. It looks like this setting "sticks" in the firmware.

I leave this here for r...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

@jepler I tried testing this but I'm not sure that I've figured out the correct way to run it.

make test and make test_full inside of ports/unix/ runs many tests including this new one, but the new one is one of 42 tests that fail for me when I run them this way.

I briefly tried running the new test on it's own with

build-coverage/micropython ../../tests/circuitpython/audiofilter_filter.py

But that raises an ImportError not being able to find audiofilterhelper, which...

#

Now it's possible to construct outputs or enable pulls immediately:

>>> d = digitalio.DigitalInOut(board.A0, pull=digitalio.Pull.UP)
>>> d.pull
digitalio.Pull.UP
>>> d = digitalio.DigitalInOut(board.A0, value=True)
>>> d.direction
digitalio.Direction.OUTPUT
>>> d.value
True
>>> d = digitalio.DigitalInOut(board.A0, value=False, drive_mode=digitalio.DriveMode.OPEN_DRAIN)
>>> d.drive_mode
digitalio.DriveMode.OPEN_DRAIN

The finaliser means t...

onyx hinge
#

It's always low-key bugged me that I couldn't create a pin in output mode, so I wrote that ^^

manic glacierBOT
#

I figured out a way to run it individually by copying audiofilterhelper.py into the folder with the py file being executed. I'm sure that is not the intended way.

I was able to successfully run the test inside of the unix port and confirm its output against the .exp file. Didn't test anything on microcontroller.

I'm assuming that my issues running make test to do the full test suite are either me misunderstanding how to use it, or not having proper environment fully set up.

Looks...

#

@jepler I think that cascading the biquad filters as you've demonstrated will perform well enough for our needs. The primary use of parallel eq is within graphic equalizers where you have a large bank of band pass filters at frequency intervals and mix them together into the output. I could see this as a separate class with a predesignated filter design, but I don't think it's a high priority right now. Here's a research paper which covers this topic: https://mycourses.aalto.fi/pluginfile.ph...

manic glacierBOT
#
#

call common_hal_audiofilters_filter_set_filters here instead of duplicating code

I'm good with this. I haven't seen to many calls to common_hal_... functions in other implementations of common_hal_..._construct(..), so I wasn't sure if that was a bad practice.

also you don't need to create an empty list, you can require that the empty tuple (that can also be the default constructor argument) is used if zero filters are actually intended.

I think I'm going to switch it out t...

#

I plan on changing the default to None rather than an empty tuple. The only problem I potentially see here is if a user decides to iterate through effect.filters without testing it (ie: if effect.filters: .... It will throw "TypeError: 'NoneType' object is not iterable" if that is the case, whereas an empty tuple wouldn't.

If you would prefer the empty tuple to avoid that situation, let me know.

manic glacierBOT
native sandal
spare jacinth
#

That makes no sense, though

#

The whole point of having a venv is that you dont see/conflict with system-wide installation of libraries, and thus everything is on the desired version

olive vessel
#

Are there any tips and tricks for minimizing the CPy binary for a port outside of toggling features off?

#

The port I am working on is for a part with 256K or Flash and 64K of RAM and I'm trying to squeeze out all I can

manic glacierBOT
#

I am using circuitpython + ESPNow for a custom sensor and this has been working reliably for the past few months - also using the broadcast adress.

My receiver is additionally using wifi, so I had to fix the Wifi channel in my router settings (in this case to channel 6).
One then has to force the transmitter to also use this channel. As far as I know, this can only be done using the wifi api and not using the ESPNow api.

Here are snippets of my code:
Receiver:

async def ha...
#

@jepler I may have become heavy-handed with my most recent changes, but hopefully it's for the best. I've done the following:

  • Rename filters back to filter
  • Support the following values:
    • individual Biquad object
    • tuple of Biquad objects
    • list of Biquad objects (which is converted to a tuple)
    • None

This retains backwards compatibility while still allowing the use of multiple filters.

The only issue I am having now with the property is that if you set it to a t...

manic glacierBOT
#

We have a helper for checking items in a sequence for the correct type. Here's an example of its use:

    for (size_t i = 0; i < nmatch; i++) {
        matches[i] = mp_arg_validate_type_in(match_objects[i], &canio_match_type, MP_QSTR_matches);
    }

so you'd iterate over the collection and check the type of each object. If you don't do this first, it seems like the object ends up in an inconsistent state.

manic glacierBOT
#

seems like if you're going for compatibility, then assigning None or a single Biquad would have to retain the current behavior when the property is fetched. On the other hand, you quickly identified that the ergonomics are not great for generic code when trying to be compatible. That's why I thought it was worth considering going ahead and breaking compatibility with this change.

manic glacierBOT
#

I added some code that should avoid recalculations when neither W0 (derived from f0 and sample rate) nor Q have changed. Nothing smart is done if only one or the other factor changes.

Your implementation is great. I think this update is mostly beneficial for static BlockBiquad objects in which neither factor changes to avoid a lot of unnecessary computation. Of course, a standard Biquad could be used instead, but we're marking that as deprecated within this PR, so it's best not to en...

manic glacierBOT
tulip sleet
olive vessel
#

Thanks @tulip sleet I've managed to fit it into 188k, leaving 64k for the filesystem, but had to turn off PWM, Pulse, Bitnang and a few other features I'd like to have to get there. I'll keep poking around in the Samd21 ports and see what I can find to help. I do wonder if the size of the STM32 HAL is keeping me from being able to get too much smaller, but I don't have any evidence of that, just a hunch since all the other ST parts are 512KB+

tulip sleet
#

that sounds typical. SAMD21 also turns off longints, did you?

#

trinket M0, etc. are really squeezed, and the choices made for them will be very similar to what you need to do. But if this product is still in development, you might consider a beefier chip

olive vessel
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.2.0 on 2024-10-28; Adafruit NeoPixel Trinkey M0 with samd21e18

Code/REPL

#import board
#import touchio
#import neopixel
#import time
#import storage
import supervisor
#import usb_cdc

#pixel_pin = board.NEOPIXEL
#num_pixels = 4
#top_touch = touchio.TouchIn(board.TOUCH1)
#bot_touch = touchio.TouchIn(board.TOUCH2)
#pixels = neopixel.NeoPixel(pixel_pin, num_pixels, brightness=0.01, auto_write=True)

...
manic glacierBOT
#

Finally looked this up, and I see what you mean. The additional check and m_malloc_fail is definitely not necessary. I'll remove it from this class, but let me know if you'd like me to go around and remove it throughout CircuitPython or save it for a separate PR. @jepler

https://github.com/adafruit/circuitpython/blob/d7a72218159f9e88e801949a74d530225a50320a/py/malloc.c#L86-L89

pastel panther
#

@tulip sleet @slender iron Is it theoretically possible for CP to boot in less than 300ms, as measured from power on to the first line of boot.py being executed? I'm working on a project where an enable line is being released after ~315ms and need my code on a pico to take over holding it low before it is released by the other things in the circuit.

#

Alternatively, could one, at least in theory, shoehorn in a bit of code to pull a pin low before CP gets through it's whole boot process?

tulip sleet
#

you can add a board-specific startup in board.c for that board.

pastel panther
#

That's were I'm at now and it's taking on the order of 1300ms until the pin is brought low in boot.py

pastel panther
tulip sleet
#

which board is it? There oculd be RP2xxxx or Espressif startup delays before CPy is even invoked

pastel panther
#

it's the pico/rp2040

#

Micropython on the same board comes up in ~220ms

tulip sleet
#

There are functions in supervisor/shared/board.c which can be overridden in a board-specific board.c, so just search for the function names in ports/*/boards/*/board.c

#

did you already turn off the safe-mode delay?

pastel panther
#

no

tulip sleet
#

i think this was discussed in some issue too. I'll look

tulip sleet
manic glacierBOT
manic glacierBOT
manic glacierBOT
pastel panther
#

@tulip sleet without the safe mode wait CP is sooo close to catching the reset; nevermind that it needs to tell an IO expander to pull it low via i2c

pastel panther
manic glacierBOT
olive vessel
#

@tulip sleet managed to get my binary size down under 256k and I flashed it with dfu-util -a 0 -i 0 -s 0x08000000:leave -D build-cygnet/firmware.bin which appears to succeed but I'm not seeing a CIRCUITPY drive enumerate on my machine so I assume I've missed a step or done something wrong in the Makefile or LD file. Any obvious reason this would happen that I should look into?

#

It's not an environment issue because I'm able to build and flash other boards locally, so it's something with my port

tulip sleet
olive vessel
#

yeah, no serial port either

manic glacierBOT
tulip sleet
#

or even toggle some pins at various stages in the startup.

#

not sure about your dfu-util command. I use:
dfu-util -a 0 --dfuse-address 0x08000000 -D build-whatever/firmware.bin

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

It looks like it was CircuitPython 7.3, and now we have 9.2 and maybe it's more lightweight? :D

I ran make -j4 BOARD=neopixel_trinkey_m0 CIRCUITPY_USB_IDENTIFICATION=1 (I was experimenting with hard-coding the VID/PID pair I wanted in the first place) and it seems that now this piece of code fits:
<img width="645" alt="obraz" src="https://github.com/user-attachments/assets/2f86714e-fcc4-46e8-a74e-f0f5d4884abc">
yup, it uses 336b more than image built with flags as is, but maybe if ther...

manic glacierBOT
manic glacierBOT
#

This PR does some cleanup on pin-names:

  • renamed SPICE_xxx to SPCE_xxx (Pimoroni calls their connector SP/CE)
  • removed SPI (board.SPI() throws NotImplementedError anyways)
  • added normal GPxx names since all pins are normal GPIOs as well
  • removed SPICE_TX and SPICE_RX. RX/TX pin names are UART-related on other boards. Here, they are only inclusive names for MOSI/MISO. It turns out that SPICE_TX is an UART-RX and vice versa. So to avoid confusion, I removed the names...
manic glacierBOT
#

Yup, works :D
So let's say I'll stay on this build for the time being :D
<img width="834" alt="obraz" src="https://github.com/user-attachments/assets/48b9752e-c9ab-43f1-b947-52c9eb43e753">
Do you recall any list of features that might be disabled in Trinkey because of lacking memory, other than supervisor.set_usb_identification?
CIRCUITPY_ONEWIREIO fits, although I am not sure it's that crucial on board that doesn't have GPIO layed out :D
CIRCUITPY_SAFEMODE_PY also fits?

manic glacierBOT
#

When testing stuff, running experimental builds or other weird stuff, safemode is great. Now that safemode.py exists, it can do so much more. But on production (for those few that want to ship CP), it may be desirable to not permit the user to enter safe mode through the boot button.

CIRCUITPY_DISABLE_SAFEMODE_TRIGGER This would disable the ability to press the boot button to enter safe mode. This would not stop the code from entering safe mode.

What do you think about it?...

manic glacierBOT
manic glacierBOT
#

make clean didn't do much for me:
<img width="771" alt="obraz" src="https://github.com/user-attachments/assets/e44ab08a-ecd0-4fb1-99b3-0510f1bcf358">
However with command line:

rm -rf build-neopixel_trinkey_m0 && make clean && make -j8 BOARD=neopixel_trinkey_m0 CIRCUITPY_USB_IDENTIFICATION=1 CIRCUITPY_ONEWIREIO=1 CIRCUITPY_SAFEMODE_PY=1 TRANSLATION=ja

Japanese built correctly:
<img width="641" alt="obraz" src="https://github.com/user-attachments/assets/3678506e-dd3f-4e29-904e-...

#

There is already CIRCUITPY_SKIP_SAFE_MODE_WAIT, which you can enable to prevent the one second interval during which you can press the reset button again. On many boards that's the only way to enter safe mode.

On boards where you can hold down a button to enter safe mode, you can disable entering safe mode by pressing a button by removing board_requests_safe_mode() from board.c for the board, or for a few ports, from port.c.

Which board are you thinking of.

#

You have to do make clean BOARD=....

Try submitting a PR with CIRCUITPY_USB_IDENTIFICATION turned on for the board, or for all SAMD21 boards. That will run the biggest translations and we can see whether it fits. However, by turning this on we use up space that we might need for something else more important in the future, so I'm not sure we want to do that. It's a balancing act.

It might fit for this particular Trinkey but not others.

Now that you know how to do builds, you can ...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Sure, I can build it myself, even can hardcode VID/PID etc myself, no problem. My issue was that it had this weird behaviour, while there was no docs saying that I should expect this behaviour, so after you pointed towards the PR I started going deeper into the rabbit hole :)

It's just that having this single piece of API unavailable for some reason is counter-intuitive. Maybe it could return message indicating why it's saying NotImplementedException?

Also, if I have some free time I'...

#

It's just that having this single piece of API unavailable for some reason is counter-intuitive. Maybe it could return message indicating why it's saying NotImplementedException?

That would be a helpful message. We could raise NotImplementedError with "no room in firmware" or not included in firmware, though there are sometimes multiple reasons for something being not implemented: it could be because it wouldn't fit, or because this particular board doesn't have the pins available, etc.

#

I think having message like "Excluded during build process" could still be useful in that it would indicate that it was purposefully excluded, in contrast to somebody introducing a bug or just forget to implement something. It could lead me to looking at the firmware build process instead of creating this issue in the first place - I honestly believed this to be a bug :D

manic glacierBOT
#

@relic-se @gamblor21 @todbot for interest.

A potential limitation is:

Using the same LFO as an input to multiple other LFOs or Notes is OK, but the result if an LFO is tied to multiple Synthtesizer[sic, someone should fix that doc typo] objects is undefined.

(besides which, LFOs can now be used with AudioFilters, BlockBiquads, and other types of objects; LFOs, Math blocks and BlockBiquads should in the medium term be moved out of synthio into their own modules and the documentation ...

manic glacierBOT
onyx hinge
#

<@&356864093652516868> Hi! just a quick note that there is no meeting today due to observing Veterans Day in the US. We will hold the meeting tomorrow at the same time of day, 24 hours later than usual.

manic glacierBOT
manic glacierBOT
manic glacierBOT
orchid basinBOT
#

And the ruby script to generate the list is here (run it from the circuitpython-org directory, ruby should already be all setup there for this):

require 'yaml'

total_count = 0
Dir.glob(['_board/*', '_blinka/*']).each do |filename|
  next if File.directory?(filename)

  # read the file and get the content of the download_instructions from the yaml section at the top
  content = File.read(filename)
  yaml = content.match(/---(.|\n)*---/)
  next if yaml.nil?

  # parse the ya...
candid sun
#

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

orchid basinBOT
#

After cross referencing with the list from #1528 and narrowing down to ones that have "Adafruit" as their manufacturer this is the list of devices that I did not find guide pages for:

x feather_m0_express_crickit.md
x adafruit_floppsy_rp2040.md
x adafruit_huzzah32_breakout.md
x edgebadge.md
x metro_nrf52840_express.md
x adafruit_vindie_s2.md
x pygamer_advance.md
x feather_m0_adalogger.md
x circuitplayground_express_displayio.md
x adafruit_metro_rp2350.md
x feather_radiofrui...
pastel panther
#

@tulip sleet et. al: My previous "success" with quickly pulling a reset line low was not a success. Currently with the safe mode wait disable and a relatively "light" build with lots of things turned off, I'm still about 8ms too slow. I've got the bare minimum busio.I2C writes in boot.py and not much else.

Any advice or suggestions of features or other things I can comment out or change would be appreciated. My application is solely GPIO and two i2c busses.

tulip sleet
pastel panther
# tulip sleet I'm not sure exactly what you need to do. If you mess with the reset line at the...

This is my boot.py; I need to set up an i2c io expander to pull the reset low:

import board
from busio import I2C
i2c_aux = I2C(board.GP3, board.GP2, frequency=100000) # change if necessary
i2c_aux.try_lock()
# from dvt_config import i2c_aux
buf = bytearray([0x12, 0b01111111])
i2c_aux.writeto(0x23, buf)
buf = bytearray([0x08, 0b01111111])
i2c_aux.writeto(0x23, buf)
i2c_aux.unlock()
i2c_aux.deinit()
pastel panther
#

no, that would be too obvious 🤦‍♂️

orchid basinBOT
#
  • edgebadge, it could link to pybadge but then it will link to a firmware with different name, though it would still work I think

I'd say that page should be mirrored and should mention both firmware images. "If you have this ... if you have that. ..."

  • pirkey, has guide with pages about using circuitpython but not installing.

pirkey is discontinued and was barely ever sold, if at all. I think it could even be removed from circuitpython.org. See #644.

lone axle
#

In this episode of Inspiring Computing, I chat with  Filip Rak (https://www.linkedin.com/in/filip-rak-81345a127/) , the team leader at the Czech Aerospace Research Center (https://www.vzlu.cz/?lang=en) . Filip tells me about his journey from engineering to leading the development of attitude and orbit control systems for satellites. We talk abou...

▶ Play video
lone axle
#

Thanks for hosting Liz, have a great week everyone!

crimson ferry
#

The "State of..." stats seem to miss some reviews. Or, perhaps they intentionally only pull the final or approving review?

lone axle
# crimson ferry The "State of..." stats seem to miss some reviews. Or, perhaps they intentionall...

I believe that the primary thing the report pulls is merged PRs, then it gets reviewers from those. I would have to check the code to be sure though. If that is the case it would be possible for it not to add a reviewer if the PR hasn't been merged yet but has been reviewed / approved.

The other odd thing for today is we are on Tuesday this week and the reports are a rolling 7 days so we technically lose a days worth for the Monday of the week before a Tuesday meeting. I've gone back and tried to add in some stats for the missing Monday's sometimes, but I've only ever done it on the library section, and I didn't for today.

crimson ferry
#

the second case fits, but not the first... I'll comment again if it happens again outside of those

lone axle
#

I have been doing some tinkering inside of adabot, and still have a bit more in mind to do as well. If you know of an instance of a PR or reviewer that it seems to have left out you can link me and I'll have a closer look.

candid sun
#

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

tulip sleet
#

I totally spaced on the meeting, sorry! @onyx hinge @candid sun

onyx hinge
#

umm me too ?!

tulip sleet
#

please ping us if you don't see us

lone axle
#

I've got a very strange issue with some learn pages at the moment. It is showing me the content for a page that differs from the URL that I am on, and the page which is shown as "current page" by the navigation highlighting. I have tried refreshing several times, and hard refresh with ctrl F5. I also deleted my recent browsing history and tried again but same results.

In a separate private browser window I was able to load the same URL and see the actual content for the page. But then I signed in inside that browser and now that I'm logged in if I go back to the page it's once again showing me the overview content instead of the real content for that page.

Somehow it seems that certain page content's got cached incorrectly for me. I'm not sure if it's worth trying to report. I thought I saw something similar on some different pages earlier today, but those went back to normal when I loaded them again, this one has thus far remained "stuck" showing the overview content instead of it's own.

tulip sleet
tulip sleet
lone axle
#

Thank you, confirmed another reload and it now shows me the real content.

manic glacierBOT
#

I've gotten pretty far along on this in #9659, just added some effects demos (ring modulator, echo). My approach is to do DAC/ADC I/O in the background, but manipulate the double buffers in the foreground. I like how this makes the process more modular and transparent. Here is a snippet showing how an audio file is read from SD, processed, and sent to the codec:

with open(filename, 'r') as f:
                while repeat or n == -1:
                    while n != 0:
        ...
orchid basinBOT
manic glacierBOT
thorny jay
#

Hello,
There is something confusing about upgrading nrf52840 bootloader.
Of course there is the "fight" if you have an old bootloader, but I used Arduino for solving that.
The confusion is that on circuitpython.org
https://circuitpython.org/board/feather_bluefruit_sense/
it say "Latest version: 0.8.3" and link to release with tag 0.8.3
https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases/tag/0.8.3
Where it tell about 0.9.2 on
https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather/update-bootloader-use-uf2

I think the "bug" is on circuitpython.org that should link to the latest release of Adafruit_nRF52_Bootloader
Regards

orchid basinBOT
manic glacierBOT
#

I'm not certain exactly what your goals in the recent updates are, but rather than building bespoke audio DSP processes for the rp2pio module, it would likely be better to find a way to integrate it into the existing audio systems of CircuitPython using the audiosample API. That way the existing processing modules could be used with custom PIO systems (ie: audiomixer, audiofilters, audiodelays, + future additions).

Alternatively, a separate audiobusio.I2Sin class could be created w...

barren ice
#

Hi, I left an issue on github a while ago, but it hasn't been answered yet, so I'm asking here.
I am inquiring about the W55RP20 chip that packages RP2040 and W5500 and configured the driver through PIO SPI. I will leave the link to the github.
https://github.com/adafruit/circuitpython/issues/9747

GitHub

Our engineers have made initial progress in developing a driver for the W55RP20, but we've encountered a few difficulties that we would like to address with your team. Below is a brief overview...

manic glacierBOT
manic glacierBOT
#

There are PIO SPI examples here: https://github.com/raspberrypi/pico-examples/tree/master/spi, but it seems like you are well along in your PIO SPI implementation.

I'm guessing that you had to choose the pins you did due to limitations of the placement of the bonding wires between the chips. Is that correct?

While this solution works as an alternative, we thought about the possibility of creating a new CHIP_VARIANT for rp2 CHIP_FAMILY.

I am not sure what you mean by this. The PIO S...

manic glacierBOT
#

Yes, that's right.
We are currently using PIO SPI due to wiring issues between the RP2040 and W5500.

I've currently made some similar to wiznet5k to control the W5500 with PIO SPI instead of busio.SPI, but I'm having trouble getting it to work with different socketpools, dhcp, dns, and other protocols.

Also, if I do this, I would like to discuss with you how to utilize the W55RP20 library from adafruit to make it available to users in the future.
https://github.com/WIZnet-ioNIC/WIZnet...

orchid basinBOT
mortal kernel
#

@danh Pimoroni has their Pimoroni Pico Plus 2 W board back in stock. This is an RP2350B with a Raspberry Pi RM2 module. The RM2 is a packaged CYW43439, so it should be compatible with CP's Pico WiFi and upcoming BLE implementations. If no one else has claimed it, I can put together a board port. They also offer an RM2 breakout with an SP/CE interface that works with their Pico Plus 2 board. Not sure we want to support that?

#

At the electrical level they've copied the resister bodge that multiplexes the DI, DO, and IRQ from the Pico W.

tulip sleet
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.2.0 on 2024-10-28; Adafruit Feather HUZZAH32 with ESP32

Code/REPL

>>> import board
>>> dir(board)
['__class__', '__name__', 'A0', 'A1', 'A10', 'A11', 'A12', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8', 'A9', 'D12', 'D13', 'D14', 'D15', 'D16', 'D17', 'D18', 'D19', 'D21', 'D22', 'D23', 'D25', 'D26', 'D27', 'D32', 'D33', 'D34', 'D35', 'D36', 'D39', 'D4', 'D5', 'I2C', 'LED', 'MISO', 'MOSI', 'NEOPIXEL', 'RX', 'SCK', ...
mortal kernel
manic glacierBOT
tulip sleet
manic glacierBOT
lone axle
#

I guess it's just due to the way the pin aliases work internally. I found it surprising that printing a pin can show a different value from the one you've told it to print. i.e. on a CLUE

>>> import board
>>> print(board.D0)
board.P0

I'm guessing the answer is no, but wanted to ask if it's possible to control which one of the aliases will be the one that it prints? In the CLUE guide they are noted as D0, D1, and D2. If it's possible it might be nice to have it use those values as the ones that get printed by default.

tulip sleet
#

The Pn names are what micro:bit uses, I think, and this was meant to emulate that. If the P prefix isn't used in our guides, we could change the order in pins.c.

lone axle
#

I was just making a build to see if that order was what determined it.

manic glacierBOT
#

I'm not certain exactly what your goals in the recent updates are, but rather than building bespoke audio DSP processes for the rp2pio module, it would likely be better to find a way to integrate it into the existing audio systems of CircuitPython using the audiosample API.

Yes, totally. I was thinking when I started this that I would be leaning more on audiocore, but its limitations (<=16-bit, <=2 channels) made it difficult to explore the full capabilities of the codec I am working ...

lone axle
#

I'll take a closer look through the guide and if there are no references to the P names I'll submit a PR to move D ones to the top for those pins. This will also help https://github.com/adafruit/Adafruit_CircuitPython_CLUE/issues/41 because it puts the Pin objects into a dictionary and lists and the example given for it prints out the lists which then show the P pin names which contradicts how the docstring explains it will work. The values themselves all still work interchangeably but the print outs could be confusing to anyone unaware of the aliasing going on.

lone axle
#

Ah, the guide page does also have a section that refers to them by their Pn names https://learn.adafruit.com/adafruit-clue/pinouts#step-3054951

There are analog pins on P0 (Arduino A2), P1 (Arduino A3), P2 (Arduino A4)...
And shows an image of the micro:bit pinout with it's pins labeled in their Pn scheme. Maybe it's not worth changing the definition. I could also change the code in the library to use the Pn pins and then it would at least not seemingly change the value supplied, and I'll update the docstring to use those Pn names too so the functionality matches the docs.

tulip sleet
manic glacierBOT
lone axle
# tulip sleet Therer are a lot of Learn Guides with CLUE code too, not sure if there's consist...

I think most of the code doesn't need to change really. Since they are aliases code can use any name. The only time I think it's worth changing is if the code is also printing the Pin object back out to the user, in that case specifically changing the code to use the Pin that will print makes it less confusing in my mind.

I haven't gone looking yet, but I doubt there will be much code that does actually print Pin objects, I don't recall running across any that does before looking into this iterable touch thing for the Playground / CLUE libraries.

manic glacierBOT
manic glacierBOT
#

I don't have time to look at this in detail at the moment, but here's what I was thinking of:

  1. Refactor https://github.com/WIZnet-ioNIC/WIZnet-ioNIC-Circuitpython slightly so that the PIO SPI is a separate class that has an API like busio.SPI, so that it can be just passed in to the Wiznet driver. PIO SPI could even be a separate library totally.
  2. Look at the Wiznet code in that repo and see how it compares to https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k. I don't know...
manic glacierBOT
#

Yes, totally. I was thinking when I started this that I would be leaning more on audiocore, but its limitations (<=16-bit, <=2 channels) made it difficult to explore the full capabilities of the codec I am working with. Now that I've got the codec working well with rp2pio I'm going to see what can be done as far as unification. For example, suppose that an 8-channel ADC could present as 8 mono rawsample-like objects or 4 stereo objects, etc., and that an 8-channel DAC could present as...

native sandal
#

I had to do some other stuff for a few days, but I'm back on trying to build CP, and still running into this same issue of requirements not being satisfied:

(.venv) 18:53:05 √  Personal/CircuitPython/  % cd circuitpython/ports/espressif
(.venv) 18:53:06 √  ports/espressif/  (main) % source esp-idf/export.sh
Setting IDF_PATH to '/Users/rmann/Projects/Personal/CircuitPython/circuitpython/ports/espressif/esp-idf'
Detecting the Python interpreter
Checking "python3" ...
Python 3.13.0
"python3" has been detected
Checking Python compatibility
Checking other ESP-IDF version.
Not using an unsupported version of tool openocd-esp32 found in PATH: 0.12.0. To use it, run '/opt/homebrew/opt/python@3.13/bin/python3.13 /Users/rmann/Projects/Personal/CircuitPython/circuitpython/ports/espressif/esp-idf/tools/idf_tools.py export --prefer-system'
Adding ESP-IDF tools to PATH...
Checking if Python packages are up to date...
Constraint file: /Users/rmann/.espressif/espidf.constraints.v5.3.txt
Requirement files:
 - /Users/rmann/Projects/Personal/CircuitPython/circuitpython/ports/espressif/esp-idf/tools/requirements/requirements.core.txt
Python being checked: /Users/rmann/.espressif/python_env/idf5.3_py3.13_env/bin/python
The following Python requirements are not satisfied:
Requirement 'setuptools<71.0.1,>=21' was not met. Installed version: 75.3.0
Requirement 'cryptography<43,>=2.1.4' was not met. Installed version: 43.0.3
To install the missing packages, please run "install.sh"
Diagnostic information:
    IDF_PYTHON_ENV_PATH: /Users/rmann/.espressif/python_env/idf5.3_py3.13_env
    Python interpreter used: /Users/rmann/.espressif/python_env/idf5.3_py3.13_env/bin/python
(.venv) 18:53:16 ?1  ports/espressif/  (main) % make BOARD=adafruit_matrixportal_s3 
- Verbosity options: any combination of "steps commands rules", as `make V=...` or env var BUILD_VERBOSE
GEN build-adafruit_matrixportal_s3/genhdr/mpversion.h
-- Building ESP-IDF components for target esp32s3
-- Checking Python dependencies...
The following Python requirements are not satisfied:
Requirement 'setuptools<71.0.1,>=21' was not met. Installed version: 75.3.0
Requirement 'cryptography<43,>=2.1.4' was not met. Installed version: 43.0.3
To install the missing packages, please run "install.sh"
Diagnostic information:
    IDF_PYTHON_ENV_PATH: /Users/rmann/.espressif/python_env/idf5.3_py3.13_env
    Python interpreter used: /Users/rmann/.espressif/python_env/idf5.3_py3.13_env/bin/python
Constraint file: /Users/rmann/.espressif/espidf.constraints.v5.3.txt
Requirement files:
 - /Users/rmann/Projects/Personal/CircuitPython/circuitpython/ports/espressif/esp-idf/tools/requirements/requirements.core.txt
Python being checked: /Users/rmann/.espressif/python_env/idf5.3_py3.13_env/bin/python
CMake Error at esp-idf/tools/cmake/build.cmake:368 (message):
  Failed to run Python dependency check.  Python: python, Error: 255
Call Stack (most recent call first):
  esp-idf/tools/cmake/build.cmake:502 (__build_check_python)
  esp-idf/tools/cmake/project.cmake:710 (idf_build_process)
  CMakeLists.txt:12 (project)


-- Configuring incomplete, errors occurred!
make: *** [build-adafruit_matrixportal_s3/esp-idf/config/sdkconfig.h] Error 1
native sandal
#

I had to do some other stuff for a few

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.2.0 on 2024-10-28; Raspberry Pi Pico with rp2040

Code/REPL

import board
from i2ctarget import I2CTarget
device = I2CTarget(board.GP3, board.GP2, (0x40,))

Behavior

Do the above once, then do ctrl-D, then do it again.

Traceback (most recent call last):
  File "", line 1, in 
ValueError: I2C peripheral in use

Description

No response

Additional information

No response

manic glacierBOT
manic glacierBOT
lone sandalBOT
manic glacierBOT
devout jolt
#

Boo, unit tests! (ooo scary) Are there any existing CircuitPython libraries in one of the bundles that have a simple unit testing setup hooked up? I'm working on a mostly pure-Python CircuitPython library that could benefit from some tests

pallid creek
devout jolt
stuck elbow
#

you probably want to run the tests with regular python and mock all the hardware calls anyways

pallid creek
#

That's what I'm doing. Running the unit tests on my local machine with regular python.

devout jolt
stuck elbow
#

well, unittest is in python's standard library

devout jolt
stuck elbow
#

I'm not that familiar with circup

stuck elbow
#

I know, but I don't know how exactly it behaves and what it ignores

#

I guess you could try and see

#

I know it ignores examples

devout jolt
#

this is why I'm asking. there's a whole system of github workflows, bundle creation, and use by circup on a CircuitPython library. And I want to use a unit test framework that behaves well with all of that

#

Well if anyone comes across an extant CircuitPython library in the bundle with unit tests, let me know. Thanks!

manic glacierBOT
onyx hinge
#

@devout jolt datetime and requests both seem to use unittest

#

Based on finding the string in the code, I didn't check into whether we actually run the tests in ci

devout jolt
onyx hinge
#

Ruff combines elements of black, pylint and isort. Its also very fast

spare jacinth
# devout jolt so just create a "tests" directory in the library directory and circup will igno...

i personally have a tests.py file at the root of the repo (i dont have many tests, didn't split into several files), and circup only downloads the toml/ folder (3 files of actual source for my lib)

those tests can be run either on Python or CircuitPython (using a 3rd party lib), but there will be some issues due to it being a subset (as always)
eg: https://github.com/elpekenin/circuitpython_toml/blob/main/tests.py#L20-L36 (i should probably open a PR for this)

devout jolt
spare jacinth
#

as far as you set up your pyproject.toml correctly, the test folder should be ignored

#

(if circup's logic is not too far from pip's , that is)

#

there's a reason why you must explicitly tell "these are the files/folders present in my project" (ie: tell the tool you want users to get src/, but not test/)

spare jacinth
#

py-modules or packages, or something like that. i dont quite remember and im no expert in python's packaging anyway

#

but i do recall that setuptools complains if you have several posible targets (eg: folders) and dont tell it which (or both) it should pick

devout jolt
#

Hi @lone axle, I'm getting warnings like this on a fresh cookiecutter'd library when doing pre-commit run --all-files. Is there a preferred solution for this?

lone axle
devout jolt
lone axle
#

I would say that in general I find it warning about fewer things overrall than the previous setup with black+pylint. but I haven't kept a count to compare real numbers just a gut feeling.

devout jolt
lone axle
#

It might be possible to configure it to do the docstring check. I do think that is something worth having it enforce if possible.

Maybe the sphinx build would fail if you're missing docstrings, but it's less convenient to use as a check since it's outside of pre-commit.

onyx hinge
devout jolt
manic glacierBOT
#

(1) I think it would be great to have it as a separate library, or you could create a separate class called ioNIC in the existing adafruit_wiznet5k driver.

(2) Currently in that repo, the W5500 is controlled by SPI using busio. The W55RP20 can't use hardware SPI due to pin issues, so we use rp2pio to drive the W5500 since it uses SPI PIO.

(3) It is not a better driver, but it is also a packaged chip that integrates RP2040 and W5500, and it is a solution that many users have responded to...

manic glacierBOT
#

@min-hs I tried the WIZnet-ioNIC code and example and of course that worked fine. The exception was when I tried to naively use the statemachine as SPI with the existing circuitpython WIZnet library.

But conceivably to Dan's point and yours, someone who knows what they are doing could construct a more SPI-compatible class or library using the statemachine. I didn't get far enough or do a thorough audit of the methods needed (read, write, etc), but try_lock and unlock do seem to be needed.

#

(2) Currently in that repo, the W5500 is controlled by SPI using busio. The W55RP20 can't use hardware SPI due to pin issues, so we use rp2pio to drive the W5500 since it uses SPI PIO.

Yes, I am saying you could refactor the library so it's using an SPI interface in the abstract, instead of knowing that it must use the "soft" SPI provided by your PIO program.

I'm not sure how I'm supposed to use try_lock and unlock, can you give me an example or explanation of how to use them?

Se...

sleek relic
lone axle
#

requests timeout did not solve the adabot actions issue. It failed again today at 6hrs. I did further into the code and saw where some of the requests are using the gh_requests thing and others are using requests directly, likely skipping the rate limit logic. I'm digging into some other library stuff now, but I'll come back around to it and get it to all go through the gh_requests and see about reducing the overall number of API calls. Many of these requests pull the contents of individual files, we could be cloning the bundle and accessing all those files locally instead to save all of those requests per repo.

manic glacierBOT
#

CircuitPython version

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

Code/REPL

import wifi
import time

SSID = "potato"
PASSWORD = "123123123"

print("connecting wifi...")
wifi.radio.connect(SSID,PASSWORD)

Behavior

If I run this sample with the access point turned off, it errors out with this message and quits to the console, without retrying :
ConnectionError: No network with that ssid

Descriptio...

manic glacierBOT
#

I guess I fixed it with some code that looks over-complicated? Is this the correct way? There is no built-in way?

import wifi
import time

SSID = "potato"
PASSWORD = "123123123"

def scan_for_wifi():
    networks = []
    for network in wifi.radio.start_scanning_networks():
        networks.append(network)
    wifi.radio.stop_scanning_networks()
    networks = sorted(networks, key=lambda net: net.rssi, reverse=False)
    for network in networks:
        print("ssid:",networ...
manic glacierBOT
onyx hinge
lone axle
#

I saw #circuitpython-dev message I have downloaded the logs and looked a bit closer at the end of it. I don't know how trustworthy the timestamps are but it does appear to start making requests a few seconds too early for the rate limit reset.

When I dig in next I'm going to work on swapping over all the API calls that use requests directly to use the gh_request one. Perhaps try to reduce the overall number of API calls as well.

onyx hinge
#

I notice we've pinned a rather old PyGithub -- they're at v2.5.0 and we're requesting PyGithub==1.57

lone axle
#

I will try upgrading as well. In the logs it appears that it waited from 09:58:58 intending to wait until 10:22:47 when the rate limit reset would occur. But it seems to start making requests a second early at 10:22:46. It makes 10-12ish in quick succession that fail and then nothing for ~3hrs until ##[error]The operation was canceled. which I assume is the actions cleanup taking over. It mentions that python3 is an orphaned process Terminate orphan process: pid (2006) (python3). I'm not sure exactly what to make of it, but its nice to have a bit more insight than just the actions log page was providing.

onyx hinge
#

there are multiple sites that try to deal with rate limits each with slightly different code. PyGithub 2.50 is supposed to have built in auto retry including dealing with rate limits, so if our layer is "on top of" that we might be making things extra worse. or maybe our old version didn't have auto retry.

manic glacierBOT
manic glacierBOT
manic glacierBOT
crimson ferry
#

bitbangio.SPI doesn't have a frequency property like busio.SPI ...will the frequency always be attempted at the frequency set by the frequency kwarg in configure?

#

(I didn't find an upper limit in shared_modules or shared_bindings, and there's no common_hal)

tulip sleet
#

yes, though note:

#define MAX_BAUDRATE (common_hal_mcu_get_clock_frequency() / 48)
#

and it does a little rounding:

void shared_module_bitbangio_spi_configure(bitbangio_spi_obj_t *self,
    uint32_t baudrate, uint8_t polarity, uint8_t phase, uint8_t bits) {
    self->delay_half = 500000 / baudrate;
    // round delay_half up so that: actual_baudrate <= requested_baudrate
    if (500000 % baudrate != 0) {
        self->delay_half += 1;
    }
crimson ferry
#

yeah, I didn't really follow that

#

so in theory, RP2040 could bitbang SPI at 2.5MHz

tulip sleet
#

in theory 🙂 I'd mesaure it

crimson ferry
#

I'll put a logic analyzer on my holiday wish list 🙂

tulip sleet
#

you could use FrequencyIn on another board and measure it

crimson ferry
#

ooh, nice, thanks

tulip sleet
#

it will be an average

crimson ferry
#

dang, I don't have access to the pin, it's internal in the WIZnet W55RP20

#

well, I'll try some external throughput measurement

tulip sleet
#

are you using bitbangio? I thought you would use their PIO SPI

crimson ferry
#

I want to use the adafruit library, more full-featured, and hopefully the PIO gets migrated over

tulip sleet
#

bitbangio does not use PIO, it uses DigitalInOut "manual" pin flipping

#

how does their library compare to ours? I didn't look yet and didn't get an answer about that in the issue

crimson ferry
#

right, until PIO s integrated with the adafruit library

#

it's basic, just ping, udp, tcp

tulip sleet
#

anything they do that we don't

#

they said they were having trouble, I wasn't sure why

crimson ferry
#

I didn't see anything unique, more like a proof of concept with the basic network stack

tulip sleet
#

i think it should be easy to factor out their PIO SPI. There is also a PIO SPI example in the pico-exmaples repo, maybe it is the same thing. The generation of the PIO program is complicated, maybe it could be done more straightforwardly.

crimson ferry
#

I spent a couple hours playing whack-a-mole trying to get the PIO wrapped in a suitable class, but I didn't really know what I was doing and kept hitting roadblocks

#

(I got past try_lock and as far as File "adafruit_wiznet5k/adafruit_wiznet5k.py", line 1284, in _chip_write RuntimeError: No out in program
and didn't know what to do with that - sometimes it just tries forever on the write)

#

looks like the pico-examples SPI PIO code is more extensive - hopefully min-hs has better results

onyx hinge
#

When a PIO peripheral is initialized, self->out can be a NULL pointer if CircuitPython thinks the out fifo can never be used, or otherwise it points to a txfifo register. Then if a write or readwrite method is called but this field is NULL, an exception is the result.

    if (!self->out) {
        mp_raise_RuntimeError(MP_ERROR_TEXT("No out in program"));
    }
    return _transfer(self, data, len, stride_in_bytes, NULL, 0, 0, swap, false);
}
#

so the problem is in CircuitPython thinking that PIO program didn't need to have a out fifo

#

it's not clear to me what PIO program we're talking about so I can't delve any deeper

crimson ferry
onyx hinge
#

but what is the PIO program you're running

#

I would like to see it so maybe I can say whether circuitpython is right or wrong to be giving that particular error at that particular time

crimson ferry
onyx hinge
#

that program spi_master contains an out instruction, so superficially the error seems wrong

#
=== sm = rp2pio.StateMachine(
===     assembled,
===     frequency=1_000_000,
===     first_in_pin=board.A1,  # miso
===     in_pin_count=1,
===     in_shift_right=False,
===     push_threshold=8,
===     auto_push=True
=== )
=== 
=== 
>>> sm.write(b'\0')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: No out in program
```here's an example of when the error is correct, because the program really contains no `out` instruction.
#

though when I tried the wiznet code in isolation (different circumstances: rp2350 feather) I did not get an error about the write call... ```=== assembled = adafruit_pioasm.assemble(spi_master)
=== sm = rp2pio.StateMachine(
=== assembled,
=== frequency=1_000_000,
=== first_out_pin=board.A0, # mosi
=== first_in_pin=board.A1, # miso
=== first_set_pin=board.A2, # clk
=== out_pin_count=1,
=== in_pin_count=1,
=== set_pin_count=1,
=== in_shift_right=False,
=== out_shift_right=False,
=== push_threshold=8,
=== pull_threshold=8,
=== )

===

sm.write(b'\0')

#

I also don't know if your code matches my code, but the failing line 1284 is immediately after another write call: ```1276 def _chip_write(self, device: "busio.SPI", address: int, call_back: int) -> None:
1277 """Chip specific calls for _write."""
1278 if self._chip_type in ("w5500", "w6100"):
1279 device.write((address >> 8).to_bytes(1, "big"))
1280 device.write((address & 0xFF).to_bytes(1, "big"))
1281 device.write(call_back.to_bytes(1, "big"))
1282 elif self._chip_type == "w5100s":
1283 device.write((0xF0).to_bytes(1, "big"))
1284 device.write((address >> 8).to_bytes(1, "big"))
1285 device.write((address & 0xFF).to_bytes(1, "big"))

#

but you're also talking about a "w55" so I'm guessing that my code must not match your code

crimson ferry
#

my line 1284 is the first write:

#
1284            device.write((address >> 8).to_bytes(1, "big"))
onyx hinge
#

well that makes a tiny bit more sense then. I would expect every write to fail, or none of them. I'd try to make sure that you are using the assembled pio program you think you are, possibly by doing a "hopefully no effect" write() call. you can't use a zero-byte write for that, however: ```>>> sm.write(b'\0')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: No out in program

sm.write(b'')

#

possibly by doing a "hopefully no effect" write() call ... immediately after creating the state machine object

#
>>> sm.write(b'\0' * 1024)

You said something about write blocking forever. With their original code I can see this too. this is because busio.SPI discards anything that could be read when you call write(), but StateMachine.write does NOT. So once the read fifo fills up, you can't write anymore until you read

#
>>> sm.write(b'\0' * 1024)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyboardInterrupt: 
>>> sm.in_waiting
4
#

so all SPI-like calls read, write and write_readinto have to be implemented in terms of StateMachine.write_readinto and you might need to have a scratch buffer for the unneeded half of the read or write

#

Anyway I don't know if some of that was useful for you, but it's what I can understand about the situation without the hardware or the exact code you're running when you hit various problems.. good luck, if you choose to continue, though!

crimson ferry
#

thanks, jepler, sorry got pulled away for a few... I'll work on digesting that, it makes sense conceptually

onyx hinge
#

no worries on my part.

manic glacierBOT
#

Something that I was discussing about this on Discord:

Both busio.SPI and rp2pio.StateMachine have read and write methods, they have different behaviors: SPI discards the "unwanted" side, while StateMachine retains it in a (small) FIFO. Thus, for a PIO SPI implementation to be compatible with busio.SPI, it will have to implement read and write both in terms of write_readinto, likely with some kind of dummy buffer of the right length for the unneeded half of the data. Without ...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Device: Raspberry Pi Pico W

mDNS seems to not work when combining the two basic examples from the project: Manual AP & mDNS.

I can reach the page when going directly to my ip address on port 5000, however when trying to reach it on abcd.local:8080 it doesn't do anything.

import wifi
import socketpool
from adafruit_httpserver im...
manic glacierBOT
stoic rain
#

@tulip sleet Got a question for you. I recently grabbed a LSM6DS-based IMU, specifically one with an LSM6DSV16X. There's some similarities to other LSM6DS IMUs, but it has got different registers and data rates than chips like the LSM6DOX and ISM330DHCX. I was looking at adding support for this chip as a pull request to the existing Adafruit LSM6DS library, but I'm a little worried that the difference would require a decent about of change (for example, the data rates in the Rate class would either need to be supplemented or a parallel class would need to be added).

What do you think? Should I try to implement this pull request, or just make a standalone library and submit it to the community bundle? I think the newer ST LSM6DS-series look more like the one I was going to add support for than those already supported by the Adafruit library.

tulip sleet
stoic rain
tulip sleet
stoic rain
native sandal
#

I'm able to build CP and run it on my ESP32 S3. Now I'm ready to try to start implementing PDMIn. I see a couple of related compiler flags: CIRCUITPY_AUDIOBUSIO and CIRCUITPY_AUDIOBUSIO_PDMIN in ports/espressif/mpconfigport.mk. Am I right to edit that file and adjust CIRCUITPY_AUDIOBUSIO_PDMIN = 1 for the appropriate target(s)?

#

Also, what's an appropriate printfcall to put in the C code that will output to the Thonny console when testing python code?

onyx hinge
#

@native sandal PDM input is not implemented in CircuitPython for any Espressif-family microcontrollers. The implementation would have to be placed in `ports/espressif/common-hal/audiobusio/PDMIn.c (and .h) but there's nothing but a comment there.

native sandal
#

yes, I know, I've decided to implement it myself.

#

But since I haven't worked in the CP codebase before, I'm having to figure out how things are done.

#

But I think I'm doing just that

onyx hinge
#

OK, my reading comprehension wasn't at its best. Yes, changing that 0 to 1 should make the build system start including those files. make BOARD=whatever clean when changing build settings.

#

(anything in Makefile or .mk files)

native sandal
#

clean is a good tip. The build isn't exactly speedy, is it?

onyx hinge
#

I wish it was faster. Parallelism isn't activated by default so you may have somewhat faster builds when you specify -jN where N is your number of cores.

native sandal
#

good to know, thanks

onyx hinge
#

the speed also varies greatly depending on the microcontroller family. espressif is one of the smaller ones overall.

#

(build time)

native sandal
#

Heh, glad I'm not working on another then!

onyx hinge
#

er, I meant it's one of the slower ones. it's late here, I probably should stop answering. Best wishes as you work on this feature!

native sandal
#

Ha! No worries.

#

I appreciate this kind of help a lot!

#

I can figure out the specifics, but the high-level view is hard

native sandal
spare jacinth
#

I would expect something like "mp_printf" to exist, being the C implementation of the Python-level print

tidal kiln
manic glacierBOT
manic glacierBOT
manic glacierBOT
lone axle
#

<@&356864093652516868> The weekly meeting will occur here in the discord in just about 20 minutes. Sorry for somewhat last minute notice. Notes can be filled in to the document ahead of time if you like https://docs.google.com/document/d/10pP4dmcG4_nispk7omUtDkOYikEoKQspGf1wB8KD9oo/edit?tab=t.0. We look forward to hearing from everyone.

onyx hinge
#

I can grab any of the state of circuitpython sections if you like @lone axle

orchid basinBOT
onyx hinge
#

MicroPython is a firmware environment for quickly developing and deploying software onto microcontroller systems. It is used in a variety of industrial and scientific applications, as well as (most importantly) in some DEF CON #badgelife projects. It's easy to learn and use for rapid prototyping.

For hackers interested in reverse engineering co...

▶ Play video
#

mmm popcorn 🙂

#

[I'm realizing circuitpython.org activity isn't reported in the State of CircuitPython section]

wraith crow
#

Congrats Jeff 🎉

manic glacierBOT
onyx hinge
#

thanks @lone axle !

ember iris
#

Thanks all! Have a great week!

lone axle
#

Have a great week everyone!

#

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/1VtQg5M7-xoaP_08wIxqJinck0yLzgv_buZQS2l-Ot5c/edit?usp=sharing

manic glacierBOT
#

CircuitPython version

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

Code/REPL

def read_packet():
    global packet
    try:
        packet = e.read()
    except ValueError as error:
        print(f"{error}")

Behavior

Hello.
This is more a support question then a bug report. I cannot find anywhere in the documentation how to purge the ESPNow buffer, or how to destroy the ESPNow object so that I can recreate...

orchid basinBOT
manic glacierBOT
lone axle
#

Don't think I've ever seen this error before. Occured during the pypi upload of a library. It seems like pypi was unhappy with the package that got built. Will dig deeper on this tomorrow, but if anyone happens to recognize it I'm happy for any pointer.

onyx hinge
#
… 
         Invalid distribution file. WHEEL not found at
         adafruit-circuitpython-bme680-3.7.11.dist-info/WHEEL```

I ran the `python -mbuild` step locally .. it printed stuff including ```adding 'adafruit_circuitpython_bme680-0.0.0+auto.0.dist-info/WHEEL'
``` and inspected the resulting whl file (which is in zip format) and it does contain a path that looks wrong: ```       91  2024-11-18 23:27   adafruit_circuitpython_bme680-0.0.0+auto.0.dist-info/WHEEL``` (and the content looks like something plausible)

however, I think this is because I didn't run the step which inserts the version number. In your transcript above the correct, identical version can be seen in both spots.
lone axle
#

Nice, thank you. That is a relief to see mention of it elsewhere. With a quick search I was getting zero results on exact string search for "Invalid distribution file. WHEEL not found at". Found many non-exact matches that looked unrelated.

onyx hinge
#

OK I see it now, it's a dashes-vs-underscores

lone axle
#

Yep, didn't catch that in the log the first time but underscores when it packs it and then dashes when it reports failing.

onyx hinge
#

pypi sorta treats underscores and dashes the same, but maybe they're changing the rule.

lone axle
#

Looks like the behavior may be reverted shortly

#

though I did notice:

the restrictions applied in #17107 introduced a bit too strict handling of wheels than we're ready for. using the parse_wheel_filename normalized name/version, which is a new and more strict constraint than intended
(emphasis added) I wonder if this restriction is planned for the future.

#

maybe being ready for it will bring some other mitigation.

onyx hinge
#

python -mbuild should be assigned the job of obeying whatever the rules are. Do we pin any of the build-related packages at old versions?

#

.. I don't think we do

lone axle
onyx hinge
#
README.rst:.. image:: https://readthedocs.org/projects/adafruit-circuitpython-bme680/badge/?version=latest
README.rst:PyPI <https://pypi.org/project/adafruit-circuitpython-bme680/>`_. To install for current user:
README.rst:    pip3 install adafruit-circuitpython-bme680
README.rst:    sudo pip3 install adafruit-circuitpython-bme680
README.rst:    pip3 install adafruit-circuitpython-bme680
pyproject.toml:name = "adafruit-circuitpython-bme680"
jepler@bert:~/src/bundle/libraries/drivers/bme680$ git grep adafruit_circuitpython_bme680
jepler@bert:~/src/bundle/libraries/drivers/bme680$ 
```we don't seem to refer to anything as `adafruit_circuitpython_bme680` with underscores, that's invented by `python -mbuild`
onyx hinge
#

@lone axle I re-ran the BME680 release actions and this time it passed.

lone axle
#

Thank you!

tulip sleet
tulip sleet
#

@lone axle woot!

#

we can notice other search terms we might add explicitly for some boards. Nothing comes to mind immediately

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

Inspecting the C source, I do believe there's an implementation error.

 68 // Callback triggered when an ESP-NOW packet is received.
 69 // Write the peer MAC address and the message into the recv_buffer as an ESPNow packet.
 70 // If the buffer is full, drop the message and increment the dropped count.
 71 static void recv_cb(const esp_now_recv_info_t *esp_now_info, const uint8_t *msg, int msg_len) {
 72     espnow_obj_t *self = MP_STATE_PORT(espnow_singleton);
 73     ringbuf_...
#

Actually, now that I think about it ringbuf is a CircuitPython API and at is not multithread / multicore safe, so it may not be appropriate to use here at all. For instance, if get and put are happening from multiple cores at the same time, the used field (which is not volatile and is simply incremented and decremented with ++ and --) could get garbled.

I think the original, original ringbuf may have been atomically safe, but once we went to two-byte entries, I think that went out th...

manic glacierBOT
manic glacierBOT
#

Not sure why the espressif builds are failing, any suggestions @relic-se @jepler? Thanks! Perhaps related, my submodule understanding is fuzzy, do I need to do something get rid of the git warnings

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   ports/espressif/esp-idf (new commits)
	modified:   ports/raspberrypi/sdk (new commits)
manic glacierBOT
#

Context from [Discord](#help-with-circuitpython message):

Todbot said:

What if keypad generated synthetic press events for any buttons not in the value_when_pressed state on init?

DanH replied:

That is an interesting idea. I was thinking of a __get_item__ or a current_state(i), but generatig some initial events is probably not hard and requires no new API. Also I don't think it would cause issues with any current use cases that...

#

More context...

Zero is an odd initial value for debounce_counter; you're liable to get weird events if there is noise at startup.

If you initialized to -debounce_threshold there needs to be some debouncing before you see an event. (Yes, I know the default debounce _threshold is 1.) And, if the keys are pressed you'd get pressed events.

You kind of get the opposite after a reset() call. (debounce_counter gets memset to debounce_threshold, so you get a bunch of release...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

@dhalbert I would still love to have access to at least the most basic of these intersection checks on devices where it will fit. I'd like to use them to make simple arcade / physics style games. A version of breakout was my initial reason for starting this effort.

It is a shame that it has overflowed so many boards, in particular the m4 express devices would be great to have. I even did a good chunk of the testing on some of them but a few languages overflowed.

I would propose the fol...

#

The T-Deck and T-Deck Plus are different versions of the board, as far as I can tell. This appears to be for the Plus. Is it also compatible with the base version? Should the directory name change? Should there be two ports?

It's fully compatible, so I followed the same logic as with the Seeed XIAO nRF52840 (Sense). The optional / plus thing in parentheses, indicating optional support.
The circuitpython.org listing can in turn also be updated to indicate support.

thorny jay
#

Sorry, I posted this on help with:

Hello, just checking if anybody was working on CP for "Video Game Module" for Flipper? https://blog.flipper.net/introducing-video-game-module-powered-by-raspberry-pi/

I am new to Flipper, and found out about that add-on to mirror the screen on "HDMI". It is based on RP2040 and should be similar to "Feather RP2040 with DVI Output Port" with added giroscope.

If ever I upgrade my Flipper, I might try to make it, I guess it is just mapping the right GPIO, they might even use the same GPIO already. 😉

Flipper Blog

We're excited to announce the Video Game Module, our new product developed in collaboration with Raspberry Pi! The module is powered by the first chip designed by Raspberry Pi—the RP2040 microcontroller, the same as in the Raspberry Pi Pico board.

We slightly overclocked the microcontroller so it could generate

manic glacierBOT
#

There are three regressions in submodule versions. See the first three entries in "Files changed". There shouldn't be any submodules listed in there for this PR> You can update submodules locally and then push again. The submodules don't get updated automatically necessarily when you merge from upstream.

Thanks @dhalbert! I can update locally with make fetch-all-submodules but then how do I push the submodules? The various advice I am seeing on stackoverflow is not giving me a warm f...

#

@aseanwatson pointed out that there was a regression from 9.0.0 to 9.1.0 for keypad.*.reset(). It started sending key_released instead of key_pressed events.

Fixes this, and also documents how to use reset() to determine which keys are held down at program startup.

Fixes #9818, by fixing the mentioned bug. Using reset() to determine pressed keys makes a new API unneeded (tagging @todbot on this).

native sandal
manic glacierBOT
tulip sleet
#

you mean where is the code that creates it?

native sandal
#

When building CP, there must be a source somehwere for what ends up in the filesystem

#

YEah

#

Not so much the code, unless the contents of the files are hard-coded into code somewhere, and not text files.

tulip sleet
#

the files are created by code. They are not copied.

native sandal
#

Okay, I can work with that. Thanks

#

Oh I see, it's code that runs on the device, not during build. I can still work with it.

native sandal
#

Okay so I've managed a basic implementation of PDMIn for CP on Espressif, but after I run it from reset, I get a "resource not found" error when I try to run again. I believe this is because I'm not deallocating the i2s channel I created. So I added code to clean it up to common_hal_audiobusio_pdmin_deinit(), but that doesn't seem to be called. I had assumed it would be called when the variable holding the PDMIn instance went out of scope, but it doesn't seem to be. Is there a way to ensure it gets deinitted at the end of the code run?

tulip sleet
manic glacierBOT
manic glacierBOT
#

I can update locally with make fetch-all-submodules but then how do I push the submodules?

You commit the changed commits for the submodules.

@dhalbert thanks, but we would have had to get into details to debug what I was seeing. I was trying to do as you say, but things were not acting as expected. For now, I short-cut the process by cloning a fresh copy of main and re-applying the changes.

Now it looks like the build is too large for some boards?

manic glacierBOT
manic glacierBOT
#

The STM32U083 has 40kB RAM and 256kB flash. The SAMD21, which was our first ports, is 32kB/256kB. The SAMD21 is quite limited in what it can provide as a CircuitPython chip, and so the STM32U083 would be only slightly better. I think it's not so likely we would do this port, given that there are more capable chips now at low cost. But we'd be happy to take a community contribution. Is there some feature of this chip that's particularly interesting?

#

Could you do this after the merge? That would be great!

Yep, that's my plan. I plan on showing both the plain and plus side by side.

BTW, do you actually have one of these (plain or Plus)?

Got the plus with 433MHz SX1262 and GPS. It can even fetch GPS time (on demo firmware).
It's just uart data, so i'll make a lib if there isn't one already.

tulip sleet
onyx hinge
#

I don't know of anything, I'm in arduino floppsy world

manic glacierBOT
#

This works great for my simple cases of detecting a held button on reset/boot. e.g.

import board, keypad, time
keys = keypad.Keys( (board.GP8,), value_when_pressed=False, pull=True )
keys.reset()
if key := keys.events.get():
    print("KEY HELD AT BOOT")
while True:
    print("HI")
    if key := keys.events.get():
        print(key)  # will print release message for held key
    time.sleep(1)
tulip sleet
#

@onyx hinge rather than wait on #9659, I think I will go ahead and do a release, since it's mid-week. There'll always be another release 9659 can go in.

onyx hinge
#

👍

manic glacierBOT
tulip sleet
#

@onyx hinge timchinowsky addressed the review very quickly; should I wait?

#

maybe you want to test

manic glacierBOT
onyx hinge
#

@tulip sleet realistically I am not going to actually test that code today.

tulip sleet
#

np

onyx hinge
#

(I re-requested review from you not because I think you need to review it again but to clear the "1 change requested" mark)

#

(but I guess it didn't do that, only leaving a fresh review does?)

manic glacierBOT
tulip sleet
#

do you agree?

onyx hinge
#

I think there's some small chance it could affect the single-buffered background write case. I should test that.

tulip sleet
#

i can leave it out

onyx hinge
#

Let me do a quick test just with an on-board neopixel & the background neopixel lib

manic glacierBOT
onyx hinge
#

Thanks for letting me gather the strength to do that 😉

manic glacierBOT
tulip sleet
onyx hinge
#

you interrupted me watching a video about a forgotten episode in American food history, nothing serious [interesting, but warning: video sponsor is a nicotine vape pen 🤮🚭] http://www.youtube.com/watch?v=ChqkNAeJygM

We love beef, but would you eat HIPPO? Go to https://TryFum.com/ANDONG or scan the QR code and use code ANDONG to get your free FÜM Topper when you order your Journey Pack today!

📘 My Cook Book KITCHEN PASSPORT
https://bit.ly/kitchenpassport

🛠️ My Kitchen Tools
https://bit.ly/kitchenpassport-tools

📸 Follow me on Instagram!
https://www.instagr...

▶ Play video
manic glacierBOT
#
[adafruit/circuitpython] New tag created: 9.2.1
orchid basinBOT
onyx hinge
#

thanks Dan!

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I missed this ping back in July.

I'd be happy to get back to this, I do still think this "device simpletest" scripts can be quite useful personally.

I'm open to any feedback regarding the test script in the PR, or anything meta like where it's stored etc... It sounds like from the comments above we prefer to have 1 per device so that changes can only impact a single one, that is good with me.

I'm happy to make any changes that would necessary to get this one into an acceptable sha...

manic glacierBOT
#

CircuitPython version

N/A

Code/REPL

N/A

Behavior

N/A

Description

types-circuitpython, created from type annotations to the code base, hasn't been updated on PyPI since May 2023 (8.1.0 release, 8.2.0b0 pre-release). It's likely a bug in the CI unless this package is no longer supported. Happy to dig into it, but wanted to submit a report so I didn't forget!

Additional information

No response

tulip sleet
manic glacierBOT
#

STM32U083
STM32U083x series provides Flash memory up to 256 KB and SRAM up to 40 KB, and it has eight packaging methods, including 32-81-pin UFQFPN, WLCSP, LQFP and UFBGA packages.  
STM32U083x devices provide:
A 12-bit ADC, two built-in rail-to-rail analog comparators and an operational amplifier.
A low-power RTC, a universal 32-bit timer, a 16-bit PWM timer specially used for motor control, three universal 16-bit timers and three 16-bit low-power timers.
Up to 21 capacitive sensing channels...

#

Can you add STM32H7R7/S7 support,I think so.

At 2024-11-20 23:45:48, "Dan Halbert" @.***> wrote:

The STM32U083 has 40kB RAM and 256kB flash. The SAMD21, which was our first ports, is 32kB/256kB. The SAMD21 is quite limited in what it can provide as a CircuitPython chip, and so the STM32U083 would be only slightly better. I think it's not so likely we would do this port, given that there are more capable chips now at low cost. But we'd be happy to take a community contribution. Is th...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
lone axle
#

Mentioned by a user in the help-with channel:

any chance that the raspberrypi filter can be, like the ESP line of modules, broken out to show RP2040 and RP2350 separately? Right now the raspberrypi search gives you 126 options and in many cases the name of the board doesn't always make it clear which microcontroller is being used.

Anyone else have thoughts for or against breaking out RP2040 and RP2350 processor families on the circuitpython.org downloads page filtering? It does sounds helpful to me and will only get more relavent as more 2350 based devices come out.

orchid basinBOT
#

Resolves: #1540

The new search logic broke the page by assuming that downloadsSearch.searchTerm would not be undefined which was an unsafe assumption and caused the rest of the JS to stop when an error was thrown. Its now wrapped in logic that ensures it isn't undefined or null before attempting to access properties.

This also includes a fix for a seperate issue I noticed were after you search for something and then erase it from the search box you are left with the page in a very...

manic glacierBOT
orchid basinBOT
#

The Coin M0 is a simple SAMD21 board the size of a large coin. It has just enough build-in features for a desktop macropad for visual (neopixels) and/or audio (speaker) feedback. The 4MB of flash is plenty for code or files.

The images use a white background. If this is a problem, I will take new photos with a charcoal or black background.

manic glacierBOT
manic glacierBOT
#

I tried adding the following 3 lines:

CIRCUITPY_CREATOR_ID =  0x000C303A
CIRCUITPY_CREATION_ID = 0x00320005

IDF_TARGET = esp32

CIRCUITPY_ESP_FLASH_MODE = qio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_FLASH_SIZE = 4MB

CIRCUITPY_ESP_PSRAM_SIZE = 4MB   <--------------------------
CIRCUITPY_ESP_PSRAM_MODE = qio   <--------------------------
CIRCUITPY_ESP_PSRAM_FREQ = 80m   <--------------------------

CIRCUITPY_ESPCAMERA = 0

but I get the following warnings:

...

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.2.1-dirty on 2024-11-23; Espressif ESP32 TTGO T8 v1.7 with ESP32
Board ID:ttgo_t8_v1_7

Code/REPL

ESP32 reports being offline

$ curl 'http://cpy-ttgo_t8_v1_7-807d3ab9bab0.local/code/' --compressed -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' -H '...
manic glacierBOT
#

Hi,I am sorry but I stopped trying for similar reasons.I don’t know internal structure of micropython  tool chain use to build the final file and don’t know where to look at for further critical points.Without adafruit support no hope to solve the problem, at least from my point of view.Best regards and good luckIl giorno 23 nov 2024, alle ore 01:15, aguaviva @.***> ha scritto:
I tried adding the following 3 lines:
CIRCUITPY_CREATOR_ID = 0x000C303A
CIRCUITPY_CREATION_ID = 0x0032000...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I just tried this on a clone of adafruit/circuitpython, on the tip of main. It builds for me both without and without the three PSRAM lines in mpconfigboard.mk, doing a make clean in between.

I'm not sure what to suggest trying next. If you are working on your fork, maybe there is something out of date about it. Try building in a clone of adafruit/circuitpython rather than your fork.

I revised the instructions in https://learn.adafruit.com/building-circuitpython/espressif-bu...

manic glacierBOT
#

Thanks DanI will retry with a fresh clone and following your suggestionsIl giorno 23 nov 2024, alle ore 16:15, Dan Halbert @.***> ha scritto:
I just tried this on a clone of adafruit/circuitpython, on the tip of main, in Ubuntu 24.04. It builds for me both without and without the three PSRAM lines in mpconfigboard.mk, doing a make clean in between.
I'm not sure what to suggest trying next. If you are working on your fork, maybe there is something out of date about it. Try building in...

lone sandalBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I can test this PR tomorrow. Only difference (besides a number of additional comments which is of course good) to my version is the PIO clock divider as noted by @eightycc . I copied the clock-divider from Jeff's implementation for the Pico2-W.

@jepler: was there a reason to set the clock-divider to 3?

A note on the directory name: this PR uses pimoroni_pico_plus2w. I used pimoroni_pico_plus2_w to be consistent with raspberry_pi_pico2_w. This is non-functional and personally I d...

manic glacierBOT
#

Nice comment about the venv I think it is safe to assume people are using venvs these days as it helps keep a clean installation.
Also, I was working on a clone of adafruit/circuitpython, not on main but on the 9.2.1 branch, in Ubuntu 24.04.

If all compiled fine for you (it worked for me despite of the warnings) please consider merging https://github.com/adafruit/circuitpython/pull/9824

manic glacierBOT
manic glacierBOT
#

@bablokb Some of the third party boards elided the _ separating separating the final w. Personally, I have no preference.

The CYW43439 interface is set as a power-on reset strapping option to gSPI. This is a subset of SPI defined by Cypress (now Infineon) in the CYW43439 datasheet. The datasheet also specifies a maximum SCLK of 50 MHz.

The Pico SDK implements gSPI using a PIO. See src/rp2_common/pico_cyw43_driver/cyw43_bus_pio_spi.c.

The PIO clock divider is set in 2 ...

#

A note on the directory name: this PR uses pimoroni_pico_plus2w. I used pimoroni_pico_plus2_w to be consistent with raspberry_pi_pico2_w. This is non-functional and personally I don't care, but maybe you have a different opinion on this.

It's consistent with pimoroni_pico_plus2. I'd try to be consistent with other boards by the same manufacturer.

Another source of possibly canonical names is https://github.com/raspberrypi/pico-sdk/tree/master/src/boards/include/boards. For i...

manic glacierBOT
#

@dhalbert All of the RP2350 boards that include an RM2 that I've looked at follow the RP2040 Pico W pin assignments so they are not affected. It does become an issue with RM2 breakouts. For example, the Pimoroni Pico Plus 2W attaches an RM2 breakout with its SP/CE connector that utilizes pins 32, 33, 34, 35, and 36.

I do not recommend switching to the SDK develop branch at this time. I tried it and got stuck in build issues.

mortal kernel
#

@danh The split heap implementation may be what I'm looking for to maintain a GATTS characteristic database that (at least partially) needs to survive a VM restart. Some entries are created by BLE workflow. Do you think it would help? Do you know of a good example in CP to look at?

#

Static allocations make my teeth grind.

tulip sleet
orchid basinBOT
native sandal
#

I don't seem to be getting valid data though. I think I'm getting the exact same set of values back from every call, but it's returning something non-zero, as the buffer is initialized to zero.

#

It does start up the bit clock

native sandal
#

Oh no, the bytes are different.

native sandal
#

My code is failing a commit hook on Translations. It says to run make translate, but there is no rule for target translate in ports/esspressif. Here’s the full error:

% git commit -m "Added basic Espressif PDM microphone support #7454"
[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to /Users/rmann/.cache/pre-commit/patch1732492128-28137.
Check Yaml...........................................(no files to check)Skipped
Fix End of Files.........................................................Passed
Trim Trailing Whitespace.................................................Passed
codespell................................................................Passed
Translations.............................................................Failed
- hook id: translations
- files were modified by this hook

if ! [ -f extmod/ulab/README.md ]; then python tools/ci_fetch_deps.py translate; fi
find extmod lib main.c ports/atmel-samd ports/cxd56 ports/espressif ports/mimxrt10xx ports/nordic ports/raspberrypi ports/stm py shared-bindings shared-module supervisor -type d \( -path "ports/*/build-*" -o -path "ports/*/build" -o -path ports/atmel-samd/asf4 -o -path ports/cxd56/spresense-exported-sdk -o -path ports/espressif/esp-idf -o -path ports/mimxrt10xx/sdk -o -path ports/raspberrypi/sdk -o -path ports/stm/st_driver -o -path lib/tinyusb -o -path lib/lwip -o -path extmod/ulab/circuitpython -o -path extmod/ulab/micropython  \) -prune -o -type f \( -iname "*.c" -o -iname "*.h" \) -print | (LC_ALL=C sort) | xgettext -x locale/synthetic.pot -f- -L C -s --add-location=file --keyword=MP_ERROR_TEXT -o - | sed -e '/"POT-Creation-Date: /d' > locale/circuitpython.pot.tmp
xgettext: The option '--sort-output' is deprecated.
ports/raspberrypi/lib/lwip/src/apps/http/makefsdata/tinydir.h:683: warning: hexadecimal escape sequence out of range
ports/raspberrypi/lib/lwip/src/apps/http/makefsdata/tinydir.h:685: warning: hexadecimal escape sequence out of range
python3 tools/check_translations.py locale/circuitpython.pot.tmp locale/circuitpython.pot; status=$?; rm -f locale/circuitpython.pot.tmp; exit $status
Checking locale/circuitpython.pot
Missing message id. Please run `make translate` and then `git commit locale/circuitpython.pot`
{'bit_depth must be 8, 16, 24, or 32.'}
make: *** [check-translate] Error 255
if ! [ -f extmod/ulab/README.md ]; then python tools/ci_fetch_deps.py translate; fi
find extmod lib main.c ports/atmel-samd ports/cxd56 ports/espressif ports/mimxrt10xx ports/nordic ports/raspberrypi ports/stm py shared-bindings shared-module supervisor -type d \( -path "ports/*/build-*" -o -path "ports/*/build" -o -path ports/atmel-samd/asf4 -o -path ports/cxd56/spresense-exported-sdk -o -path ports/espressif/esp-idf -o -path ports/mimxrt10xx/sdk -o -path ports/raspberrypi/sdk -o -path ports/stm/st_driver -o -path lib/tinyusb -o -path lib/lwip -o -path extmod/ulab/circuitpython -o -path extmod/ulab/micropython  \) -prune -o -type f \( -iname "*.c" -o -iname "*.h" \) -print | (LC_ALL=C sort) | xgettext -x locale/synthetic.pot -f- -L C -s --add-location=file --keyword=MP_ERROR_TEXT -o - | sed -e '/"POT-Creation-Date: /d' > locale/circuitpython.pot
xgettext: The option '--sort-output' is deprecated.
ports/raspberrypi/lib/lwip/src/apps/http/makefsdata/tinydir.h:683: warning: hexadecimal escape sequence out of range
ports/raspberrypi/lib/lwip/src/apps/http/makefsdata/tinydir.h:685: warning: hexadecimal escape sequence out of range

Formatting...............................................................Passed
[WARNING] Stashed changes conflicted with hook auto-fixes... Rolling back fixes...
[INFO] Restored changes from /Users/rmann/.cache/pre-commit/patch1732492128-28137.
onyx hinge
#

@native sandal it's not specifically called out there, but you need to run make translate in the top directory.

native sandal
onyx hinge
#

I'm not sure why you would get that message still, it's exactly what "make translate" is supposed to fix.

native sandal
#

This is what make translate did:

% make translate
if ! [ -f extmod/ulab/README.md ]; then python tools/ci_fetch_deps.py translate; fi
find extmod lib main.c ports/atmel-samd ports/cxd56 ports/espressif ports/mimxrt10xx ports/nordic ports/raspberrypi ports/stm py shared-bindings shared-module supervisor -type d \( -path "ports/*/build-*" -o -path "ports/*/build" -o -path ports/atmel-samd/asf4 -o -path ports/cxd56/spresense-exported-sdk -o -path ports/espressif/esp-idf -o -path ports/mimxrt10xx/sdk -o -path ports/raspberrypi/sdk -o -path ports/stm/st_driver -o -path lib/tinyusb -o -path lib/lwip -o -path extmod/ulab/circuitpython -o -path extmod/ulab/micropython  \) -prune -o -type f \( -iname "*.c" -o -iname "*.h" \) -print | (LC_ALL=C sort) | xgettext -x locale/synthetic.pot -f- -L C -s --add-location=file --keyword=MP_ERROR_TEXT -o - | sed -e '/"POT-Creation-Date: /d' > locale/circuitpython.pot
xgettext: The option '--sort-output' is deprecated.
ports/raspberrypi/lib/lwip/src/apps/http/makefsdata/tinydir.h:683: warning: hexadecimal escape sequence out of range
ports/raspberrypi/lib/lwip/src/apps/http/makefsdata/tinydir.h:685: warning: hexadecimal escape sequence out of range
tulip sleet
native sandal
# tulip sleet what does `xgettext --version` say?
% xgettext --version
xgettext (GNU gettext-tools) 0.22.5
Copyright (C) 1995-2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Ulrich Drepper.
% which xgettext
/opt/homebrew/bin/xgettext
tulip sleet
native sandal
tulip sleet
#

it (xgettext?) is not liking L'\xFEFE'

#

the deprecation may be unrelated to that

native sandal
#

ah right, that makes sense

tulip sleet
#

release notes from xgettext 0.22:

  • xgettext:
    • The xgettext option '--sorted-output' is now deprecated.
    • xgettext input files of type PO that are not all ASCII and not UTF-8
      encoded are now handled correctly.
#

L means wide characters. This should be ok, it's a 16-bit char value. What version of arm-none-eabi-gcc are you using?

#

I've gotta sleep. Will look tomw

manic glacierBOT
#

This PR adds basic PDM microphone support to the Espressif port. Only the most basic functionality has been tested: 16-bit, monophonic input seems to generate appropriate data when viewed in the Arduino plotter.

Support required adding implementations in ports/espressif/common-hal/audiobusio/PDMIn.[c|h], as well as a change to shared-bindings/audiobusio/PDMIn.c to allow for clean deinit of underlying ESP-IDF objects.

This PR is not intended to be complete, I just wanted to get it in...

native sandal
#

I opened a tentative PR for the work I've done so far. It works in the most basic sense but is otherwise untested.

manic glacierBOT
manic glacierBOT
manic glacierBOT
onyx hinge
#

Howdy <@&356864093652516868> ! We're a hair over 2 hours from our weekly meeting. Please take a moment to add your notes to the notes doc if you have them. https://docs.google.com/document/d/1VtQg5M7-xoaP_08wIxqJinck0yLzgv_buZQS2l-Ot5c/edit?usp=sharing

manic glacierBOT
slender iron
#

👋

manic glacierBOT
orchid basinBOT
manic glacierBOT
lone axle
#
The MagPi magazine
  • AI special edition. Incredible ideas for super smart projects and how-to guide to setting up Raspberry Pi’s AI Camera.

  • Handheld console gaming. Create your own handheld videogames console that's better than anything in the shops.

  • Build a DEC FlipChip tester. Checking the signals on classic PDP-9 computers using Raspberry Pi t...

manic glacierBOT
wraith crow
#

🎉

turbid radish
#

1000

lone axle
#

Thanks for hosting Jeff, have a great week everyone!

onyx hinge
#

Right now we have meetings on the 23rd, 30th & Jan 6. I would probably drop those last two in December, I can't imagine many folks will be around.

#

but as requested I'll In The Weeds it next week

slender iron
#

agreed

slender iron
#

@tulip sleet I'm back at my desk

tulip sleet
#

one sec

manic glacierBOT
orchid basinBOT
ionic elk
#

I'm writing a driver for the IT8951 to support the epaper display on the M5Paper. Should I PR it to Adafruit_CircuitPython_EPD?

onyx hinge
#

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

slender iron
manic glacierBOT
ionic elk
ionic elk
#

I've found the examples of independent displayio.EPaperDisplay drivers, but I'm kind of surprised they're so simple. It's typical to compress all the differences between these chips into the startup command sequence?

manic glacierBOT
manic glacierBOT
#

@bablokb I'd like to know more about the network performance limitations you're seeing using the CYW43 part.

I have a small "benchmark" webpage that loads a few js-libs (including jquery) and stylesheets. Total size is about 138KB (jquery alone is about 89KB, and that is the minified version). The browser opens 5 parallel streams to download the page plus all linked files. This is a test that the implementation can handle parallel requests and also kind of measures throughput.

WLAN is...

manic glacierBOT
manic glacierBOT
manic glacierBOT
slender iron
manic glacierBOT
manic glacierBOT
manic glacierBOT
lone axle
manic glacierBOT
#
[adafruit/circuitpython] New branch created: anecdata-patch-1
manic glacierBOT
manic glacierBOT
#

It seems unusual to have to provide board_millis. Unless I'm mistaken, this identifier is not otherwise used in CircuitPython. Rather, it seems it may be defined & used in tinyusb:

// lib/tinyusb/hw/bsp/max32690/family.c
#if CFG_TUSB_OS == OPT_OS_NONE
volatile uint32_t system_ticks = 0;

void SysTick_Handler(void) {
  system_ticks++;
}

uint32_t board_millis(void) {
  return system_ticks; 
}
#endif

Perhaps there's a mistake with the #defines for tinyusb?

lone sandalBOT
manic glacierBOT
#

CircuitPython version

at least since 8.0.5

Code/REPL

see https://github.com/bablokb/circuitpython-examples/tree/master/webserver

Behavior

see below

Description

The example scenario runs a webserver. The main page sources a number of js and css-files. This triggers multiple parallel requests from the browser to the server. Total download size is about 140KB, throughputs (measured as total download time from within the browser development too...

manic glacierBOT
mortal kernel
#

Bob’s cobble for this morning. Needed BLE sniffing on a long cord!

ionic elk
# slender iron Yup. It works for the class of displays we support. Maybe it won’t for the one y...

from what I can tell, the major difference is that the IT8951 uses preamble words with SPI to distinguish between commands, reading and writing, whereas chips like the SSD1608 are read-only. Do you know of any instances of a display driver like this being integrated with displayio already, or am I in uncharted territory here? (edit, after reviewing more of displayio - am I just in impossible territory, here?)

#

It seems possible that I'd be able to send out the startup command sequence, but every other write to the device will also require a preamble word

slender iron
manic glacierBOT
#

Starting this issue to track how (and perhaps if) the epaper display on the M5Paper ESP32 development board from M5Stack can be supported. I think the main issue is this board's SPI display driver, the IT8951, is built around read/write commands instead of being read-only and requires 2-bit preamble words before any command. Looking at the displayIO implementation I don't believe there's any way to get around this even if I tried sneaky byte insertion into the screen data. Are there any exi...

ionic elk
# slender iron Nothing is impossible. You may need to change the internals though.

I think it would require changing the C internals of displayio, yeah. I'll try and research whether this would help support any other interesting displays. Are there any useful rendering tools I could feasibly layer on top of a custom library for the screen, absent direct displayio support, or is everything pretty displayio integrated?

slender iron
#

displayio's text support is best

#

there is the EPD library that isn't displayio

ionic elk
#

that'd be Adafruit_Circuitpython_EPD? Does it share any API/library compatibility with displayio?

manic glacierBOT
#

Are there any existing display systems that are similarly incompatible with displayio that can still make use of some of Circuitpython's rendering features

It depends on how you define "similarly". I own two displays from Waveshare that always need 16-bit commands (usually commands are 8-bit and data is 16-bit). For the init-sequence, it was no problem filling in the additional bytes, but for the definition of the region it was. So I ended up with a patch that I apply to my own builds fo...

slender iron
#

I'd stick with displayio

ionic elk
#

Ok. I'll see what it'd take to insert multi-byte command preambles

slender iron
#

you can start by just hacking it in

#

parameterize it later

manic glacierBOT
#

I think the simplest thing would be to make an EPaperDisplay class copy, cut it down and then change it to do exactly what you need. You could also add another kwarg to EPaperDisplay to do this behavior. @bablokb, you could do that for your patch as well.

Which do you think would be clearer for dev experience? Or are you just suggesting to do the first for testing simplicity and then merge in as the second?

slender iron
#

@wanton dirge why does each board have the systick interrupt?

manic glacierBOT
wanton dirge
#

I will do that and test real quick.

slender iron
#

I don't think you need the pin definitions at the board.c level either

#

basically, I'd expect board.c to be empty 🙂

wanton dirge
#

Yeah these were probably an artifact of earlier testing as well. We have a couple simple libraries in msdk which rely on these parameters being defined. Might have to adjust the Makefile to exclude these but I'll try removing them since most of that stuff should be at the CircuitPy level now anyway. It feels like the embedded C programmer in me is slowly relinquishing the trust to the Python programmer 😂

slender iron
#

ya, it is weird to be very dynamic

wanton dirge
#

I am still going to keep the port definitions in here; that is a useful extern to check since some of our GPIO ports at the higher numbers have some behavior that is inconsistent with the others. For example GPIO4 on MAX32690 requires completely different handling than others. Most of our underling functions take care of this and I tried to mostly rely on those, but I'm reticent to get rid of that particular data for each board.

#
// Board-level setup for MAX32690
mxc_gpio_regs_t *gpio_ports[NUM_GPIO_PORTS] =
{MXC_GPIO0, MXC_GPIO1, MXC_GPIO2, MXC_GPIO3, MXC_GPIO4};
#

What I may do later is abstract that out to mcu-level include files instead of in board.c, similar to the ST port...but want to see how hard it'll be to port to our other parts before I overthink portability much more. Our parts are all fairly similar to each other in any case.

slender iron
#

usually gpio ports are enabled when they are used

#

aren't you using a single chip now and you could just init the same ports for both boards?

manic glacierBOT
wanton dirge
#

Yep, that's the case. What I see potentially happening down the line is implementing a submodule that may utilize GPIO4 for instance, and say I hit a corner case where our msdk functions don't cover the different usage. In that case, I'd like to know how many ports the MCU has to indicate how I should handle those ports. For now I just have the one MCU but will want to look at adding our other USB-enabled chips: MAX32666, MAX32650, MAX78002.

#

I believe GPIO4 is on a LP clock domain, so even for something like GPIO wakeup the handling may be slightly different vs. other GPIO ports.

slender iron
#

I think you should just skip it for now

#

deal with that when you get there

wanton dirge
#

It'd require some refactoring to get rid of; that array is how I access ports all over digitalio.

bool common_hal_digitalio_digitalinout_get_value(digitalio_digitalinout_obj_t *self) {
    digitalio_direction_t dir =
        common_hal_digitalio_digitalinout_get_direction(self);

    mxc_gpio_regs_t *port = gpio_ports[self->pin->port];
    uint32_t mask = self->pin->mask;

I really like having the important chip-specific stuff like this isolated and not buried in the common-hal modules. Would you prefer I move it to a separate mcu folder and compile that in vs. keeping it in the board.c? I can do that instead.

#

I could also just make a .c counterpart to my max32_port.h and keep them all in one file for each chip.

tulip sleet
#

we have ports/*/peripherals to create some abstractions for common-hal to use. In atmel-samd, for instance, there are differences for samd21 and samd51, which are in there. We don't do this completely consistently, but it helps hide the chip-specific details

#

definitely shouldn't be in board.c, since more than one board may use the chip

wanton dirge
#

Understood 👍 I'll move that out then. Thanks for the help guys 🙂

slender iron
#

thanks!

wanton dirge
#

Okay, board.c should be cleaned up now.

tulip sleet
#

@slender iron The stuff I'm doing toward circuitpython compatibility is in this branch: https://github.com/adafruit/CircuitMatter/tree/circuitpython.

  • ecdsa.der needed functions replaced by cm_der.py. Most functions just copied, and cleaned up a bit to remove Python 2.7 compatibility code. Many functions not needed.
  • most direct calls to ecdsa functions removed; new functions added in crypto.py that do the ecdsa wrapping. A CircuitPython version of this file will not use ecdsa, but will use some API to mbedtls and python as needed.

Not done yet. There are still some ecdsa references left. I just pushed a few more changes.

Current version tested on Linux with examples/blink.py (a slight variation on one of your examples). I can successfully add the device in Apple Home and turn it on and off. Each time I run I remove the matter matter-device-state.json file.

Lot of errands to do today, so I'll work on this more next week.

slender iron
#

I'm distracted getting USB going on the P4

tulip sleet
#

sounds good!

lone axle
#

Anyone know how the rotation inside of displayio works? Is it expected that if you plot some pixels into a bitmap and display it one rotation it will appear visually identical to when rendered at other rotations save for the actual location and orientation?

Or another way to ask is, if you were to get a pixel perfect screenshot of displaying a bitmap in one orientation and then the 180 of it. If you rotation the 180 screenshot back inside photoshop or whatever are they expected to "stack" perfectly pixel for pixel? Or is there some chance for rounding or something else to cause them to be off by a few pixels?

stuck elbow
#

I think the current implementation uses floating point numbers and sin/cos, so apart from the four cases where it will round nicely, you will have some artifacts

#

There is a way of doing pixel-perfect rotation with three shears, but it's not how it's done here

#

in any case, 90/180/270 degrees should be fine

#

oh, and if you are talking about screen rotation, that's just swapping of coordinates and/or signs, it's pixel perfect

lone axle
#

It's something specific to vectorio shapes. In rotation 0 they behave as expected. In each of the other 3 rotations 90, 180, 270 they are off by one pixel on one or two axis.

stuck elbow
#

I'd guess that's a question where the center of rotation is, in the middle of a pixel, or in one of the corners?

lone axle
blissful pollen
#

I thought within displayio most rotation of the whole display is in the hardware chip itself. Some boards (funhouse?) are actually rotated by default

slender iron
#

@onyx hinge want to do additional mdns stuff for circuitmatter in CP?

onyx hinge
#

something about my home network means mdns stuff barely works so I'm the wrong person to try to push mdns forward. unless you want me to start by figuring that out.

slender iron
#

👍

onyx hinge
#

I was looking at https://github.com/adafruit/circuitpython/issues/9705 and https://github.com/adafruit/circuitpython/issues/9674 -- 9674 is probably easy once I get the hardware out, 9705 is something I'd like to see fixed but it may be something weird/subtle

GitHub

CircuitPython version Adafruit CircuitPython 9.2.0-beta.0-3-g3a189e75d9-dirty on 2024-09-23; Raspberry Pi Pico 2 with rp2350a Code/REPL # https://github.com/adafruit/Adafruit_Learning_System_Guides...

GitHub

CircuitPython version Adafruit CircuitPython 9.1.4 on 2024-09-17; Adafruit Matrix Portal M4 with samd51j19 Code/REPL from adafruit_matrixportal.matrix import Matrix # default pinout: # R1 - G1 # B1...

slender iron
#

ya, true too

#

getting native I2S support would be good too. despite what @fleet hollow did with their library