#circuitpython-dev
1 messages Β· Page 399 of 1
gives me a flashback to a cloud cascade failure I had to manage several years ago in a past life. "One repeating user API call ate up all 64 GB of heap? On ALL of the nodes? All 1,200 of them?" π
Making drivers fit SAMD21 memory is super calming by comparison.
ah, more non-greens now. Looks like the status page is figuring out how big of a problem there is π
just when I started coding, github goes down
There it goes, they see the outage now
Guess it's time to work on local stuff only? I was hoping to find time to play with some new sensors...
Whoever's in charge of their incidents finally got the page. I hope their on call crew is well taken care of. Its a tough life. π
Hopefully the fix is simple and they can be low staffed through the rest of the weekend
with a widespread failure like this though a lot of CI/CD systems will start failing and cascade into thousands of build pipelines all over the place.
if your CI depends on external services, you have bigger problems
one of my former bosses would disagree, but that's why they're a former boss. π
this is why we practice boss fights in games
I should be eating a late lunch anyway. π Here's their incident page if anyone who also has work to do wants to subscribe/follow along.
it's back up but maybe give it a break for a while anyway π
@scath999 Got the build complete. I suspect that .local/bin wasn't in my path and that was one of the issues I had.
From the hexmerge command, it looks like it's 7.0.1 SD that gets merged in the hex.
hexmerge.py -o build-pca10100/firmware.combined.hex build-pca10100/firmware.hex bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_softdevice.hex
@jpconstantineau I see - nice. Congratz on getting the build going, and thanks for posting that.
Looks to me like this is a pretty strong candidate for the underlying reason why CircuitPython fails to deploy on this board. What do you think?
@tannewt @xobs @dhalbert Where can JP and I find this in the code? Hope I'm not disturbing your weekends ;)
Cheers!
Just ran git submodule deinit "ports/broadcom/peripherals" and git submodule deinit "ports/broadcom/firmware" which show the messages Cleared directory 'ports/broadcom/firmware' and Cleared directory 'ports/broadcom/peripherals'. After running git submodule update --init, the request for broadcom still happens. Tried with a fresh copy and then also removed references to broadcom in .gitmodules but then the error appears `fatal: No url found for submodule path 'ports/broadcom/f...
circuitpython/ports/nrf/boards/common.template.ld is a template with values that are filled in from port- or board-specific values. Note SD_FLASH_SIZE in partciular.
Let's get this merged, the board can be added in a separate PR.
yikes -- updating CP -- downloading the broadcom/firmware takes a long time!!
yup, there is an issue for it already
perhaps a separate script for downloading it would make sense
@DietmarSchwertberger : I added an exception handler which does a reset. Do you think this is enough? I tested it with a PC running Windows and waking up the computer by pressing a key still does not work. Here is my code: https://github.com/akaenner/picosplit/blob/main/Master/main.py
You really do not want to use a naked "except" like this, ever.
It will catch KeyboardInterript, MemoryError and even SystemExit exceptions.
Please use except Exception: if you really must do pokemon programming, but if possible, find out which exceptions you want to catch and only catch those.
@akaenner : a reset seems a bit hard and unnecessary.
I have tried with sending my Windows PC to Standby. The exception will only be triggered when the keyboard is trying to send the keypress. Then, Keyboard(usb_hid.devices) will only succeed, once the PC is up and running again. During standby it will constantly fail.
I would guess that the wake-up is done by something outside the normal HID protocol.
Gotcha, and thanks.
Quick question: how are these values being determined in this file? I've never written a linker script, hoping you'll forgive my ignorance.
I thought that maybe the pwm pin on the display's backlight is not being de-initialized properly when release_displays is called, but it seems to be fine, and creating a PWMOut object on the backlight pin and setting its duty cycle works fine after releasing the displays, without a crash (though I don't see the brightness of the backlight changing on the PyBoard, maybe it's hardwired).
I don't see why the PWM would fail to sync in this case. Any help with this would be appreciated.
@lunar gull I have submitted a PR that adds a new cell_anchor_point feature to the GridLayout. https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout/pull/58 If you have a chance it may be good to give this a try (if you need help with figuring out how to try a branch from a PR let me know). This allows you to declare an anchor_point to be used when laying out the content into each cell. using (0.5, 0.5) results in content getting centered within the cells and does not require using that extra layer of Group objects like the example I linked yesterday. The approach from this PR is probably better for long term usage since it allows the user code to be less complex.
I saw you mentioned IconWidget not working as expected. I still need to look into that, I would have expected IconWidget to behave pretty much the same as Label with respect to it's anchor_point and anchored_position, so if it's not then we'll try to figure out why and fix it. If you have a chance it may be worth giving the version from this PR a try with IconWidget to see if it behaves as expected if so it could get you past that issue, although it's still something we'd want to fix in the longer term I think.
@gilded cradle whenever you are around next I have a question: Do you know if items in a Palette are meant to be a different type in Blinka_DisplayIO than they are in the core? For example this code:
palette = displayio.Palette(1)
palette[0] = 0xFF0000 # red
print(palette[0])
run on a microcontroller prints this 16711680
But I'm running the same code with Blinka_DisplayIO and seeing it print this: {'transparent': False, 'rgb888': 16711680, 'rgba': (255, 0, 0, 255)}
My example code was wrong, since it used encrypt_into on the decrypt step.
This is a potential incompatibility. Before,
- IV was not required in CBC mode. Now, it must be supplied.
- counter was an int, and was not required in CTR mode. Now it must be supplied, and its type is buffer.
- IV/counter could be specified in ECB mode, and were ignored. Now, it is an error if it is specified.
Yeah, I canβt remember exactly the reason I did that. Perhaps it was to get around a limitation of pillow or something. If you want to try and get it to be the same type and still have it function, that would be cool.
I tested out a change to make it return the "rgba""rgb888"value from the dictionary and it does seem to work in the specific case I tested. I'll test it out a bit more thoroughly and PR it if nothing weird shakes out.
Sounds good.
Does ESP32-S2 use a less-accurate clock source while it's deep sleeping?
(in fake deep sleep, ESP32-S2 drifts by a second over a span of hours; in real deep sleep, it drifts almost a second per minute)
Don't pass --init to the submodules update command, that initializes all currently used submodules, including the ones you just de-initted
IconWidget positioning
@lone axle I'm going to try that code out in few hours. Stepping away for some TV-time with the wife.
Sounds good. Have a good night!
I agree it would be nice to find a way so that the majority of developers, who do no build the broadcom port, can avoid this extremely time (during the initial clone / submodule init) and disk space intensive submodule (forever). If this means changing our documentation to not recommend git submodule update --init, so be it, but the 'correct' alternative will need to be short and easy to remember!
I investigated whether specifying that the submodule was shallow helped, but it appears n...
How does one use the mpy-cross tool to bundle a module (as opposed to a single file)?
Thanks so much! It occurs to me now that .mpy is a reference to mircopython. Never made that connection
It is! I've only used CP so any MP references go above my head
I'm quite new to it as well, but I love Python, and I love CircuitPython and everything Adafruit, so here I am. π
we are alike
(I also have some love for SparkFun, because they have some crazy sensors for all kinds of stuff that are all QT)
Sometimes they do not play together, but recently I've seen them collaborate on things, together with Digi-Key, which is another favorite along with Mouser. I sometimes buy a bunch of weird electronic components and even electrical components (I mess around with managed power distribution and power management on my free time for "overlanding").
more about mpy-cross for CircuitPython here: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/creating-a-library
One of the coolest things for Qwiic, though, is the Qwiic to RJ45. It's powered, splits the signal up into 4 so it can be transmitted over greater distances. Let's you make a run of QT wire that's measured in feet instead of inches. It's also perfect because Ethernet cables are generally way sturdier, even at a cheaper level. Sure, it gets a bit pricey when you buy them for a vehicle install because they have to be grease and chemical resistant, but still, waaaaaay better than trying to pull 4 strand wire from a truck cab to the bed.
@crimson ferry does Adafruit have any thing of that sort? I am sorry for using SparkFun prods.
np, I don't think so... differential for longer distances #help-with-projects message
yeah these instructions convert .py files to .mpy files, I assumed there way a way to convert a module (with its __init__.py and supporting files) into a single .mpy file. that doesnt seem to be how it works though
This one maybe? https://www.adafruit.com/product/4756
Yeah, it converts each file.
Using ethernet cables as a "hack" for long range is one of my favorite things
Yup, those are the ones. Absolutely amazing. I have all of "sensitive" electronics and the DC-DC charger in the cab of my truck, but there's a big 'ol box in the back corner of my bed that houses switching MOSFETs for all the different DC stuff like lights, fridge, whatever, and I didn't want to have to mount any Arduino/RPi back there, so the QT extenders are clutch.
we should probably take the non-core-development stuff to another channel
Yes.
Thanks a lot. This works for me under Windows 10 :-)
This should move you mouse to an absolute position once.
# boot.py import time
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'mapping' argument required
'mapping'?
via Adafruit LED Glasses Driver nRF52840
@main furnace where did you get that library?
It's in the CP build I got from S3: Adafruit CircuitPython 7.1.0-beta.0-153-g27e8a16bf on 2021-11-26
I don't see is31fl3741 in the frozen directory
and looking at the mpconfigboard.mk for the glasses, they don't freeze any libraries on it
looking at https://circuitpython.readthedocs.io/projects/is31fl3741/en/latest/api.html there is no "mapping", but neither is there "scale" or "gamma"
According to https://github.com/adafruit/circuitpython/pull/5584 it is only compiled for the LED Glasses controller. Don't know what that means.
ah, it's the framebuffer one
Yeah. Reading further in the pull request I found this:
from map import glassesmatrix_ledmap
is31 = is31fl3741.IS31FL3741(width=54, height=15, i2c=i2c, scale=True, gamma=True, mapping=glassesmatrix_ledmap)
Guess I need to find map.py then.
Guess that's what I get for playing on the bleeding edge. π
No problem if you have any questions let me know, I'm still refining the library (I want the eye rim lights to work too)
@blissful pollen why list and not a tuple, or even int array?
Just what I chose and it was copied from Arduino and my lack of experience in pure python
I looked at bytearray but for int16 values it was causing my issues with big/little endian
Good morning everyone π
@tulip sleet, wondering if you have a few minutes at some point today to discuss the nrf52833 issue - I've been going over some the adjustments made by xobs, and wanted to make sure I'm thinking understanding them correctly.
No rush - just getting rolling.
thinking/understanding*
Offhand is the tuple (or int array) more efficient? Probably isn't a hard change if its worthwhile and can stick it on a future todo list
yeah, tuple is not modifiable, so saves a bit on that, an array would be the most closely packed data structure for this, but you need to import array for it
Whoa, it's trying to display the console on the LED Glasses!
I use 16-bit arrays for palettes, for instance
Go ahead and post your thoughts here or in the issue.
Fair enough - is it alright if I get back to you a little later? Setting up our sprint meeting for tomorrow and answering emails atm.
Yes it does (badly but you see Blinka ha)
Ah thanks I'll take a look at that.
I know this is penny-pinching, but saves 2 bytes per entry
I'm still living with the samd21 boards
It is copied internally (as it has to be long living for displayio). May be worth putting that in the help that you can deinit the map after importing it.
oh, in that case don't bother
I get you with the samd21 stuff. I know once you give me more memory I tend to forget that stuff
it will just disappear once no variable refers to it
hm, but if it's in a an imported module, it will live forever by default
and in the long-lived memory too
np, at your pace
Thanks much π
oh, it's the rpi stuff that's causing the issue. I was wondering what the broadcom ports folder was... Yeah, could do a fresh repo, or could use FetchContent.cmake to just download the files required from rpi-firmware. https://cmake.org/cmake/help/v3.13/module/FetchContent.html
I did git submodule update --init --depth 1 and that was much faster, though not instantaneous. We could recommend that, maybe?
?serverinfo
@tulip sleet
For the nrf52833:
I think the issue is that SD_FLASH_SIZE has two different definitions depending on SoftDevice version:
v6.1.0: 0x25000
v7.1.0: 0x26000
If the make is done with v7.1.0, it makes the start of the application space 0x27000 - that's 4KB past where it should be. This accounts for the error I previously reported on GitHub.
Thoughts?
Bear in mind that I'm getting the SD address start from Nordic's docs: https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v16.0.0%2Flib_bootloader.html
Scroll down to the Memory Layout Section.
The SD is larger, so the application space should be larger by 4KB, 0x1000. But are you saying the application start address assumes 0x25000. In the bootloader or in CircuitPython?
No, I'm saying that the declared SD size is bigger than Nordic specifies is allowable. According to their docs, they expect the firmware to start at 0x26000. However, if the SD size is 0x26000, then the firmware start is pushed to 0x27000 - that's too far.
if you look in ports/nrf/build-pca10100/common.ld, it looks like the appropriate values have been substituted in the templated LD files
I think the bootloader doc you are pointing to is assuming the old SD size. They increased the SD size, that's where we got the 0x26000 from. But something else may be assumingthe wrong size
or the wrong start address
I hear you. Not sure what to make of it - not strong enough here.
Can I send you a Screenshot here?
sure - I am about to be in a meeting at the top of the hour
kk 1 sec
I have been aware of this size increase for years, and added SD_FLASH_SIZE to handle it. But there may be a bug somewhere.
I did not think the SD size varied by processor. Maybe I made a mistake. I may have been going by the '840 size.
try reducing SD_FLASH_SIZE temporarily and see if it works
I hear you, and seem to remember this being an issue on the nordic Dev boards. I'll find the site.
I have, but this creates knock-on issues -> there's an overlap when merging.
Ah - seems like a documentation error: https://devzone.nordicsemi.com/f/nordic-q-a/56730/s140-v7-0-x-application-area-address-with-nrf52833
You were right, should start at 27000
we were thinking of going to SD 7 for '840, but it caused a follow-on effect, needing to update the bootloader/SD. We could include the SD in the CPy build, but haven't done that yet. The bootloader used to need the SD to function, but I think that requirement has been removed (or maybe we just had that as a goal, but it isn't true yet).
@idle owl hey, do you know anything about if this lib:
https://github.com/adafruit/Python-Thermal-Printer
has been replaced by this?
https://github.com/adafruit/Adafruit_CircuitPython_Thermal_Printer
@onyx hinge ok, it was something else I was assigned, not ESP32SPI issues
@slender iron let me know if you recall which bug this was
No idea.
np. i'll ask. i'm not sure either.
Sounds like a good plan.
What version of "aarch64-none-elf-gcc" is needed for the broadcom builds
@lunar gull I added an item to the "in the weeds" section of the meeting notes to discuss the board module in the stubs. If you're around, we're happy to have you join in or you can follow up with the recording after.
@slender iron Remember, put yourself at the top of the list and go through from the beginning.
thanks! -- sorry -- did not meant to interrupt.
@idle owl did we change how we're doing that? is it host, then top of alphabet instead of host, then following in alphabet?
Yes.
π
Updating the instructional doc now.
some other jeff π
It's
CircuitPython Monday
at Adafruit! Use the code ADATY to get 20% off CircuitPython and 15% off items storewide!
I keep forgetting to mention this. Folks: when you click around in the notes document, it displays a little "flag" on your cursor which can block a set of characters to the right of your cursor. Please try to avoid clicking around in an active section while someone is trying to read it because it can block part of what they're trying to read off. Thanks!
I am just listening (no notes)
@stuck elbow which board(s) are you trying camera on? the adafruit grand central I have basically abandoned, and I concentrated on rp2040 and esp32-s2. all my recent work has only been tested on esp32-s2 only. the samd51 parallel capture peripheral was haunted for me.
@onyx hinge esp32-s2, but with my own breakout, which has issues
okay, good luck when you get your new modules!
@onyx hinge I have a ready breakout, but it misses either mclk or pclk pin, because it only has one clock pin
so I can't use it
drat
You're welcome!
[brb, my computer audio freaked out]
"How do I get into programming?" - https://kattni.com/how-do-i-get-into-programming
[back]
@blissful pollen I should really put you in touch with my partner who a. wrote pixelbuf, and b. was working on getting the LED Animation library working on the IS31 breakout and glasses, and has at least brainstormed getting all of that going. If you're interested.
Sure thing. My plan was to start writing some stuff to see how it worked and what others thought
Keen, tag me when you do, and I'll tag her in.
@blissful pollen if you do every find a way to have subclassed native classes I am interested in this as well. I think there are some nifty things that could be done with subclasses of displayio.Group. But I haven't looked into doing it within the core at all yet.
If you want to talk about it later (even after in the weeds) let me know. I learned quite a lot about how classes are handled and potential ways to expand it
@solar whale yes there's a particular version of mkfs.fat that is needed
@blissful pollen I'll get in touch when I have a bit more time. We can make a Discord thread for it maybe so other folks can find it in the future more easily.
Sounds good just let me know. Itβs all in my head for now at least
@solar whale from the earlier discussion I think it turns out the 'secret' is only in the github workflows file ```yml
- name: Install mkfs.fat
run: |
wget https://github.com/dosfstools/dosfstools/releases/download/v4.2/dosfstools-4.2.tar.gz
tar -xaf dosfstools-4.2.tar.gz
cd dosfstools-4.2
./configure
make -j 2
cd src
echo >>$GITHUB_PATH $(pwd)
New Blinka art dropped! Happy little circuits!
thanks !
I'm so excited about these. There's a bunch!
"availibility: <platform name>"
if stubs or py files can have conditionals then ... ```python
if os.environ['CP_BOARD'] == "example_board_1":
D2: microcontroller.Pin
happy little blue smoke
.. that doesn't work .. this is an error to mypy: ```python
import os
class Pin: pass
if os.environ.get('CP_BOARD') == 'example_board_1':
D2: Pin
D3: Pin
if os.environ.get('CP_BOARD') == 'example_board_2':
D2: Pin
D5: Pin
`pinz.pyi:8: error: Name "D2" already defined on line 5`
Hah, even Blinka Ross can't avoid visits from Sparky.
every machine can be a smoke machine
the code would be a bit more complex. But if it does support conditionals there could be a single larger if statement for each pin that includes checks for each device that does contain that pin. Then each pin would get defined only once (or zero times if they are set to a device without it).
[4.2 is in debian bullseye so it should be in the NEXT ubuntu]
import os
class Pin: pass
if os.environ.get('CP_BOARD') in ('example_board_1', 'example_board_2'):
D2: Pin
if os.environ.get('CP_BOARD') in ('example_board_1',):
D3: Pin
if os.environ.get('CP_BOARD') in ('example_board_2',):
D5: Pin
``` this is accepted by mypy but D2/D3/D5 are 'available' for type-checking regardless of the CP_BOARD environment variable
that feeling when you are googling for the information, and all you find are your own posts
ADATY
https://raspberrypi.stackexchange.com/a/37167 are there two L2 caches? π€―
I did
git submodule update --init --depth 1and that was much faster, though not instantaneous. We could recommend that, maybe?
@tannewt points out --depth 1` may not include the commit you want.
Apologies, I missed the meeting today.
No apology needed π
Yep, no worries. There is a recording that you can check out if you want. Some great ideas came from the discussion near the end.
Yay! I'll check it out.
woohoo! ```rw-rw-r-- 1 jerryneedell jerryneedell 13355997 Nov 29 15:20 firmware.disk.img.zip
-rwxrwxr-x 1 jerryneedell jerryneedell 1576712 Nov 29 15:20 firmware.kernel8.img
but does it sit in the box?
Another idea that just came to mind: make commands can include arguments I presume. i.e. make BOARD=circuit_playground_express Maybe there could be an optional argument added to the make stubs so someone could do something like make stubs BOARD=circuit_playground_express and this would generate the stubs with board being specific to that device. The generic one published to pypi could still contain everything (with a warning that some pins may not be available on every device). But if folks want to go further they could build their own stubs from the core repo and then install them.
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/1OH5tU-lCvDNS0vXRsEfyKjiey2V1zjqGjFSHcGmFSH4/edit?usp=sharing
CircuitPython Weekly for December 6th, 2021 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates early. During the meeting, we go through them as a round robin sorted by username. If you canβt make the meeting and would still like to participa...
I didn't figure out if possible / how to use conditionals. But did get a warning note showing up in the ID for the usage of a given pin. I'll tinker it wit some more this week.
@slender iron The deep dive notes are great -- sorry it took me so long to start using them!
np, did you find the repo with them?
yes
it was super to just click on it and have the video pop up!
hugs to @idle wharf
It's working here, feather rp2040, adafruit tft featherwing
Adafruit CircuitPython 7.1.0-beta.0 on 2021-11-29; Adafruit Feather RP2040 with rp2040
>>>
soft reboot
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Files on SD Card:
['LOST.DIR', '.android_secure', 'DCIM', 'Android']
Code done running.
Press any key to enter the REPL. Use CTRL-D to reload.
My test program was
import board
import busio
i...
hm maybe somehow related to the specific SPI bus used?
They were and Scott read them off. Thanks for putting them in!
@onyx hinge this is the other issue I'm thinking of: https://github.com/adafruit/circuitpython/issues/5462
Ok, so wait..... I forget this every time. The readonly in storage.remount() is referring to the status of the board flash to CircuitPython, right?
So True means the computer can write to it, and False means CircuitPython can write to it. Right?
It's documented in this guide page now: https://learn.adafruit.com/circuitpython-essentials/circuitpython-storage there isn't a header near it so you'll have to scroll down a little, it's under the first code example:
You're welcome. I always end up referring to it as well so I know right where to find it. π
That's why I documented it. Because I never remember. And then I forgot I documented it, apparently.
There really was no plumbing / intention to let native classes subclass each other hmm π
Woot! So glad you found that useful. I've used it several times myself.
@tulip sleet OK, so in pins.c.... Whichever pin comes first is the "preferred" pin, right? My pin script is returning non-silk pin numbers, and I think it's because of the order in pins.c, which I would prefer to update if I'm remembering all of this correctly.
I don't think we are consistent about the "preferred pin" being first.
Is it alright to fix the Feather ESP32-S2 then?
sure
printing the pin object will use the first name
OK, yeah, that's what I meant.
Couldn't think of the terminology.
Should be silk pin.
there might need to be a big pass through all the pins.c to vet them, though if they are mostly right, maybe not
Not sure how to automate that, but I'm not great with automating things like that.
Ooof. @slender iron Should the */broadcom/firmware be taking ages to clone?
Making sure it's not a GitHub- or me-issue.
There it goes.
Must simply take a while.
Wait.
It failed.
Oi, my disk image isn't big enough it seems.
Guess it's time for a new one.
Wait, seriously? How big is the broadcom stuff?
CircuitPython version
Adafruit CircuitPython 7.0.0 on Sony Spresense
Code/REPL
N/A - issues with initial firmware setup
Behavior
N/A
Description
hi, I described my issues first here, as Sony has bugs in his getting started:
https://forum.developer.sony.com/topic/523/circuitpython-install-issues
but after flashing, I am unable to work with the thing - Spresense inserted in extension board exposes CIRCUITPY on extension board USB only(?),...
I mean presumably I'll eventually need it. How big is your disk image for CircuitPython?
--depth 1 worked though.
Oh fair enough. I guess I don't know what depth is doing.
@slender iron draft for 7.1.0-beta.1 is in. I added the broadcom port to the alpha list, and pointed it out in "Notable additions".
See if you want to add anything.
I don't think there's anything immediately on the agenda to add. There is a small translations PR, but we can wait on that.
depth is the number of commits to fetch on a branch starting with the latest and going back in time
Ah. Thanks.
k, will take a peek @tulip sleet
usually the history is small enough that getting it all is fine
@slender iron OK it would take me time to get up to speed on ble hci. it's using uart, not spi, right? still want me to look into it (tomorrow)?
@tulip sleet will have a better idea than me
i can take a look instead. This looks like a simpler connection problem of some kind.
it sets it all up using a library I wrote, etc.
(adafruit_airlift)
Can add this to the release if it's not troublesome. https://github.com/adafruit/circuitpython/pull/5626
Will def add
@tulip sleet release notes look good to me. you'll need to add the rpi boards to the new boards list too
ya, I'll add notes to the board page
We're going to wait just a little bit (a day or two) so that we can branch 7.1.0 before merging this into main. We'll want to add a 7.2.0-alpha.0 tag for it then too.
Looks good! Will merge when done.
I think the issue may be that we shouldn't load any code when writing to flash. So, interrupts should be off during the write. These signal handlers show that this isn't the case.
Since the stack is corrupt (5 and 6 being ??) I'd suggest adding printfs around the hang to determine where the flash write code gets stuck.
I haven't looked at the surrounding code but maybe there is already some sync task happening? Maybe the TC is still being reset?
Maybe we changed the TC clocking code and the peripheral isn't clocked anymore. That'd cause the sync to hang.
This should wait for 8.0.0 given the API changes. Any chance you can keep them compatible?
I think I could re-spin this compatibly, and hold the incompatible changes for 8.
The change would be smaller. For CTR mode only, accept a ReadableBuffer for counter=. (an int would remain accepted and ignored in all modes)
weird, I tried it now connected to different computer, may be using different CP210x driver too and at is better, CP is available on the extension board usb, but it still disconnects the CIRCUITPY after a while - this is Win11 machine, no antivirus (I have kaspersky on previous one, but NO issues with CP till now on any board - RP2040, ESP32s2, SAMD21...) and I used different usb cable too... now I am trying bootloader 202 + CP as in sony doc
no - usb device not recognized still
Device USB\VID_0000&PID_0002\6&3ae63acd&0&2 was configured.
Driver Name: usb.inf
Class Guid: {36fc9e60-c465-11cf-8056-444553540000}
Driver Date: 06/21/2006
Driver Version: 10.0.22000.1
Driver Provider: Microsoft
Driver Section: BADDEVICE.Dev.NT
Driver Rank: 0xFF0000
Matching Device Id: USB\DEVICE_DESCRIPTOR_FAILURE
Outranked Drivers: usb.inf:USB\DEVICE_DESCRIPTOR_FAILURE:00FF2000
Device Updated: false
Parent Device: USB\ROOT_HUB30\5&1a805c5...
@tulip sleet Huzzah! ```Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Touch on: A4
Touch on: A5
Touch on: D10
Touch on: D11
Touch on: D12
Touch on: LED
Touch on: SDA
Touch on: SCL
Touch on: D5
Touch on: D6
Touch on: D7
Touch on: D9
LED should be D13, but, I'd rather have LED be the primary pin, so... too bad.
I will start a release as soon as the merges finish.
Right on. Thanks so much!
Probably should have swapped D7 for I2C_POWER_INVERTED, but the guide refers to pin 7 on the pinouts page, so..... I was leaving the power-related pins alone, and glossed over that.
Re: NRF52833
Having gone over the memory mappings, I'm still left with the only clue I have as to why CircuitPython won't deploy onto the 833.
nrfjprog -f NRF52 --program firmware.hex -erasechip --verify --log Parsing image file. Verifying programming. ERROR: [ nRF52] - Data does not match in address range [0x00027000-0x00027100] (Flash) ERROR: [ nRF52] - Expected byte value 0x02 but read 0x00 at address 0x00027002. ERROR: [ nRF52] - Flash verification failed. ERROR: [ nRF52] - Failed while verifying file firmware.hex. ERROR: Write verify failed.
If you recall, the reason why I suspected that the SD had gone into the application space is because of this error... now I'm wondering if it's the reverse: The flasher is reading 0x00, but expects 0x02.
Curious how I can find out what it's expecting (i.e. what's supposed to be in that address) vs what it's getting (what's actually in that address).
Anyone have any thoughts where I can look, here?
Note: I've tried changing -erasechip to -erasesector - no difference.
The .hex file is human readable
(Tangentially related, three backticks on either end of a code block, makes a codeblock - see the #welcome channel for details) codeblock
Ok. I have it open in vscode. Am I correct in assuming that this file should be loaded to the 833 starting at 0x27000?
Nice π Thanks so much π
yes, it should
@onyx hinge what ulab branch should cp be tracking?
@slender iron main or master if they haven't shifted yet, I think. I haven't kept up with news from 'over there'.
kk, cp is still set to use the adafruit fork
will fix it in my upcoming submodule pr
so it is...!
as far as I can get git to tell me, we don't have any commits that they don't have in master.
we had to take one compatibiltiy change, maybe for mp 1.17 merge, which must have been taken upstream
ya, it is in upstream
but they haven't released since 3.3.1 so there's not really anything to update to
ya, I'm not changing it. just fixing the upstream url
This also sets rpi-firmware as shallow in case submodules are updated manually.
Fixes #5619
Sorry about this folks. I'm a bit spoiled with my gigabit internet.
I've made a PR #5627 which will prevent the large download by setting shallow = true. This will fail, however, because the latest commit isn't the one we use. So, I added make fetch-submodules for the top level that does the specific fetch trick that the CI does. It should be used for updating instead of git submodule update directly.
I tried to build for ESP and .... I did not succeed. It's fine, I grabbed the build off of the PR, but I would have liked to have done it myself. Is it super bonkers and I should avoid it? Or am I simply missing something simple? (I installed cmake and ninja after running into those errors...)
@slender iron I don't need this submodule fix for 7.1.0-beta.1, I assume?
@slender iron The make fetch-submodules concept seems like a pretty significant change. We will need to document it somewhere obvious, I would think.
nope. it's just a tooling thing
i have to put it in "Building CIrcuitPython"
@idle owl I figured we'd update the build guide once it is merged in
Ok, sounds good.
you can do the old way but it'll fail on the rpi firmware folder
it won't hurt anything
Ah, ok. But folks will run into the error. And we will help. Heh.
once kattni's pr merge is finished, I will tag the release. @slender iron I can do the branching stuff later
then it has to build (twice) before I do the actual announcements
The Zero 2W hangs sometimes when accessing the CIRCUITPY drive. The backtrace ends in the irq handlers-esq thing. It's not clear how it's getting there.
I did some pin based tracing a while back and it seemed to occur after a USB interrupt but not during it.
This will involve:
- [ ] Proper pin in-use checking.
- [ ] Pin mux info in the pin objects.
- [ ] Support for the ARM PL011 UART.
- [ ] Support for the mini-SPI and regular ones.
- [ ] Updating I2C for the full muxing.
Supporting USB host of keyboards would allow us to have a self-contained workflow on the Pi 400.
We currently only support 64-bit CPUs. If we supported 32-bit, then we could support Pi 1, Pi 2 and the original Pi Zero.
With a .json on circuitpython.org we could have CircuitPython in the rpi-imager menu for easy discovery. This json has unzipped file size and sha256s that we'd need to generate at build time.
Example file: http://unofficialpi.org/rpi-imager/rpi-imager-octopi.json
Raspberry Pis use a Cypress wifi (formerly broadcom) chip for WiFi and BLE. Adding support for it would give WiFi access to the port.
MicroPython has support for the chips for the PyBoard D boards that use a WiFi chip from the same family. MP code: https://github.com/micropython/micropython/tree/master/drivers/cyw43
@tulip sleet we should include https://github.com/adafruit/circuitpython/issues/5628 in known issues in the notes
I will add it. I have the blog post and forum post set to go for later.
so, final results of testing:
I tried also recoverytool to clean main board and then tested both bootloader 2.3.0 +CP7 then (clean again) and 2.0.2 +CP7
After such clean flash, it works for a while, MuEditor connects to CIRCUITPY and console, but when I try test script (attached), it probably stops working and windows reports after minute or so - usb device not recognized...
so, final results of testing:
I tried also recoverytool to clean main board and then tested both bootloader 2.3.0 +CP7 then (clean again) and 2.0.2 +CP7
After such clean flash, it works for a while, MuEditor connects to CIRCUITPY and console, but when I try test script, it probably stops working and windows reports after minute or so - usb device not recognized...
I just saw some of the new Blinka
Bob Ross blinka might be my favorite
Also Blinka teaching circuits is also adorable
@slender iron tools/ci_fetch_deps. py is breaking when attempting to do the circuitpython-org update
this is a new file. It's trying to do the "website" port, which it's not prepared for
the placement of the error is a bit misleading in the logs
python tools/ci_fetch_deps.py website refs/tags/7.1.0-beta.1
target ends up being "website":
else:
p = pathlib.Path(".").glob(f"ports/*/boards/{target}/mpconfigboard.mk")
if not p:
raise RuntimeError(f"Unsupported target: {target}")
config = list(p)[0]
should probably be p = list(...) otherwise the if not p is testing a generator
but that's a secondary bug
I'm not sure why it's doing this at all for the website CI action
I think I can run this by hand. I did that once before
- name: Get CP deps
run: python tools/ci_fetch_deps.py website ${{ github.ref }}
in create_website_pr.yml should probably not be there
I added some print statements inside shared-binding/nvm/ByteArray.c: https://github.com/FoamyGuy/circuitpython/blob/21eb5758e794a7833db37ca8c0819dd06a94c090/shared-bindings/nvm/ByteArray.c#L100-L144
It doesn't always crash on the same line. Here is the output from several test runs showing where the last print that occurred before the crash.
inside type if 119
after big if 139
after check binary_get_size 135
after set src_items 131
after check binary_get_size 135
after check b...
Automated website update for release 7.1.0-beta.1 by Blinka.
New boards:
- raspberrypi_pi4b
- raspberrypi_zero2w
- raspberrypi_cm4io
- adafruit_qtpy_esp32s2
New languages:
- ru
Run the Jekyll build on pull_request as well to make sure it works
sorry about that @tulip sleet. I think I added it because of a previous submodule thing
np, I was able to run the circuitpython-org update as myself
i just had to generate a temp token.
Looks good. Thanks for updating the URLs.
Thanks Scott! It wasn't only the speed, I was pulling my hair out trying to free up space on my little build PIs, got up to 15G but still wasn't enough.
Anyway, I'm really clueless when it comes to make so I"m sure I'm doing something stupid. This is what I get when I try the make fetch-submodules:
make fetch-submodules BOARD=adafruit_feather_esp32s2
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
find: β../../extmod/ulab/codeβ...
all CPy builders: note there is now a new way to fetch submodules, which prevents fetching all the commits in some large submodules (in particular the RPi broadcom firmware repo, which is very large). You do cd circuitpython; make fetch-submodules. See https://learn.adafruit.com/building-circuitpython/build-circuitpython#fetch-the-code-to-build-2986719-1.
Can someone help explain why the CircuitPython alarm module is not available for the SAMD5x boards like the Feather M4 Express? That chip clearly has support for several different sleep modes as well as ways of also maintaining RTC states in certain sleep modes. Is that something that can be added, and where do I start digging to come up with a PR, perhaps?
It actually sounds like alarm was added for SAMD chips in the beta that was released today: https://github.com/adafruit/circuitpython/releases/tag/7.1.0-beta.1
aww yeah
Thanks, Dan!
Alright, will mess around with that tomorrow then, will have to upgrade both the RP2040 and the M4 to 7.1 b1.
I am trying this now with the latest firmware on the M4, but I am getting ImportError: No module named 'alarm'. I'll follow up in the morning. But, I have to go to bed now.
I will try to work on the dwc2 host driver for tinyusb. It is only 2.0 comparing to xhci though it will be much simpler/easier to add support. It will also enable host support on other ports such esp32sx and stm32 as well.
alarm was mostly implemented for SAMD51, but was only turned on for a few SAMD51 boards (some satellite boards). To turn it on for all boards requires more work; I am looking at that now.
SAMD sleep was only turned on for a few SAMD51 satellite boards. Other people want to use it now. When I turned it on for all SAMx5x boards, I had to define ο»Ώboard_deinit()ο»Ώ, which was conditionally prototyped in supervisor/board.h only when CIRCUITPY_ALARM = 1.
That means board_deinit() had to be conditional on CIRCUITPY_ALARM = 1 in all board.c files, which is actually not true right now. Rather than do that, since it is usually an empty function anyway, I removed the conditi...
Just tried to build again - the build process is different but still has a huge size associated with it. Seems to fail around ports/broadcom/firmware. Take a look at the terminal output :
$ git submodule sync --quiet --recursive
$ git submodule update --init
Submodule 'data/nvm.toml' (https://github.com/adafruit/nvm.toml.git) registered for path 'data/nvm.toml'
Submodule 'extmod/ulab' (https://github.com/v923z/micropython-ulab) registered for path 'extmod/ulab'
Submodule 'froz...
Do not do this anymore:
$ git submodule sync --quiet --recursive
$ git submodule update --init
Instead, do this:
$ cd circuitpython # go to top level
$ make fetch-submodules
That does something trickier, which fetches only as much of a submodule as needed. This was added in #5627, which closed this issue.
The https://learn.adafruit.com/building-circuitpython guide has been updated to reflect this.
make sure you are setting pin 7 to be output and LOW to enable the i2c power!
Many thanks :) I suspected it was me
Happy little circuits! (I'm really happy about this one too.)
For my own clarity... and yes I looked at the guide but I want to make sure I get it.... make fetch-submodules replaces the entire git submodule sync --quiet --recursive && git submodule update --init command?
Iβm glad my Blinka teaching idea made it through the gauntlet π
I like the way it turned out, all of them really
Actually, that one was me. I wanted her drawing something super complicated on a chalkboard. That's what we got. That's only half the Blinkas, there is another set coming soon.
I think your backpack one made it in though?
If that was you..
Yeah, back pack
Yeah I believe I kept that one in the list.
Should be part of the second set if they went with it. Which I'm pretty sure, based on this, that my list is canonical.
I had mentioned in the back pack explanation about her impact on education so I thought there was a correlation π
Ah right! Nope, different things entirely.
Her writing in a notebook wearing half-moon reading glasses went with my complicated things on a chalkboard idea.
Well, I love the blinka Bob Ross and drawing a circuit
Basically, I wanted her being a smartypants.
They are super adorable
Absolutely π
Bruce pretty much always nails it. I might have had feedback on something once or twice, and it was preference stuff, not "fix this pls" type feedback.
Some people just absolutely nail their craft
Itβs always exciting to see what those people do and how they do it
For sure
The time.time() function was calling a rtc_get_time_source_time() function that was using MP_STATE_VM(rtc_time_source). Unfortunately the MP_STATE_VM(rtc_time_source) was NULL because it was never set. This caused Spresense to crash after calling time.time(). MP_STATE_VM(rtc_time_source) is set in the rtc_reset() function, so adding it fixed the issue.
This PR fixes https://github.com/adafruit/circuitpython/issues/5625
Thanks for finding this. It seems the problem is with the time.time() function. This was causing your problems on Spresense. I made a PR to fix it.
Thanks for your report. I've reported it upstream at https://github.com/v923z/micropython-ulab/issues/457. Once upstream fixes the bug, we can incorporate the new version into a future CircuitPython release.
As you've identified, using the non-ulab sum() function in this case can get you an accurate result.
GM. <noob>Is there an official lookup to map specific feathers to the available atmel-samd/boards for ada boards? (I'm compiling for a bluefruit sense, and want to be sure I get asyncio)</noob>
@half radish I don't quite understand the question. You want to see what's available for the Bluefruit Sense, and add asyncio if it's not available?
Hmm. @tulip sleet Why isn't asyncio or some related naming scheme showing up in the support matrix page?
I'm looking at "latest".
Is it not actually part of CP?
asyncio is a Python library. It really only requires async/await support, and they are keywords
async/await is turned on for all boards except SAMD21 and similar small-flash boards
Thanks Dan
@tulip sleet I just misread it as "Competitive Multitasking" and now I need that to be a thing.
that's a sport where you watch TV, cook, talk on the phone, and solve a crossword puzzle at the same time. First one to finish the puzzle with fewest mistakes, plus placing first the British Baking Show simultaneously, wins
π Well played.
FYI, looks like the build action is failing.
After doing a clean clone and the make fetch-submodules I get this with git diff
Did miss something?
jerryneedell@Mac-mini circuitpython % git diff
diff --git a/ports/broadcom/firmware b/ports/broadcom/firmware
--- a/ports/broadcom/firmware
+++ b/ports/broadcom/firmware
@@ -1 +1 @@
-Subproject commit 6a5207946edcd45813d1dd1572ca8bd8101b68b6
+Subproject commit 6a5207946edcd45813d1dd1572ca8bd8101b68b6-dirty
jerryneedell@Mac-mini circuitpython %
rpi-zero2w: vectorio shapes are always black. The pixel_shader palette is ignored. Not yet implemented, or should I write an issue?
@tulip sleet you magnificent person, you! That was quick, and also, I think I love you.
well, it's not done yet, and it's my job π
A lot of people do jobs. But very few immediately address an issue that was reported last night at like 1am in the morning. π
Looks like there's only one board that's failed so far in the builds for the PR.
(but there's still 127 queued, lol)
Possibly a permission issue, as pull requests are from forks and not a trusted source. build.yml uses github secrets.
More info here on how to fix it:
https://dev.to/petrsvihlik/using-environment-protection-rules-to-secure-secrets-when-building-external-forks-with-pullrequesttarget-hci
Example Brent did yesterday:
https://github.com/adafruit/Adafruit_IO_Python/commit/6587c92bb6fd124c36f9fabe66a2325aeea8dd97
Interesting... I'm getting mportError: no module named 'asyncio' after loading my adafruit-circuitpython-feather_bluefruit_sense-en_US-7.1.0-beta.1.uf2
I only reported this issue last night at 01:30. There's already a PR. Much love, my friends.
asyncio is a CircuitPython library. You have to get it from the library bundle or use circup to put it on the board.
What is the directory/file in lib/ for the 7.x bundle? I pushed everything from adafruit-circuitpython-bundle-7.x-mpy-20211127/lib and still have the issue.
ack, it's supposed to be in the bundle. I added it. In the meantime, download from here: https://github.com/adafruit/Adafruit_CircuitPython_asyncio/releases
don't push everything, that's too big
ACK
deploy should be guarded by an if: condition, then?
Wondering if anyone has successfully deployed to an nrf52840?
Also, morning everyone π
Deployed what?
circuitpython π
All of us? I'm confused, I think, about what you mean by "deployed".
The prototype is simplest, I would make it unconditional.
I think Scott will know better than me how the deinit functions should be related. I would say that unless we think there's a reason that setting up for deep sleep shouldn't call status_led_deinit(), it becomes simpler (less prone to mistakes) if it is in main and not in board_deinit.
Or I'm not confused by it, and I'm confused about the question in general.
Put another way, is anyone actively running circuitpython on an nrf52840?
Absolutely. What's your issue?
No issue - considering using this board over the 833 since the 840 appears allow circuitpython to be easily flashed onto the device π
Ah yeah, it's as easy as it is with any other CP-compatible board.
I appreciate it, @idle owl π
Adafruit doesn't sell any '833 boards, so they don't get as much constant testing as our own '840 boards. Hence the issues people have been seeing with the '833 builds.
@tulip sleet I completely get it, and this isn't a complaint - sorry if it came off that way.
@tulip sleet FYSA: dafruit-circuitpython-asyncio-7.x-mpy-0.5.0 β― ls -lai total 12 1447675 drwxrwxr-x 3 tiny tiny 4096 Nov 30 08:46 . 1325592 drwxrwxr-x 5 tiny tiny 4096 Nov 30 08:46 .. 1447688 drwxrwxr-x 2 tiny tiny 4096 Nov 30 08:46 examples <- only examples are present... no mpy. I checked the other bundles from the release and it's all just examples.
You guys have been immensely kind and patient with me, but my project is losing time on this. At this point I'm going to suggest to my team that we move to a board that's well supported if we want to proceed with CircuitPython π
But I can't thank you enough π
yes, it's confusing, it was added to the bundle, but it wasn't in the zip. I'm trying to track that down; very odd
np, the '833 builds were contributed by other folks, so we don't necessarily try them ourselves before merging.
Do you want me to file an issue for you?
no need, i'm already working on it
Hmmm -- I reran this on my linux box and did not see the diff ....
never-mind...
can anyone else who has built the broadcom port confirm taht this looks normal jerryneedell@jerryneedell-ubuntu-macmini:~/projects/circuitpython/ports/broadcom$ make BOARD=raspberrypi_pi4b Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity. mkdir -p build-raspberrypi_pi4b/genhdr GEN build-raspberrypi_pi4b/genhdr/moduledefs.h QSTR updated aarch64-none-elf-objcopy -O binary build-raspberrypi_pi4b/kernel8.elf build-raspberrypi_pi4b/kernel8.img cp build-raspberrypi_pi4b/kernel8.img build-raspberrypi_pi4b/firmware.kernel8.img 0+0 records in 0+0 records out 0 bytes copied, 0.000169497 s, 0.0 kB/s mkfs.fat 4.2 (2021-01-31) adding: build-raspberrypi_pi4b/circuitpython-disk.img (deflated 95%) in particular , the 0 bytes copied
the files are all there ```-rw-rw-r-- 1 jerryneedell jerryneedell 13355984 Nov 30 12:07 firmware.disk.img.zip
-rwxrwxr-x 1 jerryneedell jerryneedell 1576712 Nov 30 12:07 firmware.kernel8.img
-rw-rw-r-- 1 jerryneedell jerryneedell 16327 Nov 30 12:07 firmware.objs
drwxr-xr-x 3 jerryneedell jerryneedell 4096 Nov 30 12:06 genhdr
-rwxrwxr-x 1 jerryneedell jerryneedell 7625080 Nov 30 12:07 kernel8.elf
-rw-rw-r-- 1 jerryneedell jerryneedell 4589398 Nov 30 12:07 kernel8.elf.map
-rwxrwxr-x 1 jerryneedell jerryneedell 1576712 Nov 30 12:07 kernel8.img
OK, cool. Thanks
@hathach The keyboard on the Pi 400 is connected through the xhci host (not dwc2) so dwc2 host support won't work for it. It'd be good to have on the other ports though.
cool ! ```
soft reboot
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Code done running.
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 7.1.0-beta.1-4-g8d6957b79 on 2021-11-30; Raspberry Pi Zero 2W with rp3a0
Nicely done!
@slender iron when you have a chance, can you post a link to your "debug hat" on oshpark.
I think the build step is doing fancier things than just building the site like fetching and committing new files. Could we split the data update from the build so that 1) we don't build on a schedule and 2) everyone can build on their branch.
It's all @slender iron
I know he did the work for it, but it sounded like getting it going wasn't entirely straightforward. So you get some kudos for getting through it. π
Thanks! It took a few tries
@solar whale https://oshpark.com/shared_projects/fBq76nP9
Thanks! May come in handy... plus your boards are fun to build!
In https://github.com/adafruit/circuitpython/pull/4497 we added support for write_value . At that time, adafruit_sdcard.SDCard + bitbangio.SPI were tested and able to mount an SD card. (sdcardio, the internal implementation, only works with busio.SPI). start/end are supported in readinto and write_readinto though still not in write for some reason.
So, I think adding start/end to bitbangio.SPI.write is the only thing missing.
@daring pumice there was recently an enhancement made to Circuitpython.org that allows you to filter downloads by processor family. If you click that filter button on the Downloads page and then scroll down a bit there is a section with processor family.
Once you select the one(s) you want you can close the filter again with the X in the top right and you'll be left with just devices that use that processor:
very helpful if your interested in seeing what devices are out there today for nrf52840 or another given processor.
just when you're about to give up!
lol yup
@tannewt Is this the fix for the problem I encountered with the circuitpython.org PR generation for 7.1.0-beta.1? I don't see a reason to run ci_fetch_deps.py in create_website_pr.yml.
very odd -- this is reproducible on the Mac, but non under Linux (Ubuntu 20.04)
Does anyone know how to fix it on the Mac?
@onyx hinge is this related to what you are debugging right now? https://forums.adafruit.com/viewtopic.php?f=60&t=185718
@jpconstantineau I have it working. Can you verify if this works?
Steps:
After cloning the repository and updating the submodules
- Build
mpy-crossas given in the current docs. (Note: there may be some manual editing required to get this to build on windows, but it can be done). - Move to /ports/nrf
- Plug your USB cable into the J-Link port, located on the left side of the board above the battery
- Power up the 833
- Run
make V=1 BOARD=pca10100 sd- this will create ...
@scath999 Great! How was this different from what you were doing before that was not working?
@dhalbert I think @jpconstantineau and I were missing a step: I didn't do step 5, which accounts for the memory errors I was getting before.
The intuition that I was missing this was gathered from reading the Nordic Dev forums, but strengthened by the docs found here
All in all seems like user error. However, these instructions appear on the page for the 840 board - I never got that far in the instructions beca...
I think we do want a status_led_deinit before deep sleep to shutdown any neopixels. We also want a new deinit_rxtx_leds to undo https://github.com/adafruit/circuitpython/blob/main/supervisor/shared/status_leds.c#L330
No, that wasn't on my radar.
There is ports/nrf/README.md, and there are some README.mds in some individual board directories. They don't mention flashing the SD specifically, because it would have been flashed when you flashed the bootloader (or should have been).
If you would like to submit a PR to update that README, that would be great. In the past I have thought of just deleting the individual board README's, because they are not kept up to date, but if there are nuggets of info in them that could be hoisted ...
Looks like I replaced a submodule fetch that got tags: https://github.com/adafruit/circuitpython/blob/387a8a46b37e9e16461afe23aeaab498097ed7a5/.github/workflows/create_website_pr.yml#L34
I think it will need this.
This may account for the "build" instructions, it doesn't account for the standard way of simply uploading the UF2 to the board bootloader which is what most users would do to setup their boards.
You appear to flash twice. One with the new softdevice, the other without. Would we need 2 different uf2 or a different bootloader (one with the other softdevice)
@jerryneedell what does git status show in the firmware directory and at the top level?
Also what are the versions of git you are using?
jerryneedell@Mac-mini firmware % git status
HEAD detached at 6a52079
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: modules/5.10.81+/kernel/net/netfilter/xt_DSCP.ko
modified: modules/5.10.81+/kernel/net/netfilter/xt_HL.ko
modified: modules/5.10.81+/kernel/net/netfilter/xt_RATEEST.ko
modified: modules/5.10.81+/kernel/net/netfilter/xt_TCPMSS.ko
...
jerryneedell@Mac-mini firmware % git --version
git version 2.31.1
jerryneedell@Mac-mini firmware %
@dhalbert the nrf52 bootloader only has a uf2 with the old bootloader and not the 7.x one. Since 6.x isn't officially supported by Nordic on the 833, I suspect this should be resolved at the bootloader level.
I do seem to remember someone working and getting a PR on this.
that was on Mac
on Linux ```jerryneedell@jerryneedell-ubuntu-macmini:~/projects/circuitpython/ports/broadcom$ cd firmware/
jerryneedell@jerryneedell-ubuntu-macmini:~/projects/circuitpython/ports/broadcom/firmware$ git status
HEAD detached at 6a52079
nothing to commit, working tree clean
jerryneedell@jerryneedell-ubuntu-macmini:~/projects/circuitpython/ports/broadcom/firmware$ git --version
git version 2.25.1
Check this out: https://github.com/adafruit/circuitpython/blob/f8493db2170fa7bef6da4ac5a557f2cd5dfd71cf/ports/raspberrypi/supervisor/internal_flash.c#L134-L138
You'll want to modify the port specific code in the common-hal folder, not the code in shared-bindings.
@slender iron do you have a few minutes to voice chat about the broadcom port usage?
sure!
@dhalbert Whatever I can do to help :) And thank you again for all your support - you and your team have been endlessly patient and kind. I think simply mentioning a more verbose set of steps in case dragging and dropping fails would suffice.
@jpconstantineau Did the steps I outlined above work for you? If so, would you agree that a more granular set of instructions might be helpful in the event that dragging & dropping doesn't work?
@scath999 I am in between switching PCs (darn black Friday sales...). It will take some time before I can test it out. However, the softdevice discrepancy does make a lot of sense. I think we will need to confirm that a bootloader update with the correct softdevice will resolve the issue of the CP UF2 drag/drop not working.
@jpconstantineau Understood.
@dhalbert I will wait for JP to confirm the steps work, or report that they don't, before submitting a PR. Good?
Sounds fine! Note the. I believe when you load the bootloader with the flash Makefile target there, it also loads the SD. But that is not the case for CircuitPython.
Looks good. Thanks for updating the URLs.
I think the build step is doing fancier things than just building the site like fetching and committing new files. Could we split the data update from the build so that 1) we don't build on a schedule and 2) everyone can build on their branch.
I'm wrong about this. The build step was fine. I'll add a condition on the deploy.
I wonder if we need to do some sort of clean after checking out the correct commit. Files from the missing commit may not be deleted on checkout of a different commit.
Build is green @makermelissa. I had to prevent the deploy when running on a PR.
@tulip sleet Do you know offhand if "time.monotonic()" will "reset" after a "deep sleep" -- that is, with the resolution of the time.monotonic() increment get reset by a deep sleep or will it keep accruing?
I think it may vary by board. @slender iron has talked about always resetting it for consistency.
OK -- it's relevant to a question that just came up https://github.com/adafruit/Adafruit_CircuitPython_RFM9x/issues/67
I'll do some testing...
Awesome, that works for me.
Not sure if you're waiting on Justin to also review.
@solar whale At least it does not seem to reset on the platforms i've tested it on, even when pressing the reset button.. i assume that would be kinda the same?
(that would be nRF)
Looks like I replaced a submodule fetch that got tags:
Comparing with what it used to be:
https://github.com/adafruit/circuitpython/commit/a1052d5f73ff679c5040863fd606fed22736c9fd#diff-b754fd8b187edf5ee02a9009efe657b874a3c021d90f8fe97120800a2ad0deec
@tannewt I could just revert to the old thing. Or I could add website as a handled arg, which doesn't fetch any submodules (I think). I'm a bit confused because the depth: 0 would not fetch tags?
@mrdalgaard @jepler Thanks for taking the issue upstream! Based on Jeff's comment, I have updated the code, added a small test script, and generated a new tag, https://github.com/v923z/micropython-ulab/releases/tag/3.3.7
@tannewt Scott, is it possible to set up github in such a way that whenever you add the ulab tag, I get a notification? I would have fixed the glitch much earlier, but I took note of it only, when Jeff specifically opened the issue over there.
@tulip sleet Should we fix the bundle instead of fighting with getting your temp fix passing?
Or is it a simple fix...
To make it pass.
I'm not sure it's fixable to make the 6.x mpy-cross work on that source code. We are still building 6.x bundles until 8.x, is that right?
Or until 7.1 maybe.
But yes.
We're still building them for now.
The mpy-cross problem will occur with either a comprehensive or a quick fix to include asyncio
I may be stuck. I don't think I can conditionalize it, because it's kind of a syntax error, not just some new function that's in 7.x
btw, what do you think of FoamyGuy's suggestion about renaming it adafruit_asyncio? I didn't do that because it was so fundamental
but we have adafruit_hashlib and adafruit_requests, etc.
Question about that.
Is it meant to be a literal drop-in for the Python version?
With literally no changes to the code
or does it not work that way.
it is a subset, in the same way that our time is a subset
MicroPython added some extra stuff to it, which I was going to move to another module
yes...
I mean I'm ok with calling it adafruit_asyncio but if your intent was for the code to work on say an RPi with no changes, that might prove to be an issue.
It's about your intention, I suppose.
do we intend that code with adafruit_requests work without changes on an RPi? Do we have projects that do that?
Frankly, I would rather not have another library without adafruit_ on the beginning of it. NeoPixel is special.
No idea.
I can ask Brent, he might know.
But it obviously would need to be changed.
So...
@slender iron what do you think about @lone axle 's idea of renaming asyncio to adafruit_asyncio, as with requests, hashlib, etc?
Do you plan to, or did you already, publish it to PyPI?
no, it will not be on Pypi, because you could just use the regular asyncio
did we publish adafruit_requests to pypi?
yes, hmm
Yes we do
is requests strictly a subset?
Good to know. I'll do some testing of it and supervisor.ticks_ms()
@timber mango what MCU are you testing it on?
I don't know it well enough in either form to have an answer to that.
@idle owl - ok minor thing, if we did rename it, then I should capitalize the repo name, hunh? https://github.com/adafruit/Adafruit_CircuitPython_asyncio/ --> https://github.com/adafruit/Adafruit_CircuitPython_Asyncio/
@tulip sleet I think my preference is asyncio because, as kattni points out, that is most compatible
No. Keep it lowercase.
I prefer consistency across the libraries.
in retrospect, we might have named adafruit_requests just requests
We didn't. And it's on PyPI, so you can use it with Blinka. etc.
The mpy-cross error message is something else :/ ~/Downloads/mpy-cross.static-amd64-linux-6.3.0 funcs.py dexpresed ing back (most recent call File "funcs.py", line 25stionusEUSyntaxError: altos ess not 'async for' or 'async with' outside async fu
But, I don't know if it has things in it that requests does not.
I think I will not change it now, but keep it under advisement. I think the bundle package prefix thing is something that should be fixed anyway. It makes the community bundle .yml kind of a mess right now. Not sure how I will fix the 6.x issue, though. This gets back to different versions per bundle, which we never solved
Ok
add a .bundle-6.x-disable file ?? hmm ugh
@solar whale That was the nRF
I guess we can do it for this one library? With a comment about removing it when it's time, and removing whatever code you added to the bundle to make it work?
Or leave it in in case we need it again I guess.. I don't know.
I hope this is an unusual situation.
so suppose we added, say, some other library that depends on 7.x features. Right now we conditionalize the code to do a version check
this is the first case where it simply won't compile on 6.x
i needto take a walk. This is quite a rathole.
Ok. We'll be here.
@tannewt, ok, I think the latest commit will work, because it fetches tags from circuitpython, but ignores all submodules.
We should align this to be a compatible subset of https://pycryptodome.readthedocs.io/en/latest/src/cipher/aes.html which seems to be the standard python crypto library today.
For now, I'm not sure of the value of taking this patch. The code works as-is, except for any confusion (possibly mine) over the distinction between the IV and the counter in CTR mode. However, _not requiring IV= in CBC is a large footgun, and footguns should be avoided in crypto even more than in other contexts.
.. and correctly handle footguns like forgetting to specify IV=.
I did some work on improving the API in #5623 but it did not reach a mergeable state.
This tests that the 3 modes of aesio work. It doesn't introduce any of the incompatibilities of #5623. Closes: #5566
CircuitPython version
Adafruit CircuitPython 7.1.0-beta.1-4-g8d6957b79 on 2021-11-30; Raspberry Pi Zero 2W with rp3a0
Code/REPL
import board
import displayio
import vectorio
display = board.DISPLAY
splash = displayio.Group()
# color background
pal0 = displayio.Palette(1)
pal0[0] = 0x339933
bg = displayio.Bitmap(display.width, display.height, 1)
grid = displayio.TileGrid(bg, pixel_shader=pal0)
splash.append(grid)
pal1 = displayio.Palette(1)
pal...
Oops, forgot display.show(splash). Circle is still black, but now you can see the green background.
This includes TestFlight links for the apps.
I'm not sure where we want this to live in the menu. @tylerdcooper may have ideas on where to add a "Connect" link.
We can merge this before adding a link if we want to see the existing page at https://circuitpython.org/connect/
@tulip sleet Any clarity?
no, I wasn't really puzzling over it, listened to a podcast instead. I have three PR's in the fire right now and am fixing another one. I am kind of inclined not to rename asyncio. I do think we need some kind of mild versioning on libraries for the bundle. I can't solve that otherwise, I think
I thought you'd already concluded you're not renaming it. I didn't think that one was still on the table. You could have it do both if it finds nothing, and only do the specified one if it finds the versioning file. Then you can add something only to asyncio, and we're not doing another massive lib sweep.
the version file could be positive or negative. If positive it would declare a minimum version. It could be in the filename, or inside a file with a standard name
Absolutely needs to be a standard filename. I don't want to mess around with mixed filenames.
That sort of thing makes patching really difficult.
@tulip sleet But you're saying it has to be present on all libraries for your idea to work?
phone call, bbiab
@idle owl if the file is absent, no restrictions. If the file is present, minimum version, <n>.x. How does that sound? Would you like it to be a dot-file?
I discussed the options at some length in an issue years ago
Yes, a dot file would be perfect.
will find it
And that sounds excellent.
CircuitPython version
Adafruit CircuitPython 7.0.0 on 2021-09-20; FeatherS2 with ESP32S2
Code/REPL
import time, gc, os
import adafruit_dotstar
import board
import feathers2
# Make sure the 2nd LDO is turned on
feathers2.enable_LDO2(True)
# Create a DotStar instance
dotstar = adafruit_dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=0.5, auto_write=True)
# Say hello
print("\nHello from FeatherS2!")
print("-------------------...
Thanks. Let's do this.
ok, I will figure something out!
Feel free to tag me when ready for a look.
none of the proposed solutions are a version file, it looks like
Ok
ESP32-S2 board with a SOLO module vs. with a WROVER module... surely I'm imagining that the SOLO is faster despite being essentially identical firmware on both boards? SOLO has integrated SPIRAM, WROVER has separate SPIRAM if I read the datasheets right, but the CP board files are the same with respect to speed etc.
@languid whale Hello, do you mind if I DM you?
@idle owl https://github.com/adafruit/Adafruit_CircuitPython_Bundle/issues/181 is really more about different versions of a single library for different versions of CircuitPython, rather than just "here's a new library that doesn't work with older versions of CPy".
so solving a somewhat different problem
That's probably good since you had a different solution.
@idle owl please do!
Is is possible to remove or exclude certain files from a frozen driver when building for a specific board?
Inspired by the BME280 library, with its basic and advanced classes, I'm thinking about suggesting an advanced driver revision for the APDS9960, since the driver gets pretty huge (as much as like ~12k vs ~4k) when exposing all of the config options.
Since APDS9960 gets frozen in for the prox trinkey builds I'd prefer to avoid breaking things there by excluding any prospective advanced file if possible.
@dusk mauve my preference would be a separate library
Thanks! That makes the most sense structurally. Would that be possible within the same repo? Or would it require setting up (and maintaining) separate repo altogether?
Ahh, ok. Makes sense. Seems like a lot of work to enable features 99% of users probably wonβt care about. π
all the more reason not to have everyone install it
plus separate repos are easier to find
That makes a lot of sense.
Any examples of implementation of that model that come to mind? Iβll be taking a trip through some driver repos anyway so I may just stumble on one eventually
CircuitPython version
Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit Feather M4 Express with samd51j19
Code/REPL
# CircuitPython 7.0
import frequencyio
import board
import time
frequency = frequencyio.FrequencyIn(board.D11)
# Loop while printing the detected frequency
while True:
print(frequency.value)
# Optional clear() will reset the value
# to zero. Without this, if the incoming
# signal stops, the last reading will ...
I couldn't follow the development of 7.x version due to personal problems, so it's hard for me to guess what could have been changed around the PWM code for SAMD51. One thing that especially baffles me is that if I create a PWMOut from Python code, and set its duty_cycle β which calls exactly the same function as the auto_brightness β the loop exists correctly and there is no hang. Next time I have a chance to work on this, I'm going to see if adding delays affects the issue.
In the ...
CircuitPython version
"I am on CircuitPython 7, and tried reverting back to 6.3, same results on both."
Code/REPL
# If you have an AirLift Featherwing or ItsyBitsy Airlift:
esp32_cs = DigitalInOut(board.D13)
esp32_ready = DigitalInOut(board.D11)
esp32_reset = DigitalInOut(board.D12)
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
# spi = board.SPI()
esp = adafruit_esp32spi.ESP_SPIcontrol(spi, esp32_cs, esp32_ready, esp32_r...
ah you are right, just run lsusb on pi400. keyboard is holtek device and attached to xhci roothub. I will try to pull out the xhci specs to see if it is similar to ehci.
I am the one who opened this on the forum. I'm using the PyGamer with an Airlift ESP32 wing, which works fine with the sample code. Inserting an SD card (no code change) causes a "Timeout waiting for SPI char". Init the SD card causes the above error where it gets the wrong response. Simply eject the SD card and reload, the wifi works again.
I've been following several Adafruit tutorials, such as this one, https://learn.adafruit.com/building-circuitpython?view=all, as I've been working on adding TinyZero support from this post: https://github.com/adafruit/circuitpython/issues/5393. I was working on the Build CircuitPython section, but I've encountered a few strange problems:
First, make BOARD kept failing at line 5 in mksdiodata.py - in ports/atmel-samd/tools. I fixed it by removing the f at the beginning of each string (why ...
I've run in into an issue when trying to check for the existence of a module that will work on an MCU and on a Pi (with Blinka) . In many libraries, I see this ```try:
import foo
except ImportError:
import bar as foo
but
on raspberry pi, the failed import is a
ModuleNotFound error , not an ImportError
For my application, the tested module is not present on the Pi and I want to catch the error .
How would you reconcile this? If I just use a bare Except, pylint throws a fit...
hmmm -- never-mind -- except ImportError appears to work on the Pi -- I'm confused, but relieved....
ah that would be because:
>>> issubclass(ModuleNotFoundError, ImportError)
True
Thanks -- I just stumbled across that myself ... I should have googled first...
@tulip sleet Do you know if the time.monotonic() loses accuracy on a Raspberry i in the same way it does on an MCU?
does printing a float show more digits?
we are using internal object representation "A" for the RPi, which uses "boxed" floats, not immediate floats. I am honestly not sure if they are 32 or 64 bits. But they are at least 32.
e.g. how many digits does 1/3 show?
or time.monotonic()?
nice! thanks -- I'll test a bit more later -- have to go to a meeting π¦
I don't recall the specific situation it came from but I just recently changed some code from catching a ModuleNotFound error to catching an ImportError I think there must be some situation out there where it does end up as a ModuleNotFound because I believe when it was originally coded that way it was tested successfully somehow.
Ah, still catching up. It being a subclass and thus ImportError working in both situations is good news.
A 64-bit float still isn't unlimited precision. It looks like after a few thousand hours, nanosecond precision would be lost. after a few centuries, microsecond precision would be lost. (this is more of an issue for time.time(), where the epoch is 1970, not boot time or whatever) (I notice time_ns() has been added to cpython3 somewhere along the way, just like monotonic_ns())
I think we can live with that! We are dealing with milliseconds
Is there a core or 'standard' module/lib for CircuitPython that handles for RGB<->CCT<->Lux/Luminance type calculations? Looked for it in rainbowio, which seems to be a logical place for it to live someday, but so far its just the very useful colorwheel in there.
Its one of those things that seems pretty broadly useful but there are different ways to implement it, most leaning very heavily on floating-point math that could bog down non-FP-accelerated devices.
I'm curious about it since I'm wrapping up work on the APDS-9960 driver and it seems weird for it to include this colorutil utility module that has this broader functionality within it
This PR adds a common layout for content type pages. The /connect page is now styled to match the other content pages as well.
Looks like you used the libraries-page ID multiple times (being in the layout and specific pages). Multiple duplicate IDs in the same page (because of it being in the common layout too) is something we should avoid. If both are supposed to be there, we should change it to use class instead. Also, maybe change it to something less page specific sounding?
have you looked into FancyLED ? https://learn.adafruit.com/fancyled-library-for-circuitpython
Not yet! Thanks for the link. π
I don't know if it has what you want though, but it has some color conversion stuff
there are actually some potentially useful things in there that could provide for some low-code examples of uses for the APDS-9960 sensor, at the very least. thanks again for the link. π Also looking at the adafruit_rgbled library but that looks quite a bit simpler
the rgbled library is a driver for driving PWM RGB LEDs
Found some similar algorithms and patterns in the arduino/cpy libs for the somewhat similar TCS34725 sensor too
At first glance I really like the way its handled in the TCS34725 too.
Hah! Turns out the coefficients hard-coded in there come from one of the TCS families.. I love code archaeology, discovering the lineage of clever hacks through the ages.
This video was a pretty good overview: https://www.youtube.com/watch?v=SSrFv4a-zgU
The quote causes issue with sorting. This was the quick fix.
Should be able to close out: https://github.com/adafruit/circuitpython-org/issues/524
Need to make a couple more fixes quick.
Thanks for figuring that out.
First, make BOARD kept failing at line 5 in mksdiodata.py - in ports/atmel-samd/tools. I fixed it by removing the f at the beginning of each string (why that worked, I have no idea) as it would fail at each f-string line, and I also removed the f at the beginning of each string in mkcandata.py in the same folder, as it would experience the same error.
The f prefix is called an f-string. It is in newer versions of Python. What version are you using? You likely want python 3.8 or newer.
...
what do folks think about adding a regression issue label? that'd let us track how many issues are things that used to work
(and that testing could help prevent)
I don't know of any SAMD PWM changes off the top of my head so I'm in the same position you are.
In the mean time, should I remove the
auto_brightnessfrom thestageinitialization code for PyGamer and PyBadge, to make that library work? Should we add a note in DisplayIO documentation warning to never use that option?
It's up to you about stage.
I don't want to change the displayio docs because it should work. Instead of warning about a bug, we should fix it.
I don't think this is a CircuitPython bug. It appears that Windows sees the USB PID and VID just fine.
It might be a Mu 1.0.3 bug but it doesn't really matter since the latest beta works.
NOTE: after installing CP 7.0.0 on the FeatherS2, I also had to copy adafruit_pypixelbuf.mpy in order to get the default code.py to work (dotstar/neopixel failed to light). So the latest stable doesn't work out-of-the-box on the FeatherS2.
Please bring this up with @UnexpectedMaker who provides th...
Thanks for the bug. This may be related to the new addition of 32-bit color (really 24 bit) in displayio.
Yay for more tests! Thank you!
That looks good to me too. Thanks!
@v923z I don't know of one but I can try to remember to assign them to you or mention you in a comment.
rainbowio will likely remain simply the colorwheel due to size constraints.
Sounds like a good plan.
@v923z I don't know of one but I can try to remember to assign them to you or mention you in a comment.
@tannewt Assigment is OK. However, there is this https://github.com/marketplace/actions/issue-label-notifier It would be awesome, if you could set this up. Such a thing might be useful for others on your team.
@slender iron did you definitely need me/someone to take the december 27 discord meeting?
I don't know yet. I haven't talked with becca about it
i can do it
The "Frameworks" section of Awesome Circuitpython lists some things that are along the same lines as these helpful tools. That is the closest thing I am aware of to an existing place for stuff like this.
I agree it would be great to set up a spot to list them out specifically though if it doesn't exist today.
Another one to potentially add to the list is: https://github.com/bcr/blinka-cli
This is an interesting appnote about GPIO settings to reduce power consumption: https://www.st.com/content/ccc/resource/technical/document/application_note/group0/13/c0/f6/6c/29/3b/47/b3/DM00315319/files/DM00315319.pdf/jcr:content/translations/en.DM00315319.pdf
we tend to do floating inputs which are worse that pulling up or down
I don't have quite the right hardware set-up, but I did find an airlift featherwing.
I put it together with a Feather Adalogger and a Feather M4 Express.
I've got CircuitPython 7.1.0-beta.1 loaded. My airlift version is old, 1.2.2, while you've got an up to date version.
Unfortunately, I'm not reproducing the problem yet. With or without the SD card inserted, the AirLift example completes OK. Even if I delete the lines to initialize the SD card and remove/re-insert it so it is not y...
Would it help if I provided my code file? It looks practically same as yours. I can also try to record a video of it working and not working.
Is there any diagnostics I can try on my end? I tried adding debug=True to the esp32 ctor, but really didn't add much value...
CircuitPython version
CircuitPython 7.0.0
Code/REPL
N/A
Behavior
N/A
Description
After flashing to this BIN from here it does nothing. With original stock firmware board has some serial console OK (see below).
https://circuitpython.org/board/ai_thinker_esp_12k_nodemcu/
commands:
esptool --port COM10 --baud 460800 erase_flash
esptool --port COM10 --baud 460800 write_flash 0 adafruit-circuitpython-ai_thinker_esp_12k_nodemcu-en_US-7.0.0....
@onyx hinge I think you can start on 7.x.x bugs next
I know deshipu would like to fix the displayio crash #5476
If you can, please test with a different SD card too.
If you can, please test with a different SD card too.
Reproduced on Feather M4 Express.
This object has a finalizer, so once it's no longer referenced, GC can call that finalizer and then deallocate the storage.
In the case of a failure during construction (e.g., when checking validate_obj_is_free_pin_or_none) this will happen on an incompletely initialized structure. On samd, in particular, a newly allocated object (with construct never called) appears to be valid, so GC collecting it causes deinit() to do things, leading to a hard fault.
The double creation of the UAR...
@tulip sleet Those are the KB2040 files you emailed me right?
yes, and I loaded the .uf2 on a KB2040 to test
All I2C peripherals should be usable now. This also adds pin
in-use tracking and resetting.
Part of #5629
I've not needed a debug build in a long time. Are they available on S3 or do I need to build my own ?
Got my Kaluga setup and going to get some logs for weird Sockets behavior as discussed in an issue on Requests repo.
@idle wharf afaik you need to build your own, you'll need to disable some modules or something else to reduce the size https://github.com/adafruit/circuitpython/issues/4984
Thanks π
Would it also be possible to do custom partition magic on s2/s3 to avoid having to disable stuff?
oh, probably, didn't think of that π
Since I think the second ota partition isn't used for anything currently
who needs OTA when you're just debugging? π
in theory, I think there is OTA... I assume it works?
tinyuf2 just loads stuff into the first partition hardcoded IIRC.
I think if you're really careful, you could write code on a CircuitPython device to update its own firmware and code.py
I think that if you're doing stuff where you need debug builds on a regular basis, it might be worthwhile to dedicate a board to a custom partition table.
I don't think (did not check) the ESP32S Debug builds won't fit on those boards. I built one and it loaded fine. Now to learn to add some print debugging to Socket.c and see if I can learn anything.
Because the test which ran a few times and failed on the UM Feathers2 fails on the second call on the Kaluga.
Just tested debug build on idf@v4.4, it seems to work now on boards with more than 4MB flash.
Ya the firmware overflows on 4MB boards because unlike normal builds the debug builds aren't optimized.
The initial dram0_0_seg overflow issue seems to have been fixed in the newer idf.
Just tested debug build on idf@v4.4, it seems to work now on boards with more than 4MB flash.
The initial dram0_0_seg overflow issue seems to have been fixed in the newer idf.
It has been just over a week now so I sent an email to support@sparkfun.com asking for the PID. I will post any updates here.
The traceback test was present but wasn't being run.
I don't want to change the displayio docs because it should work. Instead of warning about a bug, we should fix it.
But auto_brightness never worked?
Added product description, links, and pictures for the upcoming Pimoroni Interstate75 board.
@jepler Different SD Card didnt make a difference. I copied your code from above, still gave the same output:
`code.py output:
ESP32 SPI webclient test
Attempting to mount sd card
['logs', 'overlays', 'prj', '9.0.3.gz', 'arcade.cfg', 'bcm2708-rpi-0-w.dtb', 'bcm2708-rpi-b.dtb', 'bcm2708-rpi-b-plus.dtb', 'bcm2708-rpi-cm.dtb', 'bcm2709-rpi-2-b.dtb', 'bcm2710-rpi-3-b.dtb', 'bcm2710-rpi-cm3.dtb', 'bootcode.bin', 'cmdline.txt', 'cmdline3.txt', 'config.txt', 'COPYING.linux', 'fixup.dat', 'ker...
I am trying to reproduce this, I have a pygamer with an airlift featherwing,
So far, ping @jepler code with the SDCard on SD_CS the Airlift works fine with or with out the card inserted BUT it is so far, unable to detect any SDCards..... still investigating
Can we add something like board.KEYS() which would return a singleton of one of the keypad classes?
.. that wouldn't handle the difference between an analog and a digital stick, though. analog sticks wouldn't work with this scheme.
After trying several different SDCards, I found on that works and it works OK with the airlift
Adafruit CircuitPython 7.1.0-beta.1-19-gb83e09858-dirty on 2021-12-02; Adafruit PyGamer with samd51j19
>>>
>>> import sdtest
ESP32 SPI webclient test
Attempting to mount sd card
['lib', 'hello.py', '.Trash-1000', '.Spotlight-V100', '.fseventsd', '.Trashes', 'swfolog.txt', 'swfoplayback.txt']
ESP32 found and in idle mode
Firmware vers. bytearray(b'1.7.1\x00')
MAC addr: ['0xa8', '0x44'...
I am unable to read many of my SDCards on this PyGamer... So far only the one works
It is an 8Gbyte card -- not sure of the mauna. just says Micro Sd Ultimate 3.0 70MB/Sec
but to the original issue, the airlift works with it in or out.....
hmmm -- if I switch to using the Adafruti_CircuitPythom_SD (adafruit_sdcard) library, i can read al of my SDCards.
Link to this repository for readers on the Awesome List on CircuitPython.org and not reading it on Github. Also add a note to come to Discord if they need help.
adafruit_sdcard defaults to 1_320_000 as the SPI clock while sdcardio uses 8_000_000. You can try changing the frequency.
Can we add something like
board.KEYS()which would return a singleton of one of the keypad classes?
The number and position of keys would still vary per device, so I'm not sure this would help making cross-device code that much.
if I do this:
sdcard = sdcardio.SDCard(spi, sd_cs, baudrate=1320000)
I get no sd card, and still the ESP32 errors...
gonna see if i can try the adafruit_sdcard lib...
same result with using example from @jerryneedell and adding adafruit_sdcard.py to the board:
code.py output:
ESP32 SPI webclient test
Attempting to mount sd card
no sd card: no SD card
continuing
Traceback (most recent call last):
File "code.py", line 51, in <module>
File "adafruit_esp32spi/adafruit_esp32spi.py", line 335, in status
File "adafruit_esp32spi/adafruit_esp32spi.py", line 325, in _send_command_get_response
File "adafruit_esp32spi/adafruit_esp32spi.py", li...
@nuwaveit Do you have any brand-name cards (e.g. Sandisk) that work? The sdcardio and adafruit_sdcard libraries use the slower SPI interface to cards, instead of the SDIO interface. We have found problems with a variety of cards.
@dhalbert yeah, im using a newer Sandisk, and an older Kingston. I have a 3rd with no name on it but has the "microSD" logo...
@tannewt Any reason why this shouldn't just be a page on the learn guide in getting started? Our biggest issue right now is that the top nav is getting quite full.
I don't have the hardware on hand any more but I did use a different SD shortly and that had the same issue.
Given that it worked fine with identical hardware with 7.0 I don't think it was an issue with the SDCard. Downgrading made it work again.
I can reproduce the hardware again is necessary or at least the same setup. Its just a Pico with a SDcard connector hooked up to the pins in the code.
Adding the same two new lines from common_hal_rgbmatrix_timer_free() at the end of common_hal_rgbmatrix_timer_disable() seems to resolve both the "syntax error" issue as well as the "CTRL-C" scenerio.
@slender iron not needing an answer right now, but I wanted to plant a seed for a potential deep dive topic. "How to Print debug in CP Core".
I don't know C, and I was poking around trying to use printf() just to see if I could anything and it didn't work, so I did some research and tried ESP_LOGD from the ESP-IDF, but still nothing coming out of the UART on my Kaluga. Anyway, I think with the searchable Deep Dive notes a 15 minute demo could be a great resource for everyone.
mp_printf(&mp_plat_print, <regular printf>) will go out the regular serial
esp is special with it's ESP_LOG stuff
I think it's only connected up on debug builds
mp_printf is engrained in my brain now unless I one day hook gdb up
printf works for most things. gdb is nice for hangs and crashes
It looks like this board has a USB to serial converter on the USB plug. You'll need to add a USB breakout cable to the native USB pins to get the CIRCUITPY drive and REPL to appear.
@tylerdcooper I think it should be in the learn guide as well.
However, I think we need lightweight pages for linking out to things on circuitpython.org. Learn is prose heavy, harder to link to and harder for others to contribute to.
Maybe we should change the get started link to go to a page that links out to the connect page, tools page and starting learn guides.
@slender iron FYI -- File Glider has been updated by TestFlight --- PyLeap has not.
ya, there is a review process that it has to go through to get in test flight
No problem.
?serverinfo
FYI -- I tried using baudrate=1320000 with sdcardio and it still fails to detect the card for me.
Same card is fine with adafruit_sdcard.
For the fact that I can consistently get this error sounds to me like there's a bug somewhere, maybe caused by a timing issue, or something is not getting reset...just my hunch...
File "adafruit_esp32spi/adafruit_esp32spi.py", line 335, in status
...
RuntimeError: Expected A0 but got 80
+1 for this I think it would be great to have the process documented somewhere as well. Either an "Advanced" learn guide, or maybe a section in the core readthedocs pages were the ones that came to mind for me. But really anywhere that makes it easy to find would be good.
wow, ya, thanks for info, I felt something weird here, best to avoid such hw - I trusted the downloads web (lack of) details... tnx, so its solved
I can confirm that running the following two commands make the PCA10100 run CP.
make V=1 BOARD=pca10100 sd
make V=1 BOARD=pca10100 flash
However, this doesn't resolve the issue that the CP UF2 doesn't work on the vanilla bootloader as it requires the embedded jlink that's on the PCA10100 to flash everything. This is not desirable for non dev-kit boards (like the BlueMicro833) as it doesn't have an embedded JLink and users wouldn't be able to load CP the normal way (drag/drop...
Finally finished my month-long educational project to improve the APDS-9960 driver and got the PR set up. Thanks to everyone that helped by answering my little questions along the way. And my apologies to whoever takes on the complex review. π
@gilded cradle I have a WebSerial ESPTool question when you're around.
Congrats! And no worries. That's what the review team is for!
I know, but I've been on the receiving end of some traumatic mega-PRs (time-constrained ones at that, lol) so I do try to be considerate π
Appreciated π
I did learn how to use pre-commit more effectively, as well as preview doc changes quickly by using sphinx to build the doc locally. That was useful. π
Great! Sphinx can be awful, so that's a good learning experience.
I can imagine the frustration it can cause, given how dang powerful it is. And how arcane some of its syntax is. But I was really happy with how well the docstring auto-formatting worked out, after some trial/error of course
That kind of sums up figuring out Sphinx π
It has taken two and a half years to get to a point where I can pretty much streamline my way through issues. Because I've finally seen them all and slowly remember what the solutions were.
Sphinx is so powerful that you have to fight against it to do something simple in my experience. But it's so powerful it's worth the headache
only because that "slowly remembering" has always been super slow for me. π
I keep cheat sheets everywhere! It really helps until you lose them π
I need a cheat sheet to finding my cheat sheets...
Oh man I know that feel Keith π₯²
It also helps that I often asked on Discord and Discord has a great search feature π
Sure, I'm back.
Ok, so we have this step in the explanation for using the WebSerial ESPTool for enabling it in old Chrome. I looked it up, the last version that has webserial enabled by default was released in March 2021. Do we need to keep that step in there anymore? Or should we assume folks have updated Chrome since March?
I think we left it in case anybody is running something like Linux which doesn't auto update and has an old version. Maybe we can change it to say that it only applies to older versions.
I'm thinking adding an alert element that links to a section at the end of the page that explains it so it's not the first step.
Ok, that works
It already says only older versions
But it seem weird having it first in the list of steps
Yeah
Thanks Melissa!
Actually, what I'd really like to know is.... what error happens if you try to use it without WebSerial enabled?
I need to figure out if I can install an old version of Chrome.
And not break everything, lol.
It will show you a message that you need to enable it and not work otherwise.
OK, I'm going to try to get a screenshot of that message for this section. If I can figure this out.
Ok, sounds good. If you can't, I can try tricking it and get you a screenshot.
OK, I'll try this for a short while and then ask for help if I can't get it going.
has anyone tried the broadcom build for the Raspberry Pi 4B? I have built it for both the Raspberry Pi Zero 2W and the 4B.The Zero 2W boots fine, but the 4B is not booting. I have a USB-Serial connected to TX,RX, GND -- On the 2W it boots to the REPL, On the 4B I see no activity at all...
Managed to get it!
Awesome
@solar whale nothing even on an hdmi display? the bootloader should show something there
I don't have an HDMI connected now -- Will try that...
It just goes to the multicolored square
hrm, that is into CP
I wonder if it is USB related
I don't usually have usb connected immediately
perhaps, adding link to this similar one on ESP-12K page in downloads helps - info about native usb on GPIO19/20 (but its not available to edit docs from web)
https://circuitpython.org/board/espressif_saola_1_wrover/
OK -- that will be a good learning experience π Does the size of the SD card Matter -- I have 8G on the 2W but 32G on the 4
There is a PR already under way in the bootloader repo BOOT#231 that would help with the default softdevice but it's currently stuck with non-related hardware dependencies (USB VID/PID on a board that it also brings in). I left a comment asking if the two could be split in two separate PRs.
I haven't tested if those changes will resolve the issue here (or simplify what needs to be done to upload CP). However, I suspect it h...
it shouldn't but I haven't exhaustively tested it
OK -- I'll explore -- tomorrow -- thanks.
thanks!
I was mostly curious if you had tried the 4B in addition to the CM4
I feel so cutting edge π
you always are π
sorta like my first run down a "black diamond" ski trail -- terrifying...
VM OS??
I installed it into my Windows VM. π
Aha
It's bonkers complicated to find older Chrome installers through the Google site.
There are tons of other sites that have them, but if you want them from Google, you have to do some steps.
VMWare Workstation with my pentesting OS and Windows 10 and Raspbian is really hard on a 4GB RAM computer
That's my setup
Oi.... yeah. 4GB with VMs sounds like a stretch.
And 3 OS's
Especially my pentesting OS struggles - what with brute force numbers and Hashcat
and Wifi attacks too
I upped my wifi security after I hacked it with no info to the system within 30 seconds
Makes you wonder
I bet
I've got Mac Maverick - I don't use it anymore for that reason
@gilded cradle Another WebSerial question if you're around.
@gilded cradle Here's the question, feel free to answer whenever you get a chance.
For the purposes of loading the bootloader, this template page will not refer to esptool. Only WebSerial ESPTool. Do you really need to identify the serial port first and separately if you're going to use WebSerial ESPTool anyway? i.e. Do I need to walk people through finding the COM/etc port before telling them to use WebSerial. Because WebSerial will display what it finds anyway, won't it?
If I recall correctly, it displays a list of ports it finds.
Right, exactly.
So I'm thinking using Terminal or Device Manager to find the port is pointless.
But I wanted a second opinion.
Yeah, kinda redundant.
I can basically say "Only plug in the board you want to flash" and then walk through the ESPTool steps.
Ok
Thanks!
Sounds good
@gilded cradle Blergh. So.... I got this error after erasing using WebSerial ESPTool ..... Did I get the board in a state where I need to use esptool to flash it or something? I erased it, disconnected, and am now trying simply to reconnect, and it gives me this instead: Error: Software loader is resident at 0x40028000-0x40028FE8. Can't load binary at overlapping address range 0x40028000-0x40028FE8. Try changing the binary loading address.
Sorry to keep bothering you, I have it in my mind that you dealt a lot with WebSerial... maybe I'm wrong about that, and if so, let me know...
Yeah, I'm not sure what's up with that, but I think there's an issue open for it.
Ahhh ok.
I guess I'll try to get esptool going again. I used it a long time ago, iirc.
Thanks
yw
@idle owl can you add notes to https://github.com/adafruit/Adafruit_WebSerial_ESPTool/issues/17 to help with figuring out the steps to reproduce the error?
Absolutely.
Thanks
Updated.
@gilded cradle I managed to recover the board with esptool and so of course I immediately followed the same steps as earlier on WebSerial ESPTool, and same results. Updating the issue to mention I reproduced it as well.
Awesome. Thank you.
using an older version of git
$ which git
/usr/local/bin/git
$ git --version
git version 2.23.0
I'm very excited to test this in a project with Prometheus pi temps and pwm fan controller
I'm trying to understand why the rp2040 ports specify external flash
while it is external to the main chip, isn't it really internal in circuitpython terms?
never mind i see now, it's used to gen stage2
The uctypes module may provide the similar functionality of memoryio. I just enabled uctypes in CircuitPython7.0, to manipulate the Configurable Custom Logic (CCL) peripheral of SAMD51 like:
import uctypes as ct
ct.bytearray_at(0x40000800 + 0x1C + 1, 1)[0] |= 0x40
ct.bytearray_at(0x42003800, 1)[0] |= 0x01
This enables clock supply to CCL, and issues software reset on CCL. By using struct facility of uctypes, the scary code above can be replaced by:
from SAMD51p19 impo...
I have built CP for both the RPI Zero 2W and the 4B.
When I connect a USB to Serial converter to GND, TX,RX on the Zero 2W it boots to the REPL as expected.
When I try the same on the 4B, I see no output on the serial port.
If I connect an HDMI monitor, I see no text to the screen, but it does go to a large multicolored square on the display.
I'm curious if anyone else has tried the 4B?
I have tried 7.1.0-beta.1 from circuitpython.org as well just to verify it is not my build -- s...
CircuitPython version
adafruit-circuitpython-pimoroni_tiny2040-en_GB-7.0.0
Adafruit CircuitPython 7.0.0 on 2021-09-20; Pimoroni Tiny 2040 with rp2040
Board ID:pimoroni_tiny2040
Code/REPL
import board, busio, adafruit_rgbled
led= adafruit_rgbled.RGBLED(board.GP18, board.GP19, board.GP20, invert_pwm=True)
Behavior
Adafruit CircuitPython 7.0.0 on 2021-09-20; Pimoroni Tiny 2040 with rp2040
import board, busio, adafruit_rgbled
led= adafru...
The LED pins are given purpose-specific names, instead of GPIO18, 19, and 20. Here is the complete pin naming:
You can also see the pins by doing dir(board). The chip-level pin names are available with microcontroller.pin. (This is for a different board.)
>>> import board,microcontroller.pin
>>> dir(board)
['__class__', '__name__', 'A0', 'A1', 'A2', 'A3', 'BUTTON', 'D0', 'D1', 'D10', 'D2', 'D3', 'D4', 'D5', 'D6', 'D7', 'D8', 'D9', 'I2C', 'MISO', 'MOSI', 'NEOPIXEL', 'NEOPIXEL_POWER', 'RX', 'SCK', 'SCL', 'SCL1', 'SDA', 'SDA1', 'SPI', 'TX', 'UART', 'board_id']
>>> dir(microcontroller.pin)
...
@idle owl yay on Factory-Reset-Images
π I don't know how quickly it's going to fill up, but we'll see. I needed somewhere to put the bin files for this ESP32-S2 template.
@tulip sleet So you sent me a .ino and a .uf2. I assume they are identical, except one you can drag and drop to RPI-RP2, and the other you need Arduino to load?
yes, I actually compiled the .ino into the .uf2. I think adding both fine would be fine.
Ehhh....
The NeoPixel one is a default NeoPixel example in Arduino. I'm not sure I want to deal with .ino files in this repo.
Maybe.
The NeoPixel pin number may vary between different RP2040 boards?
Oh hmm right. Wait... no. Hold on let me check. She started adding PIN_NEOPIXEL to everything.
Looking to see what's in this.
that .ino may have been written before KB2040 got added to Arduino
Noop. PIN_NEOPIXEL not used.
OK. I guess I'll include both.
I'm not giving it its own directory though. User can do that! :shakes fist:
oh, sure, most people will just use the .uf2 anyway
We're going to add them to the PCB repos instead. And only UF2/bin. Deleted the factory-reset-images repo per Limor.
@ladyada You asked me to tag you on this PR to clarify the order I would like to see the pins. Anytime there are multiple names for a pin, and one of those names is on the silk, the silk-pin-name should always come first in the list.
When printing the board object, the first name in the list is what's returned, and anytime you're dealing with the board objects, you want the pin in the silk to be returned to avoid confusion. If an alternate pin name is returned, you're forced to look...
Hi Dan,
many thanks for the quick response.
I'm not sure how many of the CircuitPython users would make the jump from a MicroPython constant such as MP_QSTR_LED_R to needing to use board.LED_R without this information being documented (and I wasn't able to find it documented).
I don't know whether there is precedent for the LED_x naming convention in CircuitPython - a quick search did not confirm this - however I accept that is is logical if the board also uses the same conventio...
For anyone reading this with the same problem I experienced and running the Tiny2040 firmware level above, the intended syntax for using the internal RGB LED is as follows
import board, busio, adafruit_rgbled
led= adafruit_rgbled.RGBLED(board.LED_R, board.LED_G, board.LED_B, invert_pwm=True)
Dan, thanks for your comments about dir(board) and dir(microcontroller.pin). I'd used the former before, but my inexperience did not immediately cause me to think about doing this.
@lone axle I have need of your assistance. I need to update the PCB cookiecutter to create a new folder with a dynamically generated README.... and I'm confused about how to do that. Oh hah. I think I figured it out. Nevermind. π
Happy to help if it turns out you need still.
Thanks! Appreciate it. But it looks like I did it right. We'll find out the next time I need to use it! π
@lone axle wait I lied. it's way more complicated than what I did.
I do need help, because it needs to ask "Is this a dev board? Y/N", and then only include the new folder if Y.
I thought I was so slick there. But... I realised it's not quite what we need.
This is the right repo that your adding it to right? https://github.com/adafruit/cookiecutter-adafruit-pcb
Yes.
I could try to figure out how it's done in the other cookiecutter..... but I don't know how to generate a folder based on the answer to a question....
Okay, to add the extra question it would be a new entry in this file: https://github.com/adafruit/cookiecutter-adafruit-pcb/blob/main/cookiecutter.json
OK, I'm there
Added "Is this a microcontroller board?" : "N", to the beginning.
and like in the lib cookiecutter, I'd like "y" and "yes", "n" and "no" to both work. Because I never remember π
perfect. that should make it ask that question and default to "N" I believe. Then in order to use the answer to that question you'd work in some logic into the weird looking {{ template_var }} or {% template_logic %} tags.
in the directory name?
yep
So if factory-reset directory existence needs to be conditional on that question I think the name of that directory should be something like:
{% if cookiecutter.dev_board %}factory-reset{% endif %}
{% if cookiecutter.dev_board in ['y', 'yes'] %}factory-reset{% endif %}
However I do think you'll need to change the entry in cookiecutter.json a bit. The key for that dictionary item should probably not have spaces. I would make the key something like dev_board and then the value is the text of your question I believe.
Hmm ok
Documentation I guess!
ok
updated
So, do I have to conditionalise the files within the directory or because the directory is conditional, it "just works"?
I'm not 100% certain, but I think the directory conditional would carry over to them.
Ok, testing.
Now it's failing saying the directory already exists.
Which it does not.
Like it's trying to create it twice or something
The top level directory
not the factory-reset directory
Poking a little bit on my end as well. It seems like the values in that dictionary are the default values, not the text of the question. Beyond showing the values of the default I'm not sure if there is a way to specify different text for the question.
That's fine, I can document what it means, and really only Dylan and I are doing it that I'm aware of. Maybe Limor.
Can update README.
But it's not running now. Which is a problem.
pre-generate
5000 is PID
Error: "/Users/kattni/repos/cookiecutter-adafruit-pcb/Feather_ESP_pcb" directory already exists``` is how far it gets.
I can tinker with it for a minute. I've never actually done a conditional directory but I have a vague idea of how I think it will work. Don't want to send you too far down the rabbit hole.
Ok, thank you.
Without that folder, it runs properly.
I think there may be a difference in what is needed for a conditional directory vs. and conditional file.
for files if the name equates to empty it just doesn't get created. But for directories if the name equates to empty it tries to do something else more weird. I think post_gen hooks are the way to make it work though. It runs those after creating things. So factory-reset can get created by default and then deleted if uneeded from the post_gen. Working out the specifics of that now.
Oh ok