#circuitpython-dev

1 messages Β· Page 399 of 1

lone axle
#

interesting. it shows everything green but actions to me. I wonder if there was some large scale abuse of actions that started creating wider problems.

dusk mauve
lone axle
#

ah, more non-greens now. Looks like the status page is figuring out how big of a problem there is πŸ˜…

stuck elbow
#

just when I started coding, github goes down

ember iris
#

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...

dusk mauve
ember iris
#

Hopefully the fix is simple and they can be low staffed through the rest of the weekend

stuck elbow
#

it's not like anybody is going to freeze to death

#

like with electricity outage

dusk mauve
#

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.

stuck elbow
#

if your CI depends on external services, you have bigger problems

dusk mauve
stuck elbow
dusk mauve
warm stump
#

it's back up but maybe give it a break for a while anyway πŸ˜„

manic glacierBOT
#

@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!

manic glacierBOT
#

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...

manic glacierBOT
manic glacierBOT
solar whale
#

yikes -- updating CP -- downloading the broadcom/firmware takes a long time!!

stuck elbow
#

yup, there is an issue for it already

#

perhaps a separate script for downloading it would make sense

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

@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.

manic glacierBOT
manic glacierBOT
#

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.

lone axle
#

@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.

lone axle
#

@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)}

manic glacierBOT
gilded cradle
lone axle
crimson ferry
#

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)

manic glacierBOT
lunar gull
#

IconWidget positioning

#

@lone axle I'm going to try that code out in few hours. Stepping away for some TV-time with the wife.

lone axle
#

Sounds good. Have a good night!

manic glacierBOT
#

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...

edgy drum
#

How does one use the mpy-cross tool to bundle a module (as opposed to a single file)?

lunar gull
edgy drum
#

Thanks so much! It occurs to me now that .mpy is a reference to mircopython. Never made that connection

lunar gull
#

yarp

#

CircuitPython is a fork of MicroPython, I think.

edgy drum
#

It is! I've only used CP so any MP references go above my head

lunar gull
#

I'm quite new to it as well, but I love Python, and I love CircuitPython and everything Adafruit, so here I am. πŸ˜„

edgy drum
#

we are alike

lunar gull
#

(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").

crimson ferry
lunar gull
#

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.

crimson ferry
edgy drum
lunar gull
edgy drum
#

Using ethernet cables as a "hack" for long range is one of my favorite things

lunar gull
crimson ferry
#

we should probably take the non-core-development stuff to another channel

lunar gull
#

Yes.

manic glacierBOT
manic glacierBOT
main furnace
#
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'mapping' argument required

'mapping'?
via Adafruit LED Glasses Driver nRF52840

stuck elbow
#

@main furnace where did you get that library?

main furnace
#

It's in the CP build I got from S3: Adafruit CircuitPython 7.1.0-beta.0-153-g27e8a16bf on 2021-11-26

stuck elbow
#

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

main furnace
stuck elbow
#

ah, it's the framebuffer one

main furnace
#

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.

blissful pollen
#

The python helper for the mapping isn't out yet

#

It is in the PR

main furnace
#

Guess that's what I get for playing on the bleeding edge. 😁

blissful pollen
#

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)

stuck elbow
#

@blissful pollen why list and not a tuple, or even int array?

blissful pollen
#

I looked at bytearray but for int16 values it was causing my issues with big/little endian

daring pumice
#

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*

blissful pollen
stuck elbow
#

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

main furnace
#

Whoa, it's trying to display the console on the LED Glasses!

stuck elbow
#

I use 16-bit arrays for palettes, for instance

tulip sleet
daring pumice
blissful pollen
blissful pollen
stuck elbow
#

I know this is penny-pinching, but saves 2 bytes per entry

#

I'm still living with the samd21 boards

blissful pollen
#

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.

stuck elbow
#

oh, in that case don't bother

blissful pollen
#

I get you with the samd21 stuff. I know once you give me more memory I tend to forget that stuff

stuck elbow
#

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

daring pumice
lone sandalBOT
manic glacierBOT
turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Category Channels

8

Text Channels

61

Voice Channels

6

Members

31927

Roles

36

daring pumice
#

@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?

tulip sleet
daring pumice
tulip sleet
#

if you look in ports/nrf/build-pca10100/common.ld, it looks like the appropriate values have been substituted in the templated LD files

tulip sleet
#

or the wrong start address

daring pumice
#

