#circuitpython-dev

1 messages ยท Page 369 of 1

solar whale
#

The reason I was asking was -- the guide has you load a "combo" .bin file but there is no step to then load the update_bootlader so it just loads a slightly older version

tulip sleet
#

i'm not sure what the difference is between bootloader.bin and tinyuf2.bin

#

we've been using the combo to get people started; it's your choice whether to update or not. I don't know if it's necessary to get the functionality you want

solar whale
#

but I think you clarified -- if the loaded version is already the latest, then loading update_bootlader.uf2 will essentiall do nothing

#

Thanks!

tulip sleet
#

it would be good if the version numbers were in the file names...

solar whale
#

and it looks like the combo also includes an application file (in this case, the arduino demo)

manic glacierBOT
#

Adds AuthMode class. Instead of using combined enum filed like WPA_WPA2_PSK, uses a list separating the fields [WPA,WPA2,PSK].

Code:

import wifi
for network in wifi.radio.start_scanning_networks():
    print(network.authmode)
wifi.radio.stop_scanning_networks()

Output:

[wifi.AuthMode.WPA, wifi.AuthMode.WPA2, wifi.AuthMode.PSK]
manic glacierBOT
tulip sleet
solar whale
#

@tulip sleet Thanks! Still trying to understand all the pieces, but it is making more sense to me know. I had a very confused notion of what the update_bootloader was doing.

manic glacierBOT
#

This must have something to do with merging the newer versions of Micropython (#4646, #4649). '_transmit' exists in the Neopixel and Dotstar subclasses, not in _Pixelbuf, which is the superclass. So for some reason instead of searching the subclass type for the transmit function and then searching the _Pixelbuf type, it would seem Circuitpython is only searching _Pixelbuf.

This would also support why 'fill' would work, as it is a function from _Pixelbuf. It is interesting using adafruit_pyp...

manic glacierBOT
onyx hinge
#

@slender iron do you want me to look into the _transmit problem?

slender iron
#

sure!

#

I've got one more test issue to hunt down today

onyx hinge
#

do you remember, was it krayola or you who changed the core behavior so that this could work in the first place?

#

I was looking for that commit or PR to refresh my memory

slender iron
#

we both had a role in it I think

#

I think _transmit is meant to be on the subclass of the pixelbuf

#

so perhaps the lookup is happening on the super class incorrectly

onyx hinge
#

My first suspicion was that the core behavior changed here was reverted in one of your merges; I don't think there are any tests of it.

slender iron
#

yup, that could be the spot

manic glacierBOT
idle owl
manic glacierBOT
#

The pin names of GP* come from Raspberry Pi, and I have no idea of their use cases. Defining I2S_* pins will be convenient when using audiobusio module. However, I also wonder if it may not be necessary to define aliases of those pins used as a group (such as RTL_* and I2S_*), as far as they are accessible in other ways. Which option do you think is suitable?

1. Add I2S_* definitions to board module.

2. Remove RTL_* definitions from board module (only DAC0/1 remain)

...

idle owl
#

@onyx hinge Thanks for looking into it. We were, in the thread, questioning whether it's worth waiting until the merging is complete. But neopixel is a significantly used library, so even though we haven't released 7, it's probably worth doing. (Contrary to my comment. Mostly I didn't want a community member ending up in a rabbit hole that we needed to handle.)

onyx hinge
#
# Welcome to CircuitPython 2.2.0 :)
``` huh apparently I have never done anything with this board
idle owl
#

l. o. l. Evidently not.

onyx hinge
#

hum this board is pretty unhappy with main. I get a hardfault from import _pixelbuf. ouch.

#

that's not the same as what users are seeing, is it?

idle owl
#

No

idle owl
#

So it's not importing _pixelbuf that's the issue. I did that successfully. As long as I didn't specify pixel[0].

#

I'm surprised the rainbow code works though because it iterates over pixels..... pixel[pixels] = colorwheel(pixel_index & 255)

#

That's under for pixels in range(1): (only one LED)

manic glacierBOT
#

I pulled out a Metro M0 to do some testing with, and the current main branch just crashes whenever I do "almost anything" at the repl.

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.0.0-alpha.1-929-g52589691b on 2021-04-29; Adafruit Metro M0 Express with samd21g18
>>> 
>>> import sys

[tio 10:57:51] Disconnected
[tio 10:57:53] Connected
Not running saved cod...
idle owl
#

Ok I'm running super simple code and it's not working and I am confused. Anyone have an ItsyBitsy RP2040?

onyx hinge
#

With "main"?

idle owl
#

"main"?

onyx hinge
#

branch

#

I guess that board isn't in 6.2.

idle owl
#

Yes. with main.

#

It's running, but nothing is happening

#

is my issue.

#

(Limor asked me to test with latest for everything I do so I find bugs.)

onyx hinge
#

I bet you've found bugs ๐Ÿ™‚

idle owl
#

There are no comparable boards to test on. QT Py has no built-in little LED. and Feather, you can't use the BOOT button as a user-button in code.

#

I'll try it on 6.2.0 I guess.

#

Nothing.

#

It's not a main bug.

onyx hinge
#

oh really

idle owl
#

Apparently.

#

Ok reloaded the latest.

#

(no change, but I was not expecting one.)

#

the LED isn't blinking. I know it works because it was blinking with the pico-sdk demo that it shipped with.

#

I checked the pin....

#

Pretty sure I have two, I'll try another one.

#

Not blinking.

#

How did I break blink? ๐Ÿ˜–

solar whale
#

@idle owl I do have na itsybitsyrp2040 -- do you want me to try something? may take a few minutes find it....

idle owl
#

oh wtf.

#

I figured it out. The board def is wrong.

#

BUG FINDING.

onyx hinge
#

someone should fix it then ๐Ÿ™‚

solar whale
#

Glad I could be of assistance ๐Ÿ˜‰

idle owl
#

Yes, on it.

idle owl
solar whale
#

I actually found it.

idle owl
#

Verified the schematic.

#

Ok. Fixing.

#

@onyx hinge Ok to tag you as a reviewer?

onyx hinge
#

sure

manic glacierBOT
idle owl
#

Now we wait. ๐Ÿ˜‘

onyx hinge
#

@slender iron re the above change, do we want it in 6.2.x and merge 6.2.x up to main?

slender iron
#

I think @tulip sleet has thought more about this. Ideally it'd be 6.2.x but we have plenty on main that we'll want in 6.2.x when we release

#

so I don't think it matters

onyx hinge
#

OK

manic glacierBOT
idle owl
#

Hmm hold up on merging that.

#

Button pin might be wrong too.

manic glacierBOT
onyx hinge
idle owl
#

Cheers.

onyx hinge
#

out to lunch! ๐ŸŒฎ

idle owl
#

YES.

#

Button pin was wrong, and I fixed it.

#

Also..... who has two thumbs and built CircuitPython on the first try?

#

๐Ÿ’ช

#

(Im going to verify the rest of the board def before committing again.)

jaunty juniper
#

so, on a QT PY M0 Haxpress, since merging 1.11 the board doesn't show up and messes with my mac's USB instead, making the keyboard and mouse stutter. The neopixel is lit up green.

#

and I got the same with an itsy M0

#

except sometimes it does show up after switching different versions of circuitpython back and forth, and it gives me a hard fault into safe mode, even with an empty code.py

manic glacierBOT
#

Hmmm. Yes, I have pre-commit installed and it didn't complain. I'll fix up
the
indentation.

On Thu, Apr 29, 2021 at 10:48 AM Scott Shawcroft @.***>
wrote:

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

In ports/raspberrypi/common-hal/pulseio/PulseIn.c
https://github.com/adafruit/circuitpython/pull/4683#discussion_r623177823
:

@@ -141,9 +141,16 @@ void common_hal_pulseio_pulsein_interrupt() {
}
// ignore pulses tha...

idle owl
#

I think D5 was wrong too.

#

Anybody good with reading schematics?

ionic elk
#

post em

idle owl
#

D5 != GPIO15. Accurate?

#

(LMK if you need more than that section of the schematic.)

#

It's on 14.

ionic elk
#

D5 appears connected to GPIO14, yes

idle owl
#

Ok.

#

I'll build and test it to be sure.

slender iron
idle owl
ionic elk
#

what board is this a problem for?

idle owl
#

There are a few errors in the board def.

#

Already sorted out the LED and the BUTTON pins.

ionic elk
#

and the board profile does indicate it's connected to GPIO15, yeah

idle owl
#

Yep.

#

Everything else checks out with the schematic.

idle owl
#

Trying to avoid soldering headers on this board.

ionic elk
#

That should work just fine I would think

idle owl
#

Ok thank you

manic glacierBOT
ionic elk
#

Nothing special about GPIO14 or 15 that I know of, DigitalIO should work on both

idle owl
#

15 has that silicon bug, or used to anyway, not sure if this rev of the chips fixed it. But that wasn't relevant to using it as a digital pin, it was a potential-on-reset type thing.

ionic elk
#

Oh hmm, I'll have to check out the errata, didn't see that in the datasheet

idle owl
#

Also I did not know that building CircuitPython checks to see if changes were made or not. And if not, it doesn't build.

idle owl
ionic elk
#

yah you can use V=1 to visualize the specific files that get recompiled

idle owl
#

Ah nice

ionic elk
#

it won't recompile files you didn't change in most circumstances

#

Unless you remove or add an entire module, or change a translated sentence, in which case the QSTRs screw everything up, so it's better to just make clean and rebuild in those circumstances.

slender iron
#

1.12 merge passed unix tests!

idle owl
#

Toggle appears to be working!

ionic elk
#

@idle owl wait wat

idle owl
#

I built it with the correct pin in the board def, and the pin is working.

ionic elk
#

Oh, so the board def was wrong

idle owl
#

If I'm doing this right anyway.

#

Yes ๐Ÿ™‚

#

The board def was wrong in 3 places.

#

LED, BUTTON and D5.

ionic elk
#

I thought you meant the default was working and was like how could that happen

idle owl
#

Ahhhh. No ๐Ÿ™‚

#

I meant I fixed it

#

and was excited about that.

manic glacierBOT
ionic elk
#

Nice! good debug

idle owl
#

Thanks!

ionic elk
#

I was all prepared to be embarrassed at somehow blatantly misinterpreting a schematic again after last time

idle owl
#

Aww. ๐Ÿ˜• Nah, you were right.

ionic elk
#

I am glad to see that my brain is still holding together lol

manic glacierBOT
idle owl
#

kattni dismissed jeplerโ€™s stale review via 4d97680 1 minute ago sounds like it's on the edge of being rude. "I DISMISS YOUR STALE REVIEW, SIR.". ๐Ÿ˜„

#

Thanks for the review, @ionic elk!

ionic elk
#

yes github very rude

#

no tact

idle owl
#

AFK for an hour. Back after.

manic glacierBOT
onyx hinge
#

@idle owl I think it was Billy Joel who said, "don't be afraid to try again / everyone goes stale / every now and then / you've done it / why can't someone else"

manic glacierBOT
idle owl
#

@onyx hinge Some of the checks failed on the objtype PR.

onyx hinge
#

boo! I'll look.

#

253704 bytes used, -8 bytes free in flash firmware space out of 253696 bytes (247.75kB).

#

yow

idle owl
#

Ok, I'm unclear - what's the plan for a 6.2.x release? Waiting until everything is merged? I'm asking because aside from the example code not quite working right without the board def fix I merged, folks are going to run into issues with using the LED, pin D5 and the button on the Itsy RP2040 unless they're running the absolute latest.

#

Trying to decide how to handle this.

manic glacierBOT
manic glacierBOT
manic glacierBOT
ionic elk
#

I have a weird compilation issue that only happens on CI, not my local builds

/usr/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: build-feather_stm32f405_express/supervisor/port.o:/home/runner/work/circuitpython/circuitpython/ports/stm/./common-hal/alarm/__init__.h:32: multiple definition of `alarm_sleep_memory_obj'; build-feather_stm32f405_express/main.o:/home/runner/work/circuitpython/circuitpython/ports/stm/./common-hal/alarm/__init__.h:32: first defined here

