#circuitpython-dev

1 messages · Page 81 of 1

tiny peak
#

do you mean nrf54 specifically, or does that also apply to CLUE?

slender iron
#

nrf53 and 54

tiny peak
#

ah, okay. I'm on track to look at nrf52

slender iron
#

clue would be fine. just add the circuitpy partition location. don't worry about the SD ones

manic glacierBOT
#

Do we really need CircuitPython to support this? Would it be enough to have a folder -> fat filesystem -> uf2 converter? This would be orthogonal to CircuitPython except for placing the filesystem in the same place.

This would be ideal. Is there a way to pull out of a CircuitPython UF2 all the information needed to append the CIRCUITPY filesystem? It seemed to me this hypothetical tool would need to know some internals of particular CircuitPython builds in order to do that. And/or wo...

tiny peak
#

If you want me to change the flash partition addresses on that RP2350 board def PR, help understanding the correct start address and size would be welcome.

slender iron
#

kk, lemme look

tiny peak
#

circuitpython/ports/raspberrypi/mpconfigport.h

// Setting a non-default value also requires a non-default link.ld
#ifndef CIRCUITPY_FIRMWARE_SIZE
#define CIRCUITPY_FIRMWARE_SIZE (1020 * 1024)
#endif
slender iron
#

yup, except when it is 1536k (when the board has wifi I think)

#

having circuitpy in zephyr board defs would be great. I want to do zephyr uf2 *bootloader at some point

tiny peak
#

ports/raspberrypi/boards/raspberry_pi_pico2_w/mpconfigboard.mk

# Must be accompanied by a linker script change                                 
CFLAGS += -DCIRCUITPY_FIRMWARE_SIZE='(1536 * 1024)'
manic glacierBOT
tiny peak
manic glacierBOT
#

The filesystem isn't "appended" necessarily.

Ah okay. I phrased it that way because at some point I recall having success literally concatenating UF2 files to append the CIRCUITPY filesystem on rp2. Looks like there's things like uf2tool now to be little less cavalier about it.

What platform are you targeting specifically? The implementation will depend on that.

For architectures, I think rp2 and esp32 would cover most systems people are concerne...

slender iron
#

rp2 doesn't have any internal flash

#

so it is always external

#

on nrf, it is all of external flash if it exists

#

otherwise it is a portion of internal memory

tiny peak
#

oh wow... ah, so the openocd stuff is magically handling the XIP programming... huh

slender iron
#

yup

tiny peak
#

so, are you suggesting that it would be nice to have a node called "circuitpy" in the dts file which matched the address range used by normal CircuitPython for the CIRCUITPY drive?

slender iron
#

it should be a fixed partition

#

but otherwise uses heuristics for it

tiny peak
#

so, do you mean you'd like to have something that looked kinda like this:

&flash0 {
    ...
    partitions {
        ...
        circuitpy_partition: partition@100 {
            ...
        };
    };
};
slender iron
#

yes, I think so

tiny peak
#

I can work with that

#

thanks!

short tendon
#

Any reason it shouldn't happen?

slender iron
#

do you mean get rid of import secrets?

short tendon
#

Yes, and things that take secrets (like build them from settings.toml)

slender iron
#

what would you replace it with?

#

I guess I'm not super clear what you are asking. Maybe file an issue on the learn repo about it to start? Have a couple examples of the changes there

#

before you dive into doing it all

short tendon
#

Well, it's everywhere. like here and here. I know last year we cleaned up some, but it's still in a lot of places

slender iron
#

and what would you replace it with?

#

the start of the second example seems okish

#

I'm ok calling getenv

short tendon
#

just using settings.toml

#

which cam out in CP7 I believe...

slender iron
#

but it'll take more than just changing the example code

#

the learn guides themselves may need to be updated

short tendon
#

Yeah, so I would l:

  1. Make sure libs don't need it
  2. Update examples
  3. Update learn guides
#

1 and 2 would be a PR for each lib repo and then a big one for the learn guide

slender iron
#

3 isn't doable from github PR unfortunately

short tendon
#

Oh 😦

slender iron
#

learn is a private database under the hood

short tendon
#

Gotcha

slender iron
#

that's only the referenced code, not the prose

#

we could coordinate with someone like foamyguy who has access but I'm not sure it is a priority

short tendon
#

Fair. I guess if it becomes one, let me know and I can help

slender iron
#

thank you!

short tendon
#

For sure

slender iron
#

there may be guides that don't mention it

#

but it's a lot of checking

short tendon
#

If we did all the code, but not the guides, the worse case would be someone got stuck and reached out here for help?

slender iron
#

I don't think we want that experience from the guide side though

#

do one and we can go from there

short tendon
#

Okay. I'll look at libs and see which ones if any still take secrets as an object passed in

slender iron
#

👍 thanks. it would be nice to get switched over

#

learn guides are just tricky

tulip sleet
#

@short tendon I did a lot of the Learn Guides already. There may be some mirrored pages that are still old. Also there are one or two projects that store some complicated thing in secrets.py, like some JSON data, and I didn't revise those to eliminate it there.

short tendon
#

Do you think it's worth updating those to use settings.toml?

tulip sleet
#

So if you make a PR to the learn guides repo, you could list the Learn Guides in the PR, and we'll correct them when the PR is merged.

tulip sleet
#

but it's only one or two guides

#

Some adafruit io or other IoT guide, I think

short tendon
#

Ahhh, is it really secret data? Or generic config data that could be moved into another file (and if you have an example I can answer that for myself)

tulip sleet
#

I think it was some secret data ... trying to find it

#

I can't find it now. I am finding more guides than I thought that still use secrets.py. Maybe I just changed the Eespressif ones. It was months ago -- I don't remember

#

anyway, we'd certainly be grateful for a PR. You could make an issue checklist for each guide (using [ ] in an issue post -- do you know about that?)

short tendon
#

Okay, I can start working through things. I'll start with building out a list

tulip sleet
short tendon
#

Gotcha. And there's no way for me to fix those, other than maybe finding where the issues are?

tulip sleet
manic glacierBOT
manic glacierBOT
#

@gamblor21 I know the ESP32 features an 8-bit DAC that was recently supported within audioio.AudioOut, so I wouldn't say that those formats are completely out of the picture. I think what might be a good compromise is to have all internal audio processing run as 16-bit signed interlaced (l/r/l/r), but handle the different output formats in the final stage before output which can be port-specific. I'll definitely look into compiling an issue with this info in so that we can discuss this furt...

manic glacierBOT
#

Currently, each object which utilizes the audiosample API is required to support multiple formats and manage common audio tasks independently. In order to reduce flash size, complexity, and the barrier to entry to create new audiosample objects (namely audio effects), the audio pathway should be streamlined by using a single format and adding shared resources for general audio processing tasks. These optimizations include but are not limited to the following lists. Feel free to suggest other ...

manic glacierBOT
#

The Blues.io circuitpython-fs-builder might be of interest to you, https://github.com/blues/circuitpython-fs-builder

I stumbled across it while playing with the Swan microcontroller a couple years ago. It's really meant for a different use case, but I thought it might be useful for the use case I think you're talking about here. I'm easily distracted though and didn't really follow up. There's a pretty good video explanation starting at around 50:20 of this video: https://youtu.be/fUUOmpEwpCE

manic glacierBOT
manic glacierBOT
willow totem
tiny peak
#

@slender iron by my reckoning, seems like the Feather RP2350 CIRCUITPY drive partition should start at 0x100000 (1MB) and have size of 0x700000 (7MB). Does that seem right?

tulip sleet
slender iron
tiny peak
manic glacierBOT
#

For architectures, I think rp2 and esp32 would cover most systems people are concerned about.

rp2 should be possible already. The bootloader allows you to overwrite any portion of flash.

ESP32 doesn't allow a uf2 to write outside of the ota_0 partition. (tinyuf2 README So, we'd need to add the ability to write to the data partition.

Alternatively, idf.py could be used to flash directly. It can include both TinyUF2, Circ...

tiny peak
#

@slender iron saw your merge. Wondering if you tried building CircuitPython with that board def, and if so, did it work?

slender iron
#

nope. I didn't

#

you could try

manic glacierBOT
manic glacierBOT
short tendon
#

@tulip sleet are you good changing:

adafruit_esp32spi_wifimanager.ESPSPI_WiFiManager(esp, secrets, *)

to:

adafruit_esp32spi_wifimanager.ESPSPI_WiFiManager(esp, ssid, password, *)

And doing a major version update?

tulip sleet
# short tendon <@329766224093249548> are you good changing: ```py adafruit_esp32spi_wifimanager...

two things:

  1. that will break existing code, which we might not want to do immediately. We could do:
    ESPSPI_WiFiManager(esp, secrets=None,*, ssid=None, password=None), and check for one or the other.
  2. The secrets can also include enterprise credentials. See https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI/blob/71a07cc43a80d02d627dce595eeb246e089c2679/adafruit_esp32spi/adafruit_esp32spi_wifimanager.py#L73
#
        # Check for WPA2 Enterprise keys in the secrets dictionary and load them if they exist
        self.ent_ssid = secrets.get("ent_ssid", secrets["ssid"])
        self.ent_ident = secrets.get("ent_ident", "")
        self.ent_user = secrets.get("ent_user")
        self.ent_password = secrets.get("ent_password")
#

So those should also be optional keyword args

#

or else come up with some other arg scheme that allows passing either

#

@willow totem ^^

short tendon
#

Yuck. I'd hate to have the new ones at the end...

#

What if we made WiFiManager that was a subclass of ESPSPI_WiFiManager with an updated __init__?

tulip sleet
#

why is it yuck? too many args? They are optional

short tendon
#

And once everything is using that (like PortalBase) delete the old one

#

more that they are at the end after things like debug

tulip sleet
#

they can be in any order if they are keyworded

short tendon
#

and then it's harder to remove the secrets when people write code that's positional

tulip sleet
#

i guess the q is how many people are using WiFiManager themselves. Is it prevalent in the exmaples, or is it just in PortalBase, etc.

short tendon
#

it's in a bunch of examples

tulip sleet
#

do you think ssid and password should be able to used only positionally, or with keywords? Are there other API's with just positional?

short tendon
#

so, I use keywords, but examples don't. And we don't force it

tulip sleet
#

non-upward compatible or not, how should the enterprise args be passed?

#

I am not averse to using class methods as alternate constructors (factory fns), but I've gotten pushback on that sort of thing

short tendon
#

I would do as args:

    def __init__(
        self,
        esp,
        ssid,
        password,
        enterprise_ident=None,
        enterprise_user=None,
        status_pixel=None,
        attempts=2,
        connection_type=NORMAL,
        debug=False,
    ):
tulip sleet
#

with no forced keyword args, no *? I would be inclined to force keywords after password, if we are going to make a breaking change.

short tendon
#

I'm good doing that

tulip sleet
#

also maybe check if ssid is a dictionary, and print an explanatory message, otherwise when people don't change their code but update the library, the error msg will be very confusing. I may bring this up in an internal meeting this evening to see what folks think.

short tendon
#

that makes sense.

#

If it's good, I can update that, portalbase, hue and any dirrect examples

tulip sleet
#

We could even treat ssid as secrets if it is a dict (e.g. make it backward compatible for now, with a warning).

#

so, major library change, upward compatible for now, old code still runs, and then we change all the examples and the libraries, and then, a while later, remove the back-compatibility. do any exmaples use secrets=secrets right now?

short tendon
#

would you treat password as status_light when that happens since there's a lot of examples that pass that in?

tulip sleet
#

ugh, I didn't know that

short tendon
#

and no instances of secrets=secrets

tulip sleet
#

i am liking your subclass idea better, but maybe make ESPSPI_WiFiManager be a subclass of WiFiManager. It just shuffles the args around and passes them up. It could print a warning. Eventually we drop that subclass.

#

it's a pretty verbose classname now anyway

short tendon
#

I can do that too

#

And like making it the main one from the beginning

tulip sleet
#

I like that the best: upward compatible, can print a warning, no "big bang" needed on guide changes, etc.

short tendon
#

Awesome. Won't have to release multiple things at the same time

short tendon
#

@willow totem what should the AIO names be in settings.toml:

aio_username = getenv("CIRCUITPY_AIO_USERNAME")
aio_key = getenv("CIRCUITPY_AIO_KEY")

or

aio_username = getenv("AIO_USERNAME")
aio_key = getenv("AIO_KEY")
short tendon
#

@tulip sleet something like this work:

        print("--------------------")
        print(
            "You are using the legacy ESPSPI_WiFiManager that uses the secrets dict versus passing "
            "in vars from settings.toml"
        )
        print("Please update to using WiFiManager, you can look at the examples on how to update."
        print("This class will go away in the future")
        print("--------------------")

If it's close we can finesse it in the PR

tulip sleet
onyx hinge
#

but then circuitpython would have to parse it and ugh 🙂

tulip sleet
stuck elbow
#

it would be very cool for the boards that have a camera

tulip sleet
#

we could write a little library to parse that string

short tendon
#

I'll open the PR as soon as I know the correct/current naming for the AIO keys (so they don't need to be changed again)