I hear you. Not sure what to make of it - not strong enough here.

#

Can I send you a Screenshot here?

tulip sleet
#

sure - I am about to be in a meeting at the top of the hour

daring pumice
#

kk 1 sec

tulip sleet
#

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.

daring pumice
#

It looks like the SD is supposed to end at 0x26000 - see what I mean?

tulip sleet
#

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

daring pumice
daring pumice
#

You were right, should start at 27000

tulip sleet
#

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).

tidal kiln
tulip sleet
#

@onyx hinge ok, it was something else I was assigned, not ESP32SPI issues

onyx hinge
tidal kiln
#

np. i'll ask. i'm not sure either.

idle owl
solar whale
#

What version of "aarch64-none-elf-gcc" is needed for the broadcom builds

lone axle
#

@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.

idle owl
#

@slender iron Remember, put yourself at the top of the list and go through from the beginning.

solar whale
#

thanks! -- sorry -- did not meant to interrupt.

onyx hinge
#

@idle owl did we change how we're doing that? is it host, then top of alphabet instead of host, then following in alphabet?

idle owl
#

Yes.

onyx hinge
#

πŸ‘

idle owl
#

Updating the instructional doc now.

lone axle
#
Instructables

Gom Jabbar From Dune: In this tutorial, I will walk you through the process of creating the black box in the pivotal scene from Dune where the Reverend Mother Gaius Helen Mohiam tests Paul Atreides. The Gom Jabbar is the name for the handheld needle tipped with meta-cyan…

onyx hinge
#

some other jeff πŸ™‚

lone axle
gilded cradle
#

It's blinka CircuitPython Mondayblinka at Adafruit! Use the code ADATY to get 20% off CircuitPython and 15% off items storewide!

idle owl
#

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!

thorny jay
#

I am just listening (no notes)

onyx hinge
#

@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.

stuck elbow
#

@onyx hinge esp32-s2, but with my own breakout, which has issues

onyx hinge
#

okay, good luck when you get your new modules!

stuck elbow
#

@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

onyx hinge
#

drat

solar whale
#

You're welcome!

onyx hinge
#

[brb, my computer audio freaked out]

idle owl
onyx hinge
#

[back]

idle owl
#

@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.

blissful pollen
idle owl
lone axle
#

@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.

blissful pollen
onyx hinge
#

@solar whale yes there's a particular version of mkfs.fat that is needed

lone axle
#

@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.

blissful pollen
onyx hinge
idle owl
#

New Blinka art dropped! Happy little circuits!

idle owl
#

I'm so excited about these. There's a bunch!

onyx hinge
#

"availibility: <platform name>"

#

if stubs or py files can have conditionals then ... ```python
if os.environ['CP_BOARD'] == "example_board_1":
D2: microcontroller.Pin

stuck elbow
onyx hinge
#

.. 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`
idle owl
stuck elbow
#

every machine can be a smoke machine

lone axle
onyx hinge
#

[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
stuck elbow
#

that feeling when you are googling for the information, and all you find are your own posts

idle owl
#

ADATY

onyx hinge
idle owl
manic glacierBOT
lunar gull
idle owl
#

No apology needed πŸ™‚

lone axle
solar whale
#

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

lunar gull
#

but does it sit in the box?

lone axle
#

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.

slender iron
#

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

lone axle
#

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.

solar whale
#

@slender iron The deep dive notes are great -- sorry it took me so long to start using them!

slender iron
#

np, did you find the repo with them?

solar whale
#

yes

slender iron
#

patrick has done a great job linking into the videos

#

(and dcd takes the notes)

solar whale
#

it was super to just click on it and have the video pop up!

slender iron
#

hugs to @idle wharf

manic glacierBOT
#

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...
hidden oxide
#

Sorry I missed the meeting

#

I think my notes were in the doc tho

idle owl
slender iron
idle owl
#

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?

lone axle
idle owl
#

I wrote that πŸ€¦πŸ»β€β™€οΈ

#

Thank you πŸ˜„

lone axle
#

You're welcome. I always end up referring to it as well so I know right where to find it. πŸ˜„

idle owl
#

That's why I documented it. Because I never remember. And then I forgot I documented it, apparently.

blissful pollen
#

There really was no plumbing / intention to let native classes subclass each other hmm 😐

idle wharf
idle owl
#

@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.

tulip sleet
idle owl
#

Is it alright to fix the Feather ESP32-S2 then?

tulip sleet
#

sure

slender iron
#

printing the pin object will use the first name

idle owl
#

OK, yeah, that's what I meant.

#

Couldn't think of the terminology.

#

Should be silk pin.

tulip sleet
#

there might need to be a big pass through all the pins.c to vet them, though if they are mostly right, maybe not

idle owl
#

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?

slender iron
#

it's giant

#

do --depth 1

manic glacierBOT
#

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(?),...

idle owl
#

I mean presumably I'll eventually need it. How big is your disk image for CircuitPython?

#

--depth 1 worked though.

slender iron
#

--depth 1 is fine

#

you don't need the whole history of the firmware repo

idle owl
#

Oh fair enough. I guess I don't know what depth is doing.

tulip sleet
#

@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.

slender iron
#

depth is the number of commits to fetch on a branch starting with the latest and going back in time

idle owl
#

Ah. Thanks.

slender iron
#

k, will take a peek @tulip sleet

#

usually the history is small enough that getting it all is fine

onyx hinge
#

@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)?

