#circuitpython-dev

1 messages · Page 418 of 1

manic glacierBOT
#

I just tried this in REPL on 7.2.4 on a Feather ESP32-S2 TFT:

Adafruit CircuitPython 7.2.4 on 2022-03-31; Adafruit Feather ESP32-S2 TFT with ESP32S2
>>> import board
>>> board.TFT_I2C_POWER
board.TFT_I2C_POWER
>>> import digitalio
>>> p = digitalio.DigitalInOut(board.TFT_I2C_POWER)
>>> p.switch_to_output()   # turned the display OFF (default output is False)
>>> p.value = True   # turned the display ON
>>> p.value = False # turned the display OFF
>>> p.value = True  # turned ...
#

Adafruit CircuitPython 7.2.4 on 2022-04-06; Adafruit Feather ESP32-S2 TFT with ESP32S2
Board ID:adafruit_feather_esp32s2_tft

Did not work and TFT off by default still.
Works in 7.1.1 with board.I2S_TFT_POWER as pin name
I do not think that name of pin is the problem. I check it before
running the sample (I had a similar code snippet).

I think that I might need to do some reset in code ?
I know that most of that stuff is in C low level stuff and
probably needs lots of cleanup and i...

manic glacierBOT
#

OK, @ladyada's sample does not show the REPL, like yours, but mine works. What is in your INFO_UF2.TXT when the bootloader is running? Mine is:

TinyUF2 Bootloader cd9d938 - tinyusb (0.10.1-109-g9b3ec69b)
Model: Adafruit Feather ESP32-S2 TFT
Board-ID: ESP32S2-FeatherTFT-revA
Date: Dec 17 2021

