#circuitpython-dev

1 messages Β· Page 30 of 1

slender iron
#

I've been measuring a blinky and running the micropython perf bench

blissful pollen
#

Cool I had never looked at the perf bench before. Thanks

slender iron
#

I hadn't much either

jaunty juniper
#

someone understands what's happening here ? It looks like the library is trying to override property accessors in a subclass, and it doesn't work that way:
https://forums.adafruit.com/viewtopic.php?t=199790
this library:
https://github.com/adafruit/Adafruit_CircuitPython_EMC2101
test code:

class Thing:
    def __init__(self, i2c):
        self.i2c_device = i2c
    @property
    def i2c(self):
        print(self)
        return self.i2c_device

class Thing_sub(Thing):
    def __init__(self, i2c):
        super().__init__(i2c)
    @property
    def i2c(self):
        return super().i2c

c = Thing_sub("I2C")
print(c.i2c)
code.py output:
<super: <class 'Thing_sub'>, <Thing_sub object at 0x3fd8c9a0>>
Traceback (most recent call last):
  File "code.py", line 17, in <module>
  File "code.py", line 14, in i2c
  File "code.py", line 7, in i2c
AttributeError: 'super' object has no attribute 'i2c_device'
onyx hinge
#

@jaunty juniper probably super objects just don't work that way in CP/MP. (in MP it erroneously results in a <property> object which also isn't right) You're welcome to file an issue about it but I doubt there's an easy and simple fix.

jaunty juniper
#

yeah but that's a bug in the library

onyx hinge
#

then the library will need to be changed to work around the core limitation I suppose

jaunty juniper
#

also the super().thing notation doesn't work with normal properties ???

class Thing:
    def __init__(self, i2c):
        self.i2c_device = i2c

class Thing_sub(Thing):
    def __init__(self, i2c):
        super().__init__(i2c)
    def test(self):
        print(self.i2c_device)
        print(super().i2c_device)

c = Thing_sub("I2C")
c.test()
I2C
Traceback (most recent call last):
  File "/Volumes/FUNHOUSE/code.py", line 13, in <module>
    c.test()
  File "/Volumes/FUNHOUSE/code.py", line 10, in test
    print(super().i2c_device)
          ^^^^^^^^^^^^^^^^^^
AttributeError: 'super' object has no attribute 'i2c_device'
#

that's python 3.11

#

so... it's an accident that it works with @property in C python or what ?

#

anyway I'll open an issue in the library

onyx hinge
#

so the fix in EMC2101 is to just use self.i2c_device in the subclass, rather than super().i2c?

jaunty juniper
#

hey my internet is back !

#

there is stuff like that:

    @property
    def fan_speed(self):
        """The current speed in Revolutions per Minute (RPM).
        :return: float speed in RPM.
        """
        self._check_status()
        return super().fan_speed
#

which is the same case as my test

#

also I'm not sure that I understand the actual error with EMC2101

#

the error is when i2c_struct tries to get obj.i2c_device, and somehow obj is super() ? That might be a wrongly reported error, caused by the complex weave that adafruit_register weaves

manic glacierBOT
chilly jay
#

How would I go about including the FreeRTOS and task headers from ports/espressif/esp-idf/components/freertos/include/freertos/ correctly with #include so they work flawlessly with VSCode intelli-sense?
It seems there are multiple FreeRTOS.h and task.h files in the project structure so only specifying the file name results in a confused VSCode while using the entire path also seems to confuse VSCode (types like TaskHandle_t are simply not recognised at all while they should be) and basically makes it unable to compile.

I am currently developing a module for usage with circuit python for use on an esp32s2 / feather s2 that has to use these headers since it does some stuff with FreeRTOS tasks and such.

midnight ember
#

Scott, I have 2 iMX’s if you need someone to run simple beta tests of builds I can do that. I don’t have access to a debugger though. Can offer to be a simple helper if needed.

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.4 on 2023-03-15; Adafruit Feather RP2040 with rp2040

Code/REPL

import sdcardio
import storage
import board

spi = board.SPI()
cs = board.D10

sdcard = sdcardio.SDCard(spi, cs)
vfs = storage.VfsFat(sdcard)
vfs.mkfs()

Behavior

vfs.mkfs() throws TypeError: function takes 1 positional arguments but 0 were given.

Description

I want to be able to format my sd-card, but maybe I misunderst...

rugged spindle
#

hopefully this is the correct place - does someone know why canio is available on the QT Py ESP32-C3 but not on the Seed Xiao ESP32-C3?

jaunty juniper
rugged spindle
#

having looked at my clipboard - it would appear "fat finger syndrome" was involved

#

you are right - it is shown on the canio page

#

please ignore me (for this once, not every time) πŸ˜„

manic glacierBOT
#

The documentation is wrong for mkfs(), sorry, and we'll fix. Since there may be no filesystem on the SD card, the mkfs() does not operate on a VfsFat object, but is a static method in VfsFat. To create a new filesystem on an SD card:

import sdcardio
import storage
import board

spi = board.SPI()
cs = board.D10

sdcard = sdcardio.SDCard(spi, cs)
# Create a FAT filesystem on the sdcard device.
storage.VfsFat.mkfs(sdcard)
# Now that the filesystem is created, you can ac...
manic glacierBOT
manic glacierBOT
#

Is that vfs_fat.c in extmod?

Yes, it is.

Here is my actual transcript on the PyPortal (removing some typing errors). I will try it on an RP2040 later. Which board and SD breakout (if any) are you using?

