#circuitpython-dev

1 messages · Page 49 of 1

slender iron
#

sd cards are your best bet for gigabyte scale storage

#

not sure exactly but I know it include bad block tracking

#

definitely not worth your time

ornate breach
#

Bummer

#

Okay

slender iron
#

sd cards include microcontrollers that manage it all for you

#

you can find chips that act like sd cards but I don't think they are worth the cost over an sd card

ornate breach
#

Perhaps I could use those SD flash chips Ladyada made breakouts for

#

Ah

slender iron
#

ya, but then they aren't removable

ornate breach
#

I’m not bothered by not being removable

#

I am making some gifts that will be used by my kids so removable isn’t super desirable

spare jacinth
#

Whatever the hardware underneath is, you could (no idea how) display a "fake" filesystem (like uf2 bootloaders do), such that writing actually writes to the real filesystem under the hood and "removing" does nothing. Maybe with some button on boot to disable this (cant remove) behaviour.

I would just use a SD card and edit its content by plugging on the computer tho

ornate breach
#

I’m actually wondering if given the right NAND flash that SDIO would work.. I kind of want to try now..

#

Lol.. I’ll let you know the results

slender iron
#

ya, if you can find an IC that acts like an SD card then it should work

#

no promises

ornate breach
#

My guess is the biggest thing would be needing continuous read support and being able load the entire contents of the flash.

#

I am sucking at English today, wow.

stuck elbow
ornate breach
#

Yeah, it’s one that’s not exactly readily available outside Adafruit’s module

thorny jay
ornate breach
#

I see the raw chip on lcsc or versions of it anyway

manic glacierBOT
#