And if you double-click to get the bootloader, do you see a colorful boot screen, like this?
![IMG_2322](https://user-images.githubusercontent.com/2847802/162356499-a4551070-9930-47a8-81...

bitter marsh
#

I was trying to build 7.2.5 for RP2040 and I get this error in the tinyUSB lib:
../../lib/tinyusb/src/portable/raspberrypi/rp2040/rp2040_usb.c:61:3: error: 'memset' offset [0, 155] is out of the bounds [0, 0] [-Werror=array-bounds]
61 | memset(usb_hw, 0, sizeof(*usb_hw));
../../lib/tinyusb/src/portable/raspberrypi/rp2040/rp2040_usb.c:62:3: error: 'memset' offset [0, 4095] is out of the bounds [0, 0] [-Werror=array-bounds]
62 | memset(usb_dpram, 0, sizeof(*usb_dpram));

I note a note in the Pico SDK github about a pragma added in the latest library to satisfy the compiler...
Interesting the latest branch in main compiles ok.

jaunty juniper
#

did you update the submodules after switching branch/tag ? make fetch-submodules

bitter marsh
#

I did. will try again.

bitter marsh
jaunty juniper
#

ah, that's beyond me then, I can compile the feather RP2040 successfully on 7.2.5 is all I can say

tulip sleet
manic glacierBOT
#

As I mentioned in issue #6243, it would be nice to have a MicroMod Teensy board setup.

So myself and @mjs513 setup the files and have been doing the testing.
Some of the Setups we have been using include:
image

Note: I need to swap out the ESP32 in the board that was made by Paul during the MicroMod beta. I have been doing most of the testing using my own board (one on top) and ...

proven garnet
#

Does anyone know why the CircuitPython RSA library documentation status is unknown? Is the webhook not installed?

idle owl
#

Might never have been set up.

#

Oh no it's there. Ok. Checking into it now.

#

Webhook keeps failing to activate. There were two old ones, I deleted those and added a new one, and it's not working.

#

OK Webhook is fine now.

#

Built again to see if maybe it needed a fresh build with a valid webhook.

#

Did not resolve the unknown.

#

The badge URL is incorrect.

#

Or at least changing it made it show passing.

#

No that's not it either.

#

Wait yes it is. I get it. The name of it in RTD is rsa not adafruit-circuitpython-rsa, so the URL generated by cookiecutter is incorrect.

gilded cradle
#

Ok, last guide is now updated and the tool redirects.

idle owl
gilded cradle
idle owl
tulip sleet
#

@onyx hinge do you have a bit of time to talk (audio or video) about the ESP32-S2 slow I2C issues? I'm not sure it's related to the base I2C code. It might be due to some other task delay. The delays are suspicously one FreeRTOS tick long.

onyx hinge
#

@tulip sleet if you think it would be helpful! I have not been following the issue.

tulip sleet
#

i think I just need to talk it through, thanks

onyx hinge
#

sure, happy to be a sounding board.

manic glacierBOT
onyx hinge
#

it's hard to figure out exactly where "stuff happens" in the esp-idf i2c routines

onyx hinge
onyx hinge
#

it worked for me at the time, but it's probably been a year.

#

for the built in debugger of the kaluga this is the script I start openocd with: exec $HOME/.espressif/tools/openocd-esp32/v0.10.0-esp32-20200709/openocd-esp32/bin/openocd -f board/esp32s2-kaluga-1.cfg -c "gdb_port 2331"

#

again, it's been awhile, the openocd version has probably changed

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.3.0-beta.0 on 2022-04-01; ESP32-S3-DevKitC-1-N8 with ESP32S3
Board ID:espressif_esp32s3_devkitc_1_n8

Code/REPL

# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT

"""
This test will initialize the display using displayio and draw a solid green
background, a smaller purple rectangle, and some yellow text. All drawing is done
using native displayio modules.

Pin...
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I've let the feather run since last post, and it hasn't stopped permanently. However, looking at the feed data on io.adafruit.com, there are some big gaps in reported data. The attached plot shows the time in seconds since the last data point, not sure what exactly it was doing during the substantial gaps. I also had another export to a different feed running in parallel on a qt py that just did 5 second sleeps rather than deep sleeps, and it showed no such gaps. My intent was to point to any...

manic glacierBOT
#

I have been testing a simpler web fetcher that does not use the MaxtrixPortal/PortalBase library. It's been running for hours without crashing. It is like https://github.com/adafruit/circuitpython/issues/6205#issuecomment-1079777657 above, but without the library. For both I have been fetching from a simple local webserver: python -m http.server. The lack of a crash doesn't mean there's not a core bug, but it means something about the library might be provoking it.

import board
imp...
manic glacierBOT
jaunty juniper
#

hey I used cookiecutter to make a repo and when uploading to github the CI failed because of the version of black, since the template was not updated to black 22.3.0 in the cookiecutter-adafruit-circuitpython repo.

manic glacierBOT
#

fwiw, ESP32SPI has been very stable for me though not using any of the higher-level networking or portal-type libraries, only esp32spi and requests, no crashes in a long, long time.

But... I restarted the Matrix Portal and let the code above (minor tweaks to print more info) run again until it hung (but again it didn't eject CIRCUITPY or disconnect from serial). After a few hours I came back and it hadn't changed, but macOS Finder, once selected, was spinning beach ball then eventually tim...

manic glacierBOT
#

Our CI hates it :( :(

                              Check if your project's top-level CMakeLists.txt includes the right
                              CMake files. Environment IDF_PATH will be used for the build:
                              /home/runner/work/circuitpython/circuitpython/ports/espressif/esp-idf/components/bootloader/subproject/"/home/runner/work/circuitpython/circuitpython/ports/espressif/esp-idf"

I'll try reverting the quoting of IDF_PATH because the other fixes...

bitter marsh
tulip sleet
bitter marsh
tulip sleet
#

Yes

bitter marsh
jaunty juniper
#

@tulip sleet I don't know where you're at with the I2C thing, I was doing I2C tests using the MCP23017 on a feather ESP32S2, and the 10ms delay disappears if I change the bus speed from the default (code that takes 100 ms drops to ~6 ms like on the feather RP2040) - frequency=200_000 for example

manic glacierBOT
lone sandalBOT
manic glacierBOT
#

Allows the Bitmap to be changed so that you can swap a tilegrid from one source Bitmap to another.

Tested successfully with this code:

import time
import adafruit_imageload
import displayio
import board

display = board.DISPLAY
main_group = displayio.Group()

first_bitmap, first_palette = adafruit_imageload.load("bmps/test_bmp_1.bmp")
second_bitmap, second_palette = adafruit_imageload.load("bmps/test_bmp_2.bmp")

first_palette.make_transparent(0)
second_palette.make_tr...
manic glacierBOT
manic glacierBOT
#

Hi @dhalbert - you might want to also checkout the other IO timings. For example in the issue #6254
I did some testing on trying to get the uarts talking and having the RX data corrupted. I am noticing some good size
timing gaps between operations:

The python code included:

        if uart1 == None:
            print("*** initialize the uarts ***")
            # we have not yet tried to iniatialize the uarts
            #uart1 = board.UART()
            #uart1.deinit...
tulip sleet
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
tulip sleet
lone axle
#

what is the easiest way to use pre-commit with the core repo? With libraries i typically use pre-commit run -a instead of pre-commit install. I've found with the core that edits some files that I am not otherwise touching if I run it in the core though.

onyx hinge
#

@tulip sleet oh no, will look next week

lone axle
#

With pre-commit install it seems to run when I run git commit but it doesn't seem like the changes get saved? the end of file check failed and it seems to fix them but then revert the fix. Is there a way to make it keep the fix changes?

tulip sleet
#

and prevent the commit if it fails

onyx hinge
#

I tested on a pygamer, we've had arch dependent stuff before. Failing before the repeat in this case it seems like

lone axle
#

right, I've got it doing that now. but it doesn't save the fixes. Is the intended workflow to go make them manually after it shows the failure?

#

with pre-commit run -a it will save the fixes so for instance EoF fixes will get corrected and if you run it a second time they will succeed.

tulip sleet
#

what files is it changing? Maybe you can just do run so it doesn't look at everything?

#

without -a

lone axle
#

hmm maybe there is more at play then I was thinking:

#

that isn't saving right now either. Perhaps something else is going on than what I was thinking.

#

if that acts only upon files modified by the commit that sounds like what I need though so that is good to know. I kind of always autopilot the -a

tulip sleet
#

So it's doing different things depending on whether they're staged or not. Maybe you just need toadd the changes. I think this is a case for RTM.

lone axle
#

Ah thank you. I used the normal action inside pycharm that I do to add files and made the commit that way and it did run the checks and save the results when I do it that way.

tulip sleet
#

aha! I always do all that manually so I am not so aware of the IDE helpers stuff.

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

To illustrate what I mentioned on discord, here is a low level test code I've been running, with a couple different I2C devices. It does only 2 reads in this case, I've tried different combinations depending on what the devices support with the same results:

import board
import busio
import time

ADDRESS = 0x20
buffer = bytearray([0] * 10)
def measure_time(frequency = 100_000, nsamples = 10):
    print(f"Frequency @ {frequency:7d}", end="")
    with busio.I2C(scl=board.SCL, sd...
manic glacierBOT
#

CircuitPython version

1. Adafruit CircuitPython 7.3.0-beta.1 on 2022-04-07; Adafruit QT Py RP2040 with rp2040
2. Adafruit CircuitPython 7.3.0-beta.0 on 2022-04-01; ESP32-S3-DevKitC-1-N8 with ESP32S3
3. Adafruit CircuitPython 5.3.0-rc.0-1823-gef9f9c8bf-dirty on 2022-04-07; Teensy MM with IMXRT1062DVL6A  (this is funny because it was built with later download afte 7.3.0beta.0

Code/REPL

ICM20048 code
import time
import board
import adafruit_icm20x
import...
lone sandalBOT
manic glacierBOT
#

While testing out this and the new MicroMod Teensy port, @mjs513
and myself found it desirable to have logical pin names for the
different Serial UART objects. It is a lot easier and clearer
to use and maintain to do something
like: uart4 = busio.UART(board.TX4, board.RX4)
than have to go look up the pin numbers for each board.

So we added them to the pins.c file in both the teensy40 and teensy41 directories

#

This needs additional checking, similar to what is done now during the constructor in shared-bindings.

    if (bitmap_width % tile_width != 0) {
        mp_raise_ValueError(translate("Tile width must exactly divide bitmap width"));
    }
    if (bitmap_height % tile_height != 0) {
        mp_raise_ValueError(translate("Tile height must exactly divide bitmap height"));
    }

in fact, the old and new bitmaps may need to be exactly the same resolution?

As for dealing with t...

manic glacierBOT
#

Here is an example sketch that I am using to test the different uarts, where I can use jumper wires to
connect the tx of one uart to rx of another and then when I type in something at terminal it tries to walk it through and the last uart you wish to test it tie it back to the rx of the first uart...

Warning, there is probably cleaner python code than this, but:

import time
import board
import busio
import supervisor
from digitalio import DigitalInOut, Direction, Pull

...
manic glacierBOT
manic glacierBOT
#

I've had some success factoring this into a new function and using it from the bitmap setter. But there is still work to do I think.

Right now this code is repeated in the constructor, ideally we could use the new function from the constructor to avoid the repetition. But I'm not sure how to do it that way yet, it needs to some of the values so they can be used afterward inside the constructor. I'll keep working on it later.

manic glacierBOT
manic glacierBOT
#

@ladyada @mjs513 - we thought we might try playing with SDIO stuff, which will
impact the pins.c for this board as well as t4 and t4.1

Plus copy the sdio stuff over from STM stuff and teensyfi it...

Question, I know that the pins.c for all three boards will change to handle the sdio tuple define plus probably change the CLK and CMD names in board to match the stuff in the SDIO web page...

The question is should I guess in this one and try to update the pins here before merging...

orchid basinBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Thanks for the detailed pointers. I thought as much about error strings, but didn't find the right tools right away. mp_arg_validate_* makes this much cleaner.

I now realize that I approached the UTF-16 problem the wrong way, the buffers do need to be 255 bytes wide (as a maximum) and ASCII text needs to be padded into UTF-16 theoretically. In my testing I didn't do that and it still worked fine, but obviously we shouldn't rely on that.

Ideally, the function would take str or `bytes...

manic glacierBOT
#

Actually, we're lucky and we don't need to store the strings after boot.py finishes.

The static variables I declared above are only used to store the strings until they are converted into UTF-16 and stored in the descriptor area alongside the other existing values. This conversion happens in usb_build_descriptors() which is called in usb_return_boot_py_data() just after the boot.py VM has been shut down.

So in boot.py we can dynamically allocate the space for the descriptor stri...

manic glacierBOT
manic glacierBOT
#

I'd like to take a look at adding USB Host support for the RP2040, but I'm not sure where to start. I saw the change made by @tannewt in #6125, but it sounds like support needs to first be added to TinyUSB? Would love to help out in whatever way I can. I'm comfortable writing C, but I don't have any driver/microcontroller development experience.

manic glacierBOT
#

In lieu of creating another issue figured I would continue the discussion on settable clock frequency.

On the Teensy 4.1 (4.0 and Sparkfun Micromod) we are able to set the clock frequency programmatically from with the sketch. I recently ported that over to the Teensy 4.1 port for circuitpython but to get it to work I had to change the shared-bindings which would make it (at least my understanding visible to all ports.

Basically I added a function to clocks.h for the T4.1 (setfrequ...

digital shoreBOT
idle owl
#

@lone axle Good morning! Anne let us know that the newsletter is in a good place to grab content for the CP Weekly today. FYI.

tidal kiln
lone axle
#

Thank you

idle owl
tulip sleet
lone axle
#

<@&356864093652516868> Today's weekly CircuitPython meeting will begin in about 1hr and 15 minutes in the #circuitpython-dev channel and circuitpython voice channel here on Discord. If you're planning to attend and/or want to share hug reports or status updates you can add them in the meeting document here: https://docs.google.com/document/d/1m1PCDAFk9kLs3MF1vEx9e0UW1WTURFB-eTORSQe8a7o/edit?usp=sharing See you during the meeting!

warm flame
#

where should I ask help for the adafruit_mpu6050 lib ?

lone axle
warm flame
#

maybe adding a calibration routine to it ?

#

and a smoothing the raw data too

#

I'm trying to make one. but translating old C/C++ code in circuitpython is not easy

#

or the things I find in python are too complicated to implement

lone axle
# warm flame maybe adding a calibration routine to it ?

If it's new functionality that the library doesn't have today, here is probably the most appropriate place. I'm afraid I am probably not much help personally trying to translate an existing C/C++ implementation to Python. But there may be other folks who will see it here who may be able to help.

warm flame
#

thanks

#

going to read docs

lone axle
#

@candid sun and @idle wharf I re-arranged the entries in the notes doc slightly. We recently-ish changed to putting the host as the first one in the round robin sections and then starting at the beginning of the alphabet after the host. It's not super critical either, we'll always just go with whatever order they are in the doc when it comes times to read them, but wanted to give you two heads up in-case you noticed that it changed and wondered.

modern wing
#

Happily lurking today for the meeting blinkacomputer

manic glacierBOT
idle wharf
onyx hinge
#

@tulip sleet , dunno if you want to just go through and assign milestones, or you'd like to that in a voice/video chat. Should probably also ask @idle owl if she wants to join the discussion.

tulip sleet
idle owl
onyx hinge
#

OK, I need to be done by 3:30ET or we could do tomorrow before I hit the road.

tulip sleet
idle owl
onyx hinge
#

I grabbed a pygamer to use as a name badge at pycon and I just. can't. find. it. 😡

idle owl
lone axle
onyx hinge
modern wing
onyx hinge
lone axle
#

🎉 Hooray for drawing REPL on new displays 🎉

idle owl
#

🎉 @minor plume

onyx hinge
#

dataclasses could be neat!

#

👋

mental nexus
#

Thanks everyone!👋

modern wing
#

Thanks y'all!

candid sun
#

thanks folks! and congrats @minor plume on the new job!

idle owl
#

So, I did a git pull and a make fetch-submodules on my circuitpython repo, but this was in there before I ran those commands, and is still there. Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) (commit or discard the untracked or modified content in submodules) modified: lib/libffi (untracked content) modified: ports/broadcom/firmware (untracked content) modified: ports/stm/st_driver/CMSIS_5 (untracked content)

#

What's with that?

minor plume
modern wing
#

Indeed, congrats on the new job -- employment changes are always a milestone (and sometimes a headache). Good luck and hope it goes smoothly.

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Category Channels

8

Text Channels

61

Voice Channels

6

Members

33963

Roles

35

manic glacierBOT
minor plume
idle owl
#
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
  (commit or discard the untracked or modified content in submodules)
    modified:   lib/libffi (untracked content)
    modified:   ports/broadcom/firmware (untracked content)
    modified:   ports/stm/st_driver/CMSIS_5 (untracked content)```
lone axle
#

Here is the notes document for next Monday’s CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if you’ll be attending the meeting - it’s super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868>
https://docs.google.com/document/d/1jwXEv1qr-WR32LcodY1V6htabrV1n1ZnE7SZ0o_4SQo/edit?usp=sharing

idle owl
#

@tulip sleet Japanese translation builds with keypad changes: 250572 bytes used, 2868 bytes free in flash firmware space out of 253440 bytes (247.5kB). 11860 bytes used, 20908 bytes free in ram for stack and heap out of 32768 bytes (32.0kB).

#

English: 249128 bytes used, 4312 bytes free in flash firmware space out of 253440 bytes (247.5kB). 11860 bytes used, 20908 bytes free in ram for stack and heap out of 32768 bytes (32.0kB).

tulip sleet
idle owl
#

Checking.

idle owl
tulip sleet
#

ok!

idle owl
#

I have a huge dislike for Sphinx right now.

#

The same issue is present in the docs I copied from, so it's not only an issue with this documentation. It's not wrapping unordered lists properly, and makes the top line of the multi-line list members bold.

#

I'm going to get a snack.

idle owl
#

If I put the whole list item on one way-too-long line, it renders properly

idle owl
#

🙄 Looks like I fixed it. Sphinx is so finicky.

stuck elbow
#

you have to try LaTeX one of these days ;-)

idle owl
#

No. No I will not. 😄

#

@tulip sleet Oof. CPX doesn't come with keypad. And if I did it right, enabling keypad overflows the English build. So... I guess that was kind of pointless, other than getting to write some code which is useful. I guess I could add it for CPB only. But that kind of defeats the purpose as I wanted the demo to work on both if at all possible.

tulip sleet
#

Ooh sorry! I thought it was in Express SAMD21 builds. Out of house now.

manic glacierBOT
#

Yeah. Was doing some research this morning and seems to be a known problem. Unfortunately also happening on the RP2040, Teensy Micromod and Teensy 4.1 as well.

Early on in the development of the Teensy 4 we had similar issues with the BNO055 and BNO080 and required a changed to I2C. For ref here was the fix = at least for the teensy in i2c: https://github.com/PaulStoffregen/Wire/pull/16/commits/08d870fc130b741e4fdee38798c64a28949c853d
Maybe a clue for you all to look at

#

Yeah the Company appears to be called Wemos and the RTD url is Wemos.
https://www.wemos.cc/en/latest/c3/c3_mini.html

The Aliepxress store is Lolin.
https://lolin.aliexpress.com/store/1331105 and the descriptions mention Wemos.

But sometimes the boards have Lolin in the name on the Wemos RTD site, and in the silkscreen, sometimes they don't. https://www.wemos.cc/en/latest/index.html

🤷‍♂️ -- I'm going to leave it as Lolin unless someone corrects it.

tidal kiln
tulip sleet
tidal kiln
#

maybe? current code is just a straight translation from the arduino driver.

idle wharf
#

Is there a special flag to enable BLE workflow on a device? I see BLEIO is already enabled for esp32c3 builds, but I don't see my device in Glider.

jaunty juniper
#

it's not implemented on ESP yet that I know of

idle wharf
#

Oh... I didn't realize that. I better go back through the Deep Dive notes.

dusk gull
#

I am looking at building custom uf2 bootloader for a custom board. My board most closely relates to the Feather M4 CAN. When looking at the definition files I see a USART define for the Feather M4 CAN bootloader build.... is this really needed? I thought this is all done over UBS with LEDs for feedback.

tulip sleet
tulip sleet
#

there are multiple ways of supplying the UF2 to the bootloader, not just MSC USB

dusk gull
#

@tulip sleet Thanks for the response.
Since customizing is not 100% clear I appreciate you helping me double check. The first time is always tedious because I do not know what is required or not. Also since the bootloader is a separate build there is a whole new set of variables.

To avoid the uf2, it looks like I might be able to build straight to a hex file, but I have to change a setting in the tools script. Is there a way to pass an argument, or override config in the definition files for that board that can make it spit out a hex.

I want to test my base Circuitpython firmware before worrying about debugging the bootloader also.

#

And to just confirm... by turning off the USART in the bootloader you mean comment out the definition. What is the bootloader USART used for? Optional serial bootloader for uf2?

tulip sleet
#

USE_UART is 0 (off) by default, so never mind. Just don't worry about it.

#

Do you use a different flash chip? Or is your board quite similar to the Feather M4 in that respect? We don't even have a different bootloader for the Feather M4 CAN.

#

It is more work to get CircuitPython to work without the bootloader. It is set up to start at 0x4000, for instance.

#

just past the bootloader

dusk gull
#

That makes sense, I though I noticed that that somewhere, but now I cannot remember where.

I am using something very close to the Feather M4 CAN. So the SAME51J19A chip, with a different flash chip, but in the list of support flash so I updated that definition. Some of the IO is stripped away, and I am not using the 32k crystal

tulip sleet
#

so I would say just build the current bootloader and see whether it works

#

the USB pins are the same, etc.

dusk gull
#

I have a pickit so I figured it it spit out a hex I could just flash it. But if it does not assume 0x0000 when building for hex then yes that would create issues.

tulip sleet
#

you don't even need to build the bootloader, you could use the prebuilt bin for it

dusk gull
#

Yes, the SAME51 chips are consistent with their D+ and D- ins

#

pins

#

Yeah, I think the only thing I changed was comment out the USART and change the status LED pin...

I am seeing the bootloader does not look at flash definitions... So you do not look at the external filesystem/flash until you enter the app?

tulip sleet
#

right, the bootloader doesn't care about the external flash; it doesn't load it

dusk gull
#

And for the pre-built, is there a reason you used Bin instead of Hex? The MPLAB tools for some reason does not like bin

tulip sleet
#

maybe you could set BOOTLOADER_SIZE to 0, but you probably want a bootloader, so just load it

#

in the factory, we have custom board loader/testers that use .bin's

dusk gull
#

Yeah, I want the bootloader, just want to avoid variables. But it sounds like I would introduce more things to worry about if I do not use it.

tulip sleet
#

you could use jflashlite

dusk gull
#

Hmm, need to see if I still have a Segger, I have one on order for a Nordic chip, but not here yet.

tulip sleet
#

and there are bin2hex utilities

dusk gull
#

STM32 has the DFY and since switching to SAM I have mostly been Pickit and MPLAB tools.

Oh... interesting didn't think about that.

#

So I will try to not bug you any more, but just to summarize some things.

  • Using the uf2 bootloader is likely the easiest path, especially since my device is close to the same as the Feather M4 CAN
  • Bootloader USART defines are not needed
  • u2F bootloader does not care about flash
  • You default to bin and that I will need to use a tool that support bin or play with conversion.
  • ... I think those are the main things.

I am avoiding crystals until I test the hardware more, but that is still something on my todo list that I might bug you again.

tulip sleet
#

the closer you make it to an existing board, the easier time you will have. Then you can start removing things

#

I think the itsy may not have a crystal

#

the uf2 bootloader Makefile uses arm-none-eabi-objcopy to convert the .elf to a .bin. It probably also will convert to a .hex.

#

Your assumptions above all seem correct to me.

dusk gull
#

I am still a little confused about the CAN board not having an external crystal for the main clock source. Can the SAM chip utilize the 32khz crystal for a stable main clock? In my experiences that is only used for RTC. The other boards I can see tolerances not being an issue, but CAN Bus has tolerance requirements for it to operate correctly.

tulip sleet
#

it may be a mistake that the CAN board does not have an external crystal. It syncs to the USB clock if there is no crystal

#

our choices are not always correct; they are not sacred

dusk gull
#

Yeah, it would make sure that if attached to USB it would be okay, and I know the SAM chips have a lot of ways to play around with clocks... but it would seem this could be a missing detail. Basically if it is running above 125k or 250k that you need a much more accurate crystal to be able to work correctly. Most vehicles and products run at 500k or higher.

tulip sleet
#

I will point this out to the right people, thanks

#

the testing was probably done connected to USB

manic glacierBOT
tulip sleet
#

maybe you have already?

#

That would be the best place for me to point to, and for there to be replies

high kestrel
#

D

manic glacierBOT
stuck elbow
#

I have a bit of a head scratcher with a display here, maybe someone will notice something I'm missing. I have Python code that works with this display, and it looks like this:

import board
import displayio
import busio
import time


_INIT = (
#    b'\xe2\x00' # reset
    b'\x2f\x00' # power on
    b'\x8f\x00' # contrast
    b'\xa6\x00' # invert off
    b'\xa4\x00' # a4 display normal
    b'\xaf\x00' # display on
    b'\x40\x00' # start line
)

displayio.release_displays()
spi = busio.SPI(clock=board._SCK, MOSI=board._MOSI)
bus = displayio.FourWire(spi, chip_select=board._CS, baudrate=40_000_000,
        reset=board._RST)
display = displayio.Display(bus, _INIT, width=96, height=68, color_depth=1,
        data_as_commands=True, grayscale=True, SH1107_addressing=True,
        pixels_in_byte_share_row=False, backlight_pin=board._BL, brightness=0,
        rotation=180, auto_refresh=True, native_frames_per_second=2)
#

Then I made a board.c with the corresponding code, but it doesn't seem to be sending anything to the display. It initializes it, and then nothing.

uint8_t display_init_sequence[] = {
//    0xe2, 0,  // reset
    0x2f, 0, // power on
    0x8f, 0,  // contrast 15
    0xa6, 0,  // invert off
    0xa4, 0,  // display normal
    0xaf, 0,  // display on
    0x40, 0,  // start line 0
};

void board_init(void) {
    busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
    common_hal_busio_spi_construct(spi, &pin_PA23, &pin_PA22, NULL, false);
    common_hal_busio_spi_never_reset(spi);

    displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
    bus->base.type = &displayio_fourwire_type;
    common_hal_displayio_fourwire_construct(bus,
        spi,
        NULL, // Command or data
        &pin_PA19, // Chip select
        &pin_PA18, // Reset
        40000000LL,
        0,
        0);
    displayio_display_obj_t *display = &displays[0].display;
    display->base.type = &displayio_display_type;
    common_hal_displayio_display_construct(display,
        bus,
        96, // Width
        68, // Height
        0, // column start
        0, // row start
        180, // rotation
        1, // depth
        true, // grayscale
        true, // pixels in byte share row. Only used with depth < 8
        1, // bytes per cell. Only valid for depths < 8
        false, // reverse_pixels_in_byte. Only valid for depths < 8
        false, // reverse_pixels_in_word
        0, // Set column command
        0, // Set row command
        0, // Write memory command
        display_init_sequence,
        sizeof(display_init_sequence),
        &pin_PA17, // brightness pin
        NO_BRIGHTNESS_COMMAND,
        0.0f, // brightness
        false, // auto_brightness
        false, // single_byte_bounds
        true, // data as commands
        true, // auto_refresh
        2, // native_frames_per_second
        true, // backlight_on_high
        true); // SH1107_addressing
}
#

What am I doing wrong?

#

(of course I skipped all the empty functions and includes from the C code)

#

I made sure the pins numbers are correct

#

Hmmm, I also noticed that the python version works as long as the code is running, but when I ctrl+c the code, I get one or two lines of the REPL and then it stops updating

ornate breach
#

Interesting

#

What driver does the display use?

stuck elbow
#

STE2007

tidal kiln
#

is it possible to prevent boot_out.txt from being generated?

manic glacierBOT
#

Sorry,

Not sure if this is best asked here or up on forum, Also lost first pass of typing this in, so will probably be more brief
which may not be a bad thing.

As @mjs513 and myself have been experimenting with CircuitPython and MicroPython, I am trying to understand the relationship between the code bases. From Github, my impression is that this is a fork of MicroPython so would expect a lot of basic stuff to be common.

Also I am mostly mentioning Teensy here as that is what I...

ornate breach
stuck elbow
ornate breach
#

Oh sweet!

stuck elbow
#

it was in nokia 1202

ornate breach
#

Oh okay cool! What are ya making? Another tiny py gamer?

stuck elbow
#

yeah, another version of pewpew

#

I hope to take it below $5 per unit this time

manic glacierBOT
#

port-specific behavior is different between micropython and circuitpython. only core language elements are the same.
there's sdioio for STM32 and SAMD51, nobody has yet added support for iMX - someone could do so!
https://docs.circuitpython.org/en/latest/shared-bindings/sdioio/index.html
https://github.com/adafruit/circuitpython/issues/4020

#

The core language part of CircuitPython is very close to MicroPython, and we merge regularly from upstream. However, the native modules to do I/O, etc. are different. We try to be consistent across ports, so that it's easy to move code. We may do this at the expense of exposing particular features of a particular chip family, unlike MicroPython, which is willing to expose chip-specific features more readily in the basic I/O modules. At the time we forked from MicroPython, there were different...

ornate breach
tulip sleet
tidal kiln
stuck elbow
#

one more data point: if I don't call time.sleep() in my program, then the repl displays properly

#

if I add time.sleep() anywhere, it doesn't display the repl

manic glacierBOT
#

Don't know if this is a useful clue or not, but a soft reboot doesn't fix the problem; a reset or power cycle do (temporarily). Also, I tried the code on a UM Feather using an I2C DPS310 board for temp info, wondering if the issue might be board specific. Doesn't seem to be, got the same results.

Press any key to enter the REPL. Use CTRL-D to reload.
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent ...

#
tulip sleet
stuck elbow
#

I did, and I did

#

after a reset removing time.sleep() no longer helps

tulip sleet
#

which chip family is it?

stuck elbow
#

samd21

#

I can commit what I have and make a PR

tulip sleet
#

sounds good; you could also try the same files on an earlier tag of CircuitPython, like 7.0.0, and see whether it works there. If we broke some timing-related thing, or background processing, or something, then it would work there but not on main tip.

stuck elbow
#

I'm trying it on my commit with 9-bit spi, because I need that feature

#

do you know if I need the auto_refresh for REPL?

#

so if I paste the display-initialization code in the REPL, it works inside the repl, until I press ctrl+d, after which the output of the code no longer shows

crimson ferry
#

Is the Feather ESP32S2 the only board that had a power control pin polarity changed in a hardware rev? Do we want to consider a separate board definition? It would be really nice if something like this worked regardless of board:```py
if hasattr(board, "I2C_POWER_INVERTED"):
# do active-low power control
elif hasattr(board, "I2C_POWER"):
# do active-high power control
else:
# no power control of this kind

tulip sleet
opal dagger
#

Kind of new to this but. I have implemented set system clock function for the Teensy 4.1 port which works well however I had to add it to shared-bindings processor.cpp and processor.h functions like this:

STATIC mp_obj_t mcu_processor_setSysClock(mp_obj_t self_in, mp_obj_t freq) {
    mcu_processor_obj_t *self = MP_OBJ_TO_PTR(self_in);
   uint32_t value_of_freq = MP_OBJ_SMALL_INT_VALUE(freq);
    [b]common_hal_mcu_processor_setSysClock(self, value_of_freq);[/b]
    return mp_const_none;
}

and as expected if I compile f for another board such as a QT PY RP2040 it will throw an exception such as:

undefined reference to common_hal_mcu_processor_setSysCloc

It was suggested that I use NotImplementedError but quite sure how to do that. For instance I think it would be

        if (mp_obj_is_type(freq, &mp_type_classmethod)) {
            mp_raise_NotImplementedError(translate("Setting System Clock Not Supported"));
        } else {

but I am not sure what the xxxx should be or if what I wrote is correct. REF(https://forums.adafruit.com/viewtopic.php?f=60&t=190244&p=920580#p920580

Any help is appreciated especially since I can clock it up to about 1Ghz. For the T4.1

960000000:
code.py output:
Pystone(1.2) time for 500 passes = 56335445 ms
This machine benchmarks at 8875 pystones/second

600Mhz
code.py output:
Pystone(1.2) time for 500 passes = 80261247 ms
This machine benchmarks at 6229 pystones/second

1.008 Ghz
code.py output:
Pystone(1.2) time for 500 passes = 55236810 ms
This machine benchmarks at 9051 pystones/second

and at least I can confirm I2C still works - tested with scanner and MPU9250 code

idle owl
crimson ferry
#

in the core?

idle owl
#

I thought so, yes. I might be wrong. I know we had some Python bits for it, but I thought I remembered it going into the core.

stuck elbow
crimson ferry
#

@idle owl probably it powers up in the correct state, but for manual control, that would have to be in user Python control

stuck elbow
crimson ferry
#

I run same code on different boards, and always looking to reduce conditionals that are board-specific

opal dagger
#

Ok 2 parts then to this response - was looking at what to use if I were to use a #if (wasn't obvious to me - very newbie here) and the 2nd was what @crimson ferry mention - saw that somewher i some of the issues/prs

idle owl
tulip sleet
crimson ferry
#

@idle owl OK, I found the snippet in the guide, I'll use that

idle owl
#

Sounds good. Thanks.

tulip sleet
#

See PEP 8

opal dagger
#

I saw that and added a comment to it but seems it has been laying dormant for a bit. Will continue working on getting this setup right. Probably start with getting the Python style correct. One of the reasons I was trying to avoid moding frequency was that I was trying not to affect other ports

tulip sleet
#

it is kind of a big point of CPy to make things available (or at least callable) on all ports. If you are thinking of i.mx-specific stuff, you could create a separate mimx or whatever module, but if parts of its functionality could be useful in other ports, we prefer to keep it common.

#

for example, rotaryio, some chips have rotary encoder peripherals, some don't. We hid that in rotaryio instead of exposing the peripherals per chip family

opal dagger
#

Thanks will check out rotaryio. May go both ways on implementation. first chip family and then work on understanding more of how CPy works - alot of moving parts. This is not bad but for someone new a bit to catch up on

tulip sleet
#

good luck, and feel free to ask more questions

tulip sleet
stuck elbow
#

but I wiggle the CS at the end of transaction

tulip sleet
stuck elbow
#

it works on a samd51

#

I will try an st7735, good idea

idle owl
idle owl
#

Ok thanks!

manic glacierBOT
#

@dhalbert @ladyada - Thanks for the quick responses.

Yes I noticed that there was an open issue on SDIO, Sorry I probably should have mentioned that in my opening post here.

Note: I did mention that there were a few options to implement it, sort of referred to it in my option a) by mentioning the STM implementation. Which would take a major rework, as it is all geared around the STM SDK...

In most of the other stuff I mentioned, I don't think most of it is mimxrt10xx hardware sp...

stuck elbow
idle wharf
#

When building CP, can you specify other files to include in the .BIN? For example to include a code.py.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.3.0-alpha.0-22-g102ee716a-dirty on 2022-04-12; PewPew LCD with samd21e18

Code/REPL

import board
import terminalio
import displayio
from adafruit_display_text import label
from adafruit_st7789 import ST7789
import busio

# Release any resources currently in use for the displays
displayio.release_displays()

spi = busio.SPI(clock=board.SCK, MOSI=board.MOSI)
tft_cs = board.D5
tft_dc = board.D9

displ...
manic glacierBOT
manic glacierBOT
#

As for making the user code consistent across ports, is a great goal, but tricky. For example, even simple things, like what do you call your IO pins in boards object? For some you have names like: IO2, where as Teensy boards it is D2, whereas MicroMod, it is names like G2... For Uarts, putting in specific pin numbers/names in for TX and RX is mostly hardware specific.

Yes, for pins, people often have to change the pin names, because of restrictions on which peripherals can use which pin...

idle owl
#

@tulip sleet I released the CP Library. So, it's ready for freezing when the next alpha/beta goes out. Tested it on CPB with keypad, and once I got rid of the cp.button_b I had forgotten I still had in the code, it worked perfectly. Slimmed it down a bit too.

tulip sleet
idle owl
#

You might be better off posting in #help-with-circuitpython. More folks available to help there. This channel is more for CircuitPython development discussion.

manic glacierBOT
manic glacierBOT
#

Sorry, I thought I would take a look at a couple of the Imxrt marked issues.

Saw this one. Took a little time to how to print debug stuff (printf) and then also setup that debug output went to my Teensy Serial4 (LPUART3)...

Test sketch

import digitalio, analogio, board

pot = analogio.AnalogIn(board.A9)
for i in range(10):
    print(pot.value)
pot.deinit()

print("try the digital")
pot = digitalio.DigitalInOut(board.D23)
pot.direction = digitalio.Direction.OUTPUT
pot.d...
jaunty juniper
# idle wharf When building CP, can you specify other files to include in the .BIN? For exampl...

I believe that to do it from the CP build, you'd have to alter the way the drive is formatted, the drive is not part of the bin (and is not erased if it already exists). There are methods for making a full install UF2, depending on the port. Like making a setup on a real board and using CURRENT.UF2 on some ports where it does contain the flash content (which might be only on atmel/nrf boards without external flash)
Using picotool save --all my_full_board.uf2 on RP2040 works in my experience.
And esptool should probably be able to do something similar with saving and restoring a bin, but not a UF2 (it seems that tinyUF2 does not allow writing the full flash, more here https://github.com/adafruit/tinyuf2/issues/117)

idle wharf
manic glacierBOT
jaunty juniper
idle wharf
#

I don't see REPL over the USB.

jaunty juniper
#

might be a matter of pins ?

idle wharf
#

Yes, I might have something incorrect.

jaunty juniper
#

the C3 board I have has a USB-serial chip on it, but the QTPY C3 doesn't, like the Lolin, and must use the on-chip one I think, I don't know how that works

idle wharf
#

That could help... I'll compare those two. Thanks for the pointer.

#

Yeah, the QTPY has many different includes as well as some other flags...

manic glacierBOT
#

Now that there is some life, I want to keep track of all the issues that I’ve observed so far and any links to relevant information.

  • [ ] The display glitches whenever CircuitPython is doing some processing.

I think whenever CircuitPython is accessing PSRAM, that reduces the bandwidth available for the LCD peripheral DMA access for redrawing the screen. Here is one related discussion on the ESP32 forum.

Currently, the LCD periph...

idle wharf
#
[21:24:45.353] Connected
Adafruit CircuitPython 7.3.0-beta.0-16-g65f229fed-dirty on 2022-04-12; Wemos Lolin C3 Mini with ESP32-C3FH4
Board ID:lolin_c3_mini

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Hello World!

Code done running.

Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPython 7.3.0-beta.0-16-g65f229fed-dirty on 2022-04-12; Wemos Lolin C3 Mini with ESP32-C3FH4
>>> print("Thanks Neradoc!")
Thanks Neradoc!
>>>
jaunty juniper
#

I love that it still says "Simply save files over USB"

#

I mean it's correct technically, ampy works over USB, but it's not really autoreload then 😉

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Per discussion on forum and discord I added a settable clock for the MIMXRT10xx boards. However, I used the approach of an #Ifdef in shared-bindings to test whether a settable clock is available. I was the easiest approach for me as I could not figure out how to implement a couple of the other suggestion. Also wanted to avoid have to update all the processor board files. While not optimal was easiest to implement across boards. So here goes the implementation.

  1. In each mpconfigboar...
#

Testing results.

  1. Ran pystones on the Teensy4.1 at 3 frequencies:
>>> import microcontroller
>>> microcontroller.cpu.setfrequency(960000000)
>>> print(microcontroller.cpu.frequency)
960000000
code.py output:
Pystone(1.2) time for 500 passes = 56335445 ms
This machine benchmarks at 8875 pystones/second

600Mhz
code.py output:
Pystone(1.2) time for 500 passes = 80261247 ms
This machine benchmarks at 6229 pystones/second

1.008 Ghz
code.py output:
Pystone(1.2) time for...
#

@dhalbert and all:

I don't think this is at all specific to the Teensy mimxrt...

I put several debug outputs into the port code and there does not appear to be anywhere that the pin is logically released.

I then tried same stuff on RP2040:

Adafruit CircuitPython 7.3.0-beta.0-2-g87e59a444 on 2022-04-04; Adafruit Feather RP2040 with rp2040
>>> import board, busio
>>> from digitalio import DigitalInOut, Direction
>>> led = DigitalInOut(board.LED)
>>> led.direction = Directi...
manic glacierBOT
#

We often use mp_printf(&mp_plat_print, "something: %d\n", something);. That goes to the REPL connection, so you don't have to wire up the serial debug.

As you surmise, it would be good to see if DigitalInOut.deinit() does a reset on the pin or not. Check some of the other ports and see if i.MX is doing something similar. That is how I would start on this.
Thanks, I changed over and added several more, and I am not sure if this is a bug or not...

As I mentioned on the other is...

manic glacierBOT
stoic rain
#

Quick question: if I needed to pull a couple of pins HIGH when an atmel-based board starts up (prior to the init of any external flash), and keep them HIGH, would board_init() in board.c be the right place to do that?

manic glacierBOT
stoic rain
tidal kiln
#

@tulip sleet checking my understanding on your suggestions for this:
https://github.com/adafruit/Adafruit_CircuitPython_VL53L4CD/issues/4
idea is to reduce precision and have a small int represent some larger multiple? like small_int = 42 could represent a value of 420000000000000000000000000 etc.? (but divide some base 2 instead of 10 multiple) and then deal with adding the extra 0s on the outbound traffic?

tulip sleet
#

"scaled integer arithmetic"

tidal kiln
#

cool. yah. the other issue is the code is a mess. intentionally copied as found from original C.

jaunty juniper
manic glacierBOT
#

I know it's easier the way you did it, but we really want to be consistent, as I mentioned in discord, the Processor.frequency attribute already exists as a read-only attribute. You can avoid creating a "Not Implemented" frequency setter for each and every other port by using conditional compilation in shared-bindings and having a default routine that throws NotImplementedError. For the conditional flag, add CIRCUITPY_ to the front, something like `CIRCUITPY_SETTABLE_PROCESSOR_FREQUEN...

manic glacierBOT
#

I know it's easier the way you did it, but we really want to be consistent, as I mentioned in discord, the Processor.frequency attribute already exists as a read-only attribute. As you did, you can avoid creating a "Not Implemented" frequency setter for each and every other port by using conditional compilation in shared-bindings and having a default routine that throws NotImplementedError. For the conditional flag, add CIRCUITPY_ to the front, something like `CIRCUITPY_SETTABLE_PROCE...

#

Nothing will happen to the original DigitalInOut(board.LED) object until garbage collection, and even then, it may not reset the pin, if there is not deleter cleanup function on pins. And one cannot depend on deleter for cleanup anyway. Basically the object is "lost" but not forgotten, so the pin is not going to get changed. This is more about Python semantics than pin handling.

#

Fixes #4102.

This seems to prevent incorrect colors on the first NeoPixel in a string on SAMx5x processors. This is especially noticeable on 5v-level-shifted pins, such as D5 on ItsBitsy M4.

Timings were revamped by empirically changing the delay counts and observing the waveforms. The current timings in ns are below, and can vary by a couple of ns:

zero: 402 high / 834 low
one: 836 high / 402 low

This is close to the RP2040 timings, which uses PIO for precise timings
input zero...

idle owl
manic glacierBOT
#

So I've been having what might be this problem, on a qt-py-esp32-s2, with 120 neopixels (5x24 circles). Is there a way to tell whether the above RMT driver patch in the micropython code base has made it's way into a circuitpython release?

Also, as yet another data point, the glitch i see matches the other descriptions here (and the video above), however, it only happens when my code does not initialize the wifi radio. Specifically, if I comment out this line:
`wifi.radio.connect(secre...

tulip sleet
# idle owl <@329766224093249548> Do you need this tested?

It would be nice to test it in some varied NeoPixel strings. I only tested it on the small 8 pixel bar. Only need to test with SAMD51. Thanks. I was assuming you might have some easy setups to test. Also you would be good at recognizing glitches.

idle owl
tulip sleet
#

Should be the same across all. The main difference is level-shifting. The specific problems people saw were incorrect color on the first pixel in the string when level-shifted. I also tested at 3.3V to make sure it still worked there.

idle owl
#

Oh.

#

So test on Itsy?

tulip sleet
#

Have you seen these first-pixel glitches? You mostly tested on nRF, and this is not applicable to that. It's SAMD-specific code that I fixed.

idle owl
#

No, I don't think I have. The glitching I saw was the ESP32-S2 glitching. Which is a whole separate issue.

tulip sleet
#

that is, yes

idle owl
#

I don't recall dealing with glitching on SAMD51.

tulip sleet
#

if you have a level shift setup (like for the Canada wall thing), that would be interesting. Also, if you have some non-standard strips (like non-5050 NP's), then that would be good, so we can test it on other samples besides the standard 5050 ones

idle owl
#

I don't have non-standard strips that I'm aware of. Everything I've ever picked up came from Adafruit.

tulip sleet
#

e.g. the teeny closely packed ones

idle owl
#

The LED wall is still packed up, and the NeoPXL8 level shifter was soldered directly to the nRF, so I'd have to solder up an entirely new one to test that setup.

#

(Made for a fancy flat sammich)

tulip sleet
#

ok, never mind, then just the 5V D5 on an Itsy M4, with some non-standard strips, is all that i ask

idle owl
#

Hah, ok.

#

I can do that.

tulip sleet
#

if you have non-standard strips available

idle owl
#

I'm not sure I do. If by non-standard you mean non-NeoPixel.

#

@tulip sleet Does Adafruit sell anything that counts?

tulip sleet
tulip sleet
idle owl
#

No, as in "counts as non-standard" 😄

idle owl
#

Ok, I can easily locate a side-lit strip, the flexible wire neopixels, and a short strip of what I think is "fairylight" NeoPIxels.

tulip sleet
#

that sounds great, tyvm!

manic glacierBOT
idle owl
#

Now we wait 80 years for the artifacts to build.

#

@tulip sleet Can you send me a build for Itsy M4?

tulip sleet
idle owl
#

Thanks!

#

@tulip sleet So um... CIRCUITPY showed up once, I apparently rebooted into safe mode by pressing reset during boot. So I reset again, and CIRCUITPY never came back up. Can't get to serial. Tried reloading CP through the bootloader (which does come up), no change. I unplugged the NeoPixel strip to make sure that wasn't it.

#

Cable works, been using it with a CPB. Tried a different port, no change.

tulip sleet
#

if you load a different CPy, does it work again?

idle owl
#

In the middle of trying that

tulip sleet
#

I didn't change that stuff at all

#

just neopixel timings by a few ns here and there

idle owl
#

Ugh, no. Stable doesn't come up either.

#

I guess I bricked it?

tulip sleet
#

I also see the safe mode thing pretty frequently on M4's

#

did you plug a really long string into the USB pin?

idle owl
#

120, and yeah.

#

not at full brightness.

tulip sleet
#

I don't think that should fry the regulator; it should just shut down

idle owl
#

Welp.

tulip sleet
#

this sounds more like your Mac shut down the USb port for asking for too much power

idle owl
#

Nothing else failed, and a lot of things are in that hub. Including networking.

#

I tried a different port in the hub with nothing plugged into the Itsy, and it didn't matter.

tulip sleet
#

that is wild; I'm sorry that happened, but it's still weird

idle owl
#

Shrug, I have a bunch.

#

What should I plug it into this time?

#

Vhi?

tulip sleet
#

well, something shorter, or power it from a separate 5v supply

idle owl
#

Oof ok

tulip sleet
#

just connect the grounds together

idle owl
#

Right

#

the fairy lights are shorter. I'll try those.

#

FWIW, the strip lit up once, and was red, and the first pixel was fine.

tulip sleet
#

you could try the 120 with a separate supply

#

it does not always fail; I was alternating red and blue and it would fail like half the time, only on one color, i forget which one

idle owl
#

hmm ok

manic glacierBOT
#

@dhalbert
Ok need one more lesson so I don't do this blindly (note this will also help with other things we are looking at)

In py/circuitpy_mpconfig.mk if we take this one line for instance

CIRCUITPY_USB_HOST ?= 0
CFLAGS += -DCIRCUITPY_USB_HOST=$(CIRCUITPY_USB_HOST)

what exactly is this doing and does that mean I have to do

CIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY?= 0
CFLAGS += -DCIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY=$(CIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY)

...

idle owl
#

Should be red.

#

Green is green.

#

Powered via 3V if that matters.

#

only 20 pixels on this one.

tulip sleet
#

I don't think I have any of those; I'll order a strip to test.

idle owl
#

I don't see them in the store anymore.

#

Only 100 pixel version of what appears to be the same thing.

#

Checking my order history right quick.

#

Oh!

#

They're not what I thought they were

tulip sleet
#

these are very weird on the inside, according to the product description. I'm not sure if they worked before either

idle owl
#

The regular dots are the ones I used in the LED wall.

#

That's why I couldn't find them as fairy lights.

tulip sleet
#

These you used on the wall?

idle owl
#

Yeah.

#

I have a loose strip around if you want me to try that

#

I saw it when looking for other stuff.

tulip sleet
#

ok sure

manic glacierBOT
#

what exactly is this doing and does that mean I have to do

CIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY?= 0
CFLAGS += -DCIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY=$(CIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY)

to be consistent.

Yes, that's right. These are makefile variables. The ?= 0 means set it to that value if it is not already defined. If it's already defined earlier in the file or in an included makefile, it's not changed. Then we defined a C-preprocessor macro wi...

idle owl
#

Sorry, the strips are backwards from what I expected, and took ages to figure out which end to wire up.

#

The marking on the LEDs is so tiny, and nonexistent on some strips.

#

I had two here luckily.

tulip sleet
#

i wonder if the slim ones would fail on the Itsy RP2040 as well, since now the timing is very close to that.

idle owl
#

But they are weird. Also only using the first 20

#

Didn't change the code.

tulip sleet
#

they are weird physically?

idle owl
#

Yeah.

#

Also I swear they were alternating red/green/blue at first, but I might be losing my mind at this point.

tulip sleet
#

thanks for all this testing, I think we could merge this now (after the original users with issues test), and I can refine it later. I put the flaky ones in my shopping cart

idle owl
#

Then they switched to red then green.

tulip sleet
#

but your code didn't?

idle owl
#

nope

#

OK, putting this away for now. I'll approve it.

#

@tulip sleet Or should I wait on that until the others test it?

tulip sleet
#

You can approve, and I'll make it draft until I hear from them.

idle owl
#

Kinda wish the first Itsy had gone POP. I still haven't literally smoked a board yet.

#

knocks on wood

manic glacierBOT
#

Thanks Dan. Just compiled the changes for the T4.1 and ran into one issue that I have been googling on but not having much luck finding:

../../shared-bindings/microcontroller/Processor.c:78:40: error: implicit declaration of function 'mp_arg_validate_min'; did you mean 'mp_arg_validate_string'? [-Werror=implicit-function-declaration]
   78 |     uint32_t value_of_freq = (uint32_t)mp_arg_validate_min(24000000, mp_obj_get_int(freq), MP_QSTR_frequency);
      |                           ...
ornate breach
#

oh Kattni!

#

just the person I need

idle owl
#

@tulip sleet If you set the I2C_POWER pin HIGH to enable, does that mean it gets set LOW to disable? It defaults to on, so you want to disable it for low power.

#

Hey skerr 🙂

ornate breach
#

Are the schematics not showing up on learn guides for you?

idle owl
#

As in on the Downloads pages?

ornate breach
#

i've looked at a few and I'm not seeing them

#

yeah

ornate breach
#

feather m4 page

idle owl
#

Hmm. Let me look, I just added three to three random guides that had board revisions, and didn't see an issue, but that was in the editor.

ornate breach
#

feather nrf52

#

might be safari being weird

#

but i've not had issues before

idle owl
#

I see them in Firefox and Chrome.

#

Chrome I'm not logged in.

#

In case that was why I was seeing them in FF, but it shouldn't have mattered.

ornate breach
#

hmm

#

must be a safari bug

#

shows up in chrome...

idle owl
#

Huh.

#

Maybe email support@adafruit.com if the issue persists, in case it's a bug on Adafruit's end in Safari.

stuck elbow
#

don't all browsers on macs use the same engine underneath?

idle owl
#

At least they could try to reproduce.

idle owl
crimson ferry
#

iOS, yes, but not macOS

stuck elbow
#

oh I see

manic glacierBOT
#

@dhalbert think your value_of_freq needs to read uint32_t value_of_freq = (uint32_t)mp_arg_validate_int_min(mp_obj_get_int(freq), 24000000, MP_QSTR_frequency); based on whats in argcheck: but think I am going to change it mp_arg_validate_int_range so I can keep it to 24Mhz to 1.08Ghz.

You may want to validate the range further in the common_hal routine, and raise a ValueError if it is out of range. The range check in shared-bindings is used for all potential ports, so it shou...

turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Category Channels

8

Text Channels

61

Voice Channels

6

Members

34000

Roles

35

tulip sleet
#

bingo!

ornate breach
#

right on the head! wooo!

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

Datasheet timings:

// From the SK6812 datasheet:
// T0H 0 code, high level time 0.3µs ±0.15µs
// T1H 1 code, high level time 0.6µs ±0.15µs
// T0L 0 code, low level time 0.9µs ±0.15µs
// T1L 1 code, low level time 0.6µs ±0.15µs
// Trst Reset code,low level time 80µs

// From the WS2812 datasheet:
// T0H 0 code, high voltage time 0.35us ±150ns
// T1H 1 code, high voltage time 0.7us ±150ns
// T0L 0 code, low voltage time 0.8us ±150ns
// T1L 1 code, low voltage time 0.6us ±150ns
...
manic glacierBOT
#

we (@mjs513 and myself) are taking a look at this now and there may be several issues to look at. Some may be related to some other issues.

First I believe one limitation here include not all pins will work with this. And the ones that may work with this are a subset of the ones that the Teensy Arduino builds support. If you look at my[ Teensy 4.1 xls document
https://github.com/KurtE/TeensyDocuments/blob/master/Teensy4x Pins.xlsx

![image](https://user-images.githubusercontent...

lone axle
#

Is it technically correct to refer to mpy-crossing as "compiling" Or is this technically something different?

stuck elbow
#

ultimately everything is a compiler

#

if you want to be strict, it's byte-compiling

#

into bytecode

lone axle
manic glacierBOT
#

@dhalbert @jepler and all,

Wondering if helps for you to see some of the information from the debug steps. Or if some of us continue discuss/work on it in background?

For example updated test sketch:

import board
import pwmio
import time
import supervisor
print("uart deinit")
board.UART().deinit()
print("setupPWM pin 1")
pwm1 = pwmio.PWMOut(board.D1, frequency=5000, variable_frequency=True, duty_cycle=32767) #1x1
print("setupPWM pin 2")
pwm2 = pwmio.PWMOut(board...
manic glacierBOT
manic glacierBOT
idle owl
onyx hinge
#

@idle owl because dan pushed to the branch, it dismissed your review. the core does this, the libs do not, I guess it's a configuration difference.

idle owl
#

For a minute I was like "yeah, I know that, no worries" but then I realised you were commenting on my comment about it popping up again.

onyx hinge
#

that part is weird too

manic glacierBOT
manic glacierBOT
#

This is happening to me as well, running CircuitPython 7.2.5 also on a Feather M4 Express. Even just running the simple button example on Adafruit's site will cause it to crash.

For me it either only happens with the D12 pin, or it's just more easily reproduced on that pin. Using a 100 ohm resistor on the + wire from the button to the pin seems to fix it. I am using the internal pull up resistor.

#

So sleep may be shutting down the peripherals as a power-saving measure, and they should not be shut down. This is usually settable on a peripheral, at least on other chips I have seen.

Good clue and yes, the current code for doing time.sleep() is totally messing this up along with others that I know of and probably lots I have not tried playing with.

That is in port.c we have:

void port_idle_until_interrupt(void) {
    // App note here: https://www.nxp.com/docs/en/application-...
manic glacierBOT
#

Some more findings:

  • For the PCA9685, raising the I2C frequency to 125 kHz causes the problem to go away. 110 kHz does not work for the PCA9685: I get errors which I think reflect data errors talking to the device. I tried various frequencies in between, and there are only small ranges that work.
  • CONFIG_FREERTOS_HZ is the FreeRTOS tick rate, and the rate at which it can switch between tasks. In CircuitPython it is set to 100, which is a typical default. In MicroPython and Arduino, it...
manic glacierBOT
manic glacierBOT
#

what if you change it to like 500?

The gap at 100 kHz bus frequency is the interval defined by CONFIG_FREERTOS_HZ, so 10ms at 100, 2ms at 500, 1ms at 1000. There is still some kind of bug/weirdness, because at, say 125 kHz bus frequency, the gap no longer is proportional to CONFIG_FREERTOS_HZ. For instance, at 125000, the gap reduces from 10ms to 600-700ish microseconds. So there is something unusual about the 100kHz rate compared to higher rates.

dusk gull
#

I am trying to build a modified (very slightly) version of the Feather M4 CAN uf2 bootloader and wanted to not define the BOOT UART because I prefer not to enable something that is not used, especially if it could cause issues with later SERCOM inits. I see several places where the "USE_UART" is referenced, and it is even "0" by default, but I am getting a build issue and it is within the "src/usart_sam_ba.c: In function 'usart_open':" function, which implies it is trying to use the USART anyways

This seems wrong. It seems to default to "#define USE_UART 0", I added that to my make config header file just in case but I cannot see why it would still run that function.

mental nexus
#

I'm back trying to build CircuitPython on the ESP32-S3 and I can't seem to get the debug serial monitor to work anymore. I'm compiling with DEBUG=1, but when I do "screen /dev/tty.usbserial-1450" on my Mac it says no connection. I'm sure it used to work but I'm doing something wrong now.

#

Weird. It started working again. I did "screen /dev/tty.usbserial-1410 115200" this time.

dusk gull
#

@mental nexus Not sure this is helpful or not but I really like the Mac app "Serial" for a serial terminal.

mental nexus
#

Looks interesting with a lot of features. Will keep that in mind.

crimson ferry
#

tio is really nice too since ti will re-connect automatically

#

I think the speed is needed on the USB-to-UART

#

but not on native USB

jaunty juniper
#

Serial is the only UI app that I managed to use fully with Circuitpython when I did tests (as in correctly getting tabs, up arrow, and other terminal emulation things). At the time I couldn't justify paying for it (I still can't really) but it does seem nice

dusk gull
#

I do enough serial based work for my freelancing that the time it saved easily paid for the cost of the app. But I the desire to not spend money when you do not have to.

jaunty juniper
#

and I don't know if I could use it with discotool 😋

manic glacierBOT
#

@dhalbert @tannewt @ladyada @jepler

Quick update/question -

a) Main problem getting any pin to work is because of you going into low power mode when you do something like sleep, which does things like turn off the clocks that PWM is using...

b) Current code base for PWM will not support all of the pins that Teensy Cards that ship with T4.x show as PWM. That is the Arduino code base supports both FlexPWMTimers as this code does as well as Quad Timers, which this one does not

c...

manic glacierBOT
#

a) Main problem getting any pin to work is because of you going into low power mode when you do something like sleep, which does things like turn off the clocks that PWM is using...

Are there bits to set on low-power mode that leave the peripheral power on? That would be the right thing to do here.

Question - Can fixes go into SDK files or do we pull in and fix SDK code into the higher level files.
That is the: sdk file - fsl_pwm.c does not handle the X channel for PWM output. I pu...

manic glacierBOT
#

Are there bits to set on low-power mode that leave the peripheral power on? That would be the right thing to do here.

Sorry, wondering if it is really worth trying to start out that way of setting this global mode, without seeing if it actually does anything for you. And there are lots of pitfalls.

But yes maybe in this case, One can enable the PWM to continue by setting the WAITEN bit in FCTRL2 for each of the Timers/Sub-timers.

But then not sure for example what happens if...

idle owl
#

Does anyone have an ESP32-S3 Feather and is willing to try some Arduino stuff with me? I can't get any sketch to load. Ultimately the error is that there's no board on the selected port (which is correct), but the error comes in a couple of forms. I loaded CP on the Feather, that's what's on there right now.

#

@tulip sleet What's generating the docs for the shared bindings? Because the "Edit on GitHub" or "View" from the RTD menu at the bottom left of the docs both 404. Because apparently it's not being generated from within each shared binding directory as index.rst. Which is what RTD is apparently expecting.

jaunty juniper
#

yeah the index.rst files are generated on CI, so they can't be linked to, not sure how that can be fixed

idle owl
#

Hmm ok.

#

I wonder if we can remove the links on those pages somehow.

jaunty juniper
#

maybe the intended link can be added to the template

idle owl
#

Because I'm not sure how to fix it either.

jaunty juniper
#

it would have to link to the C file of the module, or the directory

idle owl
#

Well it's in the RTD menu at the bottom too.

#

Not sure if we can "edit" both.

idle owl
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Issue to track improvements that can be done to the zlib library that now has preliminary support:

[ ] Implement decompressing data streams via the zlib.decompressobj style function like in CPython.
[ ] Expand zlib with other functions like crc32 similar to PR #1274 was looking to do.
[ ] Expand for compression functionality. Compression does not exist in the used uzlib library.
[ ] Implement the gzip CPython library (in CPython this is done in pure python so could be done t...

lone sandalBOT
proven garnet
#

Trying to find it...

#

I tried the instructions in the link I posted in the issue but clearly it didn't work 😅

jaunty juniper
#

I tried to test locally, I get "view page source" instead of "edit on github" already so I don't even know how to test it

jaunty juniper
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.2.5 on 2022-04-06; Adafruit QT Py ESP32S2 with ESP32S2
Board ID:adafruit_qtpy_esp32s2

Code/REPL

import gc, os

# Show available memory
print("Memory Info - gc.mem_free()")
print("---------------------------")
print("{} Bytes\n".format(gc.mem_free()))

flash = os.statvfs('/')
flash_size = flash[0] * flash[2]
flash_free = flash[0] * flash[3]
# Show flash size
print("Flash - os.statvfs('/')")
print("-...
jaunty juniper
#

(which makes sense since conf.py is in the root of the repo, not in docs and other paths are relative to the root)

manic glacierBOT
manic glacierBOT
summer sable
#

Hi All, I'm working on this issue currently:
https://github.com/adafruit/Adafruit_CircuitPython_BME680/issues/45
Just adding type annotations for the functions in the adafruit_bme680.py file. I've come across this function and just was hoping for a second set of eyes on the return type of this function?

GitHub

There are missing type annotations for some functions in this library. The typing module does not exist on CircuitPython devices so the import needs to be wrapped in try/except to catch the error f...

#

My first instinct is -> int, but just not certain

#

Thanks for any help!

lone axle
# summer sable My first instinct is ```-> int```, but just not certain

I think your instinct is correct here. _read_byte calls _read() which returns a bytearray (multiple bytes in a list basically) and inside of _read_byte() it's using the square brackets to access only the 0th element in the list which would be a single byte and it is represented typically as an int likely a hex number like 0x02 or something similar.

#

Thanks for helping with the typing PRs! We Appreciate the contributions. 🎉

summer sable
summer sable
shut dew
#

I was looking at one of those Missing Type Annotation issues, but I don't quite grasp what happens if the typing import fails:

try:
    from typing import List, Tuple
except ImportError:
    pass

I see the import error gets swallowed here, but how does the program not blow up anywhere that List or Tuple are used in the rest of the code?

jaunty juniper
#

so it doesn't try to resolve the names or anything, it's only for C python, and generating code completion in IDEs

#

imports that are required for typing but not for the code can be added in the try after the typing import

shut dew
#

ah, okay. so it's a bit of secret sauce that CircuitPython knows to ignore the type annotations, even though it doesn't really know anything about them

proven garnet
#

Thanks for the shoutout in the Deep Dive! Glad to be helping out! It was the functools library! 🛠️

tulip sleet
proven garnet
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.2.5 on 2022-04-06; Adafruit Metro M4 Express with samd51j19
adafruit-circuitpython-metro_m4_express-en_US-7.2.5

Code/REPL

import busio
from board import *

with busio.I2C(SCL, SDA) as i2c:
    device = I2CDevice(i2c, self.address)
    with device:
        device.write(bytes_to_write)

Behavior

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

You are in safe mode because:
C...

manic glacierBOT
#

@dhalbert @KurtE @tannewt
First to me this is just a discussion on low power mode. So lets talk about low-power mode on the mimxrt chips. To really put the processor in a low power mode you have to turn off the peripherials and unless you know what is resources are being used you can't selectively disable clocks. The snooze library that @KurtE referenced has options for that and is controlled by the user. For a real low power you should lower the system clock as well.

Just to clari...

manic glacierBOT
#

@tannewt @dhalbert I'm back to this. It turns out the flash on the revised chip DOES work. This was confirmed with the Sparkfun Arduino flash library, so yay!

So I have tried to get this board working, but I've run into a roadblock, based in part on how much I haven't learned about CP internals yet. One of the quirks of this board is that write-protect (WP) and HOLD pins on the Winbond flash mod...

manic glacierBOT
#

@dhalbert @tannewt
I made hopefully the last change. I added a couple of messages on overclocking similar to what we do when overclocking in the Arduino ide:

    if (frequency <= 600000000) {
        mp_printf(&mp_plat_print, "System Clock is set to %d hz\n", frequency);
    }
    if (frequency > 600000000) {
        mp_printf(&mp_plat_print, "System Clock is set to %d hz and is Overclocked\n", frequency);
    }
    if (frequency > 816000000) {
        mp_printf(&mp_plat_print...
manic glacierBOT
#

There were two main issues with the PWM support.

The first is they would fail to work properly if the board goes
into low power mode, when you do things like: time.sleep(0.25)
Can make partially work with this by turning on the proper flags
in each of the FlexPWMTimer Timers/sub-timers, but this did not
appear to work if for example you have both A and B channels
enabled.

Second main problem is that the code did not work with the X
channel of each timer/sub-timer. It looks li...

manic glacierBOT
#

Sorry is this still an issue?

I appeared to have an issue within Mu of using the CTRL-E when I pasted it started with a garbage character...

But I instead opened it up with Putty (actually KiTTy) and was able to paste in a sketch that > 125 lines long.
hitting ctrl+D than ran it.

I wonder if this was another case of the going into low power mode, not recovering...
i.e. maybe like #4444

manic glacierBOT
manic glacierBOT
#

I think it does it all the time:

Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPython 7.2.0 on 2022-02-24; Adafruit CLUE nRF52840 Express with nRF52840
>>>
>>> from adafruit_ble import BLERadio
>>> from adafruit_ble.advertising.adafruit import AdafruitColor
>>> ca = AdafruitColor()
>>> ca.color = 0x778899
>>> radio = BLERadio()
>>> for adv in radio.start_scan(timeout=3.0):
...     pass
...
...
...
>>> radio.start_advertising(ca)
>>> for adv in ...
#

I also meant to say that both @mjs513 and myself have done some different tests on these changes:
Example Test sketch:

import board
import pwmio
import time
import supervisor

print("setupPWM pin 1")

pwm1 = pwmio.PWMOut(board.D1, frequency=5000, variable_frequency=True, duty_cycle=32767+16384) #1x1
print("setupPWM pin 2")
pwm2 = pwmio.PWMOut(board.D2, frequency=5000, variable_frequency=False, duty_cycle=16384) #4A2
print("setupPWM pin 3")
pwm3 = pwmio.PWMOut(board.D3, frequ...
weary hill
#

I created a pull request for a JSON characteristic on the Adafruit BLE library. I found it difficult to send large values of the UART due to the small buffer, lack of flow control, reliable messaging etc. The JSON characteristic made it easy to set/get Python values directly and mad it simple to debug ble data issues using the nordic mobile app. I tried making many individual characteristics but the Nordic chip I was using on the Feather Sense was unable to support enough individual characteristics for my needs without running out of memory. I also made a msgpack characteristic but i found the size savings was marginal and the debugging utility was worth the extra size for me. Please let me know what you think:
https://github.com/adafruit/Adafruit_CircuitPython_BLE/pull/162/files

GitHub

Adds a JSON characteristic so python arrays, dicts, etc can be set/get easily on a connected ble device. This was very helpful for fast prototyping and debugging. I found it difficult to send larg...

manic glacierBOT
manic glacierBOT
#

We don't generally print out warning messages, since it can generate "noise" on stdout or the REPL. If the user is doing something like this, we expect them to read the documentation and know what they are doing. So we'd prefer that you not include these logging-style messages.

If you want to protect against overclocking, then maybe we need to add a flag like .overclocking_allowed, or not use the property after all to set the frequency, but instead use a function call with an extra "it's...

manic glacierBOT
#

This adds the frozen modules to the support matrix.

  • each module is designated by its import name. eg: neopixel not Adafruit_Circuitpython_Neopixel
  • frozen modules appear without a link, since those links are generated by sphinx as internal links
  • the usb module is fixed to only show on boards with CIRCUITPY_USB_HOST

Questions:

  • Any idea how to make Sphinx link to the libraries RTD pages ?
  • Should the frozen libraries be listed separately from the built-in ones or visuall...
orchid basinBOT
#

Note that, with builtin modules being removed and sometimes added back to some builds to make space for stuff, it's already changing with the version of Circuitpython, I think it's okay if the page only reflects the current release. I do second creating some reference on frozen libraries.

The frozen libraries could be in a separate list below the builtin modules on each board's page, under their actual module names. The generated list would need an update to get the names though. ([The mat...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Thanks @gamblor21

If you just remove this code, the pwm output does not happen, as all of the channels are blocked by fault code.

The alternative to the current code is probably what the Teensy code base does and at init time it clears out the fault conditions.

void flexpwm_init(IMXRT_FLEXPWM_t *p)
{
	int i;

	p->FCTRL0 = FLEXPWM_FCTRL0_FLVL(15); // logic high = fault
	p->FSTS0 = 0x000F; // clear fault status
	p->FFILT0 = 0;
...

Note the register names are slightl...

manic glacierBOT
#

Ok, I took a look at main.c and I can see that the CIRCUITPY filesystem gets init'ed before board_init() is called. So I going to try adding something like this before the filesystem gets set up:

    #if CIRCUITPY_EXTERNAL_FLASH_SETUP
    // Set up anything that might need to get done before we try to use SPI flash
    // This is needed for some boards where flash relies on GPIO setup to work
    external_flash_setup();
    #endif

And then add `void external_flash_set...

manic glacierBOT
#

@tennewt @dhalbert @ladyada @gamblor21 @mjs513

Sorry, I am not sure the best place to ask something like this:

What is your preferences/practices on Pull Requests and the like.
https://github.com/adafruit/circuitpython/pull/6287

Branch right now I am also testing it with a few other changes as well including for example the changes to add the uart_reset and i2c_reset. Which is pretty straight forward:

diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/super...
manic glacierBOT
#

This is a fix for #5590. The Sparkfun SAMD51 MicroMod has an external flash module that requires two pins to be pulled HIGH before the module is fully enabled.

This update adds a hook that allows for board.c to include a method external_flash_setup(), which get called before the flash filesystem is init'ed (which happens before board_init()). It also implements this method for the Sparkfun SAMD51 MicroMod so that the flash chip works and CIRCUITPY can be set up and mounted correctly....

manic glacierBOT
#

@dhalbert @KurtE @tannewt
I changed the value error to be in line with what I saw in how micropython set up their change clock for an ESP32 (which looks rather easy to do now by the way):

    if (freq != 24 && freq != 150 && freq != 396 && freq != 450 && freq != 528 && freq != 600 &&
        freq != 720 && freq != 816 && freq != 912 && freq != 960 && freq != 1008) {
        mp_raise_ValueError(translate("Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz")...
manic glacierBOT
#

Thanks to some from "ESP-sprite" on the ESP32.com forum, along with a few special tweaks, this eliminates the glitches observed above. The "bounce-buffer" code by ESP-sprite actually requires the CPU to write the data to the LCD peripheral through an intermediate buffer. In essence, this locks the processor so that other code does not access PSRAM while the LCD peripheral is accessing PSRAM.

I modified the code so that I can put the display in "non-stream" mode and then call `lcd_rgb_pan...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.2.0 on 2022-17-4; Raspberry Pi Pico with rp2040

Code/REPL

import time
import board, busio, digitalio
import os, storage
from sdcardio import SDCard

spi = busio.SPI(clock=board.GP18, MOSI=board.GP19, MISO=board.GP16)
sdcs1_pin = board.GP6
sdcs2_pin = board.GP7

print("Starting")
sd1 = SDCard(spi, sdcs1_pin)
vfs1 = storage.VfsFat(sd1)
storage.mount(vfs1, "/sd1")
print("SD 1 Mounted")
print(os.listd...
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

If the parts of a PR are rellated and should be reviewed together, then they certainly can be in one PR. But if they are unrelated, probably it's better to split up. We don't have a hard and fast rule about dividing up or combining PR's.

I do not understand what you mean about Serial2. In CircuitPython, there is no such designation. If you mean that the DEBUG UART permanently uses up a UART, that should not be the case. The UART should be used only if the UART TX and RX pins are defined ...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

As an example, this code to try the button before using debounce:

https://learn.adafruit.com/debouncer-library-python-circuitpython-buttons-sensors

`import board
import digitalio

pin = digitalio.DigitalInOut(board.D12)
pin.direction = digitalio.Direction.INPUT
pin.pull = digitalio.Pull.UP

button_state = False
while True:
pressed = pin.value
if pressed != button_state:
print(pressed)
button_state = pressed`

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

If the parts of a PR are rellated and should be reviewed together, then they certainly can be in one PR. But if they are unrelated, probably it's better to split up. We don't have a hard and fast rule about dividing up or combining PR's.

Thanks, makes sense. I have contributed stuff to projects on both ends of this, so just trying to make sure.

I do not understand what you mean about Serial2. In CircuitPython, there is no such designation.

You are right that Circuit Pytho...

manic glacierBOT
#

It may be that the frequency change is causing the time-keeping to be off. You could do some wall-clock timing to check that.

Thought crossed my mind so this morning ran the same test with the released version, 7.2.5, and the results were worse (600mhz): dt = 0.594569 minutes. Also ran it on the qtpy rp2040 and it said 2.2 minutes for one iteration (125mhz). And wall clock seemed to be close

@KurtE - @dhalbert - @tannewt
Not sure if this should be a whole different issue of ...

manic glacierBOT
manic glacierBOT
#

Guard this, for boards that don't have external flash. I think this will do it -- sorry I did not test it before.. Otherwise on boards like Trinket M0, there will be link errors (as you see in the CI). Note that RP2040 is idiosyncratic because it has external flash, but it's considered to be an "internal" filesystem. See supervisor.mk which determines whether to compile the external_flash/ sources or not.

    #if !INTERNAL_FLASH_FILESYSTEM
    external_flash_setup();
   ...
manic glacierBOT
manic glacierBOT
#

@KurtE - @dhalbert - @tannewt - @ladyada
Ok to move completely away from the Teensy board I loaded up an Adafruit ST32F405 Feather Express board using the same Prime Number sketch in Arduino and with CPy:

Arduino Time to Calculate 20K PrimeNumbers = 0.0130 minutes
CPy Time to Calculate 20K PrimeNumbers = 2.54334 minutes
=== Note: S32F405 running at 168Mhz

Some other stats:
QT PY RP2040 @125Mhz = 2.2 minutes for 20K Prime Numbers. This is similar to the ST32F405

Teensy ...

#

The resistor will tend to remove spiky noise on an input pin, because it lengthens the RC time constant on the pin, where C is the capacitance of the wiring and the input pin capacitance.

If I understand correctly, both of you are seeing this issue on D12 only (which is PA22)? I did some searching on this, and don't see specific complaints about noise on PA22.

The SAMD51 can get upset when pin voltages exceed VCC. I think this is an electrical noise problem, and doesn't have to do with ...

onyx hinge
#

that's a pretty wild bug report. must be something else going on.

orchid basinBOT
#

More in general, that freezing the portal and networking libraries is a recent addition, and we may freeze (or unfreeze) more (or different) as time goes on. It's probably not on many new and existing users' radars to pay attention to this, or know how to run a new feature that's not frozen yet.

I think the idea was that just like with the included modules, it would be an automatic part of the CircuitPython release, so as libraries are frozen or unfrozen, it would be reflected here. Whil...

manic glacierBOT
lone axle
#

What is the correct / easiest way to update a submodule in the core. adafruit_requests has some newer commits that aren't currently included in the copy that is frozen in to the core builds (including some from a PR merged today.).

I think I've done this before, but I'm not remembering how. Or secondarily is this covered in a learn guide anywhere?

I tried merging main to the branch in the frozen folder but tells me it's refusing to merge unrelated histories.

jaunty juniper
lone axle
#

Thank you I'll give that a try

manic glacierBOT
#

CircuitPython version

Teensy 4.1: Adafruit CircuitPython 7.2.5 on 2022-04-06; Teensy 4.1 with IMXRT1062DVJ6A
Teensy 4.1: Adafruit CircuitPython 5.3.0-rc.0-1839-g7a30176b4-dirty on 2022-04-13 (custom for testing with PR for settable clock)
Adafruit STM32F405: Adafruit CircuitPython 7.2.5 on 2022-04-06; Adafruit Feather STM32F405 Express with STM32F405RG
QT PY RP2040: Adafruit CircuitPython 5.3.0-rc.0-1839-g7a30176b4-dirty on 2022-04-13; Adafruit QT Py RP2040 with rp2040 (cust...
manic glacierBOT
idle owl
#

<@&356864093652516868> The Weekly meeting will begin promptly at 2pmET (just under a half an hour from now). We need to end by 3pm, so please keep that in mind. If you haven't already added your notes to the notes doc, and you wish to participate or have them read off, please do so as soon as possible. There will be no In the Weeds this week to keep things shorter. Thank you for your consideration, and hope to chat with you all soon! https://docs.google.com/document/d/1jwXEv1qr-WR32LcodY1V6htabrV1n1ZnE7SZ0o_4SQo/edit?usp=sharing

digital ibex
#

Hi, I'm looking in the notes document and am just curious what hug reports are. Excuse my ignorance 🙂

idle owl
#

It's our attempt to include some positivity in what we do.

digital ibex
#

That's wonderful! Thanks for the explanation.

idle owl
#

You're quite welcome!

#

@onyx hinge Are you up for doing the core this week?

onyx hinge
#

@idle owl sure!

idle owl
#

Thanks!

onyx hinge
#

cough cough

solar whale
#

lurking today -- nothing to report

idle owl
#

@digital ibex Are you new to this meeting?

digital ibex
#

Yep! I've made plenty of projects in CP and will make plenty more, but I thought it was about time that I maybe give back to the community.

onyx hinge
#

welcome @digital ibex glad you've been having fun with projects

manic glacierBOT
#

reproduced using 2 SPI SMT SDCard breakout (PID 4899)

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPython 7.3.0-beta.1-7-g87b3998d6 on 2022-04-18; Raspberry Pi Pico with rp2040
>>> import sdtest
Starting
SD 1 Mounted
[]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "sdtest.py", line 18, in <module>
OSError: no SD card
>>> 
...
lone axle
#

I need to play this game, I definitely use IDE as a bit of a crutch for git.

onyx hinge
#

there's no "cliff" emoji

turbid radish
#

Please subscribe!

onyx hinge
#

mjs513 and KurtE on github are working on iMX support in the core. one of the two closed PRs was from KurtE

stuck elbow
#

sorry my mike is broken

idle owl
#

No worries!

stuck elbow
#

fixed now

manic glacierBOT
lone axle
#

is circuit playground express + gizmo the only other samd21 board with display included? I have a hallowing but I think it's M4, I could try it out on Gizmo + CPX this week though.

onyx hinge
manic glacierBOT
manic glacierBOT
mental nexus
#

CircuitPython running on ESP32-S3 with 800x480 pixel 7-inch RGB display, now with no “glitching” or “tearing”.

lone axle
onyx hinge
#

after taking that photo I added some electric tape to block out more light coming out the sides of the LCD. I'm really pleased with how it works, hopefully it also stands up to being worn for a week. The pybadger app seems to run for ~10 hours on a charge so that's great

lone axle
#

I'm psyched to see your asyncio version as well. There are very limited asyncio examples for displayio stuff currently. It's great to see more of them popping up.

mental nexus
#

Thanks everyone! 👋

lone axle
#

Monday is the 25th I think?

onyx hinge
#

Yeah it is, my bad

#

10 days a week == simpler

#

@lone axle ```python
async def ui_task():
while True:
pybadger.auto_dim_display(delay=1) # Remove or comment out this line if you have the PyBadge LC
if pybadger.button.a:
pybadger.show_business_card(image_name="Blinka.bmp", name_string="Jeff Epler", name_scale=2,
email_string_one="jeff@adafruit.com", email_string_two=pronoun)
elif pybadger.button.b:
pybadger.show_qr_code(data="https://circuitpython.org")
elif pybadger.button.start:
show_my_badge()
await asyncio.sleep(.02)

async def led_task():
pixels = pybadger.pixels
pixels.auto_write = False
num_pixels = len(pixels)
j = 0
while True:
bright = pybadger.display.brightness > .5
j = (j + (7 if bright else 3)) & 255
b = 31/255. if bright else 5/255.
if pixels.brightness != b:
pixels.brightness = b
for i in range(num_pixels):
rc_index = i * 97 + j
pixels[i] = colorwheel(rc_index & 255)
pixels.show()
await asyncio.sleep(.02)

async def main():
await asyncio.gather(ui_task(), led_task())
asyncio.run(main())

lone axle
#

metric weeks.

gilded cradle
#

👋

proven garnet
#

Thank you!

ember iris
#

thanks all!

lone axle
#

Thanks everyone 👋

ember iris
#

Is there any prep that needs to be done for pycon? (I'll be remote only this year)

idle owl
#

I'm kidding, there's probably some though. If I think of anything, I'll definitely let you know!

#

It's seriously snowing hard enough here to limit visibility.

ember iris
#

Awesome! I'm looking forward to it!

ember iris
#

I keep having to bring plants in due to freeze warnings

idle owl
#

Oof. Yeah. The only plants we have are perennials that were here when we moved in, and so they'll live or die. Up to them.

stuck elbow
#

that's always the choice

manic glacierBOT
idle owl
#

@lone axle Did you file an issue to go into the Long Term milestone with the enhancement label regarding the change to TileGrid that you might want to see eventually?

idle owl
lone axle
idle owl
#

That's the back yard out one office window. The side window shows part of the road, and it's difficult to see the road from here.

lone axle
#

I am hoping we have no more of those days left this year in our area. But occasionally we do get them late into April 🤞

random junco
#

If I could, I'd file an issue against snow in April

idle owl
#

@onyx hinge I need to do the meeting updates to the newsletter, then are you available for going through code?

onyx hinge
#

@idle owl sure, 10+ minutes?

idle owl
#

Sounds about right, yeah.

#

@onyx hinge 14 minutes counts as 10+. 😄

#

Ready whenever.

manic glacierBOT
#

Sorry, I have not looked at this one yet... I have done similar on Arduino/Teensy stuff.
And the first place I would try might include, where you have:

sdcs1_pin = board.GP6
sdcs2_pin = board.GP7

Is to try setting both of them HIGH before your init code is called. I have not played enough with these boards and all of the breakouts to know if they have built-in Pull UP resistors on their Chip select pins.

So often times in Arduino I would add to start of sketch something...

manic glacierBOT
manic glacierBOT
#

While searching around to see what all I need to do to try to add SDIO support for the MIMXRT boards (Teensy 4.x) I remember reading something about sharing the SPI buss.

Found it:
https://docs.circuitpython.org/en/latest/shared-bindings/sdcardio/index.html

If the same SPI bus is shared with other peripherals, it is important that the SD card be initialized before accessing any other
peripheral on the bus. Failure to do so can prevent the SD card from being recognized until it is...

#

While searching around to see what all I need to do to try to add SDIO support for the MIMXRT boards (Teensy 4.x) I remember reading something about sharing the SPI buss.

Found it: https://docs.circuitpython.org/en/latest/shared-bindings/sdcardio/index.html

If the same SPI bus is shared with other peripherals, it is important that the SD card be initialized before accessing any other
peripheral on the bus. Failure to do so can prevent the SD card from being recognized u...

manic glacierBOT
#

All - I did an update to the above post because I found a typo in my python script - I used only 2000 iterations instead of 20000 as a result the micropython timing is about the same as the circuitpython implementation.

Teensy 4.1 @600MHz = 0.359 minutes, Arduino = 0.003 minutes and Micropython = 0.31138 minutes

doing a little googling on performance I found this post on the Raspberry PI forum: https://forums.raspberrypi.com/viewtopic.php?t=303379 where it talks about Mi...

manic glacierBOT
#

Using the Micropython code and C++ code I retested times using the minimal prime 3x3 magic square linked in the forum referenced in the previous method. Here are some benchmarks

Teensy 4.1 using C++

7| 29|101|
113| 59|  5|
 17| 89| 71|

30us
=========================================
Teensy 4.1 with CircuitPython
code.py output:
 47| 29|101
113| 59|  5
 17| 89| 71

6ms
=========================================

stm32f405 with CircuitPython
code.py output:
 47| 29|101...
manic glacierBOT
#

After looking at that video by George I made some changes to the 20k Prime Number sketch.

Looking at the STM32F405:
Before Changes @168Mhz to calculate 20K Prime Numbers: 2.54336 Minutes
After Changes @168Mhz to calculate 20K Prime Numbers: 0.691671 Minutes

For the Teensy 4.1
Before Changes @600Mhz to calculate 20K Prime Numbers: 0.359 minutes
After Changes @600Mhz to calculate 20K Prime Numbers: 0.15013 Minutes

Quite an improvement. I did 2 things

  1. Changed the while...
manic glacierBOT
#

I attempted to refactor the type and "size must be multiple of tile size" check into it's own function. I was able to get a function that did complete those checks successfully but I couldn't figure out how to use the function from inside of make_new()

The main problem I ran into was being unable have this function "return" the bitmap sizes, tile sizes, and Shape, Bitmap, or OndiskBitmap object. I made a few attempts storing things in an array or using pointers to "return" those values ...

orchid basinBOT
manic glacierBOT
#

For me D12 is just the pin where I can most reliably reproduce the issue. I managed to rarely and sporadically reproduce it on other digital pins too... I think D6, D9 and D10, but not 100% sure exactly which ones, it's been a while. It's quite a bit harder to reproduce on pins that aren't D12 for some reason. It also seemed easier to reproduce with a pullup resistor vs a pulldown, but not sure if that's a true pattern, or just randomness. I don't recall if I ever managed to reproduce this on...

manic glacierBOT
#

@dhalbert @KurtE @tannewt
Just closed the issue on CPy slowness out, https://github.com/adafruit/circuitpython/issues/6292. Did a bit more homework and rewickered the sketch based on some speed increases when coding in MPy. So now things make sense. Here are some numbers for 20K prime numbers:

Adatfruit STM32F405 Express @168Mhz:  0.691671 minutes
ESP32S3 @240Mhz:                      0.43192 minutes
Adafruit QT PY RP2040 @135Mhz:        1.12076 minutes
Teensy 4.1 @150Mhz:      ...
manic glacierBOT
#

When I run make translate the shared-module/zlib/DecompIO.c portion of this line gets removed. I noticed that this portion is present in main branch. I copied it back into this branch but after running make translate it gets removed again.

Anyone know what could cause that to be happening in my local repo? It looks like the file that it references is not present in main, so maybe it's intended for this portion to be removed from the .pot file?

For now I will put it back how it is...

#

The latest commit reverts the locale change noted above.

I also noticed that there was a redundant type check inside the bitmap setter which had it's own different error message. I removed the extra one and left the one with the more concise error message (same as make_new).

The space savings from removing the redundant check and it's different error message happen to be just enough to allow the feather_m0_supersized build with ru language to complete successfully:
![image](https://u...

proven garnet
manic glacierBOT
lone axle
proven garnet
#

Ahhhh, that's it I think, different link between badge icon and actual project

#

Thanks!

manic glacierBOT
#

Sorry again I don't understand why there would be such a limitation.

But for the heck of it I downloaded the sources of the library, so I could run from sources instead of the compiled version and it does print out some additional information on failures...

Also note: that same warning about sharing the SPI buss is on the Readme file for that library!

Also I get some different results depending on what cards I plug in. For example when I plugged in an 1gb or 8gb card it failed
wit...

proven garnet
#

PR'd, thanks @lone axle!

lone axle
#

I'm guessing maybe the "project slug" for that one might be different? but I'm not sure how to find it. The live docs page does exist and seems to work fine, but I'm not sure how to get from there to the RTD "dashboard" page that shows builds, versions etc. Generally it's formulaic so you can just paste the root name in the address bar to find them, but this one shows that "doesn't exist" page.

tulip sleet
#

I re-ran the builds on RTD, and it didn't help

proven garnet
#

Yeah, that was what the badge icon was sourcing from, but the actual link it went to when clicked was in fact correct

lone axle
# proven garnet PR'd, thanks <@382939733107408897>!

it's worth checking in with Kattni when she's around. I would guess if possible we might want to figure out how to get it under the full name adafruit-circuitpython-emc2101 rather than changing the readme to point to the smaller name emc2101 AFAIK the rest of the libraries do include the adafruit-circuitpython prefix in their URLs.

tulip sleet
#

I have privs on RTD to change it; let me check and compare with another one

proven garnet
#

Sounds good! Happy to PR the slug as correct!

tulip sleet
#

so if I understand, the slug in the README is "correct"?

#

so we wouldn't PR a change if I fix the project?

proven garnet
#

The badge image sources from adafruit-circuitpython-emc2101 but the link it goes to when clicked is emc2101

#

So it just changes which will need to change

tulip sleet
#

I will delete and re-create the project. I can also add a redirect in RTD, it appears.

proven garnet
#

Sweet Coolpika

#

I'll PR the change to the badge then to be adafruit-circuitpython-emc2101

tulip sleet
#

actually, I can't do a redirect, because the domain has changed, but I think it's better to be consistent. I will check the Guide for any needed changes.

proven garnet
#

If it's helpful, I could try finding other libraries that don't fit this style of slug.

tulip sleet
#

wait a minute, I am finding a bunch of libraries that are different.

proven garnet
#

I've hit a few in the past few weeks I think that I've brought up here

#

Ah, nevermind then haha

tulip sleet
#

ok, the subproject URLs are OK, it was still just the slug that was wrong

#

i mean it's right now, I made it like the others

#

and the badge works as is, now

#

@proven garnet no PR necessary

proven garnet
#

Oh, nice! Thanks!

#

Closed the PR

tulip sleet
#

and the guide URL is still fine. It was just the badge URL that was pointing to the truncated slug that was bad

#

thanks for noticing. I saw a couple of other not-yet subproject-ed libraries I will check on

proven garnet
#

Sounds good! Let me know if I can help at all!

tulip sleet
#

let's check on TT21100 and Pixelbuf

#

ok, pixelbuf got renamed, and TT21100 was just forgotten to be added as a subproject

orchid basinBOT
tulip sleet
#

ok, all done with those

manic glacierBOT
manic glacierBOT
#

There are a couple of use cases we have where you want to send the same data to a PIO peripheral indefinitely:

  • pimoroni-style "pwm cluster" / "servo cluster": control a whole group of pins according to "data and delay" pairs
  • "dithered" neopixels: as fast as possible, scan the neopixels with multiple sequences A/B/C/D. This expands the color resolution to 10 bits
  • other uses like periodic waveform generation

My first sketch of how these would look is something like

StateMac...
idle owl
#

It's fine to deal with whatever slug it was created with when necessary.

tulip sleet
#

i did that ; there were no links to the wrong slug that would break existing links

idle owl
#

But yes, anything new should absolutely have the proper slug.

#

Oh ok.

tulip sleet
#

I was afraid there were some somewhere, but not true

idle owl
#

That also works, I guess 🙂

tulip sleet
#

the README assumed the correct slug, fortunately, so I just went ahead and deleted and re-created it.

idle owl
#

Easy to update the README if it hadn't though. But better to not have to.

tulip sleet
#

one q as long as your are on; we now have pixelbuf and pypixelbuf repos that look identical. Are we going to archive pypixelbuf at some point? I know we discussed that, but I can't remember the resolution

#

i was worried about the guide but it was fine

idle owl
#

I think we were waiting a transition period to make sure all the code caught up.

#

I'm pretty sure we're past that.

#

If it's still in the bundle, we can remove it, and archive the repo.

#

If folks still have code using it, we'll deal with it on a case by case basis.

tulip sleet
#

only one place I see in Learn repo:

elcome_to_CircuitPython/code.py
13:* adafruit_pypixelbuf.mpy
#

looks like it's in a comment

idle owl
#

Fair enough.

#

I don't see it in the bundle anymore.

tulip sleet
#

updating my bundle repo to check...

idle owl
#

I'm looking at the repo lists online.

tulip sleet
#

you had a procedure for archiving, do you want to do it?

idle owl
#

Both the manually generated one and the autogenerated one

idle owl
tulip sleet
#

I see it in the bundle still

idle owl
#

Oof really?

#

It's not in either list.

#

Ok, do you want to remove it then?

tulip sleet
#

no, not really, leftover in my clone

idle owl
#

Ahhh.

tulip sleet
#
Untracked files:
  (use "git add <file>..." to include in what will be committed)
    libraries/helpers/pypixelbuf/
#

ok, all gone after git clean

#
"""
Blink example for boards with ONLY a NeoPixel LED (e.g. without a built-in red LED).
Includes QT Py and various Trinkeys.

Requires two libraries from the Adafruit CircuitPython Library Bundle.
Download the bundle from circuitpython.org/libraries and copy the
following files to your CIRCUITPY/lib folder:
* neopixel.mpy
* adafruit_pypixelbuf.mpy

Once the libraries are copied, save this file as code.py to your CIRCUITPY
drive to run it.
#

from Welcome_to_CircuitPython/code.py

#

I can PR that out

#

or maybe it's in a template now?

idle owl
#

So the archive process is this:

  1. Close or transfer all issues with a comment explaining the repo is being archived.
  2. Close all PRs with a comment about the repo being archived.
  3. Update the README to have a big warning at the top saying:

This library is deprecated and has been archived. Please use the new library here: [URL to pixelbuf]```
4. Archive the repository in the repo settings.
idle owl
tulip sleet
#

ok, I will do the archive, should get some muscle memory for that, and will PR the code.py change

idle owl
#

Also, no PRs or issues, so added bonus there.

tulip sleet
#

ok, great! I will look at another archived one to see

idle owl
#

They're all a little different. I just looked myself to make sure I had the right thing.

#

Use Markdown to make the warning "big".

#

Check out the Python libraries, I think, for the best comparisons. Mostly because I might have had a hand in those.

#

Brennan or me, anyway.

#

Depending on the timing.

idle owl
tulip sleet
idle owl
#

Eh, it happens.

tulip sleet
#

it was never released, maybe that's why

idle owl
#

I think so, yeah.

#

I thought it was a Python one until I looked again

tulip sleet
#

okee dokee

jaunty juniper
#

speaking of librairies that should not be there, I noticed that there's 4 boards that have Adafruit_CircuitPython_BusDevice frozen in, adafruit_qtpy_esp32s3_nopsram, adafruit_feather_esp32s2_tftback_nopsram, solderparty_rp2040_stamp, and TG-Watch. The builtin module is also enabled on those boards so I assume the frozen modules should simply be removed.

idle owl
#

I'm not even sure why anything is frozen into that QT Py or Feather...

#

Are there more libs frozen into those builds?

jaunty juniper
tulip sleet