slender iron
#

@tulip sleet will have a better idea than me

tulip sleet
#

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.

tulip sleet
#

(adafruit_airlift)

idle owl
slender iron
#

@tulip sleet release notes look good to me. you'll need to add the rpi boards to the new boards list too

tulip sleet
#

good point! should I add RPI 0 2W even if it doesn't work?

#

or it sort of works?

slender iron
#

ya, I'll add notes to the board page

manic glacierBOT
manic glacierBOT
#

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...

idle owl
#

@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.

tulip sleet
#

I will start a release as soon as the merges finish.

idle owl
#

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.

daring pumice
#

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.

tulip sleet
#

The .hex file is human readable

idle owl
daring pumice
#

Ok. I have it open in vscode. Am I correct in assuming that this file should be loaded to the 833 starting at 0x27000?

daring pumice
slender iron
#

@onyx hinge what ulab branch should cp be tracking?

onyx hinge
#

@slender iron main or master if they haven't shifted yet, I think. I haven't kept up with news from 'over there'.

slender iron
#

kk, cp is still set to use the adafruit fork

onyx hinge
#

oh is it?

#

hmmm

slender iron
#

will fix it in my upcoming submodule pr

onyx hinge
#

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.

slender iron
#

I'm testing the submodule stuff

#

the current commit isn't in adafruit master

onyx hinge
#

we had to take one compatibiltiy change, maybe for mp 1.17 merge, which must have been taken upstream

slender iron
#

ya, it is in upstream

onyx hinge
#

but they haven't released since 3.3.1 so there's not really anything to update to

slender iron
#

ya, I'm not changing it. just fixing the upstream url

manic glacierBOT
#

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.

idle owl
#

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...)

tulip sleet
#

@slender iron I don't need this submodule fix for 7.1.0-beta.1, I assume?

idle owl
#

@slender iron The make fetch-submodules concept seems like a pretty significant change. We will need to document it somewhere obvious, I would think.

slender iron
#

nope. it's just a tooling thing

tulip sleet
#

i have to put it in "Building CIrcuitPython"

slender iron
#

@idle owl I figured we'd update the build guide once it is merged in

slender iron
#

you can do the old way but it'll fail on the rpi firmware folder

#

it won't hurt anything

idle owl
#

Ah, ok. But folks will run into the error. And we will help. Heh.

tulip sleet
#

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

manic glacierBOT
slender iron
tulip sleet
slender iron
#

thank you!

#

I'm starting the board changes for cp.org now

#

for the pis at least

manic glacierBOT
#

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...

pin-mappings-speedtest.txt

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 7\.1\.0\-beta\.1
ornate breach
#

I just saw some of the new Blinka

#

Bob Ross blinka might be my favorite

#

Also Blinka teaching circuits is also adorable

tulip sleet
#

@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

manic glacierBOT
#

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...
orchid basinBOT
slender iron
#

sorry about that @tulip sleet. I think I added it because of a previous submodule thing

tulip sleet
#

np, I was able to run the circuitpython-org update as myself

#

i just had to generate a temp token.

orchid basinBOT
manic glacierBOT
#

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’...

tulip sleet
tulip sleet
lunar gull
#

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?

edgy drum
lunar gull
#

aww yeah

lunar gull
#

Alright, will mess around with that tomorrow then, will have to upgrade both the RP2040 and the M4 to 7.1 b1.