random junco
tulip sleet
#

I agree, use the name that shows up when you ask for your credentials

#

which is as paul mentions

slender iron
#

@lone axle did you write a tilemap importer from the tiled app?

lone axle
slender iron
#

👍

willow totem
#

If you visit io.adafruit.com then click the yellow key (or View Key in burger menu on small screen widths)

short tendon
#

Although now I realize my PR is wrong because I used the wrong prefix

manic glacierBOT
lone sandalBOT
manic glacierBOT
#

Hi Dan, most of the time only one space after the coma is required. In rare case , as technical messages, we use space,space.
" conjonction de coordinations" like "or ni car" is most usefull ex: ""Impossible de construire AudioOut car le canal est déja ouvert" is better for this debug message.
In French:

'Or ' adds a slight contrast ("yet").
'Ni 'negates multiple elements ("neither...nor").
'Car' gives a reason ("for/because"). -> that case
They're often used instead of commas ...

mortal kernel
#

@danh Would you like me to take #10082?

tulip sleet
# mortal kernel @danh Would you like me to take #10082?

Sure, if you would like. Worth reading the release notes carefully to see how it impacts us. We manage TinyUSB versions ourselves so that change is not for us. The higher allowed speed for RP2040 is worth investigating -- does the regulator voltage need to be adjusted on a speed change, or is it already OK?

#

worth tracking what philhower is doing with this

mortal kernel
#

The clock speed change for RP2040 that allows higher rates will have implications beyond regulator voltage. For example, I wouldn't expect anything involving the PIO to work out of the box without clock divider adjustments. I'd be most careful with the CYW43, it's proven to be very touchy.

I think we'll want to pick up the SDK update as a matter of course. If we really want to increase the clock speed that should be a separate issue.

#

But first there are RP2350 build problems with CP and SDK 2.1.1 that will need to be resolved.

#

@danh Who is philhower and where can I find their work?

tulip sleet
slender iron
mortal kernel
slender iron
#

yup, they are for rp2040

#

I'm trying to remember where I got those values

mortal kernel
#

Comparing the tables in the RP2040 and RP2350 datasheets, the voltages for the various settings of VSEL differ. For example, the default code of 0b1001 is 0.860v for the RP2040 but is 1.100v for the RP2350. Of course process and default core clock frequency differences will require different voltages, I'm wondering if the Foundation scaled the code to voltage assignments to match?

slender iron
#

I think they are done on the same 40nm process

#

(not made by the rpi foundation. it is rpi trading)

mortal kernel
#

I'm thinking that if someone is savvy enough to overclock, we might want to give them control over the voltage as well as the frequency?

slender iron
#

its mainly used by picodvi on the rp2040

mortal kernel
#

