#circuitpython-dev

1 messages ยท Page 41 of 1

manic glacierBOT
manic glacierBOT
small comet
#

qq around the type annotation topic (with apologies if I overlooked some documentation) - is there a CI config one can enable to pre-commit/check for missing type annotations once they've been added? (I've been running mypy by hand, but looking for a more standardized config if such a thing already exists)

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0 on 2023-05-22; TinyS2 with ESP32S2
Board ID:unexpectedmaker_tinys2
UID:4D9FD807FEC4

Code/REPL

import board
import pwmio
import supervisor
import analogbufio
import array

rate = 83333

# Define names for In and Out pins
print("Rate =", rate)

Vin2 = analogbufio.BufferedIn(board.A2, sample_rate=rate)
Vin3 = analogbufio.BufferedIn(board.A4, sample_rate=rate)
Vin4 = analogbufio.BufferedIn(board....
lone axle
# small comet qq around the type annotation topic (with apologies if I overlooked some documen...

running mypy by hand is the only way right now really. Once we finish up the remaining library types I imagine at some point we'll add the check to pre-commit or actions somehow. There was this one: https://github.com/adafruit/Adafruit_CircuitPython_PIOASM/pull/51 which is one way that it could be integrated. You could carryout similar changes in your local instance while your working so you could test slighly less manually. But in the actual repos I think we won't want to enable the automated check until we are ready to do it on all of the libraries accross the board, so that we don't end up with some libraries using different checks than other ones.

manic glacierBOT
small comet
lone axle
# small comet Makes sense - a couple of quick follow-ups: can I find a set of options for mypy...

The command that was used to generate all of the initial issues can be found here: https://github.com/FoamyGuy/missing_type_issue_maker/blob/06cd8949061a812ff7648d5c020b7577eb9d5667/find_missing_type_annotations.py#L8 it was essentially mypy [path to lib] --disallow-untyped-defs And for the initial pass we only went after lines that mypy reported "Function is missing a type annotation" on. Those would have been the ones that appeared within the list in the issue. That is probably as close as we have atm to a canonical configuration. We'll probably take some time during a meeting one week when we're ready to enable it more widely to discuss what configuration options we want to use and how strictly we will enforce mypy's preference.

I'm not sure if I understand you're second question. If you mean would it have been possible for the libraries to get changed in a way that created new code that now needs to be typed in order to satisfy mypy, even when that code didn't exist at the time we ran the check initially. I do think that's possible and likely something we'll have to work through when we "flip the switch" The goal before that is to get the vast majority of the "low hanging fruit" taken care of before that switch flips so that we lessen how much additional work will be needed once the checks do actually begin.

small comet
# lone axle The command that was used to generate all of the initial issues can be found her...

perfect - thx for the pointer to the script!

Re: second question - gotcha. I'm realizing I'm probably confused about the mechanics ๐Ÿ™‚ at a high-level, when the flip is made would all repos get a new stanza in .pre-commit-config.yaml pointing to a common workflow with the shared options? Or would the shared options be copied into each stanza directly? The comon standard makes perfect sense; and I was sort of wondering if it might be also be achievable incrementally (aka, one repo at a time, but adhering to the same standard.)

lone axle
# small comet perfect - thx for the pointer to the script! Re: second question - gotcha. I'm ...

I don't think we have the full plan nailed down yet, and I'll admit that actions / pre-commit is not an area of strength in my knowledge. That being said I do think adding a new section to the pre-commit-config.yaml that points to a common workflow would be what we do. Or maybe we have that mechanism in place already, so we'd be adding it into that already existing actions task repo (these are the specifics I don't quite know about).

It would be technologically possible to do at different times, but I think the preference will be to do them all at once so that we keep a level of consistency across all libraries as best we can. Enabling it on individual repos as they're ready would mean that some libraries have different "rules" for PR submissions which would add complexity to reviews and could cause confusion among less technical contributors if it's unclear why one library PR is failing for a reason that they happen to know a different library PR passed on.

#

All of that being said, these are all great questions. And all I can say is my best guess. If you happen to ever be available on a Monday this would be a great topic for 'In the weeds' during the weekly meeting to get a wider discussion going involving the rest of the team as well.

small comet
#

Thx for the extra context, makes sense!

(Not easy to manage a large collection of open-source repos for sure, and kudos to all of you for making it work well ๐Ÿ™‚ )

onyx hinge
#

synthio has a different maximum polyphony depending on the board (because processing more notes takes more CPU time and does more RAM waveform accesses). The original implementation used 2, and I've increased it to 12 on various boards where that tested OK. CPU usage can be greater or lesser depending on the sample rate as well as whether advanced features are used (ring modulation, filters, and to a lesser extent math & lfo blocks).

With recent changes to docs generation we COULD include the information about polyphony in the docs automatically, rather than having an outdated sentence about it.

one problem is that the list can't replace the existing 'supported on these boards' block.

anyway, is this worth it?

manic glacierBOT
orchid basinBOT
tulip sleet
#

@slender iron @onyx hinge I have made draft release notes for 9.0.0-alpha.1. There is a PR I will merge soon to update the frozen libraries, and there are a few pending new board defs I might wait for.

onyx hinge
tulip sleet
#

ok, so there is an array def or something somewhere that depends on the value. I wasn't sure about that

onyx hinge
#

Yes that's right, I think there are 2 or 3 parallel arrays of that size in the synthesizer

#
shared-module/synthio/__init__.h:    mp_obj_t note_obj[CIRCUITPY_SYNTHIO_MAX_CHANNELS];
shared-module/synthio/__init__.h:    uint32_t accum[CIRCUITPY_SYNTHIO_MAX_CHANNELS];
shared-module/synthio/__init__.h:    uint32_t ring_accum[CIRCUITPY_SYNTHIO_MAX_CHANNELS];
shared-module/synthio/__init__.h:    synthio_envelope_state_t envelope_state[CIRCUITPY_SYNTHIO_MAX_CHANNELS];
#

and there are some things that do linear searches of all the note_obj[]s which might become a problem

onyx hinge
#

@tulip sleet I thought there were more PRs needing review by me but I just saw the one. If there are more, give me a ping

tulip sleet
onyx hinge
#

it sorta feels like fakessl belongs in esp32spi in some way but that'd be another incompatible change ๐Ÿ˜•

lone axle
# onyx hinge <@382939733107408897> hey, I filed https://github.com/adafruit/Adafruit_CircuitP...

I don't know for certain. I think the new way would look more like this:

socket = socketpool.SocketPool(wifi.radio)
https = requests.Session(socket, ssl.create_default_context())

but as far as I am aware ESP32SPI would still need the FakeSSLContext stuff in order to work.

Upon first consideration I would probably agree that FakeSSLContext probably makes more sense to exist in ESP32SPI as it's equivalent of the ssl core module for the devices that have it. Then it could be situated so the user code could be very similar, differing only in imports I think.

#

I would mean a breaking change for requests if we enforce the deprecation / removal of set_socket. But I think it's more positive overall because then the usercode for ESP32SPI and built-in wifi will be more similar.

#