lunar gull
#

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.

manic glacierBOT
tulip sleet
manic glacierBOT
#

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...

manic glacierBOT
#

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...
idle owl
idle owl
ornate breach
#

I’m glad my Blinka teaching idea made it through the gauntlet πŸ™‚

#

I like the way it turned out, all of them really

idle owl
#

I think your backpack one made it in though?

#

If that was you..

ornate breach
#

Yeah, back pack

idle owl
#

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.

ornate breach
#

I had mentioned in the back pack explanation about her impact on education so I thought there was a correlation πŸ˜…

idle owl
#

Her writing in a notebook wearing half-moon reading glasses went with my complicated things on a chalkboard idea.

ornate breach
#

Well, I love the blinka Bob Ross and drawing a circuit

idle owl
#

Basically, I wanted her being a smartypants.

ornate breach
#

They are super adorable

idle owl
#

So do I!

#

Bruce really nailed it.

ornate breach
#

Absolutely πŸ™‚

idle owl
#

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.

ornate breach
#

Some people just absolutely nail their craft

#

It’s always exciting to see what those people do and how they do it

idle owl
#

For sure

manic glacierBOT
#

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

manic glacierBOT
half radish
#

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>

idle owl
#

@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?

tulip sleet
#

asyncio is a Python library. It really only requires async/await support, and they are keywords

idle owl
#

Ahhh.

#

@half radish ^^

tulip sleet
idle owl
#

Thanks Dan

idle owl
#

@tulip sleet I just misread it as "Competitive Multitasking" and now I need that to be a thing.

tulip sleet
#

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

orchid basinBOT
manic glacierBOT
#

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 % 
main furnace
#

rpi-zero2w: vectorio shapes are always black. The pixel_shader palette is ignored. Not yet implemented, or should I write an issue?

lunar gull
#

@tulip sleet you magnificent person, you! That was quick, and also, I think I love you.

tulip sleet
#

well, it's not done yet, and it's my job πŸ™‚

lunar gull
#

A lot of people do jobs. But very few immediately address an issue that was reported last night at like 1am in the morning. πŸ˜‰

lone sandalBOT
lunar gull
#

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)

half radish
manic glacierBOT
tulip sleet
half radish
tulip sleet
#

don't push everything, that's too big

orchid basinBOT
daring pumice
#

Wondering if anyone has successfully deployed to an nrf52840?

#

Also, morning everyone πŸ™‚

daring pumice
#

circuitpython πŸ™‚

idle owl
#

All of us? I'm confused, I think, about what you mean by "deployed".

manic glacierBOT
idle owl
#

Or I'm not confused by it, and I'm confused about the question in general.

daring pumice
#

Put another way, is anyone actively running circuitpython on an nrf52840?

idle owl
daring pumice
#

No issue - considering using this board over the 833 since the 840 appears allow circuitpython to be easily flashed onto the device πŸ™‚

idle owl
#

Ah yeah, it's as easy as it is with any other CP-compatible board.

daring pumice
#

I appreciate it, @idle owl πŸ™‚

tulip sleet
#

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.

daring pumice
#

@tulip sleet I completely get it, and this isn't a complaint - sorry if it came off that way.

half radish
daring pumice
#

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 πŸ™‚

tulip sleet
tulip sleet
half radish
tulip sleet
#

no need, i'm already working on it

manic glacierBOT
solar whale
#

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

hidden oxide
manic glacierBOT
solar whale
#

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

idle owl
#

Nicely done!

solar whale
#

@slender iron when you have a chance, can you post a link to your "debug hat" on oshpark.

orchid basinBOT
solar whale
idle owl
#

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. πŸ™‚

solar whale
#

Thanks! It took a few tries

slender iron
solar whale
manic glacierBOT
#

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.

lone axle
#

@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.

daring pumice
#

@tulip sleet Got CircuitPython flashed to the 833 πŸ™‚

#

Putting steps up on GitHub

tulip sleet
#

just when you're about to give up!

daring pumice
#

lol yup

manic glacierBOT
tulip sleet
manic glacierBOT
#

@jpconstantineau I have it working. Can you verify if this works?

Steps:
After cloning the repository and updating the submodules

  1. Build mpy-cross as 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).
  2. Move to /ports/nrf
  3. Plug your USB cable into the J-Link port, located on the left side of the board above the battery
  4. Power up the 833
  5. Run make V=1 BOARD=pca10100 sd - this will create ...