(That's a 404)

slender iron
#

link works for me

#

oh, its a private repo 😬

mortal kernel
#

Got it. Aside from the frequency/voltage issue, which I don't think we'll get to the bottom of anytime soon, I think updating the SDK version remains a good idea. Do you agree?

#

There are some CYW43 fixes we should pick up, IMHO.

slender iron
#

ya, definitely worth updating

mortal kernel
#

Thanks! The SDK update restructures floating point support for the RP2350 in a way that breaks our build. I'll get that fixed and go from there.

slender iron
#

thank you!

tulip sleet
mortal kernel
#

I haven't hit the missing return bug yet (still working through floating point issues), but it looks like a show-stopper. We'll see.

#

@danh Thanks for the heads up!

manic glacierBOT
solar whale
#

@lone axle If I want to do a guide for the RFM library, should I do it in the "Playground" or in the Adafruit Guides? If I start off as a Playground, is it simple to migrate to the Adafruit Guides if you want it there?

#

I made a Guide a long time ago, so I think I have access.

lone axle
# solar whale <@382939733107408897> If I want to do a guide for the RFM library, should I do i...

I think it would be great to have a guide for it, but I don't think it's up to me neccessarily between playground and learn guide. I would say maybe email pt and Limor to ask about it. They may have thoughts on specific ideas or hardware to include if it is a learn guide.

Migrating from playground to guide does require some manual copy/pasting as far as I know. However the text fields do keep their formatting I believe which makes it a bit less tedious. But I don't think there is any high level "migrate" button. Would require making a new guide creating page(s) and copy/pasting from the playground to the guide.

mortal kernel
#

@danh As luck would have it, CP does not use the affected SDK routines enable_interrupts() and disable_interrupts(). CP and its 3rd party libraries instead use save_and_disable_interrupts() and restore_interrupts() which are not affected.

manic glacierBOT
short tendon
manic glacierBOT
plucky tulip
#

I am not sure where to post it but I believe the Adafruit Feather RP2040 with USB Type A Host 5723 should be listed "CircuitPython" category (https://www.adafruit.com/category/956), as currently it is not.

manic glacierBOT
tulip sleet
manic glacierBOT
#

Also, it's not necessary to wire up the display just to reproduce the fault:

  1. I can get the same fault on the Feather RP2350 with the display disconnected
  2. I got the same hard fault result by running the reproducer above on a Metro RP2350 with no display connected
    (Adafruit CircuitPython 9.2.4 on 2025-01-28; Adafruit Metro RP2350 with rp2350b)
willow totem
# short tendon Gotcha. And there's no way for me to fix those, other than maybe finding where t...

Meant to send this last night sorry. I'm on UK time, but a bit of a night owl so very flexible if you want to chat. My desire is to get all the internet connected matrix and pyportal projects working reliably. Mostly secrets updates and try catch count+reboot, but ideally get some memory issues resolved, and adapt to adafruit_json_stream for consuming large json payloads (80k) with displays running, and any other little bits. If any of the upcoming changes make sense for me to do too, then happy to, or together/whatever. Was going to do a few sweeping PRs on the learn guides repo (for the code examples), probably in stages, and do the guide text updates as the guide code PR's get merged.

tiny peak
#

Shout out to everybody involved in getting DVI output working on the Metro RP2350 with HSTX. Just tried it out tonight on a TV, and it's awesome!

manic glacierBOT
#

Another data point (thanks to @Neradoc on discord for mentioning this):

If you register a release_displays atexit, like this:

import atexit
atexit.register(displayio.release_displays)

it stops the hard fault when you use the REPL. But, if your goal was to continue using the 2x zoom after code.py ends so you can have it for the REPL (perhaps with USB keyboard), then releasing the display doesn't help.

manic glacierBOT
#

CircuitPython version and board name

Adafruit CircuitPython 9.2.4 on 2025-01-29; 01Space 0.42 OLED ESP32C3 with ESP32-C3FH4
Main branch too

Code/REPL

Auto-reload is off.
Running in safe mode! Not running saved code.

You are in safe mode because:
CircuitPython core code crashed hard. Whoops!
Heap allocation when VM not running.
Please file an issue with your program at github.com/adafruit/circuitpython/issues.
Press reset to exit safe mode.

Press any key to...
thorny jay
#

@lone axle I noticed that you were working on joystic activities, maybe link to Fruit Jam.
Not sure where is that taking place, I saw a learn guide piece of code for USB Host joystic and maybe a show an tell piece.
I have two "i2c joystics" that I would love to see supported:

  • https://www.adafruit.com/product/5743
  • https://www.adafruit.com/product/5753
    Then of course I am interested in Wii Nunchuck:
  • https://www.adafruit.com/product/4836
    For that last one, Adafruit as a simple library, and the community as another that support many more joystick over I2C.
    The idea would be a joystic library that would abstract various input device and make it easy to adapt games from one platform to another... not sure if that already exist, but sure it would help for the game part of Fruit Jam (we all know most home computer from the 80's were mostly used for games and not for programming... only a few did and are now in the IT business)
manic glacierBOT
lone axle
# thorny jay <@382939733107408897> I noticed that you were working on joystic activities, may...

My vision is for https://github.com/FoamyGuy/CircuitPython_GameControls to basically be the library you mention abrstracting input devices to make it so game code can easily swap to different controllers.

For joysticks specifically currently it's only converting analog data into D-Pad button presses, but ultimately I'd like to make it possible to get the analog values too if games want to make use of them.

It already supports the I2C Stemma gamepad I think, although the class for it is named after the Feather Joywing, I believe they are similar enough to be interchangable for this code, but I haven't actually tested the stemma one I don't think.

#

PC joysticks and WII nunchuck would be cool to have as well, they aren't currently supported. I could pick up a nunchuck adapter, I'm pretty sure I've got some of those around. I don't believe I have a PC joystick. Maybe someone else would be willing to PR support for it, or eventually I may get lucky and find one in a thrift store or similar.

thorny jay
manic glacierBOT
#

microcontroller allows setting the RP2 core clock frequency, but does not allow direct adjustment of the core supply regulator output voltage. Instead, it selects a core clock frequency based on experimental data valid for the RP2040 only.

Feature request for an additional microcontroller.cpus[x].voltage property that allows setting the core supply regulator output voltage.

short tendon
# willow totem Meant to send this last night sorry. I'm on UK time, but a bit of a night owl so...

So here is the direction I was thinking:

  1. Get the secrets out of ESP32SPI - PR here
  2. After that's released update PortalBase and Hue to go from ESPSPI_WiFiManager to the new WiFiManager (and any examples)
  3. Update all other examples to not use ESPSPI_WiFiManager or secrets

I have both a Matrix Portal M4 and Matrix Portal S3 to be able to help test anything

And happy to chat anytime. I'm in the US on the west coast, but work east coast hours (utc-5)

manic glacierBOT
ornate breach
#

Hey @slender iron did the RGB666 SPI issue get completely resolved? I saw a PR that tagged it but I haven’t actively tried it with SPI.

slender iron
ornate breach
manic glacierBOT
#

The zoom_2x = displayio.Group(scale=2) object will go away when the VM does.

Yeah... I figured something might be going out of scope, but the hard fault message said to file an issue, so I did.

I think you want a settings.toml setting for terminal scale.

Is that a thing that's possible? I didn't find any mention of such things in the docs.

#

I didn't find any mention of such things in the docs.

oh... actually... I just realized that the latest vs stable Environment variable docs are different, and I was looking at stable. Will CIRCUITPY_DISPLAY_WIDTH and CIRCUITPY_DISPLAY_HEIGHT work on something that's not a picodvi display? The latest docs page implies perhaps not?

orchid basinBOT
short tendon
tulip sleet
short tendon
#

It's all ready. I realize I made a typo on a settings.toml key name

jaunty juniper
tulip sleet
jaunty juniper
#

so doing that would have to wait CP10 anyway

jaunty juniper
#

or i guess a custom tinyuf2

#

yeah that change would be needed for uf2

tulip sleet
#

we were just trying to figure out the logistics

jaunty juniper
#

I was playing too with using erase_region to avoid erasing the drive when using esptool, and I wonder if there would be side effects to not erase NVS (which is where NVM is stored)

manic glacierBOT
#

While we are waiting for CP 10, this allows overwriting CIRCUITPY_BLEIO on 4MB espressif boards from the make command, or with the github custom build action on a fork. It it is then possible to make space for _bleio by disabling other modules.
Or by using the no-ota-no-uf2 partition scheme. Note that the no-ota with uf2 build won't work with the current versions of tinyuf2 (pending https://github.com/adafruit/tinyuf2/issues/432) so this requires installing via the bin anyway (or a custo...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
short tendon
tulip sleet
short tendon
#

nope

tulip sleet
#

Go ahead and submit a PR to remove it, then. How does the network get set up otherwise?

lone sandalBOT
short tendon
#

so you can pass secrets_data which isn't in any example (although passed through in via pyportal, but sill not in any example or learn guide), and then in NetworkBase there's a method _get_setting that checks if it's in settings.toml and if not tries to load secrets and will print a warning if you are using it

#

I was thinking we could pull secrets_data and change the print to a warning

tulip sleet
#

that sounds good

short tendon
#

And then maybe after the cp10 release pull all the warnings...

#

Cool. Will start with PyPortal. This will be a slow 1 PR/Release repeat...

short tendon
#

Another quick question. For when I do PortalBase, it has:

OLD_SETTINGS = {
    "CIRCUITPY_WIFI_SSID": "ssid",
    "CIRCUITPY_WIFI_PASSWORD": "password",
    "AIO_USERNAME": "aio_username",
    "AIO_KEY": "aio_key",
}

Should I leave that in there and change it to:

OLD_SETTINGS = {
    "ADAFRUIT_AIO_USERNAME": "AIO_USERNAME",
    "ADAFRUIT_AIO_KEY": "AIO_KEY",
    "ADAFRUIT_AIO_USERNAME": "aio_username",
    "ADAFRUIT_AIO_KEY": "aio_key",
}
tulip sleet
short tendon
#

So at some point, the names were updated on io.adafruit to the newer name. I think a lot of things still point to the old names. Tyeth wants to get everything updated to the new names (code, examples, guides)

tulip sleet
#

afk for a while

short tendon
#

I'll make sure either ADAFRUIT_AIO_* or AIO_* work when I update that repo

manic glacierBOT
manic glacierBOT
ornate breach
#

hey @slender iron looks like that PR submitted did not really do anything for rgb666 support. Might make a small PR this weekend or next for it. Depending on if I can get my build environment fixed lol...

ornate breach
#

Hmmm.. the 3 bytes in a 4 byte chunk seem like they will pose a real problem for RGB666 🙁

#

I wonder if I shift it to the front 3 bytes of that will make any difference

#

So instead of being stored 0b000000RRRRRRGGGGGGBBBBBB it’s 0bRRRRRRGGGGGGBBBBBB000000 though maybe I need to swap reds and blues..

#

Or however. Hard to format right from my phone. Any thoughts are welcome

short tendon
#

@tulip sleet do you know if Adafruit_Blinka_PyPortal is still used? In PortalBase v1.15.0 (Aug 1, 2023) self._secrets was removed, in which the Blinka one still uses. Trying to figure out if I need to update it, or leave it alone for right now. I can update it to use self._get_setting() instead if you want it to work.

tulip sleet
#

and see #17, the PR

short tendon
#

Yeah, and that was later removed 😦

tulip sleet
#

if it's broken now, and was already broken, you could open an issue, and fix it sooner or later

#

I wouldn't hold up the other stuff. If it's easy to fix, go ahead

short tendon
#

Sounds good. It's easy enough. Will get a PR open in the next day or so

manic glacierBOT
#

CircuitPython version and board name

Adafruit CircuitPython 9.2.4 on 2025-01-29; Wemos Lolin C3 Mini with ESP32-C3FH4

Code/REPL

import socketpool
import asyncio
from adafruit_httpserver import Server, Request, Response, Websocket, GET

pool = socketpool.SocketPool(wifi.radio)

server = Server(
    pool,
#     root_path="/static",
    https=True,
    certfile="cert.pem",
    keyfile="key.pem",
    debug=True)

websocket: Websocket = None

@server.route("/ws",...
manic glacierBOT
manic glacierBOT
tulip sleet
#

@short tendon Your updates to PyPortal and PortalBase are updated and released, as major releases. Thank you! Anything @willow totem know now about updating Portal projects?

short tendon
#

@tulip sleet followup on updating WifiManager, Both Hue and LIFX have something like this:

        wifi_type = str(type(wifi_manager))
        allowed_wifi_types = ("ESPSPI_WiFiManager", "ESPAT_WiFiManager", "Session")
        if any(x in wifi_type for x in allowed_wifi_types):
            self._wifi = wifi_manager
        else:
            raise TypeError("This library requires a WiFiManager or Session object.")

Should I just add WiFiManager or change it to just WiFiManager and Session?

tulip sleet
#

what kind of credential args does ESPAT_WiFiManager take?

#

i mean, does it still use secrets, so you'd need to support secrets anyway, etc? Otherwise, yeah, I'd say get rid of ESPSPI_WiFiManager in those libraries at some point, because we do want to drop it eventually. For now you could open issues to make it a TODO.

onyx hinge
#
for attr in ('post', 'get', 'put'):
    if not hasattr(wifi_manager, attr):
        raise TypeError(f"This library requires a WiFiManager or Session object with a {attr} method, not {type(wifi_manager)}")
```if you must check, maybe check for what you need?
#

I understand this code was probably added to help users who passed a wrong argument, but as you're discovering it's fragile

manic glacierBOT
#

Thanks for creating this issue. When I first started on effects there was discussion about a common utility library (in one of the base audio objects) and I think now that we see the commonalities it would be a good time to revisit that idea.

I really like the idea of a common internal audio pathway format for CircuitPython (16-bit, signed, stereo would be my vote). I think we have to leave sample rate variable but I have never seen code saying if sample_rate == 44.1khz required. That said...

short tendon
short tendon
#

@tulip sleet another thing I noticed when cleaning up PortalBase. With all the work we did last year, we could create a WiFi class that works for radio.wifi and subclass that for the ESP32SPI, and thus make the package smaller. And to start, adafruit_portalbase.wifi_esp32s2 would subclass that with no changes. Thoughts? If there was ever a pico portal, it would make it easier

tulip sleet
short tendon
#

So the core of those two classes is basically the same minus connect. It would remove a bunch of boilerplate

#

I'll draft it out this week

#

I really just want to re-write all the portal libraries. But will start with some simple fixes.

#

Want to focus on removing secrets first

#

So will apologize in advance on all the PRs I'll be opening and tagging you on

manic glacierBOT
#

I wanted to build CircuitPython with MICROPY_MEM_STATS enabled to debug some out of memory issues I had, but encountered a few compilation errors.

MICROPY_MEM_STATS requires MICROPY_MALLOC_USES_ALLOCATED_SIZE to be set, which in turn causes m_realloc, m_realloc_maybe and m_free to take an extra argument: the previously allocated size.

I fixed what I could with my limited knowledge of that code. Some places of the code still lack a proper support for `MICROPY_MALLOC_USES_ALLO...

manic glacierBOT
#

I really like the idea of a common internal audio pathway format for CircuitPython (16-bit, signed, stereo would be my vote).

I think that's the only real option here.

I think we have to leave sample rate variable but I have never seen code saying if sample_rate == 44.1khz required.

There are any specific sample rate checks that I'm aware of, but a lot of the audiodelays effects use sample rate to calculate timing properties.

That said we will have to put some thought to ensure ...

manic glacierBOT
manic glacierBOT
#

Yes, we did it, truly sorry for the delayed response.

On Fri, Feb 21, 2025 at 6:50 PM Scott Shawcroft @.***>
wrote:

@.**** commented on this pull request.

In ports/nordic/boards/omnimo_nrf52840/mpconfigboard.mk
https://github.com/adafruit/circuitpython/pull/10056#discussion_r1965942436
:

@@ -0,0 +1,9 @@
+USB_VID = 0x1209
+USB_PID = 0xCECE

Have you made a pull request for this ID?


Reply to this...

manic glacierBOT
manic glacierBOT
dusk flower
#

Hi everyone
I have flashed the pico with circuit python latest uf2
But after that I unplug and replug my pico and my pc is not showing the pico
I tried it with bootsel pressed it shows as rpi-rp2 bit no circuit python was in the folder
Kindly help to resolve this

manic glacierBOT
#

Adafruit CircuitPython 9.2.4 on 2025-01-28; Particle Boron with nRF52840.

I'm struggling to get a Particle Boron (https://www.adafruit.com/product/3994) to display the CircuitPython drive. In case it's helpful, the version printed on the PCB is v1.5.0, the model number on the sticker is BRN404X, FCC ID is 2AEMI-BRN404X, and the IC is 20127-BRN404X.

I used a J-Link Edu to replace the stock bootloader with the Boron's UF2 bootloader, but when I copied the .uf2 file for CP to the Boron, no Ci...

manic glacierBOT
onyx hinge
#

Howdy <@&356864093652516868> ! come in from the cold and join us for our weekly meeting in about 70 minutes from now! And if you can take the time now to add your notes to the document, that's super helpful: https://docs.google.com/document/d/1nJs-ZrRGrey76S8DlqTuS4wzoIXLvEyXdewi0lbNx3o/edit?usp=sharing

manic glacierBOT
#

Is that a thing that's possible?

Not yet but you could add it.

Yeah... I figured something might be going out of scope, but the hard fault message said to file an issue, so I did.

Issue is still good. It shouldn't crash regardless.

Will CIRCUITPY_DISPLAY_WIDTH and CIRCUITPY_DISPLAY_HEIGHT work on something that's not a picodvi display?

I don't think so. It depends on the board_init's display init code.

#

I think I also found a bug in pre-commit:

pre-commit hook(s) made changes.
If you are seeing this message in CI, reproduce locally with: `pre-commit run --all-files`.
To run `pre-commit` as part of git workflow, use `pre-commit install`.
All changes made by hooks:
diff --git a/shared-module/atexit/__init__.c b/shared-module/atexit/__init__.c
index 6cc13e9..3960732 100644
--- a/shared-module/atexit/__init__.c
+++ b/shared-module/atexit/__init__.c
@@ -47,7 +47,7 @@ void shar...
slender iron
#

I tend to be quiet

slender iron
#

👍

lone axle
#

Yep

manic glacierBOT
errant grail
#

You're welcome! Chime was such a fun project.

slender iron
#
  • for 1280x720 output
solar whale
#

Thanks Dan for dealing with the Docs

lone axle
#

Thanks for hositng Jeff! have a great week everyone 👋

short tendon
#

Thanks all!

tulip sleet
manic glacierBOT
#

This PR fixes a bug where OnDiskBitmap was unable to read small indexed bitmaps with a small header (e.g BITMAPCOREHEADER or BITMAPINFOHEADER). This is especially true with a monochrome bitmap.

I have attached the required code + bitmap to reproduce this issue. Here is the output of the script on a build that doesn't include this PR (warning: french):

Auto-chargement activé. Copiez ou sauvegardez les fichiers via USB pour les lancer ou démarrez le REPL pour le désactiver.
main...
manic glacierBOT
manic glacierBOT
solar whale
tulip sleet
manic glacierBOT
#

The build has support for only "MX25L3233F", which is half the size Maybe they changed the flash chip at some point. https://github.com/adafruit/circuitpython/blob/4cce4fa88707a2a9500bf3e8d16482ef6fa76436/ports/nordic/boards/particle_boron/mpconfigboard.mk#L9

I'll submit a PR to add that flash chip. I'll tag you when that's done.

BTW, I know of no CircuitPython support for the LTE hardware.

onyx hinge
#

Here is the notes document for next Monday’s CircuitPython Weekly Meeting. It is at the normal time of 11am Pacific / 2pm US Eastern here on Discord. Add your hug reports and status updates to the document before the meeting. If you are unable to attend but would still like to contribute, feel free to add your notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868>
https://docs.google.com/document/d/1bNFt1NA9zvPNA-9fpOf6_6CKmBYoHS0k9QKDYaF9TLg/edit?usp=sharing

short tendon
#

@tulip sleet would you have a few minutes to chat this week about some thoughts I have on PortalBase and all the duplicated NetworkBase code in all the portal libraries? If not, I can throw together a doc to outline it

lone axle
#

@slender iron do you know of any core code or examples for writing to UART or the 'data' line of USB serial? I've tried poking around on terminalio foreground/background colors and cursor stuff in the past and ran into trouble because I need to add prints to understand/change/debug the code, but the prints go to the serial console which include the code I'm trying to understand or change and it either goes infinite or breaks.

If I can get to the point where I can add "print" statements that don't go to terminalio but do go anywhere else I can see I could take another crack at those features and perhaps emoji.

slender iron
#

I use console_uart_printf to have a separate uart

manic glacierBOT
lone axle
#

Thank you!

manic glacierBOT
#

Hi! thanks for the PR. We don't mind seeing changes for alternate configuration options like MICROPY_MEM_STATS if the impact of the required changes can easily be managed.

we kinda get to live with whatever uncrustufy does; and the CI runs the canonically correct version. Even if it looks wrong to your eyes and mine :-/ Unlike the ideal for pre-commit, we depend on an externally installed uncrustify program; I think micropython-uncrustify from pip install -r requirements.txt.

def...
tulip sleet
lone axle
# tulip sleet <@382939733107408897> for changes like in <https://github.com/adafruit/Adafruit_...

It is doing the work of black, and it is rewriting .format() to f-strings, however that is actually turning out to be problematic in some cases for us because mpy-cross doesn't support multi-line fstrings like

print(
  f"something {var}"
  f"something else {other_var}
)

It is not removing the pylint comments I removed them from this repo. And I realized that I've forgotten to search the rest of the ones I've done recently 🤦, I'll plan to do a more full sweep to cleanup any remaining pylint comments after ruff is in place for everything, and I'll try to remember to search for them on any moving forward.

tulip sleet
#

you could add a + but it might take it away!

#

Maybe I should merge that in, in 9.2.5, and you can update which mpy-cross you are using.

lone axle
#

Thank you! that led me to this format which satisfies both ruff and mpy-cross

print(
  f"local_*: ({local_x: >4}, {local_y: >4})  "
  + f" width:  ({0: >4}, {self.width: >4})  "
  + f" height: ({0: >4}, {self.height: >4})  "
)
tulip sleet
#

Note the weird case in the last file in that link I sent, where non-f-string with curly braces doesn't work.

tulip sleet
jaunty juniper
#

speaking of ruff, are we doing something about the preview mode warning ?

#

oh wait preview = true has been added to ruff.toml

lone axle
#

yes, in cookie-cutter and all of the newer... yep

jaunty juniper
#

how do you locally disable a rule with ruff ?

short tendon
#

but wouldn't that be a breaking change if you are using 9.2.4 or earlier?

short tendon
#

or what ever you want to disable

jaunty juniper
#

ah thanks

#

I didn't enable preview mode in imageload because it gave me errors that I didn't want to look at

manic glacierBOT
short tendon
tulip sleet
short tendon
#

Gotcha. Feels complicated.....

tulip sleet
#

@short tendon I think I did all the PR's except for MQTT which I left to the AIO folks

short tendon
tulip sleet
#

replied there

#

@short tendon I see the screenshot: it shows settings.toml with empty values, but then it uses id_scope, etc. in the call to IoTCentralDevice() without fetching the values.

short tendon
#

got it. fixed

#

@tulip sleet thanks so much. If you have time tonight still to do releases, I can pull the new bundle down tomorrow and see what's left. If not no worries

tulip sleet
#

I may leave those to @lone axle, who has a way of listing what needs to be released.

#

I think I will stop for now. Thank you so much for all these updates

hollow gazelle
#

Now that the Metro rp2350 is in production
I'm looking for the pico-sdk adafruit_metro_rp2350.h

I'm not sure where to make a request for it - support@adafruit?
@tulip sleet or @slender iron

maybe I can get away by pretending to build the code for adafruit_feather_rp2350.h

tulip sleet
short tendon
tulip sleet
hollow gazelle
manic glacierBOT
manic glacierBOT
#

I don't have any plans for a PR on this any time soon. Just stumbled across the hard fault as I was using CircuitPython to check wiring for a thing I'm doing with Zephyr. Mostly I'm focused on the Zephyr stuff.

If you've got a plan for a way to make REPL text more legible on these little high res displays, or at minimum to just stop the hard fault, that sounds great. I'm curious to see what you come up with.

manic glacierBOT
tulip sleet
manic glacierBOT
manic glacierBOT
#

Did you happen to come across the code that is supposed to make sure that display.root_group is not set to a heap allocated group that will go away when the supervisor does a soft reset? From what tannewt said in https://github.com/adafruit/circuitpython/issues/10084#issuecomment-2675171082, I think something is supposed to make sure the root group gets set to displayio.CIRCUITPYTHON_TERMINAL?

manic glacierBOT
manic glacierBOT
#

I thought about it, but I thought the last time I looked at FULL_BUILD, it had a lot of side effects. I was worried that turning FULL_BUILD off would turn off other things that wouldn't be noticed until someone tried to upgrade their board.

I did notice some of the other M0 boards were using the FULL_BUILD setting so if you think that's a better approach, I'm happy to get this working using that parameter.

#

I'm seeing the exact same behavior. Often times the hostname will be a single control character (I've seen 0x01: SOH - Start of Header, 0x02: STX - Start of Text) as well as random strings as show above.

Image

This prevents me from loading into the web workflow code editor. Depending on the state I can occasionally just refresh the browser (WITHOUT restarting the device) and the hostname will change allowi...

fringe yarrow
#

I have an esp32c3 device with build in i2c touch sensor. The touch SDA is on GPIO11, which is by default SPI_VDD on the ESP32c3, but the VDD_SPI_AS_GPIO efuse was factory burnt on it, and it has an external flash chip, so gpio11 should be available for use as gpio.. however no matter how I try to build a circuitpython image, on boot it always tells me that SDA (gpio11) is in use.. I see a comment in the pins.h for the luatos core esp32c3 board that mentions having to burn the efuse and recompile to enable gpio11, but I can't find any information on what I would need to change in the board definition to be allowed to use gpio11..

fringe yarrow
tulip sleet
# fringe yarrow I thought it might be something like a list of forbidden pins.. I guess there's...

The way to conditionalize it would be to add a CIRCUITPY_something flag and define that flag to 1 in the mpconfigboard.h (the flag would have a default value of 0 in mpconfigport.h). See for example the CIRCUITPY_ESP_USB_SERIAL_JTAG usage in that file.

I assume there isn't an ESP-IDF CONFIG_blah flag that is set for this fuse setting, but if there is, you could check for that. You would set that in the board-specific sdkconfig.

manic glacierBOT
#

What does uncrustify --version print for you?

Well, Uncrustify-373ed72

The other thing I wonder about here is whether these sites should (mostly) change to use gc_alloc / gc_free. Since we ALWAYS have gc enabled in any circuitpython build, we can depend on it being available; and its call signature doesn't change depending on MICROPY_MALLOC_USES_ALLOCATED_SIZE. On the other hand, does that mean MICROPY_MEM_STATS doesn't track gc allocations in the first place? I'm not super ...

jaunty juniper
#

has Micropython implemented keeping the order of items in dict() ? Or is it still not in it (I believe there are memory use reasons not to do it)

wraith crow
#

I can't find any reference to CIRCUITPY_GETPASS in the Circuitpython code. Am I missing something or can I eliminate the parameter as part of the PR I'm working on?

spare jacinth
#

it was implemented a year (?) ago

#

nope, OrderedDict.move_to_end() is the thing that got added

jaunty juniper
#

no I know that, I'm just wondering where MP is at with this

#

since it's technically an incompatibility with Python 3.6

onyx hinge
fringe yarrow
onyx hinge
#

@fringe yarrow it has to be added to CFLAGS. ```CIRCUITPY_WIFI ?= 0
CFLAGS += -DCIRCUITPY_WIFI=$(CIRCUITPY_WIFI)

tulip sleet
onyx hinge
#

makefile variables are distinct from C preprocessor defines

#

or do as dan suggests

tulip sleet
#

the reason to use a .mk flag is that you need to do something conditionally in the makefiles

#

like turn a source file on or off

fringe yarrow
#

hrm.. I was following the example of CIRCUITPY_ESP_USB_SERIAL_JTAG, which is defined in the .mk file..

tulip sleet
#

ok, sorry, that is a wider spread. there isn't another example of a .h-only variable in the pins file

#

you don't need to conditionalize it on C3 either, just the above is enough. I don't know if other chips have that fuse. Ideally all the listings of that pin as "forbidden" would be conditionalized, on other chips as well, probalby C6 and maybe others

#

assuming you are submitting a PR

fringe yarrow
#

I was, but clearly I dont understand it well enough at this time.. other chips have that, but I don't believe they all map to GPIO11 like the C3 and C6

tulip sleet
#

... looks like only C2 and C3 have that pin

#

at least according to Pin.c

fringe yarrow
#

i stand corrected..

wraith crow
onyx hinge
#

the fact that it IS a fuse indicates that maybe we should check that fuse bit to decide how to handle GPIO11 on MCUs where it exists.

fringe yarrow
#

That was my original idea but I fell down the rabbit hole of trying to make it user configurable instead..

onyx hinge
#

and static const uint64_t pin_mask_reset_forbidden means it's currently a compile time constant, so making it build-time configured may be the way to go. I guess.

manic glacierBOT
slender iron
#

@onyx hinge would I be ok using the microsecond timer in arduino?

onyx hinge
#

@slender iron The one in pico-sdk? I think so, but I'd only be able to test it tomorrow.

#

I don't understand why your systick code wasn't working for me 😕

#

in arduino

#

I didn't test in CP at all

slender iron
#

I moved it off systick and am using the tx sm for the initial timeout

#

but using it for rxing bytes makes it too slow to turn around the ack

onyx hinge
#

I'm sure you'll get something that's solid, between the three of you

manic glacierBOT
#

ESP32C3 and C6 boards have an eFuse (VDD_SPI_AS_GPIO (BLOCK0)) which, when burnt either by user or on factory devices with externally powered flash, GPIO11 is usable as a GPIO. common-hal/microcontroller/Pin.c locks this by activating the GPIO_SEL_11 bit of pin_mask_reset_forbidden.

It would be useful for the pin mask to check if the efuse has been burnt before disallowing access to the GPIO11 pin when building said mask for the esp32c3/6.

manic glacierBOT
#

I went through the logic in py/circuitpy_mpconfig.mk and tried to identify everything that was turned off when FULL_BUILD was turned off which is the list of parameters I added to each of the boards that had overflowed by adding the new TERMINAL_SCALE logic. Not every M0 board needed to be updated although it's possible that all the boards I didn't update already had the FULL_BUILD turned off.

Other than the CIRCUITPY_FULL_BUILD option I didn't turn anything else off on the boards, the lis...

manic glacierBOT
#

Would something like this be a more acceptable approach?

SB_VID = 0x239A
USB_PID = 0x8014
USB_PRODUCT = "Metro M0 Express"
USB_MANUFACTURER = "Adafruit Industries LLC"

CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21

SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C, W25Q16JVxQ"
LONGINT_IMPL = MPZ

CIRCUITPY_RAINBOWIO = 0

CIRCUITPY_FULL_BUILD = 0
# Re-enable some of the features that CIRCUITPY_FULL_BUILD=0 disables
MICROPY_PY_ASYNC_AWAIT = 1
CI...
lone axle
blissful pollen
lone axle
#

Thank you. We can probably get you added if you want to be member of Circuitpython org, though I don't know exactly how to add or if I have access to do that.

blissful pollen
#

I have no problems being added if wanted. Guess it never came up before.

manic glacierBOT
#

For the small M0 builds, instead of the original idea of CIRCUITPY_NOT_FLASH_LIMITED, I would just do CIRCUITPY_TERMINAL_SCALING or CIRCUITPY_TERMINAL_SCALE. Then turn that off for the boards where it doesn't fit.

I know you are trying to figure out how to solve this problem more generally. When a board overflows, we only want to turn off one or a few features to get it to fit. Either we should do that per board, or we should make up a CIRCUITPY_MEDIUM_BUILD (I don't like the name...

pliant flint
#

Hi! Is there a way to have the 'i2ctarget' module working on the XIAO ble board?

thorny jay
jaunty juniper
#

i2ctarget is only implemented on the RP2, ESP32 and Atmel ports, it's not available on the NRF52 port. I don't know what it would take to port it

random junco
# pliant flint Hi! Is there a way to have the 'i2ctarget' module working on the XIAO ble board?

I'm guessing you're using the XIAO Sense with the nrf52840 - the Feather Sense from Adafruit doesn't have i2ctarget either, so might not be available on nRF boards, but one of the devs can probably explain. If you're interested in building CircuitPython yourself, check out the learn guide at https://learn.adafruit.com/building-circuitpython or my interview with danh where he talks about the process is here https://www.circuitpythonshow.com/@circuitpythonshow/episodes/building-circuitpython-with-dan-halbert

#

well there you go then. 🙂

jaunty juniper
#

I believe we don't have a per-port support matrix, so knowing that involves looking into the source files (knowing what you're looking for). Like that for example:

❯ find . -name i2ctarget
./shared-bindings/i2ctarget
./ports/atmel-samd/common-hal/i2ctarget
./ports/espressif/common-hal/i2ctarget
./ports/raspberrypi/common-hal/i2ctarget
manic glacierBOT
thorny jay
# jaunty juniper I believe we don't have a per-port support matrix, so knowing that involves look...

Yeah, so it is possible to see what module is in what board, but not the reason it is not present. And there is no "higher level" view on X is not supported on MCU Y.
You have to look in the "ports" folder in the source to find out.
We had similar kind of discussion on having somewhere explicitly written that this some mcu are alpha or experimental and not feature complete. Now that is in the release notes: These ports are considered alpha and will have bugs and missing functionality:

jaunty juniper
#

I don't remember if I wrote a script that would use the support matrix script to make a list per port or if I only thought about it 🤷

tulip sleet
#

it would be nice to add port name and some kind of filter on the support matrix -- not asking you to do it!

jaunty juniper
#

building the matrix does not work on my local repo rn:

Traceback (most recent call last):
  File "tools/build_board_info.py", line 288, in <module>
    generate_download_info()
  File "tools/build_board_info.py", line 257, in generate_download_info
    board_info = board_mapping[board_id]
                 ~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'nordic'

with print outputs, this happens to be when going through a Zephyr-cp board
I'll remove zephyr-cp from the SUPPORTED_PORTS for now

lone axle
#

Welp, I figured out a way to add support for inverted colors to TileGrid. But there might be a slight issue with the terminal reading random-ish bits out of memory to set the inverted state for each tile 😅🦓.

tulip sleet
#

@slender iron catch-22 on web workflow:
If something goes wrong when starting up web workflow that raises an exception (e.g. zero-length SSID), then an exception is raised, which doesn't work because no VM, so it tries to go into safe mode, but then tries to startweb workflow again, so loops.

So should we NOT enable web workflow on safe mode? That's overkill sometimes for people who require it. Maybe at least not start web workflow on certain safe mode reasons.

The specific problem here was that in the web installer, if you don't fill in the SSID value, then it ends up being CIRCUITPY_WIFI_SSID="", which is caught as the wrong length. But someone could do this wrong by hand too.

Maybe exceptions with no VM should have their own special safe mode reason.

Simlar issue to https://github.com/adafruit/circuitpython/issues/10086 but that didn't cause a loop, just safe mode

solar whale
lone axle
#

I was totally getting the punch card vibe from it as well!

slender iron
#

@tulip sleet I think a special safe mode could work. We could also make web workflow check the ssid length itself.

#

so it doesn't safe mode.

#

that's kinda my expectation. core code calling apis should make sure arguments are valid

tulip sleet
#

perhaps we should have "exception raised outside VM" as another reason

slender iron
#

alternatively we could make exceptions work without the vm and then catch them

tulip sleet
#

I started to do it, but I will stop.

short tendon
#

@tulip sleet as an FYI, tonight I'll open up 4 more small PRs for secrets.py updates. And then this is all that's left to do in the bundle:

#

Soooo close

#

And then onto the guide

#

and @willow totem need to look a little deeper, but think there's only one repo in the bundle left pointing directly to AIO_USERNAME/AIO_KEY

manic glacierBOT
#

I see a similar situation, where code is paused when fetching a URL from the web workflow, to the point of causing a complete freeze of the board, losing USB and everything. When the board's code is particularly busy, this happens easily.

The freeze seems to be triggered by some access by web workflow, including the single scanning done by the web workflow home page of another board or the recurrent scanning by discotool manager (both of which retrieve some information on the board after det...

manic glacierBOT
#

Tested successfully with this:


import board

import displayio
import terminalio


palette = displayio.Palette(2)
palette[0] = 0x000000
palette[1] = 0xffffff

bbox = terminalio.FONT.get_bounding_box()
tg = displayio.TileGrid(terminalio.FONT.bitmap, pixel_shader=palette,
                        tile_width=bbox[0], tile_height=bbox[1],
                        width=10, height=4, default_tile=0)

for i in range(40):
    tg[i] = i

main_group = displayio.Group()
main_gro...
manic glacierBOT
#

If the CIRCUITPY_WIFI_SSID="" in settings.toml, the web workflow will get an internal exception when trying to start, and will raise an exception that causes a safe mode, because there is no VM to help raising the exception. I'm assuming this starts a startup-loop, because CIRCUITPY never appears.

It is kind of easy to get CIRCUITPY_WIFI_SSID="" if you don't give an SSID when using the part of the web installer that adds credentials.

Fix is: don't try to start the web workflow if ...

#

IThe use of a tuple for the coordinates seems unusual to me. The constructor takes x and y arguments. Are there other displayio things that take tuples for (x, y)?

tilegrid.contains() https://github.com/adafruit/circuitpython/blob/22e5a09c196bcd7b32bd6aba0e5367e1c13afac7/shared-bindings/displayio/TileGrid.c#L302 acceps a tuple for x,y coordinates, although they are display pixel coordinates, not tile index coordinates. Also iirc I added contains() and used a tuple to make it co...

manic glacierBOT
#

Thanks for the reversion. I now see that the build failures due to size are >1kB, which is way more than the code you added. I think this is because adding CIRCUITPY_TERMINAL_SCALE is the first instance of using common_hal_os_getenv_int() in these builds, which cause all the getenv mechanism to be linked in. Previously the build did not use getenv at all, and that code was omitted at link time.

I think the most straightforward fix here is to guard the code you added with

#if CIRCU...
manic glacierBOT
#

I was able to shave 30 or so bytes by refactoring the nested for loops, and the larger branching if statements. However it's still not enough to fit the feather m0 supersized.

I've disabled rainbowio on that device for now which makes it match the feather m0 express.

If someone can point me towards how to use MP_DEFINE_CONST_FUN_OBJ_VAR or whatever is needed to define a function that has 4 total arguments I can try splitting x and y values back out of the tuples, perhaps losing the...

orchid basinBOT
manic glacierBOT
#

The latest commit resolves that issue by forcing refresh on tiles when their inverted state changes.

This new example code validates that it behaves as expected:

import time

import board

import displayio
import terminalio

palette = displayio.Palette(2)
palette[0] = 0x000000
palette[1] = 0xffffff

bbox = terminalio.FONT.get_bounding_box()
tg = displayio.TileGrid(terminalio.FONT.bitmap, pixel_shader=palette,
                        tile_width=bbox[0], tile_height=bbox[...
onyx hinge
#

I'm not sure, but I wonder if my recent IRQ changes on RP2350 are causing a problem during storage.erase_filesystem(), and maybe flash writing in general. I'm seeing Thread 1 "rp2350.dap.core0" hit Breakpoint 3, reset_into_safe_mode ( reason=reason@entry=SAFE_MODE_HARD_FAULT) at ../../supervisor/shared/safe_mode.c:114 114 if (_safe_mode > SAFE_MODE_BROWNOUT && reason > SAFE_MODE_BROWNOUT) { (gdb) where #0 reset_into_safe_mode (reason=reason@entry=SAFE_MODE_HARD_FAULT) at ../../supervisor/shared/safe_mode.c:114 #1 0x200002a0 in isr_hardfault () at supervisor/port.c:557 #2 <signal handler called> #3 hardware_alarm_irq_handler () at sdk/src/rp2350/pico_platform/include/pico/platform.h:189 #4 <signal handler called> #5 0x00000de4 in ?? () while inside f_mkfs. I can't see the outer stack frames, but it's possible that this interrupt is being delivered when "most but not quite all" interrupts are supposed to be disabled. I can't find where hardware_alarm_irq_handler is at a higher priority in the sdk though.

manic glacierBOT
#

I can confirm that I have the same crash on a M4 express CAN board when CIRCUITPYTHON_TERMINAL is in a group, so I think it's neither board- nor scale-specific.

I somewhat circumvented the problem by removing the terminal from all groups before the program ends, but it's still crashing if I do a KeyboardInterrupt from the serial console (I've tried to use try/catch, but this doesn't seem to work with async code?)

manic glacierBOT
#

I somewhat circumvented the problem by removing the terminal from all groups before the program ends, but it's still crashing if I do a KeyboardInterrupt from the serial console (I've tried to use try/catch, but this doesn't seem to work with async code?)

You can use the atexit module to guarantee that some code will be called:

import atexit
@atexit.register
def release():
    some_group.remove(displayio.CIRCUITPYTHON_TERMINAL)
onyx hinge
#

this crash is ... odd. It moves around. This time (it happens with some frequency) the crash was inside common_hal_os_urandom. The disassembly was .. wrong. (gdb) disas common_hal_os_urandom Dump of assembler code for function common_hal_os_urandom: 0x100419a4 <+0>: movs r0, r0 0x100419a6 <+2>: movs r0, r0 0x100419a8 <+4>: movs r0, r0 0x100419aa <+6>: movs r0, r0 0x100419ac <+8>: movs r0, r0 0x100419ae <+10>: movs r0, r0 0x100419b0 <+12>: movs r0, r0 0x100419b2 <+14>: movs r0, r0 0x100419b4 <+16>: movs r0, r0 0x100419b6 <+18>: movs r0, r0 0x100419b8 <+20>: movs r0, r0 0x100419ba <+22>: movs r0, r0 0x100419bc <+24>: movs r0, r0 0x100419be <+26>: movs r0, r0 0x100419c0 <+28>: str r3, [r4, #0] 0x100419c2 <+30>: cmp r1, #0 0x100419c4 <+32>: beq.n 0x10041aaa <common_hal_os_urandom+262> 0x100419c6 <+34>: ldr r6, [pc, #244] @ (0x10041abc <common_hal_os_urandom+280>) 0x100419c8 <+36>: mov r8, r0 0x100419ca <+38>: mov r7, r1 0x100419cc <+40>: add.w r5, r6, #31 look how the initial instructions are all replaced with movs . After a fresh run the instructions are restored. so it's like there's a problem with flash or something ...

At the time of the crash nesting_count is 0, so it's not supposed to be an interrupts-disabled time. and i reverted my "mask interrupts by priority" code as well.

#

and sometimes it is successful

mortal kernel
#

Perhaps there's some XIP involvement there.

#

Looks like xxxxxxa0 to xxxxxxbf got zeroed in the XIP cache.

slender iron
#

@onyx hinge could you reproduce the 240mhz thing with tinyusb and pico-sdk? I'm more likely to do that than arduino

onyx hinge
#

@slender iron almost certainly but it looks like I'm putting that business aside for now so I'll stop banging that drum so hard

slender iron
manic glacierBOT
#

CircuitPython version and board name

metro rp2350

Code/REPL

>>> storage.erase_filesystem()

Behavior

Usually freezes with the white LED on.

with pico-probe a variety of weird crashes and double faults are observed. For instance on one occasion it crashed within a function in flash that appeared to have its content overwritten; but on restart, the content was restored (so problem with XIP cache?)

(gdb) disas common_hal_os_urandom 
Dump of assem...
lone axle
#

@short tendon if there are any more settings.toml PRs you can tag me on them. Dan is going to get back into some other tasks to get them wrapped up so that some other future fun things can move forward. I'll be out for a chunk of tomorrow, and do have some other things going on as well but I'll get them reviewed when I can.

short tendon
short tendon
lone axle
#

@short tendon I can release those 4 that I just merged in a few moments. Are there others that you know of that are already merged but not released?

#

the conf.py ones are odd, I wonder what is in those

short tendon
#

Those are pointing to secrets for autodoc

lone axle
#

Oh, in the mocked list. Interesting, I didn't know that would work for something like secrets.py that was a file on flash instead of a core module

#

I guess without it, it may try to link it to the cpython secrets docs

short tendon
#

And these:

  • CircuitPython_LIFX
  • Adafruit_Wiznet5k
  • Adafruit_Pastebin
  • Adafruit_OAuth2
  • Adafruit_Qualia
  • Adafruit_ESP32S2TFT
lone axle
#

okay I think those are all set

short tendon
#

Awesome

lone axle
#

Yes, but I'm out for the night. I've added it to my list.

manic glacierBOT
manic glacierBOT
#

On Show and Tell @FoamyGuy demonstrated how he was able to modify the terminal font color which got me thinking that the same functionality could be used to enable the VT100 Escape sequences for setting the terminal background and foreground. This PR adds support for all the color attributes as well as the reset to default sequence.

I used the following code.py file to test the functionality:

ans = ''
while ans.upper() != 'Q':
    ans = input('Enter ESC sequence: ')
    print(ch...
manic glacierBOT
#

This adds a target for an ESP32C3 device with an SPI ST7789 display, an external 16MB flash, buzzer, user programmable button, lithium charge circuit and a UART broken out to an unpopulated GPIO header.

The device also has an I2C CST8xx touch device, but it is not usable unless #10100 is actioned, as the SDA line is on GPIO11, which is usually reserved as "VDD_SPI" but, since this device has external flash, and has had the BLOCK0 VDD_SPI_AS_GPIO efuse burnt, there is no technical reason ...

jaunty juniper
lone axle
#

My recollection is that another release without any change does break something but I don't recall exactly what.

manic glacierBOT
#

This needed validation on the x,y values in order to avoid hard faulting if the user passes values outside the range of the tilegrid size. After adding those it pushed the feather_m0_supersized over the limit again.

I ended up disabling displayio on that device which leaves plenty of room. I am open to suggestion if there is something else that would be better to disable on that device.

tulip sleet
#

worst case you can make a trivial change

manic glacierBOT
jaunty juniper
manic glacierBOT
#

Thank you for taking this on! Unfortunately, I don't think this is the right approach.

Instead, I think it'd be better to make a terminal-specific pixel_shader. Tilegrid passes in the tile coordinates to the pixel shader. The shader can then store the foreground and background color indices for each tile.

This would then leave TileGrid nearly unchanged and not cost more memory for inverts on every TG. It'd also allow recoloring of foreground and background of each character.

What do ...

slender iron
#

@lone axle let me know if you want to chat about the invert support

lone axle
# slender iron <@382939733107408897> let me know if you want to chat about the invert support

Okay, trying to see if my understanding of your suggestion is right... With the new kind of pixel_shader there would still also be a need for a "normal" palette right? The new kind of pixel shader would essentially store the 2D grid, and for each location it holds two index numbers which represent foreground and background, but then something still needs to reference a Palette at those indexes to get the color value?

#

Could it be not specific to terminal somehow? I think it'd be great if there were still some way to use it with TileGrid too, that would give us similar highlighting cababilities within display_text and similar libraries.

manic glacierBOT
slender iron
#

@lone axle Yup! That sounds right. Maybe a "PaletteExpander"? It takes the tile dimensions, input bit count (2) and then the output palette.

#

Sounds like a new module too so we can selectively enable it.

#

then for every tile it maps input values to output values

#

terminal would use it when enabled to provide coloring. otherwise it could use palette directly still

lone axle
#

Okay, I think I understand. I can take a crack at it. I've never made a new module before, I could give that a try, but may move back to displayio to start dev if I can't the "plumbing" working for a new module.

manic glacierBOT
#

I suspect this is a mismatch of my expectations of how the IDF works. I thought it duplicated the given string and then held onto it: https://github.com/espressif/esp-idf/blob/0461e2ff88369c3da0d4caced31e8488f53376cd/components/esp_netif/lwip/esp_netif_lwip.c#L1689

However, there is some tricky task stuff here that may mean we sometimes corrupt the hostname before it is copied. Maybe we need to read it back until it matches after setting it?

lone axle
#

@slender iron What if it didn't store 2 values for foreground and background, but instead just the boolean to represent inverted? It could still be packed more effeciently than the byte array from the PR. Then it can just do the "inversion process" on the color before returning it if inverted state is true for that tile. It could also still potentially be used in cases where the palette length is >2 like you mentioned in one of the PR comments by getting the "opposite" index from within the length of the palette.

If it stores foreground and background indexes then it seems to only really be meant for use on 1bit bitmaps where color index 1 is foreground and 0 is background or vice versa. If the bitmap has more colors in it, then any pixel that happens to not have 0 or 1 wouldn't get changed by this new pixel shader (if I am understanding).

slender iron
#

I'm less concerned about bit packing if the memory isn't owned by tilegrid. That way it is opt in. You can take in the number of input colors and store that many mappings per tile.

#

and the value size of that mapping is dictated by the number of colors in the output palette

lone axle
#

Do I understand this correctly? when terminal wants to "highlight" a cell will it need to basically call a function on this new pixel shader to update the mapping for that cell? So in the most basic case of 1bit color at the start every cell has both colors mapped to itself 0:0, 1:1. Then terminal wants to highlight the cell at 0,0 so it tells this new pixel shader to update the mapping for cell 0,0 to 0:1, 1:0.

slender iron
lone axle
#

TilePaletteMapper or TilePaletteFilter come to mind for me but I'm not sure if they are right either. Including Tile in the name helps convey to my brain at least that it's storing the 2d grid mapping.

slender iron
manic glacierBOT
manic glacierBOT
short tendon
#

@lone axle not rush, but tagged you on what should be the last 11 secrets.py library updates. They are all super small

manic glacierBOT
#

Is blocking new to CP9 ?
The test code above with 8.2.10 on the same QTPY S2 goes without error for over 10 minutes.
So I hope there is some way to mitigate the issue to return to the previous behavior. I can live with the board stuttering when a file is uploaded or it's scanning MDNS, but the problem is the complete freeze for minutes or never recovering, plus drive corruption when USB fails.

On 9.x latest, the test starts failing within 30 seconds. In fact it's quite regular, the first err...

manic glacierBOT
#

Okay just so I'm on the same page, we're looking at:

https://github.com/adafruit/circuitpython/blob/ed0e640fb8eb00fcac455034fe3eea18d07da81b/ports/espressif/common-hal/wifi/__init__.c#L212-L217

You're saying that the call to esp_netif_set_hostname may potentially trigger some asynchronous process to set the hostname so by the time it uses the provided char* (pointing to cpy_default_hostname) it's gone out of scope and is being overwritten by something? Yeah I could see that causing a...

#

The underlying async call looks like it would be happening here: https://github.com/espressif/esp-idf/blob/0461e2ff88369c3da0d4caced31e8488f53376cd/components/esp_netif/lwip/esp_netif_lwip.c#L212-L227
But it looks like that should still block until it receives a result. I don't see anything that wouldn't require the return value that it gets from eventually executing the callback.

short tendon
#

3 open PRs and then no more secrets in the bundle! After those get in, on to the learn guide!

manic glacierBOT
manic glacierBOT
#

No, it isn't new to CP9. CP9 did upgrade to IDF 5 though. It was a big step and the "wake circuitpython up from socket activity" is complicated. https://github.com/adafruit/circuitpython/blob/a1f4eeace37b5c960b083bec31b4e26de5814f40/ports/espressif/common-hal/socketpool/Socket.c#L69

The easiest way to hunt this down may be a git bisect. It'll be time consuming but also enlightening.

orchid basinBOT
manic glacierBOT
manic glacierBOT
blissful pollen
#

Quick question about reviews/merges. If (say for https://github.com/adafruit/circuitpython/pull/10052) I see the changes jepler requested were complete and I know I could dismiss his review to approve/merge it. But would the core team prefer I wait for the re-review? I know things can get busy but also don't want to cause more chaos so figured I'd ask.

mortal kernel
#

@onyx hinge For #10104, did the Metro RP2350 you tested with have PSRAM installed?

mortal kernel
#

The reason I'm asking is that tlsf does not differentiate between PSRAM and RAM allocations. Because all XIP address space accesses, including PSRAM accesses, will not work once we're inside port_internal_flash_flush, any IRQ 1 accesses to PSRAM via XIP may fail and/or corrupt the XIP cache. This will need to be covered, but since it's not the problem right now I'll disable PSRAM on my board.

manic glacierBOT
#

Couple other thoughts (not sure if they are great or bad ideas yet):

  • SYNTHIO_MAX_DUR is referenced often with the LFO ticking. Maybe worth picking a set processing length.
  • And in that theme maybe then worth moving some LFO stuff outside of synth? Haven't thought too long on that.
  • Also worth thinking as the zephyr work progresses being able to properly schedule these actions (rather then running in RUN_BACKGROUND_TASKS) should be considered.
orchid basinBOT
manic glacierBOT
#

This PR adds

  • Basic VT100 scrolling (full screen only, I'm looking at scrolling range but it's fighting me)
  • A place holder for the VT100 cursor On/Off sequence
    (thinking may be useful after #10102)
  • Support for a third parameter passed to the screen attribute
    (allows for somewhat common reset/foreground/background sequence)
  • Add ESC[H which does the same thing as ESC[0;0H
short tendon
#

@willow totem as and FYI, writing tests against the examples in the cpython folder works awesome. I updated minimqtt_adafruitio_cpython to just loop 3 times.

@mock.patch('sys.stdout')
def test_minimqtt_adafruitio_cpython(mock_stdout, aio_env):
    from examples.cpython import minimqtt_adafruitio_cpython

    mock_stdout.assert_has_calls([
        mock.call.write('Connecting to Adafruit IO...'),
        mock.call.write('\n'),
        mock.call.write(f'Connected to Adafruit IO! Listening for topic changes on {ADAFRUIT_AIO_USERNAME}/feeds/onoff'),
        mock.call.write('\n'),
        mock.call.write('Sending photocell value: 0...'),
        mock.call.write('\n'),
        mock.call.write('Sent!'),
        mock.call.write('\n'),
        mock.call.write('Sending photocell value: 1...'),
        mock.call.write('\n'),
        mock.call.write('Sent!'),
        mock.call.write('\n'),
        mock.call.write('Sending photocell value: 2...'),
        mock.call.write('\n'),
        mock.call.write('Sent!'),
        mock.call.write('\n')
    ])

I think as long as we add manual check that runs these, so the repo owners could run it before merging a PR it would work great. I'd propably update the examples a bit as well...

manic glacierBOT
manic glacierBOT
still zephyr
#

Hello is there a way to improve the error message that we receive when the user has not setup the wifi SSID and password in the settings.toml. I was using the Pyportal Titano without the correct configuration in the settings.toml, and following the learning guide and I got the following error message:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "conexion.py", line 66, in <module>
  File "adafruit_esp32spi/adafruit_esp32spi.py", line 690, in connect_AP
  File "adafruit_esp32spi/adafruit_esp32spi.py", line 558, in wifi_set_network
  File "adafruit_esp32spi/adafruit_esp32spi.py", line 429, in _send_command_get_response
  File "adafruit_esp32spi/adafruit_esp32spi.py", line 307, in _send_command
TypeError: object of type 'NoneType' has no len() ```
manic glacierBOT
manic glacierBOT
#

I'm beginning to think that the problem is interaction between DMA read access activity to the HSTX peripheral and the XIP section while programming a flash block. It's possibly a starvation issue for XIP during flash programming. Going through the Pico SDK and RP2350 bootrom code with a fine-toothed comb I'm not finding any nits that would cause breakage from the brief delay introduced by running the IRQ service routine for the frambuffer.

Admittedly there remains much hand waving in this e...

lone axle
#

Something to consider about the switch from secrets.py to settings.toml... In some cases secrets.py was used in the blinka / raspberry pi context i.e. https://learn.adafruit.com/bluetooth-le-broadcastnet-sensor-node-raspberry-pi-wifi-bridge/install-pi-bridge-software. We can't simply swap this and instruct the user to create settings.toml because in cpython there is nothing that will automatically load values from settings.toml into environment variables.

I don't know if / how many more instances of secrets.py usage on rpi there are, but if there are others it would be nice to be consistent with how we change them. In my mind it makes the most sense to alter the script to "manually" read settings.toml and set environment variables out of each value found in there before accessing any of them. That code will differ from what is needed on circuitpython, but it will result in the user experience setting variables being mostly the same between MCU and rpi.

#

but there are other options, like just having them make environment variables in the normal linux way. Though it's temporary unless put into .bashrc or similar.

short tendon
short tendon
# lone axle Something to consider about the switch from secrets.py to settings.toml... In so...

I added this on the ticket. It's what I do in my personal projects:

try:
    import tomllib
except ImportError:
    import toml as tomllib

# Get Adafruit IO keys, ensure these are setup in settings.toml
# (visit io.adafruit.com if you need to create an account, or if you need your Adafruit IO key.)
with open("settings.toml", "rb") as toml_file:
    settings = tomllib.load(toml_file)
aio_username = settings("ADAFRUIT_AIO_USERNAME")
aio_key = settings("ADAFRUIT_AIO_KEY")

It was added in py3.11 so totally good to use (updated to use toml for old versions)

#

I'm happy to update any CPython examples to use this

lone axle
#

might be worth considering the minimum version we want to support for blinka. Currently it's listed at 3.7 in the blinka repo, but libraries and circuitpython typing are 3.8 I believe, and even that is EoL now. It might be time increase that.

#

if we use something requiring 3.11, and the minimum supported version for blinka remains lower than that we would need to probably call out that the specific examples require something higher than the minimum of blinka.

jaunty juniper
#

is tomllib available on pypi for older versions of python ? if so it could be an added requirement

short tendon
#

Yes

#

Could add that to blinka

jaunty juniper
#

or is it like try: import tomllib / except ImportError: import toml as tomllib ?

lone axle
#

I was thinking earlier it might be nice if blinka would do this automatically when it's imported. I'm not sure if an imported library has access to the location of the file that imported it though, which it would need in order to find the settings.toml file that the user was instructed to create next to the project files.

jaunty juniper
#

hmmm there's always os.cwd() or whatever it's called, but that might not be right, not sure how to get the path of the __main__ script caller, but that should be possible ?

manic glacierBOT
short tendon
manic glacierBOT
#

@jepler AFAIKT it affects all flash writes. storage.erase_filesystem() is performing a large number of back-to-back writes which serves to hit the problem reliably. There's no error detection/reporting mechanism in flash write SDK or bootrom code, so when it fails it does so silently. Sigh.

I'm giving myself a crash course on DMA/HSTX/TDMS operation. It's impressively complicated.

still zephyr
short tendon
#

That's totally the right one. High likelihood I'll tackle it

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

board.DISPLAY is a short hand for "the built in display, if this board has one in its board definition". If you create a display object in your code with a line like display = ssd1306(...) then you'd write display instead of board.DISPLAY.

yep. If you do display.root_group = None with your own display, it doesn't work like that, though, is my point. At least on my RP2040, I needed to also run those 2 supervisor lines to remove the initial flash of console. Even with that, if your loop br...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I've not nailed the root cause. Earlier I wrote that it appeared not to be IRQ related, but on closer examination this may not be correct. The flash write code in the SDK appears to assume that interrupts are completely disabled and the "victim" core is entirely quiescent. There's a very funky window where the bootrom is re-entered to re-initialize XIP that could be hazardous to interrupt.

I'm adding a third DMA channel to re-trigger the command DMA channel in framebuffer to eliminate the ...

manic glacierBOT
tulip sleet
orchid basinBOT
onyx hinge
#

<@&356864093652516868> We're wrapping up our internal meeting & will start the discord meeting soon!

slender iron
#

brb

thorny jay
#

Informal hug report (I have no notes): I love the C64 emulation on Fruit Jam

onyx hinge
#

@thorny jay it's now able to start & play a game. my high score is 29.

#

this is in pico-sdk not circuitpython

thorny jay
lone axle
manic glacierBOT
onyx hinge
#

Not visiting Brussels this time, sorry David

thorny jay
onyx hinge
#

thanks for reading my notes. python 3.9 itself was released in 2020.

short tendon
#

3.11 is when toml got merged in

#

many people miss pip errors

thorny jay
#

On some system, you can have many version of Python running side by side in perfect chaos...

short tendon
#

Blinka installs typing

onyx hinge
#

yes in docker python3.8 installs the older adafruit-circuitpython-typing==1.10.1 which is the one that's 3.8-compatible.

#

[apologies, I need to sign off. have a good week all!]

fringe yarrow
#

I have an epaper device (esp32s3) which utilizes a master/slave pair of SSD1683 epd drivers to achieve a resolution of 792x272. The way it works is that it splits up each line of the buffer, sends the bytestring to enable the master ram, writes half to that, sends the bytestring to enable the slave ram, writes half to that, repeat until buffer is empty.. Is there a way within board.c to redefine the function that handles writing bits to the epd, or is this something that will require modification of displayio or the epd code elsewhere?

thorny jay
#

source toml.sh
And have toml.sh read the toml file and turn that in env variable?

willow totem
#

Thanks all

mortal kernel
#

Have a great week, everyone. Bye!

thorny jay
#

I think I will have to re-listen to this "in the weed" section. 🙂

lone axle
#

Thanks for hosting Dan. Have a great week everyone!

thorny jay
#

Also I was wondering about the time zone of Tiny USB (UTC+7?) and @slender iron (UTC−8?).
That must make working together on something a bit challenging.
It is 16 hours one way or 8 hours the other day?

slender iron
#

thach is in vietnam

solar whale
#

DST will be in effect next week 😬 In the USA

thorny jay
thorny jay
slender iron
thorny jay
#

So maybe we need the warning for EU people...

fringe yarrow
tulip sleet
#

Here is the notes document for next Monday’s CircuitPython Weekly Meeting (March 10, 2025). It is at the normal time of 11am Pacific / 2pm US Eastern here on Discord. Add your hug reports and status updates to the document before the meeting. If you are unable to attend but would still like to contribute, feel free to add your notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/14g8cgraUdNkIX4AiUpA_r2YfkXm_8MIflEEAMV8GrDM/edit?usp=sharing

blissful pollen
#

Question for the core team that got lost in the weekend when I thought of it: for PRs that someone else has reviewed and requested changes is it okay for me to dismiss that review if I see those changes were made correctly? Would like to help / speed up reviews but also don’t want to create unintentional chaos (the PR for pitch shifting is what I had in mind).

short tendon
#

@tulip sleet and @lone axle high level, does something like this look good?

lone axle
short tendon
#

yup. you can see I exported test_def up top to start. To show updating

lone axle
#

Oh, right missed the top few lines.

#

I would lean towards having Blinka not overwrite pre-existing environment vars when it loads the settings.toml file. Maybe it can just print that there was a conflict and the value of each?

#

I don't think it's overly likely to come up, but if we overwrite an existing environment variable it might break something outside of Blinka.

short tendon
#

it would only be in that python session

#

I wouldn't print the data - as it could be secret

lone axle
#

good point

short tendon
#

What ever way people think it should go

#

to me a setting in the local folder should trump the global

lone axle
#

okay, if it's just inside the session it's not that big of a deal. I thought that was updating the actual environment variable as visible to bash and everything else too.

short tendon
#

only downside is they would need to import board (or something) to get the code to run (unless someone has an idea how to force it to happen)

lone axle
#

My assumption is/was that any code trying to interact withing something settings.toml file would be from a library or example that is already either itself importing something from Blinka, or imports something that imports something from Blinka.

#

@short tendon can you try pip3 install adafruit-blinka-bleio and then in the python shell import _bleio and see if it runs your loading hook? if it does I think that would at least cover the script from the broadcastnet PR

#

although that may just not work on windows for other unrelated reasons.

#

If you can push your current version that you got these screenshots with I can try it on a pi in a little while.

slender iron
slender iron
short tendon
#

Things like using the minimqtt library wouldn't need anything blinka specific.

#

Could make a helper (like Dan said), and run it automatically when you import board

lone axle
#

@short tendon I think we need to do something like str(value). I got this traceback from having a numeric value for a variable in settings.toml

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/timc/venvs/blinka_venv/lib/python3.11/site-packages/board.py", line 21, in <module>
    from adafruit_blinka.agnostic import board_id, detector
  File "/home/timc/venvs/blinka_venv/lib/python3.11/site-packages/adafruit_blinka/agnostic/__init__.py", line 47, in <module>
    os.environ[key] = value
    ~~~~~~~~~~^^^^^
  File "<frozen os>", line 684, in __setitem__
  File "<frozen os>", line 758, in encode
TypeError: str expected, not int
tulip sleet
#

since that gets run on import

lone axle
#

And I would be inclined to say that we can just add import board to examples that need settings.toml values. Even when board is otherwise strictly needed. Importing it will get Blinka to to run this for us.

tulip sleet
#

pylint/ruff will complain about it not being used, thought.

#

Thinking that might point back to from adafruit_blinka import getenv

lone axle
#

that does sound better to me than import board although I do notice with the current code import adafruit_blinka doesn't seem to run the code that imports from settings.toml

#

I think it if moves to adafruit_blinka/__init__.py instead of adafruit_blinka/agnostic/__init__.py perhaps that would make it work with the other import

tulip sleet
#

I was just typing that 🙂

#

or go back to patching os, which will always work, and doesn't require any extraneous imports

#

Now I am liking that better

#

... I think that's the best solution, since you always have to import that to get at getenv

#

so nothing extraneous

#

the patching mechanism is simple

short tendon
#

Something still needs to be imported to patch...

lone axle
#

But where would we patch os from? if it's inside of Blinka I think we are right back to the problem of these scripts don't actually cause blinka to get imported.

tulip sleet
#

🤦

#

I take it back

#
try:
    from adafruit_blinka import getenv
except ImportError:
    from os import getenv
lone axle
#

maybe we make it explicit? something like from adafruit_blinka import load_settings_toml

tulip sleet
#

again, you'll have to flag it is OK for ruff/pylint

lone axle
#

I was imaging it as a function that the code also needs to call load_settings_toml()

#

so then linter won't see it as unused.

tulip sleet
#

ok, that seems sensible.

#

we don't have blinka wifi or socketpool, etc., do we??

lone axle
#

no, all of that sort of stuff all comes from CPYthon AFAIK under blinka.

tulip sleet
#

that is, a CPython script has to be different anyway, because the network code is different

lone axle
#

right, requests instead of adafruit_requests and the boilerplate that entails.

tulip sleet
#

in CircuitPython, you have to import wifi or set up ESP32SPI, etc.

#

so I like that load_settings_toml

thorny jay
#

Hi @tulip sleet, I have been investigating why there was no rainbowio in my Trinked TRRS. Actually I compared various Trinked to try to understand the logic.
And this is how I discovered https://github.com/adafruit/circuitpython/pull/9190 and the fight for space (also found out that neopixel is also out, and that is odd for something on the board).
I understand the choices made, even if keypad was a surprise, but I wonder if for such limited board, Adafruit should not stick to "mono-language". It make it less accessible, but might reduce the number of hard choices.
I guess I will be able to work around and make that Trinked do what I want, but this is all a bit of a bad surprise.

tulip sleet
#

I understand what you are saying about mono-language, and I have argued that sometimes, but I could imagine that some of your users don't speak english well

jaunty juniper
#

I was thinking of a build where the error messages are numbers or short text codes, and they print as a URL to a page in a glossary on circuitpython.org with a language selection with all the error strings (and can be manually augmented with solutions and links to guides)
and on code.circuitpython.org they show up as the text in your preferred language (and as a clickable link)

tulip sleet
#

we would want two builds then, so even more board defs. I have thought about error messages being external and stored in a file in CIRCUITPY, and looked up from there. Then there's a single build (which is "language-less") and you can change languages by swapping that file out. But it's harder for beginners.

thorny jay
# tulip sleet we would want two builds then, so even more board defs. I have thought about err...

I can install and import neopixel and I made that neopixel run the rainbow with colorweel code I found here: https://learn.adafruit.com/hacking-ikea-lamps-with-circuit-playground-express/generate-your-colors#colorwheel-or-wheel-explained-2982566-3
I think my problems are solved now.
My code was made for the Trinked M0 and it also assume there is an LED, so I will have to emulate LED behaviour with the NeoPixel.

jaunty juniper
#

I like that though, you would download the language file on the boards page, with instructions there, instead of the current language menu

thorny jay
#

I think we already had that discussion about language, maybe more than once. And maybe I was also advocating for externalisation of the message (at least I wanted that for having one build rather than one per language).
We also have had the discussion about not being able to support M0 board anymore (I think this is where size is an issue at each new version). But that Trinket TRRS is a rather new board, that is both M0 and want to support each and every language.

jaunty juniper
#

yeah, Adafruit has a bunch of SAMD21 chips they don't know what to do with

short tendon
#

@lone axle is there a decision on the way forward for blinka (can't quite tell)?

lone axle
#

and still need a tweak so that non-string toml values will not raise an exception.

fringe yarrow
short tendon
short tendon
#

@lone axle like so?

short tendon
#

Also, If settings.toml is invalid, shoulf it print a warning or raise an exception?

lone axle
# short tendon <@382939733107408897> like so?

Yes, that matches what I had in mind. Re: print warning or raise exception. Im leaning toward raise exception. If the invalid file prevents parsing of the variables and the code is expecting to use some of them it'll likely fail somewhere else later on anyhow, I think it's nice to have the exception come as soon as the problem is recognized. It could always be downgraded to only print a warning later if it turns out to be too disruptive

mortal kernel
#

I'm looking for the source code for flash_nuke. The existing uf2 doesn't seem to work on RP2350 boards. I've tried it on Adafruit, Pimoroni, and Raspberry Pi boards without success.

orchid basinBOT
lone sandalBOT
tulip sleet
jaunty juniper
tulip sleet
#

If this works for you, we can update the links in the guides

mortal kernel
jaunty juniper
#

well it works on a pico 2 so it's the updated one

mortal kernel
#

Both the version @jaunty juniper linked and the version @tulip sleet work. They're definitely not the same, but any port in a storm.

tulip sleet
#

Gadgetoid works for Pimoroni, not RPi (as far as I know).

mortal kernel
#

I'm testing on an RP2350 feather right now.

manic glacierBOT
mortal kernel
tulip sleet
thorny jay
#

I just downloaded a project bundle (from https://learn.adafruit.com/adafruit-trrs-trinkey/neopixel-blink) and the README.txt say:

But right now there is only the "CircuitPython 9.x" version/folder proposed, so the text is a bit odd, there is no "two folders". Right now I cannot find a proper wording that match both when there is a single folder, or two folders.
Also if anybody know where is that file coming from and plan to update, then maybe also update "CircuitPython 7" to "9"?

orchid basinBOT
vast kettle
#

Awesome, thanks, and I will

orchid basinBOT
manic glacierBOT
lone axle
#

is it "issue worthy" that REPL tab completion of builtin module names works for import but not from? So import dis[tab] gives you import displayio but from dis[tab] doesn't complete and leaves you with from dis

lone axle
#

I have tried to declare a property getter like:

static mp_obj_t tilepalettemapper_tilepalettemapper_obj_get_width(mp_obj_t self_in) {
  tilepalettemapper_tilepalettemapper_t *self = MP_OBJ_TO_PTR(self_in);
  return MP_OBJ_NEW_SMALL_INT(common_hal_tilepalettemapper_tilepalettemapper_get_width(self));
}
MP_DEFINE_CONST_FUN_OBJ_1(tilepalettemapper_tilepalettemapper_get_width_obj, tilepalettemapper_tilepalettemapper_obj_get_width);

MP_PROPERTY_GETTER(tilepalettemapper_tilepalettemapper_width_obj,
    (mp_obj_t)&tilepalettemapper_tilepalettemapper_get_width_obj);

and include it in locals_dict_table

{ MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&tilepalettemapper_tilepalettemapper_get_width_obj) },

The code compiles and I can run it on a device, but when I try to access the property print(tpm.width) it seems to be returning the function instead of calling it <bound_method>. If I use print(tpm.width()) then I get the value instead of the function.

Does anyone know what I am missing in order to make it work without user code needing to call the function?

manic glacierBOT
#

@tannewt Turns out it wasn't actually leaking DMA channels, it simply wasn't resetting the DMA channel numbers in the framebuffer object so it was attempting to un-claim them twice. It looked like a leak on first glance. Since zero is a valid DMA channel, I changed the channels in framebuffer to int and set them to -1 when not assigned. I did spot the other memory leak in the patch you referenced plus at least one more. Since I'm deep into this code, are there any other patches?

jaunty juniper
#

shouldn't it be tilepalettemapper_tilepalettemapper_width_obj in the dict table ?

#

which is the getter declareed with MP_PROPERTY_GETTER

blissful pollen
lone axle
#

Ah, yes I think that is right Neradoc

#

trying it now

#

Yep, that was it. Thank you! to both of you.

manic glacierBOT
manic glacierBOT
#

This adds VT100 ranged scrolling support (ESC [###;###r). This can be useful for keeping a status line at the bottom and/or top of the screen while scrolling.

I'm realizing that submitting these incrementally is probably creating extra review work so I'll try not to do this again going forward. Sorry. :frowning: The good news is that I don't plan on adding any more VT100 sequences until the inverted tile support is available.

I think this PR adds a bit more code than the earlier ones....

manic glacierBOT
manic glacierBOT
tulip sleet
#

I cannot find it in a search of all adafruit repos

lone axle
#

I would lean toward either not including it, or having it point to a file in a repo somewhere so that it's easier to update.

thorny jay
#

Yeah, not sure where it come from, but the thing that build the zip must have it....

#

I have no clue about the implementation of it.

lone axle
#

@slender iron I have gotten a good start on TilePaletteMapper implementation on this branch https://github.com/FoamyGuy/circuitpython/tree/tile_palette_mapper.

It is pretty much functional, but I've found a potential snag with this alternate type of pixel_shader approach... How can the TilePaletteMapper tell the TileGrid to mark an area dirty when a given mapping has been updated? In my test code right now I'm cheating by setting the tile_index back to itself at the same time that I update the mapping in the tpm.

short tendon
#

@willow totem exciting! We are down to just MiniMQTT to get rid of all the secrets and update all the AIO env names. Anything you need from me on that PR?

manic glacierBOT
manic glacierBOT
manic glacierBOT
slender iron
#

Its not a ideal but a start

manic glacierBOT
manic glacierBOT
manic glacierBOT
lone axle
manic glacierBOT
short tendon
manic glacierBOT
#

I was looking at why simply setting the top of screen pointer slowed down when scrolling and realized that the screen is marked dirty and has to be redrawn when this occurs. Given that, there actually is no speed advantage to leaving the pointer version of the scroll code in place, however I'm wondering if I might be able to add optional hardware scrolling support to the display driver libraries (I've mostly been testing on an ili9341).

If I give up on the hardware scrolling approach, it ...

manic glacierBOT
#

All testing was performed on a pyportal titano with this script:

import time

from displayio import Palette
from tilepalettemapper import TilePaletteMapper
import board
import terminalio
import displayio

time.sleep(1)
p = Palette(2)
p[0] = 0x000000
p[1] = 0xffffff

bbox = terminalio.FONT.get_bounding_box()
main_group = displayio.Group()
board.DISPLAY.root_group = main_group

tpm = TilePaletteMapper(p, 10,4)

tg = displayio.TileGrid(terminalio.FONT.bitmap, pixel_shade...
spare jacinth
#

Havent read previous conversation (if any) on the topic, sorry if im adding useless feedback

My 2 cents for the "lets read a setting" function changes:

  • Modifying os.environ feels wrong, and having a function do it adds a possible "race" (read from env before loading the TOML)
  • Once we start changing, why not be future proof? Could add something like def read_setting(name: str, /) -> str | None Idea being that users/guides always use that, and the underlying implementation can change transparently
  • Such function could use warnings.warn when secrets.py is used as fallback, and remove the logic at some point in the future
  • To prevent extra flash consumption, it could just be an alias to os.getenv on firmware
short tendon
#

FYI the read setting stuff, is just for Blinka. Getting os.getenv to act similarly. So it's getting the two to work more the same (which is what Blinka is for, yes?)

lone axle
#

Yeah, I don't think this needs to be a function in the core really. It's convenient to have settings.toml parsed automatically and variables exposed as os.getenv.

In blinka we want to match as close as we can, but we didn't come up with a satisfying way to make it happen automatically, so a function that does the loading was added. It does mean if some code were to try accessing variables from settings.toml before the load function is called they won't get the values that it might expect, but I think that is something we can't really do anything about unless we come up with some other mechanism that can make it automatic in the blinka context.

I don't necessarily see a need for one that allows the user to specify the toml file. They can always write code that does that if it's what they need. settings.toml is the specific file that it's intended to deal with and I think that is okay since it matches circuitpython's usage of that file.

short tendon
#

I did think Blinka could come with its own shell wrapper...

wraith crow
#

@brazen hatch I was looking at foamyguy's PR (#10113) to see how to implement the new palette for the terminal. I think we'll need that for the ANSI cursor commands. If you're going to look at it as part of your ANSI work, I'll move on to something else though 😁

#

Not to mention making the color commands actually work properly....

brazen hatch
brazen hatch
wraith crow
#

Cool, I'll move on thanks!!!!

mortal kernel
#

@onyx hinge With picodvi.Frambuffer fresh in my mind, I'm considering giving the framebuffer in psram a shot. It would use up the single RP2350 xip streaming channel, but it's not in use now. Any other plans for the xip streaming channel that might take precedence?

spare jacinth
# short tendon FYI the read setting stuff, is just for Blinka. Getting `os.getenv` to act simil...

Makes sense. I thought it was more about unifying reading from secrets.py/settings.toml... Thus the suggestion for a public-facing API that would never change, but whose implementation would (avoiding future changes to guides and whatnot)

As per loading TOML into env though, wouldnt it be better to get the function run on __init__ so that user doesnt need to invoke it? Would also mean it gets called as soon as posible, reducing risk of reading before loading

tulip sleet
spare jacinth
#

I meant blinka, right after declaring the function, you also execute it... Still not a failproof solution

tulip sleet
#

ah, i see

onyx hinge
spare jacinth
#

Could perhaps use {site,user}customize.py

spare jacinth
mortal kernel
#

I'm counting on retrace intervals to give the xip streamer time to catch up and its FIFO to buffer the difference.

lone axle
tulip sleet
#

I think the current load_settings_toml is pretty low overhead, and is only one or two lines of code. The scripts already have to be different on Blinka vs a board, because there is no network setup needed on Blinka (no import wifi ,etc.)

#

So I don't see it as a big thing to ask. And if you want to use env variables, you don't have to use load_settings_toml

spare jacinth
#

Though being explicit might be best than a silent side effect

lone axle
#

we discussed that yesterday but decided against it because then we will also have a linter warning for "unused import"

spare jacinth
#

Best solution would be to "proxy" the os module, such that import os gets a os.py defined in blinka loaded (that passed logic thru to the actual os module, providing the extra logic to read from TOML), but i dont think that's posible

slender iron
manic glacierBOT
mortal kernel
slender iron
#

you probably won't be able to get much larger outputs because you'll need to overclock your pixel clock

#

any higher bit depth and you'll be pulling more bits per pixel too

#

I think the answer to fragmentation is using settings.toml to start up in the mode you want

mortal kernel
#

True on one and possibly both counts. I'd stick with the 640x480, but the additional depth would jump up the image quality. Especially for photos. And you're spot on re: settings.toml. Me, I'm just looking for something fun and tractable to do, so please forgive me for playing around a bit.

manic glacierBOT
#

Rather than setting two parameters in the atmel-samd/boards mpconfigboard.mk files, I think the CIRCUITPY_TERMINALIO_VT100 I recently created should default to your new parameter. (After #10108 was merged, it's being set immediately following CIRCUITPY_TERMINALIO, but doesn't show up here?). I'm also setting the VT100 parameter to 0 for all samd21 boards in the atmel-samd mpconfigport.mk which could be removed if you make this change and decide to disable the new palette for all samd21 boards...

willow totem
#

How do I best go about discussing the default stack size on m4 boards, here or in a new issue on Circuitpython repo?
The pyportals and matrix portals aren't able to do some graphical web learn guide projects, but upping pystack size to 1600 allowed them all to run. I wasn't sure of the current default value, but had an old settings.toml with 1536 in, which apparently matches github. [CIRCUITPY_PYSTACK_SIZE]
I was debating adding a settings.toml with the setting to some learn guides and their code, or whether v9 just needs a bump for those boards [like some extra level of indirection has been introduced so maybe this is expected].

manic glacierBOT
manic glacierBOT
#

I'm wondering if I might be able to add optional hardware scrolling support to the display driver libraries (I've mostly been testing on an ili9341).

I wanted to do this since I knew that SPI displays can. However, I've never come up with a good displayio internal system to do it. Furthermore, often the SPI displays are oriented 90 degrees from the direction we actually want to scroll. In those cases, it doesn't help text rendering.

The picodvi output would be able to do this too thou...

short tendon
manic glacierBOT
#

Thanks for taking this on!

I'm thinking over how to organize the memory internally. The array of uint16_t for every tile is nice because it has a bunch of small allocations instead of one large one. It does cost the array of pointers though. This could be optimized to allocate the tile mapping only when changed. If the pointer is null then it'd just map 1:1 (or have a default mapping).

Definitely try with a palette larger than the input bitmap has. We'll want that for coloring text in a...

jaunty juniper
#

@short tendon I wanted to test my code to iterate through an object's items in the json_stream library using the test values in the test file, and discovered that the library breaks on a json that contains a string with escapes inside, like say {"bad_string": "\"}"}, or the dict_with_all_types test value in the tests, because it doesn't know about backslashes. The tests pass because it doesn't try to recover stream["_check"] which would cause an EOF error. Did you look into it or have any insight about it ?
I'm attempting to solve it for now by assuming backslashes only exist in strings and ignoring the next character, or I could just ignore the issue and leave it for later, it's not specific to the iterator code.

manic glacierBOT
#

I had the assumption that it could only really work when the size of the TileGrid and the TilePaletteMapper match. What would be the expected behavior if those sizes differ? If the mapper is bigger I suppose it doesn't matter too much beyond spending extra memory to store mappings that won't be used. If the mapping is smaller though what does it do for tiles outside the range of the mapper? I'll look at input_pixel closer, I'm not sure what all is on that object.

short tendon
manic glacierBOT
jaunty juniper
# short tendon Sadly, I guess I didn't write good enough tests. Could do something like: ```py ...

something like this closes the quote and tries to json load an invalid string:

dict_with_escaped_quote ={
    "bad_string": "\"}\"",
    "bool": True,
}
data_io = io.BytesIO(json.dumps(dict_with_escaped_quote).encode())
json_data = adafruit_json_stream.load(data_io)
print(json_data["bad_string"])
print(json_data["bool"])

which ends with:

json.decoder.JSONDecodeError: Unterminated string starting at: line 1 column 2 (char 1)

While something like that:

dict_with_escaped_quote ={
    "bad_string": "\"",
    "bool": True,
}
data_io = io.BytesIO(json.dumps(dict_with_escaped_quote).encode())
json_data = adafruit_json_stream.load(data_io)
print(json_data["bad_string"])

actually gets into an infinite loop.

short tendon
#

Awesome. I'll add those and work on a fix (unless you want to)

jaunty juniper
#

adding this to test_all_types causes an error too, it gets confused by the quotes and starts a "child" object or something

assert stream["_check"] == '{"a": 1, "b": [2,3]}'
jaunty juniper
manic glacierBOT
#

Thinking this over and re-reading everything here a few more times I think maybe I'm understanding better. When it's changed to use the number of input colors rather than the number of output colors it wont be storing such a long array as long as the input image is still indexed. I'll attempt ColorConverter

Right the input array length is dictated by the number of input indices to map. The size of the values in the array is dictated by what you are outputting. (The size of the palette or...

manic glacierBOT
#

@tannewt I'm trying to change get_color() to take the input_pixel, and the output pixel, basically trying to match displayio_palette_get_color() signature.

It seems to me that input_pixel doesn't have enough information on it for TilePaletteMapper to determine the appropriate tile_location. input_pixel.tile_x and input_pixel.tile_y sound promising, but the values within seem to be in pixel units, not tile units, or else I'm misunderstanding what they represent. When my 10x4 TileGri...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

or with the github custom build action on a fork

I have never built CircuitPython locally, and I would prefer to avoid setting up and validating a custom build environment just for this purpose. Thus, I'm excited to use GitHub actions.

@Neradoc ... I'd like to try this. Presume that I have already:

  • created various github actions in the past
  • forked this repository, and
  • enabled github actions in my fork of circuitpython
  • want to enable this for an ESP32-S3 board with 4MB fl...
brazen hatch
#

@slender iron What do you think about something like this?
It can make .img's, it can attach em for easy file loading and it can make the string.

They only limit on this is ram and compile size.
If it works for my bloated project on C3 I think we can consider it good enough.
Besides, one could pack a downloader.

Do you think this is a good solution to the bundling problem?

#

We could instead load it into /boot.py so that usb doesn't get the time to start up.

#

Though iirc we can race it even in code.py

#

@devout jolt pinging for interest. Once I finish this util I'll opensource it.

#

I think this approach is much better since it's universal, doesn't require messing with tinyuf2 and is pretty tidy overall.

#

I could just add a "wget edition" with preset credentials fairly quickly.

manic glacierBOT
#

This PR is a small package of fixes made while resolving #10104:

  • Makes updates to nesting_count during interrupt disabling atomic in common_hal_mcu_enable_interrupts().
  • Fixes miscellaneous memory leaks and factors tear-down of partially constructed Framebuffer objects in case of resource allocation failures.
  • Minor code cleanup in RP2350 Framebuffer
  • Removes redundant, as of Pico SDK 2.1, XIP cache clean before flash writes and PSRAM configuration preservation around flash write...