This seems almost like the CI compilation is not recognizing my compilation ifdef?

#ifndef MICROPY_INCLUDED_STM32_COMMON_HAL_ALARM__INIT__H
#define MICROPY_INCLUDED_STM32_COMMON_HAL_ALARM__INIT__H

it's definitely there though

onyx hinge
#

@ionic elk can you link to the full file content on github?

#

I have a gut feeling but I'd like to verify it before I open my mouth

ionic elk
#

yeah that

onyx hinge
#

the line that's written there is a definition of alarm_sleep_memory_obj, so each time the file is included it creates a definition. It's included from (at least) supervisor/port.c and main.c

#

adding extern turns it from a definition into a declaration

#

if you don't see it locally, it may be because you have an older gcc

ionic elk
#

right, but isn't this supposed to stop that from happening?

#ifndef MICROPY_INCLUDED_STM32_COMMON_HAL_ALARM__INIT__H
#define MICROPY_INCLUDED_STM32_COMMON_HAL_ALARM__INIT__H
onyx hinge
#

not really. That prevents the text of __init__.h from being added twice if it's #included twice from the same top level file, but each top-level C file that includes it still sees its own copy of those lines.

river quest
#
Adafruit Industries - Makers, hackers, artists, designers and engineers!

We celebrated MicroPythonโ€™s previous birthdays, last year in NYC we were dealing with shutdowns, death, sickness, and more โ€“ so we did not get a chance to do a post. But with a new yearโ€ฆ

ionic elk
#

@onyx hinge then, why doesn't this happen on the other ports? ESP32-S2, NRF and RP2040 also don't use extern, but they don't muck up the CI

onyx hinge
#

esp32s2 uses a different compiler version

ionic elk
#

that said, you're probably right, my GCC is still 9.2.1

onyx hinge
#

nrf uses extern in the header file as I suggested ports/nrf/common-hal/alarm/__init__.h:extern const alarm_sleep_memory_obj_t alarm_sleep_memory_obj;

ionic elk
#

oh right ofc re: esp32

#

Ok, I missed that edit. I will update my gcc and add extern. Thanks Jeff!

onyx hinge
#

Glad I could help

idle owl
#

Hooray, the latest S3 build of CircuitPython has my fixes and it works!

ionic elk
#

what's the best GCC to use right now, there isn't a bug on the latest or anything, right?

idle owl
#

(Which is to say the code I was running on the custom firmware works on an actual build.)

#

@onyx hinge You asked earlier about merging things into 6.2.x, but I was unclear on the answer. I need to add warnings to this guide I think. Until we have a release of some sort with this fix.

onyx hinge
#

@idle owl yeah sounded like dan was going to do a sweep of changes on "main" that we want in 6.2.1 and gather tham all. so until then, the fix won't be anywhere but the latest binaries, and those are potentially beset by other problems

idle owl
#

Oi ok.

#

I'll verify with Limor on how to handle the guide and add warnings and hopefully remember to go back and remove them once we have releases.

#

Your reference to "main" might have been less confusing if you did main. ๐Ÿ˜„

simple pulsar
#

I just put absolute latest on Pico and got a MpyError: Incompatible .mpy file. - is that because it's going to be a 7.x release?

idle owl
#

The mpy format changed with 7. You can download mpy-cross and make your own, or use the .py versions until there's a 7.0 release.

onyx hinge
#

With circup, use circup install --py for it to install the non-compiled files, it'll be the best option for awhile

#

@idle owl glad you figured out main, main main main or whatever it should be.

idle owl
onyx hinge
#

main

#

OK I'll stop

idle owl
#

(so much main in that sentence.)

#

All the main at once!

ionic elk
#

Oh super thank you Apple please do mark every part of the arm compiler as malware and force me to manually allow each one from system preferences

ionic elk
#

that's absolutely what I wanted to spend my afternoon on

idle owl
jaunty juniper
#

isn't there a recursive command line that does that ?
i know xattr -r -d com.apple.quarantine filename or is it a different issue ?

ionic elk
#

If you know a way around this or an article that discusses it, please lord tell me

#

I'm on approval number 12 now, this might never end

idle owl
#

Wait, give me a minute, my partner figured out something if I remember correctly.

ionic elk
#

I swear Apple degrades even more every year

idle owl
#

But she's in a meeting, so let me see if she responds and remembers.

ionic elk
#

@idle owl I think I actually got through them all

#

but I'd still def appreciate anything, it might pop up again

idle owl
#

She doesn't remember without googling. But there was some command line thing iirc. That forces permissions.

#

Worth at least remembering there's a workaround, and looking for it next time.

ionic elk
#

ok, I'll poke around and do my own research

#

thx for checking

hollow token
#

Could just pipe data from a find

#

find ./ -type f | xargs xattr -d com.apple.quarantine

#

Just cd to the directory first though

jaunty juniper
#

xattr -r is recursive, I don't know if it solves that issue though

fossil gorge
jaunty juniper
ornate breach
#

could someone start the CI for my pr whenever you sweep past it ๐Ÿ™‚

#

just need to see if i fixed it.

manic glacierBOT
analog bridge
#

Anyone available to merge #4685... its already approved.

manic glacierBOT
#