#

@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...

manic glacierBOT
#

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 ...

#

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@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
...
#

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

solar whale
#

@slender iron do you have a few minutes to voice chat about the broadcom port usage?

slender iron
#

sure!

manic glacierBOT
#

@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?

orchid basinBOT
manic glacierBOT
orchid basinBOT
solar whale
#

@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?

tulip sleet
#

I think it may vary by board. @slender iron has talked about always resetting it for consistency.

solar whale
#

I'll do some testing...

timber mango
#

@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?

timber mango
#

(that would be nRF)

manic glacierBOT
#

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?

idle owl
#

@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.

tulip sleet
idle owl
#

But yes.

#

We're still building them for now.

tulip sleet
#

The mpy-cross problem will occur with either a comprehensive or a quick fix to include asyncio

idle owl
#

Hmm.

#

Ok.

tulip sleet
#

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.

idle owl
#

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.

tulip sleet
#

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

idle owl
#

But time is a module, not a library.

#

Hmm.

tulip sleet
#

yes...

idle owl
#

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.

tulip sleet
#

do we intend that code with adafruit_requests work without changes on an RPi? Do we have projects that do that?

idle owl
#

Frankly, I would rather not have another library without adafruit_ on the beginning of it. NeoPixel is special.

idle owl
#

I can ask Brent, he might know.

#

But it obviously would need to be changed.

#

So...

tulip sleet
#

@slender iron what do you think about @lone axle 's idea of renaming asyncio to adafruit_asyncio, as with requests, hashlib, etc?

idle owl
#

Do you plan to, or did you already, publish it to PyPI?

tulip sleet
#

no, it will not be on Pypi, because you could just use the regular asyncio

#

did we publish adafruit_requests to pypi?

idle owl
#

Ok, then rename it.

#

Let me check

tulip sleet
#

yes, hmm

idle owl
#

Yes we do

tulip sleet
#

is requests strictly a subset?

solar whale
#

@timber mango what MCU are you testing it on?

idle owl
tulip sleet
slender iron
#

@tulip sleet I think my preference is asyncio because, as kattni points out, that is most compatible

idle owl
#

I prefer consistency across the libraries.

tulip sleet
#

in retrospect, we might have named adafruit_requests just requests

idle owl
#

We didn't. And it's on PyPI, so you can use it with Blinka. etc.

tulip sleet
#

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

idle owl
#

But, I don't know if it has things in it that requests does not.

tulip sleet
#

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

idle owl
#

Ok

tulip sleet
timber mango
#

@solar whale That was the nRF

idle owl
#

Or leave it in in case we need it again I guess.. I don't know.

#

I hope this is an unusual situation.

tulip sleet
#

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.

idle owl
#

Ok. We'll be here.

manic glacierBOT
#

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.

lone sandalBOT
manic glacierBOT
manic glacierBOT
#

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...
orchid basinBOT
idle owl
#

@tulip sleet Any clarity?

tulip sleet
#

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

idle owl
tulip sleet
#

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

idle owl
#

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?

tulip sleet
#

phone call, bbiab

idle owl
#

Or it can be absent and it'll assume it needs both?

#

ok

tulip sleet
#

@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

idle owl
tulip sleet
#

will find it

idle owl
#

And that sounds excellent.

