It would not hurt to do something smarter when frequency value is inappropriate. @kevinjwalters noted that with the current biquad implementation, using a frequency value above f_s/2 gives "white noise like" outputs; I think it'd probably be better to have silence (or maybe no filter for notch & lpf?) in this case.
#circuitpython-dev
1 messages · Page 76 of 1
I ran pre-commit on the file changed in this commit, so that hopefully the CI completes successfully. Absent input from @titimoby we may want to just go ahead and merge this as a bugfix.
@gitcnd can we help with anything holding this issue from being marked "ready for review"?
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
Good find. Similar code is being used with audiodelays.Echo where I pulled this from. We'll need to look into a better solution.
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
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')
@lone axle I am noticing a few more people using the WM8960 library (https://github.com/adafruit/Adafruit_CircuitPython_WM8960) on https://forums.adafruit.com. Is there any way to get it included in circup for easier installation?
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.
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...
Thanks for the direction! There is potentially one issue that I'm researching into related to this forums post: https://forums.adafruit.com/viewtopic.php?p=1034796. As much as I'd like you to handle it with your experience of the ecosystem, I should probably learn the procedure. After I've addressed the aforementioned issue, I'll begin the process and ping you if I run into trouble.
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.
Also add ssl module to WIZnet W5100S EVB Pico (RP2040) board
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
@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
rp2350 doesn't have the same RTC peripheral as the 2040 (let alone other family micros), as reported on discord by anecdata.
this has the side effect of obeying a different timesource if one has been configured.
This only compile-tested (for pico w and for pico 2 with SSL module enabled). I didn't actually run the code.
@anecdata please test if you can.
ok, it was 16 minutes 😜
@onyx hinge wow, thank you! I'll test it right away (once there are artifacts)
Tested Requests on:
- Pico W, SSL over wifi
- WIZnet 5500 EVB Pico, SSL over Ethernet
- Pico2 (WIZnet W5100S EVB Pico2 - RP2350), but without SSL, over Ethernet
Looks good to me, thank you!
(I'll test Pico2 with SSL over Ethernet on my WIZnet W5100S EVB Pico2 PR #9791)
Tested adafruit_requests with ssl over Ethernet on:
- Adafruit CircuitPython 9.2.0-11-g1b8baca968 on 2024-11-04; W5100S-EVB-Pico with rp2040 (1st commit)
- Adafruit CircuitPython 9.2.0-12-g1bba7b9d14 on 2024-11-05; W5100S-EVB-Pico2 with rp2350a (2nd commit)
Added link to github repository containing hardware information and sample code.
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?
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.
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)
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.
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.
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.)
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
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.
Could you open an issue here: https://github.com/adafruit/Adafruit_CircuitPython_BLE/issues with the current error? Thanks. Then we can track it.
Will do!
The link was not working initially due to a space between the square brackets.
I added a commit to remove that space and to add the same link to the N8R8 version of the device since the documentation appears to cover both.
Thanks for adding this @Kalrkloss!
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...
I can not open an issue there: My github username is ThomasAtBBTF can you add me to adafruit/Adafruit_CircuitPython_BLE/issues
- Disregard * !
After a refresh the green Issue button became active,
The issue is filed!
thanks @fathom sand !
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 ...
I only created one test as an example. I'd hope that after this PR is merged you'd consider creating more tests; you're likely to do better at identifying what's important to test than me, given your familiarity with the code.
Here is un updated version that looks more correct (in how it behaves on my hardware at least) :
import network
import espnow
sta = network.WLAN(network.STA_IF)
sta.active(True)
sta.config(protocol=network.MODE_LR)
sta.config(pm=sta.PM_NONE)
sta.disconnect()
e = espnow.ESPNow()
e.active(True)
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
source for the port is here: https://github.com/blues/circuitpython/tree/blues_cygnet/ports/stm/boards/cygnet
in this kind of case, I'd just look for where that function was defined, and assume that for some reason it's not being compiled. The other stm32l4xx ports might offer guidance, but you're probably already using them for help.
Can I build CP for ESP-IDF by installing ESP-IDF via VS Code?
esp-idf is a git submodule inside the circuitpython tree, so we are only familiar with using it that way
certianly you can edit with VS Code, but we haven't tried any integration with Code
oh good to know. I had followed the link to the espressif docs and was going to install from that.
did you see this page? https://learn.adafruit.com/building-circuitpython/espressif-build
Yes. The first thing it said was "Please read the README.md in that directory"
And that linked to the espressif docs
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
I'm still waiting on brew to update. I installed sequoia recently and a LOT of stuff is updating.
my Mac is case-insensitive, and I've built for Espressif on it
With a few modifications I can get the LED status now.
(See the description in a comment of the github issue)
Can you point me to the sources of the underlying C (c++? ) code of the reportin and reportout objects?
hi - answered in issue: https://github.com/adafruit/Adafruit_CircuitPython_BLE/issues/207
I would like some insight into a better method of updating the biquad_filter_state objects when the list of Biquad objects is updated, but otherwise this PR is functional. If there isn't a better method, I'll need to update the docstring for audiofilters.Filter.filters to demonstrate proper usage.
@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?
I think we missed the release of 13.3rel1? We should probably update. I was surprised to see
-mcpu=cortex-m33 \
-mfloat-abi=softfp
in the port makefile. I don't know why it's softfp. I was going to say that m33 is specified
That -mfloat-abi=softfp looks wrong to me, too. I'll do a test with 13.3rel1 and hardware FP on RP2350 just to see if there's a performance improvement incoming.
in pico-sdk they use softfp for clang but not gcc, it looks like. I will see if I can find out why
Clang support is new with 2.0.0, could be an oversight.
@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.
did you reproduce the problem? (or maybe you don't have that breakout?)
I do not have the device. Just started going through open issues at happen to start at the top of the alphabetically listed page in the 'A's.
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.
Ahhh
i said the same in the PR
I will change it to use a loop and match the current arduino driver.
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.
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...
I'm relatively sure that m_malloc already throws in case of failed allocation, so the call to m_malloc_fail is not needed; but also, the call to common_hal_audiofilters_filter_deinit is ineffective. I see this idiom has been used across the audiofilters so it may need to be revised elsewhere as well.
@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.
let's leave it alone for now, then. When Scott is back we can ask if he thought about this.
thanks for researching this
I'll look into this issue and apply changes as necessary throughout. I'm still learning about how best to program within the MicroPython/CircuitPython ecosystem so bear with me! :)
@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...
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.
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?
@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
if the function is referenced in a .c file, but that .h is not included at the reference, then it will assume it's a real symbol and try to link it, instead of resolving it at compile time.
understood. Just having a hard time seeing what I could be doing in the L433 port that would resolve this...
I would compare what's in the build directory for a STM32L4R5 build, and maybe also compare the setups between the two, and the verbose build outputs.
but maybe you are doing that already
I'll do that, thanks for the suggestion
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?
not all pins are attachable to all peripherals. There isn't a crossbar. So PA02, for instance, is not attachable to any PWM peripheral. Look at section 7 in the datasheet
Espressif has a crossbar, mostly, and so does nRF, but SAMD assignments are very scattered.
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?
yes, exactly
You can also write a program to find the pins that work. Here's an example for I2C, and you can modify it for PWM: https://learn.adafruit.com/circuitpython-essentials/circuitpython-i2c#wheres-my-i2c-2985160
Cool! Thanks @tulip sleet
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
inside ports/espressif, running install.sh will set up ESP-IDF's own venv. So if you are already in a venv, you will need to deactivate before running install.sh. After install.sh, then you can install requirements-dev.txt
venv will not let you create a venv inside a venv
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:
- Do I do that from the
ports/esspressifdirectory? Answer seems to be yes. - Where do I find the list of board name strings? I'm currently targeting the Adafruit MatrixPortal S3. Answer seems to be "
lstheboards/directory, use those names.
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.
I went back thru my notes and found where my design went off the rails. The Circuit Playground Express uses SPEAKER for A0. I didn’t follow through to look at its CircuitPython examples to read that A0 is a real analog pin and the CircuitPython example does not use PWM.
I will first test with the CPE example before deciding if I will change my hardware design.
Did you activate your venv (was it export.sh) after installing deps?
Cant tell without seeing your full console input, but you would most likely want to see something like (venv) at the very start of the line, before your username and whatnot
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...
For this kind of equalizer does it work to apply the filters sequentially (e.g., output_samples = high_shelf(peaking_eq1(peaking_eq2(low_shelf(input_samples)))) using function call notation? I had an impression from somewhere that the filters needed to be parallel rather than sequential, but maybe this is mistaken on my part.
I'd suggest asking on the MicroPython Discord server, and if that doesn't pan out, file an issue on the MicroPython Gituhb repo.
@ViktorWiz Any comments on this? I noticed you did the original PRs for the W5500 and W5100S EVB Picos.
no hw so didn't test but everything looks in order from a quality standpoint. Thank you!
Well,
After further testing, it looks like even if the LR mode cannot be selected, the default mode used with Circuitpython is still better then what I get with Micropython. I get about twice the range. So, I'll stick with Circuitpython for now, and hope the long range mode can be enabled soon.
@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...
On reflection I think that the constructor error handling needs to ensure the object's immediately deallocated. but I'll let this run and get some important info: does this fit, or does it add enough code to overflow our most constrained builds...?
It's always low-key bugged me that I couldn't create a pin in output mode, so I wrote that ^^
I have been wanting this for years :) . I hope it fits.
But @tannewt has not been in favor of some of this: see #5124 and #8534.
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...
You can run a single test with make VARIANT=coverage TEST_EXTRA=circuitpython/audiofilter_filter.py. Or, you can manually include testlib in the import path with MICROPYPATH=../../tests/testlib build-coverage/micropython ../../tests/circuitpython/audiofilter_filter.py
This means that the variant no longer needs to be explicitly named and you can just run make test. (I suspect this is what happened to @FoamyGuy over in #9793 but I'm not sure)
I constantly have to re-remember this. Thanks!
@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...
thank you, I took a quick glance at the paper you linked and I think it will be enlightening when I get a chance to read it through. In CircuitPython we're not likely to be taking advantage of parallel methods of computation anytime soon, so simplicity and adequate single thread performance are great features to enjoy.
Hi! I mostly have just nitpicky things, plus one concern about backwards compatibility. Given that in practice there's not much audiofilters code deployed so far I'm inclined not to worry but I'd like Dan to sign off on that as well.
call common_hal_audiofilters_filter_set_filters here instead of duplicating code
@dhalbert can we ignore this backward-incompatible change? audiofilters "filter" argument was in 9.2.0 but would not be in 9.2.1.
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 began removing the ..._deinit and m_malloc_fail statements, but I'm finding that this idiom is fairly common within multiple modules of CircuitPython. As you certain that this isn't the proper handling of m_malloc?
Here are a few examples:
call
common_hal_audiofilters_filter_set_filtershere 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.
Nice! Thank you. make tests does not show any failed tests anymore with this change.
Yep. This will be omitted in the next commit.
See previous comments regarding using None or () as default.
It may take some work to implement, but would the ideal scenario be filter: Optional[synthio.Biquad|Tuple[synthio.Biquad]]? It would retain backwards compatibility and reduce confusion if the user only plans on using a single biquad.
Adding b'\xff\xff\xff\xff\xff\xff' as a peer does not work for me :
peer = espnow.Peer(b'\xff\xff\xff\xff\xff\xff')
I get error message espidf.IDFError: ESP-NOW error 0x3069 ((0x3069): ESPNOW peer is not found)
Without the possibility of sending gratuitous broadcast packets and receiving them, it is not possible to pair ESPNow devices.
Is there any update on this?
Yeah it wasn’t clear to me that setting up idf via install and export would also activate the necessary venv. That part works, as pip install worked. But the build fails due to some mismatch in versions
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
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
Hi! I mostly have just nitpicky things, plus one concern about backwards compatibility. Given that in practice there's not much audiofilters code deployed so far I'm inclined not to worry but I'd like Dan to sign off on that as well.
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
filtersback tofilter - 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...
Well, this is precious information!
I wish this were documented in the circuitpython documentation.
Thanks @Sola85 !
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.
That did the trick! Thank you, @jepler
The ESP-NOW feature was added by a community member, so there's no guarantee it will get an enhancement any time soon. If you are inclined to develop the enhancement yourself, you can get help on Adafruit's Discord server. You could even prove it out first using Espressif's esp-idf environment, with their example.
Thanks @relic-se particularly for noting the problem with Q vs q_factor. The implementation in synthesizer was similarly confused, so I updated the docs there too.
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.
Sorry, I won't be able to do it, I'm just a simple user trying to make a device do what I want it to do, I'm not a developer. I was trying to avoid using Arduino and having to wait for a build everytime I change a coma, because I don't really know how to write code. Circuitpython or micropython looked attractive to me because of this.
The Coin M0 is a simple round SAMD21 board with sound, touch pads, and LEDs.
A popular use is to create small purpose-built touch pads.
Note: the PID:VID for USB has been submitted to pidcodes but it's merge is pending the circuitpython merge.
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.
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...
Switch to MicroPython - it properly supports channel selection and broadcast addresses.
Sadly, MicroPython has other issues that make it even less desirable for me. For example, the default hardware transmission mode of Circuitpython gives me twice the range of MicroPython's default mode (neither can be switched, it's another bug see https://github.com/adafruit/circuitpython/issues/9790 and https://github.com/micropython/micropython/issues/16179).
Turning features on/off is the easiest way. For instance, turn off ulab. You can also use less verbose error messages, but that's not a big difference. Look in particular at what's turned off for SAMD21 builds, both with and without external flash
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+
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
yes, I did and that helped
Background playback of 8-channel audio from SD card to a 4-codec TAC5212 setup now working! Details at https://github.com/timchinowsky/tac5.
Hey @timchinowsky ! I've been loving this new feature and have recently implemented in a simple general purpose I2S library: https://github.com/relic-se/CircuitPython_I2SInOut. So far so good, but if you need any assistance with reviewing these updates further, let me know how I can help.
Hey @timchinowsky ! I've been loving this new feature and have recently implemented in a simple general purpose I2S library: https://github.com/relic-se/CircuitPython_I2SInOut. So far so good, but if you need any assistance with reviewing these updates further, let me know how I can help.
Hey that's great, thanks for letting me know!
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)
...
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
@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?
you can add a board-specific startup in board.c for that board.
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
interesting. Are there any particular boards I should look at for a reference?
which board is it? There oculd be RP2xxxx or Espressif startup delays before CPy is even invoked
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?
no
i think this was discussed in some issue too. I'll look
CIRCUITPY_SKIP_SAFE_MODE_WAIT = 0 in a .mk
It's because space is extremely tight on the Trinkeys. When this feature was added it overflowed builds on the smallest boards. See #6247 for a little discussion on this. It would be possible to make a custom build to make it fit. It might fit in some language translations.
@arturo182 I know you mentioned this is very early stages still, just wondering if you are able to share a photo that could be used to list this device over at circuitpython.org? I tried looking at https://www.solder.party/docs/ but could find no reference to it there, I assume because it's still in the works and not officially released yet.
An extra call to serial_early_init() causes builds with serial REPL enabled to enter a bootloop. Affects all port raspberrypi boards.
Regression due to #9490, looks like a leftover from debug.
Tested with raspberrypi_pico_w and adafruit_feather_rp2350 covering serial REPL enabled and disabled cases.
@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
I got it! With boot.py having only two busio.I2C.writes to the gpio expander it catches the reset before it's released!
I think a lot of these are already turned off in mpconfigboard.mk, due to SAMD21. Circuit Playground Express is probably a good model.
Note: the PID:VID for USB has been submitted to pidcodes but it's merge is pending the circuitpython merge.
Since Scott is off for a few weeks, that won't get merged, but we can proceed on this anyway.
CPE does not turn off a lot of these. I looked at Big Honking Button as it too is a "special purpose" board.
Well, certainly BLEIO, BLEIO_HCI, etc. are already off.
thanks for the head's up on the VID:PID status
@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
in the rood mpconfigport.mk for same, they use the syntax ?=
I am not familiar with what that does.
are you also not seeing a serial port appear? If so, it sounds like it's crashing.
yeah, no serial port either
FOO ?= means set to the given value if FOO is not already set (if it's undefined). mpconfigboard.mk is read first so that can do per-board settings, then mpconfigport.mk, then py/circuitpy_mpconfig.mk.
if you can enable some kind of serial logging, or use a debugging tool like J-Link, that's the next step.
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
OK. I can go through and attempt to remove redundant flags. I was "just doing what others had done before me" :-)
you don't have to get it perfect, but it's easier to read with fewer, and there are fewer implications of "well, this is off, but something not mentioned must be on", which isn't necessarily true.
I'll do one "due diligence" pass and run my smokiest. I should have a new commit in about 30 minutes.
latest commit removed some of the redundant build flags (but added a couple too).
From @tannewt 's comments on #8534 :
Having direction in the constructor would require cross parameter validation (if pull is set but direction is output then fail.)
Is there a specific reason why cross parameter validation would be something to avoid within DigitalInOut or other classes?
Tried it out with a bunch of filter combos and worked great for me. Code looks good as well.
As @jepler had comments I'll let him approve if he thinks all his requests were complete. But looks good to me.
I did not have time to test on hardware but the code looks good. I had 3 minor comments.
Notch is defined below but not here? Is that on purpose?
Just making sure it does not matter that this is in this PR?
It turns out that if you build in ports/raspberry pi and then try to build the docs, it'll show an error because of unexpected files in ports/raspberrpi/pioasm. This is the fix.
this should probably be taken out, or at least discussed separately.
should be added here, good catch!
Changes are good. Looks good to me. Thanks!
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...
This PR does some cleanup on pin-names:
- renamed
SPICE_xxxtoSPCE_xxx(Pimoroni calls their connector SP/CE) - removed
SPI(board.SPI()throwsNotImplementedErroranyways) - added normal
GPxxnames since all pins are normal GPIOs as well - removed
SPICE_TXandSPICE_RX. RX/TX pin names are UART-related on other boards. Here, they are only inclusive names for MOSI/MISO. It turns out thatSPICE_TXis an UART-RX and vice versa. So to avoid confusion, I removed the names...
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?
When testing stuff, running experimental builds or other weird stuff, safemode is great. Now that
safemode.pyexists, 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_TRIGGERThis 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?...
I believe the SPICE name was copied from what @gadgetoid set within our C header for the product (e.g. https://github.com/pimoroni/pimoroni-pico-rp2350/blob/feature/wireless/micropython/board/PIMORONI_PICO_PLUS2/pimoroni_pico_plus2w_rp2350.h), though why he included the I I don't know.
The other changes sound sensible to me.
Thanks @py7hon and @wtuemura!
Try TRANSLATION=ja, or de_DE, or fr. Those are larger translations that may overflow.
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 ...
"SPICE" flows better and is easier to say, I will die on this hill.
Which board are you thinking of.
I'm thinking of using the Waveshare RP2040 Zero. I want to ensure that my device never enters safe mode.
Whatever is consistent for your pin names elsewhere (MicroPython, Arduino, board silk, etc.) is OK with us.
I want to ensure that my device never enters safe mode.
There are software and hardware failures that will trigger safe mode. Without that there may be a loop of continuous errors. You could turn that off by modifying the safe mode code.
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
I agree we could have a better message:
"not provided on this board"
"no room in firmware"
"not implemented on this port"
etc.
I will change the title of this issue.
@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 ...
Although I use SPICE for simulation and when I am cooking, I have no problem reverting to SPICE naming again to make all spice boys and girls happy. Just let me know.
[adafruit/circuitpython] New comment on issue #9762: TTGO T8 V1.7 ESP32 board lacks PSRAM management
I added support for this board, but I am not sure how to add support for that. Any idea?
<@&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.
There are software and hardware failures that will trigger safe mode.
Is there a way to trigger safe mode by connecting certain pins on the board if the board doesn't have a button to boot into safe mode?
There are software and hardware failures that will trigger safe mode.
Is there a way to trigger safe mode by connecting certain pins on the board if the board doesn't have a button to boot into safe mode?
On RP2, no.
On ESP32, ESP32-SX, yes by using pin IO0.
On ESP32-CX, ESP32-HX, yes by using pin IO9.
On nRF and SAMD, by using a double reset.
[two builds overflowed, looks like]
[adafruit/circuitpython-org] New comment on issue #1528: Boards/Blinka without Download Instructions
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...
@ladyada
This is the rest of the Adafruit devices that I found install instructions guide pages for.
A few I could not find a page for:
- edgebadge, it could link to pybadge but then it will link to a firmware with different name, though it would still work I think
- pirkey, has guide with pages about using circuitpython but not installing.
<@&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!
Google Docs
CircuitPython Weekly Meeting for Tuesday, November 12, 2024 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 ...
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...
@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.
I'm not sure exactly what you need to do. If you mess with the reset line at the top of boot.py with a DigitalInOut, is that too late?
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()
did you try I2C at 400 kHz?
no, that would be too obvious 🤦♂️
Links all look good. I'll see if I can find some of the leftover ones, or at least something that could work in their place. Then we can add some of the non-Adafruit ones that we can find instructions without too much trouble.
- 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.
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...
Home. PeMi Technology - Factory For Materializing Dreams
#pyprca python calculator is back with same dimensions as #picomputer and new #pycoboy (#picopad clone)
This can use same side and bottom boards.
All toys can #Armachat, #circuitpython, Picomputer S3 new #meshtastic UI
Emulator #ZXspectrum, #C64, #atari800
https://t.co/O1M6wtoMGC

Thanks for hosting Liz, have a great week everyone!
The "State of..." stats seem to miss some reviews. Or, perhaps they intentionally only pull the final or approving review?
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.
the second case fits, but not the first... I'll comment again if it happens again outside of those
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.
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
Google Docs
CircuitPython Weekly Meeting for November 18, 2024 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...
I totally spaced on the meeting, sorry! @onyx hinge @candid sun
umm me too ?!
please ping us if you don't see us
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.
I saw the same thing and posted in Slack about this
learn folks say it is fixed now!
Thank you, confirmed another reload and it now shows me the real content.
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:
...
A few more to follow up on comments from #1529
ty @makermelissa for the cpx + displayio link.
I've added the EdgeBadge firmware button as an option on the pybadge learn guide page as well and added a link to that for the edgebadge file here.
Just stumbled across this while stuck in some other weeds....
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
Resolves an issue reported on discord by @dglaude. #circuitpython-dev message
Updates the nrf bootloader version to match the latest one linked in the guide pages about updating bootloader.
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...
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
It's also possible to feed data from rp2pio into an audiocore.RawSample buffer when double-buffering is enabled using the background_read functionality. See the "effect" example in the library I shared earlier for a demonstration of this: https://github.com/relic-se/CircuitPython_I2SInOut/blob/master/examples/i2sinout_effect.py.
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...
answered in issue
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...
Updated links to purchase and GitHub code, corrected # of LEDs
@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.
There is a PR for the board underway! https://github.com/adafruit/circuitpython/pull/9803.
That particular board was out of stock but I have the RP2350 board with the SP/CE connector and the corresponding CYW breakout on order from Pimoroni and expect it to arrive shortly.
RPi has publicly suggested in the past that Pico 2 W would arraive this month.
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', ...
9803 is for the Pico Plus 2. I think we need one for the Pico Plus 2 W as well, so I'll open an issue. I've also got RM2 modules in transit as well as a couple of Pico Plus 2 W boards.
Use D12 instead of IO12. It's the same thing on this board. I'll make a note to fix the pinout diagram and/or add pin aliases.
oops, you're right. It was out of stock when I ordered.
CP supports the Pimoroni Pico Plus 2 board but lacks support for the new W variant. The Pico Plus 2 W includes a Raspberry Pi RM2 adding WiFi and Bluetooth capabilities that should be compatible with Infineon CYW43439 on the Raspberry Pi Pico W boards.
I'll claim this issue and will submit a pull request as soon as my test board arrives.
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.
The preferred pin name is the first one, in order, in pins.c for board. If it isn't there, then the microcontroller.pin name is used.
e.g. for CLUE:
{ MP_ROM_QSTR(MP_QSTR_P0), MP_ROM_PTR(&pin_P0_04) },
{ MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_P0_04) },
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P0_04) },
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P0_04) },
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.
I was just making a build to see if that order was what determined it.
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 ...
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.
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.
Therer are a lot of Learn Guides with CLUE code too, not sure if there's consistency about what they use. But it's certainly less work to change the code examples than all the diagrams, etc.
The RM2 module incorporates the same mux'ing of its DI, DO, and IRQ pins as the Pico Plus 2 W so building a CP board port for a Pico Plus 2 board with the module SP/CE attached should be straightforward.
Of course that approach leads to a proliferation of board ports, so some means of separately supporting RM2 might be a good thing.
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.
The latest commits update the new code to work under the unix port and add an initial very basic test of the intersection functionality. I've also disabled vectorio on a few more devices which overflowed the build since the previous time I worked on this.
I'm sure I'm oversimplifying several things, but bitbangio works with these pins (even ssl), so it seems like if PIO could make the pins look like SPI, the existing driver should work?
I think the q would be the SPI speed for bitbangio.
Yes, I was mainly suggesting PIO SPI as a possible transparent alternate to SPI (or bitbangio SPI), not sure if that's possible.
BTW, I have these boards and could do some speed comparisons, but could use direction on code (and URL or what to serve) to test effectively.
I don't have time to look at this in detail at the moment, but here's what I was thinking of:
- 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. - 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...
Re: #1, I get as far as AttributeError: 'StateMachine' object has no attribute 'try_lock' when trying the PIO SPI with the existing driver on the W55RP20, which I interpret to mean that the PIO SPI implementation could possibly be beefed up to be compatible enough for the existing driver.
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 withrp2pioI'm going to see what can be done as far as unification. For example, suppose that an 8-channel ADC could present as 8 monorawsample-like objects or 4 stereo objects, etc., and that an 8-channel DAC could present as...
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
I've moved the secondary-mode behavior to a new spitarget module and fixed the naming, see https://github.com/Bruin-Spacecraft-Group/bruinspace-circuitpython/tree/main/shared-bindings/spitarget
I had to do some other stuff for a few
I think this can be merged. If anything comes up, it should be straightforward to PR.
I already have (two) of these boards. If I can help in any way, just let me know.
Thanks @py7hon and @andibing!
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
Thanks to @anecdata for pointing to https://github.com/micropython/micropython/pull/16057 where a similar Micropython port is underway. Making a first pass through the PR and the changes it makes I can see that RP2350/RM2 changes depend on SDK changes to its develop branch. Likewise, cyw43-driver module will also need an update.
It's probably wise to wait for this PR to shake out.
I'm seeing 71ºC on several Waveshare ESP32-S3-Zero boards, running wifi only. I've tried lowering the CPU speed to 80000000, but I see no change in temperature. Very small boards.
@stanelie as described above, the board itself does not provide much of a heatsink. You could add a heatsink if you are worried. There is not anything "wrong" -- the chip is consuming a noticeable amount of current which must be dissipated somehow. The recommended chip temperature is –40 to 105 C, so it's not outside the spec.
I went through all the board without tutorial links and checked if I could find them in under 30 seconds or so and added them if I could find them.
Looks good to me. Thanks for adding all of these and doing that cleanup to the other bits!
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
Won't the regular python unittest work? https://docs.python.org/3/library/unittest.html
Python documentation
Source code: Lib/unittest/init.py(If you are already familiar with the basic concepts of testing, you might want to skip to the list of assert methods.) The unittest unit testing framework was ...
thanks! is there an example of using that with CircuitPython libraries?
you probably want to run the tests with regular python and mock all the hardware calls anyways
That's what I'm doing. Running the unit tests on my local machine with regular python.
yes this is the plan. But I'm going to be putting this library in the bundle and I want it to be installable like normal without any issues
well, unittest is in python's standard library
so just create a "tests" directory in the library directory and circup will ignore it?
I'm not that familiar with circup
basically 'pip' for CircuitPython https://learn.adafruit.com/keep-your-circuitpython-libraries-on-devices-up-to-date-with-circup/
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
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!
- Fixes #9809.
Tested with test mentioned in #9809.
@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
thanks. And pylint is out and ruff is in? I don't know anything about ruff. or black? hard to keep up with all this stuff
Ruff combines elements of black, pylint and isort. Its also very fast
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)
I've been looking at that! It was the only one I found so far in the Community Bundle. Thank you!
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/)
right. thanks
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
was this it? i dont recall tbh: https://github.com/pfalcon/pycopy-lib/blob/master/unittest/unittest.py
edit: discord search tool... i should've used it sooner: https://github.com/mytechnotalent/CircuitPython_Unittest
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?
We didn't necessarily do anything to solve it so all of those warnings do still show I believe. I think they may only show once perhaps, if you run pre-commit again after it's passing they aren't printed any more iirc.
Yeah, I was about to edit, that I only see them now when doing ruff format *.py --force-exclude. Is ruff more lenient than black? my library is currently a stub with no docstrings and it's passing.
I'm not sure on all of the specifics, it's probably more lenient in some ways, but perhaps a bit less in others. It's a bit different because ruff covers things beyond formating, ruff also does linting and import order manipulation whereas black does strictly formatting and we used pylint alongside it for the linting.
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.
in my 20mins of using that seems to be the case to me too. I kinda hated black's pickiness but now I kinda miss its nagging me about documentation
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.
https://docs.astral.sh/ruff/rules/undocumented-public-function/ The Dnnn family of checks should fire on missing docstrings. maybe we're not enabling them? Only D19 seems to be enabled in this ruff.toml from my most recent library...
Checks for undocumented public function definitions.
check out the whole suite of rules: https://docs.astral.sh/ruff/rules/#pydocstyle-d
An extremely fast Python linter and code formatter, written in Rust.
oy. I like that they are categorized at least
(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...
@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.
Thank you so much for your help.
@anecdata 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?
(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...
I have a PR pending for the adafruit_ntp library that includes unit tests. The tests run on both cpython and circuitpython. In circuitpython it uses a separate circuitpython specific unittest library I found. Mocking in circuitpython is a bit of a challenge. Limited options.
Sadly, I have not had time to work on this. I'll leave the branch around but close the PR for now.
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.
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...
Heh, a bit off topic maybe;
I was hoping with adafruit's release of the esp32-c6 feather boards that we would finally get zigbee support in circuitpython
i feel like when you pre-order a game and get disapointed cuz hype lol, I got a couple of those boards hooping to work with zigbee out of the box, but still waiting lol
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...
ConnectionError is not a subclass of RuntimeError. So your original code in the first post, will not catch the ConnectionError raised inside connect_to_wifi().
try:
connect_to_wifi()
except RuntimeError as e:
Try:
try:
connect_to_wifi()
except ConnectionError as e:
Ah! Sorry, I'm a newbie. Thanks!!
@stanelie just fyi... connect() does a scan under the hood when it's trying to find the target SSID, and for many connection error types it will automatically retry several times before raising an exception to the user
Thanks for the info!
Is this documented somewhere? I'm not sure how to search for this type of info.
Thanks again!
It's kind of implementation minutae, may be different in the raspberry pi port, and I suppose low-level behavior could even change in a future version (the core wifi code relies on Espressif APIs). I typically check the code for details like that.
@lone axle argh 😕 https://github.com/adafruit/circuitpython-org/actions/runs/11853595634 failed in 6 hours
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.
I notice we've pinned a rather old PyGithub -- they're at v2.5.0 and we're requesting PyGithub==1.57
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.
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.
Copied parts from SparkFun Pro Micro RP2350 and Pico W. Tested on a board and all seems well.
Just checking -- This board has wifi with cyw43?
That's correct! I ran the basic WiFi test here and it worked fine.
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)
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;
}
yeah, I didn't really follow that
so in theory, RP2040 could bitbang SPI at 2.5MHz
in theory 🙂 I'd mesaure it
I'll put a logic analyzer on my holiday wish list 🙂
you could use FrequencyIn on another board and measure it
ooh, nice, thanks
it will be an average
dang, I don't have access to the pin, it's internal in the WIZnet W55RP20
well, I'll try some external throughput measurement
are you using bitbangio? I thought you would use their PIO SPI
I want to use the adafruit library, more full-featured, and hopefully the PIO gets migrated over
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
right, until PIO s integrated with the adafruit library
it's basic, just ping, udp, tcp
anything they do that we don't
they said they were having trouble, I wasn't sure why
I didn't see anything unique, more like a proof of concept with the basic network stack
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.
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
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
this is for a WIZnet W55RP20 board, uses an integrated RP2040+ethernet single chip ...no SPI possible due to internal pins used https://github.com/adafruit/circuitpython/issues/9747
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
in the code and library linked in the issue... https://github.com/WIZnet-ioNIC/WIZnet-ioNIC-Circuitpython/blob/677d1d3e8f9d1cf8a848806a372ae426daf74afc/example/loopback/UDP/udp.py#L19 (I'm complete newb on PIO, but the wiznet engineer is working on it, I just thought I'd see if I could get anything going)
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
my line 1284 is the first write:
1284 device.write((address >> 8).to_bytes(1, "big"))
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!
thanks, jepler, sorry got pulled away for a few... I'll work on digesting that, it makes sense conceptually
no worries on my part.
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 ...
Hi! I have a few style comments on the pins but overall this seems in good shape.
We prefer to group aliases of the same pin together:
{ MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO0) },
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO0) },
(the name that comes FIRST in this file is the one shown when printing the pin.
I don't have the Thing Plus RP2350 to check, but I compared to the Thing Plus RP2040 and saw there's no "D5" pin broken out.
In general, if a pin is not used, the corresponding entry in the board pins file will be omitted.
The SDK currently uses a default PIO clock divider of 2. Given the higher clock speed of the RP2350 consider increasing it to 3 to reduce the emulated gSPI clock frequency.
CFLAGS += -DCYW43_PIO_CLOCK_DIV_INT=3
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...
@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.
If it's not just upward-compatible, make a new library. We want to keep libraries relatively small, so adding a new class with all kinds of new things isn't so great. (For instance, if it gets frozen on a small board.)
Makes sense, will do. I'll base it off the existing one,, but this one will cover the LSM6DSVxxx series exclusively.
seems like "LSM6DS..." is becoming a very general name
Looking at the differences, I think ST decided to make some significant changes to the LSM6DS chips (and the related ISM and ASM IMUs in their iNEMO line). I can't say for sure, but it seems like they reworked things for the newer chips in the series.
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?
@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.
The situation remains that Adafruit is not prioritizing this work, but we would welcome implementation by the community. https://github.com/adafruit/circuitpython/issues/7454
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
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)
clean is a good tip. The build isn't exactly speedy, is it?
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.
good to know, thanks
the speed also varies greatly depending on the microcontroller family. espressif is one of the smaller ones overall.
(build time)
Heh, glad I'm not working on another then!
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!
Ha! No worries.
I appreciate this kind of help a lot!
I can figure out the specifics, but the high-level view is hard
Is there an appropriate printf call to put in the C code that will output to the Thonny console when testing python code?
I would expect something like "mp_printf" to exist, being the C implementation of the Python-level print
Yeah, seems like you can do just that
#circuitpython-dev message
Thanks, I'll try that!
Windows w/ Oracle virtual box + CircuitPython = BSOD
https://forums.adafruit.com/viewtopic.php?t=214825
is this one new? worth adding to welcome/troubleshooting guide?
@ZodiusInfuser @Gadgetoid Is Pimoroni in agreement that it should be SPICE? It have found only one use of that term on pimoroni.com, in the forums. We can also have an alias with SP_CE as part of the name.
In my testing, I did not experience any problems with the default clock divider of 2. The Pico SDK also uses the default for the Pico 2 W, which I would take to mean the default value is fine for the RP2350. Increasing the clock divider would come at the cost of lower transmit/receive speed, so would prefer to leave it as is unless there's compelling reason to change it.
There's some minor pinout differences between the boards, and GPIO 5 is now broken out. I've double checked that the pins in this file match the pins available to the user. The only pins that are not available are GPIO 8 for the PSRAM, and GPIO 23/24/25/29 for the radio.
Ah! I was unaware of that, good to know! Will get that updated, thanks!
I'm going to defer to @ZodiusInfuser on this one 👀
We can probably change the Pico SDK headers to SPCE without too much hassle since it's still early days.
Thanks for that .....
Go with SPCE like this PR already does. We'll (cough @Gadgetoid ) fix it in other places.
Thank you, the pin stuff looks good now. Thanks for the other clarifications as well.
As for the divisor issue, I do not see this setting being made in the pico2_w board specific files in the "develop" branch of pico-sdk:
https://github.com/raspberrypi/pico-sdk/blob/develop/src/boards/include/boards/pico2_w.h
i.e., they appear to be using the default divisor of 2 as well.
<@&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.
Google Docs
CircuitPython Weekly Meeting for November 18, 2024 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...
I can grab any of the state of circuitpython sections if you like @lone axle
Family is esp32s3, should be esp32. Caused a spurious "Update bootloader" section on the board page.
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...
The launch of the Raspberry Pi Pico 2 marks a significant upgrade from its predecessor, the Raspberry Pi Pico.
mmm popcorn 🙂
[I'm realizing circuitpython.org activity isn't reported in the State of CircuitPython section]
Congrats Jeff 🎉
A bunch of tiny fixes and improvements for the LILYGO T-Deck.
- Display power pulled high, not left floating.
- Pins reorganized, only exposing what is usable. (No pins renamed, BOOT pin added)
- Modules unusable on the board removed.
Along with these I have created a TinyUF2 port.
thanks @lone axle !
Thanks all! Have a great week!
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
Google Docs
CircuitPython Weekly Meeting for November 25, 2024 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates before the meeting, alphabetically by your username. During the meeting, we go through them in order. If you can’t make the meeting and wo...
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...
@ladyada ping for interest
Resolves: #1536
This changes makes it so that exact matches on tags will get higher priority in the resulting list of boards. It adds "pico 2" to the pico 2 tags so that it will appear as the first result for "pico 2" now.
@stanelie you can try deinit (or as a workaround reload or reset if that doesn't work):
https://docs.circuitpython.org/en/latest/shared-bindings/espnow/index.html#espnow.ESPNow.deinit
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.
…
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 we'll need to monitor https://github.com/pypi/warehouse/issues/17111
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.
OK I see it now, it's a dashes-vs-underscores
Yep, didn't catch that in the log the first time but underscores when it packs it and then dashes when it reports failing.
pypi sorta treats underscores and dashes the same, but maybe they're changing the rule.
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.
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
I don't think so either. intsalling reqs handled here AFAIK https://github.com/adafruit/workflows-circuitpython-libs/blob/main/release-pypi/action.yml#L34-L39
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`
@lone axle I re-ran the BME680 release actions and this time it passed.
Thank you!
@lone axle is the circuitpython.org search PR ready for review? I'll approve. Thanks!
Yes, I think so.
@lone axle woot!
we can notice other search terms we might add explicitly for some boards. Nothing comes to mind immediately
I seem to be still encountering this error on different hardware using 9.20: https://github.com/adafruit/Adafruit_CircuitPython_seesaw/issues/138
Apologies if that's not the same as using the ESP-IDF I2C Driver... that's still a bit over my head.
Is there more I need to do before this new board is merged?
I touched up some of the settings to remove redundancies. The details of this are in mpconfigport.mk
You can find out whether a certain option is set or not by doing:
make BOARD=yourboardname print-CIRCUITPY_WHATEVER
Not used if CIRCUITPY_ROTARYIO = 0
These are already on by default
duplicate line and already off for SAMD21
BTW, you can use Add Suggestion to Batch and then commit them all at once.
deinit works perfectly for my purpose. Thanks @anecdata !
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_...
However, I'm glad you were able to work around the problem with the use of deinit.
Actually, now that I think about it
ringbufis 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, theusedfield (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...
This high level discussion is way above my level, but if you do implement a fix, I will be ready to check if it works.
:)
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)
I tried I2C and some simple network tasks, and they all worked. Fine with me to merge now.
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 acurrent_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_thresholdthere needs to be some debouncing before you see an event. (Yes, I know the defaultdebounce _thresholdis 1.) And, if the keys are pressed you'd get pressed events.You kind of get the opposite after a
reset()call. (debounce_countergetsmemsettodebounce_threshold, so you get a bunch of release...
I think we have settled on the names. Thanks everyone.
Merging and we'll see whether there are complaints.
@FoamyGuy What are your thoughts about this for now? It does require turning off vectorio on a number of boards.
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?
This looks fine. I can't merge the pid.codes request, but we'll assume it will show up soon.
Awesome, thank you @dhalbert !
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.
@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.
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
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).
Where is the default filesystem that gets written onto the CIRCUITPY drive during flashing? I want to change it to write a small test program for the thing I'm working on
I can update locally with
make fetch-all-submodulesbut then how do I push the submodules?
You commit the changed commits for the submodules.
not sure what you mean by "where is"
you mean where is the code that creates it?
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.
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.
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?
you need to make it an object with a finaliser. In the constructor, call mp_obj_malloc_with_finaliser(), and in the locals_dict_table at the end, amek sure there's an MP_QSTR___del__ entry. See as an example shared-bindings/busio/I2C.c
Add STM32U083 support.
I can update locally with
make fetch-all-submodulesbut 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?
I update submodules using this alias (for convenience):
alias gitsubupdate='git submodule sync --quiet --recursive && git submodule update --init --filter=blob:none'
Yes, the Wiznet boards were very close to full. Let's turn off USB host on those two boards. Add this to mpconfigboard.mk for those two:
CIRCUITPY_USB_HOST = 0
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?
The circuitpython.org listing can in turn also be updated to indicate support.
Could you do this after the merge? That would be great!
BTW, do you actually have one of these (plain or Plus)?
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.
@onyx hinge I would like to do a 9.2.1 release: I think there are enough interesting fixes, plus the 2 W. Is there anything you want to finish before that? PR's I would rely on you to review are https://github.com/adafruit/circuitpython/pull/9819 and https://github.com/adafruit/circuitpython/pull/9659
I'll review those next
I don't know of anything, I'm in arduino floppsy world
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)
I have some review comments. Thanks you in advance for addressing them!
Please document loop2 in background_read
Please add loop2 to the documentation above.
it feels like the handling of "once buf and two loop bufs" could be factored out into shared code. However, I'm not asking you to do this right now.
should the assignment to ints be ints1 to match inte1?
Didn't test but I think I understand what the change intends to do. Thanks!
@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.
👍
should the assignment to
intsbeints1to matchinte1?
No doubt. Thanks for the review @jepler!
There is trailing whitespace on line 148 of StateMachine.c
@onyx hinge timchinowsky addressed the review very quickly; should I wait?
maybe you want to test
thanks, that addressed my requested changes.
@tulip sleet realistically I am not going to actually test that code today.
np
(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?)
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.
submodule skew is fixed
I think is safe to merge because it doesn't look like it would break rexisting p2pio even if there are some bugs in the new code
do you agree?
I think there's some small chance it could affect the single-buffered background write case. I should test that.
i can leave it out
Let me do a quick test just with an on-board neopixel & the background neopixel lib
I did a quick test of adafruit_neopxl8 which uses the old single buffered background write and it still functioned properly with Adafruit CircuitPython 9.2.0-38-g8d561a0b0e-dirty (this PR)
Thanks for letting me gather the strength to do that 😉
just testing the built in neopixel on rp2350:```py
import adafruit_neopxl8
import board
n = adafruit_neopxl8.NeoPxl8(board.NEOPIXEL, 1, num_strands=1)
n.fill(0)
n.fill(0xff00)
🙂 I appreciate your effort, and hope it wasn't too much of an interruption
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...
Automated website update for release 9.2.1 by Blinka.
New boards:
- 0xcb_gemini
- bradanlanestudio_coin_m0
- raspberry_pi_pico2_w
- sparkfun_thing_plus_rp2350
- wiznet_w5100s_evb_pico2
thanks Dan!
Thanks for the test @jepler!
CircuitPython version
Maybe this is simply a documentation problem(or I just cannot read), but how can I set the output mode of a pin I set to use as a PWM output with pwmio? How do I set a pull-up on it, or a pullpdown? How about setting the mode to push-pull or open drain?
Thanks!
Code/REPL
N/A
Behavior
N/A
Description
No response
Additional information
No response
I think you're right that this isn't possible at present, so I've marked this issue as an Enhancement.
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...
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
CircuitPython 9.2.1 released!
https://blog.adafruit.com/2024/11/20/circuitpython-9-2-1-released/
Highlights:
- Additional
synthioandaudiofiltersfunctionality. I2CTargetandkeys.*.reset()fixes.- RP2350: PSRAM and
cpu.temperaturefixes. rp2pio: add background read operation.- Five new boards.
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...
There are already two boards with STM32H7 chips that we support: nucleo_h743zi_2 and openmv_h7.
types-circuitpython is not our pypi package. It's somebody else's: https://github.com/hardfury-labs/types-circuitpython.
Are we talking about https://pypi.org/project/circuitpython-stubs/ ? That is up to date.
The performance of STM32H7R7/S7 is interesting.
I'm going to close this now, since it seems like you're flexible about which chip to choose. There are many other chips we support as well, with varying levels of performance, besides STM32, if those are of interest.
I have a working version here: https://github.com/bablokb/circuitpython/tree/pico_plus2w
Still needs some updates on the USB_VID/USB_PID stuff. But I verified that basic STA operation is working fine.
@ZodiusInfuser: do you already have these values? And please also check the board name: I currently have #define MICROPY_HW_BOARD_NAME "Pimoroni Pico Plus 2 W
@bablokb I do not, but I have just put a request in for it, and our other recent boards too. Pimoroni Pico Plus 2 W is correct
@ZodiusInfuser: thanks, that was fast!
I updated my tree.
@eightycc : you claimed this issue, will you create the PR or should I just go ahead?
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.
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...
I'm very excited to see this in 9.2.1. Good job everyone! 🎉
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.
See https://forums.adafruit.com/viewtopic.php?t=215000 for motivation.
Currently, if pull=True when creating a PinAlarm, the pull chosen is the opposite from the value argument. From the doc:
pull (bool) – Enable a pull-up or pull-down which pulls the pin to the level opposite that of
value. For instance, ifvalueis set t...
[adafruit/circuitpython] New comment on issue #9762: TTGO T8 V1.7 ESP32 board lacks PSRAM management
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:
...
seems to work fine
]0;🐍192.168.1.55 | BLE:Off | REPL | 9.2.1-dirty\
Adafruit CircuitPython 9.2.1-dirty on 2024-11-23; Espressif ESP32 TTGO T8 v1.7 with ESP32
>>> import gc
>>> gc.mem_free()
4067840
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 '...
[adafruit/circuitpython] New comment on issue #9762: TTGO T8 V1.7 ESP32 board lacks PSRAM management
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...
[adafruit/circuitpython] New comment on issue #9762: TTGO T8 V1.7 ESP32 board lacks PSRAM management
Did you do make clean BOARD=ttgo_t8_v1_7 before redoing the build, after adding those lines? It looks like the sdkconfig is inconsistent with other settings.
Or, the esp-idf submodule is out of date. Try updating the usbmodules. I use this alias:
alias gitsubupdate='git submodule sync --quiet --recursive && git submodule update --init --filter=blob:none'
[adafruit/circuitpython] New comment on issue #9762: TTGO T8 V1.7 ESP32 board lacks PSRAM management
After a few unsuccessful attempts I deleted everything and started from scratch and same thing. BTW It would help if the sequence of commands to compile the espressif modules where one after the other, otherwise one needs to go fishing around
[adafruit/circuitpython] New comment on issue #9762: TTGO T8 V1.7 ESP32 board lacks PSRAM management
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...
[adafruit/circuitpython] New comment on issue #9762: TTGO T8 V1.7 ESP32 board lacks PSRAM management
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...
Implement support for Pimoroni Pico Plus 2W board vid=0x2E8A pid=0x10bd. Resolves #9808.
Tested with code from "Quick-Start the Pico W WiFi with CircuitPython".
@bablokb would you like to review and test? I don't have the actual board.
@bablokb Sorry about that. My boards arrived today so I tested and made a PR without first reading your updates.
I explicitly set the PIO clock divider to 2 (also the SDK default) with a note to increase it if the gSPI connection to the RM2 becomes unstable. I don't think it will.
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...
[adafruit/circuitpython] New comment on issue #9762: TTGO T8 V1.7 ESP32 board lacks PSRAM management
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
Seek to add support for STM32N6,Because it's coming out soon
@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 usedpimoroni_pico_plus2_wto be consistent withraspberry_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...
Pico SDK 2.0.0 hard codes the pin numbers used for the CYW43439 gSPI interface, so changing CYW43_PIN_WL_... will have no effect. The devolop branch of the SDK corrects this.
Are there boards that need the pin numbers to be changed? Or can we wait for the pico-sdk changes to be put in a release? We can move up the submodule commit if necessary.
@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.
@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.
I'd suggest looking for uses of port_malloc, which allocates outside the gc'd heap. usb_hid uses this to allocate HID descriptor stuff that lives between VM's, as do various display things, usb_midi (for names, I think), etc.
Support for Pimoroni Pico Plus 2W. Complements adafruit/circuitpython#9826.
This fixed that issue!
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
Oh no, the bytes are different.
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.
@native sandal it's not specifically called out there, but you need to run make translate in the top directory.
Okay. So that ran without issue, but it didn't change anything. Still get:
Missing message id. Please run `make translate` and then `git commit locale/circuitpython.pot`
{'bit_depth must be 8, 16, 24, or 32.'}
That's an error message I added by copy/pasting an example i saw elsewhere. Do I need to do something elsehwere?
I'm not sure why you would get that message still, it's exactly what "make translate" is supposed to fix.
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
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
eh, this is a newer version than is in Ubuntu 24.04. I'm on 0.21. If you can install 0.21 via homebrew try that
That seems to have fixed it. Not sure why a deprecated (but still exisiting?) feature causes it to not work; or is it the warning output?
I think there may be two issues here. The references to tinydir.h are this code:
#ifdef _UNICODE
if (drive_buf[0] == L'\xFEFE')
drive_buf[0] = '\0';
if (dir_name_buf[0] == L'\xFEFE')
dir_name_buf[0] = '\0';
#endif
it (xgettext?) is not liking L'\xFEFE'
the deprecation may be unrelated to that
ah right, that makes sense
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
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...
I opened a tentative PR for the work I've done so far. It works in the most basic sense but is otherwise untested.
I tested the artifact and it works without problems. Tested as STA and as AP+webserver serving multiple streams in parallel. Network performance seems to be limited by the Infineon-chip - I see the same throughput as with the Pico-W.
But as soon as it comes to processing the requested data, you can see the difference.
So from my side, you can go ahead and merge.
https://github.com/raspberrypi/pico-sdk/releases/tag/2.1.0
More support in various places for pin numbers >= 32. Various fixes.
@dhalbert I can take this one on.
new rev uses RP2350B instead of RP2350A
@bablokb I'd like to know more about the network performance limitations you're seeing using the CYW43 part.
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
Google Docs
CircuitPython Weekly Meeting for November 25, 2024 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates before the meeting, alphabetically by your username. During the meeting, we go through them in order. If you can’t make the meeting and wo...
You are correct, I was referring to the incorrect package. In that case there isn't any issue, sorry!
👋
Running for over a month without any issues, so I would consider this resolved.
Nice catch. I've added "USB-C" to the features section.
@EAGrahamJr Thank you for the followup!
Other folks have also run into the "too much power" issue when small chip antennas in limited space are used. Lowering power really helps, and we've tried to make the default tx_power for various boards take this into account.
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...
This might be done by a revamp of Pin to include persistent settings that could be changed before a pin is claimed for a *io use.
🎉
1000
Thanks for hosting Jeff, have a great week everyone!
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
agreed
@tulip sleet I'm back at my desk
one sec
Update Raspberry Pi Pico SDK to 2.1.0. Update cyw43-driver submodule to CF924BB to match SDK included version.
Changes add a few newly required include paths. Also adds hardware_xip_cache/xip_cache.c.
Resolves #9829.
Boots, doesn't catch fire. I'm making this a draft pull just in case anyone cares to take it out for a spin.
Update the LILYGO T-Deck page to indicate support for it's plus variant.
The image now features the Plus on the left view.
I'm writing a driver for the IT8951 to support the epaper display on the M5Paper. Should I PR it to Adafruit_CircuitPython_EPD?
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
Google Docs
CircuitPython Weekly Meeting for December 2, 2024 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates before the meeting, alphabetically by your username. During the meeting, we go through them in order. If you can’t make the meeting and woul...
If you like. That library isn't the more common displayio support though
@Brandon-Hurst Do you want a review on this? I'm back from paternity leave for the time being.
It should be ready as far as all the requested changes and I've tested it pretty thoroughly. I had to rebase to fix the last CI check on the readthedocs task, and now it shows hundreds of commits so that may need to be fixed first 😅 sorry about that.
i messed this up but better to merge and then ill fix it when i reroute
@wren6991 any tips for how we can get 800x480 going from HSTX? I think you got it working.
This looks good to me! Happy to have it tested via "Absolute Newest". If we're worried we could do a 9.3.0 pre-release with it too.
Merging since it works! Thank you!
I was looking at it since it was linked in the original M5Paper PR, and the IT8951 is an EPD with SRAM as the repo describes itself, but looking at the code it seems specific to adafruit breakouts. Happy to do whatever you'd recommend. Separate library with displayio compatibility?
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?
The PR got approved; I've updated the submodule reference to point to the merge commit that just got made
@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...
The current build environment on Github codespaces provides CMAKE in a version that is too old. At least for the new Pico-SDK.
This PR updates the build-scripts to automatically install a newer version.
@bablokb The network performance issue you're experiencing seems to be severe. I'd expect the time to load to be in milliseconds. Would you open an issue so that we can track it? I suspect there's something broken in the way that IRQs from the CYW43 are handled.
@tannewt SDK 2.1.0 is where we'll have to live for full RP2350B support, so I don't see any reason to delay stepping up to it past the 9.2.x timeline. I'd like to hold off merging for a day or two to give me a chance to test WiFi on a couple of RP2040 and RP2350 boards.
Yup. It works for the class of displays we support. Maybe it won’t for the one you are looking at.
I will do that as soon as I uploaded the test-case. I tested with the Adafruit Feather ESP32-S3 (4MB/2MB version), and using this device I am in the range of 1s (I think milliseconds are a bit over-optimistic).
I'll mark this ready for review once I've done some more testing & have a corresponding pull in to adafruit-circuitpython-floppy that works with floppsy rev b.
This looks good to me! Happy to have it tested via "Absolute Newest". If we're worried we could do a 9.3.0 pre-release with it too.
ping @ladyada for interest
Re-based to pick up pimoroni_pico_plus2w board. Tested WifFi with this board, an RP2350B with an RM2 on the board. Ready for review.
Should this issue be moved to the core perhaps? https://github.com/adafruit/Adafruit_CircuitPython_AD569x/issues/3
Or maybe it's ultimately the same as https://github.com/adafruit/circuitpython/issues/9535
I tested under the latest release on an S3 and found that the error message is slightly changed but it seems this device has some incompatibility with I2C on S3.
Great! Thanks for the update!
@ladyada
@tannewt nomenclature copied from previous Metro RP2040 and Feather RP2350 boards
can merge now and ill test when hardware arrives
[adafruit/circuitpython] New branch created: anecdata-patch-1
Correct the USB_PRODUCT and USB_MANUFACTURER (thanks, @Xarnlen)
@wmerkens Could you review and confirm this corrects the discrepancy you saw?
The usb_hid documentation was missing a crucial comma in an example, and also needed some more explication.
@dhalbert You are good to go, the changes worked.
[adafruit/circuitpython] New comment on pull request #9836: update usb_hid boot device documentation
I canceled the rest of the builds because the doc build worked, which is all I needed to know.
Code looks reasonable to me. I saw keep going. :-) Thanks!
Two small things. I'm excited to get this merged in!
Did you get the status LED working? It should replace this code.
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?
As described in title, three minor corrections in CircuitPython_Cheatsheet.md .
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...
Added support for the ESP32S3 based EPD device from Heltec.
Bob’s cobble for this morning. Needed BLE sniffing on a long cord!
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
Yep! Removed this code in the latest commit.
Not sure where I grabbed this from, must've conflated the board requirements with tinyusb. Removed for both 'apard32690' and 'max32690evkit' board targets in the latest commit.
Nothing is impossible. You may need to change the internals though.
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...
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?
that'd be Adafruit_Circuitpython_EPD? Does it share any API/library compatibility with displayio?
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...
Here is an example write:
The trickiest bit may be toggling CS between the command and write data packets.
This is the command you'd use to load data:
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 ano...
no, it doesn't
I'd stick with displayio
Ok. I'll see what it'd take to insert multi-byte command preambles
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?
I'd say start by modifying the existing class and see how much you change.
@wanton dirge why does each board have the systick interrupt?
@bablokb, you could do that for your patch as well.
I think we discussed this and the decided against doing it. We would have to change many existing board files to add this additional parameter only to support an obscure hardware-implementation. And my displays aren't e-paper, so the kwarg would go to BusDisplay which is used much more often in the code-base.
I should probably move this to supervisor/port.c. Initially I think I put it here before I had figured out how to drive the supervisor ticks (via RTC or SysTick) and so I was being cautious.
I will do that and test real quick.
I don't think you need the pin definitions at the board.c level either
basically, I'd expect board.c to be empty 🙂
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 😂
ya, it is weird to be very dynamic
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.
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?
See this post: https://forums.raspberrypi.com/viewtopic.php?t=339512
They claim using iperf they see
near 10 Mbits/sec at data size greater than 1 MByte
But this is with the Pico-W running as a client and it is a huge data size for an MCU, so this is not realistic in any way.
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.
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.
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
Understood 👍 I'll move that out then. Thanks for the help guys 🙂
thanks!
Okay, board.c should be cleaned up now.
Looks great! Thanks for working on this!
neopixel, display, i2c, floppy & sd all working
@slender iron The stuff I'm doing toward circuitpython compatibility is in this branch: https://github.com/adafruit/CircuitMatter/tree/circuitpython.
ecdsa.derneeded functions replaced bycm_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.pythat 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.
I'm distracted getting USB going on the P4
sounds good!
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?
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
I think https://github.com/adafruit/Adafruit_CircuitPython_Display_Shapes/issues/77 is another manifestation of this issue.
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.
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?
I found a comment that is talking about the relative point for rotation here: https://github.com/adafruit/circuitpython/blob/main/shared-module/vectorio/VectorShape.c#L324 but I don't fully understand it. And the function here where it seems to deal with the transpose https://github.com/adafruit/circuitpython/blob/main/shared-module/vectorio/VectorShape.c#L127. I'll have to study the code futher and try to turn on the log messages in there to get a better understanding of what is going on.
I thought within displayio most rotation of the whole display is in the hardware chip itself. Some boards (funhouse?) are actually rotated by default
@onyx hinge want to do additional mdns stuff for circuitmatter in CP?
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.
I don't think we support subtypes https://github.com/adafruit/CircuitMatter/blob/main/circuitmatter/utility/mdns/avahi.py
👍
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...
https://github.com/adafruit/circuitpython/issues/9630 would be another quick-ish one, probably