Implements dynamic USB descriptors, including HID.
Fixes #4351, fixes #1015, fixes #4242, fixes #2087.
Not yet included: ability to change interface names (#4433), boot keyboard (#1136).
#620 (touchpad) would implemented as a custom HID device and a library.
This will break the existing VENDOR WebUSB implementation and that will have to be redone.

API Summary

All configuration is done in boot.py.

  • MSC and MIDI are simple on/off choices:
storage.configure_usb(False)  ...
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
tulip sleet
#

@onyx hinge hi - do you understand the pre-commit uncrustify formatting checks? I thought that pre-commit would do the reformatting. Those checks pass locally, but fail on GitHub. There are definitely formatting changes to be made. uncrustify leave *.uncrustify files scattered around. I thought they were the unfixed versions, but they are the fixed ones.

manic glacierBOT
manic glacierBOT
onyx hinge
#

@tulip sleet no, my impression was the same as yours

#

@tulip sleet what's your uncrustify --version?

manic glacierBOT
onyx hinge
#

because codeformat.py invokes uncrustify โ€ฆ --no-backup I think it's supposed to modify files in place, not put .uncrustify files alongside them.

tulip sleet
onyx hinge
#

BUILDING.md says you need "version 0.71 (0.72 is also tested)"

tulip sleet
#

oh , bleah, 0.69 is what comes with ubuntu 20.04. I will find a PPA. THanks.

onyx hinge
#

yeah if you're on ubuntu check the ppa that the build uses

onyx hinge
#
    sudo apt-add-repository -y -u ppa:pybricks/ppa
#

I think it gets the pybricks one

tulip sleet
#

oh, I thought that was only for py-related stuff

onyx hinge
#

ยฏ_(ใƒ„)_/ยฏ

tulip sleet
#

indeed it has updated uncrustify. thanks!

#

what's weird is that 0.69 did not obey --no-backup but didn't complain about it either

analog bridge
#

@tulip sleet no errors is due to pre-commit... it hides the logs

tulip sleet
#

aggh

analog bridge
#

if you run the uncrustify command directly, their will be a bunch of errors

tulip sleet
#

tnx

onyx hinge
#

I think codeformat isn't running on all the files we intend

#

for instance, it doesn't run uncrustify on ports/raspberrypi/common-hal/pulseio/PulseIn.c

hollow token
#

All those poor ducks, all bread and no crust
(sorry, could not help myself)

onyx hinge
#

there must be some context I am missing

tulip sleet
#

maybe we need to add the whole port directory

onyx hinge
#

I think pathlib.Path.match doesn't treat "**" like we need it to

manic glacierBOT
#

This fixes some missing and incorrectly-assigned pins for the SparkFun Thing Plus RP2040 protoboard so that they match what the board has printed. This also changes the default SPI pins from the SD card to the breakout pins on the side of the board (the SD card pins can now be found via board.SD_*).

These pins match the EAGLE files posted by sparkfun here (marked as 'v10' on the schematic and 'v11' on the boar...

manic glacierBOT
#

In #4683, tannewt noticed that uncrustify was not running on some file in common-hal.

I investigated and found that it was not being run on a bunch of paths.

Rather than make incremental changes, I rewrote list_files to work based on regular expressions; these regular expressions are created from the same git-style glob patterns. I also added a dry-run mode so it was easier to look at the paths being acted on.

I spot-checked some specific filenames after this change, and all looks g...

tulip sleet
#

@onyx hinge is it a bug in pathlib, or we are using it wrong?

#

I tried running a cut-down version of codeformat.py just to see what it was matching, but got nothing (I was doing it wrong)

manic glacierBOT
manic glacierBOT
solar whale
#

@slender iron thanks!

slender iron
#

np ๐Ÿ™‚ all I did was hit merge

#

thanks to jeff for fixing it

solar whale
#

I looked at the fix -- wow! that was obscure... glad he figured it out.

#

@onyx hinge Thanks for fixing both the pixelbuf and the samd21 issues -- they make 7.0 much more useable!

manic glacierBOT
solar whale
#

@idle owl what boards can the "flash_nuke.uf2" be used on?

idle owl
#

RP2040 boards, afaik.

solar whale
#

nice -- good to know. thanks.

manic glacierBOT
#

Here are my first API thoughts. I haven't looked at the code yet. Thanks for working on this!

* All the configuration routines use the general `configure_usb()`, rather than just, say, `enabled()`) so that in the future they might take more arguments other than just bools or a list (e.g. interface names, multiple HID devices for a separate boot keyboard, etc.)

I'm not a fan of the common configure_usb design because it makes them equally vague. I think it'd be better to have int...

ornate breach
#

The question centers around, will it work for most kinds of SPI/I2C EPD? Iโ€™m getting some 1.54โ€ 152x152 epd by GoodDisplay and I want to know if they are compatible with or the same general brand as what you use in your designs

slender iron
#

please don't ping here directly. more folks can answer than just her

#

@ornate breach I think displays are sourced from good display. support depends on the chipset used on the display

#

and how the chip connects to the display

ornate breach
#

The ones Iโ€™m getting have both SPI and I2C directly

#

So it has those pins broken out directly

#

seems similar to the 1.54" one stocked in the shop, but not the same pixel density

solar whale
#

@slender iron good point. I pinged because the question was related to a guide she just published but your point is well taken.

#

Oops. I see from the deleted messages that you may have not been referring to me . Still a good point!

onyx hinge
#

@tulip sleet I think specifically that the "**" syntax of git globs is not understood by the pathlib functions that deal with globs

#
>>> pathlib.Path("a/b/c/d").match("a/**/d")
False
tulip sleet
#

maybe only .glob does, but not .match

onyx hinge
#

maybe?

#

it can also look slightly like it DOES work if you use the wrong test

#
>>> pathlib.Path("a/b/c/d").match("**/d")
True
tulip sleet
#

i will see if there's a filed bug on this

#

so only prefixed '**' works, it appears

onyx hinge
#

it turns out the match can start "part way down the filename", or something. It is not extensively documented, so it's hard for me to know exactly what it does

tulip sleet
#

you did the right thing, I was just surprised, since the doc appeared like it should work

onyx hinge
#
>>> pathlib.Path("a/b/c/d").match("d")
True
``` well, you can just omit the `**` if it's at the beginning...
#

I appreciate you taking the time to make sure what I did was right.

tulip sleet
onyx hinge
#

hmmm my conversion to regular expressions might not be right...

#

since a/**/b needs to match a/b

#

.. right?

tulip sleet
#

@onyx hinge Yes, in bash, with ** turned on:

halbert@tuna:~$ mkdir -p dir1/dir2
halbert@tuna:~$ ls -d dir1/dir2
dir1/dir2
halbert@tuna:~$ ls -d dir1/**/dir2
dir1/dir2
halbert@tuna:~$ 
#

though I don't think the patterns we use depend on that

onyx hinge
#

they do, tools/**/*.py should match tools/codeformat.py

jaunty juniper
#

ok, so I was looking into the issue I had with Mu, and it seems that just sending a lot of things to the serial makes it stop receiving, or time out. Like something like this sending data to the board while it runs anything makes it impossible to ctrl-C afterwards. (With as low as 25 on M0 boards I tested)

with serial.Serial(serial_port) as channel:
    channel.write(b"." * 1000)
#

the issue with Mu is because when you click in the Serial window it sends as many VT100 commands to move the cursor right or left as necessary

#

(whether you are in the REPL or the code is running)

manic glacierBOT
lone sandalBOT
manic glacierBOT
crimson ferry
#

7.x libs: MpyError: Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/mpy-update for more info. is this because the mp merge is ahead of my 7.0.0-... build?

#

or will the libraries get rebuilt at some point?

jaunty juniper
#

ah the libs are mpy-compiled with the latest tag

#

not the head of main

#

and the latest tag in 7.x is just like the start of 7.x

onyx hinge
#

For now use .py files. if you use circup, you can circup install --py.

jaunty juniper
#

I had to compile libs myself to test a neopixel on latest on a QT PY, I had Memory errors with the .py

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

PWMOut is no longer in pulseio as of 7.0.0. pulseio is still large, and we cannot make dynamic USB descriptors and some other new things fit on smaller boards without removing something larger.

I am only removing pulseio from non-CIRCUITPY_FULL_BUILD boards. So it will remain on CPX, which has IR transmit and receive. I hope dynamic USB and the other new things will then fit. pulseio could be restored on some other boards if I have forgotten its utility on them.

(I was think...

manic glacierBOT
manic glacierBOT
#

I've spent the evening playing with my Neo Trinkey and have had a not-fun time tracking down issues like the ones mentioned here. It's a cute little board, and I was doing some fun things like touch pads to simulate keys through the hid. Then I wanted to change colors by sending character command through the serial port. Using supervisor.runtime.serial_bytes_available was non-intuitive at best, but I found it. It would be nice if serial_bytes_available returned a count instead of a bool...

manic glacierBOT
manic glacierBOT
lone axle
manic glacierBOT
manic glacierBOT
#

I'm not a fan of the common configure_usb design because it makes them equally vague. I think it'd be better to have interface specific functions like storage.disable_usb_drive(), usb_midi.disable(), and usb_cdc.configure_interfaces(). I think this will make the boot.py code more readable.

I was thinking of something like usb_midi.configure_usb(enabled=True, interface_name_prefix="My Own MIDI"), etc. I would add more keyword arguments in the long run. I was trying to keep the c...

#

FYI, flash space used for this: It is about 2900 bytes, and that includes always including support for both CDC channels. Removing support for the data-only channel would not save very much. I looked at whether anything was exceptionally large, and there isn't anything that's terrible: it's very roughly 1/3 API, 1/3 descriptor construction and management, and 1/3 support for user-defined HID devices.

solar whale
#

Is it now necessary/recommended to recompile mpy-cross when ever pulling in the latest MP merges or is it updated fully as part of the pull?

tulip sleet
#

the pre-built mpy-crosses can be used. Is that what you mean?

solar whale
#

so a prebuilt version is part of the repo - not just the source.

tulip sleet
#

there is no executable in the repo, but we re-build mpy-cross on every PR build, and upload it to the link above

solar whale
#

OK - but I should rebuild it in my clone of the repo for build things locally.

#

make -C /mpy-cross

tulip sleet
#

no, you can just download from the S3 link above if you don't want to rebuild it. That would be the same as building locally.

#

if there's an mpy-cross in your clone, it's just left over from the last time you built it. It's not part of the pull

#

just like any board build is left over

#

we don't commit any mpy-cross executables

solar whale
#

ok -- got it - that makes sense -- executables are not usually checked in - my "workflow" uses a locally built verison -- especially when building boards with "frozen libs"

tulip sleet
#

you could build it locally or you could download the corresponding one from S3; your choice

manic glacierBOT
#

Another thing to consider is whether this will work in the longer term where some interfaces are disabled and others are enabled. It might be better to set them all at once so you have one source for errors. What would happen if someone tries to enable too many things at once?

You run out of endpoints. I throw an exception in that case, but it would be at the end of when boot.py runs, hmm, so maybe you wouldn't see that error. I need to try that and see what happens to the exception.

solar whale
#

I asked because the "building CP " guide has you doing the make -C mpy-cross as the first step. If you pull in a modified mpy-cross you should rebuild it as well.

manic glacierBOT
#

I need to try that and see what happens to the exception.

If I can't literally throw an exception, I could still write an error message to BOOT_OUT.TXT. Or I could go into safe mode with a new safe-mode reason like "USB configuration error: too many devices" or something like that.

I am a little wary of mashing all the settings together because it would make that single call be unwieldy.

tulip sleet
solar whale
#

It has not changed in a long time -- and as I understand it, it will change a few times over the course of the MP updates. A note may save some confusion -- but probably not ๐Ÿ˜‰

#

Do you recall offhand where the frozen libs are built (is it in one of the Makefiles?) I 'm not finding it and wanted to see what it used for a path to the mpy-cross.

tulip sleet
solar whale
#

ah -- so it does use the version in your local repo

tulip sleet
#

oh, sure, you have to build it or something like the CPX build will fail

solar whale
#

yup -- and many others

tulip sleet
#

(and if you forget to build it and the CPX build fails, then you need to do a clean build or else you get strange errors)

solar whale
#

I have been doing make -C mpy-cross/ clean; make -C mpy-cross/ as well as make ... clean; make for any build...

#

the annoying case is if you build it with the old mpy-cross executable, it may build, but it won't load!

tulip sleet
#

ideally it should rebuild mpy-cross automatically, but it's hard for mpy-cross to know what's a significant change, so it doesn't. There are many changes that would force an mpy-cross rebuild unnecessarily.

solar whale
#

it's not a perfect system... I raised it only to hopefully avoid some confusion that is bound to occur going forward.

#

Once the MP merges are done, it probably won't change again for a long time.

solar whale
#

Nice! Thanks!

#

Now, we'll see if anyone reads it ๐Ÿ˜‰

#

I'll admit to not having reviewed the guide for a long time and recently found it had changed significantly (all improvements!) I now try to review it more frequently and when something breaks!

fossil gorge
manic glacierBOT
fossil gorge
manic glacierBOT
manic glacierBOT
#

The pirkey_m0 is not "completely" useless, but it is a challenge. I managed to get a couple when they were briefly available from Digi-key. The only thing I've used it for is as a simple 2FA helper. I store my GitHub key on it and have it send it when I push a button on my ir-remote. It works but I have no objection to support for it being dropped. I've already replace it with a new-trinky so I can send the 2FA key by touching the trinket and the new rp2040 version sounds much better. It was ...

#

Hopefully, this issue is of relevance here. My apologies if this is an issue which should not have been raised here.

Hi,

At the moment, on my setup, at least, it is not possible to build mpy-cross.

It has been building up until, and including 43840363c2ac1709ff0ed456f042a7b31c82db41
After, and including 76033d5115889d779debfddc14c6990df31de799, building fails with the following error:

make: Entering directory '/home/john/code/circuitpython/mpy-cross'
`
Use make V=1, make V=...

manic glacierBOT
#

Thanks for your reply. :)