manic glacierBOT
#

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("-------------------...
tulip sleet
#

ok, I will figure something out!

idle owl
#

Feel free to tag me when ready for a look.

tulip sleet
#

none of the proposed solutions are a version file, it looks like

tulip sleet
#

I will cogitate

#

a version file is easy

idle owl
#

Ok

crimson ferry
#

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.

idle owl
#

@languid whale Hello, do you mind if I DM you?

tulip sleet
#

so solving a somewhat different problem

idle owl
languid whale
dusk mauve
#

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.

slender iron
#

@dusk mauve my preference would be a separate library

dusk mauve
slender iron
#

separate repo

#

that's what all of the tooling is setup for

dusk mauve
#

Ahh, ok. Makes sense. Seems like a lot of work to enable features 99% of users probably won’t care about. πŸ˜…

slender iron
#

all the more reason not to have everyone install it

#

plus separate repos are easier to find

dusk mauve
#

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

manic glacierBOT
manic glacierBOT
#

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 ...

manic glacierBOT
#

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...
manic glacierBOT
manic glacierBOT
#

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 ...

solar whale
#

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...
solar whale
#

hmmm -- never-mind -- except ImportError appears to work on the Pi -- I'm confused, but relieved....

jaunty juniper
#

ah that would be because:

>>> issubclass(ModuleNotFoundError, ImportError)
True
solar whale
#

@tulip sleet Do you know if the time.monotonic() loses accuracy on a Raspberry i in the same way it does on an MCU?

tulip sleet
#

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()?

solar whale
#

looks 1/3 give 0.3333333333333333

#

16 3s

tulip sleet
#

so then it should not be an issue

#

64-bit floats

solar whale
#

nice! thanks -- I'll test a bit more later -- have to go to a meeting 😦

lone axle
#

Ah, still catching up. It being a subclass and thus ImportError working in both situations is good news.

onyx hinge
solar whale
dusk mauve
#

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

orchid basinBOT
dusk mauve
jaunty juniper
#

I don't know if it has what you want though, but it has some color conversion stuff

dusk mauve
jaunty juniper
#

the rgbled library is a driver for driving PWM RGB LEDs

dusk mauve
#

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.

manic glacierBOT
manic glacierBOT
#

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.

...

slender iron
#

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)

manic glacierBOT
#

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_brightness from the stage initialization 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...

idle owl
manic glacierBOT
onyx hinge
#

@slender iron did you definitely need me/someone to take the december 27 discord meeting?

slender iron
#

I don't know yet. I haven't talked with becca about it

tulip sleet
#

i can do it

orchid basinBOT
lone sandalBOT
slender iron
#

we tend to do floating inputs which are worse that pulling up or down

manic glacierBOT
#

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...

manic glacierBOT
#

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....

slender iron
#

@onyx hinge I think you can start on 7.x.x bugs next

#

I know deshipu would like to fix the displayio crash #5476

manic glacierBOT
manic glacierBOT
#

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...

idle owl
#

@tulip sleet Those are the KB2040 files you emailed me right?

tulip sleet
#

yes, and I loaded the .uf2 on a KB2040 to test

idle owl
#

I up and forgot between then and now.

#

Ok, excellent. Thank you!

manic glacierBOT
idle wharf
#

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.

crimson ferry
spiral elk
crimson ferry
#

oh, probably, didn't think of that πŸ˜‰

spiral elk
#

Since I think the second ota partition isn't used for anything currently

crimson ferry
#

who needs OTA when you're just debugging? πŸ˜‰

#

in theory, I think there is OTA... I assume it works?

spiral elk
#

tinyuf2 just loads stuff into the first partition hardcoded IIRC.

crimson ferry
#

I think if you're really careful, you could write code on a CircuitPython device to update its own firmware and code.py

spiral elk
#

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.

idle wharf
#

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.

analog bridge
#

Just tested debug build on idf@v4.4, it seems to work now on boards with more than 4MB flash.

crimson ferry
#

but not ==4MB?

#

I'm looking forward to testing the S3

analog bridge
#

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.

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
orchid basinBOT
manic glacierBOT
#

@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...

manic glacierBOT
#

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'...
manic glacierBOT
lone sandalBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

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...
orchid basinBOT
manic glacierBOT
#

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.

idle wharf
#

@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.

slender iron
#

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

blissful pollen
#

mp_printf is engrained in my brain now unless I one day hook gdb up

slender iron
#

printf works for most things. gdb is nice for hangs and crashes

manic glacierBOT
orchid basinBOT
solar whale
#

@slender iron FYI -- File Glider has been updated by TestFlight --- PyLeap has not.

slender iron
#

ya, there is a review process that it has to go through to get in test flight

solar whale
#

No problem.

turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Category Channels

8

Text Channels

61

Voice Channels

6

Members

31968

Roles

36

manic glacierBOT
lone axle
manic glacierBOT
#

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...

dusk mauve
#

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. πŸ˜‚

idle owl
#

@gilded cradle I have a WebSerial ESPTool question when you're around.

idle owl
dusk mauve
dusk mauve
#

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. πŸ™Œ

idle owl
dusk mauve
idle owl
#

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.

ember iris
#

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

dusk mauve
ember iris
#

I keep cheat sheets everywhere! It really helps until you lose them πŸ˜„

#

I need a cheat sheet to finding my cheat sheets...

dusk mauve
#

Oh man I know that feel Keith πŸ₯²

idle owl
#

It also helps that I often asked on Discord and Discord has a great search feature πŸ˜„