>>> import sdcardio,storage,board
>>> spi = board.SPI()
>>> sdcard = sdcardio.SDCard(spi,board.SD_CS)
>>> storage.VfsFat.mkfs(sdcard)
>>> import os
>>> vfs = storage.VfsFat(sdcard)
>>> storage.mount(vfs, "/foo")
>>> os.listdir()
['foo', '.fseventsd', '.metadata_never_in...
proven garnet
#

Not exactly CircuitPython related, but seems like the relevant audience - but I started converting one of my CPython libraries to a C extension, and boy is it fun (when it works). Is this what core work feels like? 😁

stuck elbow
#

I think core work is mostly tracking down obscure off by one errors

proven garnet
#

There are only two problems in CS - cache invalidation, naming things, and off by one errors.

manic glacierBOT
brazen hatch
#

I am doing the cptoml module now, it's almost done.

#

Reading is 100% done, supporting ", ', comments, octal, hex, scientific notations, bool, int (with +/- support).

#

I have done about 70% of writting new keys.

#

It's amazing how many edge cases there are.

#

I don't want to implement dates.. It's such a paaaiiiin.

#

It's the only thing left to do for reading though.

#

It's almost 200 lines of code now huh. And I am optimising it as much as possible..

#

It will be an all-in-one for settings.toml though.

#

It also applies basic formatting.

slender iron
slender iron
manic glacierBOT
jaunty juniper
#

hmmmm I have an ESP32-S3 boards with builtin I2C oled here, but there doesn't seem to be on-board pull ups πŸ˜•

#

also the code seems to halt when running board_init trying to setup the display, dunno if it's related, it seems to boot fine without it

manic glacierBOT
#

Could you check your code again? Here is what I tried from the REPL, with a Feather RP2040 and an AdaLogger FeatherWing:

>>> import sdcardio,storage,board,os
>>> spi = board.SPI()
>>> sdcard = sdcardio.SDCard(spi,board.D10)
>>> storage.VfsFat.mkfs(sdcard)
>>> vfs = storage.VfsFat(sdcard)
>>> storage.mount(vfs, "/foo")
>>> os.listdir("/foo")
[]

I tried this with 8.0.4 and 8.1.0-beta.0, and it worked for both.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0-beta.0 on 2023-03-01; Pimoroni Badger 2040 with rp2040

Code/REPL

na

Behavior

see below

Description

PR https://github.com/adafruit/circuitpython/commit/931c7c1c51fe3b2affa765d94c7178ae3d1be80c (ACEP) changed the interface to the EPaperDisplay class replacing the (single byte) refresh_display_command with a refresh_sequence. Since this PR the Badger2040 flashes during refreshes but the screen...

manic glacierBOT
manic glacierBOT
#

No sorry, got the same error. With 8.1.0 too. Now without the oled featherwing.

paste mode; Ctrl-C to cancel, Ctrl-D to finish
=== import sdcardio,storage,board,os
=== spi = board.SPI()
=== sdcard = sdcardio.SDCard(spi,board.D10)
=== storage.VfsFat.mkfs(sdcard)
=== vfs = storage.VfsFat(sdcard)
=== storage.mount(vfs, "/foo")
=== os.listdir("/foo")
Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
OSError: [Errno 22] Invalid argument

I can re...

tulip sleet
#

@jaunty juniper I am fixing up adafruit_hid in a few ways. I'm thinking of adding a longer timeout to the Keyboard() etc constructors, and making the timeout optionally specifiable in the constructor. I think you helped people with this: on some host computers (maybe especially after host sleep?), it may take a while to re-enumerate. Also I can use supervisor.usb_connected to check -- it didn't exist when this library was first written.

Do you have some advice you give people ("insert a time.sleep(2)" or whatever)?

jaunty juniper
tulip sleet
#

maybe it should be an example in the library, and it should be in a guide as well

jaunty juniper
#

I would think a default timeout waiting for USB would be nice, and I was wondering if we wanted to make the library itself resilient to USB going away, like print() is to the absence of a CDC connection, but I don't know if ignoring the errors is enough

tulip sleet
#

the trouble is that the host and CircuitPython might get out of sync (e.g. caps lock) if there's a temporary disconnection

#

or the code just wants to flag "hey, your keystrokes are not getting through"

#

the reboot/sleep issue isn't helped that much by a timeout, because it could be an indefinite period of time. But we have seen cases where it doesn't come back properly. I have a Trinket M0 HID volume control I have to reset sometimes after sleep

jaunty juniper
#

yeah if we ignore the errors we need to return a failure flag, which might not be better

tulip sleet
#

we should also document the exceptions that can be raised

manic glacierBOT
#

If you format this card on a host computer, and then just use it, does it work OK?

Yes it does.

I tested with 4GB, 8GB, and 16GB cards. Only the 4GB can be formatted by mkfs(). I think this is a limitation of the formatting code. However, these cards can be read if externally formatted. You don't have to format them in CircuitPython.

Sure, but I want to build a little datalogger device where I can delete all contents of the SD card if I need to. To use mkfs was the first idea.
...

jaunty juniper
#

@tulip sleet with a (ESP32S3) board that has a builtin oled on I2C but no pull ups, can we hack something to support it in board.c with internal pull ups ?

manic glacierBOT
tulip sleet
jaunty juniper
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I only did a handful of trials and there is some variance from run to run, but it seems comparable to me.

I used this test code to measure

import displayio
import board
import bitmaptools
import time

display = board.DISPLAY

bg_bmp = displayio.Bitmap(display.width, display.height, 4)
bg_palette = displayio.Palette(4)
bg_palette[0] = 0xffffff
bg_palette[1] = 0x0000ff
bg_palette[2] = 0x00ff00
bg_palette[3] = 0xff0000
bg_tilegrid = displayio.TileGrid(bitmap=bg_bmp, pixel_s...
fossil turtle
#

Does anyone know of a good link that describes how to bring up SD Card support for mkrzero running circuitpython?

manic glacierBOT
#

CircuitPython version

8.0.4

Code/REPL

import storage

# 禁用 USB MSC
storage.disable_usb_drive()

Behavior

The drive is gone.

Description

After I burned the firmware for Raspberry Pi Pico using uf2 for version circuitpython8.0.4, I created boot.py and disabled the drive with storage.disable_usb_drive(). Now I want to redisplay the drive, After I tried to re-install circuitpython by pressing the BOOTSEL button on the motherboard, I found tha...

manic glacierBOT
#

My log:
It is FR_INVALID_PARAMETER. I've replaced the 3 occurences of this number with 3 different numbers (1,2,3).

The error occurs here:
if (!(opt & FM_FAT)) LEAVE_MKFS(FR_INVALID_PARAMETER); /* no-FAT? */ (lib/oofatfs/ff.c)

FF_MKFS_FAT32 is 0. Which causes this "bug"

How I get it working:

 #ifdef MICROPY_FF_MKFS_FAT32
 #define FF_MKFS_FAT32   MICROPY_FF_MKFS_FAT32
 #else
-#define FF_MKFS_FAT32   0
+#define FF_MKFS_FAT32   1
 #endif
 /* This option swi...
still zephyr
#

Neradoc. let me know if I can contact you by DM. Thanks πŸ™‚

manic glacierBOT
tulip sleet
#

@onyx hinge I added a commit to your PR to document that mkfs() is a staticmethod.

#

that was the original "bug" from the issue

manic glacierBOT
tulip sleet
#

@onyx hinge I will try to finish #7739 off unless you want to.

onyx hinge
#

@tulip sleet that would be kind, thank you. I don't have a lot more working time today.

manic glacierBOT
jaunty juniper
#

well setting CIRCUITPY_I2C_ALLOW_INTERNAL_PULL_UP = 1 didn't work, it still complains about "no pullups", I wonder if there is a setting on ESP32S3 to change the strength of the internal pull up. It came with an Arduino/u8g2 demo, maybe I could look at how Arduino does its thing

tulip sleet
#

i am trying to remember why allow_internal_pullup was added. let me look

jaunty juniper
#

I tried that too, so far I was not able to scan or find the display (scanning takes an eternity)

#

I vaguely remember somebody needing/wanting it for their NRF board ?

tulip sleet
#

utlimately it was a moot issue

#

their board was misdesigned

jaunty juniper
#

yeah I'll just give up on this board for now, too bad the other two have pullups and it works nicely with board.DISPLAY

tulip sleet
#

I think the "ALLOW" was for a different reason

#

You could try replaceing this:

#if CIRCUITPY_REQUIRE_I2C_PULLUPS
    // Test that the pins are in a high state. (Hopefully indicating they are pulled up.)
    gpio_set_direction(sda->number, GPIO_MODE_DEF_INPUT);
    gpio_set_direction(scl->number, GPIO_MODE_DEF_INPUT);

    gpio_pullup_dis(sda->number);
    gpio_pullup_dis(scl->number);
    gpio_pulldown_en(sda->number);
    gpio_pulldown_en(scl->number);

    common_hal_mcu_delay_us(10);

    gpio_pulldown_dis(sda->number);
    gpio_pulldown_dis(scl->number);

    #if CIRCUITPY_I2C_ALLOW_INTERNAL_PULL_UP
    gpio_pullup_en(sda->number);
    gpio_pullup_en(scl->number);
    #endif

    // We must pull up within 3us to achieve 400khz.
    common_hal_mcu_delay_us((1200000 + frequency - 1) / frequency);

    if (gpio_get_level(sda->number) == 0 || gpio_get_level(scl->number) == 0) {
        reset_pin_number(sda->number);
        reset_pin_number(scl->number);
        mp_raise_RuntimeError(translate("No pull up found on SDA or SCL; check your wiring"));
    }
    #endif

with just:

    gpio_pullup_en(sda->number);
    gpio_pullup_en(scl->number);

as a test

jaunty juniper
#

right, I'll try looking into common hal busio something see what happens if I force the pull ups there, but that's for another day, I'll finish the PRs for the ones that work

#

like, these don't seem to be actually used

        .sda_pullup_en = GPIO_PULLUP_ENABLE,
        .scl_pullup_en = GPIO_PULLUP_ENABLE,
tulip sleet
#

we have avoided providing for internal pullups for I2C in general, because the internal pullups are usually out of spec for the required pullup current. For instance, on RP2040 the internal pullups are 60k-80k ohms, which is way out of spec. on nRF they are about 15k, which is still out of spec.

jaunty juniper
#

yeah, the problem is the board design here 🀷

#

I'll PR those for now

tulip sleet
#

looks like the ESP32ish pullups are like 30k-80k?

#

in the datsheet they are even called "WPU" (weak pull up)

manic glacierBOT
#

Hello! I've been exploring the espulp module with a project to read some analog sensors using the ULP and I believe I've hit a wall. As far as I'm able to tell, the ADCs have to be initialized from the main processor before they can be used by the ULP.

RISC-V:

https://github.com/espressif/esp-idf/blob/630c2724fc8c69eeaaa1bb025de52b99c5cb11aa/examples/system/ulp_riscv/adc/main/ulp_riscv_adc_example_main.c#L60-L66

ulp_riscv_adc_cfg_t cfg = {
    .channel = EXAMPLE_ADC_CHANNEL,
...
#

The block device arguments for VfsFat are currently declared as str, which is completely wrong. We should define an abstract class for these in circuitpython_typing. Signatures are as described https://docs.micropython.org/en/latest/library/os.html#os.AbstractBlockDev, though I think the "extended" signatures may not be used by us.

Another bug is that the signature for mkfs() is mkfs(self), which is wrong: it should be a block device.

#

CircuitPython version

Adafruit Circuitpython 8.1.8 on 2023-03-17; Adafruit Metro ESP32S2 with ESP32S2

Code/REPL

# SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries
#
# SPDX-License-Identifier: MIT

import time
import adafruit_sdcard
import board
import busio
import digitalio
import adafruit_dht
import microcontroller
import storage
import adafruit_pcf8523

# Use any pin that is not taken by SPI
SD_CS = board.IO9
# Initial the ...
brazen hatch
#

It's finally done

#

Deletes tables autogically when empty. Applies formatting and can fetch, put, delete.

#

It's basically an aio for toml.

#

I have optimised it as much as possible.

#

I went nuclear with it as I want it to be called very often.

#

I perhaps shouldn't be talking about it in this channel..

ornate breach
#

Seems relevant?

brazen hatch
ornate breach
#

Ah, maybe πŸ€·β€β™‚οΈ

brazen hatch
#

But I basically live here, so I uncontiously sent it here.

idle owl
#

No worries. This is a perfect place for it. πŸ™‚

ornate breach
#

Hai Kattni πŸ‘‹

idle owl
#

Hello πŸ™‚

ornate breach
#

Glad you’re back πŸ™‚

manic glacierBOT
idle owl
#

Thanks!

jaunty juniper
#

@slender iron can I do a request on pid.codes for using Circuitpython for a RP2040 board that is not open source ? (I asked on the maker's discord, if they would request one from RPF)

slender iron
#

ya, closed source is ok as long as its not your closed source design

jaunty juniper
#

ok, thanks πŸ‘

idle owl
#

@slender iron What milestone would you file a documentation issue under? It's not an error, it's that a code snippet should be added showing how to use the feature in your code.py file.

#

Trying to get the labels and milestones on it while filing it to make less work for you folks.

#

Long-term I'm guessing, but it's a core dev designed system, so I figured it was worth asking.

tulip sleet
idle owl
#

Ah ok.

#

I'll do that. I do think it's worth updating. Good first issue label is on it too.

manic glacierBOT
#

The documentation for alarm.time() should include an example that shows what it looks like in use in code.py. I struggled to figure out how to format it, and ultimately asked for help. I believe this would eliminate potential confusion for others moving forward.

The following explanation and example should be fine to include in the alarm.time() documentation.

This code block sets a delay, creates a TimeAlarm to wake up the board after delay seconds have passed, and then deep...

jaunty juniper
manic glacierBOT
manic glacierBOT
#

Reproduced on a PCA10100 eval board (nrf52833), using SoftDevice 7.2.0, installed by the latest Adafruit_nRF52_Bootloader.

The first SPI assigned is probably SPIM3. By not using the first SPI assigned, I worked around the problem. This code does not hang:

import busio, board, digitalio, time
from adafruit_bus_device.spi_device import SPIDevice

buf = bytes([0x90,0x00,0x00,0x00])

cs = digitalio.DigitalInOut(board.D3)
# comm_portx will get SPIM3
comm_portx = busio.SPI(board.D...
#

it is possible to avoid assigning SPIM3 at all: change nrfx_config.h to not use it:

-- a/ports/nrf/nrfx_config.h
+++ b/ports/nrf/nrfx_config.h
@@ -44,7 +44,7 @@
 #ifndef NRFX_SPIM3_ENABLED
 #if defined(NRF52840_XXAA) || defined(NRF52833_XXAA)
     #define NRFX_SPIM_EXTENDED_ENABLED 1
-    #define NRFX_SPIM3_ENABLED 1
+    #define NRFX_SPIM3_ENABLED 0
 #elif CIRCUITPY_NRF_NUM_I2C == 2
     #define NRFX_SPIM3_ENABLED 0
 #endif

There should be a cleaner way to do this in...

slender iron
#

welp, my amazing perf numbers were a lie

blissful pollen
#

that's frustrating

slender iron
#

yup

#

I learned a lot....

#

perf benchmarks that time themselves aren't a great idea πŸ™‚

blissful pollen
#

Was that with that spall tool?

tame grove
#

cool! I've read up on machine code in mpy last night and I think that's probably the by far easier first step compared to going full native internal. Did poke around the build system and was equal parts intimiated + impressed, heh

slender iron
#

and I had messed with what time we return 🀦

jaunty juniper
#

say, there are some commits in 8.0.x that have not been backported to main yet

#

(like the web workflow stability fix)

manic glacierBOT
#

This is initial support for the Lilygo T-Watch 2020 V3.
There are multiple "t-watch" products with quite different setups and on-board devices, but I only have one !

http://www.lilygo.cn/prod_view.aspx?TypeId=50053&Id=1380&FId=t3:50053:3

It's not super obvious to use at first because the display's backlight is handled by the APX202, which is an I2C Power System Management chip. The side button is also a power button (turns on if pressed 2 seconds, turns off if pressed 6 seconds) and ha...

manic glacierBOT
#

resolves #7637

Response sizes are in bytes.

Example of response:

{"free": 212992, "block_size": 512, "total": 963072}

Maybe we don't really need block_size in the results? I can remove it if not. I added it initially in order to test how it's looked up, which is needed to find the correct multiplier to get to bytes units.

Tested successfully with Feather ESP32-S2 TFT.

Thank you to: isacben, Neradoc, and anecdata who all helped me in getting this far on implementin...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0-beta.0-33-g9c1d83476 on 2023-03-17; Adafruit Grand Central M4 Express with samd51p20

Code/REPL

import board
import pwmio
a = pwmio.PWMOut(board.D8)
a.deinit()
a = pwmio.PWMOut(board.D8)
a.deinit()
a = pwmio.PWMOut(board.D7,variable_frequency=True)
a.deinit()
a = pwmio.PWMOut(board.D8)

Behavior

>>> import board
>>> import pwmio
>>> a = pwmio.PWMOut(board.D8)
>>> a.deinit()
>...
manic glacierBOT
#

Two unrelated fixes:

  • Rewrite allocate_pystack logic:
    • Saves space, fixes translation string, allow pystack to be set only when SAFE_MODE_NONE and remove upper size limit.
  • Increase auto-reload delay:
    • This has been an issue since a long time, closes #3502
    • On my microS2, I logged the time between subsequent calls to autoreload_trigger, most calls are <100ms but the 3rd last call has a difference of ~950ms. I suspect this to be something to do with the large fs.
manic glacierBOT
manic glacierBOT
#

I formatted the CIRCUITPY drive with windows formatting utility and it fixed double auto-reload.

This issue still exists and the above fix still applies. I used a windows machine to format the drive.

I logged the time between subsequent calls to autoreload_trigger, most calls are within 100ms but the third last call differs by:

  • Just Ctrl+S with the file open and no changes: ~940ms
  • Adding new data in the file and then saving: ~1080ms
  • Removing everything in the file and t...
manic glacierBOT
#

Is this bitmap referenced by anything else? TileGrid maybe? Otherwise you could do an explicitly free here.

TileGrid calls _get_pixel so it has no direct access to bitmap's data element. Added in the explicit free.

It's available as .bitmap, right?, so someone else could have a reference to it.

This is only to the Bitmap object in OnDiskGif. For Bitmap the data element is not accessed by any other object. (I searching through all shared-module for data and checked).

...

manic glacierBOT
#

This PR add codespell to pre-commit to check for typo with following config file

  • .codespellrc, .codespell/ignore-words.txt & exclude-file.txt

The rest is lots of typos detected and corrected by codespell. I did manual check/review on each file to make sure it does not affect actual code. There is still more but leaving this on purpose to see when ci-failed https://github.com/hathach/circuitpython/actions/runs/4456023057/jobs/7826197620
...

lone sandalBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.3 on 2023-02-23; Adafruit Feather ESP32S3 4MB Flash 2MB PSRAM with ESP32S3

Code/REPL

import time
import rtc

nowtime = time.struct_time((2023, 3, 18, 13, 47, 28, 5, 77, 1))
rtc.RTC().datetime = nowtime
now = time.localtime()
print("Time sent to RTC:", nowtime)
print("Time from RTC:", now)

nowtime = time.struct_time((2023, 3, 18, 13, 47, 28, 5, 77, 0))
rtc.RTC().datetime = nowtime
now = time.localt...
manic glacierBOT
thorny jay
#

Would you have the matching BIN file? I don't know how to boot the LILIN S2 Pico into UF2 mode.

rugged spindle
#

Click reset button
Wait until LED is lit
Hold BOOT button

#

I spent ages playing around and then found the instruction on the CP download page. Doh!

#

That works on the S2 Mini so might work on the S2 Pico

thorny jay
thorny jay
#

I would say there is one line out of two, that is why you can guess Wi-Fi but do not see the "-" that is eaten.

#

Do you have a branch with the code for this, I could have a look and try to compile CP myself.
Let me at least share some python code that work with stock CP.

#
import busio
import time

import displayio
import adafruit_displayio_ssd1306

displayio.release_displays()
i2c = board.I2C()  # uses board.SCL and board.SDA
oled_reset=board.LCD_RST
display_bus = displayio.I2CDisplay(i2c, device_address=0x3C, reset=oled_reset)
display = adafruit_displayio_ssd1306.SSD1306(display_bus, width=128, height=32)```
thorny jay
#

I hope no one is hurted that I keep the label on the screen... LadyAda style!

thorny jay
#

@jaunty juniper here is your code but without using board.DISPLAY and it does 8x2 "square" pattern.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.4 on 2023-03-15; Adafruit Feather ESP32-S2 TFT with ESP32S2
Board ID:adafruit_feather_esp32s2_tft
UID:487F305F7D21

Code/REPL

print(next(iter("test"), None))
# Expected: "t"

print(next(iter("test")))
# Expected: "t"

print(next(iter(""), None))
# Expected: None

print(next(iter("")))
# Expected: StopIteration

Behavior

The behaviour of CP's next() is not the same as Python's, the `next...

manic glacierBOT
#

Explicitly calling gc_free on data is making the build over size on the few M0 boards that include displayio.

Ideas (in my general order of best idea best to worst):

  1. Revert back to having the GC free data and my code setting the data pointer to NULL. This original change fit and still fixes the original issue.
  2. #ifdef SAMD21 (or similar) around the new code. I'm not sure if using port specific #ifdef in the common shared-module is a good idea.
  3. Try to find something else ...
thorny jay
#

It works as expected.
That is perfect now. πŸ‘ πŸ₯³

jaunty juniper
#

ok I'll PR it then

thorny jay
#

Maybe we can discuss how the text "wrap" on the prompt line, or how the prompt line does not blank the text that was there before.
But this is I believe a general issue, just exacerbated by the tiny screen.
On the serial I have ```Code done running.

Press any key to enter the REPL. Use CTRL-D to reload.
]0;Wi-Fi: off | REPL | 8.1.0-beta.0-24-gf532318d6-dirty
Adafruit CircuitPython 8.1.0-beta.0-24-gf532318d6-dirty on 2023-03-19; S2Pico with ESP32S2-S2FN4R2

The line on screen display >>> S2-S2FN4R2 with E and that is SP32S2-S2FN4R2 with E so the text with ESP32S2-S2FN4R2 wrapped where the 4 first character are overwritten by the REPL >>> .
If I that point I type spaces I can delete the offending S2-S2FN4R2 with E and get a clear prompt.

crimson ferry
#

(also, I print with line endings at the start of lines on small displays so there is no blank line at the bottom wasting space)

orchid basinBOT
#

When installing another board, the process stops at the same place but in this case the error is a malformed URL.
The URL has a double slash after bin. When the second slash is removed the file downloads successfully. This installer was working flawlessly a couple of days ago.

Connecting...
base_installer.min.js:12 Connected successfully.
base_installer.min.js:12 Try hard reset.
base_installer.min.js:12 Chip type ESP32
base_installer.min.js:12 Connected to ESP32
base_installer...
thorny jay
crimson ferry
#

there is some weird wrapping happening there, isn't there

thorny jay
#

We only have >>> on top of H*ll.

#

I forced to have spaces in my print to clear the space if anything is there.

jaunty juniper
#

yeah I did notice that when it's a small screen it wraps on itself

crimson ferry
#

would be nice if CIRCUITPY_REPL_LOGO was a boot.py thing

jaunty juniper
#

but I don't know what you would show in a REPL that small, the status bar shows the IP when you have one

thorny jay
#

Anyway, with such a size, seeing the REPL is not really the key function.

jaunty juniper
#

the API for the status bar and REPL is still rather wonky

manic glacierBOT
manic glacierBOT
tulip sleet
#

@jaunty juniper @thorny jay I will approve the PR if you think it is good enough.

orchid basinBOT
manic glacierBOT
manic glacierBOT
#

is there any evidence that OnDiskGif is useful within the RAM constraints of the HalloWing M0?

Quickly checked, with only 32Kb RAM it would not be worthwhile if you ever managed to get it to work. Maybe something added on to go straight from GIF->Display but that would be the only way I see it possible. OnDiskGif is currently turned off on all M0 builds.

The overflowing part is with the changes to displayio.Bitmap

lavish saffron
#

How do I adding typing for a microcontroller.Pin?

try:
    from typing import Union
    import adafruit_pca9685 as pca9685
    import pwmio
    import microcontroller
except ImportError:
    pass
...
def __init__(
        self,
        red_pin: Union[microcontroller.Pin, pwmio.PWMOut, pca9685.PWMChannel],
        green_pin: Union[microcontroller.Pin, pwmio.PWMOut, pca9685.PWMChannel],
        blue_pin: Union[microcontroller.Pin, pwmio.PWMOut, pca9685.PWMChannel],
        invert_pwm: bool = False,
    ) -> None:
  ...

Works on my laptop, but fails in the Github CI tests:

937 NameError: name 'microcontroller' is not defined
938
939 Error: Process completed with exit code 2.

I'm perplexed!

manic glacierBOT
still zephyr
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0-beta.0 on 2023-03-01; ESP32-S3-DevKitC-1-N32R8 with ESP32S3
Board ID:espressif_esp32s3_devkitc_1_n32r8
UID:866B3B736F82
boot.py output:

Code/REPL

import microcontroller
microcontroller.on_next_reset(microcontroller.RunMode.NORMAL)
...wifi DHCP lease timeout or similar...

Behavior

always forces a reboot to SAFE_MODE, not NORMAL (or otherwise)

Description

any cause for a reset, whether p...

lavish saffron
onyx hinge
#

@lavish saffron Exactly what is failing? It is a step of CI? What command is running? Can you link to the full code & log?

#

adafruit_magtag/magtag.py is an example of a CP library that uses microcontroller.Pin in its type annotations

lavish saffron
# onyx hinge adafruit_magtag/magtag.py is an example of a CP library that uses microcontrolle...

It's failing on the CI step that builds the Sphinx Docs after I opened a pull request on GitHub (the docs build on my local system):

917 Warning, treated as error:
918 autodoc: failed to import module 'adafruit_rgbled'; the following exception was raised:
919 Traceback (most recent call last):
920 File "/opt/hostedtoolcache/Python/3.11.2/x64/lib/python3.11/site-packages/sphinx/ext/autodoc/importer.py", line 60, in import_module
921 return importlib.import_module(modname)
922        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
923 File "/opt/hostedtoolcache/Python/3.11.2/x64/lib/python3.11/importlib/__init__.py", line 126, in import_module
924 return _bootstrap._gcd_import(name[level:], package, level)
925        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
926 File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
927 File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
928 File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
929 File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
930 File "<frozen importlib._bootstrap_external>", line 940, in exec_module
931 File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
932 File "/home/runner/work/Adafruit_CircuitPython_RGBLED/Adafruit_CircuitPython_RGBLED/adafruit_rgbled.py", line 35, in <module>
933 class RGBLED:
934 File "/home/runner/work/Adafruit_CircuitPython_RGBLED/Adafruit_CircuitPython_RGBLED/adafruit_rgbled.py", line 90, in RGBLED
935 red_pin: Union[microcontroller.Pin, pwmio.PWMOut, pca9685.PWMChannel],
936                ^^^^^^^^^^^^^^^
937 NameError: name 'microcontroller' is not defined
938
939 Error: Process completed with exit code 2.```
onyx hinge
#

@lavish saffron The true error is

$ python3 -c 'import pwmio'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/_env/lib/python3.9/site-packages/pwmio.py", line 50, in <module>
    raise NotImplementedError("pwmio not supported for this board.")
NotImplementedError: pwmio not supported for this board.
#

this causes the line import microcontroller to not be run

#

or the true error may be: ModuleNotFoundError: No module named 'adafruit_pca9685'

#

you can choose to:

  • from __future__ import annotations before anything else, even before the docstring. this means that the type annotations will not be evaluated as Python expressions at import time
  • change specific annotations to be strings (e.g., red_pin: "Union[microcontroller.Pin...]")
  • there may be other possibilities
#
  • you can try setting microcontroller, pwmio, and/or adafruit_pca9685 as mocked in sphinx
  • you can add adafruit_pca9685 to requirements.txt
#

pwmio is already mocked in sphinx config so maybe it's adafruit_pca9685 that is the problem during doc build

lavish saffron
#

Thanks. I'll experiment and see which works best. I'd never have figured this out by myself. I don't think adding adafruit_pca9685 to requirements.txt is a good idea, because it's only needed for typing.

onyx hinge
#
-autodoc_mock_imports = ["pwmio"]
+autodoc_mock_imports = ["adafruit_pca9685", "pwmio"]

Yeah try this

#

If your types are not merely annotations then it is a requirement

lavish saffron
onyx hinge
#
try:
    import doesnt_exist_ever
except ImportError: pass

x: doesnt_exist_ever.whatever

this won't work, because doesnt_exist_ever.whatever has to be a Python expression that is evaluated at import time. On standard Python.

#

if you have x: "doesnt_exist_ever.whatever" then it's not evaluated as an expression at import time

#

or if you have from __future__ import annotations

still zephyr
#

Just try the mocking of the pca9685 module and that solve the issue, and its building the docs locally

onyx hinge
#

I'm talking about how its treated on desktop Python which is important since pylint and sphinx work on modules with desktop python, even if it's a module like magtag that's only ever "used" on circuitpython

lavish saffron
lavish saffron
onyx hinge
lavish saffron
# onyx hinge I don't know what optional_requirements is used for

I usually stick pytest and other testing modules in there if I'm writing unit tests. No idea apart from that. I read in PEP 563 https://peps.python.org/pep-0563/#runtime-annotation-resolution-and-type-checking that imports that are only used for type checking can be ignored at runtime so I think this may be appropriate:

try:
    import typing
    from typing import Union
    if typing.TYPE_CHECKING:
        import adafruit_pca9685 as pca9685
        import pwmio
        import microcontroller
except ImportError:
    pass

So that the modules wouldn't need to be installed on systems that are only running the code.

orchid basinBOT
orchid basinBOT
onyx hinge
#

I noticed this on ReadTheDocs .. does anyone know what we need to do to make 8.0.x appear here and be treated as the newest?

#

(old docs say " You are not reading the most recent version of this documentation. 7.3.x is the latest version available." and the version chooser in the readthedocs sidebar doesn't have an 8.0.x choice)

#

<@&356864093652516868> we are about 2 hours from the weekly Discord meeting! It's a great time to add your notes to the document: https://docs.google.com/document/d/1y7kZuukcZXC1eiStMaMsI_YlglAAoW_fMbaQysK_CAY/edit?usp=sharing

I look forward to catching up with y'all in the meeting over in the CircuitPython voice channel.

proven garnet
#

So you could do pip install library_name[optional] (I think that's how I have the syntax set)

proven garnet
onyx hinge
#

that's .. interesting. A square wave is decoded by this logic analyzer as an apparently legal CAN frame

#

@proven garnet feel better soon .. and no need to push yourself over this, probably

proven garnet
# lavish saffron Would it be appropriate to add the modules that are only used for type checking ...

So given the above, they would go in requirements.txt because they are fully required for primary use. A litmus test I use is if they are needed outside of typing. If yes, it's worth putting them in requirements.txt because Blinka will still need them to interop with the code. If it's opt in or only used in examples, its best to put it in optional_requirements.txt and use strings as jepler mentioned.

slender iron
#

yup. I activated it under the versions tab

onyx hinge
#

@slender iron thank you

lone axle
#

I am getting these errors in the console trying to view the docs atm:

onyx hinge
#

@proven garnet @lavish saffron The other thing about rgbled is that maybe it's circuitpython_typing's pwmio.PWMOut that you want, because what's actually important is that there's a duty_cycle property on the object. Then you don't need to refer to that adafruit_pca9685 module at all. However, it checks the object for having a frequency property which isn't in the circuitpython_typing version of the type (not sure why it doesn't check for duty_cycle)

lone axle
#

Yep, unable to filter. Clicking the version pop-up thing doesn't seem to work on my end either. Poking a bit further: I do not have the same problem if I build the docs locally. Looking at where it's loading loading from I'm seeing a different file. The live page uses this URL: https://docs.circuitpython.org/_/static/vendor/jquery.js and in a local build the file is in _build/html/_static/jquery.js

onyx hinge
tulip sleet
tulip sleet
lone axle
digital shoreBOT
modern wing
#

Happily lurking today πŸ™‚

lone axle
turbid radish
#

😁

slender iron
#

πŸ‘

gilded cradle
#

I'm available

idle owl
#

All good.

turbid radish
modern wing
#

πŸŽ‰

errant grail
#

Woo hoo!

#

"Well Monte, I'll take the prize behind door one."

idle owl
#

😊 Thanks!

turbid radish
#

I missed you too!

idle owl
#

Thanks!

lone axle
#

Had never heard of distox before and was curious:

DistoX Bluetooth Protocol - mimic the DistoX protocol for communicating with paperless cave surveying tools
orchid basinBOT
#

The QT Py ESP32-C3 also has problems. The only difference is that this installer never worked. The other two boards were installing just fine for several days. (BTW, all this JavaScript development for browser based esptool and repl tools is very exciting! Chromebooks are what students have to use in many countries.)

Failed to load resource: the server responded with a status of 404 (Not Found) stylesheet:1 
base_installer.min.js:12 Connecting...
base_installer.min.js:12 Connected suc...
idle owl
#

Thanks everyone!

gilded cradle
#

Thanks

modern wing
#

Thanks everyone for an excellent meeting!

turbid radish
#

ok Jeff

#

sounds perfect

errant grail
#

Thanks!

ember iris
#

Thanks everyone, have a great week!

lone axle
#

Thanks for hosting Jeff, have a great day everyone.

slender iron
#

thanks all!

onyx hinge
#

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

manic glacierBOT
manic glacierBOT
#

PR to correct vectorshape lcoation

Testing Code

import vectorio
import displayio
import board

display = board.DISPLAY

palette = displayio.Palette(2)
palette.make_transparent(0)
palette[1] = 0xFFFFFF

reci = vectorio.Rectangle(pixel_shader=palette,width=10, height=50,x=100, y=100, color_index=1)

print(reci.location)
reci.location = (100, 5)
print(reci.location)

Before PR

Adafruit CircuitPython 8.0.4 on 2023-03-15; Adafruit PyPorta...
orchid basinBOT
midnight ember
#

Missed the meeting today. Was really nice to hear @idle owl again. πŸ™‚ Welcome back.

still zephyr
#

in the design guide we have stated that when printing we should use the " ".format() option, as some boards are not capable of using f-strings, have this changed recently?

stuck elbow
#

m0 boards still can't fit f-strings

still zephyr
#

Thanks (y)

onyx hinge
#

(though counter-intuitively an mpy-compiled module that uses f-strings can be used on even those boards)

stuck elbow
#

oh, right, because it's just a parser hack

jaunty juniper
#

didn't we enable f-strings on every board ?

#

or did we roll that back ?

stuck elbow
#

if we did, I missed that

jaunty juniper
#

yeah since 7.3.0

tulip sleet
#

we tried really hard to get f-strings on for everything, because otherwise we have to write examples that don't use f-strings

onyx hinge
#

oh I forgot about that. yays.

still zephyr
#

Got it, thanks.

manic glacierBOT
#

@dhalbert reverted deque changes, also remove lib from exclude and fix other remaining typos. Please again double check each file changes, there is changes to micropython (py/*) and other 3rd party. Let me know if you want to revert/ignore those files.

Add lib back to the exclude list. Let's do check py/. I'd rather spell-check just our code (and MicroPython's), not all this third-party code. Thanks.

slender iron
#

dan or jeff want to review my performance PR?

manic glacierBOT
#

Hi, thanks for this. I do use the watchdog but this error occurs unexpectedly at as yet unpredictable times and drops me into safe mode before the watchdog times out. Perhaps I am not understanding your query though? Β Thank you for pointing me to safemode.py I will look at whether that can help us in the meantime. Β Do you need more data from me to help diagnose?On 20 Mar 2023, at 21:37, Scott Shawcroft @.***> wrote:ο»Ώ
Are you using the watchdog to reset? Have you seen safemode.py?

β€”Repl...

manic glacierBOT
#

@gamblor21 I tested this on a PyPortal (SAMD51) with this test program:

import gifio

import gc

for i in range(1000):
    print(i)
    odg = gifio.OnDiskGif("/nyan.gif")
    odg.deinit()
    odg = None
    gc.collect()

If any of the last three lines is commented out, then I get a MemoryError. Is this what you would expect? I'd still love to fix the original problem about not gc'ing what is on the stack, but that may not be possible.

Would it be worth writing up s...

vale spire
#

hi! we're looking into some fixes for os.dupterm, which I know CircuitPython doesn't use, but you must have solved a similar problem for the various BLE/WiFi workflows?
(i'm spelunking right now, but still figuring out where to look exactly... in particular I'm curious how you handle things like Ctrl-C and whether this works for user streams or is specifically handled for the various workflows)
(actually i'm also not sure whether it does work like dupterm -- if you're using the wifi workflow, does stdout still get mirrored to the UART/VCP?)

#

speaking of... I guess this also applies to just regular UART/VCP... do you mirror stdout and support input from both between a default UART and the VCP on the tinyusb-capable ports?

manic glacierBOT
#

@dhalbert reverted deque changes, also remove lib from exclude and fix other remaining typos. Please again double check each file changes, there is changes to micropython (py/*) and other 3rd party. Let me know if you want to revert/ignore those files.

Add lib back to the exclude list. Let's do check py/. I'd rather spell-check just our code (and MicroPython's), not all this third-party code. Thanks.

ok, seems like I read your previous review too quickly and totally misunder...

tulip sleet
#

we don't usually do both UART and USB CDC, but I think it does work. Also we mirror the REPLoutput onto an on-board display if present

manic glacierBOT
#

If any of the last three lines is commented out, then I get a MemoryError. Is this what you would expect? I'd still love to fix the original problem about not gc'ing what is on the stack, but that may not be possible.

Yes that is what I would expect with a GIF that takes most of the memory available.

    odg.deinit()

This will free the displayio.Bitmap.

    odg = None

This will free the OnDiskGif and the memory held by the code that processes the...

manic glacierBOT
vale spire
# tulip sleet hi - maybe you are looking for this?? <https://github.com/adafruit/circuitpython...

yes! thank you!

and to answer my own question Ctrl-C appears to be handled in each of the sources individually (much like we do)

so, just like micropython, writes to stdout are blocking across all destinations, and poll-for-writing on stdout is not implemented. So https://github.com/micropython/micropython/issues/11026 might be of interest to you.

GitHub

import uasyncio, usys def can_write(s): yield uasyncio.core._io_queue.queue_write(s) async def write_stdout(data): await can_write(usys.stdout.buffer) usys.stdout.buffer.write(data.encode()) uasync...

lavish saffron
manic glacierBOT
bronze kernel
#

So, there is a circuitpython port for stm32f411 controllers, specifically the black pill board. There is another variant of this board sold with the f401 chip. Is porting circuitpython to this chip possible or for what reasons it isn’t?

stuck elbow
bronze kernel
#

From what I can see, the f401 has half as much ram as the f411. In my case (f401cc) it is 64 kb

bronze kernel
#

What would be the minimum ram requirement for circuitpython? I can’t seem to find it

bronze kernel
stuck elbow
#

it varies depending on the port

#

yeah, micropython has looser requirements, it can have many things disabled, so it has more ports

bronze kernel
#

Gemma M0 has 32MB of ram, and it is still supported

stuck elbow
#

the minimum is around 64kB, but the closer you get to that minimum, the more work it takes

jaunty juniper
#

my understanding too is that STM chips are tricky, they have different configurations of how the RAM is split between different blocks or whatever, and other odities

stuck elbow
#

you can try porting it, but it will be tricky

bronze kernel
#

What a nice opportunity to get familiar with stm chips!

#

I had no prior experience working with stm before lol

#

gotta read that datasheet, I guess

manic glacierBOT
#

I tried the usb_cdc.data on ESP32-S3 without luck:

boot.py -----------------
import usb_cdc
usb_cdc.enable(console=True, data=True) # Enable console and data
print("boot.py: usb_cdc.data", usb_cdc.data)

  • boot_out.txt ----------
    Adafruit CircuitPython 7.3.3 on 2022-08-29; ESP32-S3-DevKitC-1-N8R8 with ESP32S3
    Board ID:espressif_esp32s3_devkitc_1_n8r8
    boot.py output:
    boot.py: usb_cdc.data <Serial>

Seems that the usb_cdc.data works while booting ( 'boot.py: usb_cdc.data <Seria...

manic glacierBOT
small mantle
#

how can I clone a branch?

#

For research I cloned the adafruit repo and want to check something between 7.3.3 and main

stuck elbow
#

if you have cloned the repository then all the branches are in there, you can checkout them as you want

small mantle
#

oh yes sorry

tulip sleet
manic glacierBOT
bronze kernel
manic glacierBOT
slender iron
#

@tulip sleet or @onyx hinge want to review my imx improvements?

onyx hinge
#

@slender iron I'll dive in right now

slender iron
#

thank you!

tulip sleet
#

fine with me πŸ™‚

#

I have to get into i.mx hal, but haven't done that yet

slender iron
#

I'm gonna rework how we integrate the sdk this week

#

hal should be the same though

#

gonna spend a little time chasing a crash on samd21

#

(that perf bench triggers)

manic glacierBOT
onyx hinge
#

wow pull request review really needs some keyboard shortcuts, like "mark as viewed", "next/prev file"

slender iron
#

have you tried vimium?

#

0x20007f2c

#

heh, what's it say about me that my clipboard contents is a memory address?

manic glacierBOT
#

Forgive me @tannewt for not being clear enough. Ignore the watchdog or my code in this discussion as it will only cloud things - I was just trying to reply to your query. Regardless of the code on the device, we see occasional hangs, resulting in a hard reset to safe mode. Based on reading all the open issues related to the esp32-s3 overnight, perhaps what we see is related to the known S3 wifi issues?

I have been able to use the safemode.py approach for now (although I'd be keen to k...

slender iron
#

@onyx hinge was your think ink rp2040 def for the feather form factor board or something else?

onyx hinge
#

@slender iron I would have said I thought it was, but based on the pins.c file it doesn't look feather-ish at all

#

yeah it's not, there's a different non-feather-format board that's probably been teased but is certainly not released

#

(not that the feather is released either)

manic glacierBOT
#
  • Update tinyusb to latest, to pick up changes and also to pick up removal of all submodules (tinyusb submodules are now fetched with a script, so recursive fetch is no longer an issue). I did simple smoke tests on SAMD51, RP2040, STM, and nRF to test the update.
  • Removed no-longer-used tools/usb_descriptor submodule.
  • Change make fetch-submodules to use git submodule update --init --filter=blob:none. This does a partial clone of all submodules: all the tree metadata is fetch, but d...
manic glacierBOT
#

mimxrt10xx: implement i2sout

tested on metro m7 (green prototype version) with max98357a i2s amplifier and the following test code:

import board
import time
import digitalio
from audiobusio import I2SOut
from audiocore import RawSample
from microcontroller import pin
from ulab import numpy as np

n = np.array(np.sin(np.linspace(0, np.pi*2, 218, endpoint=False)) * 200, dtype=np.int16)
print(n)
r = RawSample(n, sample_rate=8000, channel_count=2)
def main():
    with digit...
onyx hinge
#

hooray! I finally have audio coming out of this little speaker!

#

@slender iron 😒 ```
build-metro_m7_1011/firmware.elf section .itcm' will not fit in region ITCM'
region `ITCM' overflowed by 912 bytes

slender iron
#

I'd suggest looking at the map file to see what has been added to that section

#

do you have debug on?

onyx hinge
#

no.

#

actually it's before enabling mp3, hmm, I just rebased my i2s work onto main and assumed without checking that it still worked

#

did we switch compilers for main?

#

I'm still on gcc-arm-none-eabi-10-2020-q4-major

slender iron
#

I don't think so

manic glacierBOT
slender iron
onyx hinge
#

@slender iron I had -UNDEBUG which turns back on assert messages, I think; and it was probably causing the problem

#

still ITCM is 96.90% full for me, shivers

slender iron
#

a lot of that is optional and we can move it out

#

I've been thinking about the ideal setup for it

#

theres error handling stuff that should always be in there

onyx hinge
#

I am guessing that mp3 decoding & audio mixing would benefit from having some key part in ITCM but it looks like that's not likely to happen

slender iron
#

and then everything else should really be performance guided

#

ITCM should really only be used for things that are always used

#

there is an icache for other code

onyx hinge
#

OK mp3 fits now without affecting ITCM use

slender iron
#

πŸ‘

onyx hinge
#

sorry for the false alarm! and thanks for the quick guidance

slender iron
#

np, I know its new

#

llvm/clang has a monthly meeting about making it work for embedded

#

I think PGO is the way to go for fast memory placement (versus detailed linker scripts)

onyx hinge
#

oops there went my CIRCUITPY drive

manic glacierBOT
onyx hinge
#
Adafruit CircuitPython 8.1.0-beta.0-49-g06fbd521c5-dirty on 2023-03-21; Metro MIMXRT1011 with IMXRT1011DAE5A
>>> import audiomp3
>>> import audiomp3
>>> r = audiomp3.MP3Decoder(open("/alot-128.mp3", "rb"))
Traceback (most recent call last):
[tio 12:29:28] Disconnected
```next thing to debug, creating an MP3 decoder object fails. boo.
manic glacierBOT
onyx hinge
#

well, the 64kbit/s encoded version works, so yay?

manic glacierBOT
#

There seem to be some reliability problems.

  • Sometimes, it becomes impossible to stop with ctrl-c or even UART 'break' which was supposed to be the super-ctrl-c. In this condition, data still comes IN from usb cdc.
  • sometimes it just crashes/freezes after ctrl-c'ing
  • a couple of times it ate the whole CIRCUITPY drive, requiring me to storage.erase_filesystem()

audiomixer can mix up to ~8 22.05kHz 16-bit mono samples. I mixed a random selection of samples from Glowing_Bottle_Cast...

onyx hinge
#

@slender iron I added new interrupts, do those have to be in ITCM?

#

namely this is called from interrupt context ```static void i2s_transfer_callback(I2S_Type *base, sai_handle_t *handle, status_t status, void *self_in) {
i2s_t *self = self_in;
if (status == kStatus_SAI_TxIdle) {
// a block has been finished
background_callback_add(&self->callback, i2s_callback_fun, self_in);
}
}

slender iron
#

Only if you want them to run during flash writes

onyx hinge
#

OK, so that's effectively "yes"

slender iron
#

I’m not sure how often user code will write flash and playback audio at the same time

manic glacierBOT
manic glacierBOT
onyx hinge
#

@slender iron rewriting CIRCUITPY via USB mass storage is something most folks will do

idle owl
#

Are we intentionally still including 7.x on circuitpython.org/libraries? At this point, I don't recall what our thoughts were on this, whether we always keep the current stable and most recent stable, or what the plan was there. I'm currently doing a bit of work on that page, so if that needs to be updated, I can do so. But I also don't want to remove it if it's intended to remain.

slender iron
onyx hinge
#

@slender iron what's the alternative? make CIRCUITPY read-only to the host when audio's running?

slender iron
#

a write to CIRCUITPY will cause a reload anyway

#

so why not just stop the audio?

#

or have the interrupt in flash

onyx hinge
#

right now that's not what it does, though nobody's happy about the skipping audio during CIRCUITPY writes

slender iron
#

much of the time you'll be loading more audio from flash anyway

#

so it doesn't make sense to have the interrupt run while flash is unavailable

onyx hinge
#

there's 2 parts. there's the interrupt, which is small and only registers work to be done from background callback

#

do you mean just masking the interrupt temporarily, or reaching into running audio objects and stopping them?

#

hm, SAI_TransferTxHandleIRQ / I2S0_DriverIRQHandler are just in text so maybe this is either a red herring or an incomplete fix. What I'm chasing is, the board just crashing with the new audio code. and no I haven't attached a debug probe to it yet.

#

but only sometimes, and usually when I have tried to write CIRCUITPY

slender iron
#

I don't think the interrupt needs to be in ITCM because it'll be masked during flash erase and write

#

definitely attach the debugger

onyx hinge
#

yeah tomorrow

#

it's too bad I believed the ITCM change made it not crash, I must have changed something else in my testing procedure too

slender iron
#

you could put it back into the ITCM to see if it fixes it

manic glacierBOT
#

Another option would be to make OnDiskGif take in the Bitmap to load into. That way you don't need to reallocate a huge chunk of memory each loop. That'll better fragmentation-proof your code.

I think I tried that when I was first writing it. I think it would make most sense to have it optional. The only problem with pre-allocating is your may not know the GIF size.

That said should I leave the deinit code in displayio.Bitmap or back that out? Obviously the gc_free has to come out...

tulip sleet
manic glacierBOT
manic glacierBOT
still zephyr
#

When I am building circuitpython with the latest commit https://github.com/adafruit/circuitpython/commit/461d833c1c9ead38542dbbfe665af5c3446035bd for the Pyportal Titano, Circuitpython is crashing and taking me to safe mode. is there any change that we have included since yesterday that could cause this. I build CP in https://github.com/adafruit/circuitpython/commit/08c9eb9f00a4c88d0a81f9b6d5e4298d021ca74c and it works fine without crashing.. I did make clean, and V=2 if anyone is interested in see the output.

tulip sleet
still zephyr
#

No I did not, should I test with that?

tulip sleet
#

Yes, I am updating my fork and will try building from that. I built Metro M4 and tested that before I submitted the PR, but I will test PyPortal and PyPortal TItano

still zephyr
#

ok, will do

tulip sleet
still zephyr
tulip sleet
#

I have to bisect tinyusb, I think

#

the other changes should not be making it crash -- they are just git things

still zephyr
#

got it. thanks again

manic glacierBOT
tulip sleet
still zephyr
#

No worries, thank you

wraith crow
#

I'm seeing a problem with web workflow on the Pico W and the latest S2 build that also wasn't happening on the 8.0.4 S2 release. As soon as I try and connect via web workflow (serial terminal or file browser) the board crashes. If I'm connected to the REPL an OSError: [Errno 11] EAGAIN is displayed. Do you think it's related to the PyPortal issue you're looking at or should I open an issue?

tulip sleet
#

I think it was in 8.0.3, fixed in 8.0.4, but not sure I remember right

manic glacierBOT
wraith crow
#

Do I need to update something to get the new make fetch-submodule function to work? I build on Debian and git doesn't seem to like git submodule update --init --filter=blob:none

jaunty juniper
#

what do you mean ?

wraith crow
#

I just cloned a new copy of circuitpython and when I attempt to run the make fetch-submodules, it now runs git submodule update --init --filter=blob:none which the git on my install rejects with a usage error. If I go back to the makefile in 8.0.4 the fetch-submodules function consisted of two different commands so I'm assuming the one that' s failing for me is an updated procedure

#

I am running the old version now but I assume the new version is the preferred way to go

manic glacierBOT
#

@tannewt The crash is caused by this change, which adds a const:
https://github.com/adafruit/circuitpython/blob/5bb8a7a7c68781e6edbd3aebaf7eeeecb310bd86/tools/gen_display_resources.py#L167
If I remove the const, the crash does not occur. Why this is true is not at all obvious to me. It does explain why the crash occurred on the PyPortal and not on the Metro M4 (which has no display). The casts added to this file and the other new consts do not make a difference.

(I tried undoing a ...

tulip sleet
#

I tried to find out when --filter was added to git submodule update` but it was not immediately obvious.

#

You can use the old make fetch-submodules, it is just a little bit slower, and it creates shallow clones, which can be a bit of a nuisance if you want to change commits in the submodule.

wraith crow
#

git version 2.30.2

tulip sleet
#

I am on 2.40.0. I am using the git-core-ubuntu-ppa.

#

what is your OS and its version

wraith crow
#

Linux 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 GNU/Linux

#

I'm not sure why my git isn't updated to the latest, but I assume it will make it to my distro eventually. If the shallow clones are causing the issue I think they are then I'm happy the new method is in place, now I just have to dig in and try and figure out how to get 2.40 πŸ˜„

tulip sleet
#

I looked at the .0 release notes for the releases between 2.30.0 and 2.40.0, and I can't see which one added it. But there are many more bugfix releases in between, and the descriptions are such that something obscure might have added this feature.

#

what is /etc/issue on your system?

#

suggests using the -backports package for your release

wraith crow
#

pi@Rohan:~$ cat /etc/issue
Debian GNU/Linux 11 \n \l

tulip sleet
#

i can make the target be more robust

#

do apt show package-name -a to find out about backports

#

apt show git -a

wraith crow
#

Well your link looks promising, I'm a little slow in Linux as the only thing I do on it is build CP. I suspect you've dug up all I need 😁 Thanks!!!

#

pi@Rohan:~$ apt show package-name -a to find out about backports
N: Unable to locate package package-name
N: Unable to locate package to
N: Unable to locate package find
N: Unable to locate package out
N: Unable to locate package about
N: Unable to locate package backports
E: No packages found

tulip sleet
#

let me know what the backports version is and if it works; that will give us some indication package-name is a metavariable, like "foo". Do apt show git -a

wraith crow
tulip sleet
#

add the repo either via synaptic or via the command line

#

after it is added, then you can do apt show package-name -a

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.4 on 2023-03-15; Adafruit Feather M0 Express with samd21g18

Code/REPL

import gc
import board
import adafruit_vl53l4cd  # TOF
import time
import neopixel
import simpleio
import touchio
from digitalio import DigitalInOut, Direction, Pull

gc.collect()   # make some rooooom, WIP, copied from code on M0 Express board

pixel_pin = board.NEOPIXEL
num_pixels = 1
ORDER = neopixel.GRB
pixels = neopixel.N...
wraith crow
#

Okay the apt show git -a now indicates that 2.39.2 is available, I'll try installing that

#

It looks like 2.39.2 has the feature the new make fetch-submodules is working now.

tulip sleet
#

I should probably make it do it the old way if the command fails.

wraith crow
#

Probably, but I'm glad it failed for me first so I could get the new version. If it's possible to throw a message up after the old way completes hinting that there's a better way that might be worth while, unless you think all distros will get the 2.39 or later version relativly soon.

#

Another nice feature of the new command is that I often have to run the fetch-submodules command more than once because of failed submodule clones, with the old version it was hard to tell when everything was complete, but this version just comes back with nothing if there's nothing to do

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0-alpha.2-16-g60a9c7e5b on 2023-03-22; Raspberry Pi Pico W with rp2040

Code/REPL

No code executed, tested without a code.py

Behavior

During my testing I first dismounted the CIRCUITPY drive and then attempted to access the web workflow URL. on commit https://github.com/adafruit/circuitpython/commit/60a9c7e5b2570a84c07c6c0c78f73c63322937f0 and newer the Pi Pico W would restart as soon as I clicked ...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0-beta.0-47-gc93560144 on 2023-03-22; Waveshare RP2040-Zero with rp2040

Code/REPL

>>> import struct
>>> struct.pack("2H", 1)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: can't convert  to int
>>> struct.pack("2H", 1, 2)
b'\x01\x00\x02\x00'
>>> struct.pack("2H", 1, 2, 3)
Traceback (most recent call last):
  File "", line 1, in 
RuntimeError: too many arguments provided with th...
jaunty juniper
#

[edited: issues with fetch-submodule, but I'll see if it's a local problem fixed with recloning]

manic glacierBOT
manic glacierBOT
onyx hinge
#

anybody run into an error like this? ```jepler@eric:~$ pyocd list

Probe/Board Unique ID Target


0 Segger J-Link 50128794 n/a
jepler@eric:~$ pyocd gdbserver -t MIMXRT1010
0000798 I Target type is mimxrt1010 [board]
0000935 C No emulator with serial number 50128794 found. [main]
Traceback (most recent call last):
File "/home/jepler/.local/pipx/venvs/pyocd/lib/python3.9/site-packages/pyocd/probe/jlink_probe.py", line 168, in open
self._link.open(self._serial_number_int)
File "/home/jepler/.local/pipx/venvs/pyocd/lib/python3.9/site-packages/pylink/jlink.py", line 723, in open
raise errors.JLinkException('No emulator with serial number %s found.' % serial_no)
pylink.errors.JLinkException: No emulator with serial number 50128794 found.

#

"sudo" doesn't help

manic glacierBOT
slender iron
#

@onyx hinge I haven't seen that. I just use JLink's software though

#

JLinkGDBServer -if SWD -device MIMXRT1011xxx5A

onyx hinge
#

yeah I did eventually get it working that way

#

and then couldn't reproduce my crashes πŸ˜…

slender iron
#

πŸ™‚

#

I think I'm going to write a script to generate the pin mappings

#

so I can fill in the i2s stuff for you

onyx hinge
slender iron
#

I'm planning on adding the rest of the chips so a python script will make it simpler

#

my sdk update makes it all easier

tulip sleet
#

i haven't yet tried pyocd, sorry

slender iron
#

I'm not sure pyocd does flashing with external flashes that well

slender iron
#

@onyx hinge want me to wait to merge the sdk changes? it'll conflict with your i2s PR

onyx hinge
#

@slender iron I'm fine with rebasing i2s

#

it should be quick

slender iron
#

πŸ‘

onyx hinge
#

if it's not, well,

slender iron
#

yup, just changing the location of the added source file

slender iron
#

don't forget to git submodule sync to pick up the submodule source switch

tulip sleet
#

I should probably add git submodule sync to make fetch-submodules

slender iron
#

πŸ‘

#

good idea

#

I love how much faster it is now

manic glacierBOT
tulip sleet
#

maybe you saw last night it requires a pretty new git (somewhere past 2.30). bullseye doesn't have it by default, but it's in backports. Not sure if I should add a fallback or just document it. I need to find the minimum version: the release notes are not that helpful

onyx hinge
#

I already have the backports one on my debian bullseye (but I also just directly enter git commands rather than using the makefile for submodules; I should reeducate myself on that)

tulip sleet
#

it SHOULD be an option in .gitmodules, I would say, but this is better than nothing

manic glacierBOT
bronze kernel
#

ok

#

I am trying to build circuitpython from source

#

But make says that it has no rule for building peripherals/samd/samd21/adc.c

#

(i am trying to build it for a circuit playground express as a test)

tulip sleet
#

you need to do make fetch-submodules at the top level to get all the git submodules brought in

bronze kernel
#

I already did that

#

but welp, I'll try again

#

maybe it will help

tulip sleet
#

what did it print when you did that? It newly requires a recent version of git, and perhaps it just printed an error.

#

what OS are you doing it on?

bronze kernel
#

endavourOS

tulip sleet
#

what does git --version say?

bronze kernel
#

git version 2.40.0

tulip sleet
#

that should be fine

#

yes, try it again, and see whether ports/atmel-samd/peripherals exists and has files in it

bronze kernel
#

yeah, it does exist

#

still didn't work though

#

also that folder is empty

tulip sleet
#

that isn't good: what does it print when you do make fetch-submodules

#

nothing? It should take several minutes

#

is this your fork? Did you update main in it, if it is?

bronze kernel
#
git submodule update --init --filter=blob:none
bronze kernel
#

and i am on my branch

tulip sleet
#

try git submodule sync first

#

then do that

#

again

bronze kernel
#

still nothing

tulip sleet
#

testing it myself...

#

try a fresh clone of your repo under another name, e.g. git clone https://github.com/yourname/circuitpython 1circuitpython; cd 1circuitpython; make fetch-submodules

#

it is working for me on a fresh clone

slender iron
#

(I'm on arch so its unlikely an OS issue)

tulip sleet
#

is endeavour arch?

slender iron
#

arch based

bronze kernel
#

seems to have worked!

#

thanks!

tulip sleet
#

not sure what is up with your other clone, but great!

manic glacierBOT
#

I am seeing the issue on the latest build from circuitpython.org. I am a bit concerned I'm missing something because the commit that the problem seems to start at doesn't make a lot of sense for this type of issue and I'm surprised that no one else has reported this by now. I did try plugging the pico w into both a Windows 8 PC and a Linux box and got the same result. I also connected the Pico to a usb charger so there was no computer involved and confirmed that web workflow didn't work in th...

manic glacierBOT
#

Just got this product in: https://www.adafruit.com/product/1028

Using it with this product: https://www.adafruit.com/product/5477

Exactly the same as this issue: https://github.com/adafruit/Adafruit_CircuitPython_IL0373/issues/28

CircuitPython Version: Adafruit CircuitPython 8.1.0-beta.0-50-ge1f16472c on 2023-03-22; Adafruit Feather ESP32S3 4MB Flash 2MB PSRAM with ESP32S3

![image](https://user-images.githubusercontent.com/2934507/226999973-2e1f409a-9150-4540-af3c-34df7fe11f5f.p...

#

This reverts commit 7e6e824d5655026906b6515070aeb604d2ef3426.

Fixes #7770

The change in #7623 needs to be revered; the raise-site added in #7632 is the correct one and the one in socketpool needs to be reverted.

This is not affecting 8.0.x because #7623 was not back-ported to there before we realized it was not a full fix.

Both #7770 and #7606 should be re-tested. I didn't test.

jaunty juniper
#

@onyx hinge sould it do n_args+1, i+1 ? (because the format is an additional argument)

(void)mp_arg_validate_length(n_args, i, MP_QSTR_args);
>>> struct.pack("3H", 1, 4)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: args length must be 3
#

or is it clear enough ?

#

it's not the same as function takes x positional arguments but y were given

#

I guess I answered my question !

onyx hinge
jaunty juniper
#

no, my bad, it makes sense that it's the size of the vararg

onyx hinge
#

or maybe there's another QSTR that could be used, such as MP_QSTR_values

#

standard documentation uses that word: "Return a bytes object containing the values v1, v2, ... packed" as does our docstring def pack(fmt: str, *values: Any) -> bytes:

jaunty juniper
#

it is called values in the docs

manic glacierBOT
onyx hinge
#

Thanks @jaunty juniper that makes it better

idle owl
#

Uff, who wants to help me with an error I'm encountering trying to update my local copy of CircuitPython?

#

git pull is happy, says up to date. make fetch-submodules on the other hand, got through part of the update, then threw this error. Rerunning it changed nothing except that it doesn't go through any updates, it simply throws the error now. ```
$ make fetch-submodules
git submodule update --init --filter=blob:none
fatal: 'adafruit' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: Fetched in submodule path 'ports/broadcom/peripherals', but it did not contain d3a6b50a21e7dd49ba4bfa0374da3407594caa50. Direct fetching of that commit failed.
make: *** [Makefile:332: fetch-submodules] Error 128```

#

It ran earlier...

tulip sleet
idle owl
#

That's the unusual one right? I created a separate DMG for it to do exactly that.

#

So yes I believe so

tulip sleet
#

ok, good

#

try doing git submodule sync, and then repeat make fetch-submodules. If that doesn't work, can you just do a fresh clone?

idle owl
#

Probably on the fresh clone. Was pretty proud of not having needed to do that in a long time though. πŸ˜„

#

I'll try that first.

#

sync did a thing, and then make throws the same error.

#

I guess it's fresh clone time. Bleh.

#

Unless anyone else has run into this before and has a suggestion to try.

tulip sleet
#

You could try git clean -ffdd

idle owl
#

Ooh, what does that do

tulip sleet
#

I think it might clean out the submodules ... no it didn't

idle owl
#

Hah ok

#

I'm usually first in line for a fresh clone, lol.

tulip sleet
#

@jaunty juniper did you have any suggestions?

idle owl
#

I have one untracked directory that I need to dig out of there, a new board def I think I was working on.

#

Otherwise, I don't think there's anything else in progress.

jaunty juniper
#

no I have been having issues with fetch-submodules but sync solved the last one

#

it was that:

❯ make fetch-submodules 
git submodule update --init --filter=blob:none
fatal: remote error: upload-pack: not our ref 2b9354539e6e4f722749e87b0bdc22966dc080d9
fatal: Fetched in submodule path 'ports/mimxrt10xx/sdk', but it did not contain 2b9354539e6e4f722749e87b0bdc22966dc080d9. Direct fetching of that commit failed.
make: *** [fetch-submodules] Error 128
tulip sleet
#

ok, got to go cook but I will do a little more research. I have seen like three unique problems which I haven't duplicated

idle owl
#

Hmm.

#

I'll rename the current clone directory, and keep it around for testing or trying to fix.

#

I'm kind of blocked on this for something else, so it's fresh clone time.

jaunty juniper
#

I had another one in a different working directory, but that one might have been due to weird things on my side, so i recloned, then had weird problems again when switching branches that solved themselves by a checkout

#

(some submodules had been left in a modified state)

tulip sleet
#

i would like to find a way to "uninit" and remove the submodule fetches

manic glacierBOT
timid bolt
#

Hi everyone! I've been out sick for the past 1+ weeks, but I'm starting to come back now. I'm a little sad that the PRs I sent 2 weeks ago haven't attracted any attention. πŸ˜₯

idle owl
tulip sleet
#

@jaunty juniper @idle owl Ooh neat git submodule deinit --all (or you can deinit a particular one). That might help.

idle owl
#

I'll check it out, thanks!

#

Trying it now.

tulip sleet
#

you could try it on the one you moved aside. adding -f will deinit them even if there are changes inside

idle owl
#

Ooh ok

#

make fetch-submodules ran through a bunch of things, and then threw the same error.

idle owl
#

It did a lot of things.

#

I'll keep this clone around for now though.

tulip sleet
#

@blissful pollen21 you just did something which added a huge number of changes. Can you back that out? just pull your branch and you will pick up my single commit change. You can do a git reset --hard 4d09afa to just go back to your doc addition and then do a git push -f

blissful pollen
tulip sleet
blissful pollen
#

Okay makes sense I'll revert it back. Sorry about that

tulip sleet
#

i am just worried about reversions to main from such a large PR

blissful pollen
#

With the reset will it set it back before I did the rebase then? I think I can find the original commit for my branch still

#

ugh sorry I missed that commits went to 132 😦 now I see clearly why that was bad

tulip sleet
blissful pollen
#

okay thanks I'll try that. I know I should just avoid anything crazy in git by now!

manic glacierBOT
blissful pollen
#

Fingers crossed I think I fixed it (not perfectly maybe but removed all the commits)

tulip sleet
blissful pollen
tulip sleet
blissful pollen
#

Dan just so you know somehow I lost my first commit but I know what was in it / can find it so I'll recommit it hopefully later tonight.

tulip sleet
blissful pollen
#

I'm not even sure how I lost that brace. It was just the definition of deinit in OnDiskGif so simple enough to put back

blissful pollen
#

Thanks I have the commit id on my own machine too if i need. Just will be a few till I can get to it. Not sure when you're aiming for the next release if that matters

tulip sleet
#

not for a couple of days at least, I think

blissful pollen
#

Okay I'll get to it before then for sure

manic glacierBOT
manic glacierBOT
onyx hinge
#

on metro m7 I've been seeing that it's easy to get it into a state where ctrl-c does't work to send KeyboardInterrupt. this tends to happen if I accidentally type something in on the repl but my program is never going to read it. I think maybe @slender iron made the USB CDC buffer really small to reduce RAM footprint? but the newer "serial break" feature, if you can get your terminal program to do it, does succeed in causing a KeyboardInterrupt.

manic glacierBOT
still zephyr
#

@idle owl Hello, do you think it would be a good Idea to use the picture that they used yesterday in ask an engineer, celebrating the 100th libraries in the community bundle, in the readme of the repo?. I could put it there if the answer is yes πŸ™‚

random junco
#

I like that idea. πŸ™‚

idle owl
manic glacierBOT
still zephyr
#

Thank you !!!\

ornate breach
#

Look how cute blinka looks in that banner πŸ™‚

idle owl
#

I came up with the design, Bruce made it a beautiful reality. πŸ™‚

still zephyr
#

I like it very much!

slender iron
onyx hinge
#

or something from the upgrade to tinyusb?

slender iron
#

maybe

#

I'd suspect the upgrade if we see it on other ports

onyx hinge
#

I have to actually hook up some speaker or headphones but maybe "mqs" (PQMAudioOut) is starting to work too. top are L/R channels as digital, bottom is as analog with the saleae sampling at just 15kHz. The carrier frequency is about 192kHz so it "should be" un-hearable.

#

some musical notes

tulip sleet
#

@slender iron ok, we are down to 22 PR's after I closed some stalled ones.

#

and we finished off some recent ones

manic glacierBOT
slender iron
#

thanks @tulip sleet !

manic glacierBOT
idle owl
#

@tulip sleet The CircuitPython install template still has "entering safe mode in 6.x" separate from 7.x, which I assume is the same as 8.x. Should we remove the 6.x at this point?

#

Either way, I need to explain that 7.x is the same if it is.

#

There's no mention of 8.

#

Only the RP2040 install template has it.

tulip sleet
idle owl
#

Ok.

tulip sleet
#

I saw this in the Lyre guide, seemed a little excessive

idle owl
#

I think it already is in the troubleshooting.

#

I'll delete it.

manic glacierBOT
idle owl
#

Fixed.

tulip sleet
#

@onyx hinge @slender iron I am starting on release notes for 8.1.0-beta.1, can wait for #7785 above, etc., not in a big rush

#

68 PR's already

onyx hinge
#

wow and thanks

#

release notes are real work

tulip sleet
#

really helps to give perspective on how much work is going on; I don't mind the review

onyx hinge
#

is it new to have the logos next to the roles?

random junco
#

added this morning

onyx hinge
#

aha

lone sandalBOT
slender iron
#

kinda interesting for ulab style stuff

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Category Channels

8

Text Channels

63

Voice Channels

7

Members

37002

Roles

37

manic glacierBOT
#

If I use my test program (see below_, and then ctrl-C it, then when I restart it, I get:
``
Traceback (most recent call last):
File "", line 1, in
File "play.py", line 14, in
ValueError: I2SOut in use

This is confusing, because it's not known to the user that I2S is in use, and something is not being reset when the VM starts up (or shuts down).

```py
import array
import board
import os
import time

from audiocore import RawSample, WaveFile

from audiopwmio import P...
#

Also the "." debugging printout continued to run after the playing was finished. Maybe that's just how the I2S hw is working, but it seems like the interrupt continues even when play is done:

>>> import play
note: peripheral 3
 0 mak11.wav
 1 mak12.wav
 2 mak14.wav
 3 mak15.wav
 4 mak16.wav
 5 mak17.wav
 6 mak22.wav
 7 mak22050.wav
 8 mak24.wav
 9 mak8.wav
play: 0
  playing mak11.wav
.............................................................................................
manic glacierBOT
#

Yes, we keep feeding the peripheral with zeros (only signed 16-bit samples are ever output, so this is the "quiescent value"; the value specified by the user is always ignored) because otherwise the hardware signals FIFO underruns and gets grumpy. There may be a clever way to turn the FIFO off exactly when it empties, but it was easier to just keep giving it zeroed data.

manic glacierBOT
tulip sleet
#

@onyx hinge you saw my comment about I2SOut in use after ctrl-D, is that right?

manic glacierBOT
manic glacierBOT
#

On 57ac9aa763587221c2bf55dce746bd50e58159dd, which is current Master, I cannot make fetch-submodules.

fatal: remote error: upload-pack: not our ref 2b9354539e6e4f722749e87b0bdc22966dc080d9
fatal: Fetched in submodule path 'ports/mimxrt10xx/sdk', but it did not contain 2b9354539e6e4f722749e87b0bdc22966dc080d9. Direct fetching of that commit failed.
make: *** [Makefile:332: fetch-submodules] Error 128

Running git submodule deinit --all -f doesn't help.

manic glacierBOT
brazen hatch
#

Spamming exec still crashes with a large enough pystack.
I am inclined to believe heap is at fault somehow.

#

With stock pystack though it all works fine.

#

I still have no idea how to decode the cpu crash dumps.

manic glacierBOT
slender iron
#

you give it the elf file and then copy and paste in the Backtrace: lines

brazen hatch
#

OHHH, NICE!

#

brb

#

I have an esp to break

tulip sleet
manic glacierBOT
manic glacierBOT
idle owl
#

The Windbond chip is the QSPI flash, right? I mean it's the only thing on this board that's the proper size, but I wanted to verify anyway.

idle owl
#

Thanks!

lone axle
#

Has anything changed with regards to make fetch-submodules I'm getting this error trying to run that on a fresh cloned repo:

❯ make fetch-submodules
git submodule update --init --filter=blob:none
usage: git submodule [--quiet] [--cached]
   or: git submodule [--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--] <repository> [<path>]
   or: git submodule [--quiet] status [--cached] [--recursive] [--] [<path>...]
   or: git submodule [--quiet] init [--] [<path>...]
   or: git submodule [--quiet] deinit [-f|--force] (--all| [--] <path>...)
   or: git submodule [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-shallow] [--reference <repository>] [--recursive] [--[no-]single-branch] [--] [<path>...]
   or: git submodule [--quiet] set-branch (--default|--branch <branch>) [--] <path>
   or: git submodule [--quiet] set-url [--] <path> <newurl>
   or: git submodule [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]
   or: git submodule [--quiet] foreach [--recursive] <command>
   or: git submodule [--quiet] sync [--recursive] [--] [<path>...]
   or: git submodule [--quiet] absorbgitdirs [--] [<path>...]
make: *** [Makefile:332: fetch-submodules] Error 1
jaunty juniper
lone axle
#

This page in the docs mentions Ubuntu 22.04 and shows sudo apt install git which is what have / have done as far as I am aware 😫

jaunty juniper
#

yeah that change is causing a lot of problems, I don't think we fully know what it does even

lone axle
#

Is it completely impossible to do it with the an older version? I feel like I did it very recently. I'm willing to try some workarounds if some are available.

jaunty juniper
#

you could use the old fetch-submodules ?

git submodule update --init -N --depth 1 || true
git submodule foreach 'git fetch --tags --depth 1 origin $$sha1 && git checkout -q $$sha1'