I took a look at that last night. I was unsure as to where to apply the fixes mentioned and remain so.

As I said, if I checkout at the earlier merge, all is well. All is not well after the merge of MP 1.11, so something has changed which breaks things now.

Interestingly, I am able to build mpy-cross from the downstream micropython.

Hopefully, that didn't come across as a bit sharp, as that's certainly not my intention. :)

p.s Love my three Feather 2040s! :)

manic glacierBOT
#

Just curious, can I still save some space by completely disabling things like USB MIDI at compile time?

Yes, CIRCUITPY_USB_MIDI, CIRCUITPY_USB_CDC, CIRCUITPY_USB_HID, CIRCUITPY_USB_MSC can all be set to 0 to turn them off completely. CIRCUITPY_USB_CDC turned off may need a little more work: I haven't tested it thoroughly. I have definitely turned of MIDI to get a build to work on a small board.

manic glacierBOT
#

Adafruit CircuitPython 7.0.0-alpha.1-815-ged374a89f on 2021-04-24; Fluff M0 with samd21e18

The following code:

import busio
import board

uart = busio.UART(tx=board.RX)

results in:

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

You are in safe mode: something unanticipated happened.
CircuitPython core code crashed hard. Whoops!
Crash into the HardFault_Handler.
                                 Press any key to enter the REPL. Use CTRL-...
manic glacierBOT
manic glacierBOT
manic glacierBOT
lone sandalBOT
manic glacierBOT
#

Hi,

This is a really esoteric issue, but I was looking through the code and found this line: https://github.com/adafruit/circuitpython/blob/e6dc3e4686c74ad1828d07475194fc45e8f65ab0/ports/atmel-samd/common-hal/analogio/AnalogOut.c#L87

However, in the datasheet here: https://ww1.microchip.com/downloads/en/DeviceDoc/SAM_D21_DA1_Family_DataSheet_DS40001882F.pdf