I guess maybe user code could be structured that way today even without moving FakeSSLContext though now that I think about it a bit more. So perhaps that is actually a different thing apart from moving it. If ESP32SPI is the only thing that use the FakeSSL stuff (to my knowledge it is, but perhaps there is something I'm unaware of) then I do think it's more fitting over in ESP32SPI.

manic glacierBOT
onyx hinge
lone axle
# onyx hinge I'm not sure if/how wiznet does ssl

As far as I know it doesn't. All of the examples in that repo have http:// URLs specifically. I do think I tried it at one point, but it would have been a while ago, and I don't recall exactly how it behaves.

onyx hinge
#

hmmm

#

maybe it doesn't

slender iron
idle owl
#

Oooh hmm.

idle owl
#

mpy versions changing in the middle of an existing release seems like asking for support issues.

tulip sleet
#

IT would be nice to have a named release with the usb host and other new stuff in it

#

8.99.0-alpha.1

slender iron
#

we could do an 8.3.0 then

#

we haven't done the esp-idf upgrade or the mp merge yet

idle owl
#

Concur.

slender iron
#

but I'd also like to not distract from the mp merge

tulip sleet
#

The real reason I made release notes for an alpha is that I had to write up the summary lines for each 8.2.1 PR anyway.

#

so there is a lot of overlap between the x.x.x-alpha.1 and 8.2.1 release notes

#

I am about to finish the 8.2.1 release and didn't plan to do anything with the alpha release for several days, until we got more stuff merged. So we can cogitate and discuss this tomw or Monday.

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 8.2.1
manic glacierBOT
#

I'm not 100% sure that I set up to use the external flash correctly either. It matches other boards in the parameters used and the external flash file is looking for the parameters I used, but I'm not getting the full 16MB of space. It may just a FAT12 thing, but that should be able to get up to 16MB.

How much memory are you seeing?

Oh yeah, it's failing duplicate VID/PID now because of the 2 board defs for the same board.

You can exempt it here: https://github.com/adafruit/circu...

#

I'm not 100% sure that I set up to use the external flash correctly either. It matches other boards in the parameters used and the external flash file is looking for the parameters I used, but I'm not getting the full 16MB of space. It may just a FAT12 thing, but that should be able to get up to 16MB.

How much memory are you seeing?

5.9MB, which now that I think about it more, probably means it's using internal flash rather than external.

manic glacierBOT
thorny jay
# onyx hinge maybe it doesn't

That's what I remember and the reason I waited so long before getting two modules (a Feather and a generic one).
At one point I was thinking you could use your magic and play the trick you did for the Pico W SSL support... but except for the technical challenge, I don't see the interest for Adafruit.

manic glacierBOT
thorny jay
manic glacierBOT
manic glacierBOT
orchid basinBOT
lone sandalBOT
tulip sleet
#

Use 8.2.1 for the Adafruit MatrixPortal S3.

manic glacierBOT
spare jacinth
#

Any tag/recommendation for "mid-level" PRs/milestones i could help with?

Like, i dont want to cleanup or add type hints, but wont write the best code ever either

Im familiar with both py and C(not with the bindings between them but shouldnt be much trouble getting stuff to work i hope).

Available hw: RP2040, STM32H750 (is it supported?) and ESP32S3

slender iron
#

we have H743 support

spare jacinth
#

Will take a look, thx for the pointers

FWIW: i also have a few displays (will try and write a driver for STM's LTDC peripheral as soon as another screen arrives), and have been working on a TOML library lately, not sure if we want further func on getenv (supporting bools would be nice imo)

slender iron
#

I think bool values could be nice but not sure if getenv would actually give you them in CPython

#

40 pin RGB display support is definitely on our radar

#

so it'd be cool to support

spare jacinth
#

My radar is 27 i think

slender iron
#

we're not actively working on it though

spare jacinth
#

RGB888(24) + a couple control signals

slender iron
#

I think this is the same, just more control signals: https://www.adafruit.com/search?q=40+pin+display

spare jacinth
#

I also allow both TOML (true) and python syntax (True) - read: case insensitive - for bools. Again out of the spec but seems useful

Differences, if documented and/or for QoL, doesnt sound bad imo

manic glacierBOT
spare jacinth
#

But again, dunno how much of a compliant parser we want....

spare jacinth
# slender iron

I think thats the same i have bought, some extra pins for power and touch sensor

Will hopefully get something working at some point :p

manic glacierBOT
manic glacierBOT
midnight ember
#

In issues notes it says Espressif boards have ESP-IDF storage leaks and occasionally crash after extended WiFi use. What time frame is considered "extended use"? Weeks/Months? I've had my Adafruit ESP32-S3 feather pulling weather data from openweathermaps & local sensors then pushing it to adafruitIO via MQTT for weeks at a time without issue. Most I've run it (according to monotonic) is for 2.5 weeks before coming back to it for some more coding. It sits on my workbench running 24/7 updating every 15 minutes. I've not had a single issue with it since about CP 8.0 beta 3.

manic glacierBOT
manic glacierBOT
crimson ferry
# midnight ember In issues notes it says `Espressif boards have ESP-IDF storage leaks and occasio...

Yeah, if I do requests only, ESP projects will run virtually forever (though I do occasionally reload or reset in software if certain conditions arise). Several have been running since some time in 2022 (still on CP7). But I get spontaneous resets or hard faults on some projects where AP or HTTP Server or other wifi or socket stuff is thrown into the mix. More specialized issues with ESP-Now frequently resetting, or monitor init hard faults are probably separate issues.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0-beta.2 on 2023-04-26; ESP32-S3-Box-2.5 with ESP32S3

Code/REPL

# SPDX-FileCopyrightText: 2022 Paulus Schulinck
#
# SPDX-License-Identifier: MIT
##############################
# 2022-10-22. Last update: 2023-07-26
# by @PaulskPt
#
# touch test results on an Espressif ESP32-S3-BOX
#
#        319        X          0
#         |                    |
#      ---+--------------------+--- 0
#         |  ...
manic glacierBOT
proven garnet
#

@tulip sleet did you mean to tag me on the TT21100 issue?

#

I don't have a datasheet but suspect you meant to tag someone else most likely, unless I'm not understanding something.

#

I don't think I have the device either

tulip sleet
#

Scott wrote it

proven garnet
#

No worries! I just felt bad giving an entirely unhelpful answer of "no" ๐Ÿ˜…

manic glacierBOT
meager fog
#

@crude blaze y0000000000ooooooooooooooooo...............

crude blaze
#

@meager fog hey!

meager fog
#

@crude blaze if now is a good time i have some moments..

#

(ill turn on my scope...)

crude blaze
#

yea I got time for a good while!

meager fog
#

ok so i think i just dont have the right dto setup

#

i cloned/ran the example for the icn on the pi4

crude blaze
#

yea sounds likely, i2c worked fine via the Pi? Or did you ran it on the samd?

meager fog
#

i did have to run it twice due to a CRC error (?) but i dont think thats important

#
root@devpi:/home/pi/Adafruit_CircuitPython_ICN6211# python3 examples/icn6211_simpletest.py
0x00 = 0xc1
0x01 = 0x62
0x02 = 0x11
0x03 = 0xff
0x08 = 0x00
0x09 = 0x10
0x10 = 0x40
0x11 = 0x88
0x14 = 0x83
0x20 = 0x20
0x21 = 0xe0
0x22 = 0x13
0x23 = 0x28
0x24 = 0x28
0x25 = 0x28
0x26 = 0x00
0x27 = 0x0a
0x28 = 0x0a
0x29 = 0x0a
0x2a = 0x01
0x31 = 0x78
0x32 = 0x04
0x33 = 0xff
0x34 = 0x80
0x35 = 0x08
0x36 = 0x28
0x51 = 0x20
0x56 = 0x92
0x63 = 0xff
0x64 = 0x00
0x65 = 0x00
0x66 = 0x00
0x67 = 0x00
0x68 = 0x00
0x69 = 0x03
0x6a = 0x00
0x6b = 0x31
0x7a = 0x3e
0x7b = 0xff
0x7c = 0xf1
0x7d = 0x01
0x80 = 0x43
0x81 = 0x0f
0x84 = 0x94
0x85 = 0xc9
0x86 = 0x28
0x87 = 0x00
0x90 = 0x05
0x91 = 0x0a
0x92 = 0x18
0x94 = 0x0d
0x95 = 0x04
0x96 = 0x64
0x97 = 0x00
0x99 = 0x05
0x9a = 0x96
0xb5 = 0xa0
0xb6 = 0x20
SoT error
SoT sync error
False control error
ECC error, single-bit
ECC error, multi-bit
CRC error
DSI Data type Not Recognized
root@devpi:/home/pi/Adafruit_CircuitPython_ICN6211# python3 examples/icn6211_simpletest.py
0x00 = 0xc1
0x01 = 0x62
0x02 = 0x11
0x03 = 0xff
0x08 = 0x00
0x09 = 0x10
0x10 = 0x40
0x11 = 0x88
0x14 = 0x83
0x20 = 0x20
0x21 = 0xe0
0x22 = 0x13
0x23 = 0x28
0x24 = 0x28
0x25 = 0x28
0x26 = 0x00
0x27 = 0x0a
0x28 = 0x0a
0x29 = 0x0a
0x2a = 0x01
0x31 = 0x78
0x32 = 0x04
0x33 = 0xff
0x34 = 0x80
0x35 = 0x08
0x36 = 0x28
0x51 = 0x20
0x56 = 0x92
0x63 = 0xff
0x64 = 0x00
0x65 = 0x00
0x66 = 0x00
0x67 = 0x00
0x68 = 0x00
0x69 = 0x03
0x6a = 0x00
0x6b = 0x31
0x7a = 0x3e
0x7b = 0xff
0x7c = 0xf1
0x7d = 0x01
0x80 = 0x00
0x81 = 0x00
0x84 = 0x94
0x85 = 0xc9
0x86 = 0x28
0x87 = 0x00
0x90 = 0x05
0x91 = 0x0a
0x92 = 0x18
0x94 = 0x0d
0x95 = 0x04
0x96 = 0x64
0x97 = 0x00
0x99 = 0x05
0x9a = 0x96
0xb5 = 0xa0
0xb6 = 0x20
#

im running it on the pi, since the samd21 is low on ram, and i figured the pi is easier to tweak

crude blaze
#

yea for sure! I have not tested the lib at all on MCU CPY actually so far

crude blaze
#

the errors I imagine are likely due to lack of DSI signal

meager fog
#

oh hm

#

thi is the wiring

orchid basinBOT
meager fog
#

i have the icn wired to main i2c bus and i just tweaked the i2c bus instantiation in the example

crude blaze
#

lemme look up the boot flag that I used last time to debug the device tree stuff, that gave a whole lot more error logs in the syslog

meager fog
#

dsi is just a plain dsi cable

#

i didnt change any boot flags, i just added the compiled icn.dto you gave me

#
root@devpi:/home/pi/Adafruit_CircuitPython_ICN6211# cat /boot/config.txt
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
#dtparam=i2s=on
dtparam=spi=on

# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

# Automatically load overlays for detected cameras
start_x=1

# Automatically load overlays for detected DSI displays
#display_auto_detect=1

# Enable DRM VC4 V3D driver
#dtoverlay=vc4-kms-v3d
max_framebuffers=2

# Disable compensation for displays with overscan
disable_overscan=1

[cm4]
# Enable host mode on the 2711 built-in XHCI USB controller.
# This line should be removed if the legacy DWC2 controller is required
# (e.g. for USB device mode) or if USB support is not required.
otg_mode=1

[all]

[pi4]
#dtoverlay=vc4-fkms-v3d
# Run as fast as firmware / board allows
arm_boost=1
dtoverlay=vc4-kms-dsi-7inch


[all]
enable_uart=1
dtparam=i2c_arm_baudrate=100000
gpu_mem=128
#

e.g. removed #dtoverlay=vc4-fkms-v3d and added dtoverlay=vc4-kms-dsi-7inch

crude blaze
#

ah might be because the kms driver is not enabled, if you uncomment "#dtoverlay=vc4-kms-v3d" that might make it work already

meager fog
#

yeah i tried that but will do again

manic glacierBOT
meager fog
#
#dtoverlay=vc4-fkms-v3d
# Run as fast as firmware / board allows
arm_boost=1
dtoverlay=vc4-kms-dsi-7inch


[all]
enable_uart=1
dtparam=i2c_arm_baudrate=100000
gpu_mem=128

root@devpi:/home/pi/Adafruit_CircuitPython_ICN6211# nano /boot/config.txt
root@devpi:/home/pi/Adafruit_CircuitPython_ICN6211# tail /boot/config.txt
# Run as fast as firmware / board allows
arm_boost=1
dtoverlay=vc4-kms-dsi-7inch


[all]
enable_uart=1
dtparam=i2c_arm_baudrate=100000
gpu_mem=128
crude blaze
#

otherwise I had not tested the official 7inch overlay in a recent OS version, lemme see how that plays out on my end if I use that

meager fog
#

i probably am using the very latest

crude blaze
#

in /boot/cmdline.txt I added loglevel=6 drm.debug=0xfwhich enables error logs for DSI on syslog

meager fog
#

ok let me do that now

#

ill reboot now, should i be looking at uart console or can i just check dmesg

#

i have a headless pi4 i ssh into

crude blaze
#

should show up in dmesg

manic glacierBOT
meager fog
#

hmm

crude blaze
#

ok the official 7inch overlay doesn't work for me either, then maybe try the overlay I had attached in the zip, compile and copy instructions in the .sh file

meager fog
#

ok

#

thats dmesg

#

ill swap the dto

#

i did have compilation warnings...

#
ICN6211.dts:58.5-15: Warning (reg_format): /fragment@1/__overlay__/panel_disp1@0:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
ICN6211.dts:71.5-15: Warning (reg_format): /fragment@1/__overlay__/reg_bridge@0:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
ICN6211.dtbo: Warning (pci_device_reg): Failed prerequisite 'reg_format'
ICN6211.dtbo: Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
ICN6211.dtbo: Warning (simple_bus_reg): Failed prerequisite 'reg_format'
ICN6211.dtbo: Warning (i2c_bus_reg): Failed prerequisite 'reg_format'
ICN6211.dtbo: Warning (spi_bus_reg): Failed prerequisite 'reg_format'
ICN6211.dts:57.31-68.6: Warning (avoid_default_addr_size): /fragment@1/__overlay__/panel_disp1@0: Relying on default #address-cells value
ICN6211.dts:57.31-68.6: Warning (avoid_default_addr_size): /fragment@1/__overlay__/panel_disp1@0: Relying on default #size-cells value
ICN6211.dts:70.29-77.6: Warning (avoid_default_addr_size): /fragment@1/__overlay__/reg_bridge@0: Relying on default #address-cells value
ICN6211.dts:70.29-77.6: Warning (avoid_default_addr_size): /fragment@1/__overlay__/reg_bridge@0: Relying on default #size-cells value
ICN6211.dtbo: Warning (avoid_unnecessary_addr_size): Failed prerequisite 'avoid_default_addr_size'
ICN6211.dtbo: Warning (unique_unit_address): Failed prerequisite 'avoid_default_addr_size'
#
dtoverlay=vc4-fkms-v3d
# Run as fast as firmware / board allows
arm_boost=1
dtoverlay=ICN6211
crude blaze
tulip sleet
#

@crude blaze @ladyada could you start a thread, since there is a lot of text here?

#

thanks

manic glacierBOT
manic glacierBOT
cunning orchid
#

Waiting on an unexpected extra layer bureaucracy for my approval. Should I refer to the Milestones in GitHub for roadmap? Or is there a dedicated roadmap somewhere?

manic glacierBOT
#

I had to slim down a number of builds for this to fit. Are we entering the era of this for samd51 ? ๐Ÿ˜“

I think we need a plan for ulab since it keeps growing. Maybe we need to freeze versions for smaller MCUs. We basically do this by omitting newer python modules.

After looking at ulab for the synth filter stuff, if parts of the ulab python need to be omitted having someplace where people can find the omitted parts of the library would be helpful. I never realized that a lot of...

slender iron
#

we discuss it during the weekly meetings usually

#

we're just about to switch to 9.0.0 dev once the micropython merge bumps the mpy version number

#

we're going to update to esp-idf 5.0 then too

cunning orchid
#

Good stuff.

slender iron
#

Ok, not beauracy I can help with then. ๐Ÿ™‚

#

@cunning orchid any specific platforms or topics that interest you?

manic glacierBOT
cunning orchid
# slender iron <@478338815162056714> any specific platforms or topics that interest you?

I'm intending to dig into multicore support at some point but, think it will be better to start elsewhere. I've a few MCUs at my disposal (ESP32-S3, SAMD21, RP2040), and, an Arty Z7 FPGA (not well-versed in its configuration yet) so, should be able to test on a good chunk of archs.

Mainly, I'm looking to work on lower-level things as I've done a lot of Python and Go in my day jobs and really want to get closer to the hardware again and have been digging into communication protocol implementations, RISC-V, and FPGAs lately in my free time. Not ruling out porting Python code though.

manic glacierBOT
slender iron
#

I have a long term wish to support the zynqs.

#

I've also started a "I wish my SoC did X" wishlist

#

exposing the second RP2040 core for C code could be doable

stuck elbow
#

my list of "I should do it for circuitpython" things is now so long, that I just stopped adding to it

#

maybe when I'm retired...

slender iron
#

๐Ÿ˜„

cunning orchid
# slender iron exposing the second RP2040 core for C code could be doable

After previous discussions, I've been contemplating approaches that would be applicable to RP2040s and other multicore. Definitely think that running low-level code makes the most sense (ex. Reserve x memory space for inter-proc comms, reserve y memory space for CPU1 processing, and run this.binary on CPU1). Would be fun to have the type of binary fairly agnostic, as long as it's compiled for the correct arch.

stuck elbow
#

I would love to see displayio running on the second core

slender iron
stuck elbow
#

of course

devout jolt
#

even a very dumb mechanism that loaded a .bin on boot into the second core and provided a small amount of RAM "scribble space" to talk between C-core and CirPy could be useful for a huge number of applications

slender iron
#

that's essentially what dvi and usb host do. no need to do it at boot though

cunning orchid
#

That's exactly what I'm thinking. For safety, I think it makes most sense to have two dedicated regions (one for said "scribble space" and one as a dedicated communication buffer). Not sure that safety could or should be enforced for the primary proc though.

slender iron
#

the cpu does have an MPU you can use to crash instead of allowing a memory write

cunning orchid
#

Oooh. Interesting.

#

While graceful failure seems preferable in many cases, that could be a good route.

slender iron
#

dvi and usb host use it to prevent rogue flash reads

cunning orchid
#

If that's the case, I'll definitely dig further into that as reusing the established approach makes most sense.

manic glacierBOT
#

User reports:

With that image + original hardware config (four 64 x 32 RGB Matrixes) + original sketch... No artifacts from the S3 observed when "bit_depth=3". Problems still there when "bit_depth=4"

@PaintYourDragon Would it make sense / is it possible to make that timing parameter bit_depth dependent, or maybe it should be a user-supplied parameter?

xref to https://github.com/adafruit/Adafruit_Protomatter/commit/5f0b4...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Hardware/Version: RP2040 with circuitpython 8.2.1.

Assuming sm as a rp2pio.StateMachine it is possible to write a pio program with no in instruction and then read an internal state using a run command as sm.run(adafruit_pioasm.assemble("in x, 32")) to fill the buffer and then read the state with sm.readinto.

readinto will cause a RuntimeError: No in in program error if no in instruction was found in the original state machine code.
Adding an unreachable in instruct...

#

The motivation for this is a good one, an implementation of quadrature encoder that doesn't require the FIFO to be constantly monitored. https://github.com/jamon/pi-pico-pio-quadrature-encoder/blob/main/src/quadrature.pio

This will need to be optional, controlled by a new constructor argument because in general we still want to continue "join"ing the fifos when only one direction is used.

slender iron
#

FYI Iโ€™m off and on today because Ari is home with a rash

cunning orchid
#

@slender iron Kinda curious from yesterday's chat. What direction were you thinking for Zynq ports? Blinka? Bare metal on hardcores? RTOS on hardcores? Some sort of RISC-V softcore?

slender iron
#

risc-v softcore would be cool eventually too. orangecrabs (w/ecp5) are probably best for full soft soc

#

CP runs bare metal on raspberry pi's w/cortex-a already

rancid pilot
#

Is there a way to print messages to the REPL from common-hal code?

#

Also I think the documentation is wrong here (not sure where to share it): https://docs.circuitpython.org/en/latest/shared-bindings/canio/index.html
The example says:
can = canio.CAN(board.CAN_RX, board.CAN_TX
But based on common-hal coding and also the documentation down below says:
class canio.CAN(tx: microcontroller.Pin, rx: microcontroller.Pin,
So the RX and TX pins are wrong in the example. Took me a couple of hours to realize what was wrong.

spare jacinth
rancid pilot
#

thanks

tulip sleet
#

@onyx hinge does the MPy PIO impl also have a zillion arguments? or is more implied by the the "native" code?

onyx hinge
#

they're also spread out a bit differently it seems

tulip sleet
#

yah

onyx hinge
#

but for instance they omit the count of in/out/set pins in that signature, and leave it up to the coder to just make sure there's no error

#

it looks like there may be no fifo-joining, not sure

tulip sleet
#

i like our hand-holding better

meager fog
#

@crude blaze hihi im not sure if you're around again

crude blaze
#

@meager fog I am, currently editing some photos but have some time in a bit

manic glacierBOT
meager fog
#

@crude blaze np tag me when yr done! (if you wanna do another attack run)

manic glacierBOT
unreal wadi
unreal wadi
#

I have installed CircuitPython 8.2.1 and if I try this, it doesn't work:

spare jacinth
#

Did you compile/flash a fw with the feature enabled?

unreal wadi
#

No, just downloaded the "official" one. How do it do this?

spare jacinth
#

Dunno if the compiled is somewhere to be downloaded...

You could setup your machine to compile yourself, but that's trickier

#

Given it was merged on the main branch, i would expect the compiled to have this new code available

#

Did you download in the past few days?

unreal wadi
#

I downloaded it just now, but it seems not to be enabled. But I don't really know

spare jacinth
#

You can also look for images on the storage (S3 bucket) where adafruit stores them, no idea whether there will smthing there with that enabled

#

Command looks good to me, but not that im an expert

unreal wadi
#

I just installed this one here: adafruit-circuitpython-raspberry_pi_pico-en_US-20230728-75ba17e.uf2
There it seems to be enabled! Thanks for your support! ๐Ÿ––๐Ÿป

spare jacinth
#

Cool ๐Ÿค“

unreal wadi
manic glacierBOT
#

I made the neccessary changes however when I try to test using the following setup:
Teensy MicroMod board [RX, TX pins] <==> [RX, TX pins] TI SN65HVD230 CAN-bus transceiver module (3.3V) [CAN H, L pins] <==> [CAN H, L pins] MCP2515 CAN Bus Controller Module [SPI bus] <==> 5v to 3.3V logic level shifter <==> Adafruit QT Py
ESP32-S3 No PSRAM
it doesn't work with the following code examples:

MCP2525 side.
`from time import sleep
import board
from digitalio import DigitalInOut
from adaf...

unreal wadi
#

hm but seems not to work or I m doing

rancid pilot
#

Is it possible that I2S audio is broken on the Teensy MicroMod board?

tulip sleet
#

you could test I2S on a regular Teensy as well

rancid pilot
#

the wrong pin is listed in the pin config file

#

i think

#

so you cannot init the audiobusio ๐Ÿ˜ฆ

tulip sleet
#

i"d compare it with the equivalent regular Teensy. Are you able to make your own build to test? We would welcome a PR.

rancid pilot
#

I can build, and i can test. But i don't know how to make PRs.

tulip sleet
rancid pilot
#

This file is generated by a python script, so even if i'd edit the next python file update would just undo my changes?

#

python3 /home/qute/gen_peripherals_data.py /home/qute/mcux-soc-svd /home/qute/Downloads/ MIMXRT1062

#

this would overwrite it

onyx hinge
#

@rancid pilot @slender iron would know more but from what I recall, the chip maker does not permit distribution of the "svd files" that this script uses as input, which is why the results are committed instead of the original files.

tulip sleet
#

does the same error appear in the Teensy 4.0 or 4.1 pins.c file?

#

and if it's the same, does I2S not work on those boards?

#

I wonder if this is some kind of pin-mapping confusion on the micromod carrier board

onyx hinge
#

it is hard to tell from the screenshots @rancid pilot pasted (please use text when possible!) but I assumed the content they were talking about was in a file like ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/pins.c which would depend on the mcu chip, not a circuitpython board definition.

tulip sleet
#

i.e. look at all the 1062 boards

#

got it; the q would still apply about other 1062 boards.

#

if the base 1062 pin map is in error that would carry over

rancid pilot
#

I could test, I have all possible teensy boards, but I feel like I should just use smtg else that works ๐Ÿ˜ฆ

tulip sleet
#

well, I think it would be a quick test just to see if you could create an I2SOut on a Teensy 4.x using the same pins.

#

it sounds like the same issue would occur

onyx hinge
#

i.MX RT1060 Processor Reference Manual, Rev. 2, 12/2019 page 313 lists GPIO_AD_B1_14 as a possible alternative for SAI1_TX_BCLK and does not list GPIO_AD_B1_11.

#

and the generated periph.c seems to match this

tulip sleet
#

from the board pins.c:

    {MP_OBJ_NEW_QSTR(MP_QSTR_MM_I2S_CLK), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, // D21
onyx hinge
#

AD_B1_11 can be used as SAI1_RX_BCLK

tulip sleet
#

The teensy41 board pins.c does not list I2S-specific pins

rancid pilot
#

same on teensy 4.1

tulip sleet
#

@onyx hinge so are you saying the generated pins.c (not the board pins.c) does appear wrong? Perhaps there was an SVD error and we should update the submodule

rancid pilot
#

D21 is BCLK1

#

and it does not accept

#

I can try the other BCLK pins

tulip sleet
#

or maybe there is a pin validation error in common-ah

onyx hinge
#

At least with the implementation in circuitpython, a "TX" clock has to be used to transmit audio data via i2s

#

there may be some register level configuration that lets an "RX" clock be used to transmit data but if so CircuitPython doesn't implement it

tulip sleet
#
    const mcu_periph_obj_t *bclk_periph = find_pin_function(mcu_i2s_tx_bclk_list, bit_clock, &instance, MP_QSTR_bit_clock);
#

in I2SOut.c for mimxrt

rancid pilot
#

D4 is accepted (BCLK2) in the diagram

#

but the MicroMod has designated pins, and silkscreened I2S pins, which are wrong :/

onyx hinge
#

that diagram might represent what works in some other environment

#

in circuitpython, the pin has to be a "TX BCLK", but AD_B1_11 is an "RX BCLK".

rancid pilot
#

Thanks for the help. I'll figure smtg out. Maybe there is an Adafruit board with i2s and can bus with better circuitpython support.

onyx hinge
#

I don't think we've implemented canio on any mimxrt10xx microcontrollers yet

rancid pilot
#

I just did ๐Ÿ™‚ But something is wrong with my CAN transciver chip. I think. Bad chinese fake or...

tulip sleet
#

This is what MicroPython allows for I2S pins: SCK are allowed clock pins:

#define I2S_GPIO_MAP \
    { \
        I2S_GPIO(1, SCK, RX, GPIO_AD_B1_11, IOMUXC_GPIO_AD_B1_11_SAI1_RX_BCLK), /* pin 21 */ \
        I2S_GPIO(1, WS, RX, GPIO_AD_B1_10, IOMUXC_GPIO_AD_B1_10_SAI1_RX_SYNC), /* pin 20 */ \
        I2S_GPIO(1, SD, RX, GPIO_AD_B1_12, IOMUXC_GPIO_AD_B1_12_SAI1_RX_DATA00), /* pin 38 */ \
        I2S_GPIO(1, SD, RX, GPIO_B1_00, IOMUXC_GPIO_B1_00_SAI1_RX_DATA00), /* pin 8 */ \
        I2S_GPIO(1, SCK, TX, GPIO_AD_B1_14, IOMUXC_GPIO_AD_B1_14_SAI1_TX_BCLK), /* pin 26 */ \
        I2S_GPIO(1, SCK, TX, GPIO_B1_02, IOMUXC_GPIO_B1_02_SAI1_TX_BCLK), /* pin 36 */ \
        I2S_GPIO(1, WS, TX, GPIO_AD_B1_15, IOMUXC_GPIO_AD_B1_15_SAI1_TX_SYNC), /* pin 27 */ \
        I2S_GPIO(1, WS, TX, GPIO_B1_03, IOMUXC_GPIO_B1_03_SAI1_TX_SYNC), /* pin 37 */ \
        I2S_GPIO(1, SD, TX, GPIO_AD_B1_13, IOMUXC_GPIO_AD_B1_13_SAI1_TX_DATA00), /* pin 39 */ \
        I2S_GPIO(1, SD, TX, GPIO_B1_01, IOMUXC_GPIO_B1_01_SAI1_TX_DATA00), /* pin 7 */ \
        I2S_GPIO(1, MCK, TX, GPIO_AD_B1_09, IOMUXC_GPIO_AD_B1_09_SAI1_MCLK), /* pin 23 */ \
        I2S_GPIO(2, SCK, TX, GPIO_EMC_06, IOMUXC_GPIO_EMC_06_SAI2_TX_BCLK), /* pin 4 */ \
        I2S_GPIO(2, WS, TX, GPIO_EMC_05, IOMUXC_GPIO_EMC_05_SAI2_TX_SYNC), /* pin 3 */ \
        I2S_GPIO(2, SD, TX, GPIO_EMC_04, IOMUXC_GPIO_EMC_04_SAI2_TX_DATA), /* pin 2 */ \
        I2S_GPIO(2, MCK, TX, GPIO_EMC_07, IOMUXC_GPIO_EMC_07_SAI2_MCLK) /* pin 33 */ \
    }
onyx hinge
#

but does it allow using an RX clock when transmitting audio?

#

every source agrees AD_B1_11 is a transmitting clock and AD_B1_14 is a receiving clock, from what I saw.

tulip sleet
#

the MicroPython code appears not to care

#

hmm, it might check futher down

#

@rancid pilot ESP32-S2 and -S3 support canio. I think someone else contributed that port, or did you do it @onyx hinge?

onyx hinge
#
        saiConfig.syncMode = kSAI_ModeAsync;                                                 
        SAI_RxSetConfig(self->i2s_inst, &saiConfig);                                         
        saiConfig.bitClock.bclkSrcSwap = true;                                               
        saiConfig.syncMode = kSAI_ModeSync;                                                  
        SAI_TxSetConfig(self->i2s_inst, &saiConfig);
```yeah it looks like there's some register setting that allows using an RX clock when transmitting data. We'd be happy to see this implemented in circuitpython, but as it's not needed for adafruit hardware we probably wouldn't prioritize it.
tulip sleet
#

is the pin you want accessible on the micromod carrier?

rancid pilot
#

Mine is here. I don't know how to make a PR and when testing and doing logic analyser checks the signals appear to stop at me CAN bus transcivere IC so I can't test. : https://github.com/adafruit/circuitpython/issues/8151

GitHub

I have started working on a canio implementation for the Teensy Micromod (mimxrt10xx port). I am not a circuitpython nor a CAN bus expert but I hope I can make a working version and pass on enhanci...

#

the I2S pins are on the top

tulip sleet
#

yeah but if the pin you want is available elsewhere then you don't have to use the labeled ones

rancid pilot
#

๐Ÿ™‚

manic glacierBOT
#

It's possible to use a pin designated "RX BCLK" when transmitting audio data. This can be done, but circuitpython lacks the necessary code. This may be necessary for some boards such as the micromod.

Here's a snippet from micropython:

    } else if ((self->mode == TX) && (i2s_gpio_map[sck_index].mode == RX)) {                 
        saiConfig.syncMode = kSAI_ModeAsync;                                                 
        SAI_RxSetConfig(self->i2s_inst, &saiConfig);         ...
onyx hinge
#

I went ahead and entered an issue about supporting RX BCLK but it's not likely to be a priority-- community help to implement it would be appreciated. ^

meager fog
#

@crude blaze ok heres the latest draft for rev B - i am gonna at the TSC2007 but im kinda wondering now how does the raspi 7" handle CTP IRQ... (?) kinda wish they'd added another GPIO or two to the DSI connector ๐Ÿ˜•

manic glacierBOT
slender iron
manic glacierBOT
manic glacierBOT
orchid basinBOT
rancid pilot
#

I am sorry to ask so many questions. Is I2CTarget (aka I2C peripheral, aka I2C slave) in a working condition? I am using board "Adafruit QT Py ESP32-S3 No PSRAM" as the slave. I am waiting for requests. Nothing is connected at all and I keep getting a lot of requests. Like circuitpython is spamming itself with non-existent requests. When I connect a master and do an I2C scan I can see that the slave is alive and responding. When I try to read from the slave I get garbage as response.

slender iron
meager fog
#

timonsku ok heres the latest draft for

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Closes #7615

Perhaps i mis-understood something on the code + i dont have any hardware to test this with, please review it throughtfully.

From my understanding:
- num_blocks: amount of memory we want to read
- count: amount of memory we can read from cache

If that is correct (bold assumption):
- < should have been <=. That is, reading the same or less amount of memory than there's in cache
- Why would we use MIN on count there at all? Since the...

spare jacinth
#

looking into #8178 (beware im not too familiar with CircuitPy architecture)

im seeing that main.c has a function named run_code_py (assuming this is the early code that triggers executing code.py)....which in turn calls common_hal_release_displays, but only inside #if CIRCUITPY_ALARM (plus some other C-checks inside this pre-processor-check)

if i understand correctly, "alarm" is used to go into sleep mode until some condition is met and then re-execute the whole code.py file

ideas so far

  • small addition: shouldn't harm calling release on an #else block... i can see most ports have the feature enabled by default, tho
  • should i dig further to understand the entire function and try to automatically release on very first pass at the code(maybe just add a static bool) and/or some other states, or does that sound bad?
tulip sleet
spare jacinth
#

Ok thx, will take a closer look, didnt see any code that would detect unreleased on a quick glance, but i can probably find a way ๐Ÿค“

tulip sleet
#

The error happens because someone is trying to create a display, but there already is one (hence "too many display busses"). The error is uninformative, because the user is not necessarily trying to create a second display, but simply to use one. If you read the thread referenced in that issue, I think it describes the error case pretty well, esp see Neradoc's reply

#

I was just thinking of changing the text of the error

spare jacinth
#

But my quick glance lead to the understanding that this error is the same as actually (trying) creating too many displays, ie: no way to tell both events apart

#

So, straight up changing the error message wouldnt be nice for the other event

tulip sleet
#

I think you can't determine the user's intent at the time, we can just offer an extra hint, making the text longer

#

paraphrasing: "too many display buses -- did you forget to release the current display?". That's a bit too long, but that's the idea

spare jacinth
#

alright, yeah, makes sense

manic glacierBOT
spare jacinth
tulip sleet
#

let me look at the the msg...

tulip sleet
spare jacinth
#

My doubt right now is... Is this even related to busses (hardware lines), or amount of display "objects"(probably RAM concerns)? I mean, error is not bad but maybe isnt 100% technically correct (plus a user may not know, and doesnt need to know, what a bus is)

#

Thats the only reason i removed "busses"
Is it hardcoded on the translations or whatever, making it hard to change the text?

tulip sleet
#

There is already a "too many displays" error, which gets raised under different cirucmstances. The error specifically happens when you try to create a new display bus in the process of creating a new display.

spare jacinth
#

Oh... guess i didnt look far enough in the chain of functions that get executed to get down here ๐Ÿ™ƒ

tulip sleet
#

you can search for "Too many displays" and "Too many display busses"; i think you did already

#

the error is changed in the .c code, not in the .pot file, which is generated automatically. But I think I am telling you something you know already.

spare jacinth
#

yeah, i figured that out, some magic going on to find strings and re-gen those

tulip sleet
#

yeah, we look for translate(...)

spare jacinth
#

(but i was looking at the code without "busses" on it, how dumb am i hahahaha)

tulip sleet
#

the discord link in the issue has some specific failing code in it

spare jacinth
#

Cant get pre-commit to like my changes, tried both make translate(as suggested by error msg) and make msgmerge(after digging Makefile), but still not going through

tulip sleet
#

what is the error?

#

I have another suggestion but hold on eating breakfast

spare jacinth
#
Translations..........................................................Failed
- hook id: translations
- files were modified by this hook

find extmod lib main.c ports/atmel-samd ports/cxd56 ports/espressif ports/mimxrt10xx ports/nrf 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 -f- -L C -s --add-location=file --keyword=translate --keyword=MP_ERROR_TEXT -o circuitpython.pot.tmp -p locale
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`
{'Too many display busses; forgot display.release_displays() ?'}
make: *** [Makefile:256: check-translate] Error 255
find extmod lib main.c ports/atmel-samd ports/cxd56 ports/espressif ports/mimxrt10xx ports/nrf 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 -f- -L C -s --add-location=file --keyword=translate --keyword=MP_ERROR_TEXT -o - | sed -e '/"POT-Creation-Date: /d' > locale/circuitpython.pot
tulip sleet
#

what happens when you run make translate?

spare jacinth
#

wait, am i dumb and im just missing a git commit locale?

tulip sleet
#

[my possible suggestion above is not feasible, never mind, has to do with using qstrs in message]

#

yes, you have to add the modified circuitpython.pot to the commit

spare jacinth
#

will also add to the PR an extra output line to the command making the suggestions (if i find where it comes from found!) to also tell about the file to be committed, thx

manic glacierBOT
tulip sleet
#

@stuck elbow thanks for making this sweep; do you have privs to remove the labels in libraries and adafruit/circuitpython (or only the latter)? I can make executive decisions for thecircircuitpython repo

stuck elbow
tulip sleet
#

i will trail behind and remove; i agree with all the choices so far

manic glacierBOT
stuck elbow
#

there was only a handful, so I'm pretty much done in the main repo

#

the libraries don't seem as bad

manic glacierBOT
tulip sleet
#

@stuck elbow i think I got them all

#

thanks again

spare jacinth
#

i messed up @tulip sleet ๐Ÿ˜…
display vs displayio

tulip sleet
#

np, i'll approve another one; I should have seen that

spare jacinth
#

omw

tulip sleet
#

I will stop the builds so as not to waste resources

manic glacierBOT
#

I've been working on a (still very incomplete) library for parsing TOML, see it here.
Sharing it in for visibility, just in case someone wants to use it or contribute, or core team wants to merge it (after some fixes).

Supported types:

  • ints
  • floats
  • bin/oct/hex literals
  • strings
  • lists (details below)

Current workflow is

  • For each line in the input:
    1. Iterate the line to find some metadata, eg tokens (like quotes or br...
spare jacinth
#

translated latest (11) texts to spanish on weblate, are they automatically added to the PR or do i have to click some button that i didnt see?

onyx hinge
#

@spare jacinth weblate I think uses a scheduled task to make a new PR; you don't have to do anything.

manic glacierBOT
spare jacinth
#

guess i will need to compile a new board config, so asking here instead of #help

i have bought and am trying to setup a Luatos ESP32C3, however the code for it (https://circuitpython.org/board/luatos_core_esp32c3/) is for a prior version without UART/USB converter
looks like both manually running esptool, and using the web tool have actually flashed the firmware, and i even got the popup on the webtool to configure credentials (tho it didnt close, perhaps due to errors?)

right now i cant get to it by neither mu/thonny/putty (REPL) nor web workflow (files?)

is this a missing setting (letting CircuitPy about the UART/USB) or just part of C3 port not being completely done?

buoyant lagoon
#
../../shared-module/displayio/Bitmap.c:219:28: error: comparison of integer expressions of different signedness: โ€˜uint32_tโ€™ {aka โ€˜long unsigned intโ€™} and โ€˜intโ€™ [-Werror=sign-compare]
  219 |     for (uint32_t i = 0; i < self->stride * self->height; i++) {
#

and now i'm down to just compiler warnings, my distro is fairly strict by default

#
 39     uint16_t height;
 41     uint16_t stride; // uint32_t's
#

but the error doesnt make much sense, its already unsigned!?

spare jacinth
#

u16 * u16 wont fit on another u16, seems like its getting casted to i32(int) automatically
what if you: for (uint32_t i = 0; i < (uint32_t)self->stride * self->height; i++) {

buoyant lagoon
#

i would say thats a bug, it should have become a u32

#

i32 is also smaller then u32, so it might still truncate

#
[nix-shell:~/apps/rpi/circuitpython/ports/raspberrypi]$ make -j 16 BOARD=raspberry_pi_pico
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
QSTR not updated
/nix/store/7bir7rgpr9i95ky49cxpg9mk1x28il24-arm-none-eabi-binutils-2.35.1/bin/arm-none-eabi-ld: warning: -z relro ignored
/nix/store/7bir7rgpr9i95ky49cxpg9mk1x28il24-arm-none-eabi-binutils-2.35.1/bin/arm-none-eabi-ld: cannot find -lc_nano
collect2: error: ld returned 1 exit status
make: *** [Makefile:456: build-raspberry_pi_pico/firmware.elf] Error 1
#

@spare jacinth the cast does fix the compile error, now its on to a link error!

spare jacinth
buoyant lagoon
#

@tulip sleet any idea about this new link error?

tulip sleet
buoyant lagoon
#

if those are dynamic binaries, it wont work

#

/lib doesnt exist on nixos

tulip sleet
#

I don't know, but I don't think so -- the binaries are built to work on a lot of different platforms

buoyant lagoon
#

the toolchain ive loaded, is known to work on the pico

tulip sleet
#

what version of gcc are you using

buoyant lagoon
#
$ arm-none-eabi-gcc --version
arm-none-eabi-gcc (GCC) 10.2.0
#

i cant find c_nano in the source anywhere

tulip sleet
buoyant lagoon
#

../../ports/mimxrt10xx/sdk/tools/cmake_toolchain_files/mcux_config.cmake: set(TARGET_LINK_SYSTEM_LIBRARIES "-lgcc -lc_nano -lm" PARENT_SCOPE)
only in another port, and git grep is being stupid and wont show it

tulip sleet
#

we use ag a lot for searching

#

this does build without errors on the standard setup. I can't explain why yours is different.

buoyant lagoon
#

do you know where c_nano.a is normally coming from?

tulip sleet
buoyant lagoon
#

ahhh

#

my toolchain comes with newlib, but most of the things i build provide their own libc

#

simplest option then, docker!

#

that will fix my missing /lib and let me just apt-get install whatever the directions say

tulip sleet
#

I just unpack the toolchain and put it on my PATH. It does not require a system install

buoyant lagoon
#

URL?

tulip sleet
#

See the link above and read the paragaph for explanation

#

Most people use Ubuntu 22.04. Scott (tannewt) uses arch

#

but the guide is written for 22.04

buoyant lagoon
#
[clever@amd-nixos:~/apps/rpi/circuitpython]$ gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gcc
bash: gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gcc: cannot execute: required file not found
#

yep, fail, just like expected

#

it expects /lib64/ld-linux-x86-64.so.2 to exist

#
[clever@amd-nixos:~/apps/rpi/circuitpython]$ ls /lib
ls: cannot access '/lib': No such file or directory

[clever@amd-nixos:~/apps/rpi/circuitpython]$ ls /lib64
ls: cannot access '/lib64': No such file or directory
manic glacierBOT
#

Do other boards show CIRCUITPY? (Just making sure there's nothing weird about your host system.)

Do take away the lines above; they are for an nRF board, and maybe some other things, not RP2040. Your mpconfigboard.h should look at a lot the Feather or QT Py RP2040.

You can try re-creating CIRCUITPY from the REPL:

import storage
storage.erase_filesystem()

but I'm thinking there might be something else wrong.

tulip sleet
small comet
#

I took a look at https://github.com/adafruit/circuitpython/issues/8119

The naive fix seemed to be to add a reference to the circuitpython_typing online repo at:
https://github.com/adafruit/circuitpython/blob/8050b07a687277cb277e4c13de83cfdc076682d5/conf.py#L444

Unfortunately, there's some long-standing Sphinx issue, which doesn't
support the current mechanism that the adafruit-typing module uses
(https://github.com/sphinx-doc/sphinx/issues/8934)

The symptom: the Sphinx html generator looks for a class definition
for (say) circuitpython_typing.ReadableBuffer but the online repository
tags it as data (https://pastebin.com/21ZjBX3g) so it never gets resolved.

Am I missing a trick here?

onyx hinge
small comet
#

Sg - fwiw, I saw there was some 'good first issue' cleanup going on, and this one seemed to get into the weeds; so maybe worth reviewing for that tag

manic glacierBOT
#

Closes #4408

Adds the method in the title. First time i write a C-Python binding, please let me know if anything should be changed

  • Should maybe remove the doctstring to follow other funcs not having it on the file
  • Is there a way to extend existing array instead of duplicating? Could save a bit of space

My little test:

Adafruit CircuitPython 8.2.0-47-g8050b07a6-dirty on 2023-07-30; WeAct ESP32S3-B-N16R8 with ESP32S3R8

>>> from collections import OrderedDict
>>> d =...
small comet
spare jacinth
#

good thing is: regardless of how items are inserted, this method should still work (unless the definition of the structure holding the data changes)

#

and we were lacking it anyway to have better coverage of CPython's API

small comet
#

Right - I was thinking (because of the new duplication of the method pointers) if it might become more tricky to merge any upstream changes, but (thankfully!) someone more experienced will no doubt figure this out ๐Ÿ™‚

spare jacinth
#

im not sure what that file is used for, tho... other tests seem to have a .exp to match their output, but this one doesnt (?)

small comet
#

Yea - it's confusing (but better documented in micropython.) The way it seems to work is that for anything without a .exp suffix, it runs cpython first, and compares with micro/circuitpython output

spare jacinth
#

oh, makes sense, lets see if i can run the test (and check its output)

gloomy cosmos
#

I have an issue that I posted over at general help circuitpython chaneel, but I doubt anyone is going to be able to help me over there. Would someone mind taking a look at #help-with-circuitpython message. I'll pretty sure there's an issue in the sockpool lib. I can also file an issue on GitHub if that works better for you folks.

manic glacierBOT
#

The "easy" solution seemed to be to add a reference to the circuitpython_typing repo around here:
https://github.com/adafruit/circuitpython/blob/8050b07a687277cb277e4c13de83cfdc076682d5/conf.py#L444

However, there's an additional long-standing Sphinx issue, which appears to have trouble with TypeAlias definitions (see https://github.com/sphinx-doc/sphinx/issues/8934)

The symptom: the Sphinx doc generator looks for a class definition for a TypeAliased definition like
`circui...

small comet
# manic glacier

fyi @onyx hinge - not a high priority; I tried to find the least unappealing workaround while I was looking at it.

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I guess I'll give an update on something I did last year (or maybe earlier this year) where this is relevant:

I wrote a CircuitPython (in C) to allow for playback of real-time generated audio, for use in synths. (No, I haven't pushed, because I haven't been able to fully test it; read on.) It seems to work, but I can't generate synth audio in CircuitPython fast enough to keep the buffer filled. That makes the audio generated sound really bad. Access to the second core might solve thi...

manic glacierBOT
spare jacinth
#

TIL, thx again Dan :)

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.2.0-45-g75ba17e84 on 2023-07-28; ESP32-S3-DevKitC-1-N8R2 with ESP32S3
Board ID:espressif_esp32s3_devkitc_1_n8r2

Code/REPL

import board
import adafruit_rgbled
import neopixel
import wifi
import os
import socketpool
import ipaddress
import microcontroller

def processNetMsgs():
    try:
        buff = bytearray(128)
        numbytes, addr = sock.recvfrom_into(buff)
        if numbytes:
            ...
light lichen
#

Is this a place (channel) for getting assistance adding support for a board? specifically waveshare esp32-s3-pico

#

Specifically troubleshooting getting it to run on the board after compiling (or configuring correctly to get to run on the board)

manic glacierBOT
#

Title says installed on new ESP32-S2 Feather but links at the bottom to the ESP32-S2 TFT UF2. The ESP32-S2 Feather is different from the ESP32-S2 TFT. When posting the board's boot_out.txt it's best to include everything in it except the UID.

Very cool script. It's best to include a check for if connected to wifi with a try/except while making the request or ping. If Wifi goes down during the return it might crash the script. I don't think it would crash to safemode though. Checking for ...

lone sandalBOT
manic glacierBOT
#

Whenever someone says Python is slow compared to C, I ask to look at their code. Usually, I find they are writing in Python as if in C.

For example, this is โ€œdead dog slowโ€ in Python but fast in C:

For i in range(something):
Someting(i) = something(i) +1

You should ALWAYS write this as

Something += 1

If โ€œsomethingโ€ is a numpy array object, the above will likely be as fast as possible on your hardware, possibly even using vectorized math instructions. The first version doe...

manic glacierBOT
#

I am extremely experienced in both Python and C. I do know how to maximize efficiency in both. That said, I don't typically use Numpy, because in my day-to-day work, if I need efficiency badly enough to bother with Numpy, I'm better off just using C directly. Unfortunately, writing C modules for CircuitPython is far more difficult and complicated than writing C modules for desktop Python. (And half the time, for my job, instead of writing a Python module, I just make a C executable and ...

#

@chrisalbertson

On a side note, using += is only marginally faster on my machine. There's a way to go far faster though.

for i in range(100000000):
    a = a + 1

That takes 7.719s


for i in range(100000000):
    a += 1

This takes 6.479s


a += sum({1 for i in range(100000000)})

That looks more complicated, because it generating a full list and then taking the sum, but it only takes 2.374s


If you do a = a + ... on that last...

#

Use the viper code emitter and you can the same back end native code that C uses,

Can you REALLY write C code that is as good as Numpy? Maybe. But a lot of smart people have spend time making numpy very fast. You could duplicate this work if you know about both numeric algorithms and the hardware in the chip.

OK, you had to write an RTOS, But Micropython already runs on Mbed. So it has a pretty good RTOS foundation. Multitasking and all.

On Jul 30, 2023, at 1:44 PM, Ben...

manic glacierBOT
#

Well, let's see, I taught several semesters of college level ARM assembly, which included the use of vector instructions. You have to be good at numeric algorithms to write good audio synthesis code. The RP2040 has some hardware I'm not that great with (the PIOs mainly), but I don't need to use those for this.

Yeah, I think I could manage. In fact, I could probably one-up Numpy if I wanted to. See, Numpy is highly generalized, so that it will work with a broad range of applications. ...

#

Ran his code and was able to replicate the hard fault.

Adafruit CircuitPython 8.2.1 on 2023-07-25; Adafruit Feather ESP32S2 with ESP32S2
Board ID:adafruit_feather_esp32s2
code.py output:
https://api.open-meteo.com/v1/forecast?latitude=40.7259&longitude=-74.0055&daily=precipitation_sum,precipitation_probability_max&current_weather=true&temperature_unit=fahrenheit&windspeed_unit=mph&precipitation_unit=inch&timezone=auto&past_days=3

Precipitation history: 0.0
Future pr...
manic glacierBOT
#
Adafruit CircuitPython 8.2.1 on 2023-07-25; Adafruit Feather ESP32S2 with ESP32S2
Board ID:adafruit_feather_esp32s2

Setup AP and was able to connect to it with my phone. Green light on, everything looks good.

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
WiFi SSID: CustomNet
MAC addr: [obfuscated]
AP IP addr: 192.168.3.192
Time : 1843.76

After a while decided to soft reboot to see if that in itself would ca...

manic glacierBOT
manic glacierBOT
#

Appologies. I was not trying to clutter up this issue, and there are some bits that are still relevant. I'll quiet down in here.

I've looked at synthio before, and it was too primitive for my needs. Looking at that though, it seems to have come a long way, so I'll give it another look. If I do go the route of working in C, adding to an existing module would be far simpler for me than trying to make yet another one from scratch. Thanks for the suggestion! (Is there somewhere appropria...

small comet
#

(just a quick sanity check) on the esp32, is it feasible to implement a useful countio without a dedicated pulse counter peripheral? (I was rueing the lack of countio on an esp32c3, and realized it doesn't have such a peripheral.)

onyx hinge
#

probably would require creative use of some existing peripheral. maybe rmt?

small comet
#

Will read up more on it - thx for the pointer!

#

This is an ultra-naive question - is pulseio already built on the rmt peripheral on the ESP32? (So one might creatively do any countio equivalent entirely in python?)

onyx hinge
#

no, looks like the existing implementation is using PCNT

manic glacierBOT
small comet
onyx hinge
#

I was looking at countio/Counter.c, sorry for any confusion

manic glacierBOT
#

After some discussions on Discord, another possibility to rule out:

Having CIRCUITPY_WIFI_SSID and CIRCUITPY_WIFI_PASSWORD in settings.toml will enable web workflow with auto-connect. That makes this device a wifi station trying to connect to the same SSID and password that this device's Access Point is using. That's probably an unnecessary complication. Separate settings.toml settings could be used for the AP credentials, and if web workflow isn't needed, those credentials could b...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.2.1 on 2023-07-25; Raspberry Pi Pico W with rp2040

Code/REPL

import mdns
import socketpool
import wifi

from adafruit_httpserver import Server, Request, FileResponse


mdns_server = mdns.Server(wifi.radio)
mdns_server.hostname = "helloworld"
mdns_server.advertise_service(service_type="_http", protocol="_tcp", port=80)

pool = socketpool.SocketPool(wifi.radio)
server = Server(pool, "/static", debug=T...
manic glacierBOT
#

CircuitPython version

CircuitPython at 55c82f45daf797af7de6d1edf86082a21f9df7d7

Code/REPL

# Building for beetle-esp32-c3 causes a non-critical error because of a
# typo in sdkconfig

Behavior

$ make BOARD=beetle-esp32-c3 PORT=/dev/ttyACM0 clean flash
...
/tmp/confgen_tmpoavy933y:4: warning: malformed string literal in assignment to LWIP_LOCAL_HOSTNAME (defined at esp-idf/components/lwip/Kconfig:3). Assignment ignored.

Also see logs...

manic glacierBOT
warm stump
#

A MiniDisc!? (a line from scooby-doo where velma finds a minidisc on the floor as part of an investigation, can't find it now)
Trying to explain the many features of this contraption and adding to it is the fun part. It's essentially just a disk drive but has otherwise completely redundant physicality details to commentate.

The main slide tray has 2 prod sticks which prod the minidisc out of the slot so it falls on the floor in amusing fashion.
It obviously also has a spindle motor for the actual disc which has decals.
There's a driving ring which looks complex and all it does is moves an axle 1 unit upwards to lock the minidisc in place.
Then it has (and why not) a Pneumatic Laser Arm with no air in it.
```I did consider while adding each feature that if you add a circuitpython device to this (or a motor to each motor and a pump to each pump)
and if the spinning disc were actually made out of actual optical glass & polycarbonate substrate, then it might actually work as a storage device -_(\
manic glacierBOT
#

@Rybec

Python is slow compared to C.

The statement is obviously false, especially when we discuss Numpy functions coded in C and Fortran. Moreover, your own C code will always be slower than Numpy code if you do not utilize vectorization and other techniques implemented in Numpy. And with the Numba Python library, we can achieve pure assembler performance (though I suspect it may not be available in Micropython yet). I can certainly back up my claims: you can find my satellite interf...

manic glacierBOT
#

So out of desperation I just tried commenting out the line that sets the static IP for operating in AP mode and it did not enter safemode. It ran all night (12 hours) with out a hiccup. The updated code is below that worked. I did take out more things that were not related. So its a more condensed version now.

import board
import wifi
import os
import socketpool
import ipaddress

def processNetMsgs():
    try:
        buff = bytearray(128)
        numbytes, addr = sock.re...
manic glacierBOT
#

I don't have a safemode.py but I do have the following boot.py:

import usb_hid

# This is only one example of a gamepad descriptor, and may not suit your needs.
GAMEPAD_REPORT_DESCRIPTOR = bytes((
    0x05, 0x01,  # Usage Page (Generic Desktop Ctrls)
    0x09, 0x05,  # Usage (Game Pad)
    0xA1, 0x01,  # Collection (Application)
    0x85, 0x04,  #   Report ID (4)
    0x05, 0x09,  #   Usage Page (Button)
    0x19, 0x01,  #   Usage Minimum (Button 1)
    0x29, 0x20,  #  ...
digital shoreBOT
#
adafruit
Owner

.adafruit#0

Members

37,650

Roles

38

Category Channels

8

Text Channels

63

Voice Channels

7

spare jacinth
#

there was a website with a list of issues from (all?) repos, but i cant find it... can someone share the link for me to bookmark?
would like to try and fix some ๐Ÿ™‚

spare jacinth
#

ha, my keywords "adafruit contributing" should have been "circuitpython" instead
ended up with links to docs for how to make a PR and the like
thx ๐Ÿ˜„

onyx hinge
manic glacierBOT
#

I think the W25Q80DV chip is 8Mbit = 1 megabyte.

By default, CircuitPython allocates the first 1MB for the firmware and the remaining portion for the CIRCUITPY drive. In this case, that means there's no left over space, so the CIRCUITPY drive can't be formatted or mounted.

You can check out the raspberry pi pico w board definition for how to change this default. That board allocates a LARGER space for the firmware. You would try allocating LESS such as 900*1024 (900k), as the size o...

#

I did see the other issue that mentioned web workflow. I've tried completely erasing the contents of my settings.toml along with deleting it entirely and had the same issues. As far as I'm aware I'm not using the web workflow at all but I could still be missing something.

I've tried moving it before, after, inside functions, outside functions and the conclusion I came to was that if I put mdns_server.advertise_service inside of an async function then it won't work at all, but if I put ...

manic glacierBOT
onyx hinge
#

The thing that is not great about remove_prefix is it's not exceptional if the expected prefix isn't present, but it is still a more explicit way to do the slice. @tulip sleet I think I addressed everything except the function names, which I am not sure your suggestions are better than my originals but I'll change it if you have a strong opinion.

tulip sleet
# onyx hinge The thing that is not _great_ about remove_prefix is it's not exceptional if the...

I am interested in detecting if the prefix is wrong, since it could change out from under the code. Ohterwise it will fail in some mysterious way. So however is the easiest to do that would be good (replace failure or whatever).

Re names, don't have to change. I was just trying to indicate this is very specific to 0's and 1's, as opposed to using $(filter or something like that. That's why I asked for an example in a comment.

onyx hinge
#

OK. does a comment referring the interested reader to a use below "cut it", or do you want the example right there?

tulip sleet
onyx hinge
#

OK now the prefix is checked

tulip sleet
#

i have to go out for 45 mins or so; will pre-approve

onyx hinge
#

thanks dan, appreciated as always

manic glacierBOT
slender iron
#

<@&356864093652516868> The meeting is in an hour and half today. See the pinned message for the notes doc. Talk to you soon!

midnight ember
#

According to my ISP shouldnโ€™t expect my internet to be back online for a couple hours.

onyx hinge
#

enjoy your time on the desert island

blissful pollen
#

Didn't update the notes but just here lurking today while I review exceedingly exciting documents...

onyx hinge
#

I'm going to assume there may be an element of sarcasm in that statement

blissful pollen
#

maybe ๐Ÿ™‚

onyx hinge
#

it's pretty good after turning david up to 200% in the right click menu

lone axle
digital ibex
#

I haven't messed around with SynthIO yet. I've gotta get on that!

lone axle
turbid radish
#

Date is now permanently every Monday morning US Eastern time

idle owl
#

You can also email circuitpythonday (@) adafruit.com with your own events for CircuitPython Day!

onyx hinge
#

thank you new & infrequent contributors! โค๏ธ blinka

digital ibex
#

I'd love to help review where I can, can someone help me get set up after the meeting?

onyx hinge
#

We will want another 8.2.x release soon, due to the Adafruit IO certificate change. There's an open (I think*) PR for it, but not an Issue.

tulip sleet
onyx hinge
#

@tulip sleet brent did check out the build and confirmed it can connect to IO. but if the actual certificates in nina-fw changed during your troubleshooting session on friday/the weekend I can update the PR again.

tulip sleet
royal rover
#

Is there a list of libraries available for Blinka

digital ibex
onyx hinge
#

@royal rover you can search pypi based on package name https://pypi.org/search/?q=adafruit-circuitpython-&o= though a small number of packages that are not expected to work on blinka/desktop python are published on pypi anyway.

#

[and based on David's hug reports I second the HR to scottyp humanIthink and tyeth for bringing the issue up over here on the discord; I didn't directly see that part of the process]

thorny jay
#

Certificate are a pain...

onyx hinge
#

nice to hear from you @thorny jay !

thorny jay
#

Micro Dot

onyx hinge
#

If that's what I think it is, the display is about 0.3" (7.62mm) wide, the same as a classic DIP IC

#

thank you everyone, have a great week!

idle owl
#

Thank you, everyone!

onyx hinge
#

And remember

You can also email circuitpythonday (@) adafruit.com with your own events for CircuitPython Day!
we'd love to have your participation!

digital ibex
#

Bye everyone! Have a wonderful week!

onyx hinge
#

August 7

turbid radish
#

Thanks Scott

lone axle
#

Thanks for hosting Scott, have a great week everyone!

manic glacierBOT
#

Yeah, should i add a new #define + #ifdef to control whether the API's code gets added?

Yup. We use #if instead of #ifdef so we make sure that the setting has a defined value. There are many examples of that in various places.

Instead of making yet another flag, there is a kitchen-sink one called MICROPY_CPYTHON_COMPAT which turns on various extra features. I think this feature should be controlled by that for now, so that it's not added for the smallest builds. In the long run ...

manic glacierBOT
slender iron
thorny jay
#

The "problem" with (most) Pimoroni product is that they have a Python driver for the Raspberry Pi SBC and a driver (maybe C) for thier own version of MicroPython. When a compatible CP library exist, it is possible to quickly reuse their hardware, else you are on your own.

devout jolt
slender iron
slender iron
#

@turbid radish @idle owl I don't need to do versions anymore right? only the meeting links and py dev of the week

devout jolt
slender iron
#

I watched the pocket piano 201 video and then was recommended one on chompi. My natural tendancy is to figure out what the guts are. ๐Ÿ™‚

#

@digital ibex I've got time now if you want to chat about reviewing

digital ibex
#

Ok, should I hop in the voice channel?

slender iron
#

sure, that may be fastest

crimson ferry
#

"Clone failed: A submodule points to a commit which does not exist." ๐Ÿ˜ฆ

slender iron
#

does it say which one?

#

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

crimson ferry
#

it doesn't say which one, trying again in case it was a fluke

slender iron
#

it can happen if a commit is in a different branch/repo than the one listed in .gitmodules

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 8.2.2
orchid basinBOT
manic glacierBOT
manic glacierBOT
tulip sleet
#

Only change is updated Adafruit IO SSL certificate

manic glacierBOT
#

How do I flash the bin to the board? I'm not sure what bootloader it has.

It comes with some bootloader that pulses when reset is double-clicked. But I was not able to load anything with that bootloader
.
MicroPython says to use dfu-util, but this did not work for me. It said there was no DFU device.

I also tried uploading Blink from the Arduino IDE (2.x.x) and that did not work either.

An Arduino Forum user [told](https:/...

manic glacierBOT
manic glacierBOT
#

Do other boards show CIRCUITPY? (Just making sure there's nothing weird about your host system.)

Yep. QT Py 2040 works.

By default, CircuitPython allocates the first 1MB for the firmware and the remaining portion for the CIRCUITPY drive. In this case, that means there's no left over space, so the CIRCUITPY drive can't be formatted or mounted.

Ohh thanks. Yeah that must be it. Currently our flash size is only 1M. I'll try it later.

It's not really a dev board, so it's not a pri...

lone sandalBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Alright, I was able to compile and get a debug build running. But the backtrace gets corrupt each time after multiple attempts. I will trying in hopes I can get one that doesn't.

Here's the debug output:

FHFuRiBc)Ri~cI (215991) wifi:new:<1,1>, old:<1,1>, ap:<1,1>, sta:<0,0>, prof:1
I (215991) wifi:station: 58:1c:f8:a7:d7:e4 join, AID=1, bgn, 40U
I (216021) esp_netif_lwip: DHCP server assigned IP to a station, IP is: 192.168.99.2
I (217031) wifi:<ba-add>idx:2 (ifx:1, 58:1c:f8:...
midnight ember
#

I don't know which one of you or all devs who decided not to wipe nvm during a circuit python install but huge hug to you. ๐Ÿค— I had an API token stored in NVM, installed CP 8.2.2 and the token was still there and picked up right where it left off. Have no idea how or why that worked but thank you for allowing that possibility to exist. blinka_heart_circle

tulip sleet
manic glacierBOT
slender iron
#

(teensy's bootloader wipes all of flash)

manic glacierBOT
midnight ember
#

@slender iron I don't have any teensy's... would that apply to the iMX?

slender iron
#

nope, just teensies

midnight ember
#

awesome ๐Ÿ‘

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.2.0 on 2023-07-05; ESP32 Devkit V1 with ESP32
Adafruit CircuitPython 8.2.2 on 2023-08-01; VCC-GND Studio YD RP2040 with rp2040
Adafruit CircuitPython 8.2.0 on 2023-07-05; Adafruit KB2040 with rp2040

Code/REPL

def __example_print(string):
    print(string)

class ExampleClass():
    def __init__(self, string) -> None:
        self.string = string
    def do_print(self):
        __example_print(self.stri...
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.2.0-beta.0-9-ge631350b9 on 2023-06-06; Metro MIMXRT1011 with IMXRT1011DAE5A
Board ID:metro_m7_1011

Code/REPL

import board, busio, sdcardio
spi = busio.SPI(board.SCK, MISO=board.MISO, MOSI=board.MOSI)
print("before config:", spi. frequency)
while not spi.try_lock():
    pass
spi.configure(baudrate=30_000_000) # max according to mimxrt10xx/common-hal/busio/SPI.c
spi.unlock()
print("after config:", spi.fre...
manic glacierBOT
manic glacierBOT
manic glacierBOT
onyx hinge
#

@stuck elbow are you able to share your streaming mjpeg code with me?

manic glacierBOT
stuck elbow
onyx hinge
#

thank you!

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.2.0-49-g55c82f45d-dirty on 2023-08-01; DFRobot Beetle ESP32-C3 with ESP32-C3FN4

Code/REPL

#### a couple of reproducible examples

import wifi
import socketpool

wifi.radio.connect("mySSID", "myPASS")
pool = socketpool.SocketPool(wifi.radio)
sock = pool.socket(pool.AF_INET, pool.SOCK_STREAM)
sock.bind((str(wifi.radio.ipv4_address), 9876))
sock.listen(10)
sock.close()
# Blocks rather than raising EBADF...
onyx hinge
#

aha! the stub needs to be dedented 1 level

#

no that's not the only problem

manic glacierBOT
onyx hinge
#

oh the other problem was my own making. yay.

cunning orchid
#

Still waiting for the bureaucracy here before I can really materially contribute (my boss is ex-Cisco and wants to get all liability ducks in a row and thoroughly documented). Thinking that I may try putting together a little guide for navigating such waters. Maybe subsection of contributing? Or Adafruit learning?

cunning orchid
#

That's where I was thinking, yeah. There is already some mention of the possibility of needing approval but, a bit sparse on details.

#

There's been mention of a waiver document of some sort, so, once that's figured out, I'll do a write-up and maybe see if there are documents/guidelines from the FSF to help folks in startups and other companies that aren't necessarily FOSS-averse but FOSS-inexperienced.

manic glacierBOT
#

Hi Scott:

Awesome. Thanks!

bye for now,

Jeremy Littler

LEAD Emerging Technologies

The Creative School

Toronto Metropolitan University

416-979-5000 ext. 552222

RCC 353

On Wed, Aug 2, 2023 at 12:59โ€ฏPM Scott Shawcroft @.***>
wrote:

Merged #8251 https://github.com/adafruit/circuitpython/pull/8251 into
main.

โ€”
Reply to this email directly, view it on GitHub
<https://github.com/adafruit/circuitpython/pull/8251#event-9990419...

#

I wonder if something changed with GitHub. make fetch-all-submodules isn't working for me if I use the repo it was merged into.

Here is my esp32-camera failure even though I merged your PR yesterday:

fatal: transport 'file' not allowed
fatal: Fetched in submodule path 'ports/espressif/esp32-camera', but it did not contain 2cd2a6d69faaba9ebb6105814a50039d82e2f899. Direct fetching of that commit failed.
slender iron
cunning orchid
#

Thanks! I'm wondering as well if you folks have had any thought yet on project governance considerations with the CRA heading for adoption in the EU. (Maybe more of a weekly meeting question).

slender iron
#

I'm not aware of what the CRA is. (I'm in the US)

cunning orchid
#

I'm in the US too but it is looking like global open-source may be impacted (intentional in the committee version, pending on negotiation w/ the current rotating executive to finalize). It is the Cyber Resilience Act. Much of it seems rather sensitive but, currently it's looking likely to "left-shift" CE security/process certification liability for open-source software and hardware to the projects themselves, if they are to be available in the EU.

slender iron
#

I take the THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND portion of the license literally. Any support I give is a bonus.

#

@onyx hinge I had to delete my .git/modules/ports/espressif/esp32-camera/ folders after deinit. sync doesn't seem to update the tracking branch

cunning orchid
#

Agreed. That's a pretty central concept in most FOSS licenses. We won't know for certain how it stands until Sept, but the committee draft intent seems to be to explicitly nullify such terms. Here's an Apache Foundation article: https://news.apache.org/foundation/entry/save-open-source-the-impending-tragedy-of-the-cyber-resilience-act

By: Dirk-Willem van Gulik, VP, Public Affairs, ASF ย TLDR;ย  Software, including open source, is becoming regulated the world over. This lengthy blog post explains the background to the Cyber Resilience Act in the Europe Union, what is good, its flaws and the likely negative impact on open source. And it also explains the arcane process [โ€ฆ]

manic glacierBOT
onyx hinge
#

If/when that becomes law I'm sure Adafruit will chek with lawyers to determine the response. Until then it's not clear why we'd do anything but the status quo.

cunning orchid
onyx hinge
#

I appreciate you have good intent bringing it to our attention ๐Ÿ™‚

manic glacierBOT
#

The need to change the ulab submodule seems weird, as the change was merged by

* [Fix -Wunused-variable diagnostic when !ULAB_SUPPORTS_COMPLEX v923z/micropython-ulab#631](https://github.com/v923z/micropython-ulab/pull/631)

Yup, weird. I think it may have to do with my submodules tracking the wrong branch. (Sync doesn't sync them.) I've reverted that bit.

spare jacinth
#

stuff like control+arrow not working on REPL is an issue with app connecting to the serial port (Mu currently, but im pretty sure Thonny did the same), or that's simply not handled by the code on fw?
seems like it is the later and there's a good reason (code complexity?) for it, but if it feels somewhat feasible to implement i could poke at it ๐Ÿ™‚

#

that should probably go towards MicoPy tho, i assume

slender iron
#

I don't know what control+arrow is meant to do ๐Ÿ™‚

spare jacinth
#

on right/left, move entire words instead of single chars

#

on up/down, most likely nothing special ๐Ÿ˜›

slender iron
#

There is somewhere where we interpret the special vt100 codes

#

I know the display spot but not the repl one

spare jacinth
#

funny enough, shift+control+left/right does select entire words, lol

#

so, the logic is there already, hopefully not too coupled with select-mode

slender iron
#

it may not be the cp side

#

may be the terminal editor in mu

spare jacinth
#

yeah, definitely some terminal stuff in play too, putty doesnt select on whole words

#

so... sadly, something with no fix :(

slender iron
#

I'm sure you could fix it. It just won't be easy ๐Ÿ™‚

spare jacinth
#

support for using key as kwarg added, and also realized i had no KeyError(to match CPython), but output is ```py

d.move_to_end("foo")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError:
```copied from the only place i found that raises a KeyError (in my case: if (!found) mp_raise_type(&mp_type_KeyError);)
so.. it is not returning the key (?), how do i set it up? ๐Ÿ™ƒ

stuck elbow
#

a quick grep shows mp_raise_type_arg(&mp_type_KeyError, field_q);

#

there is also mp_raise_msg_varg(&mp_type_KeyError, MP_ERROR_TEXT("pop from empty %q"), MP_QSTR_set);

spare jacinth
#

need to work on searching skills, thx that should be it

stuck elbow
#

I use ag, aka the silversearcher

spare jacinth
#

i use Ctrl+Shift+F, aka VSCode's builtin lol

small comet
manic glacierBOT
manic glacierBOT
#

Could you add some tests to tests/basic? There are some OrderedDict tests there already. Add a new one. See tests/README for whether you need a .exp file or not. The testing procedure runs the test in both CircuitPython and CPython (regular Python). If they are the same the test passes. If the tests might not be the same, then a .exp file is provided that is the result one would expect from running the test in CircuitPython.

jaunty juniper
#

@spare jacinth interpreting ctrl-arrow into the propre code is likely a PC-side thing. Mu does things on its side like sending the right amount of "move left/right" when clicking in the "command line".
But there is extended (while still limited) emacs keys support that can be enabled with MICROPY_REPL_EMACS_KEYS and MICROPY_REPL_EMACS_EXTRA_WORDS_MOVE
https://github.com/adafruit/circuitpython/blob/main/shared/readline/readline.c

#

don't ask me how I ended up in this section of the code a long time ago

spare jacinth
# manic glacier

getting this when trying to compile py ../../extmod/ulab/code/numpy/vector.c: In function โ€˜vector_sinc1โ€™: ../../extmod/ulab/code/numpy/vector.c:787:20: error: conversion from โ€˜mp_float_tโ€™ {aka โ€˜doubleโ€™} to โ€˜floatโ€™ may change value [-Werror=float-conversion] 787 | if (fpclassify(x) == FP_ZERO) { | ^ adding -Wno-float-conversion didnt work as Makefile contains -Wfloat-conversion, does this happen to somebody else?
commenting out on Makefile does workaround, ofc
(WSL with Ubuntu22)

Update: Fun, test gets skipped hahaha

small comet
onyx hinge
#

we probably didn't update ulab again since the fix went in?

slender iron
#

I'm thinking of making adafruit_usb_host_descriptors and adafruit_usb_host_mass_storage libraries. Any alternatives I should consider?

#

One is helpers for reading and parsing descriptors, the other is for interfacing over mass storage.

manic glacierBOT
#

We use it to open endpoints as they are used. Fetching the descriptor as needed can cause issues with devices that we're expecting a control packet while another transaction was ongoing. Specifically, a usb thumb drive didn't expect a control transaction while doing a SCSI transaction.

This PR also aborts transactions on timeout or ctrl-c interrupt. It doesn't always recover though...

spare jacinth
#

seems like --target esp32 and/or building the variant/coverage unix port (did it even get used?) got the test to run, but it wont pass checks because of different format, shall i rather make a long .exp for one of existing folders, or make a new test? well, i can perhaps print the keys instead of whole dict

small comet
#

(I had the impression a good place to make any changes would be in the upstream repo) but I've also forgotten what I actually poked at around this.

manic glacierBOT
manic glacierBOT
#

Here are the test failure details:

 True
 abcdefghij
 abcdefghij
-odict_keys(['a', 'b'])
-odict_keys(['b', 'a'])
-odict_keys(['a', 'b'])
-odict_keys(['b', 'a'])
-odict_keys(['a', 'b'])
-odict_keys(['b', 'a'])
-odict_keys(['a', 'b'])
+dict_keys(['a', 'b'])
+dict_keys(['b', 'a'])
+dict_keys(['a', 'b'])
+dict_keys(['b', 'a'])
+dict_keys(['a', 'b'])
+dict_keys(['b', 'a'])
+dict_keys(['a', 'b'])

FAILURE /home/runner/work/circuitpython/circuitpython/tests/results/basics_ord...
manic glacierBOT
manic glacierBOT
spare jacinth
#

How complex is that to implement? โคด๏ธ

(No previous experience with PIO)

tulip sleet
manic glacierBOT
#

Should i have that many tests, for every combination of positional and keyword usage (made that to confirm i made things correctly), or would it be better to just check moving either way?

I think the main thing is to test the moving and edge cases (e.g. on an empty dict, key not found, etc.) not so much the arg parsing. It doesn't hurt but the testing is more about the functionality than the arg parsing. Also test arg validation maybe: suppose you pass a non-bool for the bool arg.

midnight ember
onyx hinge
#

@slender iron @tulip sleet OK I was mistaken in part about ulab. The specific ref that circuitpython pointed at was NOT in the history of their main branch, possibly because the PR was resolved with "squash and merge". Their main branch has "38caf84 Fix -Wunused-variable diagnostic when !ULAB_SUPPORTS_COMPLEX (#631)" while CP was pointing at "< 3728d22 (HEAD) Fix -Wunused-variable diagnostic when !ULAB_SUPPORTS_COMPLEX. So it's interesting that this worked for me & for the CI system but not for others including scott.

tulip sleet
#

makes sense, do you want to PR to repoint it?

manic glacierBOT
tulip sleet
#

@onyx hinge there is a pre-commit failure in 8256 โฌ†๏ธ

onyx hinge
#

oops, I'll fix it

#

the "translations" check is not run if only the submodule extmod/ulab is changed, so it wasn't caught locally. pre-commit run --all does though

manic glacierBOT
onyx hinge
#

ah did an engineer ever fix a problem without making more? ๐Ÿ˜“

manic glacierBOT
turbid radish
#

I'm unable to get the number of users we have on the server, / serverinfo isn't showing it

onyx hinge
#

?membercount

#

@turbid radish apparently I don't either

#

@turbid radish on the discord desktop client, click the "v" icon next to "adafruit" above the listing of channels. then click "server settings" and "members". the screen will show you the current count.

spare jacinth
#

if you have the rights, seems like there's a "members" tab on server's settings

onyx hinge
#

"jinx" I think they say.

manic glacierBOT
onyx hinge
#

sigh, feeling a bit distressed that I apparently messed up the build system pretty good with a change I didn't even think would have an impact on it. well, it'll get put right soon. if I understood the problem now.

gilded cradle
#

@lone axle I have some questions when you get a chance about bitmaptools and displayio.

lone axle
gilded cradle
#

Have you had a chance to work with the bitmaptools much?

#

Jeff thought you had

lone axle
#

I'm pretty familiar with some of it's functions but less so with others.

gilded cradle
#

Well, I've been trying to use the alphablend function and I can sort of get it to work, but because palettes are separate to bitmaps, the colors aren't correct. Any ideas?

lone axle
#

That is one of the ones I haven't used yet. But my interpretation of whats mentioned in the colorspace docs here: https://docs.circuitpython.org/en/latest/shared-bindings/bitmaptools/index.html#bitmaptools.alphablend

The colorspace of the bitmaps. They must all have the same colorspace. Only the following colorspaces are permitted: L8, RGB565, RGB565_SWAPPED, BGR565 and BGR565_SWAPPED.

means it may not work for indexed bitmaps with different palettes. I think they would need to have the same palette. This mentions using one of those listed colorspaces, but I would expect if you happen to have 2 different indexed bitmaps with the same palette even if it's not specifically one of these full color spaces it could still work with them.

#

My best idea would be to try non-indexed BMPs and see if it makes a difference, or if possible try to merge the palettes for your two images into one so that they each can use the same palette.

gilded cradle
#

Ok, well I was pulling the bitmaps in with imageload (which only works with indexed bitmaps) as it doesn't work with OnDiskBitmaps. Any ideas how to pull in an non-indexed bitmap?

lone axle
#

Hmm, that is a good point. In my head I had mistakenly had that restriction backwards. I was thinking OnDisk was only indexed, and imageload was indexed or rgb.

gilded cradle
#

Yeah, I think ondisk only works with 24-bit bmps and imageload only works with 8-bit bmps.

#

8-bit of course means indexed.

lone axle
#

It looks like when it was added originally the test case was using directio rather than displayio to get it onto the display: https://github.com/adafruit/circuitpython/pull/5544 I wasn't aware of directio module before, though I think I recall something about GIFs using a similar technique.

gilded cradle
#

Huh, I haven't seen directio. I'll have to look at that

#

Oh, ok. I think directio is for camera data

#

He mentioned something like that

lone axle
#

I am curious about alphablend after poking through the documentation a bit. I'll try out the merged palette approach in the next few days and see if I can get a "simpletest" that works with displayio. If I'm understanding things correctly it would mean that it's restricted to only working on images whose combined palettes occupy less than 256 colors.

gilded cradle
#

It still may be useful

#

According to the pr you linked, it should work with RGB565 16-bit images

#

Also, I may take a look at what gifio might be able to do

#

Anyway, thanks for chatting. I think you helped. I am interested to check out your simpletest when you get it working.

manic glacierBOT
onyx hinge
#

alphablend is about combining two input images colors proportionally, like output[0] = 50% * input1[0] + 50% * input2[0]. I'm not sure how that makes sense with palette images, because that RGB value you get by combining two pixels might not be anywhere in the palette.

#

it's not about combining image according to the transparency information one or the other of those images has

manic glacierBOT
gilded cradle
#

Yeah. I'm working on a way to get the input bitmaps to be 16-bit in which case, the palettes become the same for the images, which is why it works.

onyx hinge
#

I don't think it will work for palette images, even if they're 16 bits.

#

they have to be RGB565 or one of the variations

gilded cradle
#

Right

#

My initial strategy is to try and load an ondiskbitmap, convert to (RGB565) 16-bit with color converter and if necessary copy pixel by pixel into a regular Bitmap.

onyx hinge
#

OK.

gilded cradle
#

If that works, I can try and optimize it from there

manic glacierBOT
#

First and foremost... the code i pushed the other day was an old version by mistake. I pushed the newer one yesterday.

I have now pushed:

  • Require quotes for things to be considered strings
  • bools have to be all-lowercase
  • Implemented better parsing of lists, it somewhat works but breaks/parses wrong on some scenarios. Will try and fix it during the week, but a second pair of eyes would definitely help locating bugs :)
gilded cradle
#

Fortunately the images needed for these matrices are fairly small.

manic glacierBOT
midnight ember
#

@turbid radish Are you looking for total members or members currently online?

#

Online Members

turbid radish
#

Total members

#

Thanks @onyx hinge

manic glacierBOT
spare jacinth
# manic glacier

fixed, or at least improved, the list-parsing bug
would love some feedback for improvement, as the lib is pretty much feature-complete from my end (i dont feel like adding support for dates, line breaks inside lists, nor multiline -aka triple quoted- strings)

manic glacierBOT
manic glacierBOT
slender iron
#

first time I've seen this: ```
#0 0x00002dea in FLEXSPI_ReadBlocking (base=0x402a8000,
buffer=0x20007a9c "C", size=1) at sdk/drivers/flexspi/fsl_flexspi.c:760
#1 0x00002fc2 in FLEXSPI_TransferBlocking (base=base@entry=0x402a8000,
xfer=xfer@entry=0x20007aa0) at sdk/drivers/flexspi/fsl_flexspi.c:876
#2 0x00002a24 in flexspi_nor_wait_bus_busy (base=base@entry=0x402a8000)
at supervisor/flexspi_nor_flash_ops.c:62
#3 0x00002a86 in flexspi_nor_flash_erase_sector (base=base@entry=0x402a8000,
address=2097152) at supervisor/flexspi_nor_flash_ops.c:103
#4 0x00002924 in port_internal_flash_flush ()
at supervisor/internal_flash.c:133
#5 0x000027c4 in supervisor_flash_flush ()
at ../../supervisor/shared/flash.c:137
#6 0x00002816 in filesystem_flush ()
at ../../supervisor/shared/filesystem.c:172
#7 0x000029ce in reset () at reset.c:34
#8 0x00002696 in reset_cpu () at supervisor/port.c:490
#9 0x00002804 in reset_into_safe_mode (
reason=reason@entry=SAFE_MODE_HARD_FAULT)
at ../../supervisor/shared/safe_mode.c:139
#10 0x000026ec in HardFault_Handler () at supervisor/port.c:636
#11 <signal handler called>
#12 0x00003da0 in tu_fifo_write (f=f@entry=0x20008004,

#

flash flush from hard fault

onyx hinge
#

hmmmm maybe for some safe mode resets you'd want to do that but probably not hard fault.

manic glacierBOT
slender iron
#

higher in the stack it was also reading from flash

#

no idea how it faulted

#

wish I had trace going ๐Ÿ™‚

#

it did corrupt my fs

manic glacierBOT
manic glacierBOT
lone sandalBOT
orchid basinBOT
midnight ember
#

@turbid radish It's much easier to find if using a mobile device than desktop discord app. The UI's are not the same and show more server info on the mobile app.

#

hold down on the Adafruit channel icon and a menu popout with more options appears

#

which displays online members and total members

clear halo
manic glacierBOT
orchid basinBOT
manic glacierBOT
#

this implementation is hoped to be smaller. (feather_m4_express/fr fits unlike the other PR; approximate savings ~600 bytes)

Minor difference to standard Python: A dict object has a move_to_end method. However, calling this method always results in TypeError.

Implementing it this way means that the method table can still be shared between OrderedDict and builtin dict.

Hug report to @elpekenin who provided the initial implementation!

Closes #4408.

manic glacierBOT
random junco
#

@onyx hinge May I please DM you when you have a moment? I have a question for you regarding CircuitPython Day

onyx hinge
manic glacierBOT
#

Pinging @dhalbert and @jepler here. I was doing some work on the Arduino side of Protomatter today and found that this latest batch of P4 and P5 matrix panels are super persnickety about the clock signal. Todayโ€™s 1.5.10 release should fix this, and the change (just moving some NOPs) ought to work in CircuitPython as well.

I think what mightโ€™ve happened is occasionally thereโ€™s a PR that fixes one personโ€™s flicker issue, unaware that this may lay waste to other situations. So earlier Circu...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.2.0 on 2023-07-05; Raspberry Pi Pico with rp2040

Code/REPL

import alarm
import time
import microcontroller
microcontroller.cpu.frequency = 20000000

...

time_alarm = alarm.time.TimeAlarm(monotonic_time=time.monotonic()+INT_TIME)
alarm.exit_and_deep_sleep_until_alarms(time_alarm)

Behavior

Deep-Sleep with standard cpu frequency (125MHz) uses about 6.8mA. With 20MHz, it is only about 4.1mA (40%...

manic glacierBOT
#

I tested this today with a QT Py RP2040 & jog wheel encoder.

Tests may_exec=: https://gist.github.com/jepler/597b80caa61a4a71f094959c1df66001 (note that I think this PIO code may have a bug that occasionally allows the incorrect value ~x (bitwise not of the actual value) to be read; this is a bug in the PIO code and not in CP; I think this can be fixed by using 'y' as the temporary register)

Tests offset=0: https://gist.github.com/jepler/891a3c48e2f9f9fb9759bdb5ce081265 (revised b...

small comet
#

(just curious) I saw an adafruit_debug_i2c wrapper library but the comparable adafruit_debug_spi library seems to have stopped development. Is there any new thinking around such wrapper libraries, or just lack of time/priority to move that forward?

manic glacierBOT
#

updated yet again and using https://gist.github.com/jepler/0f162eb04c2b4e36e9ae9d6a228e4112 as test of offset=.

I also manually tested that offset conflicts are detected, though the error message says "All state machines in use" when the real problem is that the requested load address was not available.

This interactive session shows how the "same" program can be loaded multiple times at offset 0, then a 2nd program can be loaded at offset 0 of the second SM. A third program can't be ...

onyx hinge
#

@small comet probably mostly lack of time. If offered it sounds like something we'd be happy to add to the community bundle!

small comet
#

@onyx hinge just confirming, as https://github.com/adafruit/Adafruit_CircuitPython_Debug_SPI seemed intended to be an adafruit bundle library (like the i2c library). Not that I'm throwing my hat in the ring ๐Ÿ™‚ but do you think it would it be preferable to make contributions as pull requests there, or do you have in mind having this be a new repo outside the Adafruit organization altogether?

onyx hinge
#

It looks like no Adafruit person ever actually wrote any runnable code in there, it's all just updates of infrastructural stuff.

If Adafruit is not planning to maintain it, it's better that it go in the community bundle.

Because there's no runnable code I don't think anything's lost by starting fresh.

small comet
#

Ack - thx for extra context! (Awkwardly, it's more red tape work-wise to moonlight on a new project vs contributing to an existing adafruit one, but that's a whole other story ๐Ÿคทโ€โ™‚๏ธ )

thorny jay
#

I don't understand why the Picopad is not available in a stable release: https://circuitpython.org/board/pajenicko_picopad/
I think it was there in time for 8.2.2 (maybe 8.2.1), but that was only for patching the certificate, so nothing was backported.
Or maybe backporting board only occurs on minor version and it will be in 8.3?

proven garnet
#

@onyx hinge I just submitted a PR against the unified workflow repo for the issue you tagged me in!

onyx hinge
#

any idea why it worked previously, or appeared to?

proven garnet
#

No, I don't, which is the weird part. I actually would have expected it to fail up until now actually, based on the information you linked

#

I've started using what I PR'd exclusively for this reason though, and for our purposes makes the most sense anyways. I'll probably do some digging into why we only just hit this issue, or at least didn't originally.

onyx hinge
#

oh! pip install . installs this library to a place on pythonpath; you removed that in favor of .. other commands.

#

successful run ```
Successfully installed adafruit-circuitpython-pioasm-0.0.0+auto.0
============================= test session starts ==============================
platform linux -- Python 3.11.4, pytest-7.4.0, pluggy-1.2.0
rootdir: /home/runner/work/Adafruit_CircuitPython_PIOASM/Adafruit_CircuitPython_PIOASM
collected 15 items

tests/test_mov.py ... [ 20%]```

#

notice how it has just installed the library

#

[also noted on the issue] @proven garnet

proven garnet
#

OHHHHH

#

Confidently wrong about how confident I was about not introducing a breaking change ๐Ÿ˜‚

#

That makes sense though, thank you for discovering and explaining that!

small comet
proven garnet
#

My personal belief is that python -m pytest is best since it always includes the library you mean to test, though it is interesting to see how the change @onyx hinge mentioned affected it. Makes a lot of sense, and something I should be more mindful of when working with the CI files!

small comet
#

And I learnt something about how the CI is put together by watching from the peanut gallery, so win-win ๐Ÿ™‚

onyx hinge
#

@proven garnet can you add a comment about why so we don't mess it up again accidentally?

#

# this includes the current directory in sys.path so that the tests can find the module being tested or similar

proven garnet
#

Updated, please let me know if more details is needed

onyx hinge
#

nah that'll hopefully make someone at least check before changing it.

#

tests passed in that other PR now. yay. thanks and have a great rest of your weekend.

#

well, actually, it failed, just later. argh

#

actions don't work with python 3.9, but that was something I'd changed trying to figure out the problem

plush citrus
#

any chance I could ask for the new synthio to supply the elementary waveforms out-of-the-box? understand that memory is limited, but something like synthio.sine_wave, synthio.sawtooth, etc. would be quite helpful

manic glacierBOT
plush citrus
#

also I submitted a PR for NAU7802 to enable polling rate selection

manic glacierBOT
#
bcr

CircuitPython version

Adafruit CircuitPython 8.2.1 on 2023-07-25; Adafruit PyPortal Titano with samd51j20

Code/REPL

>>> import microcontroller
>>> microcontroller.on_next_reset(microcontroller.RunMode.UF2)
>>> microcontroller.reset()

Behavior

Reboots to normal running CircuitPython

Description

When I run the provided code, it just goes back to normal user mode.

Additional information

If I use the older RunMode.BOOTLOADER it moun...

manic glacierBOT
onyx hinge
manic glacierBOT
manic glacierBOT
thorny jay
#

I have something to say about CircuitPython.org nRF warning:

If I check an NRF board from Adafruit ( like https://circuitpython.org/board/circuitplayground_bluefruit/ ) there is a warning about UF2 bootloader version 0.61+ and See Update UF2 Bootloader below.
If I go on a non Adafruit board ( like https://circuitpython.org/board/Seeed_XIAO_nRF52840_Sense/ ) I have the same warning but there is no section "Update UF2 Bootloader" below.

My Bootloader was the following:

UF2 Bootloader 0.6.2-12-g459adc9-dirty lib/nrfx (v2.0.0) lib/tinyusb (0.10.1-293-gaf8e5a90) lib/uf2 (remotes/origin/configupdate-9-gadbb8c7)
Model: Seeed XIAO nRF52840
Board-ID: Seeed_XIAO_nRF52840_Sense
Date: Nov 30 2021
SoftDevice: S140 7.3.0

I went ahead as it does not cost to give it a try... and it worked.
So I don't know what the "problem" is... is it misleading warning? is it absence of bootloader section? or no problem at all?

thorny jay
manic glacierBOT
midnight ember
onyx hinge
#

that section is present when the condition is true: {% if bootloader_version and bootloader_id %}
It's missing because the metadata of those non-Adafruit boards is incomplete, and/or they do not use the UF2 bootloader.

Feel free to submit patches to circuitpython-org to improve the metadata for third party boards.

tulip sleet
#

I made the See Update UF2 Bootloader below. I dind't know there were so many third-party boards that didn't have that setion. I was addressing several forum posts that didn't realize their boards needed a bootloader update.

manic glacierBOT
#

In standard Python, socket.settimeout() sets a timeout for both TCP connections and data transfer. In CircuitPython, socket.settimeout() sets a timeout for data transfer, but doesn't affect the TCP connection timeout. It sure would be nice to set a TCP connection timeout, either via settimeout() or some other method.

For example, using CircuitPython 8.2.2 on an Adafruit Feather ESP32-S3 (no PSRAM), an attempted TCP connection always times out after 30 seconds, regardless of the settimeou...

misty garnet
#

not clear on the current status, does UART block on a write until all bytes are transmitted? If not, are we going to get a flush() command that does? Or is this complicated because different MCUs handle things differently?

manic glacierBOT
manic glacierBOT
#

a CPU temperature sensor is designed to measure temperature at some point inside the CPU chip itself, not the ambient temperature. This can be quite a bit above the ambient temperature.

https://learn.adafruit.com/adafruit-feather-rp2040-pico/cpu-temperature

Here's what we say about it, generally speaking for all circuitpython boards:

There is a temperature sensor built into the CPU on your microcontroller board. It reads the internal CPU temperature, which varies depending on how lon...

onyx hinge
manic glacierBOT
slender iron
onyx hinge
slender iron
#

I know we had issues with PIO and shutting it down because the OSR was actually flushed.

#

@tulip sleet heads up you are scheduled to host today's meeting

tulip sleet
#

I had this notice stashed to send now

#

thanks for the reminder, though, sometimes i don't remember!

cobalt grail
#

So that would be <t:1691431200:F>

cobalt grail
#

There are other generators out there that might suit you better though.

slender iron
#

last I looked, there was no way to do recurring times