#circuitpython-dev

1 messages Β· Page 359 of 1

manic glacierBOT
#

The small example in the section above contains an small error:

**import countio
import time
from board import *

error "board not defined" here -> pin_counter = countio.Counter(board.D1)

pin_counter = countio.Counter(D1) # this is the fix
#reset the count after 100 counts
while True:
if pin_counter.count == 100:
pin_counter.reset()
print(pin_counter.count)**

Thomas

manic glacierBOT
manic glacierBOT
#

The mpconfigboard.mk file for the Blackpill species different Flash device that the one linked to on the product page. the link is for the GD256Q16C https://www.adafruit.com/product/4763

I put one of these on the boards and naively just created a build with from the tip of main.
Not surprisingly, the board boots to safe mode and the OS is unhappy with the new device....

I changed the mpconfigboard.mk to specify the GD256Q16C

SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICE_COUNT...
#

Thanks @hathach. Some websearching shows this is a convention, and that terminal programs typically assert it when opening the conenction. So does pyserial, by default. This does not mean that DTR/DSR-style flow control is enabled. There is no other easy way to determine that something is connected on the host end. I can add more docmentation to .connected to make this clear.

Some more websearching shows that other people have had this problem with C#, which defaults to DTR not being set.

manic glacierBOT
#

I also verified that just adding the GD25Q16C to the list works as well.

diff --git a/ports/stm/boards/stm32f411ce_blackpill_with_flash/mpconfigboard.mk b/ports/stm/boards/stm32f411ce_blackpill_with_flash/mpconfigboard.mk
index 9a95a3539..166b56b6e 100644
--- a/ports/stm/boards/stm32f411ce_blackpill_with_flash/mpconfigboard.mk
+++ b/ports/stm/boards/stm32f411ce_blackpill_with_flash/mpconfigboard.mk
@@ -4,9 +4,9 @@ USB_PRODUCT = "stm32f411ce blackpill with flash"
 USB_MANUFACTURER =...
manic glacierBOT
onyx hinge
#

sadly, even with the 1500 bytes I found, and another 170 bytes, I still can't enable built-in sdcardio on feather m0 adalogger. πŸ˜•

#