Section 47.6.3 does not exist (section 47.6 does, but that is the document revision history which doesn't have anything relevant...

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

@dhalbert It appears that my problem arises long before the serial connection; even if I add some blinking into port_init(), it doesn't run in my microbit_v2 build.

Looking in my firmware.elf.map, I see:

Memory Configuration

Name             Origin             Length             Attributes
FLASH            0x0000000000000000 0x0000000000080000 xr
FLASH_MBR        0x0000000000000000 0x0000000000001000 xr
FLASH_SD         0x0000000000001000 0x0000000000026000 xr
FLASH_ISR   ...
lone sandalBOT
main furnace
#

Should I write an issue to go along with my pull request?

manic glacierBOT
#

In #4697 a user mentioned using a version of mpy-cross built from micropython sources with CircuitPython. I don't think we ever guaranteed that the format of .mpy files was the same as our base version of micropython, though this has been true for a long time. I believe this will change with #4693, as we renumbered some of the flags in runtime0.h.

The .mpy file begins with two bytes: ASCII 'M', and then the bytecode version number (currently 4, will become 5 soon). I see two main ways...

onyx hinge
#

@lone axle what was the source for the folder & file images in the screenshot-maker?

#

or, more to the point, I want to add the proper license declaration

#

I guess there's a .license file, it's just not spdx-style

lone axle
manic glacierBOT
lone axle
onyx hinge
#

thank you!

manic glacierBOT
still zephyr
idle owl
#

@still zephyr Thank you for letting me know. If @lone axle is up for it, he can work with you to update guides as you update the documentation examples. Foamyguy, are you interested? It's ok if you don't have the cycles, we'll go another route in that case.

lone axle
still zephyr
#

No problem, I will go back then and review as it was originally the plan, and the make a list, if that is ok?

#

oh i see

idle owl
#

Thanks @still zephyr and @lone axle!

still zephyr
#

@lone axle there is some that has been done already, and other that I will revise soon

#

Do you prefer a complete list or as they come?

lone axle
still zephyr
#

@lone axle Will do a Gist tonight and share the link here with a Ping,

#

Thanks both of you ๐Ÿ™‚

lone axle
#

perfect! thank you as well!

turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

58

Voice Channels

6

Members

28887

Roles

34

onyx hinge
#

weeeeird, if I scroll waaaay down the page they're there

#

@tulip sleet is it possible this is something to do with how your directory lister works? like, is it paginated by s3 in a different order than it's displayed?

#

can we fix it by moving old files to a sub-folder?

#

and by "we" I mean someone with s3 knowledge & permissions ๐Ÿ˜‰

idle owl
#

I was getting it from the source because I couldn't find it.

#

I don't know what's going on, I forgot to look into it on Friday.

onyx hinge
#

yeah I was able to get what I need

#

it's just weird

tulip sleet
#

it's just alphabetical, I think

idle owl
#

It wasn't until 2 weeks ago though.

#

That's why it's odd.

idle owl
tulip sleet
#

delete 2020?

#

and older?

jaunty juniper
#

oh there's 2 lists and I see no rime or reason why a thing is in one and not the other

onyx hinge
#

s3 lists the files by an arbitrary or alphabetical order, then the lister script puts them in timestamp order. If s3 requires two API calls to list all the files, it's treated as a whole second list. At least, that's the story that the second header mid-file is making me tell myself.

idle owl
# tulip sleet delete 2020?

I guess that's ok? I mean, the thing is, some folks don't know about the CP Weekly notes. But I guess they probably don't know about this bucket either.

tulip sleet
#

I will check the lister. The lister script we got from somewhere else; it is kind of a mess

idle owl
#

Yeah I guess that's fine.

onyx hinge
#

surely the 2019 and older files can be removed

#

I don't know who will refer back to them later

jaunty juniper
#

ah it hits the page limit in the middle of listing circuipython files

onyx hinge
#

but .. they could also be moved to an archive folder or something

tulip sleet
#

I could put them in an OLD/ directory

idle owl
#

That would also work

tulip sleet
#

I'll do that for now, and we can discuss whether to keep them

onyx hinge
#

I guess there aren't a lot of 2019 files are there, must have already culled them once

#

thank you Dan!

idle owl
#

@tulip sleet That Mu feature where you don't need VID/PID is in, correct? So I do NOT need to add something to a guide about making a PR to Mu for your board?

tulip sleet
#

right

idle owl
#

thanks

#

I've been sitting on guide feedback to that effect for a while here.

tulip sleet
#

it will work as long as there's a CDC connection. If there isn't, it will not work

idle owl
#

deletes

tulip sleet
#

I can also make it check for MSC only, but that's a rare case

idle owl
#

This was someone saying we should include something in the Add your Board to CP guide about PRing to Mu when you do.

#

We do not need to do that at this point.

slender iron
tulip sleet
#

@idle owl @onyx hinge adabot reports now cleaned up. All but latest April and May are now in OLD/

onyx hinge
#

@tulip sleet thank you!

#

@slender iron are there more merge-related problems you know about? I think I got the ones I know about.

slender iron
#

not that I'm aware of. I'm not caught up on email though

onyx hinge
#

okay

slender iron
#

I'm hoping to have the first pass merge of 1.13 today

manic glacierBOT
manic glacierBOT
onyx hinge
still zephyr
#

@idle owl created this PR with a checklist to verify in the libraries, could you take a look and tell me if I am missing something, just to want to make double check thanks ๐Ÿ™‚

idle owl
#

It has the things I can think of.

still zephyr
#

No problem, ๐Ÿ™‚ I would start veryfing and adding accordingly.

thorny jay
#

I don't know if it apply here, but when a library change something, there is the check to see if it break existing learn guide. If it is new, then it does not apply (well except if some learn guide could benefit from using that new library).

still zephyr
#

yes, this will apply, and Foamyguy will do the check after

#

I included in the cheklist to add to the list that we will have together

lone axle
#

I don't think there is any automated check for that but when we update libraries in a way that breaks the old API we check the learn guide repos to find instances that need to be updated.

turbid radish
#

lurking

sterile bronze
#

lurking

lone axle
lone axle
cobalt grail
lone axle
#

This project uses the Circuit Playground Express to create a visual thermometer. The current temperature is measured and represented with LEDS. Using Circuit Playground Express is a great way to start programming a microcontroller and components. The Playground Express contains components on one small board; including 10 NeoPixels, motion sensor...

turbid radish
#

GIF: G-if (hard G)

#

No worries

idle owl
#

If I remember correctly, the original author does not agree. ๐Ÿ˜„

ionic elk
#

it's a holy war

slender iron
#

let people say it however they like

thorny jay
#

I say PNG...

turbid radish
#

๐Ÿ˜† ๐Ÿ˜‚

ionic elk
#

tabs vs spaces, emacs vs vim

turbid radish
#

No one can get out of vim

ionic elk
#

Jiraffe vs Giraffe

cobalt grail
#

I am a power user. I know how to quit VI.

turbid radish
#

:q! doesn't do what you think it does

ionic elk
#

I just know because git trapped me in it so many times that eventually I didn't have to google it anymore

cobalt grail
#

I just care about what :wq! does. ๐Ÿ™‚

#

If I don't want to save the file, I just reboot the computer,

modern wing
#

๐Ÿ˜ผ

idle owl
#

I know!

trim elm
#

lurking

#

jk not lurking for status updates

thorny jay
#

Not in public, in PM.

trim elm
#

Oh, sorry, haven't been to one of these in a while

solar whale
#

OV7670 is very cool!

turbid radish
#

THANK YOU SO MUCH KATTNI!!

idle owl
#

You're entirely welcome, @turbid radish!

#

@mental nexus We want to know what you're up to, CircuitPython or otherwise! Doesn't have to be CP-specific.

mental nexus
#

Thanks Kattni. Will keep making brief updates here until I get other notice!

idle owl
#

Please do ๐Ÿ™‚

mental nexus
#

โ˜•

slender iron
#

the TLF progress will be helpful for CP debugging

mental nexus
#

CGrover the coffee scale looks really cool.

errant grail
#

@mental nexus Thanks. It's on hold for a while to permit completion of other projects. Hope to wrap it up in a couple of weeks.

lone axle
turbid radish
#

๐Ÿ‘

idle owl
#

@trim elm There's a bunch of reasons for the auto-reloads. What OS are you on?

trim elm
#

Linux

#

Ubuntu to be specific. I'm using screen for my serial console

thorny jay
turbid radish
#

Will be in the newsletter

idle owl
#

What's the specific issue you're having?

trim elm
#

Hmm

#

Yeah, so basically I get auto reloads a lot. Seems to mostly happen in loops that are running without a time.sleep or with a really short one

idle owl
trim elm
#

Pretty much every board. It was something I remember running into the first time I ever used CircuitPython in 2018 on a Feather M0, but I'm currently running into it on the Funhouse

idle owl
slender iron
trim elm
#

Yeah, that's exactly it

idle owl
#

I think it's an issue if it's happening when the board is stand-alone, but while it's connected to your computer, it can happen.

trim elm
#

Yeah, it never happens when it's stand-alone

ionic elk
#

@slender iron that's the supervisor bug I got started on this past week ๐Ÿ™‚

idle owl
#

Then it's expected behavior. Unfortunately or otherwise ๐Ÿ˜„

ionic elk
#

I didn't get super far into it but I'm on it ๐Ÿ‘

trim elm
#

I think at one point someone said that I had to run some command after copying files and that fixed it, but I do not remember what the command was

manic glacierBOT
ionic elk
#

Oh no wait it isn't, I got mixed up. But I'll check it out, looks related?

trim elm
#

I think it had something to do with the files being copied and the computer doing something weird with the drive a bit after that

ionic elk
#

whoops

turbid radish
#

Windows generally doesn't touch the drive except writes. AV software perhaps or Mac trash etc

trim elm
#

Yeah, I don't think I've ever really used windows for programming, so I'm not sure if it happens there.

tulip sleet
#

Some third-party utility programs, anti-virus scanners, or innate OS indexing programs can touch the drive and do writes to it.

jaunty juniper
trim elm
#

Interesting

#

Yeah, I think it had to do with an OS indexing program, but the solution I was told was like 2 years ago and sadly I did not write it down

turbid radish
mental nexus
trim elm
#

Ok. That'd definitely work, but I still like auto reload for when I copy new files

cobalt grail
#

CircuitPython_Org_Xxxxx?

thorny jay
#

Something that start with org ... is really java and could trigger nightmare for some that migrated to Python for a reason.

cobalt grail
#

Agreed. Avoid copying Java stuff! ๐Ÿ˜ฌ

#

CircuitPython_Community_Xxxxxx

errant grail
#

Perhaps?

slender iron
idle owl
#

@lone axle You're not muted.

lone axle
#

Thank you

errant grail
#

FunHouse has an integral 240x240 display.

#

A useful size.

trim elm
#

Yeah, and it's also pretty small so the pixels look amazing

errant grail
#

The integral displays are usually on their own SPI or parallel ports. Helps with display performance.

thorny jay
#

240x240 is like on all of the other board: Gizmo + Clue + ...

modern wing
#

Thanks!

turbid radish
#

Thanks all

thorny jay
#

So that is easy to test on the presentation.

errant grail
#

Thanks!

mental nexus
#

Thanks all!

trim elm
#

Thanks!

lone axle
#

Thanks all ๐Ÿ‘‹

idle owl
#

@onyx hinge I'm running next week. FYI.

modern wing
#

I write it down.....and I forget I wrote it down....

onyx hinge
#

Here is the notes document for 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/1R2Qq9dAKqrAh0wFuu1-X7r9HgPJf1bgLz45fklJHmfo/edit?usp=sharing

tulip sleet
#

the "fix formatting"? That's a mistake on my part. The gc_make_long_lived() wrapped in the file comparator, and I thought it was on the next line.

slender iron
#

๐Ÿ‘

manic glacierBOT
manic glacierBOT
#

I'm not a fan of the common configure_usb design because it makes them equally vague. I think it'd be better to have interface specific functions like storage.disable_usb_drive(), usb_midi.disable(), and usb_cdc.configure_interfaces(). I think this will make the boot.py code more readable.

I was thinking of something like usb_midi.configure_usb(enabled=True, interface_name_prefix="My Own MIDI"), etc. I would add more keyword arguments in the long run. I was trying to keep...

tulip sleet
#

@slender iron did you see this PR from @onyx hinge to tannewt/circuitpython?

#

i was trying to compare your force-push old commit with the new commit to see the new changes-- haven't succeeded at doing that yet

manic glacierBOT
#

So I think you're suggesting this:

storage.disable_usb_drive()
storage.enable_usb_drive()
usb_midi.disable()
usb_midi.enable(interface_prefix="My MIDI")

For CDC, not sure about circuitpython, since it doesn't connote that much. How about primary? or maybe std or stdin_stdout?

usb_cdc.disable()    # disable completely
usb_cdc.enable(primary=False, data=True)
usb_hid.set_devices((device,...))
slender iron
tulip sleet
#

i figured out the changes -- github said "outdated file" and that was the clue

slender iron
#

that issue is very old

tulip sleet
#

yeah, i thought it was misplaced. i was just surprised to see issues and PR's in tannewt

#

it was only because I went to tannewt/circuitpython to do the compare

slender iron
#

I think I did the flag renumber already

manic glacierBOT
slender iron
#

ok, pushed the last array fix

manic glacierBOT
tulip sleet
slender iron
#

I think it had finished already

tulip sleet
#

you're right

#

i took a break for a snack

slender iron
#

good idea though ๐Ÿ™‚

#

I just had lunch and didn't expect it to be done either

tulip sleet
#

i clean up the jobs a lot when I'm impatient ๐Ÿ™‚

#

also ever since i found out it might cost $15 if we were paying ๐Ÿ™‚

slender iron
#

ya, I think it's a good idea if you think of it

thorny jay
#

Hi @onyx hinge you wanted to find the bilinear interpollation discussion... but that was in PM. So for the record, here is the fully working code that
@lapis hemlock shared with me (and I shared with @errant grail).
This was with a lot of discussion before and optimisation after.

b = array(range(n * n)).reshape((n, n))

a = zeros((2*n-1, 2*n-1))

a[::2,::2] = b
a[1::2,::2] = 0.5 * (b[:-1,:] + b[1:, :])
a[::2,1::2] = 0.5 * (b[:,1:] + b[:,:-1])
a[::2,1::2] = 0.5 * (b[:,1:] + b[:,:-1])
a[1::2,1::2] = 0.25 * (b[:-1,1:] + b[1:,:-1] + b[1:,1:] + b[:-1,:-1])```
manic glacierBOT
#

So I think you're suggesting this:

storage.disable_usb_drive()
storage.enable_usb_drive()
usb_midi.disable()
usb_midi.enable(interface_prefix="My MIDI")

For CDC, not sure about circuitpython, since it doesn't connote that much. How about primary? or maybe std or stdin_stdout?

usb_cdc.disable()    # disable completely
usb_cdc.enable(primary=False, data=True)
usb_hid.se...
#

I think you want disable and enable for usb_hid as well because you may want to disable it.

I was going to disable if the device list was empty, but I forgot to do that. Are you saying never mind usb_hid.set_devices(), just:

usb_hid.disable()
usb_hid.enable((device, ...))
# or
usb_hid.enable(devices=(device,))  # could be a required keyword arg

I think that makes sense.

still zephyr
#

Jeff Thanks for hosting , your voice sounded different today ๐Ÿ™‚

still zephyr
#

@lone axle as discussed I will start putting the learning guides to be updated here:

#

Thanks ๐Ÿ™‚

lone axle
#

perfect Thank you ๐Ÿ™‚

solar whale
#

Does anyone know why MISO/MOSI/SCK are present on the same Pins as D5/SDA/SCL on the Feather RP2040? Will this preclude using I2C0 and SPI0 at the same time?

#

Ah - I see that SDA/SCL are I2C1 not I2C0 -- the Stemma is I2C0 -- this is confusing -- but it does conflict with the use of D5....

idle owl
#

@solar whale I provided the pin information multiple ways. There's so much information to convey with the RP2040. Complex is kind of the only option there.

slender iron
#

1.12 is merged!

manic glacierBOT
tidal kiln
#

@solar whale i think those other designations relate to the RP2040 itself, since I2C/SPI can move around. but for the feather pins, there should be no conflicts. MOSI is on physical pin 30 and a D5 is on physical pin 9.

solar whale
#

But there was clearly a conflict with D5 and MOSI

#

and it says MOSI is on the MOSI pin and on D5

tidal kiln
#

where?

solar whale
#

but as in the forum post, D5 dis not work as the CS pin

#

you are correct, it is not in pins.c so I am very confused....

tidal kiln
#

the RP2040 SPI0 MOSI can show up on Feather pins MOSI, D5, or, SCL

solar whale
#

right -- so D5 is not available as aGPIO if SPI is in use. That is not "normal" on a feather.

#

it seems like MOSI is on MOSI and D5

tidal kiln
#

does RP2040 SPI activity show up on all pins at once?

solar whale
#

I have not looked. ... yet. I just found that D5 would not work as the CS pin for the rfm69 under test.

tidal kiln
#

same should be true for any SPI peripheral then? (don't have rfm handy, but do have BME280)

solar whale
#

agreed -- if you have time try it.

tidal kiln
#

yah. issue seems odd. i'm curious.

solar whale
#

I can try that as well

#

I have an spi fram handy -- will try it

hollow token
#

I did do this on the regular pico

#

You can use the GPIO on a pin as long as that pin itself isn't being used in SPI/I2C operations

solar whale
#

that is problematic and not the same as other feathers.

tidal kiln
#
Adafruit CircuitPython 6.2.0 on 2021-04-05; Adafruit Feather RP2040 with rp2040
>>> import board
>>> import digitalio
>>> cs = digitalio.DigitalInOut(board.D5)
>>> import adafruit_bme280
>>> bme = adafruit_bme280.Adafruit_BME280_SPI(board.SPI(), cs)
>>> bme.pressure
1009.7
>>> 
#

i'm gonna grab an RFM and try that as well. in case it's something specific to that.

solar whale
#

hmm -- the FRAM works as well -- so false alarm -- now to concetrate on why the rfm does not work.

tidal kiln
#
Adafruit CircuitPython 6.2.0 on 2021-04-05; Adafruit Feather RP2040 with rp2040
>>> import board
>>> import digitalio
>>> import adafruit_rfm69
>>> cs = digitalio.DigitalInOut(board.D5)
>>> reset = digitalio.DigitalInOut(board.D6)
>>> rfm69 = adafruit_rfm69.RFM69(board.SPI(), cs, reset, 915.0)
>>> 
#

now going to try per forum posters code...

solar whale
#

did 5/6 work for you?

tidal kiln
#

yep. see above.

solar whale
#

oh --yuk -- I have my feather plugged into a tft feather wing -- it has the conflicts!!!!

#

nevermind--- D5/D6 are fine ....sigh -- sorry about that

tidal kiln
#
Adafruit CircuitPython 6.2.0 on 2021-04-05; Adafruit Feather RP2040 with rp2040
>>> import board
>>> import busio
>>> import digitalio
>>> import adafruit_rfm69
>>> RADIO_FREQ_MHZ = 915.0 
>>> CS = digitalio.DigitalInOut(board.D5)
>>> RESET = digitalio.DigitalInOut(board.D6)
>>> spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
>>> rfm69 = adafruit_rfm69.RFM69(spi, CS, RESET, RADIO_FREQ_MHZ)
>>> 
#

also works

#

no worries. just nice to know why.

#

i see something. i'll respond in thread.

#

forum thread

solar whale
#

Thanks!

#

We now return to our usual programming ... ๐Ÿคฆ

#

@slender iron so far have tried the MP 1.12 merge on a feather_rp2040 and on an esp32s2 Funhouse. No problems other then my confusion above....

slender iron
#

great!

hollow token
#

I should get some of my build infrastructure making me these PRs to flash onto my pico. I love the features that will/might be in 7.x

solar whale
hollow token
#

I know, I'd rather have local builds available to me

solar whale
#

Me too...

hollow token
#

I already have a local debian x86 and x64 package mirror and some PXE images for my VMs, plus I already use GitLab mirroring so putting in some patches to allow localised CICD runs shouldn't be too hard.

#

AKA, I have the technology :P

solar whale
#

Not sure what CICD is?

ornate breach
#

Continuous development continuous integration

#

Swap those around

solar whale
hollow token
fossil gorge
fossil gorge
#

*ahem* successful builds!

solar whale
#

@onyx hinge FYI - I built CP for the RP2040 pico and the GCM4 with the MP 1.12 merges and tried the OV7670 examples. It works OK on the RP2040, but fails (safe mode) on the GCM4. Even the OV7670_simpletest goes to safe mode on the GCM4... I'll do more testing tomorrow and open an issue if I can't resolve it but just wanted to let you know.

hollow token
#

I wonder if I can get an automated testing rig to test builds on actual devices for PRs.....

onyx hinge
#

@solar whale yeah there's something haunted on grand central. I just don't know what. Nothing's made sense yet. It's not even the camera capture code because that doesn't get run before the hardfault occurs. I don't even think it's "due to" code changes, for me this hardfault while setting up the camera has been coming and going the whole time I've worked on the project.

solar whale
#

Yes - I am having issues even getting previously working builds to run now....

#

Time for bed... ๐Ÿ’ค

onyx hinge
#

I'm sure someone will figure it out. Doesn't seem to have affected the aduino version...

ornate breach
manic glacierBOT
thorny jay
# slender iron this is where we try to compare feathers: https://learn.adafruit.com/adafruit-fe...

Ok, that guide is not helping me, nor "Michael (Mike) Horne" that I try to help. The guide does not know about the Feather RP2040 no the FeatherS2 so it is lacking behind. I don't find yet @idle owl buying guide that was listing various board and benefits of each. One useful information for me would be the memory available once CP run (the output of import gc gc.collect() print(gc.mem_free()) once the board is booted.

#

And then the same thing with the full library set and big board specific library (like for PyPortal or FunHouse or ...)

#

Just like a C64 computer would display the available memory at boot prompt on top of the screen. ๐Ÿ™‚

onyx hinge
#

@lone axle will you have a chance to look at https://github.com/FoamyGuy/CircuitPython_Library_Screenshot_Maker/pull/2 today? I'd like to get this merged, then move the repo into the circuitpython organization so I can continue with the steps that I need to do in the Learn repo.

GitHub

This

removes the HTML generator entirely

I could put it back but I didn't feel like figuring out reuse-compliant license statements for it
but I don't think we're going to...

solar whale
onyx hinge
#

but it's the not crashing trick I'd like to figure out

lone axle
onyx hinge
#

@lone axle I appreciate it, thank you

onyx hinge
#

@lone axle thanks for merging that. Now can you transfer it into the circuitpython organization?

lone axle
onyx hinge
#

great, that lets me do my next step.

lone axle
#

Sorry I didn't transfer back when I merged ๐Ÿ™. Thanks again for all of your help on it

idle owl
#

Is this a valid command? pylint Adafruit_Feather_RP2040/*/*.py Will it run Pylint on all files in all subfolders of the indicated directory? Or does it only think it does. (It passed running it that way, and passed running it specifically on the individual files, so I can't really tell if it ran properly.)

onyx hinge
#

@idle owl yeah. You could change "pylint" to "echo" and that will show you what files are listed

idle owl
#

Oh neat. Thank you.

slender iron
#

welp, I think I messed up the git history with my merges

still zephyr
#

mmmm @fossil gorge ?

fossil gorge
still zephyr
#

jajaja

fossil gorge
#

Figment of a collective society's imagination! ๐Ÿ˜„

still zephyr
#

no it was for scott message

#

if someone could help with git it is you or nis

fossil gorge
#

Maybe, but I don't know... Scott's quite the power-user with Git.

still zephyr
#

worth the try ๐Ÿ™‚

#

at least we chat

#

@idle owl I will submit I think the last update to the design guide, that includes the code usage template, do you think that we are missing something?

idle owl
still zephyr
#

Ok, no problem just making sure, when we started you said small updates, so hope not bothering you with that granular ๐Ÿ˜†

idle owl
#

Not at all!

still zephyr
#

I would like to cover requirements vs mock the docs vs sphinx intermapping but I do not think it is the right place

idle owl
#

Hmm yeah. Agreed it's worth covering, but perhaps not there.

still zephyr
#

We could create another document like how to, to do some libraries management

#

pypi, releases, readthedocs, requirements, thath kind of stuff

idle owl
#

I mean, there's a guide for that.

still zephyr
#

๐Ÿ˜ฎ

idle owl
#

Some of it anyway.

still zephyr
#

could you point me in the right direction

#

ahhh yes, could I add stuff in there?

#

that is scott guide

idle owl
#

I don't see why not. I can add you as a contributor to give you access.

#

We've all contributed to it at this point. Scott authored the initial guide.

still zephyr
#

good thanks Kattni ๐Ÿ™‚

idle owl
#

Please create new pages, and then have us review them before they are made live, since the guide is already live.

#

Because once we click "Publish", the page is immediately visible to the public.

still zephyr
#

gotcha I ask questions before anything

#

no publish ๐Ÿค gotcha

idle owl
#

@still zephyr Wait, have you done any editing in Learn yet?

still zephyr
#

Nope

idle owl
#

Ah! Ok. That makes things a little different. I'll DM you.

still zephyr
#

ok

idle owl
blissful pollen
#

Um I thought I approved it but not letting it merge...

idle owl
#

@blissful pollen Is it not letting you actually approve the PR? Hmm.

#

Did you click the "approve" radio dial in the dialogue box?

#

nm, Dan got it. But I think you got it the second time.

blissful pollen
#

I thought I had...

tulip sleet
#

that is odd; I saw that too, so I went ahead and approved it too

blissful pollen
#

If it happens again I'll let someone know, never had that occur before. The comment even says "gamblor21 approved these..."

idle owl
#

Yeah I saw that.

#

But it also said "left a comment" so it seemed contradictory.

#

Yeah let us know if it happens again.

blissful pollen
#

"gamblor21 approved this but git doesn't trust him so have someone else look at it" ๐Ÿ™‚

jaunty juniper
#

the tooltip on the grey checkbox says "Only reviews by reviewers with write access count toward mergeability"

#

(as opposed to dan's green)

tulip sleet
#

yes, I was just making a screenshot

#

CircuitPython Librarians doesn't have write access to the Learn Guide repo, I guess

idle owl
#

That's odd, because I can add them as a reviewer.

#

I thought they could only be added if they had access.

#

Hmm ok. I guess I'll keep that in mind moving forward, or look into whether we want to add write access for that team.

tulip sleet
#

for the Learn Guide repo, Librarians only have read access

idle owl
#

I'll ask Limor if that's deliberate.

slender iron
#

my 1.11 and 1.12 merge commits only have one parent which makes them not merges

lapis hemlock
#

If would be really great, if ulab behaved in the same manner under micropython as in circuitpython.

onyx hinge
#

@lapis hemlock I don't know, is it the same or different than how we did it in circuitpython? i.e., is it "just" back-porting our code to MP?

#

oh I read a bit further down

#

that code link is not helping me at all, it's extremely long

lapis hemlock
onyx hinge
#

if micropython has its own way of doing properties, we'll probably be able to use it after the related code gets merged.

lapis hemlock
#

micropython doesn't really work with the concept of properties, that is the snag.

onyx hinge
#

py/obj.h: mp_attr_fun_t attr; we do seem to have this in our type objects, you're welcome to try it

lapis hemlock
#

If you search for mp_lv_color32_t_attr, there is only one place in the code, where it pops up.

lapis hemlock
onyx hinge
#

Well, not me personally

lapis hemlock
#

It doesn't matter, who it was, they had a reason.

#

Perhaps, the fundamental question is, what attr is meant for.

onyx hinge
#

@slender iron I dunno if you want to drop in and supply any history of why we coded our object properties like we did

lapis hemlock
#

I could definitely add the pointer to .attr, and circuitpython would still have the option to do it via proxies. I wouldn't really mind.

#

The way it is used in the code example is really reminiscent of the concept of the proxy.

onyx hinge
#

My impression of the "attr" code vs the style we adopted is that our style makes properties more "table driven" and probably reduces code size when you have many of them. Plus it naturally drives you to keep each setter separate from the others (they have to be different functions), making cleaner code. It would be interesting to compare the binary size of (say) 100 CP-style properties vs a micropython .attr that supports 100 attributes

lapis hemlock
#

Plus it naturally drives you to keep each setter separate from the others (they have to be different functions), making cleaner code

#

This is a good point, and should not be overlooked.

#

On the other hand, I could live with the notion of a beauty plaster for micropython.

onyx hinge
#

py/objgenerator.c: .attr = gen_attr, circuitpython has .attr so maybe you can try it out on both

lapis hemlock
#

OK, will do.

onyx hinge
#

or maybe you could implement a ".attr" that implements the behavior you want, but still based on the class's dict.... hmmm

#

๐Ÿค”

#

it would be nice if you can find a way to get properties in MP, that'll make it more like standard Python for your users no matter which implementation (MP vs CP) they're using

lapis hemlock
#

Oh, you mean like a universal attr function?

onyx hinge
#

yes

lapis hemlock
#

I will try to explore the idea.

#

Don't be surprised, if I ping you on github ๐Ÿ˜‰

ionic elk
#

I have somehow made my Circuitpython drive into a read-only filesystem

#

will storage.remount("/", False) have that effect?

jaunty juniper
#

yes that's what it does (from boot.py)

ionic elk
#

Isn't the second parameter for readonly: bool = False? Or am I misreading these docs?

jaunty juniper
#

readonly from Circuitpython

ionic elk
#

how does turning readonly to false turn it on?

jaunty juniper
#

I guess that was the question: it is read only from where ?

idle owl
#

False makes it readonly by you. And read/write by CircuitPython, iirc.

ionic elk
#

that seems a little misleading

jaunty juniper
#

yeah it's readonly from the point of view of the code

idle owl
#

I learned this because I omitted the boolean the first time around and it was doing what I wanted it to, but I didn't know why.

jaunty juniper
#

and yeah there could be a more explicit way to express that, nobody ever remembers which is which ๐Ÿ˜‰

#

(on first try)

ionic elk
#

I just don't like functions that make me have to erase my filesystem

#

especially when they don't say that upfront

jaunty juniper
#

did it do that ?

idle owl
#

Can't you remount True?

ionic elk
#

I mean it made the whole drive read only

jaunty juniper
#

you can boot in safe mode or erase boot.py from the REPL

idle owl
#

Oh, you didn't make it do it based on a trigger. I thought you could still remount from the REPL, but maybe I'm misremembering.

#

Oh right! That. Rename or delete boot.py

ionic elk
#

yeah there's probably some tricky way to do it

#

is there a command for deleting boot.py despite the drive being read only?

jaunty juniper
#

safe mode is easy except on pico

jaunty juniper
#

it's not readonly from the code, that's the point

idle owl
#

I think it's included elsewhere as well, but I knew I put it in the Pico guide.

#
    os.rename("boot.py", "boot1.py")``` or ```    import os
    os.remove("boot.py")```
ionic elk
#

ah, ok. Handy tricks.

#

Maybe a note to that effect could be added to storage.remount() docs

idle owl
#

I don't see any reason why the docs couldn't be updated.

ionic elk
#

"If the remounted drive is CIRCUITPY, this will make it read-only to the host computer. Use os.remove("boot.py") to regain access to the drive, or erase the filesystem"

jaunty juniper
#

safe mode !

ionic elk
#

or safe mode. I don't mess with this stuff so I don't know the tricks, sorry! This might not be necessary I'm just griping lol

idle owl
#

I'll include it in the Storage page for CircuitPython Essentials when I template it, so it'll start going into board guides at least.

#

Though I realise fully that would not have helped you here.

#

Simply saying I'll get it into Learn more ubiquitously.

jaunty juniper
#

since it's mostly used to enable to write to the board, I think it could be interesting to have the parameter name reflect that instead of readonly = False, something like host_can_write = False or reverse it code_writeable = True and force to use the argument name so all examples are self documenting (I know, that is a breaking change ๐Ÿ˜ฆ )

idle owl
#

Yeah, unfortunately, I think we need to fix this one in documentation.

#

If it was clearer what was made "readonly", I think it would be fine.

tulip sleet
#

@ionic elk is it read-only from the host's point of view or the code's?

manic glacierBOT
ionic elk
#

@tulip sleet the default for storage.remount(), when used on /, will make the CIRCUITPY drive read-only to the host's point of view, rendering the drive unusable until you take extra steps from the REPL. The docs say readonly (bool) โ€“ True when the filesystem should be readonly to CircuitPython. which hints that it will do this, but I think it could spell it out more clearly, as well as offer ways to regain file access.

tulip sleet
#

so you were using a remount in boot.py, right? I just wanted to make sure it just wasn't a corrupted filesystem, which the host can make read-only for safety reasons.

ionic elk
#

but ehh. it's not that important.

tulip sleet
#

e.g. I have seen a filesystem become read-only to the host out from under me due to corruption

ionic elk
#

No, there was a remount from some example code, I don't think anything is wrong here from a design perspective, I just noted there could be a docs addition

tulip sleet
#

got it, thanks; i read through everything but may have missed that. a docs improvement would be great

ionic elk
#

@slender iron do you have some LED code for me?

#

Fixed the supervisor thing

#

or I can do #3454

jaunty juniper
idle owl
#

@jaunty juniper I'm working on templating all of the CP Essentials pages. I'll include it in the new template version. But yeah, we could probably add it to that page, even though that will eventually be deprecated.

jaunty juniper
#

(like even following that you might put the wrong pin name and get stuck)

slender iron
ionic elk
#

That's #3454 ya

#

though actually going over my todo list I should probably wrap up my sleep profiling before I get fuzzy on the details

slender iron
idle owl
#

@lone axle Do you have a ton on your plate at the moment? Wondering whether you'd be interested in updating the Storage page in the CircuitPython Essentials guide to make what storage.remount("/", False) does clearer, and also include the few different steps discussed above (I can outline them again) available to remove boot.py and regain write access to your CIRCUITPY drive. No is an entirely acceptable answer here.

simple pulsar
idle owl
jaunty juniper
#

my vote is to always include it

#

it doesn't help much the first time, but it helps remember it once you know what it does

#

(hehe)

idle owl
#

Sounds good. I doubt we'll go back and update all project usages of it, but moving forward, we can indicate that it should be included.

idle owl
#

@lone axle Excellent. I believe the options for removing/editing boot.py once you've made CIRCUITPY readonly are safe mode (at least this was mentioned, I would suggest testing), import os os.rename("boot.py", "boot1.py")
or import os os.remove("boot.py")

#

Those are three separate things.

#

The second two are done from the REPL.

idle owl
# lone axle I'd be up for doing that

The clarification needs to be made that storage.remount("/", readonly=False) makes CIRCUITPY NOT readonly to itself. Therein lies the confusion - what was being made readonly. Does that make sense?

lone axle
#

Yep definitely. I've had the same confusion myself when I first started working with that. Ended up just trying both to figure out which is which ๐Ÿ˜…

idle owl
#

The example in the Essentials guide uses switch.value to determine whether to remount, so you'll have to explain that switch.value is True or False depending on whether the button is pressed when CircuitPython starts up. THEN explain the readonly thing.

#

Apologies ahead of time, this page will be deprecated eventually, but it's a HUGE project that will take a while, so we should still update this page for now.

lone axle
#

No worries there

idle owl
#

As in.... templates have to be created and then something like 60 guides have to be updated. ๐Ÿ˜…

lone axle
#

I will probably start those new explanations on a new unpublished page so I can get feedback before it goes live. and then once good I can copy it into the real page.

idle owl
#

That is perfect. Name the page something ridiculous that wouldn't ever be used so it doesn't eat up a URL that might be needed.

#

No idea what might need it, but still.

#

Is it accurate to say that the code in boot.py is executed when CircuitPython starts up?

simple pulsar
idle owl
#

Yeah. Like I said, heading for eventual deprecation. To be replaced by a tailored page in each board guide with code specific to that particular board, and comments like that would be included.

#

@lone axle If you could include something to the effect of what kjw suggested above, it would be appreciated. Thanks!

idle owl
#

Or do you have something better, even...

#

Also is boot.py used for anything other than this?

#

Commonly used *

#

I'm going to continue the usage of a switch/button/grounded pin in boot.py to remount the filesystem so folks can get CIRCUITPY to the proper state and THEN set it to readonly by the host machine deliberately.

tulip sleet
#

@idle owl boot.py is run when CircuitPython starts from a hard reset or a power on. It is not run on soft-reload, etc.

idle owl
#

Ok thank you

manic glacierBOT
#

PR artifact yields expected results for AUTO_RELOAD, SUPERVISOR_RELOAD, and REPL_RELOAD. STARTUP still absent on:
Adafruit CircuitPython 7.0.0-alpha.1-1006-g964f368ed on 2021-05-04; Adafruit PyPortal with samd51j20

Test code:

import time
import supervisor

time.sleep(5)
print(supervisor.runtime.run_reason)
supervisor.reload()

Result:

soft reboot

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

code.py output:
supervisor....
manic glacierBOT
#

ESP32-S2 yields all expected RunReason values under expected circumstances: STARTUP, AUTO_RELOAD, SUPERVISOR_RELOAD, and REPL_RELOAD

This may be expected, but REPL_RELOAD only arises with Control-D immediately after:
Press any key to enter the REPL. Use CTRL-D to reload.

Control-D from the >>> prompt gives:

>>> # Control-D
>>> 
soft reboot

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

code.py output:
supervisor.RunReason.SUPER...