#circuitpython-dev
1 messages ยท Page 369 of 1
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
but I think you clarified -- if the loaded version is already the latest, then loading update_bootlader.uf2 will essentiall do nothing
Thanks!
it would be good if the version numbers were in the file names...
and it looks like the combo also includes an application file (in this case, the arduino demo)
Lone CI failure is Actions flakiness.
Thanks contributors!
Sphinx syntax is not obvious; it's not markdown, though sometimes it looks like that. You'll want to try to build to docs locally to make sure any changes will work, such as the new cross-reference you propose.
I resolved the merge conflict, so hopefully this is good to go now. Thanks!
It looks like the merge conflict occurred because the section "Documentation References to other Libraries" was worked on in another PR as well.
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]
I created PR #4685 adding AuthMode class.
Once it is merged, I'll update this PR enabling setting of authmode for ap.
So 1 network will give three values?
Can we drop the PSK? All WPA modes are PSK by neture. Only Open, WEP, and Enterprise are not and they are called out uniquely. The PSK isn't meaningful by itself.
I asked hathach, who said:
- The bootloader.bin is 2nd stage bootloader,
- tinyuf2.bin is our "bootloader" that does uf2 upgrading and yes, it is 3rd stage but actually factory app https://github.com/adafruit/tinyuf2/blob/master/ports/esp32s2/README.md
- update-tinyuf2.uf2 (there is no .bin for update), is for upgrading the tinyuf2 (3rd stage), it will not able to update the 2nd stage bootloader.bin
@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.
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...
Makes sense. Last I heard he is planning to continue. If it doesn't fix it, then it would make more sense to address this issue after that is finished so it doesn't break again.
@slender iron do you want me to look into the _transmit problem?
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
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
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.
yup, that could be the spot
Yes, the plan is to merge though the current version. As there is no 7.0.0 release yet, I agree we should wait to address this issue until we're done merging MicroPython.
@jepler Is looking at this. _transmit is usually on the subclass (not PixelBuf) so it's likely a bug with the attribute lookup.
Looks good to me. Thanks!
This is the last one I see, from 23 April. https://adafruit-circuit-python.s3.amazonaws.com/bin/mpy-cross/mpy-cross.static-x64-windows-6.2.0-4-g9d8545e5e.exe
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)...
Do you have pre-commit installed? I wouldn't expect this uneven indentation to pass the code formatting check.
@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.)
# Welcome to CircuitPython 2.2.0 :)
``` huh apparently I have never done anything with this board
l. o. l. Evidently not.
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?
No
If you run NeoPixel code, where you specify a pixel, e.g. pixel[0] = (255, 0, 0), it fails with a _transmit not found type error.
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)
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...
A grand central m4 doesn't seem to be affected. 6.2.0 works on the Metro M0 Express, at least to the extent I tested it.
Ok I'm running super simple code and it's not working and I am confused. Anyone have an ItsyBitsy RP2040?
With "main"?
"main"?
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.)
I bet you've found bugs ๐
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.
oh really
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? ๐
@idle owl I do have na itsybitsyrp2040 -- do you want me to try something? may take a few minutes find it....
Yes please!
oh wtf.
I figured it out. The board def is wrong.
BUG FINDING.
someone should fix it then ๐
Glad I could be of assistance ๐
Yes, on it.
Thank you, Jerry! ๐
I actually found it.
sure
The LED pin was incorrect.
Now we wait. ๐
@slender iron re the above change, do we want it in 6.2.x and merge 6.2.x up to main?
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
OK
if it passes CI, merge it!
Please wait to merge this. There's another potentially incorrect pin. Troubleshooting now.
For pixelbuf's [] to be able to call _transmit on the Python subclass, we need to do the subscripting operation specially.
@idle owl I tagged you on https://github.com/adafruit/circuitpython/pull/4688 as you will be able to test
Cheers.
out to lunch! ๐ฎ
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.)
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
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...
post em
D5 != GPIO15. Accurate?
(LMK if you need more than that section of the schematic.)
It's on 14.
D5 appears connected to GPIO14, yes
I think Jeff was seeing this too
Thanks!
what board is this a problem for?
ItsyBitsy RP2040.
There are a few errors in the board def.
Already sorted out the LED and the BUTTON pins.
and the board profile does indicate it's connected to GPIO15, yeah
I can use digitalio to toggle the pin and use a multimeter to verify it, correct?
Trying to avoid soldering headers on this board.
That should work just fine I would think
Ok thank you
I tested this on a Funhouse with tip of main -- the Dotstars are working !! yay!
Nothing special about GPIO14 or 15 that I know of, DigitalIO should work on both
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.
Oh hmm, I'll have to check out the errata, didn't see that in the datasheet
Also I did not know that building CircuitPython checks to see if changes were made or not. And if not, it doesn't build.
Not sure if it ended up in the datasheet.
yah you can use V=1 to visualize the specific files that get recompiled
Ah nice
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.
1.12 merge passed unix tests!
Toggle appears to be working!
@idle owl wait wat
I built it with the correct pin in the board def, and the pin is working.
Oh, so the board def was wrong
If I'm doing this right anyway.
Yes ๐
The board def was wrong in 3 places.
LED, BUTTON and D5.
I thought you meant the default was working and was like how could that happen
if it passes CI, merge it!
Nice! good debug
Thanks!
I was all prepared to be embarrassed at somehow blatantly misinterpreting a schematic again after last time
Aww. ๐ Nah, you were right.
I am glad to see that my brain is still holding together lol
This fix has been verified against the schematic. I also built CircuitPython and tested all three pin changes. LED, BUTTON and D5 now all work properly with this fix.
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!
AFK for an hour. Back after.
On QTPU M0 Haxpress, I tried
help('modules')
at the REPL -- it went do SAFE Mode due to " Crash into HArdFault_Handler"
@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"
Tested successfully with NeoPixel as well.
@onyx hinge Some of the checks failed on the objtype PR.
boo! I'll look.
253704 bytes used, -8 bytes free in flash firmware space out of 253696 bytes (247.75kB).
yow
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.
Tested successfully with NeoPixel as well.
Cannot repro on a RasPi Pico running
Adafruit CircuitPython 7.0.0-alpha.1-929-g52589691b on 2021-04-29; Raspberry Pi Pico with rp2040
I tried to do help("modules"), 1+1, and import sys. All worked as expected. No safe mode or HardFault. This is probably a SAMD-specific problem.
Yes, I've had no issues on rp2040 or esp32s2 boards.
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
@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
yeah that
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
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
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.
Happy 8th Birthday MicroPython!
https://blog.adafruit.com/2021/04/29/happy-8th-birthday-micropython-micropython-micropython-and-adafruit-sponsoring-join-in/
@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
esp32s2 uses a different compiler version
that said, you're probably right, my GCC is still 9.2.1
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;
oh right ofc re: esp32
Ok, I missed that edit. I will update my gcc and add extern. Thanks Jeff!
Glad I could help
Hooray, the latest S3 build of CircuitPython has my fixes and it works!
what's the best GCC to use right now, there isn't a bug on the latest or anything, right?
(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.
@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
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. ๐
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?
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.
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.
Well I had to ask earlier. You explained it.
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
Oh, yeah. That.
that's absolutely what I wanted to spend my afternoon on
I mean.... who doesn't...... ๐
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 ?
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
Wait, give me a minute, my partner figured out something if I remember correctly.
I swear Apple degrades even more every year
But she's in a meeting, so let me see if she responds and remembers.
thanks
@idle owl I think I actually got through them all
but I'd still def appreciate anything, it might pop up again
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.
Could just pipe data from a find
find ./ -type f | xargs xattr -d com.apple.quarantine
Just cd to the directory first though
xattr -r is recursive, I don't know if it solves that issue though
Don't know if that's the one for this situation, but I use this EVERY time there's an app update on Homebrew. "Looks like you downloaded something from the BIG BAD INTERNETS! Are you SURE you want to run that program? Did the big bad wolf give it to you?"
Actually, I do xattr -rc <path> because nothing works better than a hammer sometimes!
I've been using an applescript droplet for downloaded folders of stuff too, because it complained when opening a php file in a code editor... like that makes sense... I rarely need it though https://gist.github.com/Neradoc/6bc4ddcbd492d7a65a2dddb2e151c3ac
could someone start the CI for my pr whenever you sweep past it ๐
just need to see if i fixed it.
you can add a
CFLAGS_INLINE_LIMIT = 35for japanese too
Not sure why when I added that flag it was still failing. I ended up looking at the Qt Py M0 mpconfigboard.mk file and matching that and it's built without issue. not sure what the reasoning for that ends up being.
Anyone available to merge #4685... its already approved.
Done
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) ...
I've added 4 I2S_* pin assignments in board module, and removed 8 pins above from microcontroller.pin for Wio Terminal.
I like this approach very much.
Will start to test as soon as it is available in a beta build.
Does this allow setting multiple keyboard HID descriptors and their order?
If it does this would also allow a 6+ KRO keyboard HID and a method to allow BIOS mode keyboards.
Does this allow setting multiple keyboard HID descriptors and their order?
If it does this would also allow a 6+ KRO keyboard HID and a method to allow BIOS mode keyboards.
No, multiple HID device descriptors are not yet supported.
@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.
AuthMode can now be set by:
import wifi
from wifi import AuthMode
wifi.radio.start_ap("ssid", "password", authmode=[AuthMode.WPA, AuthMode.WPA2, AuthMode.PSK])
This fixes a problem where boards that enabled this (most SAM D21s) would crash on the first bytecode instruction.
Closes: #4686
@tulip sleet no, my impression was the same as yours
@tulip sleet what's your uncrustify --version?
Tested on qtpy_m0_haxpress. at REPL "help('modules')" now works
because codeformat.py invokes uncrustify โฆ --no-backup I think it's supposed to modify files in place, not put .uncrustify files alongside them.
Uncrustify-0.69.0_f
BUILDING.md says you need "version 0.71 (0.72 is also tested)"
oh , bleah, 0.69 is what comes with ubuntu 20.04. I will find a PPA. THanks.
yeah if you're on ubuntu check the ppa that the build uses
https://packages.debian.org/bullseye/uncrustify I built bullseye's uncrustify (0.72) which I think is the version in Arch as well
oh, I thought that was only for py-related stuff
ยฏ_(ใ)_/ยฏ
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
@tulip sleet no errors is due to pre-commit... it hides the logs
aggh
if you run the uncrustify command directly, their will be a bunch of errors
tnx
Tested neopixel on a qtpy_m0_haxpress and dotstar on raspberry pi pico and funhouse.
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
All those poor ducks, all bread and no crust
(sorry, could not help myself)
there must be some context I am missing
maybe we need to add the whole port directory
I think pathlib.Path.match doesn't treat "**" like we need it to
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...
@tannewt Some of the authmodes are not currently supported for AP... should we remove them, comment them out, or raise an exception?
Some of the authmodes are not currently supported for AP.
An exception should be raised as that is port specific. From the idf docs, I see only WEP being unsupported in soft-ap.
Also, for some reason xtensa builds are failing while I am able to build them locally.
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...
@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)
From the idf docs, I see only WEP being unsupported in soft-ap.
I would have thought so too, but the WPA3 modes fail with the same error in the DEBUG console as with WEP. And we also haven't implemented Enterprise. So the only working AP authmodes currently are: WPA, WPA2, WPA-WPA2, and Open.
So the only working AP authmodes currently are: WPA, WPA2, WPA-WPA2, and Open.
Yup! just checked, only these authmodes are supported. Thanks for pointing that out.
Is this likely to be merged soon or is it still under review? Just curious. It would be nice to have it in place.
@slender iron thanks!
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!
hihi please install pre-commit to format this file (or check the pre-commit error log)
Some of the authmodes are not currently supported for AP.
An exception should be raised as that is port specific. From the idf docs, I see only
WEPbeing unsupported in soft-ap.
100% agree
@idle owl what boards can the "flash_nuke.uf2" be used on?
RP2040 boards, afaik.
nice -- good to know. thanks.
Hmmm. Yes, I have pre-commit installed and it didn't complain. I'll fix up the indentation.
Thanks! Looks like the code formatter was missing some files.
Ha sorry about the pre-commit whitespace thing! Hopefully they'll be fixed in 929ee8d :)
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...
I can add the exception in start_ap(), may take me a couple of days, I'm in the process of moving my office and my computer will be going down for an indeterminate length of time :-(. If anyone else feels like doing it, feel free.
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
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
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
@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!
@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
the weird thing is that it says it does: https://docs.python.org/3/library/pathlib.html#pathlib.Path.glob
maybe only .glob does, but not .match
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
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
you did the right thing, I was just surprised, since the doc appeared like it should work
>>> 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.
@onyx hinge https://bugs.python.org/issue29249
hmmm my conversion to regular expressions might not be right...
since a/**/b needs to match a/b
.. right?
@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
they do, tools/**/*.py should match tools/codeformat.py
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)
Thanks! I don't know that file-by-file review is going to be useful here, so I didn't.
oh, you did it already @microDev1 , nice! are we ready to merge then?
I am looking at the files...
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?
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
For now use .py files. if you use circup, you can circup install --py.
I had to compile libs myself to test a neopixel on latest on a QT PY, I had Memory errors with the .py
Thanks again! I looked over everything briefly. Mostly just worried about new uarray, and new functionality in CPython-named modules, but I see it's off by default.
This is not in CPython, so I think we should turn it off or move its functionality elsewhere.
In CPython, this is a separate atexit module, which is fairly complicated. We could move this to supervisor or something like that.
I think this should go back to array.
.. module:: array
So, could we encourage Adafuit to update the description at: https://www.adafruit.com/product/4382 to indicate that there is NOT audio support?
Just out of curiosity, what would it take to get this working? I'd be willing to discuss the possibility of implementing.
Fixes #3211.
PWMOut is now solely in pwmio, as planned for 7.0.0.
#4440 is a later duplicate, but has more discussion, so closing in favor of that.
I propose that we drop board.SPI(), since it has no utility other than to talk to the display. I will also rename the SPI pins to EPD_MOSI, etc. The fact that they were called plain MOSI, etc., is an historical artifact, I believe, based on the original schematic.
On the MagTag, board.SPI() can only be used for the display; the pins are not broken out elsewhere. Using board.SPI() gives a "pin in use" error.
- Remove
board.SPI(). - Rename
board.MOSI,.MISO,.SCKto.EPD_MOSI, etc. - Remove
board.CS; it already has an aliasEPD_CS.
Fixes #4142.
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...
Thanks for spotting the cause and fixing it!
(Python PurePath.match() does not handle **, even though glob() does. Turns out this is a known issue: https://bugs.python.org/issue29249)
It makes sense functionally that board shouldn't advertise capabilities that aren't exposed. The RTD warning in board says as much:
The board module varies by board. The APIs documented here may or may not be available on a specific board.
Addressed by #4695 ...closing.
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...
Oh and I asked questions on Discord if I got stuck, but I think that was mostly at the end with the publishing part of it.
i'm working in project that uses max30102 using micropython ...... but unfortunately i didn't found its library ...... i just found the ### max30100 library and most people said it### doesn't work !!
any help please ??
Can pulseio be left in the pirkey_m0 build? It has irremote frozen in which requires pusleio. Or is it time to drop support for the pirkey_m0 completely?
We can enable pulseio on the pirkey explicitly.
@still zephyr @mental nexus readthedocs and PyPi are both set up now on https://github.com/circuitpython/CircuitPython_DisplayIO_Annotation ๐
Can pulseio be restored to the pirkey_m0 build? It has irremote frozen in which requires pusleio. Or is it time to drop support for the pirkey_m0 completely?
Yes,thanks, I meant to do that but forgot that it was not enabled explicitly already. Pushed a new commit.
Thank you ๐
I'm not a fan of the common
configure_usbdesign because it makes them equally vague. I think it'd be better to have interface specific functions likestorage.disable_usb_drive(),usb_midi.disable(), andusb_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.
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?
so a prebuilt version is part of the repo - not just the source.
there is no executable in the repo, but we re-build mpy-cross on every PR build, and upload it to the link above
OK - but I should rebuild it in my clone of the repo for build things locally.
make -C /mpy-cross
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
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"
you could build it locally or you could download the corresponding one from S3; your choice
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.
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.
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.
I can add a caveat to the guide about when you might need to re-build mpy-cross
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.
Look in py/mkrules.mk and py/mkenv.mk. $(MPY_CROSS) is invoked which is set to be in the tree as MPY_CROSS = $(TOP)/mpy-cross/mpy-cross
ah -- so it does use the version in your local repo
oh, sure, you have to build it or something like the CPX build will fail
yup -- and many others
(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)
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!
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.
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.
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!
Maybe! If they read it, we won't find out about it since they won't be asking questions about it! ๐
fyi im totally cool with it being only available on larger chips - if folks want it on, say, a qtpy, they can disable enough stuff to make a special build
fyi im totally cool with it being only available on larger chips - if folks want it on, say, a qtpy, they can disable enough stuff to make a special build
It completely replaces the old way of doing descriptors, so I can't really turn it off. I could turn off the API and save some space, but not the mechanism.
hmm reducing the API makes sense so its hard coded. pulseio is the tradeoff? pulsein's what folks use for DHT sensors is the only thing, pulseout im a little more ok with cutting.
hmm reducing the API makes sense so its hard coded. pulseio is the tradeoff? pulsein's what folks use for DHT sensors is the only thing, pulseout im a little more ok with cutting.
I'm not sure that will make enough room, but I can see.
alternative we discussed - having dht_read() thats kinda the oppostite of neopixel_write() :)
Whenever anyone with access has a chance, this issue could be labeled as "Good first issue"
https://github.com/adafruit/Adafruit_CircuitPython_ProgressBar/issues/28
pirkey_m0 wasnt supposed to be shipped - it can barely do anything. it will be redesigned as an "IR trinkey" with RP2040 which will make pirkey 'usable' :) so we can drop it completely.
you can subscribe to https://github.com/adafruit/circuitpython/pull/4689 - when that's merged in (no ETA!) it will allow turning on/off the second CDC channel
the description should not say audio - its been removed.
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=...
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! :)
Just curious, can I still save some space by completely disabling things like USB MIDI at compile time?
supervisor_workflow_active needs to be stubbed for when there's no USB
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.
As mentioned in https://github.com/adafruit/circuitpython/pull/4689#issuecomment-830649832 and to support #4696, it would be convenient to have a small C module that can do the DHT-style read protocol, without needing the entirety of PulseIn
It would implement just the basic read, like this code in the DHT sensor library.
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-...
Does it work on 6.2.0? Is there anything connected on those pins right now?
Same behavior whether anything is connected or not.
I will try with 6.2.0.
6.2.0 doesn't seem to work on the Fluff M0 at all. On 6.1.0 I get:
code.py output:
Traceback (most recent call last):
File "code.py", line 4, in <module>
ValueError: Invalid pins
which seems to be correct.
Why not call it _1wire_read, as the protocol is called?
hm cause it isnt 1 wire (?) and weve got something with that name already
DHT is a one-wire protocol but is not the "official" "Dallas" one-wire protocol, so it's not compatible. DHT returns 5 bytes; Dallas returns 8 bytes, and I don't know whether the timing is similar in any way.
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...
It looks like when we merge in MicroPython 1.12 (#4693) this should be fixed. We should add a static-aarch64 build of mpy-cross when this is done.
Albeit temporary, I've ovecome this by cheating most heinously.
Purists, look away... I built mpy-cross in my clone of the micropython repo then copyied the executable into my clone of circuitpython. :P
Thanks for spotting this. The "SAMD21" and "SAMD51" got reversed in error when the comments were reformatted at a certain commit. See:
https://github.com/adafruit/circuitpython/commit/5c24023240be492ddcf0cacec21318a182933391

I believe this was resolved by #4688 -- OK to close?
I'm seeing this problem as well. It was working fine and then one day it won't connect. The AP is shown on wifi scan but it won't connect to it. Sometimes it says "No network with that ssid" and other times it's "Unknown failure 205". If I bring the magtag within a few feet of the AP it will connect.
@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 ...
Should I write an issue to go along with my pull request?
If that works for you, yay. Note that in general we don't have a guarantee of mpy-compatibility with micropython. In fact, when #4693 is merged I know for sure that we will be different, because of a difference in how we treat "async" functions. (this would affect files that use async, viper, or native code)
FeatherS2 crashes if you set the PWMOut frequency to 0.
This change will raise ValueError: Invalid PWM frequency if the requested frequency is 0.
(Lifted from the atmel-samd port)
When this gets merged, it should fix many of the broken builds in #4689 (dynamic USB).
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...
Looks good to merge. I did not check it against the schematic.
I fixed the merge conflict, which appeared to be just an indentation difference between two different additions of pins PB24-PB29.
Should this check for frequency too high?
I don't know the ESP32-S2 platform well enough to decide.
@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
I don't think I ran cookiecutter when I created it. Just did some things manually.
I found those icons from https://publicdomainvectors.org/ with the idea being that they were permissively licensed.
Public domain vectors - download vector images, svg cut files and graphics free of copyright. You can use our images for unlimited commercial purpose without asking permission.
Should this check for frequency too high?
No, that is not needed as the idf functions do a check for correct duty_cycle and frequency combinations.
I believe it was these 2: https://publicdomainvectors.org/en/free-clipart/Generic-file-icon/67197.html and https://publicdomainvectors.org/en/free-clipart/Blue-folder/38883.html and then I made a few variations of the file one for different file types.
thank you!
Thanks! @rsbohn for spotting and fixing this issue. Just one comment...
// check the frequency -- 0 is not valid
if (frequency == 0) {
return PWMOUT_INVALID_FREQUENCY;
}
Please move this to line 66 as the crash seems to happen at line 68.
@idle owl Just an example, these two learning guide have been updated the full example code with the new modified examples using board.I2C(), however not the rest of the code. https://learn.adafruit.com/adafruit-veml7700/python-circuitpython and https://learn.adafruit.com/adafruit-mcp9808-precision-i2c-temperature-sensor-guide/python-circuitpython. I am unable to be in the meeting today, so I wanted to point that out. Let me know if there is something that I could do to help. thanks
@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.
Yep I can work on making those changes in the Learn Guides. I'll get those two that are linked tonight. @still zephyr feel free to ping me with any others that come up and I can fix them as they come.
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
Thanks @still zephyr and @lone axle!
@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?
either way is fine I think. If you want to make a gist or some other public file and keep a list there I could keep checking that and work on them as you add them?
@lone axle Will do a Gist tonight and share the link here with a Ping,
Thanks both of you ๐
perfect! thank you as well!
?serverinfo
@idle owl hey there seem to be no adabot "circuitypython library report"s for the last two weeks or so.. any idea what's going on? https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=adabot/bin/reports/
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 ๐
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.
it's not my lister, but I did modify it, though not the adabot one. Could I clean out the old reports? They're in the notes. Is that OK?
it's just alphabetical, I think
How old? I think they're worth having for some period of time on S3...
oh there's 2 lists and I see no rime or reason why a thing is in one and not the other
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.
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.
I will check the lister. The lister script we got from somewhere else; it is kind of a mess
Yeah I guess that's fine.
surely the 2019 and older files can be removed
I don't know who will refer back to them later
ah it hits the page limit in the middle of listing circuipython files
but .. they could also be moved to an archive folder or something
I could put them in an OLD/ directory
That would also work
I'll do that for now, and we can discuss whether to keep them
I guess there aren't a lot of 2019 files are there, must have already culled them once
thank you Dan!
@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?
right
it will work as long as there's a CDC connection. If there isn't, it will not work
deletes
I can also make it check for MSC only, but that's a rare case
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.
No need if you already have a PR
@idle owl @onyx hinge adabot reports now cleaned up. All but latest April and May are now in OLD/
@tulip sleet thank you!
@slender iron are there more merge-related problems you know about? I think I got the ones I know about.
not that I'm aware of. I'm not caught up on email though
okay
I'm hoping to have the first pass merge of 1.13 today
The next time I make a CircuitPython release, I will take notes and document the process. I will write it up in an internal Learn Guide Page.
Topics (not inclusive):
- Tagging
- Release notes
- Get download counts using AWS Athena queries
- Generate contributors list
- Reformatting release notes for Adafruit blog and forum post
Cheers!
There were identical changes needed for #4696, so I cherry-picked back and forth between the two PR's, #4696 is now merge, and what's left here is now all that is necessary.
<@&356864093652516868> hope you can join us for the discord meeting in about an hour. Add your notes to the notes document and then join us in the CircuitPython voice channel! https://docs.google.com/document/d/1z62nKbjNNv0j6uPWeUG6Co3aSCw4OQ3wl9VYlRIeTi8/edit?usp=sharing
@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 ๐
I think it's good? I say "think" because I believe you're more on top of this than I am. ๐ You can always add to it if you find you missed something!
It has the things I can think of.
No problem, ๐ I would start veryfing and adding accordingly.
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).
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
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.
lurking
lurking

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...
If I remember correctly, the original author does not agree. ๐
it's a holy war
let people say it however they like
I say PNG...
๐ ๐
tabs vs spaces, emacs vs vim
No one can get out of vim
Jiraffe vs Giraffe
I am a power user. I know how to quit VI.
:q! doesn't do what you think it does
I just know because git trapped me in it so many times that eventually I didn't have to google it anymore
I just care about what :wq! does. ๐
If I don't want to save the file, I just reboot the computer,
๐ผ
I know!
Not in public, in PM.
Oh, sorry, haven't been to one of these in a while
OV7670 is very cool!
THANK YOU SO MUCH KATTNI!!
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.
Thanks Kattni. Will keep making brief updates here until I get other notice!
Please do ๐
โ
the TLF progress will be helpful for CP debugging
CGrover the coffee scale looks really cool.
@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.
@errant grail this might be of interest if you are looking for invisible buttons: https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout/blob/main/adafruit_displayio_layout/widgets/control.py it's a Group subclass with click API built in.
๐
Excellent! Thank you.
@trim elm There's a bunch of reasons for the auto-reloads. What OS are you on?
That is the 4x + pixel doubling (there is a x5 too): https://twitter.com/DavidGlaude/status/1388993353191145472?s=20
The thermal camera MLX90640 produce a 32x24 "image".
Thanks to ulab (numpy alike) I scale it x4 in bilinear. Quickly copy from array to bitmap, then scale it x2 with DisplayIO.
Hardware: FeatherS2 + FeatherWing Keyboard
WIP Code #CircuitPython: https://t.co/s5W4LC5Uhc
Will be in the newsletter
Basically anytime there's write happening to the board, it will reload. Anytime there's local activity on your computer, not necessarily to the board, it can reload. I use MacOS, and screen, and I get it if I move files around in Finder that have nothing to do with the board.
What's the specific issue you're having?
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
Hmm. On what board? Or all boards?
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
Then I think you're running into what I was talking about. Where when there is local activity on your machine, it can trigger a reload. I mean, there are times where I'll have something last ages without a reload, but typically, they're triggered pretty regularly.
@ionic elk it'd be nice if you could pick up https://github.com/adafruit/circuitpython/pull/3454 too. I think it's related to your main.c work
Yeah, that's exactly it
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.
Yeah, it never happens when it's stand-alone
@slender iron that's the supervisor bug I got started on this past week ๐
Then it's expected behavior. Unfortunately or otherwise ๐
I didn't get super far into it but I'm on it ๐
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
The official ARM gcc toolchain compiles libgcc.a as -O2. The arch Linux ARM toolchain uses -Os. We discovered that building on arch saved a kB or two (at least).
We can consider replacing the stock libgcc.a in the ARM toolchain with a -Os version to make room on the smallest boards for new features.
Oh no wait it isn't, I got mixed up. But I'll check it out, looks related?
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
whoops
Windows generally doesn't touch the drive except writes. AV software perhaps or Mac trash etc
Yeah, I don't think I've ever really used windows for programming, so I'm not sure if it happens there.
Some third-party utility programs, anti-virus scanners, or innate OS indexing programs can touch the drive and do writes to it.
we've had a few issues with some type of Windows 10 anti virus scanner in #help-with-circuitpython
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
I come from java. ๐
One way to debug is to try this supervisor command to prevent auto reloading: https://circuitpython.readthedocs.io/en/latest/shared-bindings/supervisor/index.html#supervisor.disable_autoreload
To reload CircuitPython you will then need to Ctrl-C -Ctrl-D
Ok. That'd definitely work, but I still like auto reload for when I copy new files
CircuitPython_Org_Xxxxx?
Something that start with org ... is really java and could trigger nightmare for some that migrated to Python for a reason.
Perhaps?
this is where we try to compare feathers: https://learn.adafruit.com/adafruit-feather/feathers
@lone axle You're not muted.
Thank you
Yeah, and it's also pretty small so the pixels look amazing
The integral displays are usually on their own SPI or parallel ports. Helps with display performance.
240x240 is like on all of the other board: Gizmo + Clue + ...
Thanks!
Thanks all
So that is easy to test on the presentation.
Thanks!
Thanks all!
Thanks!
Thanks all ๐
@onyx hinge I'm running next week. FYI.
I write it down.....and I forget I wrote it down....
Ya, it's array in objmodule.c.
Removed from the docs but left in so it can be moved later.
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
CircuitPython Weekly for 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...
@tulip sleet what did you mean by https://github.com/adafruit/circuitpython/pull/4693/files/cd2c2f19f9eddd82aea8d47c38c29d90185d8b2f#r624277785 ?
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.
๐
Thanks! I don't know that file-by-file review is going to be useful here, so I didn't.
I'm not a fan of the common
configure_usbdesign because it makes them equally vague. I think it'd be better to have interface specific functions likestorage.disable_usb_drive(),usb_midi.disable(), andusb_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...
@slender iron did you see this PR from @onyx hinge to tannewt/circuitpython?
also there is a stray issue here: https://github.com/tannewt/circuitpython/issues/6
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
Just the uarray -> array thing. Otherwise looks good!
Do we need to change this back to array to make the doc be correct for us?
:mod:`array` -- arrays of numeric data
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,...))
ya, sorry. I could just do a commit on top
i figured out the changes -- github said "outdated file" and that was the clue
that issue is very old
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
I think I did the flag renumber already
For CDC, not sure about circuitpython, since it doesn't connote that much. How about primary? or maybe std or stdin_stdout?
How about console?
ok, pushed the last array fix
How about
console?
I like that!
ok, I will stop the previous build to save time
I think it had finished already
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 ๐
ya, I think it's a good idea if you think of it
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])```
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 aboutprimary? or maybestdorstdin_stdout?usb_cdc.disable() # disable completely usb_cdc.enable(primary=False, data=True)usb_hid.se...
I think you want
disableandenableforusb_hidas 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.
Jeff Thanks for hosting , your voice sounded different today ๐
@lone axle as discussed I will start putting the learning guides to be updated here:
Thanks ๐
perfect Thank you ๐
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?
The conflict with D5 and SPI0 came up in a forum discussion https://forums.adafruit.com/viewtopic.php?f=57&t=178805
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....
@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.
1.12 is merged!
usb_hid.disable()
usb_hid.enable(devices=(device,)) # could be a required keyword arg
This is my preference.
@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.
But there was clearly a conflict with D5 and MOSI
and it says MOSI is on the MOSI pin and on D5
where?
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....
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
does RP2040 SPI activity show up on all pins at once?
I have not looked. ... yet. I just found that D5 would not work as the CS pin for the rfm69 under test.
same should be true for any SPI peripheral then? (don't have rfm handy, but do have BME280)
agreed -- if you have time try it.
yah. issue seems odd. i'm curious.
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
that is problematic and not the same as other feathers.
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.
hmm -- the FRAM works as well -- so false alarm -- now to concetrate on why the rfm does not work.
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...
did 5/6 work for you?
yep. see above.
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
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
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....
great!
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
You can get the latest build here https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/raspberry_pi_pico/
I know, I'd rather have local builds available to me
Me too...
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
Not sure what CICD is?
I do local builds on Raspberry Pi(4) , Linux (Ubuntu) or MacOS. I just do the build following https://learn.adafruit.com/building-circuitpython not the full CI
I'd prefer the end-to-end job, automated tasks from a repo should be fairly portable which aids in https://reproducible-builds.org/
Same - or worse, WHERE I wrote it down ๐คฆ
I've often heard the "D" for "Delivery". Ship on every build type thing
*ahem* successful builds!
@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.
I wonder if I can get an automated testing rig to test builds on actual devices for PRs.....
@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.
Yes - I am having issues even getting previously working builds to run now....
Time for bed... ๐ค
I'm sure someone will figure it out. Doesn't seem to have affected the aduino version...
Youโre right, I had it mixed up for some reason ๐
Thank you so much @Neradoc, those fixes worked!
Leaving this open so someone can figure out why the delay is needed at all.
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. ๐
@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.
The speed of the Adruino version is impressive!
yeah they have at least a couple of tricks we don't
but it's the not crashing trick I'd like to figure out
Yep, I can take a look now. Meant to check out last night but slipped my mind.
@lone axle I appreciate it, thank you
@lone axle thanks for merging that. Now can you transfer it into the circuitpython organization?
on it's way now. Github reports "may take a few minutes" but I do see it on the org page already
great, that lets me do my next step.
Sorry I didn't transfer back when I merged ๐. Thanks again for all of your help on it
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.)
@idle owl yeah. You could change "pylint" to "echo" and that will show you what files are listed
Oh neat. Thank you.
Overall this looks really good. Just a few minor comments. I'm happy with the API overall. Thanks!
Is this used? I'd assume it's not used since we don't use ASF for USB.
Where are these documented?
welp, I think I messed up the git history with my merges
mmmm @fossil gorge ?
NEver heard of them
jajaja
Figment of a collective society's imagination! ๐
Maybe, but I don't know... Scott's quite the power-user with Git.
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?
You already covered more than I would have thought of including. We can always add more if we decide there's something else that should be added.
Ok, no problem just making sure, when we started you said small updates, so hope not bothering you with that granular ๐
Not at all!
I would like to cover requirements vs mock the docs vs sphinx intermapping but I do not think it is the right place
Hmm yeah. Agreed it's worth covering, but perhaps not there.
We could create another document like how to, to do some libraries management
pypi, releases, readthedocs, requirements, thath kind of stuff
I mean, there's a guide for that.
๐ฎ
Some of it anyway.
This only covers part of that. https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library
could you point me in the right direction
ahhh yes, could I add stuff in there?
that is scott guide
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.
good thanks Kattni ๐
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 Wait, have you done any editing in Learn yet?
Nope
Ah! Ok. That makes things a little different. I'll DM you.
ok
If anyone has a moment: https://github.com/adafruit/Adafruit_Learning_System_Guides/pull/1536 It's a quick one, it's template code, so there's nothing really to review.
Um I thought I approved it but not letting it merge...
@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.
I thought I had...
that is odd; I saw that too, so I went ahead and approved it too
If it happens again I'll let someone know, never had that occur before. The comment even says "gamblor21 approved these..."
Yeah I saw that.
But it also said "left a comment" so it seemed contradictory.
Yeah let us know if it happens again.
"gamblor21 approved this but git doesn't trust him so have someone else look at it" ๐
the tooltip on the grey checkbox says "Only reviews by reviewers with write access count toward mergeability"
(as opposed to dan's green)
yes, I was just making a screenshot
CircuitPython Librarians doesn't have write access to the Learn Guide repo, I guess
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.
for the Learn Guide repo, Librarians only have read access
I'll ask Limor if that's deliberate.
my 1.11 and 1.12 merge commits only have one parent which makes them not merges
@onyx hinge Jeff, any side effects of hooking into the attr like this: https://github.com/micropython/micropython/pull/5648#issuecomment-830869436 ?
This modification concerns only runtime.c, and implements getters/setters for properties. The code is based entirely on circuitpython's runtime.c (https://github.com/adafruit/circuitpython/...
If would be really great, if ulab behaved in the same manner under micropython as in circuitpython.
@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
Right, it was a backport, but hasn't been accepted. Then somewhat suggested that we could exploit the .attr method.
if micropython has its own way of doing properties, we'll probably be able to use it after the related code gets merged.
micropython doesn't really work with the concept of properties, that is the snag.
py/obj.h: mp_attr_fun_t attr; we do seem to have this in our type objects, you're welcome to try it
If you search for mp_lv_color32_t_attr, there is only one place in the code, where it pops up.
That could be, but you wrote your own properties handler, via proxies.
Well, not me personally
It doesn't matter, who it was, they had a reason.
Perhaps, the fundamental question is, what attr is meant for.
@slender iron I dunno if you want to drop in and supply any history of why we coded our object properties like we did
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.
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
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.
py/objgenerator.c: .attr = gen_attr, circuitpython has .attr so maybe you can try it out on both
OK, will do.
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
Oh, you mean like a universal attr function?
yes
I have somehow made my Circuitpython drive into a read-only filesystem
will storage.remount("/", False) have that effect?
yes that's what it does (from boot.py)
Isn't the second parameter for readonly: bool = False? Or am I misreading these docs?
readonly from Circuitpython
how does turning readonly to false turn it on?
I guess that was the question: it is read only from where ?
False makes it readonly by you. And read/write by CircuitPython, iirc.
that seems a little misleading
yeah it's readonly from the point of view of the code
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.
and yeah there could be a more explicit way to express that, nobody ever remembers which is which ๐
(on first try)
I just don't like functions that make me have to erase my filesystem
especially when they don't say that upfront
did it do that ?
Can't you remount True?
I mean it made the whole drive read only
you can boot in safe mode or erase boot.py from the REPL
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
yeah there's probably some tricky way to do it
is there a command for deleting boot.py despite the drive being read only?
safe mode is easy except on pico
it's not readonly from the code, that's the point
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")```
ah, ok. Handy tricks.
Maybe a note to that effect could be added to storage.remount() docs
I don't see any reason why the docs couldn't be updated.
"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"
PR? ๐
safe mode !
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
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.
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 ๐ฆ )
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.
@ionic elk is it read-only from the host's point of view or the code's?
This PR fixes an issue in main that would cause any pre-existing run reason, such as SUPERVISOR_RELOAD set in supervisor.reload(), to be overwritten after the reload_requested trigger. autoreload.c now sets the run reason as AUTO_RELOAD itself.
Resolves #4510
Resolves #3858
@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.
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.
but ehh. it's not that important.
e.g. I have seen a filesystem become read-only to the host out from under me due to corruption
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
got it, thanks; i read through everything but may have missed that. a docs improvement would be great
@slender iron do you have some LED code for me?
Fixed the supervisor thing
or I can do #3454
does the learn guide need mode info on how to recover too ?
https://learn.adafruit.com/circuitpython-essentials/circuitpython-storage
@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.
(like even following that you might put the wrong pin name and get stuck)
Ya, pick up the next code file stuff. I think it'd be good to do in 7.x
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
@onyx hinge this is exactly why CP does it the way it does. It uses a standard attr and the property object used by Python properties. custom native attrs is a recipe for weird non-standard behavior
@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.
Is the kwarg form for second arg the preferred form for that? It gets a mention in https://github.com/adafruit/circuitpython/issues/286
Probably? It would possibly be clearer.
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)
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.
I'd be up for doing that
@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.
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?
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 ๐
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.
No worries there
As in.... templates have to be created and then something like 60 guides have to be updated. ๐
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.
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?
Might be worth a comment about left vs right for switch when it's a real one like on CPX/CPB. The example still uses board.D7 rather than board.SLIDE_SWITCH
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!
@tulip sleet Is this valid wording?
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.
@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.
Ok thank you
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....
Good point. Deleted all the ASF4 USB config files.
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...