idle owl
# gilded cradle 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?

gilded cradle
idle owl
#

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.

gilded cradle
#

Ok, that works

idle owl
#

It already says only older versions

#

But it seem weird having it first in the list of steps

gilded cradle
#

Yeah

idle owl
#

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.

gilded cradle
idle owl
gilded cradle
idle owl
solar whale
#

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...

gilded cradle
#

Awesome

slender iron
#

@solar whale nothing even on an hdmi display? the bootloader should show something there

solar whale
#

I don't have an HDMI connected now -- Will try that...

#

It just goes to the multicolored square

slender iron
#

hrm, that is into CP

#

I wonder if it is USB related

#

I don't usually have usb connected immediately

manic glacierBOT
solar whale
#

In this case I only have USB power connected -- not data

#

using a wall-wart

slender iron
#

hrm. this is where I'd gdb it

#

you could printf debug it

solar whale
#

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

manic glacierBOT
#

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...

slender iron
#

it shouldn't but I haven't exhaustively tested it

solar whale
#

OK -- I'll explore -- tomorrow -- thanks.

slender iron
#

thanks!

solar whale
#

I was mostly curious if you had tried the 4B in addition to the CM4

slender iron
#

limor did at one point

#

I haven't

solar whale
#

I feel so cutting edge πŸ˜‰

slender iron
#

you always are πŸ˜„

solar whale
#

sorta like my first run down a "black diamond" ski trail -- terrifying...

idle owl
hidden oxide
#

Aha

idle owl
#

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.

hidden oxide
#

VMWare Workstation with my pentesting OS and Windows 10 and Raspbian is really hard on a 4GB RAM computer

#

That's my setup

idle owl
#

Oi.... yeah. 4GB with VMs sounds like a stretch.

hidden oxide
#

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

hidden oxide
#

I've got Mac Maverick - I don't use it anymore for that reason

idle owl
#

@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?

gilded cradle
idle owl
#

Right, exactly.

#

So I'm thinking using Terminal or Device Manager to find the port is pointless.

#

But I wanted a second opinion.

idle owl
#

I can basically say "Only plug in the board you want to flash" and then walk through the ESPTool steps.

#

Ok

#

Thanks!

gilded cradle
#

Sounds good

idle owl
#

@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...

gilded cradle
idle owl
#

Ahhh ok.

#

I guess I'll try to get esptool going again. I used it a long time ago, iirc.

#

Thanks

gilded cradle
#

yw

idle owl
#

Absolutely.

gilded cradle
#

Thanks

idle owl
#

Updated.

idle owl
#

@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.

idle owl
#

You're welcome!

#

Now I'll stop breaking my Feather. πŸ˜„

manic glacierBOT
manic glacierBOT
viscid pine
#

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

manic glacierBOT
#

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...
manic glacierBOT
#

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...

manic glacierBOT
#

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...

manic glacierBOT
#

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)
...
tulip sleet
#

@idle owl yay on Factory-Reset-Images

idle owl
#

@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?

tulip sleet
#

yes, I actually compiled the .ino into the .uf2. I think adding both fine would be fine.

idle owl
#

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.

tulip sleet
#

The NeoPixel pin number may vary between different RP2040 boards?

idle owl
#

Looking to see what's in this.

tulip sleet
#

that .ino may have been written before KB2040 got added to Arduino

idle owl
#

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:

tulip sleet
#

oh, sure, most people will just use the .uf2 anyway

idle owl
manic glacierBOT
#

@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...

idle owl
#

@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. πŸ˜„

lone axle
idle owl
#

@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.

idle owl
#

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....

lone axle
idle owl
#

OK, I'm there

idle owl
#

and like in the lib cookiecutter, I'd like "y" and "yes", "n" and "no" to both work. Because I never remember πŸ˜„

lone axle
#

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.

idle owl
#

in the directory name?

lone axle
#

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 %}
idle owl
#

{% if cookiecutter.dev_board in ['y', 'yes'] %}factory-reset{% endif %}

lone axle
#

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.

idle owl
#

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"?

lone axle
#

I'm not 100% certain, but I think the directory conditional would carry over to them.

idle owl
#

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

lone axle
#

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.

idle owl
#

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.
lone axle
#

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.

idle owl
#

Ok, thank you.

idle owl
#

Without that folder, it runs properly.

lone axle
#

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.

idle owl
#

Oh ok