I could disable neopixel too (there's no onboard neopixel)

solar whale
#

@onyx hinge I'll be happy to create a PR for the BlackPill. I have not done one since the "pre-commit" changes were implemented. Can you easily describe what I need to do now to create a PR -- I don't see any mention of "pre-commit" in the guides for PR ... or have I missed it?

onyx hinge
#

@solar whale I think someone was updating a guide to add it, not sure

blissful pollen
#

I'd think you could probably get away without neopixel for a logger, or even put a note that if you want this get X build instead?

onyx hinge
#

I don't see where it was added to docs. you want to pip install pre-commit (however you invoke pip normally, it may be pip3, python3 -mpip, etc,) once per system. Then in any git repo where you want to enable pre-commit checks, you run pre-commit install once per repo to enable checking each time you commit and you can check all files with pre-commit run --all.

#

@solar whale ^

solar whale
#

@onyx hinge Thanks -- I'll give it a try later today.

onyx hinge
#

It would be nice to have sdcardio built in, but back over 1600 bytes of flash storage savings right away -- when there's a perfectly workable if not quite as fast module to do the same thing -- seems like a wrong decision.

#

tuning up performance a little bit on an M0 board is less important than just giving us some everyday breathing room when it comes to M0 builds filling their flash

#

especially since people would have to change their code to use it

manic glacierBOT
solar whale
#

That is a strange case where you run out of Flash, but have enough RAM to load the Python module....

onyx hinge
#

Β―_(ツ)_/Β―

manic glacierBOT
tulip sleet
#

@onyx hinge I'm fine with merging the COMPUTED_GOTO savings. I left it to you in case you had more to add.

thorny jay
#

What did go wrong with my PR #32 to split this library into package to save some space? It was an answer to an issue #27 from @slender iron from April 7th 2020 and my PR was available since August 24 2020. Now around February 14 2021 Sandy made a PR for new hardware from Pimoroni (and it is great that RP2040 based Pimoroni hardware use CircuitPython). But now my PR cannot be reconciled automatically (or at least you may understand that I don't want to spend time on this again...). https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3731/network

tulip sleet
thorny jay
# tulip sleet Hmm, usually GitHub is better at showing the merge conflicts. I think this was h...

Yeah, it did require change in learn guide, those were identified. I believe it is still needed to split as this library will continue to inflate with stuff like this: https://twitter.com/veryalien/status/1368573430656864257?s=20

I made some very pretty tiny 2040 rainbows on a couple of @pimoroni 5 x 5 RGB LED matrix breakouts.
🌈😎
The @adafruit @CircuitPython is31fl3731 library needed to be cajoled into believing that RGBMatrix5x5 things exist, and eventually the pixels started to glow! 😊
#rp2040

#

And the day such a change will be done, it will affect all of the Pimoroni customer too... because they started on the non split library.

manic glacierBOT
thorny jay
# tulip sleet Hmm, usually GitHub is better at showing the merge conflicts. I think this was h...

Maybe @slender iron was right and each product should have it's library and not sit in the chip library: https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3731/issues/27

tulip sleet
#

yes, that sounds like how displayio additions libraries vs drivers is structured

thorny jay
#

But this is a core work for Adafruit, not from contributor.

thorny jay
#

If Adafruit show the way, contributor will follow the pattern. When I added board to that library, I followed the existing pattern.

manic glacierBOT
#

rtc.RTC was not written with sleep in mind: it sounds like it should remember something in RAM during deep sleep. I don't know that we can do anything about hard reset without saving info in flash, which may not be a good choice in the long run.

I don't know how an nRF52-based device that wants to keep a clock works if it has no extra hardare. Presumably if you remove the battery it loses its idea of what time it is. Typically it may ask another device for the time (e.g., its supporting ...

manic glacierBOT
stone iris
#

Seeing reports of Mu not recognising the REPL when using a Pico with the latest beta of CircuitPython.

blissful pollen
manic glacierBOT
#

I was worried about whitespace after commas, so I tried a bunch of variations. "A, B" counts as two, that's fine, but leading or trailing whitespace will add to the count, so adding a $strip() will help. However, removing the quotes is tricky. https://stackoverflow.com/a/10430975/142996

  EXTERNAL_FLASH_DEVICE_COUNT := $(words $(subst $(COMMA), ,$(strip  $(subst $\",,$(EXTERNAL_FLASH_DEVICES)))))

Test Makefile:

COMMA := ,

TEST = "  A,B "
COUNT := $(...
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Loosely related to issue #4345:

The usb_cdc documentation (https://circuitpython.readthedocs.io/en/latest/shared-bindings/usb_cdc/index.html) is missing the following methods :

  • readline() - returns bytearray, takes 0 or 1 argument, seems to be a _typing.WriteableBuffer) or some sort of stream
  • readlines() - returns array of bytearray

Aditionally, it is missing any infor...

manic glacierBOT
manic glacierBOT
#

Progress notes: I looked more carefully at how to do i2c_driver_install() only once, as we are currently doing, and then to reuse the installed drivers as needed. I found there was no clean way to reassign the pins based on the current API. It is possible to deassign the pins using negative pin numbers, but that caused other things not to be done properly.

I have gone back to the original scheme of installing and deleting I2C drivers on demand. I am looking at why deleting an I2C drive...

manic glacierBOT
orchid basinBOT
manic glacierBOT
turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

58

Voice Channels

6

Members

27913

Roles

34

manic glacierBOT
manic glacierBOT
#

@igrr I narrowed down the issue to the treatment of a single semaphore in i2c_driver_delete() by some divide and conquer work (comment out code until it stops breaking and then add it back piece by piece). Here is the code in esp_idf/components/driver/i2c.c:

esp_err_t i2c_driver_delete(i2c_port_t i2c_num)
{
    I2C_CHECK(i2c_num < I2C_NUM_MAX, I2C_NUM_ERROR_STR, ESP_ERR_INVALID_ARG);
    I2C_CHECK(p_i2c_obj[i2c_num] != NULL, I2C_DRIVER_ERR_STR, ESP_FAIL);

    i2c_obj_t *p_i2c...
lone axle
#

Are there any other relevant flags similar to --all-files that can tell pre-commit to run only on checked in files?

#

--files [FILES [FILES ...]] seems like it could help but I'm not sure if all the hooks treat that parameter the same. I tried using that instead of all-files but some of the hooks still failed for some things unrelated to the files I specified, so some of those hooks must be looking at a wider set than the ones specified by this.

tulip sleet
analog bridge
lone axle
#

Thank you that does seem to make it skip my "extra" uncommitted file (perhaps using the stash technique mentioned above) But it also seems to have caused it to skip an actual change in one of the real library files:

Actual output did not format well. It shows skipped on all of the checks including pylint and black, which I think it needs to run on my change.
#

maybe the git diff needs to be done without --cached removing that does get it to list the file I changed.

fossil gorge
#

I thought that pre-commit automatically stashed anything that wasn't ignored or staged in Git. Didn't it?

lone axle
#

It does print these messages which seem to indicate it is:

[INFO] Stashing unstaged files to /home/timc/.cache/pre-commit/patch1615213587.
....running checks...
[INFO] Restored changes from /home/timc/.cache/pre-commit/patch1615213587.

But it's also still failing with reasons pointing to files that aren't checked in. I'm not sure I understand the behavior of all the different components involved.

#

I don't get those messages every time I run either though. Perhaps that is tied to one of the input flags.

tulip sleet
#

dang that was pressing the wrong button [accidental beta.4 release - removed]

orchid basinBOT
onyx hinge
#

oops!

tulip sleet
#

I was trying to do "Save Draft" in the release notes, and 2 pixels over was "Publish Release". oh groan, well, I could do it, but it's not that interesting. I'll get Anne to kill the tweet.

manic glacierBOT
orchid basinBOT
manic glacierBOT
#

(Explanation - after accidentally pressing "Publish Release" instead of "Save Draft", I am going to keep draft release notes in an issue, so that can't happen again. Two other advantages are that the editing interface has a menu bar, unlike the release notes editor page, and it's public. I'll create an issue for each upcoming release and then close it on release.)

manic glacierBOT
manic glacierBOT
#

As of today, I'm still seeing results from 2.x and 3.x as the first result on Google, but it's now hiding the content. Typically the Latest docs are the second result. So... partial success? At least it's now easy to tell from the search results page which links are going to go to Latest, even if the bad links still show up.

<img width="674" alt="Screen Shot 2021-03-08 at 12 40 02 PM" src="https://user-images.githubusercontent.com/5904176/110359446-7fad6e00-800b-11eb-9da5-8d0022d9c1ba.png...

thorny jay
#

versus

#

if x <= 5:
r = x * 16 + y
else:
r = (x - 5) * 16 + y - 8
return r

tulip sleet
#

if you put the original formulas in a comment, I think that's fine. Then someone can check your algebra and recognize the original formula from the datasheet or whatever. If the rewrite reduces the number of computational operations, then it seems worth it.

#

comments are free and save the reader time

drowsy geyser
#

FWIW I think the one-liner is more elegant, but as @tulip sleet says, a comment would be justified.

thorny jay
#

I'll check some of those formula, the original was a truth table, I made the if else, then I found about tertianary operator.

#

I have a test program to compare two function and make sure they give the same result. πŸ™‚

tulip sleet
#

i have done some minor timing checks on tertiary operator vs if's and I don't remember that there was much difference.

drowsy geyser
#

Interesting. I'm trying to build latest from source, but I'm getting an error about strict overflow checking: CC ../../lib/tinyusb/src/common/tusb_fifo.c ../../lib/tinyusb/src/common/tusb_fifo.c: In function 'tu_fifo_write': ../../lib/tinyusb/src/common/tusb_fifo.c:149:6: error: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Werror=strict-overflow] if ((p > p + offset) || (p + offset > f->max_pointer_idx)) ^ cc1: all warnings being treated as errors make: *** [../../py/mkrules.mk:55: build-feather_m4_express/lib/tinyusb/src/common/tusb_fifo.o] Error 1 Could someone point me to the right solution (I don't want to just bodge it)?

tulip sleet
#

make sure you are using gcc10

#

check the Building CIrcuitPython guide

#

gcc 10 is smarter about that error

drowsy geyser
#

Ahhh, ok, I'm at 9.3.0. I'll update gcc.

#

Thanks, Dan!

drowsy geyser
#

Hum. No joy with gcc-10. I'll just pull latest from the S3 bucket.

modern wing
#

Good afternoon all you wonderful folks! adabot

idle owl
#

@gilded cradle Do I see correctly that you submitted the tests for the datetime library?

gilded cradle
#

Only some of them

#

I think Brent did the majority of them

idle owl
#

Ah fair enough. I only checked the first two.

#

There's only three

ionic elk
#

Won't be able to make today's meeting unfortunately

gilded cradle
#

I was mostly disabling skips

ionic elk
#

Didn't really have anything new anyway though

gilded cradle
#

Each file does multiple tests

idle owl
#

@gilded cradle Ok. Pylint is having a rough time with it, and I think it's worth discussing how we run Pylint on tests. But I also think some of it might be valid failures. I'll bring it up in the meeting.

idle owl
turbid radish
#

Lurking

drowsy geyser
#

Also lurking. But hello everyone.

modern wing
#

better!

solar whale
#

@drowsy geyser did not recognize the name change...

gilded cradle
#

Same here, but I recognized the profile pic

modern wing
#

@idle owl Macbook?

thorny jay
#

array of microphone.

solar whale
#

Magic Mic

idle owl
#

@modern wing MacBook Pro. yes.

drowsy geyser
#

@solar whale It's easier to pronounce than "hukuzatuna"

modern wing
#

@idle owl It's probably under the left side speaker -- on the 15" and 16" models, it mutes the left side speaker to help with the echo cancellation. I've found out the hard way when touching the left speaker was....unkind....to my listener's ears. πŸ‘‚

idle owl
#

@modern wing Gah yeah. Fair enough.

#

FYI: The US changes to Daylight Saving Time on March 14, so the next meeting is at 2PM EDT, which is UTC-4.

slender iron
#

hey folks and <@&356864093652516868> , feather rp2040s are in stock if you want one: https://www.adafruit.com/product/4884

lone axle
#

Yep got them ready

idle owl
#

@inland tusk Please mute.

solar whale
#

wrong channel

manic glacierBOT
thorny jay
#

not one but all the answer. πŸ™‚

#

That game beat me every time... I used to be good.

turbid radish
modern wing
#

Good luck with the new one -- we had the same happen a few years ago, and disliked the new one so much we returned it and got a used Speed Queen.

thorny jay
#

Is there a CP chess yet?

turbid radish
#

Maybe sunfish could be used?

manic glacierBOT
gilded cradle
#

Thanks for reading, my internet dropped for a few minutes

solar whale
#

is the beta.4- tag gone too?

slender iron
#

we should have the next one be beta.5. it's ok to burn beta.4

turbid radish
#

Email me @lone axle when the guide is submitted please

tulip sleet
solar whale
#

You need to make a .mpy to test on an M0 board

still zephyr
#

Build a Keyboard and Mouse Emulator, make a rainbow with RGB LEDs, and work with a microSD card - all with CircuitPython on a Raspberry Pi Pico!

Article with diagrams and code: http://bit.ly/picocp
More articles and tutorials: https://dronebotworkshop.com
Join the conversation on the forum: https://forum.dronebotworkshop.com
Subscribe to the ne...

β–Ά Play video
thorny jay
#

Now I am worried because I don't know if I have been using VSYS or VBUS...

gilded cradle
#

I'm pretty sure that's correct.

fossil gorge
#

Here but lurking

turbid radish
#

Thanks everyone

modern wing
#

Thanks πŸ™‚

gilded cradle
#

Thanks

mental nexus
#

Thanks all!

still zephyr
#

Thanks

errant grail
#

Thanks!

fossil gorge
#

Thanks everyone. Will catch the replay/recording when it goes up πŸ™‚

thorny jay
#

Thanks.

gilded cradle
#

I gotta go feed the cats 🐱

solar whale
#

Have a great week πŸ‘‹

#

no -- it is UTC-4

#

a good reason to abolish it

idle owl
#

@slender iron I have a quick thing if you have a minute.

#

We can chat here, it's not personal.

onyx hinge
#

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

slender iron
#

@onyx hinge ping me if you have time after you do meeting stuff and take a break today re: weblate

tidal kiln
#

@idle owl hey. got a read the docs / CI question if you've got time.

idle owl
tidal kiln
#

it's not urgent. you can ping me later? if ur busy.

fossil gorge
#

Just a quick note - I'm catching up on the Youtube replay, and audio's quite faint.

turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

58

Voice Channels

6

Members

27933

Roles

34

onyx hinge
#

@fossil gorge yeah it's a bit lower than ideal, but I think I at least got me & the audio participant levels closer. I'll continue working on it next time.

#

OBS had both sides peaking in low yellow which I thought would be okay

#

they were at -11.2 and -3.3 so I'll try -7.9 and -0.0 for next time

idle owl
#

@tidal kiln Working on getting the newsletter out, so if that works, I'll ping you later. (I typed this out immediately after you messaged me and got distracted... so yes I'll ping you later.)

onyx hinge
#

@slender iron I'm back and can chat now

tidal kiln
#

@idle owl gotcha. no worries.

slender iron
#

@onyx hinge for the translation "minimum"

#

I was thinking of using weblate's priority setting

onyx hinge
#

I'm not familiar with that

onyx hinge
#

how does one set the priority flag -- in the web ui or in the .pot file?

slender iron
#

the description I saw was in the web ui

#

I don't have permissions though

#

which is why I'm bugging you πŸ™‚

onyx hinge
#

did you log in with github?

fossil gorge
slender iron
#

ya

onyx hinge
#

huh, Dan did that and he was awarded admin access right away. I'll get you set up though.

slender iron
#

maybe I linked it later...

onyx hinge
#

could be.

#

are you weblate user tannewt too?

slender iron
#

yup

onyx hinge
#

OK you should be added with administration access now

slender iron
#

thanks!

onyx hinge
#

hopefully you can mass-edit priority somehow

#

I didn't find the spot for it yet

devout jolt
#

Hi! Is there a way to get the name of the board (e.g. "QT Py", "Pico", "ItsyBitsy M4") in CircuitPython? It would be handy when creating a single piece of code for multiple devices. I think board.name would be a good place for it. I've checked sys and microcontroller and can only get chip name and CP version

slender iron
onyx hinge
#

ahhh

slender iron
#

I'm looking in their github for more clarity

#

@devout jolt I think there is os.uname() or something too

#

but ya, it'd be good to provide the board ID too

#
``priority:N``
    Priority of the string. Higher priority strings are presented first to translate. 
    The default priority is 100, the higher priority string has, the earlier is 
    offered to translate.
devout jolt
slender iron
#

I'll do them as priority:200

onyx hinge
#

this is cool, we'll be able to use a search like priority >= 200 and untranslated (not sure of exact syntax) to check the status of a language.

slender iron
#

πŸ‘

#

it'll prompt for those first too

#

k, lunch time. I'll try to mark them all later today

idle owl
#

@tidal kiln Ok. I have a moment.

tidal kiln
#

hey! ok...one sec....let me context switch...

idle owl
#

waits

#

context switches as well

tidal kiln
onyx hinge
idle owl
#

@tidal kiln Checking.

tidal kiln
#

right, but what in the CI deploys to there?

idle owl
#

It looks like it's rendering properly.

onyx hinge
#

last build was 1 month + 1 week ago

idle owl
#

What is missing?

#

I think it's a release thing iirc.

onyx hinge
#

The github actions CI is not what deploys the readthedocs stuff

#

github sends a hook or something to readthedocs, and then they build it

idle owl
#

It's a webhook

#

yeah

tidal kiln
#

basically, it's not up to date

idle owl
#

Oh wait I see it.

#

So....

idle owl
#

You released on 29 January, and I think that's the last time it built.

onyx hinge
#

is there particular text you're not seeing online?

idle owl
#

Where is values though?

#

values property appears to be missing.

#

Rebuilding manually to see if it's something in the lib that's causing it.

tidal kiln
#

and others that went away are still there

#

button_C and button_Z for example

idle owl
#

It might simply be a glitch. But let me see if it works.

tidal kiln
#

cook. ok. thanks.

idle owl
#

Nope.

#

Let me see.

#

Hmph.

#

I'm perplexed.

#

You're right that it's not updating. values should be in there at least.

tidal kiln
#

@onyx hinge new values and buttons properties are not showing up. and old ones are still there.

onyx hinge
#

the metadata in the html say weird things .. "build_date": "2021-03-08T22:18:00Z", ..., "commit": "b653d734",

tidal kiln
#

@onyx hinge also thanks for looking / helping as well πŸ™‚

onyx hinge
#

oh I may know, hold on

#

main vs master

tidal kiln
#

ohhhh. that could totes be it.

idle owl
#

Oh.

#

I can fix that.

#

Has to be added when the docs are created.

tidal kiln
#

yah. i did that change about that same time frame.

onyx hinge
#

and somehow, possibly following the link from rtd, I was seeing that "master" when I thought I was on the default branch

idle owl
#

Alright the update triggered a rebuild.

#

I'll tell you when it's done.

onyx hinge
#

checklist item to add when transitioning a repo to 'main' I guess

tidal kiln
#

was that a change on RTD or github?

idle owl
#

@onyx hinge Oi, thank you, that didn't even come close to occurring to me.

#

RTD.

tidal kiln
#

anything i could/should do? or just bug you when it happens?

idle owl
#

That did not seem to resolve the issue though....

#

@tidal kiln Probably bug me? But I should probably sort out not being a single point of failure there. I don't think you do enough with it for it to make sense to give you credentials.

tidal kiln
#

yep. i agree.

onyx hinge
idle owl
#

Oh good then mine is cached.

onyx hinge
#

"stable" did not appear to change. has that version been released yet?

idle owl
#

Thanks <insert whatever is caching here>

tidal kiln
#

not sure, what designates the "stable" release?

onyx hinge
#

I'm not sure either.

tidal kiln
#

"stable" = latest release
"latest" = current repo head
?

idle owl
#

I thought stable ... yes that

#

afaict.

onyx hinge
#

If your versions follow PEP 440, Read the Docs activates and builds the version if it’s greater than the current stable version. The stable version is also automatically updated at the same time. See more in Versioned Documentation.

#

We also create a stable version, if your project has any tagged releases. stable will be automatically kept up to date to point at your highest version. If you want a custom stable version, create either a tag or branch in your project with that name.

#

so yes it should be that when a version is given a tag -- that doesn't look like a prerelease per PEP 440 -- it should update the "stable" docs

#

@idle owl mind prodding the button to re-build the "stable" docs and see if it makes a difference?

onyx hinge
#

or maybe we'll have to tag 1.0.1, to make it really re-think its choices

#

I wonder if the "release" not being in the history of what it thought was the "default branch" inhibited some of this fancy processing.

idle owl
#

Rebuilding now.

onyx hinge
mental nexus
#

A basic question on .h file organization in shared-bindings and shared-modules. What's the decision point for which function headers go in which location? I assumed that functions in shared-bindings would go in shared-bindings/CPCode.h, but sometimes they're found in shared-modules/CPCode.h.

idle owl
#

@onyx hinge Thanks for checking since my browser is being a jerk.

onyx hinge
#

@mental nexus I think that shared-bindings can contain the function prototypes that would be identical in any implementation (thinking of cases where there is a common-hal implementation, for instance). but I am not 100% sure of the rule, I just guess and see what makes it through PR review.

mental nexus
#

Also regarding function naming, for example fontio. All functions in shared-bindings start with fontio_, but over in shared-modules, some start with common_hal and another one with fontio_ I suspect that the fontio_ ones are exposed to the user while the others are not. But then why is there a fontio_.._get_glyph over in shared-modules. Main reason for my questions is so that I can be clear when adding functions I can do it in the appropriate and expected place.

tidal kiln
#

yep. looking good for both latest/stable now. thanks @idle owl @onyx hinge

mental nexus
idle owl
tidal kiln
#

ok. next question. feather rp2040 reset behavior - CIRCUITPY isn't showing up after reset.

tidal kiln
#

well. thought about that...but can't....no REPL 😦

#

this is after copying over latest UF2

#

all works fine, just nothing after reset

crimson ferry
#

@tidal kiln not sure if related, but I have seen no REPL, no serial or CIRCUITPY on host (mac)... requires full nuke and re-install to fix (filed an issue)

manic glacierBOT
tidal kiln
#

@crimson ferry thanks. can you link issue.

crimson ferry
#

I think it’s flash-related? But could be >1 issue or just something quirky about reset/usb

manic glacierBOT
tidal kiln
#

@crimson ferry may be related? not sure. at this point I'm not even copying files, other than the firmware UF2 to the RPI-RP2 folder. that gets CIRCUITPY just fine. can connect to REPL. blinked the LED, etc. then simply reset..and...nothing.

#

hmmm. no CURRENT.UF2 ?

manic glacierBOT
idle owl
#

@lone axle Do you want to take a stab at updating the datetime library to have another hook like the one for the example code, except for the tests directory?

idle owl
#

@prime flower I sent you an email regarding the datetime lib. If you have time tomorrow or Wednesday I'd like to chat in Slack or here.

prime flower
idle owl
#

@prime flower It's not! Sorry to bother you, I forgot you were out. Ping me next week when you're around!

prime flower
#

np - will do next week! (I use the same discord account for everything, incl school, should really decouple!)

idle owl
#

@prime flower I totally get it. I'm the same with Discord.

idle owl
#

@lone axle I commented on the PR with what I'm looking for. If you're not up for it, please let me know in the GitHub thread. Thanks!

crimson ferry
#

after bootloader, now reset puts me in never-never land, will need to nuke again

tidal kiln
#

what is the "nuke" process?

crimson ferry
#

drop the raspberrypi . org nuke UF2 onto the bootloader, I'll dig up the link

#

(I haven't found an Adafuit full erase UF2)

tidal kiln
#

what happens if you copy a firmware UF2 without doing the nuke?

crimson ferry
#

nothing, still won't mount CIRCUITPY, and no indication of serial presence, but code.py seems to be running

#

that nuker is for Pico, not sure if it's really correct for Feather RP2040, but I'm not aware of one specifically for Feather

tidal kiln
#

ah, pico doesn't show a CURRENT.UF2 either, so that may not be related or matter

lone axle
idle wharf
# manic glacier

@ornate breach might be interested in this as well. I know they were looking into S3 stuff this weekend

ornate breach
#

It was the C3, unexpectedmaker on the other hand did do a video or a stream with the S3 though πŸ™‚

idle wharf
#

C3 / S3 lol. πŸ€¦β€β™‚οΈ

fossil gorge
lime trellis
#

@tulip sleet usb_cdc breaks helper scripts that my students use for automatically opening a putty session with the most recent usb device connected (b/c we now have multiple usb ports). What compile-time option do I set to get the old behavior?

tulip sleet
#

CIRCUITPY_USB_CDC = 0

#

In general, the lower-numbered port is the REPL port. What is the OS your students are using?

lime trellis
#

I'll comment on the PR with this info so dum-dums like me can find it πŸ™‚

tulip sleet
#

There are ways to determine which port is which. The interface name is "CircuitPython CDC data" for the REPL and "CircuitPython CDC2 data" for the secondary channel. If we provided a script to identify the port, I assume that would help you. Could you open a new issue, and include the scripts you are using now? My very next task is to get Mu to identify the corretc port.

#

of course you can use an earlier version of CircuitPython for now unless you need the later version

#

this is the point of putting it in the beta, to find these cases and figure out what to do πŸ™‚

lime trellis
#

Thank you for the info!! building now just to verify πŸ™‚
RE older CP: eager beaver students were already building beta 3 and found the hiccup. what can ya do haha

#

@tulip sleet I've been meaning to ask: are there any efforts to get the REPL running in the browser. Not over wifi, just the browser accessing the serial port?

My biggest CP hurdle with students is a low-effort way of accessing the serial monitor and REPL. Had some push back downloading and installing Mu

manic glacierBOT
tulip sleet
#

the CIRCUITPY_USB_VENDOR options turns on WebUSB. However, WebSerial would be easier. You'd still need to choose the serial port. I have tried the Google demo WebSerial program and it doesn't quite work, but it's close and probably just needs a little work. In either case I think it may only be supported by Chrome. Gotta go, but feel free to ping me with more q's about this

lime trellis
#

ty!

manic glacierBOT
#

Awesome new usb_cdc capability creates multiple serial ports when connecting to PC/Mac/Linux machine. The REPL port number is not consistently highest/lowest number which causes issues for scripts written to auto-connect to CP boards. @dhalbert suggested this issue be created:

Some of the scripts my students and I use:

Windows Batch:

@echo off
python -c "import serial.tools.list_ports as ls; p=ls.comports(); [print(i[0]) for i in p]" > Output
SET /p SERPORT=<Output
START...
#

Two questions:

  1. Should I still work on the feather_m0_express in the top comment for building out the ninja script? Or is there reason to merge the years' worth of changes from main back to the ninja branch?

I'd probably start with the latest main and merge in the files from the old branch. I don't think there is much history there worth saving. I believe the QSTR stuff may have changed a bit. It's probably one of the larger things to move over.

  1. This may be early to ...
manic glacierBOT
#

Thank you for being a guinea pig for this. It turns out that there is enough information provided by pyserial to figure out which port is right. You need to use the .interface attribute on the result of comports():

import serial.tools.list_ports
for port in serial.tools.list_ports.comports():
    if port.interface == "CircuitPython CDC control":
        print(port.device)

The key is the port.interface, which is the interface name. For the REPL port, it is `CircuitPy...

onyx hinge
#

I investigated whether using qstrs as "dictionary words" can improve message compression. It requires moving to a 16-bit representation of chars on all translations, so that the space for "words" is larger Unfortunately, it looks like it's not a net improvement, based on trinket_m0_express de_DE build size.

tulip sleet
#

thanks for investigating this

manic glacierBOT
#

Yes, we still need this. The exec of the wait is only done during a resume(). Some devices (i.e. irremote) don't do a resume - they just wait for the next pulse to come in.
But if we have more than one pulsein device; each one will create its own state machine - won't that then create a new offset (program pointer) for each one? The programs themselves would be different due to the first operator differing if the initial states differ.

manic glacierBOT
manic glacierBOT
#

@tannewt As discussed enclosed Draft for I2CPeripherals Feather RP2040.

To take into considerations:

  1. I build the firmware, but I had to change a reference that I could not figure out, it is market with a TODO. Help is needed here.
  2. Overwritten the Original i2cperipheral in shared-bindings, as I needed to build to verify errors
  3. In a strange turn of events, the function `i2c_write_raw_blocking' paragraph 4.1.10.3.13 is not available in the SDK library in our REPO, so any writing t...
manic glacierBOT
#

It may be something besides flash, or in addition to flash. I've seen, and on Discord @caternuson mentioned seeing this behavior without file copy activity.

It could be a complicating factor that I'm using the Pico flash nuke UF2 to get the device back. I have not seen that one exists for the Feather RP2040. I don't know of any other way to recover the board when this happens. The Pico version seems to work, and afterward allows power cycle, hard reset, re-entering the bootloader to instal...

manic glacierBOT
#
Adafruit CircuitPython 6.1.0-beta.2 on 2020-12-03; FeatherS2 with ESP32S2

Code/REPL

https://github.com/adafruit/Adafruit_CircuitPython_DHT/blob/master/examples/dht_simpletest.py

Behavior

in the Pulseio.PulseIn library https://github.com/adafruit/Adafruit_CircuitPython_DHT/blob/7c81737eff2b2fcaf399dfc7afee61d12867ca58/adafruit_dht.py#L82
For the Metro ESP32S2 if I use hi-sig=True: Only the first measure will be good, as the pulse...

manic glacierBOT
#

Firmware

Adafruit CircuitPython 6.2.0-beta.1 on 2021-01-27; Seeeduino Wio Terminal with samd51p19

Code/REPL

>>> import board
>>> import digitalio
>>> import busio
>>> import adafruit_sdcard
>>> spi = busio.SPI(board.SD_SCK, MOSI=board.SD_MOSI, MISO=board.SD_MISO)
>>> cs = digitalio.DigitalInOut(board.SD_CS)
>>> sdcard = adafruit_sdcard.SDCard(spi, cs)

Behavior

Traceback (most recent call last):
  Fi...
manic glacierBOT
#

I had a great chat with @unexpectedmaker about this update to the IDF, he's going to post more detailed notes, but a couple of things:

1.The paths updates I provided (now ~ a month old) are incorrect in many instances, wherever possible the path should have an esp32s2 folder in the path.
2. In order to support S3, ESP32 as well as the S2, from the same port, the build system will need to have a way to indicate the target board. @tannewt should advise on that, and we should probably break ...

#

I had a great chat with @UnexpectedMaker about this update to the IDF, he's going to post more detailed notes, but a couple of things:

1.The paths updates I provided (now ~ a month old) are incorrect in many instances, wherever possible the path should have an esp32s2 folder in the path.
2. In order to support S3, ESP32 as well as the S2, from the same port, the build system will need to have a way to indicate the target board. @tannewt should advise on that, and we should probably break ...

#

@hathach
https://gist.github.com/bitboy85/543b34a9505280ead8103a4d4d9cab26
2 different keyboards, no mixed device.

I remember a doc that says, a boot keyboard endpoint requires a packet size of 8 byte.

As additional reference: https://www.usb.org/sites/default/files/hid1_11.pdf
page 50-54: GET_PROTOCOL and SET_PROTOCOL request for boot device
page 62: Keyboard implementation
page 74: Boot keyboard requirements

manic glacierBOT
#

I'm just curious if I understand this..

So if we added IDF_TARGET = esp32s2 to each boards/<boardname>/mpconfigboard.mk
we could then use the INC as you show above anywhere there is a mcu specific include and then the S3 or any other idf support mcu could be supported.

There was this thread about INC paths in the PR which I still think is relevant. A standar way the includes are handled in this port will ...

manic glacierBOT
manic glacierBOT
#

Interesting!

Did you try compiling with MICROPY_OPT_COMPUTED_GOTO disabled, ie using a big switch in the VM? I just tried this patch out here and it seems that a big switch is still smaller than what is here.

Using minimal port, cross compiled to Cortex-M4 with -Os:

build options                                       fw size     diff to baseline
baseline MICROPY_OPT_COMPUTED_GOTO=0                67224       +0  
MICROPY_OPT_COMPUTED_GOTO=1                         69008       +...
manic glacierBOT
manic glacierBOT
#

because turning it on produced a 5x (!) gain in speed

That doesn't seem right... using computed goto or not shouldn't affect how often the VM hook macros are executed, and shouldn't lead to such a huge difference in speed. I just tested this by running our benchmark suite on a PYBLITEv1.0 (STM32F411) and turning off MICROPY_OPT_COMPUTED_GOTO leads to about a 1-2% decrease in performance.

manic glacierBOT
#

Well, since I didn’t develop the code originally, no I don’t. I did look around in the uPy github repo and see it’s quite a bit different, so I imagine there’s

quite a bit of work to accomplish it; but, on the other hand, I strongly feel that the original implementation for these boards wasn’t done correctly. Why

waste a good percentage of the on board memory, especially when the board doesn’t have onboard sd card socket with which to overcome the loss of

the onboard memory. I understa...

fossil gorge
#

To answer your question from the meeting yesterday Jeff, I'm window-shopping anything! Either a Windows PC (what a pane to find a decent one at a decent price), or a fruitless search for a reasonable second-hand Apple

manic glacierBOT
#

The behavior I saw is very simple and 100% repeatable:

  • Hold BOOTSEL, press RESET, get RPI-RP2 folder
  • Copy adafruit-circuitpython-adafruit_feather_rp2040-en_US-6.2.0-beta.3.uf2 to RPI-RP2 folder
  • Board self rests when copy is complete, CIRCUITPY folder shows up, everything works as expected - can access REPL, etc.
  • Can create a code.py and soft reset via <CTRL><D> at REPL and it works as many times as you want.
  • Press RESET button, the CIRCUITPY folder goes way ...
tulip sleet
#

@Hugo I have bought many machines from https://www.dellrefurbished.com. There is almost always a coupon of some kind for 30-50% off. See the Coupons & Deals link. The coupons often come out later in the week. Occasionally dealnews.com has private coupons. These are off-lease machines. The "B" condition ones are fine.

I have read that with the advent of the M1 Macs, the price of other used Macs has dropped significantly. But you may not be seeing this.

onyx hinge
#

huh I get a security warning visiting that url

tulip sleet
#

so www. it is, oh well πŸ™‚

#

i edited the link

#

and sent them a message.

fossil gorge
#

Thanks @tulip sleet, much appreciated!

#

For the intel based macs, I think there's some reluctance from folks giving up their current one on the off-chance that the new one doesn't do what they want it, or isn't spec'd "well enough".

tulip sleet
#

i just got from dell refurbished a 2019 micro-sized Optiplex desktop with 16GB, a 512GB SSD, and an i7-8700T (6/12 cores/threads) CPU, $424 tax included. That was a very well spec'd machine. i5's are much more common. Also nearly all come with Win10 Pro.

fossil gorge
#

Dang!

tulip sleet
#

that is after a 40% coupon

onyx hinge
#

The built-in RTC of this matrixportal I have has a lot of error, a second every few minutes. What is this RTC referenced to and is there any way to improve it? I saw there's a calibration property but neither extreme makes an appreciable difference; the adjustment units of maybe-parts-per-million only have an 8 bit range but the error is on the order of 6000ppm..

tulip sleet
#

I am not sure the matrixportal has a crystal

fossil gorge
#

That's pretty much a no-brainer. I just want something that I can put 32 or 64GB of RAM in, so I can Docker and VM things I need, but wow...

tulip sleet
#

it was a 16GB SODIMM, so there's room for another. I would have preferred a SFF size, which has more USB ports, but I really wanted the 6 cores

onyx hinge
#

this is while connected on USB, I know some devices have OK timekeeping on USB and really poor timekeeping off of it.

tulip sleet
#

you can also find stuff like this on eBay, but the prices vary more

onyx hinge
#

and probably the dependability of the product too

tulip sleet
#

i have had some laptops fail but no Optilex desktops

fossil gorge
#

I'm reluctant to go the eBay route, but "official" or well refurbished products I'm quite ok with

lone axle
#

@idle owl when you have a moment sometime can you look into the DisplayIO_Layout library docs. This is the latest merged PR on it: https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout/pull/9 As far as I can tell all of the actions seemed to pass successfully. When I build and look at the docs locally they look good to me, and do include all of the new things. But the page that is live on readthedocs when we follow the badge link seems to be out of sync with the repo. It's showing an older copy of the docs before some of the more recent additions were made. DanH took a look last night and found a webhook URL that needed updating, but we are still seeing that older copy on the live page. (Perhaps it would need another PR to be merged now that the setting was changed though for the live page to actually update?)

tulip sleet
#

before that my dev machine for three years was an Optiplex 7010 i5 with SSD I got for $100 on craigslist

fossil gorge
#

Wow!

tulip sleet
#

i added some RAM and another SSD but it's still fine. The new machine is about twice as fast on multicore CircuitPython builds, but the raw speed of a single thread is not that much greater

manic glacierBOT
idle owl
#

@lone axle For some reason "latest" didn't rebuild when you did the release. "stable" shows the latest things. I did a manual rebuild on latest, but it shouldn't be required.

idle owl
lone axle
idle owl
#

@lone axle Keep an eye on it though. Because it should have updated.

lone axle
#

Will do.

idle owl
fossil gorge
#

I can handle it, since @lone axle has a few other things going on

idle owl
#

Great, thank you!

fossil gorge
#

Any time! πŸ™‚

idle owl
#

What's another word for "capability" in the context of GPIO pin capabilities

#

I don't like that word in what I'm writing up, but I'm completely blocking on another option

onyx hinge
#

I guess I need to join the ranks of people having trouble with mass storage on the feather rp2040. I've been trying to copy some large-ish "mp3" and either it's hanging or it's taking much longer than I expect.

blissful pollen
#

abilities?

onyx hinge
#

the repl seems to get confused too

fossil gorge
#

What's the sentence or context?

tulip sleet
#

are you using beta.3 or latest? Try a newest latest because Scott fixed a tinyusb regression

idle owl
#

It's a section title in the Feather RP2040 guide, and it's going to be pins listed by what they can do, versus by pin name. So the title is "GPIO Pins by Pin (Capability)"

tulip sleet
#

oops, it's not merged yet ,let me merge

solar whale
#

@idle owl -- would "function" or "functionality" work?

fossil gorge
#

Functionality?

idle owl
#

YES!

#

There it is.

onyx hinge
#

looks like I have a random old ref from my rotaryio work, I'll update

idle owl
#

@fossil gorge @solar whale Thank you.

blissful pollen
#

was goign to say features, but functionality is better

fossil gorge
#

The human thesauruses... thesauri? thesauriae?

blissful pollen
#

the pin's "super powers" would also be an okay choice πŸ™‚

fossil gorge
#

or "Spells available"

idle owl
#

Hah! If the pin concepts for this weren't already a bit confusing πŸ˜„

fossil gorge
#

The pin number, that maps to the GPIO number available with the spells and/or superpowers of blinking an LED...

mental nexus
manic glacierBOT
blissful pollen
idle owl
#

We include both pin numbers.

#

And yeah that's getting a little advanced πŸ˜„

fossil gorge
#

Just a thought, might it be worth having both pin numbers and GPIO numbers in the board for the PiPico? so you could have board.PIN25 and board.GPIO13 (I don't have the datasheet handy, so made up an equivalency). And then the GPIO is defined as, essentially, board.GPIO13 = board.PIN25 (or vice versa).

#

Because there is a lot of crossing of terms in many resources I've seen online so far, and it's always prefaced with "Make sure you're using the right PIN/GPIO number"

#

Not sure what impact it would have on space thought.

onyx hinge
#
>>> import storage
>>> storage.erase_filesystem()
``` OK .. umm .. storage.erase_filesystem() still doesn't work !? It acts like it does (clean reboots) but filesystem contents aren't re-initialized?
#
>>> import os; os.listdir('.')
['.fseventsd', '.metadata_never_index', '.Trashes', 'code.py', 'lib', 'boot_out.txt', 'hello.txt', 'alot-128.mp3']
>>> import storage; storage.erase_filesystem()

[tio 11:07:57] Disconnected
[tio 11:08:03] Connected
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

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

Adafruit CircuitPython 6.2.0-beta.3-75-g7d92f5aa5 on 2021-03-09; Adafruit Feather RP2040 with rp2040
>>> import os; os.listdir('.')
['.fseventsd', '.metadata_never_index', '.Trashes', 'code.py', 'lib', 'boot_out.txt', 'hello.txt', 'alot-128.mp3']
blissful pollen
manic glacierBOT
onyx hinge
#

ooookay, that's my fault, but why? well, we can revert it.

idle owl
#

The GP pins are listed so folx who want to use it with the SDK can. We don't intend to add them to the board def for CircuitPython, as far as I know.

onyx hinge
#

still having trouble copying files πŸ˜•

manic glacierBOT
#

@johncblacker hi John, the NUCLEO-F767ZI was added by a community member, so it was probably just a mistake in the setup parameters that never got caught. The big F7/H7 Nucleos don't see as much use as the Discovery boards, so this kind of setup problem can persist for a while.

@tannewt this is probably just a typo/parameter problem in either the linker or the flash settings. I can take a look after wrapping up my low power draft today. @k0d might also have ideas, I think he was the one wh...

#

I am having trouble copying "large-ish" files with Adafruit CircuitPython 6.2.0-beta.3-75-g7d92f5aa5 on 2021-03-09; Adafruit Feather RP2040 with rp2040. In my case, I wanted to copy a ~5MB mp3 file for testing.

<details>
<summary>
Kernel messages (click to open)
</summary>

[701219.528873] usb 1-2.4.2: new full-speed USB device number 29 using xhci_hcd
[701219.888376] usb 1-2.4.2: New USB device found, idVendor=239a, idProduct=80f2, bcdDevice= 1.00
[701219.888380] usb 1-2.4....
#

Ok, looks like it's just a linker thing. Filesystem size probably just wasn't a priority for whatever @k0d was using it for, and we don't tend to make big internal filesystems for chips in favor of external flash, but none of the F7 boards have that so we can up it. I'll need to refresh on the F767 flash organization briefly to make sure there's nothing that makes using a bigger chunk of the flash a problem (like buffering sizes), but we can probably at least increase it to match the H7 defau...

idle owl
#

@tulip sleet Opinion time. The PWM pins for Feather RP, includes PWM0 A: PWM0 B: etc, up to PWM6 (because PWM7 isn't exposed). Every one of them except one have pins exposed. PWM2 B does not. Do I leave it in the list with "(none)" after it or remove it from the list since there's no pins for it?

tulip sleet
#

i think none is good because then it's obvious it's not a typo in the list

idle owl
#

Ok thanks

#

@tulip sleet Was that what you had in mind?

#

When you suggested pins listed by function in your review of this page last week

onyx hinge
#

OK from the original schematic I can see it, there's a pin 1 arrow on the upper left corner, not visible in the fab print for some reason

manic glacierBOT
manic glacierBOT
#

FWIW, I did modify the boards .ld file and made it look more similar to the uPy version. Basically added a single line called FLASH_APP, built the firmware onto the board but it didn’t make

any difference, so there’s more to it than that and I don’t know enough about the module structure to go any further myself. I did find one file that defined the flash size as 96k (0x18000) but

not know what other dependencies there might be I was hesitant to change that value. The file I looked at is...

slender iron
onyx hinge
#

yeah, I did.

slender iron
onyx hinge
#

if I hadn't, the version number would have said "-dirty", I am pretty sure

slender iron
#

tinyusb should be 2ad

tidal kiln
manic glacierBOT
#

Just for grins, I made a change in the internal_flash.h file for the 767zi changing the size from 0x18000 to 0x200000, rebuilt, flashed to board, checked size and it was still around 80k – so that didn’t work!

jb

From: Lucian Copeland @.>
Sent: Tuesday, March 9, 2021 12:22 PM
To: adafruit/circuitpython @.
>
Cc: John Blacker @.>; Mention @.>
Subject: Re: [adafruit/circuitpython] NUCLEO-F767ZI STORAGE ISSUE (#4330)

@johncblacker <https://github.com/j...

fossil gorge
slender iron
#

@tulip sleet beta.3 had the mistaken tinyusb rollback in it right?

manic glacierBOT
#

@johncblacker I would not expect anything using FLASH_APP in the linker to work. Linker flash sections will need to match our existing definitions, and there may be additional work that needs to be added to the flash buffering system.

Also, just a gentle heads-up: whatever email client you are using for Github is inserting all kinds of weird whitespace and a massive signature into your messages. It's not a big deal for me to edit them down so they're readable, but it might be something t...

manic glacierBOT
tulip sleet
slender iron
#

ah, I see

tulip sleet
#

@slender iron so there were two rollbacks of tinyusb??

slender iron
#

no, just one

tulip sleet
slender iron
#

right, that's why I was thinking beta.3 was bad

#

but those fixes were merged after beta.3 and then rolled back accidentally

tulip sleet
#

no, maybe not that, but any way, a bunch of new commits

slender iron
#

right

#

so it's still worth trying absolute newest over beta.3

tulip sleet
#

yah, and maybe we should update tinyusb to latest

manic glacierBOT
tulip sleet
manic glacierBOT
slender iron
#

right right

manic glacierBOT
#

Just for grins, I made a change in the internal_flash.h file for the 767zi changing the size from 0x18000 to 0x200000, rebuilt, flashed to board, checked size and it was still around 80k – so that didn’t work!

You'll also need to recreate the file system after changing the space for it. If it starts in the same place, then it will just use the existing smaller file system. You can do storage.erase_filesystem() from the REPL to recreate it.

#

@tannewt As discussed enclosed Draft for I2CPeripherals Feather RP2040.

Thanks for the PR! It is much easier to reply to and see the changes.

1. I build the firmware, but I had to change a reference that I could not figure out, it is market with a TODO. Help is needed here.

I glanced over the code but didn't see a TODO. Please ask me about it here.

2. Overwritten the Original i2cperipheral in shared-bindings, as I needed to build to verify errors

You shouldn't nee...

manic glacierBOT
manic glacierBOT
#

That worked…now when I right mouse click on the cPy drive, I see 2MB. Did an os.statvfs(β€˜/’) and here’s what I get:

os.statvfs('/')

(1024, 1024, 2028, 2021, 2021, 0, 0, 0, 0, 255)

Looks good to me…how about you?

From: Scott Shawcroft @.>
Sent: Tuesday, March 9, 2021 4:06 PM
To: adafruit/circuitpython @.
>
Cc: John Blacker @.>; Mention @.>
Subject: Re: [adafruit/circuitpython] STM32: NUCLEO-F767ZI Storage Issue (#4330)

Just for grins, I ma...

#

Sorry about the replies…I’m using M/S Outlook…

From: Lucian Copeland @.>
Sent: Tuesday, March 9, 2021 3:13 PM
To: adafruit/circuitpython @.
>
Cc: John Blacker @.>; Mention @.>
Subject: Re: [adafruit/circuitpython] STM32: NUCLEO-F767ZI Storage Issue (#4330)

@johncblacker https://github.com/johncblacker I would not expect anything using FLASH_APP in the linker to work. Linker flash sections will need to match our existing definitions, and there may...

lavish saffron
#

HI, how does my community bundle driver get uploaded to PyPi? The Build CI runs twine check dist/* but I can't see a step that actually uploads it. Thx.

manic glacierBOT
#

Firmware

Adafruit CircuitPython 6.2.0-beta.3 on 2021-03-04; Adafruit MagTag

Code/REPL
Wifi test from guide

import ipaddress
import ssl
import wifi
import socketpool
import adafruit_requests
 
# URLs to fetch from
TEXT_URL = "http://wifitest.adafruit.com/testwifi/index.html"
JSON_QUOTES_URL = "https://www.adafruit.com/api/quotes.php"
JSON_STARS_URL = "https://api.github.com/repos/adafruit/circuitpython"
 
# Get wifi details and more from a ...
tidal kiln
#

@lavish saffron the pypi deploy happens from the individual library repo, not the bundle repo

manic glacierBOT
#

So, regarding the QSPI pins, I think I'm losing some hair with how they're named.

Here's what I have in pins.c now:

    // QSPI, used by flash on this board, but is broken out on MicroMod connector.
    { MP_ROM_QSTR(MP_QSTR_SPI_SCK1), MP_ROM_PTR(&pin_P0_19) },  // 0.00 - IOSCK | Flash Serial Clock
    { MP_ROM_QSTR(MP_QSTR_SPI_COPI1), MP_ROM_PTR(&pin_P0_14) }, // 0.00 - IO0 | Flash Data 0
    { MP_ROM_QSTR(MP_QSTR_SPI_CIPO1), MP_ROM_PTR(&pin_P0_21) }, // 0.00 - IO1 | Flash D...
lavish saffron
manic glacierBOT
#

I updated this pr so it can be the basis for collaboration and moving things forward:

  • Moved the esp-idf tag forward to the v4.3-beta1 tag.
  • Added IDF_TARGET to every board file, used that in the INC section of the makefile
  • Changed a few includes so they use the short path because they had 'esp32s2' in the include.
  • Hand merged @microDev1's I2C changes into my branch. There was an I2C build error and then after there was not.
  • I alphabetized the INCs. That might be incorrect... l...
lavish saffron
#

Hi, the upload-pypi release action is failing with Invalid or non-existent authentication information. See https://pypi.org/help/#invalid-auth for more information. I have checked my PyPi API token in the GitHub repo's Repository secrets as per the link in the error message and it seems fine, so I'm not sure where to go from here?

manic glacierBOT
manic glacierBOT
still zephyr
#

@lone axle Very good job in the New display_text guide. I love it!!

lone axle
#

Thank you!

still zephyr
#

@lone axle question here I saw that we have the Refactor in, do we introduce changes rebasing on this and canceling olds PRs?

lone axle
#

@onyx hinge I think there may be a permission issue with the notes doc for next week linked in the pinned message. When I follow that link it takes me to a page to 'Request Access'

still zephyr
#

yes same here for the doc for next week

lone axle
#

Sorry that the refactor came right in the middle of those PRs and require more tweaking on them.

#

Or starting a new branch if you want for clean commit history, instead of merging. But it's no big deal to have those commits in either I think.

still zephyr
#

mmm, do not worry, not saying that I do not want help :), but it is ok, I have all the changes in my mind. And I prefer to start a new branch as you mentioned. I am open, if you want to help, just let me know which one do you want to take, I do not want that we work on the same PR πŸ™‚

#

But after yesterday C rabbit hole a little of python fresh air is most welcome for me

lone axle
still zephyr
#

Ok deal. Thanks @lone axle I will work on the others. Thanks again

onyx hinge
#

@lone axle I'll fix it when I'm back at a desktop computer.

#

I got it wrong at first and trying to fix it made it worse

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

For the Pico, storage.erase_filesystem() did not work in 6.2.0-beta.3 nor in adafruit-circuitpython-raspberry_pi_pico-en_US-20210309-d650849.uf2. I also used the flash_nuke.uf2, reloaded CPy, and then created an empty new file in the filesytem that did not cause any trouble. Again, storage.erase_filesystem() did not work with either version, and the board did not reboot to CPy after losing the connection. Unplugging and replugging showed the new file was still there.

By comparison,...

marble hornet
#

@mental nexus did your slide switch ever make it into a library on gh? would love to try it out and having some trouble finding it

onyx hinge
#

<@&356864093652516868> the permissions on the notes document for next week have been corrected -- please let me know if you still have trouble @lone axle @thorny jay

marble hornet
mental nexus
onyx hinge
manic glacierBOT
idle wharf
#

@analog bridge are you around ?

analog bridge
idle wharf
#

Question for you. Does your update-idf branch build successfully?

analog bridge
idle wharf
#

Mine does not. Why don't you just do a PR and I'll close mine.

manic glacierBOT
#

Hello, just wanted to stop by and say this is looking fantastic and I can't wait.

Also wanted to ask @jun2sak: what did you use to draw those state machines? They're excellent!

I also had a bit about the RTC, maybe worth a discussion elsewhere.

rtc.RTC was not written with sleep in mind: it sounds like it should remember something in RAM during deep sleep. I don't know that we can do anything about hard reset without saving info in flash, which may not be a good choice in the lo...

analog bridge
idle wharf
#

Yes that is checked.

#

ONe thing to note. I tried pulling in your changes AND adafruit main and both times, I ended up with the same error outside the eps32s2 port

#
QSTR updated
../../supervisor/shared/workflow.c: In function 'supervisor_workflow_connecting':
../../supervisor/shared/workflow.c:39:12: error: implicit declaration of function 'tud_connected'; did you mean 'tud_connect'? [-Werror=implicit-function-declaration]
     return tud_connected() && !tud_suspended();
            ^~~~~~~~~~~~~
            tud_connect
../../supervisor/shared/workflow.c:39:12: error: nested extern declaration of 'tud_connected' [-Werror=nested-externs]
cc1: all warnings being treated as errors
analog bridge
#

this must be related to submodule update

idle wharf
#

Possibly... I just wanted to mention it.

#

Also if you don't want the $(IDF_TARGET) mixed in, submitting your own PR would clean that up as well.
But I see you didn't update the IDF's commit, you pointed the submodule to espressif's repo\branch instead.

analog bridge
#

have you got a backup of IDF_TARGET changes as I will be rebasing your branch

idle wharf
#

They are super easy to do again now that I know how, go for it.

analog bridge
#

okay... something came up just now... I'll get back to this shortly

idle wharf
#

No worries, Thank you MicroDev !

analog bridge
#

πŸ™‚

manic glacierBOT
idle wharf
#

Thanks again @Micrdev We should have just done this 20 days ago πŸ˜‰

#

Also, you were spot-on, once I pulled your changes, I had to update submodules again and now I'm building successfully.

analog bridge
#

nice... I'll rebase again... my local pre-commit checks were turned off which led to the ci failure.

manic glacierBOT
analog bridge
#

@idle wharf I might have overwritten a commit of yours...

idle wharf
#

We made the same change. I ran pre-commit

#

all good

analog bridge
#

oh...πŸ‘

manic glacierBOT
idle wharf
#

Boom... esp32s2 port on IDF 4.3 builds clean thanks to @analog bridge !

analog bridge
#

@idle wharf I am taking a look at $(IDF_TARGET) now...
have you got i2c working with v4.3?

idle wharf
#

Yes. I was able to run the 4.3 based build on a feathers2 and access a bme680 over i2c.

analog bridge
#

that's interesting cause bruce mentioned some i2c semaphore issues

idle wharf
#

Earlier today, I saw issues with I2C in the build, but once I merged in your changes in i2c.c\i2c.h it got passed that point.

#

ben running fine for about 40-50 minutes

analog bridge
#

ok... I'll test it, SPI does crash though... I am running a backtrace now

idle wharf
#

I can scan I2c fine too ...

analog bridge
#

I think I got why SPI crashes... fixing now.

idle wharf
#

I don't think it was a question, but UART is working... (I had a GPS lying on my desk so I hooked it up.)

manic glacierBOT
manic glacierBOT
onyx hinge
#

I wonder which other optimization flags are in use on that particular file in the micropython tests .. like, we've already gone to -Os there for size savings in the builds where we enabled these new size optimizations

#

but reviewing the discussion around the 5x speedup/slowdown, that's when background tasks were heavyweight too

#

so maybe we should re-test that

tulip sleet
#

@onyx hinge I did look at the build for that board, and it is -Os mostly

manic glacierBOT
solar whale
#

For anyone interested -- just hooked up a rfm9x radio breakout to my RP2040 Pico via SPI -- works normally. No issues transmitting or receiving.

tulip sleet
#

the background stuff netted another 2x or so

manic glacierBOT
manic glacierBOT
idle wharf
#

@supple gale if you have some time, checkout the udate-idf PR it would be good to know if you have any I2C issues.
I did not, but you mentioned you did on Microdev's fork previously.

manic glacierBOT
#

~Please see the PR #4195 I made some of these changes to head us down this path.~ We discussed and Microdev removed those changes so we could get in his fixes which built the as-is branch on idf release/4.3

@tannewt if you show me an example of how to specify a variable in an include, I'm willing to update all the includes to the long paths an remove the length INC section.

We don't actually do it in #include with SAMD. Looks like we always do it in -I: https://github.com/adaf...

#

I'd say ignore the flash use for the pin mapping and just go by the pinout names. The data pin numbering for SDIO doesn't match the mapping for QSPI because they are different things.

Yeah they just threw me for a loop with that kinda-but-not-really off by 1 πŸ˜‚ Took me far longer than I'd like to admit to figure out why it wouldn't run. 🀫

This looks good to me! Let me know if you agree and then we'll merge.

Punch it, Chewie!

slender iron
#

@uncut nexus how are you doing wrt pulsein? it still needs another iteration at least. I can pick it up if you are getting tired of it

timber mango
manic glacierBOT
solar whale
#

@timber mango I was just experimenting - I like to verify that I can use the rfm9x boards with all microcontrollers so I keep my options open. There should soon be some low power options for the nRF52840 boards so I'll also want to try them again once it is released.

manic glacierBOT
#

Starting new issue as requested from here:
https://github.com/adafruit/circuitpython/issues/4349#issuecomment-795742928

Pretty simple way to re-create:

  • Hold BOOTSEL, press RESET, get RPI-RP2 folder
  • Copy firmware UF2* to RPI-RP2 folder
  • Board self resets when copy is complete, CIRCUITPY folder shows up, everything works as expected - can access REPL, etc.
  • Can create a code.py and soft reset via `` at REPL and it works as many times as you want.
  • Press RESET but...
timber mango
#

Hi makes sense, you mean the board of nordic? A good thing for would be the adafruit rfm95x support pi.alarm with deep sleep. On Ffriday my case for the s2 will hopely arrive πŸ™‚ so I can attach it to the door πŸ™‚

manic glacierBOT
manic glacierBOT
manic glacierBOT
supple gale
manic glacierBOT
#

I came across this while sleuthing for a way to enable I2C pull-ups for Keybow 2040.

The I2C.c for rp2040 included a special case for writes <=2 bytes, claiming that the hardware does not support these.

I'm guessing this was a workaround for an early SDK bug, since I can't find any evidence this is true.

Deleting this code did not adversely affect register reads from an is31l3731 which involve a single byte of data written to set up the address pointer, followed by a read.

I am u...

manic glacierBOT
#

I originally wanted to call the module "buttons" (#295), but I guess that was too generic. I'm open to suggestions for another name.

Another option is to introduce a completely new module that would actually handle buttons correctly, using pin change interrupts instead of polling, like the gamepad does, and then phase out gamepad β€” that is however still a little bit beyond my skill at the moment. I suppose the gamepad_shift would need to stay how it is, though, as the shift reg...

manic glacierBOT
#

Okay I've been directed at https://github.com/adafruit/circuitpython/pull/4315 where @dhalbert has performed far more extensive testing within CircuitPython than I have.

However I still submit our entire library of C++ Breakout Garden drivers - including working C++ implementations of BME280 - as evidence that 1-byte and 2-byte I2C writes are fine in general. Indeed these are a cornerstone of SMBus so I'd suspect some citation or fairly clear errata if the Pico were broken in such a fu...

#

Do not delete this code. it's completely necessary for 0-length writes. See https://github.com/raspberrypi/pico-sdk/issues/238 for a recent query of mine about this.

MicroPython uses bitbang for 0-2 bytes (besides the address). The reason for 1 or 2 I don't know, and have asked, but haven't yet received an answer. I did the same thing in our code. I may reduce it to zero-length bytes in the future.

The internal pullups are not very strong.

manic glacierBOT
#

Thank you for clarifying.

I'm trying to figure out what we've stuck the TCS34725 on, since I recall the sensor name and seem to have written a Python driver for it once upon a time. I'm a bit officeless at the moment, though, so my ability to do any useful sleuthing is somewhat hampered.

I have a PA1010D, an MSA301 and a BME280 from your list- basically working with what we've got Breakout Garden versions of.

From experience we seem to have these Keybow 2040 boards running pretty ...

simple pulsar
#

Hi, I've got some minor displayio weirdness on a no-brand SSD1306 attached to a Pi Pico via i2c. It was working well until I introduced a Bitmap and some single pixel updates. It now pauses sometimes and corrupts a few pixels in an unrelated Rect. What's most likely part of all of that to be buggy? I dropped i2c to 100kHz and that made no difference.

manic glacierBOT
#

I had disabled the check for SDA and SCL pull-ups and fudged in some code to enable the onboard ones, but yes I originally ran into the infamous "check your wiring" error.

I can enable pull-ups for the I2C with an #ifdef and regular Pico SDK commands in the I2C init.

However, in this case bitbangio setup:

    shared_module_bitbangio_i2c_construct(&self->bitbangio_i2c, scl, sda,
                                          frequency, timeout);

Will still fail with:
...

#

I think I have also hit that problem recently with the Adafruit Joy Bonnet and the Anavi Play pHAT:
https://github.com/dglaude/circuitpython_phat_on_pico/blob/main/play_phat.py
https://github.com/dglaude/circuitpython_phat_on_pico/blob/main/joy_bonnet.py

I did not report something but did not link to gamepad, but it is very likely that I was using the gamepad on those two board when I noticed:
#circuitpython-dev message

So I ...

manic glacierBOT
#

Until a time is set, the RTC is not running, and rtc_get_datetime() returns false without assigning to the out-parameter.

In CircuitPython, this would manifest as arbitrary values being returned by rtc.RTC().datetime, since uninitialized storage on the stack was being converted into a timestamp.

After this change, the RTC starts on January 1, 2020. I think this is the same epoch as the other ports.

manic glacierBOT
tough flax
#

Got my Feather RP2040 today & tried to make an AT HeadMouse using a BNO055 - it worked... briefly πŸ™‚
I made a video: https://www.youtube.com/watch?v=6dau3qSTxW8

For a brief moment, our HeadMouse worked using the new Adafruit Feather RP2040 board! This is great news because we were able to get our existing code working on this board in about 20 minutes. The bad news is that it crashed after a few seconds with an I2C error.

We're certain we can get this straightened out quickly and are really excited t...

β–Ά Play video
#

Are there known issues w/I2C on this board?

#

I will go look at issues, but was hoping someone could point me in the right direction

manic glacierBOT
lavish saffron
#

Hi, the GitHub upload-pypi release action is failing with Invalid or non-existent authentication information. See https://pypi.org/help/#invalid-auth for more information. I have checked my PyPi API token in the GitHub repo's Repository secrets as per the link in the error message and it seems fine, so I'm not sure where to go from here?

manic glacierBOT
idle wharf
#

I think something in your setup isn't quite right...
If you look at this https://github.com/BiffoBear/CircuitPython_AS3935/runs/2071312909?check_suite_focus=true#step:6:7
You'll see the user name and password are blank.


Run python setup.py sdist
  python setup.py sdist
  twine upload dist/*
  shell: /usr/bin/bash -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.9.2/x64
    TWINE_USERNAME: 
    TWINE_PASSWORD: 

But if you look at this successful run from another library

https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3731/runs/2082370852?check_suite_focus=true#step:6:7

Run python setup.py sdist
  python setup.py sdist
  twine upload dist/*
  shell: /usr/bin/bash -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.9.2/x64
    TWINE_USERNAME: ***
    TWINE_PASSWORD: ***

There are placeholder "***" there which implies in your case the values are not being picked up.

silver tapir
#

Ok, weblate (-es) back to 100%

manic glacierBOT
onyx hinge
#

Is it OK to merge a PR while CI is failing like this, or should I wait until the test/ lint changes go in? https://github.com/adafruit/Adafruit_CircuitPython_datetime/pull/6 -- I think the change we want to make hasn't actually been made in cookiecutter or added as an adabot patch, so if I do something now I risk making it harder to apply the patches later..

#

@silver tapir thanks!

manic glacierBOT
manic glacierBOT
#

Firmware
Adafruit CircuitPython 6.1.0 on 2021-01-21; Adafruit Feather STM32F405 Express with STM32F405RG

Code/REPL
import board
import busio
uart = busio.UART(board.TX, board.RX, baudrate=9600)
uart.deinit()
uart = busio.UART(board.TX, board.RX, baudrate=9600)
Traceback (most recent call last):
File "", line 1, in
ValueError: Hardware in use, try alternative pins

Behavior
What I expect is that the deinit will release the bus, but it doesn't seem to. Is there an ...

manic glacierBOT
manic glacierBOT
#

Please ping when it's ready and we'll get it in.

Ya... this needs some coordination to avoid conflicts.

Is there a way to check the formatting in the CI via pre-commit?

Yes, we can have that.

This currently fails CI at Test all with the following error which I am unable to debug:

Run MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1
Traceback (most recent call last):
  File "./run-tests", line 615, in <module>...
manic glacierBOT
#

I was intrigued by your crash, so I ran a very simple test

import board
from busio import I2C
i2c = I2C(board.SCL, board.SDA)

FeatherS2 this works fine.
MetroS2, and Kaluga it goes into safemode.

I used the same BME680 on all boards.
Tested my own builds and the artifacts attached to the PR.

The difference between these groups of boards that I see is
the ones that fail use the WROVER module and the Feather
S2 (mine is a Pre-Release) uses the raw ESP32-S2.

M...

manic glacierBOT
#

This crashes for me on a debug build but the following fixes it:

diff --git a/ports/esp32s2/common-hal/busio/I2C.c b/ports/esp32s2/common-hal/busio/I2C.c
index d45d391a2..09e8ce9ca 100644
--- a/ports/esp32s2/common-hal/busio/I2C.c
+++ b/ports/esp32s2/common-hal/busio/I2C.c
@@ -94,7 +94,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
     if (self->semaphore == NULL) {
         mp_raise_RuntimeError(translate("Unable to create lock"));
     }
-    xSemaphore...
manic glacierBOT
manic glacierBOT
#

I also need a keyboard that works at boot time. I'm currently working on a software for a DIY split keyboard with each part having a Raspberry Pi Pico in it. All features I planned are now implemented and I will share the code on GitHub in the comming weeks. I just realized, that it does not work at boot time (at least not under macOS). I hope that this issue can be fixed, because otherwise building fully fledged custom keyboards is out of reach by using CircuitPython.

manic glacierBOT
manic glacierBOT
lavish saffron
# idle wharf I think something in your setup isn't quite right... If you look at this https:...

Thank you for your reply. I have my PYPI API key saved as a secret, but based on your information I can see that the release.yml file looks in an environment for ${{ secrets.pypi_username }} and ${{ secrets.pypi_password }} . I've created an environment and added the secrets with the username as __token__ and the password as my API key. I still get the same error though. Is there a naming convention for the env, or permissions that I have to set to allow the release.yml to access the secrets?

manic glacierBOT
lone axle
#

they are specifically under "Repository Secrets" not "Environment Secrets"

tulip sleet
manic glacierBOT
gloomy shuttle
manic glacierBOT
#

You can check the list of supported modules on the circuitpython.org downloads page for the specific board, such as https://circuitpython.org/board/stm32f4_discovery/. The canio module is not available at this time for "STM32F407 Discovery kit" or "STM32F412 Discovery kit". We would be happy to accept a pull request to enable it, if it is supported by the underlying hardware.

ionic elk
#

@onyx hinge do we want to close that issue? canio should work on every F4 board that has it, I don't see a reason to keep it turned off unless you had problems in practice on other boards

#

The F407 in particular is essentially identical to the F405

manic glacierBOT
manic glacierBOT
slender iron
#

@tulip sleet the issue I've been watching is serial only

#

it feels more like a google issue than an adafruit one

tulip sleet
#

i agree, they are not liking the USB drive for some unknown reason

#

the weird thing is it seemed to be fixed, and then regressed. I will have to break out the Chromebook again and try it before and after an update

slender iron
#

ya, I suspect its just something they don't test well

tulip sleet
#

do you have any kind of inside track?

slender iron
#

not really, just that issue

#

rpi emailed me a link to that issue

tulip sleet
#

well, I will see if I need to open another issue :/

slender iron
#

ya, that's probably best

#

I think the usb allowlisting may only impact thonny as well

#

because it uses pass through or something

manic glacierBOT
#

After some internal discussion, we have decided to disable usb_cdc by default for now. It will still be available to be turned on in a custom build. Several users found it interfered with their existing workflow because there were now two devices to choose from for the REPL. Normally the devices are assigned REPl first, but on Windows, a lower-numbered COMnn device may be reused for the second CDC if it is free.

In 7.x, we hope to be able to allow this feature to be turned on and off in ...

#

@tannewt; I'm not sure what you mean about FIFO's having an 'automatic'
interrupt. I did not see anything
about that in the RP2040 datasheet or
in src/rp2_common/hardware_irq/include/hardware/irq.h.
When I took the IRQ op out of the state machine program I did not see any
firing of the
interrupt handler; regardless of how the SM was configured. Could you
possibly explain? Thanks!

On Wed, Mar 10, 2021 at 12:25 PM Scott Shawcroft @.***>
wrote:

@.**** requested changes on this pu...

slender iron
#

anyone done webserver stuff on the ESP32-S2?

manic glacierBOT
#

@tannewt; I'm not sure what you mean about FIFO's having an 'automatic' interrupt. I did not see anything about that in the RP2040 datasheet or in src/rp2_common/hardware_irq/include/hardware/irq.h. When I took the IRQ op out of the state machine program I did not see any firing of the interrupt handler; regardless of how the SM was configured. Could you possibly explain? Thanks!

Yup! Sorry for being vague. In IRQ0_INTE you can enable SM#_RXNEMPTY and it'll fire IRQ0 to the core when the...

onyx hinge
#

@ionic elk I don't have any of the HW, so I didn't even try. Each board needs lines added to ports/stm/peripherals/[...]/periph.c at a minimum. And that assumes the C API is the same for all the various chips. I am fine leaving it open if you want to interpret it as a feature request, but as written it was a support request and that's been answered.

manic glacierBOT
#

Fixes #3846.
Fixes #4046.

Tagging @askpatrickw, @microdev1, @skieast for testing.

Tests that now work:

import board,busio

i2c = busio.I2C(board.SCL, board.S...
manic glacierBOT
#

Also, is there any requirement that x1 <= x2 or even x1 < x2?

I would argue for using the same semantics as a numpy slice assignment, which in turn is an extension of how slicing works in general in Python:

>>> n = numpy.zeros((8,8))
>>> n[2:5, 3:7] = 1
>>> n
array([[0., 0., 0., 0., 0., 0., 0., 0.],
       [0., 0., 0., 0., 0., 0., 0., 0.],
       [0., 0., 0., 1., 1., 1., 1., 0.],
       [0., 0., 0., 1., 1., 1., 1., 0.],
       [0., 0., 0., 1., 1., 1., 1., 0.],
       [0.,...
ionic elk
#

@onyx hinge it's no biggie, the F407 is a strict superset of the F405 so I put in a PR that updated it, since it was lagging behind the F405. The F412 would have required actual work so I ignored that part.

onyx hinge
#

@ionic elk thanks! I would not have known any of that. I just have vague warnings that they can be different in unexpected ways

ionic elk
#

Yeah the F412 in particular had weird register level changes for no reason

#

if you only use the HAL things tend to be consistent within a family but the H7 and F7 HALs change stuff in really subtle breaking ways so those take a lot of double checking.

#

The F407 is a specific case where it's actually literally the same silicon as the F405 with more features, they even share the same datasheet.

manic glacierBOT
#

I just tested based on this issue and I found that it the Feather RP2040 from the latest production run (I got 2 of them yesterday delivered by DHL to me in Canada) worked as they should. I followed the steps as laid out by caternuson at the start of the post.

  1. Attached the Feather RP204 to my Windows 10 PC
  2. Held BOOTSEL and pressed RESET, go the RPI-RP2 folder
  3. Dragged the latest UF2 file from circuitpython.org into the folder
  4. The CIRCUITPY folder appeared
  5. Opened MU and e...
#

Just as another datapoint: the two RP2040 Feathers I received yesterday exhibit this problem. The steps I performed:

  • Plug in device. It appears dead: no lights, no USB activity to host. Device draws 7 mA
  • BOOTSEL reset to RPI-RP2 bootloader. Device draws 21 mA
  • Install CircuitPython UF2. Latest tried was adafruit-circuitpython-adafruit_feather_rp2040-en_US-20210311-3b948b2.uf2)
  • Programming successful. Green neopixel, CIRCUITPY drive, both CDC UARTs, everything else all present....
tulip sleet
#

@mental nexus I have an uninformed question which is whether bitmaptools and vectorio share any purpose. They both can define rectangular regions, for instance.

mental nexus
#

As I started exploring the capabilities of vectorio just this week, I am now becoming less than clear on which is best to use. Here's what I know so far. For rotating, scaling and placing text, bitmaptools is currently the only option available.

#

As for manipulating polygons, we have a couple of libraries available, the built-in vectorio and the display_shapes library.

tulip sleet
#

when I was casually reviewing the latest additions to bitmaptools, it seemed like there was an overlap, and I was wondering if a unification was possible. vectorio does not deal with Bitmaps. Anyway, it's something to think about in the long run, maybe

mental nexus
#

Yep, I agree and the boundaries are overlapping (no pun intented). I think if you want to build a stagnant background, then bitmaptools may be the best way to go. If you have shapes you want to move their relative positions around, then vectorio or display_shapes is probably a better approach.

tulip sleet
#

got it, bitmaptools does not deal with "objects". It paints

mental nexus
#

Also, display_shapes is built in python, so it's relatively slow. You could probably build the same thing with bitmaptools if anyone wants a speedup.

tulip sleet
#

thanks - i have basically not used displayio and friends in any informed way

#

and so was wondering

mental nexus
#

One good thing about bitmaptools is you can pre-allocate all your bitmaps and keep them around and paint in them. That way you can avoid the memory segmentation issues if you keep your bitmap buffers around.

#

I was spurred into thinking about the differences in vectorio and bitmaptools and display_shapes by todbot and his dial gauge this weekend. I think vectorio is an underappreciated library. It's relatively fast at redrawing and pretty flexible.

low sentinel
#

@mental nexus OOM making layered static backgrounds with bitmaps is what drove me to make vectorio. Its api is pretty ready to add things like clipping masks and rotation in C. Just haven’t yet had a need.
Bitmaps take a huge amount of memory compared to a microcontroller when making an interactive UI. I reach for them when I actually need bitmaps. When I need a colored square or circle, it’s nice to have constant memory space requirement.

fossil gorge
manic glacierBOT
mental nexus
# low sentinel <@366059101203202052> OOM making layered static backgrounds with bitmaps is what...

WoW those are great points. Just to note for folks that with your vectorio you can already do polygon rotations by redefining a polygon's points (and I guess you could write your own wrappers to input angles rather than points). In @devout jolt 's dial, one key performance limiter is redrawing a fairly large rectangle when the dial needle goes to a 45 degree angle. In vectorio is there any way to make an arbitrary "dirty polygon" for speeding up redraws of angled shapes like a dial needle?

#

Oh, and vectorio is pretty good about filled shapes too. I think I'll gravitate toward using it more in the future.

low sentinel
#

It’s easy to write rotations in python. You can pin your coordinate system (in the vest or shape) at 0,0 and do the point math to rotate your point array about that axis.

It tries to avoid doing work it does not need to, what dirty area are you talking about though?

mental nexus
#

When drawing a rectangular dial needle, when it's horizontal, the dirty rectangle is the same dimensions as the needle. As it moves up to 45 degree angle, the "dirty" boundary redraw rectangle to cover it gets really big (meaning it has a lot of pixels more than just the skinny needle rectangle). So the display is asked to update a lot of pixels that aren't really "dirty".

#

My understanding of how displayio works is that it asks for every dirty pixel to be redrawn.

low sentinel
#

There’s logic in vectorio polygons so you could place your shape at -10000,-10000 and place polygon vertices within it at 10100,10050, and it will only mark the potential size of actually possible pixels not some gigapixel sized area.

Yeah I’m familiar with that however there’s not really a general way to do area marking like that without marking off the area.

#

Dirty rectangles life be like

#

Could use a gpu to open doors but we’re running on uC’s. I do quite like EVE2 but it’s quite a leap from displayio to that

mental nexus
#

Thanks for the insights on vectorio. As I start exploring it more, if I run into things I don't understand, I may pepper you with more questions. It's a great set of features, so thanks for adding it in there. Now, I'll just have to work understand the best ways of using all the capabilities it has.

manic glacierBOT
manic glacierBOT
manic glacierBOT
meager fog
#

@lone axle hihi

lone axle
meager fog
#

ok for the jp project, we're going to use the 3.5" TFT featherwing

#

dya have an rp2040 feather?

lone axle
#

I do, my two came yesterday.

meager fog
#

ok so ya just need the 3.5" TFT wing?

lone axle
#

Yep, that is correct. I did put in an RMA order for that a little bit ago.

meager fog
#

ok you already ordered?

#

or not

lone axle
#

I did order it, maybe an hour or two ago.

meager fog
#

ok what was the order number

lone axle
#

Order Confirmation No: 2509494-2006762344

meager fog
#

ok thanks

#

alright so the project part ya can help with is making nice lil image-buttons

#

with nice labels πŸ™‚

#

i figure you're doin a lot of it now

lone axle
#

Yep πŸ™‚ JP shared the main ideas with me. I think some the new stuff in the DispayIO_Layout library will be perfect for making little touchable icons with labels in a grid.

meager fog
#

ok thankx!

lone axle
#

For sure. Happy to help out with it! Thank you.

thorny jay
#

@meager fog did you get my suggestion to make your NeoKey pluggable at the back of a QT-Py (like todbot example with rotary encoder)?

meager fog
#

like a little shield?

#

ok gotta run l8r!

thorny jay
#

Just if the pin space is the same and the pin match... you have a one key keyboard.

onyx hinge
#

uint8_t fontio_builtinfont_get_glyph_index(const fontio_builtinfont_t *self, mp_uint_t codepoint) huh I guess nobody noticed that the builtin font could only have 256 (255?) distinct glyphs

manic glacierBOT
manic glacierBOT
#

This PR aims to aid light and deep sleep to the STM32 port. It also makes some minor naming alterations to the internal APIs, and includes some module changes to the STM32 peripheral structure. It's not working yet, so I'm keeping this as a draft.

Tasks:

  • [x] Extract EXTI from the PulseIn module and create /peripherals module
  • [x] Extract RTC from Port and create /peripherals module
  • [x] Common-hal prefix changes
  • [x] Pin/EXTI light sleep
  • [x] RTC based light sleep
  • [x] RTC fak...
manic glacierBOT
lavish saffron
gaunt spruce
#

Hi all qq, Im working on a MatrixPortal M4 board using circuit python and I have my secrets file working able to access the internet, but for whatever reason the adafruit_requests library isnt working. Specifically Im, importing adafruit_requests as requests and trying to perform r = requests.get('https://api.coindesk.com/v1/bpi/currentprice.json') I keep getting the following traceback error:

#

Traceback (most recent call last):
File "code.py", line 12, in <module>
File "adafruit_requests.py", line 681, in get
AttributeError: 'NoneType' object has no attribute 'request'

#

Any thoughts, normal requests package this works just fine

manic glacierBOT
#

I tested this using the CI artifacts on a MetroS2 an a Feather S2 PreRelease.
I ran dan's second code sample, and my own script using the BME_680. Both worked as expected.

I then copied over a script that connects to wifi and then prints the BME values.
It failed to safemode, when I disconnected USB and connected again the script worked.
I tried to reproduce that auto-load failure 10 times and could not.

Unless other people see that behavior, I would call this good.

still zephyr
#

@vague latch Regarding the Jupyter Notebook, actually Python in the computer are looking for the information in the ports and then, acting according the OS to look for the possible USB connected devices. In the CircuitPython side as I mentioned before, normally we could use the uname function in the OS module. So we do not have a list per se, the list is generated on the fly, when we request the serial communication from the jupyter notebook to the circuitpython board, but I agree with you, we could make some decision either in the Jupyter notebook or on the board

#

I did some work in the past in micropython and the jupyter kernel (only as a User), but I am wiling to explore the CP possibilities know

vague latch
#

is the uname in host os module or circuit python

#

sorry are you using

still zephyr
#

in circuit python on the boards

vague latch
#

so if the board isnt supported it wont have uname

#

so it would be better running this inside jupyter

still zephyr
#

is not supported by CircuitPython?

#

Yest it would bebetter, but we have the list of boards avalaible that we support

vague latch
#

we use the look up to check if the device is supported right

still zephyr
#

as you mentioned in ports

#

good idea

cedar moth
#

Good afternoon all. I just received my Feather RP2040 and am trying to get it to work with an SH1107 128x64 OLED Featherwing via I2C. I am getting an error when trying to initialize the I2C connection using the following code: `Adafruit CircuitPython 6.2.0-beta.3 on 2021-03-04; Adafruit Feather RP2040 with rp2040

import board

import displayio
displayio.release_displays()
i2c = board.I2C()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TimeoutError: Clock stretch too long
`

vague latch
#

yay i2c

cedar moth
#

Any thoughts appreciated, or should I file an issue?

crimson ferry
still zephyr
#

I am thinking that you need to use busio

vague latch
#

@still zephyr as board.py looks at the serial port. I dont think we would want to muddy this with os.uname(). As that is circuit python specific.

cedar moth
#

Thanks @crimson ferry and @still zephyr ... that was quick! I will give it a try. That code works on a Feather M4 Express and a QT Py so I thought it would with the RP2040.

still zephyr
#

@vague latch yes agree, we would need to change board, in order to this to work, maybe using some of the attributes of the port object

#

Maybe rethink _find_board(), how many devices are you dealing with?

vague latch
#

For me i only have a few. But i want to have the system work for anyone out of the box

still zephyr
#

🧐

#

But in order to the CircuitPython Kernel to work it needs to be connected to the REPL, so that could be our Try... Except

#

just tell the user that is not yet implemented

manic glacierBOT
#

I am also getting this error using the Feather RP2040 with an SH1107 128x64 OLED Featherboard:

Adafruit CircuitPython 6.2.0-beta.3 on 2021-03-04; Adafruit Feather RP2040 with rp2040

import board
import displayio
displayio.release_displays()
i2c = board.I2C()

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TimeoutError: Clock stretch too long

I get the same result using the most recent CP build for the RP2040:
Adafruit CircuitPython 6.2.0-beta.3-125...

vague latch
#

@still zephyr thats probably the simplest. We dont need to check the board at all. We just need the confirmation that the board is connected.

still zephyr
#

@vague latch do you have your project in Github?

vague latch
#

not at the moment. I am also working on adding a %magics to the kernel to allow python code to run as normal.

#

Not sure how to delineate them at the moment. Or whether the user should do that them selves

still zephyr
#

in CircuitPython kernel?

vague latch
#

yeah

manic glacierBOT
vague latch
#

My idea as was mentioned by someone else. is to utilise the amazing software library nbdev. This allows you to run the repl for testing and then run nbdev functionality to port your code to a .py file

#

You can also add documentation inline

still zephyr
#

Let me know if you need a hand. I would like to do more stuff with CircuitPython in the Jupyter Notebboks

manic glacierBOT
vague latch
#

nbdev finds all code that has the %export magic at the top of the cell and ports these to a file.