@RetiredWizard Curious I just had another look at the 8.2 branch compared to MP and the only thing different that stands out (but that I don't think it the issue) is CP is not setting CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL to anything. MP sets it to CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=8192

That setting will try to put smaller allocations in internal SRAM instead of PSRAM - which might cause less fragmentation in PSRAM. You could try building with that added to the TinyPICO settings.

A...

manic glacierBOT
#

Hi again,

I checked and apparently mbedtls has the ability to cache the handshake (and possibly speedup), using the MBEDTLS_SSL_CACHE_C:
https://github.com/Mbed-TLS/mbedtls/blob/1bc2c9cb8b8fe4659bd94b8ebba5a4c02029b7fa/include/mbedtls/config.h#L2884-L2894

BUT, as i see MBEDTLS_SSL_CACHE_C was NOT defined in circuitpythons' mbedtls_config.h, therefore currently cache seems disabled:
https://github.com/adafruit/circuitpython/blob/main/ports/raspberrypi/mbedtls/mbedtls_config.h

No...

manic glacierBOT
orchid basinBOT
slender iron
#

@candid sun want to video chat to go over HUSB review comments? I had a lot...

candid sun
#

@slender iron sure yeah

slender iron
#

I'll hop in the amelia voice/video chat channel

slender iron
#

@candid sun I just realized I sent you the wrong talk. Will find it after lunch

slender iron
manic glacierBOT
#

It sounds as though the current problems with BLE service support relate to dynamically adding services / characteristics / descriptors after things are running. IIRC, a similar limitation exists for USB HID devices. The solution for USB was to require things to be setup within boot.py.

Could a similar requirement to setup BLE in boot.py avoid the dynamic update problems you listed above, and thus enable BLE on these boards in an earlier milestone?

manic glacierBOT
#

Thanks for getting a new PID! You'll need to fix the pre-commit test before we can merge. It should be auto-fixable on your machine. See pre-commit info here: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/check-your-code

Ah I see what happened - I got lazy and edited it on github directly so not everything got triggered properly. Updated from my own machine now - thank you for your patience.

manic glacierBOT
fringe trench
#

There's a core library - usb_midi - that isn't available on the Winterbloom Big Honking Button board. What would I have to do to make that library available on that board in a future CP release?

manic glacierBOT
tulip sleet
manic glacierBOT
fringe trench
#

Thanks! I'll ping her on her discord when she's back online.

slender iron
#

@lone axle have you had issues with the .root_group changes? I'm seeing it ignore when assigning to root_group on a subclass of BusDisplay

manic glacierBOT
lone axle
slender iron
#

hrm

lone axle
#

What is an example of a BusDisplay subclass? I don't recall seeing that name before I don't think

slender iron
#

its the new name for Display

#

I think the MP merge may have broken it

#

(which is good)

#

needs to add a test

#

tests 8.2.6

#

yup, that works

#

(I was worried we'd have to add show() back)

manic glacierBOT
#

If you look here: https://github.com/adafruit/circuitpython/pull/8468/files, you'll see that you have different versions (probably outdated) of the ulab module and a library module. These should not be in your commits. These should be brought up to date. The only files changed in your commits should be the files you are adding. That's causing the build problems.

I notice that you forked for this PR, but are working on main. Instead. you can fork once, and then reuse the fork. But alway...

wraith crow
#

I know there's going to be an effort to update the libraries replacing .show with .root_group once the 7.x libraries are frozen but if I run into individual cases while working with pre-release 9.x (main) should I just modify a local copy of the library or would it be helpful to also submit a PR?

tulip sleet
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.2.6 on 2023-09-12; Adafruit Metro M4 Airlift Lite with samd51j19

Code/REPL

# not available, see below

Behavior

TL;DR: my best guess at the moment is broken memory hardware, but if that's not the case (the board is not very old), it's really weird behavior. Read on below for much more details and the whole story.

It boils down to a few things:

  • Getting into bootloader mode with double-pressing ...
manic glacierBOT
#

This does sound like a hardware problem of some kind. It is not CircuitPython core related. Could you open a thread in https://forums.adafruit.com/viewforum.php?f=60 and we'll pick it up there? Post a link to the thread here and then close this issue.

In the thread, could you answer the question below? You don't need to repost all the above. Just link to this issue.

Does double-clicking RESET cause the red LED nearest SWD connector to pulse? Is it a fast or a slow pulse? If the red LED ...

slender iron
#

I think we can remove show() from libraries now because the 7.x bundle is turned off

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0-alpha.1-74-geae426ed90 on 2023-10-18; ProS3 with ESP32S3

Code/REPL

id = board.board_id


if id == 'unexpectedmaker_pros3':
    use_neopixel = True
    import pros3
    import neopixel
    my_brightness = 0.005
    BLK = 0
    RED = 1
    GRN = 200
else:
    use_neopixel = False
    my_brightness = None
    BLK = None
    RED = None
    GRN = None

# in setup()
if id == 'unexpectedmaker_pr...
manic glacierBOT
#
[adafruit/circuitpython] New tag created: 8.2.7
orchid basinBOT
main furnace
#

I'm using framebufferio.FramebufferDisplay. display.rotation=270 works, display.rotation=-90 does not. Seems like either should work.

tulip sleet
#

These actual values are checked for

#

@grand hamlet your latest push still is changing the submodule commits. You need to do make fetch-port-submodules in the ports/espressif directory

#

remerging does not automatically fix the commits

manic glacierBOT
grand hamlet
#

Trying to sort things out a step at a time, got rid of the mpy-cross/mpy-cross
Just now.

I have done done make fetch-port-submodules before, I guess I need to do it again to get things properly up to date?

tulip sleet
#

right, or you probably could jsut do git submodule update extmod/ulab and the same for the other one, in the right directory

grand hamlet
#

You mentioned my ulab probobably being out of date, does that get sorted out with that? I was just looking into running updates through apt but not even sure what to update 😛

tulip sleet
#

ulab is just another submodule

grand hamlet
#

This has been such a disaster haha. Not helped by 2 random power outages and the VM randomly crashing. I'm very much out of my depth here.
Submodules are updating at least

#

What do I need to run after that because I'm very much lost

slender iron
#

git add the changed folder and commit them

grand hamlet
#

axeia@axeia-VirtualBox:~/repos/circuitpython-ESP32-S3-Zero/ports/espressif$ make fetch-port-submodules

wall of things completing

axeia@axeia-VirtualBox:~/repos/circuitpython-ESP32-S3-Zero/ports/espressif$ git status
On branch main
Your branch is up-to-date with 'origin/main'.

nothing to commit, working tree clean``` 

Going by git, there's nothing to commit
#

Tried running make BOARD=waveshare_esp32_s3_zero
But that's running into a problem.

LINK build/mpy-cross
   text       data        bss        dec        hex    filename
 330068      14200        904     345172      54454    build/mpy-cross
make[1]: Leaving directory '/home/axeia/repos/circuitpython-ESP32-S3-Zero/mpy-cross'
In file included from ../../py/mpstate.h:35,
                 from ../../py/runtime.h:31,
                 from ../../extmod/ulab/code/ulab.c:17:
../../extmod/ulab/code/ulab.c:140:11: error: 'ndarray_properties_attr' undeclared here (not in a function)
  140 |     attr, ndarray_properties_attr,
      |           ^~~~~~~~~~~~~~~~~~~~~~~
../../py/obj.h:801:44: note: in definition of macro 'MP_DEFINE_CONST_OBJ_TYPE_EXPAND'
  801 | #define MP_DEFINE_CONST_OBJ_TYPE_EXPAND(x) x
      |                                            ^
../../py/obj.h:805:179: note: in expansion of macro 'MP_DEFINE_CONST_OBJ_TYPE_NARGS_9'
  805 | , _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, N, ...) MP_DEFINE_CONST_OBJ_TYPE_NARGS_##N
      |                                                                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../extmod/ulab/code/ulab.c:129:1: note: in expansion of macro 'MP_DEFINE_CONST_OBJ_TYPE'
  129 | MP_DEFINE_CONST_OBJ_TYPE(
      | ^~~~~~~~~~~~~~~~~~~~~~~~
make: *** [../../py/mkrules.mk:84: build-waveshare_esp32_s3_zero/extmod/ulab/code/ulab.o] Error 1
slender iron
#

how many do you have to fix?

#

update is just checking out the bad commit again

tulip sleet
#

I was looking for your circuitpython repo but it's not a fork of adafruit/circuitpython. That was confusing 🙂

#

you may want to rename it to something else so you can then fork adafruit/circuitpython and keep the circuitpython name

main furnace
#

Where is the setter code for display.rotation? It should raise an exception for an invalid value.

grand hamlet
tulip sleet
#

it's often easier to bake a new cake than cut the burned parts off the original one

grand hamlet
#

Not related but I saw in the documentation a little while ago that ESP32's should have enough memory to have 'dual screen' to be enabled by default.
Is that still something that's being considered?

I plan on making a keyboard with 2 screens and it would be nice if I could stick to the normal builds rather than having to roll my own and having to maintain the entire environment to be able to do so.

tulip sleet
#

Scott is working on something that will allow dynamic allocation of displays, if I understand correctly

devout jolt
#

Question for all the CircuitPython devs who know RP2040 and neopixel & adafruit_pixelbuf: Is there any reason why for neopixel.NeoPixel(some_pin, n=8) that "n=8" would be a "special" value that could cause weird issues? Over in help-with-circuitpython, user Muck is having this weird issue where on the PropMaker RP2040 when having i2s audio going, doing things like for i in range(8): pixels[i] = (255,0,0) goes all non-linear for them. But changing it to 12 or 16 and it works. Link to video of the issue as replicated by me. But it's really flaky when it happens: #help-with-circuitpython message

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.2.6 on 2023-09-12; Adafruit Feather RP2040 Prop-Maker with rp2040

Code/REPL

import time, board, digitalio
import audiobusio, audiocore, audiomixer
import rainbowio, neopixel

num_pixels = 8
power_pin = digitalio.DigitalInOut(board.EXTERNAL_POWER)
power_pin.switch_to_output(value=True)
pixels = neopixel.NeoPixel(board.EXTERNAL_NEOPIXELS, num_pixels, brightness=0.2, auto_write=True)

audio = audiobusio.I...
tulip sleet
manic glacierBOT
blissful pollen
manic glacierBOT
#

As of v1.21.0, MicroPython provided a new lib/uzlib which has a slightly different API: it returns wbits instead of you supplying wbits. I reverted to the old one in the v1.21.0 merge until someone can study the implications and change our code.

Also note that MicroPython has decided to provide deflate instead of gzip. We should try to understand that and see if we might follow suit.

manic glacierBOT
#

This changes a few of the Hacktablet and Makerfabs pin names for consistency. I also believe the RGB pins were defined backwards on the Makerfabs board. I actually have the 1024x600 board but from everything I have seen online they should be connected the same way as the 800x480 board. Before this change, the following code drew a black line rather than a green line, reversing the order of the RGB pins resolved it.

import board
from adafruit_turtle import Color, turtle
import frameb...
tulip sleet
#

Interesting CircuitPython build result. I have a 6-core/12-thread Intel CPU, i7-8700. I have been running make -j12, assuming that the threading would buy me a little speed. In fact it's the opposite: -j6 is faster, by up to 10% or so (wall-clock time)

devout jolt
tulip sleet
#

i was also using that getconf, and to get the actual number of cores I found this compact search on stack overflow: lscpu | awk -F ":" '/Core/ { c=$2; }; /Socket/ { print c*$2 }. There is not a comparable getconf or similar that I know of.

mortal kernel
tulip sleet
#

i would divide by 2 but it varies across CPU's

tulip sleet
mortal kernel
tulip sleet
#

got it, i've got 6 real cores ... trying -j7 and up now

#

-j7 is worse than -j6 even

mortal kernel
#

What's your OS?

tulip sleet
#

also 22.04

#

testing a pico build

#

24GB RAM

mortal kernel
#

Weird. You may be having heating issues that are causing your cores to slew down their clock dividers.

tulip sleet
#

fan is quiet. it's a Dell Optiplex small form factor

mortal kernel
#

I've got a heatsink the size of a brick on mine. And my fans spool up running the build. Maybe the stock Dell fan speed profile is skewed to quiet?

tulip sleet
#

-j6 33.3ecs, -j7 36.7 secs, -j5 32.8 secs, -j4 33.7 secs, -j3 43.0 secs

#

i can check the bios settings

#

i hear it spool up sometimes

#

metro m4 build, but it's not whining

#

the builds above are pico, not metro m4, so no LTO

mortal kernel
#

Your -j5 is just one second more than my best at -j8. This is a Pico W build here.

tulip sleet
#

it's an old machine, maybe I should redo the thermal paste (Dell Optiplex 7060 SFF)

#

I should rummage around for a temp monitor

#

in Linux

mortal kernel
#

Also consider disabling hyperthreading in your BIOS. You'll get more bang per core on this sort of workload.

tulip sleet
#

I am not sure how much is in parallel beyond the basic compilation of all the sources. The qstr, etc. stuff at the begininng is probably single thread, and so is the linking, I assume

mortal kernel
#

True, that's what I've observed. That's where no hyperthreading will double the single thread bits.

tulip sleet
#

using watch sensors, highest CPU temps I am seeing are 77C, typical is low seventies or lower

mortal kernel
#

You can also monitor clock slewing with watch -n1 "lscpu | grep MHz | awk '{print $1}'";

tulip sleet
#

no, wrong, that was with -j3, -j6 is

#

jump to 90, then fan spins up, goes to 80ish

onyx hinge
#

There are some long sequential steps. The final link, even if it uses LTO, doesn't use a while lot of parallelism but can be the very longest running step...

#

Generating compressed error messages is also lengthy and not parallel

mortal kernel
#

New thermal paste time! Last time I re-pasted my rig the old paste had dried to a powder.

tulip sleet
#

I turned off hyperthreading; seems to make no difference. SpeedShift, SpeedStep, TurboBoost are all on. I will check the paste -- thanks!

blissful pollen
#

Interesting -j3 to -j6 (i5-9600) goes from 37 to 33 seconds. (-j1 is 1:45 or so). I see all CPU cores showing about 80% usage at 3 but max at 6

tulip sleet
blissful pollen
#

Just tried and seems consistent. Going to try -j5 too

tulip sleet
#

is -j12 slower, for isntance?

#

i5-9600 does not have hyperthreading

blissful pollen
#

-j4 on and higher seems to be consistent in build time, not up or down.

mortal kernel
#

I'm seeing the same as @Mark. I wonder if the top-level make is again invoking make with a smaller -jxx somewhere in the build?

tulip sleet
#

The jobserver stuff may not be set up right. As I mentioned in the merge thread, with gcc12 I am now seeing lto-wrapper: warning: jobserver is not available: '--jobserver-auth=' is not present in 'MAKEFLAGS' lto-wrapper: note: see the '-flto' option documentation for more information on the Metro M4 builds

#

I think just trying gcc12 on main would have the same effect. Merge build is branch v1.21-merge in dhalbert/circuitpython right now

mortal kernel
#

For example, see this rule inports/raspberrypi/Makefile:

    $(Q)cmake -S pioasm -B $(BUILD)/pioasm
    $(Q)$(MAKE) -C $(BUILD)/pioasm PioasmBuild
tulip sleet
#

i was looking at this last night and saw mention of adding + prefix to the $(MAKE) lines.

#

i am unfamiliar with that and haven't had time to research it yet.

blissful pollen
#

I did notice all my cores would max out for the first 10-15%, then dip for a few seconds, then shoot back to 100% till the end when again a few more seconds of 50%. Just the two dips from maxing it all out though.

mortal kernel
#

On second take, make accounts for nested use of make automatically. Breaking it down, the bulk of the build time is spent constructing qstrdefs.generated.h.

#

FWIW, I'm thrilled having ~30 second full build times. Seems like just yesterday I was watching the dots while a small Pascal program compiled on my Apple II.

slender iron
#

I'd love to see us optimize across board builds to reduce our CI time

#

we should merge 8.2.x into main now

manic glacierBOT
mortal kernel
# slender iron we should merge 8.2.x into main now

Confirming what @onyx hinge said earlier, compressing error strings is a large part of the single-threaded portion of the build. Re-coding maketranslationdata.py and huffman in C could help. Huffman encoding is bit-string based, which is not one of Python's strengths.

onyx hinge
slender iron
#

I'd rather compress them all once and use them for all boards 🙂

mortal kernel
slender iron
#

compression depends on qstrs now and they change per-board for now

onyx hinge
#

and it depends on the subset of all compressed messages in a build as well

#

what we could do is have a "go faster" knob where all the fancy tricks aren't used for boards with plenty of flash space

#

like almost all rp2040 & espressif boards

slender iron
#

ya, it'd be good to factor all of that out

mortal kernel
#

I've got an experiment in mind that factors out the huffman library, decompress, and compress from maketranslationdata.py to a new C library. I'll report back and open a PR if it pans out.

slender iron
#

are you hung up on the pico w ble stuff?

mortal kernel
onyx hinge
#

I know the feeling, I fled the country after my last big project. 🌍

#

and this laptop has never compiled circuitpython before, wild

manic glacierBOT
#

to trade compile speed & flash size

Initially enable the faster mode on rp2040 and espressif, where there's usually plenty of flash available (these advanced techniques save hundreds to thousands of bytes, which is important on a lot of old samd21 boards but is a drop in the lake of a 4MB flash chip)

Levels are:

  • 1: fastest
  • 3: use qstrs
  • 5: use custom dictionary

Tested on the unix build (level 1) and still passes tests.

real time duration of running just maketranslationd...

manic glacierBOT
tranquil ether
#

I'd like some help with UART control of the Audio FX Sound Board (Product ID: 2217). I got it working with discrete pin triggering, but I would like to change to serial control over UART. I have found some example code, but for some reason it only does receive(https://learn.adafruit.com/circuitpython-essentials/circuitpython-uart-serial). I think a simple example of CircuitPython doing both Rx AND Tx would get me going. Can anyone think of some example code I can learn from?

mortal kernel
#

@onyx hinge , @slender iron Looks like the problem is not bit-string manipulation but rather the search for an optimal set of n-grams. Factoring out huffman encoding/decoding to C won't speed thing up as all of the overhead is in the while len(words) < max_words: loop.

tulip sleet
#

@slender iron ok I got ports/unix coverage variant to compile, pushed all changes, didn't try any tests yet; will go eat

slender iron
#

👍 I'll try the tests

atomic summit
#

Hey folks - just finished work on my CP board support for my new BLING! and TinyWATCHS3 boards and they are not like my usual "development boards" - but instead have fixed functionality and no user exposed IO.

What I'm wanting to know is what the consensus is on including frozen libraries?

#

For instance, my TinyWATCHS3 uses an ST7789 screen, has a bunch of peripherals like RTC, Fuel Gauge, IMU, Magnetometer etc... these are fixed hardware. Should I provide support for these in a frozen form?

#

It's not like users would choose to "use or not use" the screen 😉

#

I know I can ship a bunch of libraries in \lib but that means if someone stomps their CP install, they no longer have them and then have to hunt them down themselves and add them back in etc.

tulip sleet
#

we originally started using frozen modules to save RAM space on chips with limited RAM. There are pluses and minuses: it's very convenient, but if there's a library change, then we need to release a new CircuitPython or else have people override the frozen module. The libraries had more churn early on; now the base libraries don't change all that much: new releases often have nothing to do with code: they are just build infrastructure changes.

So I'm saying it's really up to you. It's a use case question, not really a policyt question. There are manufacturers who like things frozen to make it easy to use out of the box, and there are others who are tweaking their custom libraries often and might want a new release.

#

you could always make custom releases: 8.2.7+c-um-tinywatchs3 or whatever

atomic summit
#

Right-o. I notice that not all libraries I'd want to include are available in the frozen folder anyway.

tulip sleet
#

we're happy to add more there; it's just more submodules

atomic summit
#

Yah, I don't want to have to maintain a seperate build or list of libraries/bundles etc and then have to worry about keeping them current etc.

tulip sleet
#

it's support one way or the other: either you maintain it in our repo, and tell people how to override if there are bugs, or you supply builds

atomic summit
#

Yeah, just what I need - extra tasks 🙂 hahaha

#

Ok, I might just include essential libs frozen - Display, Neopixels etc and then any "can work without ones" I'll have as seperate things I include and users would need to add back in.

tulip sleet
#

it's convenient for the onboard sensors too, if you think those libraries are stable

atomic summit
#

There are bunch of peripherals on these boards I've never used in CP befoe, so not even sure the libs are compatible or how well they work etc - or even if they are supported!

#

Maybe my best bet is to get the board definitions PR'd and then over time update them and freeze "known good libs".

#

I was trying to get these ready for 8.2.7 - woops! haha. I'll still add them for 8.x today and then start work on adding them to main.

tulip sleet
#

8.2.7 is almost certainly not the last 8.2.x release 🙂

manic glacierBOT
#

These are moved:

  • Display -> busdisplay.BusDisplay
  • FourWire -> fourwire.FourWire
  • EPaperDisplay -> epaperdisplay.EPaperDisplay
  • I2CDisplay -> i2cdisplaybus.I2CDisplayBus

paralleldisplay is now paralleldisplaybus (and registered as
paralleldisplay too).

Bus related helpers are split out of display_core into bus_core.
It is in still displayio since it is a dependency of both
busdisplay and epaperdisplay.

Fixes https://github.com/adafruit/circuitpython/issues/7667

T...

atomic summit
tulip sleet
#

@atomic summit scott is doing a deep dive right now and looking to update your 8.2.x boards

#

to merge 8.2.x to main

atomic summit
#

Oh....

tulip sleet
#

i am not paying that close attention

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.2.7 on 2023-10-19; Adafruit Matrix Portal M4 with samd51j19

Code/REPL

import time
from random import randrange
import board
import terminalio
from adafruit_matrixportal.matrixportal import MatrixPortal



matrixportal = MatrixPortal(
    url=None,
    json_path=None,
    status_neopixel=board.NEOPIXEL,
    height=32,
    width=128
)

# --- Display Setup --- #

# Colors for guide name
colors =...
manic glacierBOT
manic glacierBOT
#

Adds support to supervisor/shared/status_leds.c for GRB status LEDs (should be easy enough for others to extend to BRG or whatever if such things exist).
Adds support for the Waveshare ESP32-S3-Zero board. My thanks to espressif for proving me with a USB PID and Waveshare for granting me permission to request a USB PID from Espressif for their product. This board unsurprisingly uses a BRG status LED.

grand hamlet
#

fingers crossed

#

I see there was some discussion on using more threads above. Coincidentally I tried using -j6 (AMD Ryzen 5 1600 AF under virtualbox) - I did see all 6 cores being pushed hard at some points

#

Annoyingly virtualbox refuses to install on my main rig, I'd be curious to see how much faster it goes on my Ryzen 7 5800X.

manic glacierBOT
manic glacierBOT
#

I am also struggling with this issue. I have a forum post with details here: https://forums.adafruit.com/viewtopic.php?t=205186

Has anyone come up with a solution/workaround?

My workaround was to switch from a soldered spring coil antenna to an external antenna using the ufl to sma adapter and just keep the antenna a few inches from the board. No issues since doing that for my project at least. I have about 10 of these set up with the external antenna and max power for an i...

lone sandalBOT
manic glacierBOT
#

Thank you for the recommendations. At least I understand the problem now. I have multiple applications for these boards. In some cases, I won't need USB, so that's fine. When possible, I'll go with the ufl to sma. Where space is an issue, I'll just have to lower the power and deal with the potentially reduced range.

I wish I had found this page earlier. I didn't realize it was an interference issue until after a few days of troubleshooting. Since this is a known issue, adding a note to th...

manic glacierBOT
#

I briefly tested the artifacts from this PR in 3 contexts:

  • Funhouse using print() to show messages on the display that was initialized automatically by default
  • Magtag using adafruit_display_text to show a label on the display at various locations
  • Matrix portal using some Bitmaps that have lines drawn within them, the display was initialized by adafruit_matrixportal library

All appeared to work as expected.

grand hamlet
manic glacierBOT
#

ok we made a page for the guide here
https://learn.adafruit.com/feather-rp2040-rfm95/rp2040-usb-radio
we really do think that its a RF coupling issue - we saw very similar behavior when we had 'high current drive' on the RP2040 pins for the SCORPIO driver board. and that's not even amplified!
please check it out, i'm going to close this issue because we have a few workarounds :)

grand hamlet
#

Ah thanks, I'll check that out. Thought it would create some place holder by default which can be edited from there.

manic glacierBOT
manic glacierBOT
orchid basinBOT
grand hamlet
#

It doesn't really show which image it's not happy about. I guess it's unhappy about the 'original' being only 800x600?

#

or.. I completely overlooked one being in a completely wrong directory.
How the heck did it up end there

manic glacierBOT
#

Bummer! Still, I appreciate your responding. I now have five ESP32-S3 devices, which I have really wanted to used with CircuitPython for BLE HID (mouse, keyboard, joystick, etc.). I did not realize until a few days ago that it wouldn't work for my needs. I'll be watching this issue, although sad because of the likely long timeline involved.

Keep up the great work! I'm overall a very happy customer of Adafruit hardware!

wraith crow
#

It looks to me like the Makerfabs TFT7 board has shared the I2S audio pins with the USB data pins (D-, D+). If I attempt to initialize audiobusio I get an I2S_BIT_CLOCK pin in use message and when I run the Arduino audio example, the USB serial connection repeatedly disconnects/reconnects while the audio is playing. Is there anyway to get Circuit Python to release the USB data pins?

manic glacierBOT
#

CircuitPython version

Using the latest main of asyncio https://github.com/adafruit/Adafruit_CircuitPython_asyncio
Using the latest ticks https://github.com/adafruit/Adafruit_CircuitPython_Ticks
Using "A" latest circuitpython nightly: adafruit-circuitpython-unexpectedmaker_tinys3-en_US-20231018-eae426e.bin

Adafruit CircuitPython 9.0.0-alpha.1-74-geae426ed90 on 2023-10-18; TinyS3 with ESP32S3
Board ID:unexpectedmaker_tinys3
UID:4F21AFD4FF0B
boot.py output:

Code/...

manic glacierBOT
#

Oh
I think this is it

https://github.com/adafruit/circuitpython/pull/8481/files#diff-e2baf888039fbdf18dc4d8600714a0a332a02c995a694d98910671bc262ba7a5L73

// CIRCUITPY-style ticks
#define _TICKS_PERIOD (1lu << 29)
#define _TICKS_MAX (_TICKS_PERIOD - 1)
#define _TICKS_HALFPERIOD (_TICKS_PERIOD >> 1)
#if !CIRCUITPY || (defined(__unix__) || defined(__APPLE__))
STATIC mp_obj_t ticks(void) {
    return MP_OBJ_NEW_SMALL_INT(mp_hal_ticks_ms() & _TICKS_MAX);
}
#else
// We don't sha...
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0-alpha.1-64-gf14ca95df4 on 2023-10-06; Adafruit MatrixPortal S3 with ESP32S3

Code/REPL

import os
import gc
import ssl
import time
import wifi
import socketpool
import adafruit_requests
import adafruit_display_text.label
import board
import terminalio
import displayio
import framebufferio
import rgbmatrix
import adafruit_json_stream as json_stream
import microcontroller
from adafruit_ticks impo...
#

i was able to have it happen again with the chrome console open:

Connected!
3index.js:37 write
index.js:37 Initializing File Transfer Client...
index.js:37 Waiting for connection status to change...
index.js:37     PUT http://cpy-2048dc.local/fs/code.py net::ERR_CONNECTION_RESET
_fetch @ index.js:37
writeFile @ index.js:37
await in writeFile (async)
writeFile @ index.js:24
writeFile @ index.js:35
op @ index.js:37
saveFile @ index.js:35
Gd @ index.js:37
await in Gd (async)...
manic glacierBOT
atomic summit
#

Has anyone played with the latest macOS 14.1 beta to see if the USB sync issue is still there? I'm not signed up for the betas, and don't really have a "spare Mac" I'm able to risk betas on right now, but I'm curious to know if by some fluke the issue has been addressed?

#

Also, @slender iron I released this morning I accidentally PR'd my updated BlizzardS3 board files in main with my other 2 boards. I know you did the work already on it moving it from 8.2x to 9.x sdkconfig setup - sorry.

slender iron
humble iris
#

Anybody available to verify a potential bug with me? It's in the RP2040 version of the PulseIn component on the PulseIO module.

humble iris
#

I can't download the build tools I need to build circuitpy locally (hotel wifi, 44 hour estimate). I need to change 2 files to fix this bug; can somebody help build a test branch for me?

wraith crow
humble iris
#

I'm modifying the main branch, I can toss the two files up here if that's OK, or DM them to you.

ports/raspberrypi/common-hal/pulseio/ ( the files I'll give you ) for position.

wraith crow
#

ok, be a few minuts to get things going

humble iris
#

(Want to build against the latest version, not against the alpha)

#

thank you!

#

SO much!

wraith crow
#

what board are use using?

humble iris
humble iris
# wraith crow

... I didn't change that. :/ I might have pulled files from the alpha. Let me make sure I have the latest 8.2.7 files and put my modifications onto that.

humble iris
# wraith crow

Thank you so much for trying; I think it's ultimately going to need more work. I don't know if I can debug my problem well enough while I'm in a hotel... so... can I tip you or buy you a coffee for your help?

wraith crow
#

No worries, I was working on CP anyway so wasn't any bother at all. Good luck tracking the bugs down when you have real internet 😄

humble iris
#

(My solution is not great, that is)

manic glacierBOT
#

I noticed a bug in the pulseio module for the RP2040 when using it:

Under specific circumstances, an item getting pushed into the queue during the PIO interrupt handler can be overwritten.

This happens specifically when the "len--" of popleft() is being executed: len is loaded into a register, then the register is decremented, then written back to memory. If the interrupt happens after len is loaded from memory into a register, or after it's decremented - but before it's written back t...

humble iris
wraith crow
#

All good, thanks though, and congrats on finding the Internet 😄

manic glacierBOT
lone axle
#

I am trying to test out the cleveland art project to see if I can replicate any of the issues that a user on the forums and github is having or see if I can find a way to help. In reading into the issue I saw that this message from someone whose seemingly associated with Cleveland art: https://github.com/ClevelandMuseumArt/openaccess/issues/8#issuecomment-1743348001 They are asking for the removal of the CMA logo from the learn guide: https://learn.adafruit.com/cleveland-museum-of-art-pyportal-frame. My assumption is they mean the one depicted on the pyportal display in the main photo on the overview page.

I'm not sure whether they realize that photo is used in the project that runs o n the pyportal also (the photo is of it running on a device). The CMA persom mentions removing it from the web page, but perhaps it is best to remove it from the project as well?

manic glacierBOT
tulip sleet
#

I think I will move up the landscapce and remove it from lower down on the first page

lone axle
#

do you think it's okay to leave the logo image file in the project itself? It uses it basically as a sort of loading splash screen.

tulip sleet
#

maybe we should just change it to text

lone axle
#

Okay, yeah I like that idea. I was thinking to just credit them by name as well even though not explicitly required by cc0

tulip sleet
#

i removed the photo but if the code is going to change anyway that can be done at the same time.

humble iris
#

@tulip sleet Got your suggested changes, I’ll make those when I get a chance later today. Do you know the cycle penalty for disabling and reenabling interrupts?

tulip sleet
#

no, but I think it's pretty trivial. I'll look

lone axle
#

There are some other small improvements I think can be made in this project as well. The random image selection uses a hardcoded upper bound. But it appears there are more images in the collection now so we could increase it. Or perhaps read the value out of the JSON responses so it's "self updating"

humble iris
tulip sleet
#

it boils down to a couple of single instructions; I think it's nothing to worry about.

#

if you could re-test that would be great, thanks

humble iris
#

Oh, nice. I can retest, yeah.
It’s probably better than the occasional branch penalty I was getting in my solution.

tulip sleet
#

other ones typically use PWM hardware, atmel-samd would be a typical one to look at

humble iris
#

Thanks for the help. My first real contribution upstream!

tulip sleet
#

we appreciate it!

tulip sleet
# humble iris Thanks. It definitely reads better and doesn’t need a comment. I DID test my so...

atmel-samd guards already:

uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t *self) {
    if (self->len == 0) {
        mp_raise_IndexError_varg(translate("pop from empty %q"), MP_QSTR_PulseIn);
    }
    if (self->errored_too_fast) {
        self->errored_too_fast = 0;
        mp_raise_RuntimeError(translate("Input taking too long"));
    }
    common_hal_mcu_disable_interrupts();
    uint16_t value = self->buffer[self->start];
    self->start = (self->start + 1) % self->maxlen;
    self->len--;
    common_hal_mcu_enable_interrupts();
    return value;
}
humble iris
#

I was just looking but I’m on my phone atm.
That’s where I was going to put my interrupt guards, at least, so that’s a nice sanity check

tulip sleet
slender iron
mortal kernel
#

@slender iron I've improved maketranslatedata.py so that build times are improved from 31.5 seconds to 20.2 seconds. I'm having a small loss of compression efficiency from 12873 to 12652 bytes saved (I'm 221 bytes worse). The loss is due to qstr compression, where some cases trade-off on the razor's edge.

mortal kernel
#

The iterative dictionary word search is the heart of the problem. The regular expression with qstrs included becomes quickly becomes unwieldy.

slender iron
#

using a bit more space is fine as long as all of the boards still fit

mortal kernel
#

The port is raspberrypi

lone axle
#

@tulip sleet I think I recall recently you mentioning working on something related to SSL certs issued by Let's Encrypt. I'm starting to wonder if there is something similar in play for ESP32SPI or nina-fw? I was able to replicate reliably one of the errors that this user reported and simplify the reproducer down to a slightly modified wifi test script rather than the full art museam project.

I'm noticing that requests to https://openaccess-api.clevelandart.org/api/artworks?cc0=1&has_image=1&indent=2&limit=1&skip=9786 are always failing with TimeoutError: ESP32 not responding The requests to adafruit test file, and coindesk API both suceed as does an https version of the coindesk URL so I know it's not generally an https issue. Looking at the cert for that cleveland art API it does show that it's from Let's Encrypt.

mortal kernel
#

Also, considering all possible n-grams for scoring is very expensive. I've found a heuristic that trims the set under consideration.

lone axle
#

even if unrelated to the recent Let's Encrypt cert stuff it does seem that CircuitPython 8.2.7 with nina-fw 1.7.5 on the PyPortal Titano does reliably always fail the request to that art API.

slender iron
tulip sleet
#

Could you give me a URL?

tulip sleet
lone axle
#

going for a walk be back in a bit.

tulip sleet
#

Yep, it's the E1 cert, which uses ECDSA 😦

cunning sundial
#

I've come up with a new version of a board that I had working earlier (background: https://discord.com/channels/327254708534116352/1143997801274015774) The board is mostly the same, but attempting to use a W25Q32JVSSIQ memory chip rather than the W25Q128JVSIQ I was using before.

RPi shows up, allows me to flash it with firmware, then doesn't show up again unless I reconnect with the boot button depressed. So it SEEMS to be storing something. I changed the mpconfigboard.mk around as shown below and recompiled.

Is there something I am doing wrong here, and/or is there something off about how this particular memory module compiles. Or might something else not be correct?

What is interesting is that when I flash an older board with my new(?) firmware, it still says it has ~16MB of memory even though I put in the 32mbit ~ 4MB. Does this mean I'm not compiling it correctly?

USB_PID = 0x80F4
USB_PRODUCT = "Pico"
USB_MANUFACTURER = "Raspberry Pi"

CHIP_VARIANT = RP2040
CHIP_FAMILY = rp2

EXTERNAL_FLASH_DEVICES = "W25Q32JVxQ"

CIRCUITPY__EVE = 1
CIRCUITPY_PICODVI = 1
tulip sleet
#

You specified the new chip, so that's what it thinks is on the board.

#

RPi shows up, allows me to flash it with firmware, then doesn't show up again unless I do the reset button. So it SEEMS to be storing something. I changed the mpconfigboard.mk around as shown below and recompiled.
if, when you press reset again, RPI-RP2 shows up, that means the flash was unsuccessful.

Can you do anything else with the board, such as loading an Arduino Blink UF2 that you built with Arduino, or something with pico-sdk? I would be inclined to think there might be a hw problem with the board if that is unsuccessful. Since the bootloader is in ROM on the RP2040, that will show up even when the flash chip is messed up in some way

cunning sundial
slender iron
#

changing the flash device will also change the stage2 flash setup code run after the bootloader

cunning sundial
slender iron
#

that should be what you need to do for it to work

tulip sleet
#

any board that you flash with your W25Q32JVxQ version will think it has that flash chip on the board, even if it has something else

cunning sundial
#

For that matter, if I put a UF2 that specifies 16MB on a Flash chip with 4MB of memory, would Finder even recognize it?

tulip sleet
#

@slender iron is it using the generic ??

#

we are jsut going into a meeting, may not be that responsive

slender iron
#

I thought the rp2040 read the flash size from the chip

tulip sleet
#

that's what i meant, so maybe all I said is just wrong

slender iron
#

the stage2 will try to optimize for the specific chip though

cunning sundial
slender iron
#

most basic settings

#

I usually use a logic analyzer to debug flash chip issues

cunning sundial
#

Hmm, what I mean is if I want the RP2040 to take care of deciding on the flash chip, what would I put here instead of what I have: @slender iron

USB_PID = 0x80F4
USB_PRODUCT = "Pico"
USB_MANUFACTURER = "Raspberry Pi"

CHIP_VARIANT = RP2040
CHIP_FAMILY = rp2

EXTERNAL_FLASH_DEVICES = "W25Q32JVxQ"

CIRCUITPY__EVE = 1
CIRCUITPY_PICODVI = 1
#

Do I need to change anything?

#

(If that is what you mean)

slender iron
#

you can comma separate the two

lone axle
# tulip sleet Yep, it's the E1 cert, which uses ECDSA 😦

When I first started testing today I was getting successful responses from that API. My Nina-fw was on a rather old version though 1.2.2 I'm not sure if I ever updated it on this device. If I start working backwards in nina-fw versions and find the most recent one that allows it to succeed would it make sense to add alertbox or something to the learn guide stating which firmware version it's known to work with?

manic glacierBOT
onyx hinge
#

py/obj.c: mp_warning(MP_WARN_CAT(BytesWarning), "Comparison between bytes and str");
apparently there is an mp_warning now @slender iron

manic glacierBOT
onyx hinge
slender iron
manic glacierBOT
slender iron
#

just in the local dict

midnight ember
#

i will not be talking today had dental surgery, mouth full of gauze.

onyx hinge
#

yipe, feel better soon @midnight ember

manic glacierBOT
midnight ember
#

oh i got some feel good meds, feeling really good 🙂

gilded cradle
#

I believe they are still memory mapped, but the device name changed

#

was previously /dev/gpiomem and is now /dev/gpiomem4

lone axle
onyx hinge
#

10.0 milestone I assume?

slender iron
#

yup, did I say label?

onyx hinge
#

I think you said "issue" but I don't remember now

#

I'm dropping off now so do read my status update 🙂

midnight ember
#

have a great vacation @onyx hinge

midnight ember
#

CGrovers automatic sensor calibration code is really great.

#

Been seeing a lot of Sonoma related issues in discord, figured that was going to be a big issue.

#

FoamyGuys work on the template engine and stuff is great. Almost like a local host of AdafruitIO which has a lot of advantages. Very exciting to see that progress.

lone axle
#

@errant grail I think that everything in requirements.txt needs to be formatted as pypi library names. I'm not sure how circup translates those over to the format it needs for installing, but I think something similar would need to occur for the community bundle libraries in order to have them be counted as dependencies that get installed automatically.

midnight ember
#

Playground note on that project Liz? Sounds great.

candid sun
errant grail
midnight ember
#

With Pi 5 I imagine Melissa is going to be quite busy with Blinka. Good luck!

gilded cradle
#

Yeah, I have a pi 5 and was working on adding Blinka support over the weekend

midnight ember
#

A lot of people use Display_Shapes is that a different library?

lone axle
#

displayio.Shape (the one that was removed) isn't used hardly anywhere. The one place mentioned so far was a place I chose to use it mostly because it wasn't used anywhere else 😅

wraith crow
#

I just found and used shape, I sure I can find another approach:)

lone axle
#

vectorio should work for the most basic use-cases.

wraith crow
#

Thx 😊

candid sun
#

+1 for vectorio

errant grail
#

Thank you!

candid sun
#

thanks for hosting Dan!

midnight ember
#

Thank you for hosting Dan. Lots of neat changes on the horizon.

gilded cradle
#

thanks

blissful pollen
#

Ha my last meeting ending and I joined just in time to hear "... join next week"

wraith crow
#

Trying to load as few libs as I can, I think I'm already displaying a bitmap so that should work

midnight ember
#

Can do a monitor capture instead of window capture to get around all of that.

lone axle
#

Thanks for hosting Dan, have a good week everyone!

midnight ember
#

I use hitclips, free video editing program. It's for windows though.

lone axle
#

I might go back to having discord open in a browser instance instead of the app. I believe my OBS still see's it that way without any issue.

slender iron
#

I do that for my streams but not the meeting

lone axle
#

Same, I used to do it for the meeting, but I started suspecting that having the browser instance and the app open was making the audio call get broken sometimes. If I can't figure out how to have it find the discord app I might switch over to the browser entirely for running the meeting.

lone axle
# errant grail Ah, that would make sense. Ironic that the second Community Bundle dependency in...

It might be a good topic for a future "weeds section", it would be nice if there was something seperate from requirements.txt and pypi that circup could look for at least optionally. IIRC circup's usage of requirements.txt and pypi names was the thing behind our descision to start releasing all libraries on pypi. Before there was a time when libraries that aren't meant to work with Blinka weren't released on pypi. Maybe there could be an optional circup-requirements.txt or something that can hold the list of requirements that can be found specifically with circup without necessarily being released on pypi.

errant grail
lone axle
slender iron
#

maybe something in pyproject.toml?

lone axle
#

I thought that file was also associated with pypi, though I'm not that familiar with it beyond having seen it in our libraries and knowing a few of the things that have popped up needing to be changed in there.

manic glacierBOT
lone axle
#

it does look like our cookie-cutter creates it even if the user selects no for pypi so we could use it as a place to keep the circup-requirements.

slender iron
lone axle
#

neat. I'm guessing it would be best to use some specific namespace for a block within the toml like [circup.requirements] or something to try to ensure that this value won't be recognized by any tool except circup. Does that sound like a reasonable way to add it? Id be willing to tinker with circup some to try to get it to read an alternative list of requirements sometime.

slender iron
manic glacierBOT
lone axle
#

Is there any place to find older releases of nina-fw than the ones listed on this page? https://github.com/adafruit/nina-fw/releases the earliest one here is 1.4.0 and even it has the same "ESP32 timed out" issue with these ECDSA style certs. My titano had 1.2.2 on it before I upgraded to day and I was getting successfull responses with that one.

tulip sleet
lone axle
#

I was at first unable to replicate the issue the user reporeted but eventually realized my nina-fw was a different version and updated it, now I do always see that timed out error.

manic glacierBOT
#

I don't think the webrepl is going to work on this board, because it doesn't have native wifi in CircuitPython itself. The wifi is handled by the ESP32SPI library. You would need to use a board whose primary processor is Espressif or use the Pico W.

Nevertheless the original question still stands.

I was afraid that might be the case - unfortunately, this board predates the newer Matrix Portal S3, with native wifi. Still, if it's possible to get this working with SPI-connected wif...

tulip sleet
#

you can look at the 1.2.2 tag and see the sources. Building it is a bit of a pain. I am looking for a download. I don't think it's a root cert issue, but it might be an sdkconfig settings issue. I tried the ECDSA cert chain with the latest Arduino NINA-FW and it also didn't work, so whatever stopped working was a long time ago.

#

maybe you could try the arduino nina-fw 1.2.1 or 1.2.2, but I'm not sure that's going to work for other reasons. I don't remember why we forked it originally.

#

@lone axle ^^

manic glacierBOT
lone axle
# tulip sleet <@382939733107408897> ^^

Thank you ill poke around and try a few more things. Perhaps weird question, but is it possible to pull a .bin off of a co-processor, I have a few others that I think it's likely I never upgraded, maybe if I could grab it from one of them I could load it back to the titano esp32

tulip sleet
#

btw I have tried to insert a clip into the meeting video with both pitivi and flowblade, unsuccessfully

tulip sleet
#

i am going to stop wasting time on these video editors for now, since the video is not that important. I am missing about 11:30 of screenshots in the beginner

#

I can insert a static image as a clip, but in pitivi, it did not render for long enough, and in flowblade, it did not render the audio. I can fix this but it seems like a waste of time.

#

openshot was worse

lone axle
#

Sounds good to me, the video component for one meeting isn't worth too much extra time imo.

lone axle
tulip sleet
manic glacierBOT
lone axle
#

Nice, thank you! I'm going to work on something different for a bit. After a break from this i'll come back to it and try to get it building locally. I don't necessarily think pointing folks toward installing the very old ones is the best option either though.

It might be good to add a warning in learn to projects that are known to be affected by it.

In time I imagine esp32-s2 and newer will eventually find their way into more of the form factors and the projects could go back to working on the newer hardware. But on the original hardware it's looking very tricky to get it working.

tulip sleet
#

i will do a diff of that old version and the current one and see whether there's something obvious. Not at the moment, but soon.

manic glacierBOT
orchid basinBOT
orchid basinBOT
manic glacierBOT
manic glacierBOT
tulip sleet
#

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

manic glacierBOT
lone sandalBOT
manic glacierBOT
#

Whenever I try switching it to an input and I get the following error:

Traceback (most recent call last):
  File "code.py", line 87, in <module>
  File "/lib/adafruit_pcf8574.py", line 142, in switch_to_input
  File "/lib/adafruit_pcf8574.py", line 170, in direction
  File "/lib/adafruit_pcf8574.py", line 87, in write_pin
  File "/lib/adafruit_pcf8574.py", line 74, in write_gpio
OSError: [Errno 19] No such device

I also tried using bitbangio, but received this error:

T...
manic glacierBOT
#

The v1.21 merge (#8508) includes some incomplete changes for the UART clock divisor on mimxrt10xx.

In ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT10*/clocks.c, the clock divisor was changed from 0 to 1:

CLOCK_SetDiv(kCLOCK_UartDiv, 1);  // WAS 0

However, this change appears to be incomplete; these sorts of lines will also need to change:

#define BOARD_BOOTCLOCKRUN_UART_CLK_ROOT 80000000UL

See https://github.com/micropython/micropython/pull/12377

manic glacierBOT
mortal kernel
#

What is our most flash constrained port? Thinking it's atmel-samd.

devout jolt
tulip sleet
#

no longints, other missing features

#

feather m0 basic has more pins(and so pin names) than trinket or gemma so it's even tighter

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0-alpha.1-82-gec678a54ce on 2023-10-23; ESP32-S2-DevKitC-1-N4R2 with ESP32S2

Code/REPL

No code, compilation issue

Behavior

A few weeks ago I was trying to perform a debug build on CircuitPython and I ran into an issue with the placement of the #endif on line 371 of web_workflow.c. I moved the #endif down two lines which I think resolved that issue and figured I get back to filing an issue/pr once I...

#

Speed up maketranslationdata.py by reducing work done in optimization loop.

Port Optimization Setting Build Time -j16 Bytes Saved
RP2 Pico W 1 16.3 sec 8336
9 (before this pull) 31.6 sec 12873
9 (with this pull) 17.8 sec 13093
Atmel-SAMD Pyruler 9 (before this pull) 12.87 sec 4494
9 (with this pull) 12.83 4476

Speed improves, slight variation in compression (improves on RP2, very slightly worse on Atmel-SAMD). Speed on RP2 optimizat...

manic glacierBOT
#

Hi @tannewt, thank you!

I had to erase the flash memory via the factory reset. Just dragging the new 8.2.7 UF2 file onto the matrixBoot drive didn't work.

But now that I've reflashed the whole thing, I was able to save the code file like 10 times in a row without problems.

Then, I still made it crash by connecting it to a UART source while saving. So the RX pin might ha...

lone axle
# tulip sleet i will do a diff of that old version and the current one and see whether there's...

I made it back to nina-fw 1.2.2 on my titano but I am stumped because now the requests to the art API are failing the same way as the newer nina-fw's did (ESP32 Timeout). I still have the logs from the successful requests yesterday morning and confirmed in them that my device was reporting 1.2.2 during the time it was succeeding.

I found that there may have been multiple versions technically that were all 1.2.2. This PR that you pointed me to: https://github.com/adafruit/nina-fw/pull/1 actually had accidentally included a bin file in the repo. I tested with that bin file and it does report 1.2.2 however it was failing the requests just as all the newer ones were.

The next PR after that removes the bin file from the repo. The following one https://github.com/adafruit/nina-fw/pull/3 adds wpa2 enterprise support but does not increase the version number. I think I was able to build successfully from the commit where #3 was merged and it does also report version 1.2.2 but does also fail the requests to those URLs

The next PR after that one is when the version is changed to 1.3.0, I haven't tried that one yet. I also haven't yet tried building from the commit where #1 was merged, perhaps the .bin file that was checked in was different somehow. in https://github.com/adafruit/nina-fw/pull/2 Jerry mentions that the accidentally added bin file was "only built by using make firmware" implying perhaps that the "real" builds are made some different way?

One thing I noticed when I built from the commit merging #3 was that after running make firmware there was a long list of prompts that wanted me to input answers for various bits of configuration. I tried to stick to the defaults, but I didnot understand much of anything that was asked 😅. Do you know if there might be specific choices needed for use with circuitpython or anything like that?

It'll be much later tonight or tomorrow before I can get back to it again. I still intend to round up my other airlift style devices to see if I can luck out on finding another one that succeeds the requests to those URLs.

tulip sleet
lone axle
#

That could be a possibility but the timing of consistent failures for me starting after I changed firmware and having had no other successes since then would be terribly unlucky.

tulip sleet
#

I will see if I have an old one with 1.2.2, but I think I upgraded them all

lone axle
#

Unfortunately I was also not in a completely known state on my device at the time. I had been using it before this for testing the changes to ESP32SPI library. I am unsure whether at the time of my successes I was using the frozen libraries, or if I had them overwritten with ones I put in. And if they were overwritten I have no idea what specific versions I would have had at the time.

tulip sleet
manic glacierBOT
manic glacierBOT
mortal kernel
#

@slender iron Want to discuss 8514 or does the explanation I added make sense?

slender iron
manic glacierBOT
manic glacierBOT
slender iron
#

any feedback on ```
Adafruit CircuitPython 9.0.0-alpha.1-99-gecaf9e6b14-dirty on 2023-10-24; Adafruit Feather ESP32-S3 TFT with ESP32S3

import board
board.DISPLAY.show(None)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: .show(x) removed. Use .root_group = x

#

any rewording?

manic glacierBOT
slender iron
#

@tulip sleet I think the _transmit fix will be blocked by the displayio split PR

#

because I can use some test stuff there to verify that _transmit works

tulip sleet
#

you mean wait on merging, or merge split first?

slender iron
#

merge it first ideally

#

it doesn't have the warn stuff yet though

tulip sleet
#

i will rely on foamyguy's testing

#

you could just add it to that

manic glacierBOT
slender iron
#

I have a fix without a new test

#

could PR that separately and add a test with the displayio PR

tulip sleet
#

i am starting to review the split pr

slender iron
#

👍

manic glacierBOT
tulip sleet
#

@slender iron MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS is set if there are class properties?? (They didn't document the flag.)

slender iron
#

yup

#

or descriptors

tulip sleet
#

okee, i didn't add it anywhere, glad you got those. no examples of using that flag in MPy

slender iron
#

they don't use it on native class afaict

#

since they don't use properties in their native apis

#

@tulip sleet I've got the _transfer fix ready too

tulip sleet
#

I have some minor comment changes marked in the split PR

#

about 75% done

slender iron
#

kk. I'll integrate those and then push my rebase

#

had one conflict with main

manic glacierBOT
#
            // CIRCUITPY-CHANGE
            #if MICROPY_PY_BUILTINS_PROPERTY
            // Validate that the type has the correct flag for properties. It is manually
            // managed for native types. If the flag is missing, then act like the
            // attribute doesn't exist.
            if (mp_obj_is_type(elem->value, &mp_type_property) && (type->flags & MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS) == 0) {
                dest[1] = MP_OBJ_NULL;
                retur...
manic glacierBOT
tulip sleet
#

@slender iron

Also MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS is not documented in obj.h with the other flags. Could you add a comment line there (with CIRCUITPY-CHANGE?). Thanks.

#

could you add one comment line to obj.h to document that flag? Not vital.

#

also is the .show fix going to be outdated by this merge? Maybe you said that already above.

#

Never mind, I will add a comment and approve and merge.

#

Never mind even more. The set of comments there needs a lot more work.

slender iron
#

Thanks @tulip sleet I’ll do it tomorrow. Had to run off to get the kiddo

manic glacierBOT
#

After some poking, I was able to reproduce the compile errors I was getting when trying to build a DEBUG image. It turns out the problem shows up with you use the CIRCUITPY_FULL_BUILD=0 option. The issues I was seeing could have been resolved by turning on select modules (CIRCUITPY_DISPLAYIO=1 for example) and perhaps that's the expected route to take but I figured I'd put the changes I made into a PR just in case. I'm not sure these changes have been made in the most appropriate way or place...

manic glacierBOT
stuck elbow
manic glacierBOT
manic glacierBOT
#

I downloaded the "latest" CPY file:
2023-10-25T02:50:15.000Z 2.9 MB [adafruit-circuitpython-unexpectedmaker_pros3-en_US-20231025-702b4a5.uf2](https://adafruit-circuit-python.s3.amazonaws.com/bin/unexpectedmaker_pros3/en_US/adafruit-circuitpython-unexpectedmaker_pros3-en_US-20231025-702b4a5.uf2)
about 9 hours after Dan closed this issue:

Contents boot_out.txt:
Adafruit CircuitPython 9.0.0-alpha.1-86-g702b4a58f8 on 2023-10-25; ProS3 with ESP32S3

Still get:

...
lone sandalBOT
tulip sleet
stuck elbow
#

right, but then you get questions of why it is removed and if there is a way to put it back and so on, while I think that at least in the computer jargon the word "obsolete" conveys the reason and the fact that it won't be coming back

tulip sleet
#

I was thinking of "obsolete" as "deprecated" (still working but going away)

stuck elbow
#

deprecated is a good word too

#

my thesaurus also suggested "kaput" XD

manic glacierBOT
manic glacierBOT
#

@calcut did you manage to get it working on FeatherS2?

I'm trying your code on FeatherS3 and first call to dualbank.flash fails, I suspect due to external flash

>>> dualbank.flash(response.content, offset=position)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: storage is extended

Quick aside: you can get the length dynamically like this

# length = 1354336 #determined manually just now.
head = requests.head...
manic glacierBOT
digital ibex
#

Hey, still working on this idea: #circuitpython-dev message
I think it's best if the Minecraft scripting functionality is implemented in Blinka. However, in order to communicate between Blinka and Minecraft, we'd probably need another library (websockets and grpc are my top two choices) as a dependency of Blinka. Would the Blinka folks be opposed to adding to the package requirements? Is there a better solution? Thanks!

stuck elbow
#

websockets are really complex for a microcontroller

digital ibex
#

It won't be running on a microcontroller. It'll be blinka running on a PC

stuck elbow
#

then why do you need to add it to Blinka?

spare jacinth
#

im not quite sure what's the API/functionality Blinka adds, but as i already said back in the day, i feel like it wouldn't add any value

digital ibex
#

The hope is that you'll be able to use NeoPixels, pin io, etc in Minecraft via blinka

spare jacinth
#

just add some external program which takes python code (or perhaps some GUI in the game within the mod) + then interacts with the game

stuck elbow
#

or a library outside of blinka for talking to minecraft

spare jacinth
#

note: im guessing your goal is that some python code causes signals (redstone) to appear on the game, not like a lever activating a LED on your MCU and whatnot

digital ibex
spare jacinth
#

and afaik blinka adds support for hardware-specific things (eg I2C) to be run somewhere other than a MCU/dev-board...
which would probably be best(and easier) to handle on the mod itself .... ie Java, which doesnt quite fit Blinka (?)

#

you probably won't be using stuff like SPI or I2C in the game, to begin with, so may not even need a bunch of those things being provided by blinka

digital ibex
#

I'm not sure I understand what you mean. Here's an example of how it would work, just so we're all on the same page:

import board
import digitalio
import time

pin = digitalio.DigitalInOut(board.D0)
pin.direction = digitalio.Direction.OUTPUT

while True:
    pin.value = 1
    time.sleep(0.5)
    pin.value = 0
    time.sleep(0.5)

In-game, that would be a redstone lamp connected to a modded-in block, which would blink every half second.

Again, this might not be a plausible/useful idea, but I think it is because it provides a way to get used to CircuitPython syntax in a familiar way (minecraft) without needing actual hardware.

#

I think this could be great for young kids who already enjoy Minecraft and want to learn how to code

#

I2C could maybe be implemented. An example of this is an in-game temperature sensor block, and if you put it close to lava, the value goes up.

spare jacinth
#

May be worth looking into Jython or whatever it was named (Py interpreter written in Java), instead of using CPy/CircuitPy and having to come up with a way of communicating that code (C) with the game (Java)

digital ibex
#

I think I would just write a Minecraft mod in Java, and it would use gRPC or Websockets to talk to Blinka. That goes back to my original question if it would be OK to add a dependency. The user wouldn't need to interact with Java code.

spare jacinth
#

So then your java mod would be just a RPC used to place/destroy blocks, listening to an external program (written in Py? C?) which sends those events?

slender iron
#

@digital ibex I don't think you need to use blinka. instead you could create your own version of digitalio that has a DigitalInOut that does the calls into minecraft

spare jacinth
digital ibex
# slender iron <@525432105224765494> I don't think you need to use blinka. instead you could cr...

My concern is that most of the work is already done with Blinka, and adding a backend that interacts with Minecraft is somewhat simple. I also want this to have support for complex I/O devices, such as NeoPixels, simple sensors, etc. I'd really hate to make what would essentially be a copy of Blinka with hardware functionality replaced with Minecraft functionality. Most of the code is already there.

digital ibex
spare jacinth
#

I dont like the interface, i would aim for all to happen in-game

digital ibex
#

The problem with that is it would be harder to transition from an in-game editor to a real hardware device, when the purpose of this project has been served and it's been used to teach CircuitPython to the user. Also, writing an entire code editor in Minecraft from scratch would be pretty tough. I can imagine the process I have in mind being a little clunky, but I think it's worth not having to use an in-game code editor with limited functionality.

spare jacinth
#

I meant just a text input where mostly you can:

  • See the code running
  • Paste existing code to start running it
    I wouldnt plan on making a full editor lol 😬
#

My question was more on how to feed the code to the game, not on how to edit it.

Your approach would be something like minecraft_py code.py as im understanding it. While i would opt for having a (basic) method of writing/reading code within the game

slender iron
spare jacinth
#

Im not saying "do this", im giving some ideas/opinions

slender iron
#

@digital ibex are you thinking the user code would run on a CP device or from with python on the desktop?

digital ibex
#

Desktop python

slender iron
#

and what does neopixel support mean in a minecraft context?

digital ibex
#

pixels.fill((255, 0, 0)) would make a red block appear in-game

#

There's some tricks you can use to get blocks of any RGB color

slender iron
#

I think you really do just want to reimplement things then

#

make a neopixel class that looks like it from the outside but does custom minecraft stuff under the hood

digital ibex
#

So this would be completely outside of Blinka, but with the exact same API syntax? I could see that

spare jacinth
#

regardless of what the "interface" ends up being, there has to be some basic building blocks like reading/writing digital/analog pins(redstone lines). i would start with that code as soon as posible as it may lead to some meaningful insight of what limitations you will face along the way

then, however that code is called shouldn't be a problem, that compatibility layer is what will mostly cause headaches

slender iron
digital ibex
#

Ok, thanks! I'll try that.

manic glacierBOT
slender iron
#

@tulip sleet I think ☝️ is the last thing for an alpha

tulip sleet
manic glacierBOT
mortal kernel
#

Wondering if there's a discount code for devs purchasing from Adafruit?

#

I need a couple of nrf and espressif boards for Bluetooth LE comparision testing

manic glacierBOT
lone axle
# digital ibex I'm not sure I understand what you mean. Here's an example of how it would work,...

One extra complexity is that you'll somehow need to associate an x,y,z location in the game with your pin You might end up needing some property or init argument for that which differs from the Blinka / CircuitPython API since that concept of location doesn't exist in the same way for the physical pin in the real world.

Temperature sensor in the game might be hard, I don't know if the game tracks a heat value beyond the most basic "touch lava or fire -> take damage" . The game does track light level I believe, and there is already a light sensor in the game. I think it'd be fairly straight forward to rig up similar python code that treats it as an AnologIn that is connected to a photoresistor.

#

For DigitalInOut you can get away without needing a custom block created in your mod I think as well if you want to go that route. You can have it just spawn or not spawn a redstone torch at the specificed location based on the value of the pin.

manic glacierBOT
#

I can't get copying files to a Pico CIRCUITPY from a Mac (M1 Macbook Pro running Sonoma) to reliably work with all/any of the workarounds i.e. I've added to boot.py

import supervisor
supervisor.runtime.autoreload = False

I've done sync in Terminal.
From a newly Flashed-to-CIRCUITPY drive on my Pico, I can copy over the small .py files (boot.py, code.py) quite reliably, but it almost always fails with the (small) MP3s including the ones from the Adafruit sample project (slow.m...

digital shoreBOT
slender iron
#

I'm looking into the build failure now

#

qrio passed CI before 1.21 was merged and wasn't run again

manic glacierBOT
#

I have had good luck with this shell script that remounts the USB drive on the MatrixPort S3.

#!/bin/csh

This works around bug where, by default, macOS 14.0 writes part of a file

immediately, and then doesn't update the directory for 20-60 seconds, causing

the file system to be corrupted.

set disky=df | grep CIRCUITPY | cut -d" " -f1
sudo umount /Volumes/CIRCUITPY
sudo mkdir /Volumes/CIRCUITPY
sleep 2
sudo mount -v -o noasync -t msdos $disky /Volumes/CIRCUITPY

manic glacierBOT
#

The FULL_BUILD=0 option was the first thing I tried when the DEBUG=1 build didn't fit. I did get a build to work by turning off/on individual features which is fine, but I figured if there was a CIRCUITPY_FULL_BUILD flag it should work.

I agree that raising an error message rather than simply ignoring the option would be a better option, I can try and rework this with error messages if you like, or if you think the FULL_BUILD option is not really needed I can see that point as well.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.2.4 on 2023-08-22; Adafruit Feather ESP32-S2 TFT with ESP32S2

Code/REPL

>>> import re
>>> re.search(r">\S*?test>> re.search(r">\s*? >> re.search(r">[\s\S]*? test >> re.compile(">.*? test <") is None
False

Behavior

When searching for \S aka any non-whitespace character, re module finds a match.
Similarly, when searching for \s aka any whitespace character, re module also finds a match.

...

orchid basinBOT
#

At first glance, this proposal seems reasonable.

After a moment of reflection (in my situation, as a noob with circuitpython, a beginner in uC and a programmer with many years of experience), it begins to be: a lot of work that is not necessarily necessary for anyone.

Each board has a list of built-in modules that are available. Each module and library has its own very good documentation. It took me about 2 days to find documentation for the modules... And this should be the link.

manic glacierBOT
tulip sleet
#

i am working on 9.0.0-alpha.2 release notes

slender iron
#

Ari is home today so I’ll be off and on

tulip sleet
#

@slender iron I finished the 9.0.0-alpha.2 release notes. I think the RTD build should be fixed, but other than that, maybe ready to go. Did you look at RTD or should I do that?

slender iron
#

I haven’t had a chance yet. Going to the pharmacy. Will have time once he’s down for nap

tulip sleet
#

Error
Build output directory for format "pdf" contains multiple files and it is not currently supported. Please, remove all the files but the "pdf" you want to upload.

#

Maybe we should just drop the Support Matrix PDF

manic glacierBOT
slender iron
#

want me to do it? ari just went down

tulip sleet
#

sure, you are familiar with the CI steps you just changed

#

anything else you want to get in for alpha.2?

slender iron
#

not really. the warning stuff can go in the next release

#

the docs build isn't really needed for the release either

#

(though I know the change to make)

manic glacierBOT
#
[adafruit/circuitpython] New branch created: tannewt-patch-1
tulip sleet
#

but otherwise I think we have a good snapshot

onyx hinge
#

Thanks Dan for fixing that. I must have forgotten to set up pre-commit

slender iron
#

PR to disable the second pdf is in the queue

manic glacierBOT
orchid basinBOT
#

Automated website update for release 9.0.0-alpha.2 by Blinka.

New boards:

  • adafruit_esp32s3_camera
  • adafruit_qualia_s3_rgb666
  • es3ink
  • espressif_esp32c6_devkitc_1_n8
  • espressif_esp32c6_devkitm_1_n4
  • espressif_esp32h2_devkitm_1_n4
  • espressif_esp32s3_devkitc_1_n8r8_hacktablet
  • espressif_esp32s3_lcd_ev
  • luatos_core_esp32c3_ch343
  • m5stack_atoms3
  • m5stack_atoms3u
  • m5stack_m5paper
  • m5stack_stick_c_plus
  • makerfabs_tft7
  • pimoroni_pico_dv_base_w
  • supermini_nrf52840
  • ugame22
  • wavesha...
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.2.7 on 2023-10-19; VCC-GND YD-ESP32-S3 (N16R8) with ESP32S3

Code/REPL

from busio import I2C, UART
import board
i2c = I2C(board.GPIO41, board.GPIO42)
uart = UART(board.GPIO1, board.GPIO2, baudrate=9600)

Behavior

Board disconnects from the computer, power cycles, then flashes triple yellow lights on loop.
On plugging it in and connecting via serial, this is the readout

You are in safe mode be...
manic glacierBOT
#
boards/adafruit_esp32s3_camera/board.c:90:9: error: passing argument 19 of 'common_hal_busdisplay_busdisplay_construct' makes pointer from integer without a cast [-Werror=int-conversion]
   90 |         45,  // backlight pin
      |         ^~
      |         |
      |         int
In file included from ../../shared-module/displayio/__init__.h:28,
                 from boards/adafruit_esp32s3_camera/board.c:33:
../../shared-bindings/busdisplay/BusDisplay.h:44:78: note: expected 'co...
manic glacierBOT
manic glacierBOT
tulip sleet
manic glacierBOT
digital shoreBOT
tulip sleet
slender iron
#

I can look too. Just got to my desk

tulip sleet
#

ok sure, go ahead

slender iron
#

@tulip sleet my guess is that the PR was green based on a merge before my warnings PR went in

#

this is what the build queue is supposed to solve

tulip sleet
#

yah, I think so, so it should be easy to fix

#

does turning on the build queue change our workflow?

slender iron
#

just sent a PR to build 9.x bundles too

#

thanks for releasing alpha 2!

tulip sleet
slender iron
#

I can look

pallid creek
#

I might be able to help with the merge queue issues. My company's tools specifically help with high PR velocity repos. I got permission to use it for free on open source projects.

slender iron
#

what tool is it? I was thinking we'd enable the github merge queue to start

pallid creek
#

Yes, that's a good start.

#

I mainly work on the Check tools, which manage all of the linters and code prettiers, but I just learned about Merge from another engineer this week, and it sounds exactly like what would help your PR collisions.

manic glacierBOT
manic glacierBOT
slender iron
#

build tools PR is green

tulip sleet
#

merged - i changed to 8.2.0 instead of 8.0.0 to get the paths right

manic glacierBOT
#

@dhalbert Manually remounting clears the nodev, nosuid, and noatime flags. Manually mounting with or without the noasync option works around the problem. Likewise, manually mounting with various permutations of these four flags always works around the problem, including the case where no mount flags are provided. Looks like the mount flags are a red herring, it's some other difference between an automatic vs. a manual mount.

Testing on Sonoma 14.1.

tulip sleet
#

@mortal kernel - ugh, this is sort of worse, since now there's something hidden going on

mortal kernel
#

Any luck with 14.2 beta?

manic glacierBOT
#

Apologies if this has been covered already; I skimmed and it looks like most of the focus has been on async and auto-reload.

The problem also happens with the UF2 boot loader drive - for instance, trying to update CircuitPython firmware by dragging its .uf2 file to the boot loader drive under Sonoma fails.

Given that, it also unsurprisingly happens with non-CircuitPython devices - I couldn't install Bluetooth sniffer firmware on a Nordic nRF dongle on a Sonoma Mac. I was able to using L...

tulip sleet
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 9.0.0-alpha.2 on 2023-10-27; Raspberry Pi Pico with rp2040

Code/REPL

>>> import adafruit_pcf8575
Traceback (most recent call last):
  File "", line 1, in 
ImportError: no module named 'adafruit_pcf8575'

>>> import sys
>>> sys.path
['', '/', '/lib']

>>> open('/lib/adafruit_pcf8575.mpy')
Traceback (most recent call last):
  File "", line 1, in 
OSError: [Errno 2] No such file/directory: /lib/adafruit_...
#

@dhalbert Good point! I just re-ran the test:

  • prepped a clean 64MB filesystem on a USB flash drive (using dd from a filesystem image prepared under Linux)
  • unplugged the drive
  • rebooted the Mac (just to be absolutely sure)
  • plugged the drive back in and let macOS mount it
  • confirmed it was empty
  • copied a batch of .py files that cause the error on a 4MB filesystem
  • successful copy, no errors
/dev/disk6 on /Volumes/NO NAME (msdos, local, nodev, nosuid, noowners, noat...
#

@eightycc Just tested this:

  • prepped a clean 4MB filesystem on a USB flash drive (using dd from a filesystem image prepared under Linux)
  • unplugged the drive
  • plugged the drive back in
  • confirmed it was empty
  • mkdir /Volumes/NO\ NAME
  • mount -t msdos -o nodev,nosuid,noowners,noatime /dev/disk6 /Volumes/NO\ NAME
  • copied a batch of .py files that normally cause the error on a 4MB filesystem
  • as you predicted, this actually worked and they copied successfully
/dev/...
#

It would be nicer to write

pin = digitalio.DigitalOut(pin=board.GP123)

# or this
pin = digitalio.DigitalInOut(pin=board.GP123, direction=digitalio.Direction.OUTPUT)

# than this
pin = digitalio.DigitalInOut(pin=board.GP123)
pin.switch_to_output()

"Explicit is better than implicit." Defaulting to input seems arbitrary and it would be better for code to be explicit about direction. And it makes it a one-liner to define an output pin, which is nice if you're doing many of...

mortal kernel
#

@danh I'm checking into the >8M filesystem reported by @romkey on 8449 just now. If I can confirm that, I have an idea for a workaround. If we report a >8M filesystem, but mark the excess blocks as in use in the FAT without a corresponding directory entry, the OS will think it has a larger device but won't be able to access the non-existent blocks. If the OS does try to read those blocks as part of a caching scheme, return them as zeroes. Could this work?

manic glacierBOT
#

Sometimes you want to switch a pin from input to output or vice versa and then back again. For instance this is useful when scanning keyboard matrices. We are thinking in the long run about separating pin I/O state from pin functionality. For instance, you'd create a "Pad" or some name like that on a given pin. Then you could control its I/O state (pulls, open-collector output, drive strength), and pass that around to DigitalInOut, busio.whatever, etc., rather than simply passing a pin name...

manic glacierBOT
mortal kernel
tulip sleet
#

i don't remember if oofatfs has the ability to have two FAT's. Also it would take up extra space in the 64kB CIRCUITPY's.

mortal kernel
tulip sleet
#

oofatfs does support FAT16 and up, but maybe just with one FAT. So maybe the two FAT's are not necessary, but it seemed like some OS's wanted two FAT's. We'd need some experimentation and studying of oofatfs

#

this Sonoma problem is all too familiar, in some ways

pallid creek
tulip sleet
#

They broke FAT12 support in the past, and then fixed it again. It's not missing, but it doesn't work the same way.

mortal kernel
tulip sleet
#

sounds great!

#

If you could make it fake FAT16, that might solve two problems. But also see if it reports a false size with the bad blocks. That will be a support issue.

mortal kernel
tulip sleet
manic glacierBOT
tulip sleet
#

i thinik I have seen capacity go down on hard drives that had a lot of bad blocks

manic glacierBOT
mortal kernel
crimson ferry
#

just copied the entire .py library bundle to a 16MB FAT16 CIRCUITPY (UnexpectedMaker FeatherS2) w/o mishap (macOS 14.1)

crimson ferry
#

Ditto 32MB FAT16 (espressif N32R8). 300+ library files copied to 8MB FAT16 (espressif N8R8) also look intact. I didn't reboot between or do any kind of manual mounting, just plugged in new devices.

mortal kernel
crimson ferry
#
statvfs:
N32R8 (2048, 2048, 15176, 10309, 10309, 0, 0, 0, 0, 255)
UM16 (2048, 2048, 5969, 511, 511, 0, 0, 0, 0, 255)
N8R8  (1024, 1024, 5796, 728, 728, 0, 0, 0, 0, 255)
#

wasn't the 8MB expected to fail on the copy though? (or is that just on UF2)

#

I can't get an error at all now on macOS 14.1 ... 4MB FAT12 (QT Py S3 N4R2): copied (and edited) files appear OK ((1024, 1024, 2348, 2050, 2050, 0, 0, 0, 0, 255))

#

(I had copy issues on 14.0)

#

not at all convinced all is good, just can't get an obvious failure

mortal kernel
crimson ferry
#

I thought the 8MB FAT16 and the 4MB FAT12 would fail, but not so far

mortal kernel
crimson ferry
#

oh, btw, did this on an Intel-based macOS14.1

#

(not ready to do other Macs yet, need them issue-free)

mortal kernel
manic glacierBOT
keen eagle
gusty plover
tulip sleet
gusty plover
#

I am flashing NINA as we speak

gusty plover
#

1.7.5 still happening

mortal kernel
#

@danh Disappointed to report that faking out the filesystem will eat up a relatively large amount of flash on smaller devices. For example, on a ATSAMD21E18 64K is allocated for the filesystem. Ballooning that to 8M+64K increases the cluster size from 512 bytes to 2048 bytes. It also increases the FAT table size from 512 bytes to 6656 bytes decreasing the amount of available filesystem space to about 53K. Each file stored will cost ~896 bytes more.

manic glacierBOT
#

Easier way to verify, doesn't even need a USB drive.

Create an 8MB FAT12 disk image. Not sure how to do this on macOS, on Linux it's:

truncate -s 8M disk8.img
mkfs.vfat -F 12 disk8.img

Transfer this to your Mac.

Mount it - either open Disk Utility in the Finder and use File | Open Disk Image...

or

diskutil image attach disk8.img

This should mount as /Volumes/NO NAME and appear in the sidebar in the Finder.

Copy small files to it from the command line...

onyx hinge
#

https://fosstodon.org/@brettcannon/111309638874068503 something to potentially investigate for circuitpython libs

manic glacierBOT
mortal kernel
#

@danh If you saw my message from last night, I think I've got a workaround that doesn't eat up flash on flash-constrained device (ex., M0 trinket). Changing to FAT16 increases the FAT table entry size so that cluster size remains 512 bytes. This gives us 128 clusters on a 64K device. Only the first 512-byte block of the expanded FAT is meaningful, the remainder is filled with bad block codes, so it can be faked without consuming flash.

manic glacierBOT
#

Retested with 8.2.7 and latest libraries. It fails even earlier:

Adafruit CircuitPython 8.2.7 on 2023-10-19; Adafruit CLUE nRF52840 Express with nRF52840
>>> from adafruit_clue import clue
>>> import time, gc, random
>>> gc.collect() ; gc.mem_free()
87200
>>> a=[(1.0, 2.0, 3.0) for x in range(500)
... ]
>>> def read(n):
...     for idx in range(n):
...         a[idx] = clue.magnetic
...         
...         
... 
>>> 
>>> 
>>> gc.collect() ; gc.mem_free()
68800
>>> re...
gusty plover
#

BLE on Titano

mortal kernel
# tulip sleet Thank you for working on this!

NP, I'm enjoying this. oofatfs gets a bit sloppy setting cluster sizes, i.e., it sets FAT16 cluster size using a FAT12 table that in turn sets the cluster size too large for FAT12. Also, it always allocates 512 root directory entries, eating up 16K on a device that can only hold a few fewer than 128 files.
Looks like a similar, but not identical oofatfs is in tinyusb that has the same issues. Any suggestions on how/if I should proceed? File pulls for tinyusb?

stuck elbow
#

@tulip sleet was there a change in keypad.Keys in 9.x? I'm getting AttributeError: 'Keys' object has no attribute 'events'...

#
>>> import board
>>> import keypad
>>> keys = keypad.Keys((board.X, board.DOWN, board.LEFT, board.RIGHT,
... board.UP, board.O), value_when_pressed=False, interval=0.01)
>>> keys.
deinit          reset
>>> keys.events
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'Keys' object has no attribute 'events'
>>> dir(keys)
['__enter__', '__exit__', 'deinit', 'reset']
stuck elbow
#

hmm, I see I need CIRCUITPY_KEYPAD_KEYS = 1 now

#

but even that doesn't make it work

#

scratches his head

#

I can't get it to work, even if I put CIRCUITPY_KEYPAD_KEYS define in mpconfigboard.h

manic glacierBOT
onyx hinge
tulip sleet
#

Ok I see previous dialogue. Will look at this but I’m in issue review mode at the moment

stuck elbow
#

sorry, no hurry, I was just surprised

stuck elbow
#

hmm, it looks like the attribute is there on the class, it just it doesn't work as a property on the instance

#

adding MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS to the class definition fixes it

manic glacierBOT
random junco
#

Please don't crosspost - this is already in #help-with-circuitpython which is the right place. This channel is for development of CircuitPython itself

manic glacierBOT
tulip sleet
#

@slender iron @onyx hinge as might be clear, I went through all the "Long Term" issues and tried to close those that could be closed.

#

closed not quite 50 issues

#

so from about 600 to about 550

manic glacierBOT