#circuitpython-dev

1 messages ยท Page 340 of 1

cunning verge
#

@hazy plover Hi! Thanks for the heads up - will make sure i do this

Very gateful

TTFN

J

ionic elk
#

had to change things like tuple to Tuple[str, int] in the commented interpretable section thingies

#

the mypy targets? what's the right thing to call those

manic glacierBOT
#

I have this to offer to further reduce the size of circuitpython. It looks like it lets de_DE fit on feather_m0_express feather_m0_supersized and metro_m0_express along with the changes in this PR: https://gist.github.com/jepler/1f40cdadfabe61661c5fbad8ab58f030

It removes a little-used (I believe!) feature, calling the built in function pow with 3 arguments: pow(a,b,c). This is perhaps useful if you want to implement the RSA cryptosystem in pure Python code, but otherwise not much. ...

tulip sleet
#

@onyx hinge how much does it save?

manic glacierBOT
tulip sleet
#

i am about to add some stuff necessary to support deep sleep, etc., that will exist even without CIRCUITPY_ALARM=1, and may use up your savings ๐Ÿ˜ฆ

onyx hinge
#

@tulip sleet my local build of metro_m0_express for de_DE of that PR has 140 bytes free after that change. Before, that PR had -244 bytes free in my local build

#

we talked about disabling EPD on m0 devices, but I don't remember if we concluded that was something to investigate or not.

tulip sleet
#

i think that would be fine. I also think we could try turning off _pixelbuf

#

_pixelbuf is 3200 bytes

#

As I said, I view this as temporary until gcc 10. I don't think we should spend a lot of time getting a couple hundred bytes here and there. It's a tremendous time sink.

onyx hinge
#

you said there's a preview build available?

onyx hinge
#

Thanks, I pointed a draft PR at it so we can check it out

manic glacierBOT
idle owl
#

@tulip sleet Something is up with the way Learn is processing the file. I just uploaded a new version, and it came out the same size. Here is the smaller file:

#

Trying one more thing.

#

Nope. Emailing learn.

tulip sleet
#

sounds good; they made a lot of changes recently, and I guess this is a regression

idle owl
#

Wait it's not Learn.

#

I just checked the new version of the exported file. It's huge.

#

Eagle is doing something

tulip sleet
#

seems like a bug... do you recognize that resolution number as typical?

#

what version of eagle are you using?

#

I 'll try it too. I wonder if it's peculiar to the board or to the eagle version

idle owl
#

9.6.2 Eagle @tulip sleet

#

That resolution is pretty typical I think.

#

I only ever change the resolution

tulip sleet
#

i tried the same thing in Linux Eagle 9.6.2, same size, and the resulting image is the right size.

idle owl
#

Well wt*.

#

9.6.2 is latest, so I can't even update it.

#

I guess I reinstall it.

tulip sleet
#

is this on Mac?

idle owl
#

Yeah

tulip sleet
#

did you update to Big Sur yet?

idle owl
#

Absolutely not.

tulip sleet
#

my only Mac is Big Sur; I only use it for BLE testing

#

yeah, I guess, try reinstalling. I wonder if the resolution is being confused by the "hi-dpi" stuff on Mac

#

but why would it show up now?

idle owl
#

I haven't the slightest. Wondering if it's been happening and I haven't noticed.

tulip sleet
#

was reported ages ago

#

did you do the export while using the laptop screen only, as opposed to desktop monitor, or vice versa?

#

I think it might depend on the resolution of the screen

idle owl
#

Desktop monitor, but I always have displays connected and use them as my main screen.

tulip sleet
#

so for hi-DPI screen, it gets it wrong??

#

anyway, photoshop to the rescue, but now you'll have to check in the future

idle owl
#

Yeah. Trying a fresh install now.

#

Same thing.

#

And I deeply uninstalled it with an app that clears everything.

tulip sleet
#
idle owl
#

I don't have it scaled though

#

It's using the default resolution afaik

#

Just checked another one, and it's also huge.

#

So I have no idea how long that's been going on.

#

Sigh.

#

Laptop display isn't even scaled.

#

None of the connected displays are scaled.

#

Folks are still reporting it. Well bugger.

manic glacierBOT
tulip sleet
#

@onyx hinge I do not understand why your gcc10 PR is failing. The download filename looks correct.

#

might be worth turning off the progress messages, which just make the log huge

idle owl
#

@gilded cradle Setting brightness of the NeoPixels LEDs using MagTag library is not working.

#

Or maybe I'm trying to do it wrong.

gilded cradle
#

I hadn't tried it. How are you doing it?

idle owl
#

I tried two ways. One I have pixels = magtag.peripherals.neopixels and I did pixels.brightness = 0.2, and I tried doing magtag.peripherals.neopixels.brightness = 0.2 as well in case saving it to a variable broke something, neither works.

#

Using pixels as the pixel object works everywhere else.

#

so pixels.brightness should work.

gilded cradle
#

What if you did something like magtag.peripherals.neopixels[0].brightness = 0.2?

idle owl
#

tuple object cannot assign attribute brightness

#

console error.

#

AttributeError: 'tuple' object cannot assign attribute 'brightness'

gilded cradle
#

Ah, ok. I'm not 100% sure brightness is implemented on the esp32-s2. Do you know if you can adjust it without using the library?

idle owl
#

I can adjust it on the external strip. Let me try with the onboard.

gilded cradle
#

ok

idle owl
#

Raw CP using neopixel allows setting the brightness, though oddly, setting it to 0 makes them max brightness. But setting them to 0.1 for example, makes them dim.

#

@gilded cradle ^

gilded cradle
#

Hmm, ok. That's good to know. Can you open an issue on the magtag library? I'm wondering if the 0 for max brightness is a bug that should be opened for circuitpython as well.

idle owl
#

@gilded cradle Probably.

#

@tulip sleet Setting the NeoPixels on MagTag to brightness = 0 makes them max brightness. CP problem or NeoPixel problem?

gilded cradle
#

I'm guessing CP problem, though now that you mention it, it could be a lib problem.

idle owl
#

I kind of doubt it's NeoPixel, but maybe.

tulip sleet
#

๐Ÿคท would have to explore, but try same thing on, say, a PyBadge

gilded cradle
#

Good idea @tulip sleet

tidal kiln
gilded cradle
#

@idle owl didn't you run into something similar to what @tidal kiln mentioned?

idle owl
#

Not that I'm aware of? Or am I forgetting something?

gilded cradle
#

Ok, maybe I'm just remembering you had an issue with a long running script

#

@tidal kiln maybe @tulip sleet has some ideas?

tulip sleet
#

i have not seen this before, but it could be blocked on output, that's possible. I haven't seen that behavior on other boards. If I put the host to sleep and then wake it up, I see skipped counts (I was doing doing a 5 or 10 second sleep in that example.)

idle owl
#

@tulip sleet Huh. I can set brightness on an external strip to 0 and it turns it off. Set it on a PyBadge or MagTag onboard NeoPixels using board.NEOPIXEL, and it makes them max brightness.

#

Let me try it using 6.0.0 on the PyBadge.

tulip sleet
#

is it reproducing the desired color at the wrong brightness, or is it messed up?

idle owl
#

Color is same. But let me try something other than red.

tulip sleet
#

also try a CPX

#

to see about M0

idle owl
#

6 stable shuts them off.

#

on PyBadge.

#

no it doesn't, hold on

gilded cradle
#

I wonder if it is esp32-s2 specific

idle owl
#

Ok weirder:

#

0.0 shuts them off. 0 does not.

gilded cradle
#

huh, that is weird

#

Is that on magtag?

idle owl
#

PyBadge and MagTag both.

#

Just checked.

#

PyBadge is on 6 stable, MagTag on beta1.

gilded cradle
#

Oh, ok. So looks like a non-processor specific bug. Is that something that could be fixed in the library?

idle owl
#

Both using same neopixel lib.

#

I have no idea.

#

@tulip sleet 0 makes them max brightness, 0.0 makes them off.

gilded cradle
#

It could be that 0.0 is really like 0.000000000001

idle owl
#

Right.

#

Let me dig up a CPX.

gilded cradle
#

So it sounds like something that should be fixed in cp

idle owl
#

@tulip sleet CPX is same behavior.

tulip sleet
#

check somethign without _pypixelbuf, like trinket

idle owl
#

Ok

#

@tulip sleet Trinket and Gemma are DotStars. But I'll try it.

tulip sleet
#

i mean attach a strip

idle owl
#

Strips are not acting the same

#

Strips are acting properly already

tulip sleet
#

maybe qt py?

idle owl
#

QT Py is a NeoPixel

#

yeah

#

@tulip sleet QT Py works properly. brightness = 0 turns off the LED.

#

Which narrows it to _pypixelbuf ?

#

Because QT Py required adafruit_pypixelbuf lib.

onyx hinge
#

@tulip sleet rookie mistake

  •    sudo tar -C /usr --strip-components=1 -xaf โ€˜gcc-arm-none-eabi-10-2020-q2-preview-x86_64-linux.tar.bz2โ€™
    
tulip sleet
#

@idle owl go ahead and file an issue; I don't see an obvious issue in th _pixelbuf code

idle owl
#

@tulip sleet Ok will do.

manic glacierBOT
#

Tested on MagTag, PyBadge, CPX and QT Py. The issue is not present on QT Py which requires adafruit_pypixelbuf. It is present on all other boards, which may narrow it down to an issue in _pixelbuf.

Used simple code that uses board.NEOPIXEL to turn the pixels red, and then tested brightness:

  • Setting brightness = 0 makes the on-board NeoPixels max brightness. They are the appropriate color when this occurs (as in they are not getting incorrect color info).

  • Setting `brightn...

idle owl
#

@gilded cradle Limor's suggestion on the MagTag lib works, though I don't understand it. I closed the brightness issue on the MagTag library.

gilded cradle
#

Ok, thanks for the update @idle owl

slender iron
#

@tulip sleet I'm around if you want to chat

tulip sleet
#

@slender iron on the phone but will ping you later - tnx

slender iron
#

k, lets pick a time after you are off the phone. I've got a couple more things to do this afternoon

tulip sleet
#

just got off! wasn't sure how long it would be

slender iron
#

๐Ÿ‘

ornate breach
manic glacierBOT
ionic elk
#

@slender iron tackling this pin claiming thing on the ESP32-S2, and then my immediate docket is free. What would you like me to focus on next, bugfixes, server or i.MX?

solar whale
#

Just a heads up -- not ready for an issue yet -- I updated my Mac to "Big Sur" and now my esp32s2 builds are failing -- I don't have time to dig into it today, but if anyone else has upgraded, let me know if you are also having issues.

#

Linux builds are fine...

ionic elk
#

I could try but I was about to upgrade today and now you're giving me cold feet ๐Ÿ˜ฌ

#

Confirm jerryns bug... or keep my productivity for the rest of the week?

supple gale
#

i have an upgraded mac but usually dont build there. lol

idle wharf
#

Actually that is specific to using monitor in the idf.

solar whale
#

yes -- and I see the same error messages

supple gale
#

I think there is also an issue with Big Sur and Silabs support. Not that it is needed unless your serial port adapter is using one.

solar whale
#

@supple gale yes -- no SiLabs driver yet. But the board does show up as @crimson ferry discovered so I was trying to build so I could flash it.

idle owl
#

@gilded cradle Would you suggest any other libraries for the MagTag other than the following: adafruit_magtag adafruit_bitmap_font adafruit_display_text adafruit_io adafruit_requests.mpy neopixel.mpy simpleio.mpy

gilded cradle
#

Let me check what I'm using...

idle owl
#

Thanks

#

That was the minimum to get MagTag lib working.

gilded cradle
#

I had bus_device for some reason, but it appears to be working without it.

idle owl
#

Fair enough. Thanks for checking.

gilded cradle
#

np

idle owl
#

I've only used the neopixels and buttons from MagTag lib so I have no idea if I missed some other lib needed.

#

Thanks!

gilded cradle
#

I had the il0373 before, but that shouldn't be required with the newer versions of CP. In fact, I'm removing it soon.

idle owl
#

@gilded cradle Actually, I have a favor to ask. I'm doing a libraries page in the MagTag guide like you did in the Matrix Portal guide, but I have no idea why most of those libraries are necessary. If I fill in everything else, can you write up the quick blurbs that explain why each lib is needed?

gilded cradle
#

Sure. I think I copied/pasted from the PyPortal guide that you did for that. ๐Ÿ˜‰

idle owl
#

Hah! I don't know if I did that one either though. Because I don't remember doing a page like that, nor do I have any idea what went into the PyPortal library. ๐Ÿ˜„

gilded cradle
#

You can copy text from the matrixportal guide for requests and io and text stuff. For simpleio, it's used for the tone generation.

idle owl
#

Ok doing that now

gilded cradle
#

Awesome

idle owl
#

@gilded cradle Are you eventually doing a guide for the MagTag library? Because I did not find the bits I needed very intuitive and had to do a lot of trial and error to get things working.

#

Also wondering if calling the buttons A-D is the best idea since we labeled them with arrows on the silk.

gilded cradle
#

I was planning on doing a creating projects guide like I did for MatrixPortal

idle owl
#

Ah fair enough

#

Plus A-D won't make sense if the board is rotated or upside down which I think we added support to do.

#

Hmm.

#

Though up down left right won't match either!

#

Hey, here's a terrible idea, use up/down/left/right and have it detect the board orientation and change the button names based on orientation. ๐Ÿ˜„

slender iron
#

@ionic elk if you are comfortable with tcp server you could do that. or imx is good. there is some progress on the metro

gilded cradle
#

@idle owl, it's not really a terrible idea. Possibly a bit hard to implement, but it might be useful for updating display orientation and such.

ionic elk
#

Anything specifically on the IMX, or just get in there and root around for unfinished stuff

idle owl
#

@gilded cradle I mean the whole reason we went with arrows was because we intended to make the board rotatable.

#

So it's not totally off base.

gilded cradle
#

Ah, I went with A, B, C, D because that's what they were named on board.*

idle owl
#

Named on the board... like schematic-wise?

#

Oh

#

board.

#

I read that wrong

#

I'm tracking now

gilded cradle
#

๐Ÿ™‚

idle owl
#

I mean I guess we had to call them something. Silly they ended up that way though, imo, since we went to all the effort to do the arrows.

gilded cradle
#

We can make more properties and call them up down whatever

idle owl
#

Fair enough!

manic glacierBOT
orchid basinBOT
manic glacierBOT
onyx hinge
#

gcc10 giveth and taketh away... Build aloriumtech_evo_m51 for nl took 38.73s and failed make: Entering directory '/home/runner/work/circuitpython/circuitpython/ports/atmel-samd' Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity. /usr/bin/../lib/gcc/arm-none-eabi/10.1.1/../../../../arm-none-eabi/bin/ld: build-aloriumtech_evo_m51/firmware.elf section `.text' will not fit in region `FLASH_FIRMWARE' /usr/bin/../lib/gcc/arm-none-eabi/10.1.1/../../../../arm-none-eabi/bin/ld: region `FLASH_FIRMWARE' overflowed by 18984 bytes

slender iron
#

@onyx hinge didn't you try gcc10 a month or two ago?

onyx hinge
#

@slender iron who remembers the past ...?

slender iron
#

let me try to build that here locally

onyx hinge
#

we did make some changes "for gcc10 compat"

slender iron
#

right, and early versions of the branch actually had gcc10 I think

#

yup, it overflows here by 7272 bytes

#

it's -O2

#

so we can -Os it

onyx hinge
#

we can select whichever gcc (8/9/10) builds each board the smallest

#

(no, let's not)

slender iron
#

haha, ok. I was hoping you were joking

slender iron
#

@onyx hinge thank you for all of the byte-finding

manic glacierBOT
onyx hinge
#

@slender iron sure thing

onyx hinge
#

@slender iron OK I changed that patch so it's disabled on all samd21 builds, hopefully it'll come through CI okay

slender iron
#

๐Ÿ‘

manic glacierBOT
#

Correct, I don't seem to have any issues with 5.3.x. I have tried 5.3.x with both the Feather NRF52840 Express and the Itsybitsy NRF52840 Express without problems. When I tried the example code with 6.0.0 it seemed to fail and not advertise, whereas with 5.3.1 I can immediately see "Circuitpython HID" appear in the device list of a host device. I haven't yet stepped through line by line to see if it fails anywhere.

ornate breach
#

thanks @slender iron ๐Ÿ™‚

ionic elk
#

@slender iron I'm trying to find an example of us manually resetting the IOMUX in any of our implementations, and I don't see anything

#

the fastLED implementation doesn't touch it

#

is it gpio_iomux_in?

manic glacierBOT
supple gale
# solar whale Just a heads up -- not ready for an issue yet -- I updated my Mac to "Big Sur" ...

I tested a build on my BIg Sur mac and the uf2 was generated correctly (Unexpectedmaker_feathers2)
I had to install everything from bare metal as i had done a clean install from USB. So install whatever tools needed, clone the repo, setup the idf and build. I didnt try esptool to flash as I'm doing some other things with the feathers2
Only issue was something with the fish shell and python . I will look at that at some point but building under bash worked fine.

manic glacierBOT
#

Yes, same.
Wifi and I2C hangs (in my case on the 2nd CTRL-C
Leave either out it doesn't hang. Nothing is actually being done to the
wifi or i2c in my code besides the import and instantiate an i2c object. I
assume wifi is instantiated on import.

On Tue, 24 Nov 2020 at 07:27, Mark notifications@github.com wrote:

If I comment out the import wifi I cannot cause this to reproduce.

Before any reboots, if I uncomment out import wifi it will lock up the
next Ctrl-C.

So it appear...

manic glacierBOT
manic glacierBOT
#

At first I didn't understand what you were saying about "TLS internal" bytes, since I saw the call to esp_tls_get_bytes_avail, and that is documented as returning the number of application data bytes. But, there's also the call to lwp_ioctl which would return TLS internal bytes. What I'm wondering is, it seems that esp_tls_FOO calls handle the tls and non-tls cases. It makes me wonder why the lwip_ioctl is needed at all; I conjectured it was from pre-TLS-support days but that's not the case...

manic glacierBOT
manic glacierBOT
manic glacierBOT
bitter bronze
#

@tulip sleet, @crimson ferry I am back with another problem as a result of the earlier help I was given. The error I see is Traceback (most recent call last): File "code.py", line 154, in <module> File "adafruit_hid/keyboard.py", line 100, in pressAttributeError: 'int' object has no attribute '_add_keycode_to_report'

#

I have more information if needed. My guess is that is the result of changes in the libraries since I developed the code a long time ago.

#

The libraries used by the code are:

#

import adafruit_trellism4
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
from adafruit_hid.consumer_control import ConsumerControl
from adafruit_hid.consumer_control_code import ConsumerControlCode

#

These libraries are freshly loaded in the lib directory on the CIRCUITPY

#

Any thoughts about what is causing the error? Thanks

bitter bronze
#

The README.md has a bit more information. Since this is my first attempt to communicate via GitHub, please let me know if you have any suggestions about content or protocol for using this tool.

#

@split ocean thanks for developing the Neotrellism4 code. I have used it for a long time and it has been very helpful for speeding up Emacs tasks and starting scripts. If you know of any HID library changes that may affect your original code, please let me know.

manic glacierBOT
#

Hi,

First off, thanks for an awesome library!

I have a string of 300 LEDs that I want to update in sync with music using a chase down the line effect, however, the "show" method is very slow and causes the system to fall behind when processing the music.

I'll share my example code that's running it. I'm currently using a C# application to send a 7 band spectrum from 0-100 for volume, then python is decoding that set of bytes into the proper numbers and when the data is completely rec...

manic glacierBOT
manic glacierBOT
tulip sleet
#

@forest badgeuntilis changing Keyboard() to Keyboard and the same for ConsumerControl is not what to do. That changes a creation (instantiation) of a Keyboard object into just a reference to the class. Instead you do:

import usb_hid
#...
kbd = Keyboard(usb_hid.devices)
manic glacierBOT
#

Hi, this is not really a bug, so it's more appropriate to bring it up in https://forums.adafruit.com. Could you post there, with more details?

Are you running this on a microcontroller board or on an RPi or similar? I'm not sure, based on the network code. I don't see a main program here, either.

Depending on the board, there is a native implementation of some of NeoPixel in an internal module called _pixelbuf. On small boards such as Trinket, that code is not native, but is in Pyth...

manic glacierBOT
tulip sleet
#

@slender iron more considerations about switching from DurationAlarm to some kind of absolute time-based alarm:

  • time.monotonic() is universal (not based on presence of longints), unlike time.time() and time.monotonic_ns(). So the most basic time alarm type is probably MonotonicTimeAlarm.

  • If we had more than one kind of time-based alarm, we wouldn't be able to tell them apart on wakeup: all we know is that we woke up due to a time-based sleep. So we can't construct an alarm.wake_alarm whose type is guaranteed to match the alarm type on the other side of reset, unless we stored state about the original object, which I am somewhat reluctant to do. That could argue for a WakeUpReason rather than using an alarm object, because it collapses the different time alarms into a single thing. Or, we just say that we always create, say, a MonotonicTimeAlarm regardless of what kind of alarm was set (a DurationAlarm, a TimeAlarm, a StructTimeAlarm, etc.). ... I am a bit inclined toward the latter since it reduces the number of parallel classes.

#

Interesting to look at other API's: Java and Rust timers provide both absolute time and interval-from-now options.

blissful pollen
#

@tulip sleet When I was playing with deep sleep for arduino you can use small bits of RTC memory could you store an alarm type in there to reference when you woke up?

#

Though guess you still don't know which alarm it was...

tulip sleet
#

you can only set one time alarm at a time, so that's not such a big deal. mainly we want to distinguish between time alarms and pin alarms (there are also touch-based alarms on ESP32-S2)

#

Yes, we could use RTC memory for that, but it's a significant complication, and conceivably on some platforms we wouldn't have it, though I'm not sure there are any. I think returning an "equivalent" alarm is ok. For pin alarms, there's a bunch of parameters (which pin(s) (can be multiples), edge triggering, etc.

#

the time alarms are all implemented the same way at the lowest level. ESP32-S2 API just has sleep for a duration (though it's actually converted to an absolute timer-tick value internally !)

blissful pollen
#

From a user point of view the set MonotonicTimeAlarm with helpers for other time types seems easy to understand and use from an API usage. At least from the projects I want deep sleep for. The two I use cases I have are a set wake up every minute (8:01 8:02 etc.) and the just sleep for 60 seconds elapsed.

manic glacierBOT
#

Trying to mount an sd card or just a small test on bno055 as below both report: OSError: [Errno 5] Input/output error

code used:
import time
import board
import busio
import adafruit_bno055

Use these lines for I2C

i2c = busio.I2C(board.SCL, board.SDA)
sensor = adafruit_bno055.BNO055_I2C(i2c)

User these lines for UART

uart = busio.UART(board.TX, board.RX)

sensor = adafruit_bno055.BNO055_UART(uart)

while True:
print("Temperature: {} degrees C".format(sen...

tulip sleet
#

good; yes usually you would do something like MonotonicTimeAlarm (time.monotonic() + 60) to do 60 seconds from now. If you knew what time it was due to an external clock, then you could relate that to a time.monotonic() time and do something similar, if say you wanted to wake up next Tuesday, etc.

#

I originally implemented only a DurationAlarm(), e.g. DurationAlarm(60), but that's only relative time, and it's from the time you actually start sleeping, so it could be off by the lag between creation and sleep.

#

thanks for your comments! it's v helpful to have others consider their use cases

blissful pollen
#

Welcome. Feel free to ping me if you need testing the PR when its ready. I have wanted CP deep sleep for a while now.

onyx hinge
#

@tulip sleet bluez-firmware has been updated to 1.2-4+rpi6, but based on the changelog they haven't fixed the problem

manic glacierBOT
tulip sleet
idle owl
#

@gilded cradle Thanks for the review!

gilded cradle
#

np

idle owl
#

@onyx hinge โค๏ธ again for the workflow_dispatch trigger.

lapis hemlock
#

@slender iron Scott, if I told you that ulab has now complete numpy/scipy compatibility (i.e., code can be ported verbatim from CPython), would you still insist on sub-modules as defined in circuitpython?

slender iron
prime flower
#

@slender iron Should MiniMQTT also have a Session class like adafruit_requests does? I don't see why not..

slender iron
manic glacierBOT
#

@hathach I have an APMF103ZE, which is a clone of a larger F103.

At this point, though, I think it's time to just close this PR. I don't know from my testing whether the current issue is actually on our end or whether it's some issue with the knockoff, and I don't have a better board to recommend because there are essentially no F103 dev units meeting CPy's minimum size requirements outside of China. Most users will find that the F4 and F1 lines have almost identical costs at this stat ran...

slender iron
# lapis hemlock <@!252717193496756235> Scott, if I told you that `ulab` has now complete `numpy/...

Yes, because the goal of many small modules is to allow them to be enabled and disabled on a per-board basis. One monolithic module would lead to later errors later in execution when a function is attempted to be used. My understanding is that you can still create a wrapper library that imports all the pieces back together if you want numpy compatibility. Or you can have your cross compatible code import numpy multiple times under the individual module names.

slender iron
ionic elk
#

@slender iron I asked since you commented that IOMUX needed to be reset to digital 0 - I'd like to know how you found that out. I've seen very little official information that discusses IOMUX, only some blogposts that note it's a bit like the STM32 altfunction system, underneath the GPIO mux.

slender iron
#

@ionic elk have you looked in the technical reference manual?

prime flower
ionic elk
#

I looked in the define tables for how to set IOMUX, but I don't see anything that correlates to a "digital function 0"

slender iron
#

what are define tables?

ionic elk
#

Just the big list of defines they use instead of an enum to plug into IOMUX Set In or whatever it is

slender iron
#

ah, did you look in the datasheet for it?

manic glacierBOT
#
k0d

The F103 issue I had was running TinyUSB with freertos, and the same issue was on CPY. It was fixed by making the USB interrupts lower (15 if I remember) than the RTOS interrupts.

My opinion is F103Cx is very attractive due to it's low cost, but that specific IC hasn't the flash for CPY, and when you go to higher boards...it's not so price effective.

I've got a board with L432CE, which Micropython already supports, so I think it'd be a good target chip...not due to price, but it's low-p...

slender iron
#

I think it's in the DS actually

ionic elk
#

Thanks for the reference manual, I actually thought they were all online with their docs

analog bridge
#

Is there a framework in CircuitPython to support OTA updates ?

slender iron
#

@analog bridge no but the partition layout has space for it

analog bridge
#

I was thinking of grabbing updates from the S3 bucket.

manic glacierBOT
#

@k0d I did try your fix (thanks again for trying it), and I didn't find that it made any impact, at least in my case. If you have an F103 board that is capable of running Circuitpython and would like to pick up this port, I'd be happy to reopen it - I just can't justify spending any more of my time on it. But as you said, the cost appeal of the F103 is mostly for the bluepill type C8 and CB, which are too small for Circuitpython. Once you get up into the R and Z series the price is essentiall...

analog bridge
#

@slender iron this would make a great into the the weeds topic. We can even setup update priority depending on release tags.

slender iron
#

I'm assuming it'd be the python code to manage the update, not circuitpython internals

ionic elk
#

@slender iron I'm considering whether it'd be better to simply make our own version of gpio_reset that configures the pins how you'd like them - with better default pullup settings, etc

analog bridge
#

my approach with this is to have a module for it

#

added ota update topic to cpy meet notes

slender iron
#

@ionic elk I think that's fine to have our own.

ember iris
#

When circuit python runs into an error and decompresses the compressed error strings--is that handled on the board--and is that handled by the makeqstrdata.decompress function, or is there another program that handles it as well?

slender iron
#

@ember iris it's done within circuitpython's internals. let me find it

ember iris
#

and that is all done on the controller itself right?

slender iron
#

yup

ember iris
#

thank you!

slender iron
#

np ๐Ÿ™‚

ember iris
#

So if I add a new compression scheme, (lzw give or take) the code+codebook/dictionary+compressed translations would all have to be smaller than the current codebook+compressed translations right?

slender iron
#

yup, that's the challenge

ember iris
#

excellent, then I think I'm following this so far, I really appreciate it

slender iron
#

we use it in all of our builds and a few of them are almost full

#

np! it's a fun challenge ๐Ÿ™‚

#

the history of that file can show you how it's evolved too

ember iris
#

I didn't even think to look at that-that'll be super helpful!

slender iron
#

๐Ÿ™‚

tulip sleet
stuck elbow
#

@tulip sleet do you remember off the top of your head where the HID descriptors are defined in the code?

#

hmm, tools/hid_report_descriptors.py

tulip sleet
#

tools/hid_report_descriptors.py. There are also some descriptors in a submodule, but we don't use those

stuck elbow
#

thanks

tulip sleet
#

tools/usb_descriptor/adafruit_usb_descriptor/hid.py are NOT used

#

that could probably be rationalized

ember iris
tulip sleet
#

I was just thinking about this early this morning. I was wondering whether we could compile each language's messages once and just stick them in flash at a fixed place. IN other words, assemble the translations post-compilation. But there'd have to be a table of message ids to offsets into the compressed string data. That might take extra space (or maybe we are doing that already, I don't know -- I was going to talk to @onyx hinge about it but haven't had time yet)

#

hmm, not a good idea because there'd be unused messages for any particular build that would take up space

supple gale
#

is it normal that a small amount of heap memory is lost during each CTRL-C CTRL-D cycle?
This doesnt happen if i remove the import wifi

#

Its small, around 20 bytes

stuck elbow
#

I think there is a pull request that fixes some of that in review

supple gale
#

ahh, thanks

#

Another question, I have some debug printf in the common_hal_busio_i2c_deinit and the common_hal_busio_spi_deinit and never see these routines entered. Should they be?

#

esp32s2

tulip sleet
#

the deinit routines are either called by user code or in some cases to deinit board.SPI() or a display SPI object

supple gale
#

i would have though CTRL-D would do it. Guess not.

#

CTRL-C i meant

manic glacierBOT
#

At first I didn't understand what you were saying about "TLS internal" bytes, since I saw the call to esp_tls_get_bytes_avail, and that is documented as returning the number of application data bytes. But, there's also the call to lwp_ioctl which would return TLS internal bytes. What I'm wondering is, it seems that esp_tls_FOO calls handle the tls and non-tls cases. It makes me wonder why the lwip_ioctl is needed at all; I conjectured it was from pre-TLS-support days but that's not the case...

tulip sleet
#

@slender iron i am running into another dilemma re falling off the end of the program into deep sleep: in some cases it is deliberate, and you don't want the end processing to scribble on the screen stuff like "Code done running. Waiting for reload": you want the screen to stay pristine. But in other cases, you do want the (potentially naive) user to know, hey, yes, your program is done.

I am kind of inclined to say that an explicit deep sleep will leave the screen pristine. A fall-off-the-end will write status messages. You might think the difference is whether an alarm was set deliberately or not, but I can also imagine a simple program that, say, fetches and displays something, and then just finishes, expecting you to reset the board if you want it to run again, vs, say, getting a status message when the default hello-world program finishes.

#

So I'm thinking a fall-off-the-end would not normally be used deliberately. Limor was already confused by the example I gasve her of falling off the end

slender iron
#

@supple gale usually a reset does a bulk reset

tulip sleet
#

she expected an explicit call

#

fall-off-the-end going into deep sleep is simply a power-saving trick

slender iron
#

my worry is that calling a function will be too similar to light sleep

#

we could have the screen update after only when an exception happens

tulip sleet
#

the name of the function now is supervisor.exit_and_deep_sleep()

slender iron
#

I like that name

tulip sleet
#

but if it's a new user, the user likes to know when the program finishes, or whether it's just hanging, hence they want to see an "all done" -type message

supple gale
#

looking at init.c in common_hal/board i see

// reset_board_busses() first because it may release pins from the never_reset state, so that
    // reset_port() can reset them.
    #if CIRCUITPY_BOARD
    reset_board_busses();
    #endif
    reset_port();
    reset_board();
    reset_status_led();
}

Where reset_board_busses() is where the deint are called

tulip sleet
#

or not even a new user, just a user debugging something that doesn't have sleep as part of its modus operandi

slender iron
#

@tulip sleet so you are arguing for what?

#

@supple gale board busses only applies to board.I2C. not all I2C

supple gale
#

ahh

tulip sleet
#

that it's fine to deep sleep on program end, but we're not going to suggest it as a coding idiom, because it will print status messages

#

instead if you wnat to sleep and freeze what's on the screen , call exit_and_deep_sleep()

#

the last remaining q is if you set alarms but don't call exit_and_deep_sleep, whether the alarms actually take effect. (so there's deep sleep just to save battery, and there's programmatic deep sleep)

#

exit_and_deep_sleep() could take the list of alarms, instead of it being a separate call .RIght now it's a separate call so you can fall off the end and have the alarms take effect

slender iron
#

right

#

I think that's all OK. it makes it clearer that something else will happen if you exit any other way like exceptions

tulip sleet
#

thanks, I think it will be clearer, with less implicit semantics. I like the idea of deep-sleeping to save battery if we can even on error, but that's a separate thing.

slender iron
#

yup, and we'll have more flexibility then too

tulip sleet
#

one other thing: I like yoru idea of TImeAlarm taking different disjoint keyword args for say, duration/monotonic/struct_time, but then fetching them back is a bit problematic. I could have three properties, I guess, returning None for the ones that aren't right. Ideally maybe there'd be an abstract superclass, but that's painful in the native modules (I think - I can find no examples)

slender iron
#

just normalize it to epoch time

tulip sleet
#

that rounds to the nearest second, I guess that's ok

#

sleeping is not that accurate anyway

slender iron
#

well, you can have a fraction of a second

tulip sleet
#

time.time() is an integer, but only exists on longint builds

#

so I'm not sure we can have alarms on non-longint builds

slender iron
#

the main thing is the reference point, epoch (1970) or monotonic (arbitrary)

#

I wouldn't have different kwargs for type

tulip sleet
#

i thought you suggested that? TimeAlarm(monotonic_time=x) vs TimeAlarm(struct_time=...) vs TimeAlarm(time=x), so not that?

#

I think you could have on absolute time alarm that has two exclusive kwargs. one for time vs epoch and one monotonic

slender iron
#

I suggested two options, not three

#

time and struct_time would be the same thing

#

you just check the argument type

#

you need two because you could have two seconds counts with different reference points

tulip sleet
#

so just TimeAlarm(monotonic_time=x) and TimeAlarm(time=x)

#

and what would be the read-only property to get the value back?

slender iron
#

time?

tulip sleet
#

and it's an integer since 1970?

#

so non-longints are out of luck

slender iron
#

heh, right

#

I guess you could go the other way and only support monotonic relative time

tulip sleet
#

RIght now I said this in the doc:

//| def set_deep_sleep_alarms(*alarms: Alarm) -> None:
//|     """Set one or more alarms to wake up from a deep sleep.
//|
//|     When awakened, the microcontroller will restart and run ``boot.py`` and ``code.py``
//|     from the beginning.
//|
//|     An alarm equivalent to the one that caused the wake-up is available as `alarm.wake_alarm`.
//|     Its type and/or attributes may not correspond exactly to the original alarm.
//|     For time-base alarms, currently, an `alarm.time.MonotonicTimeAlarm()` is created.
//|
//|     If you call this routine more than once, only the last set of alarms given will be used.
//|     """
//|     ...
#

so you get back an "equivalent" alarm

slender iron
#

ya, makes sense

tulip sleet
#

ok good, I am not too far off the mark ๐Ÿ™‚

ornate breach
#

hey @slender iron I have a question about the 'haxpress' circuitpython builds

#

when you specify the SPI Flash device, does that mean you have to use that SPI flash or is it more for reference?

tulip sleet
#

The SPI flash devices listed in mpconfigboard.mk are the only ones supported for that build.

#

we do that to save space; we don't support all possible

ornate breach
#

okay, so that makes sense

tulip sleet
#

you could change that setting if you have a different one

#

and do your own build

onyx hinge
#

@slender iron @tulip sleet removing epaper display looks like it saves ~3.7kiB on feather_m0_express, going from 2196 bytes free to 5992 free bytes. So not a huge benefit, but there when we need it.

tulip sleet
#

the reason we sometimes list more than one is for manufacturing flexibility

onyx hinge
#

for haxpress we could probably list a few more flash chips (some boards have 2 or 3 listed), but what would the short list be?

ornate breach
#

I ask because the SPI Flash i use in my SPI Flash build is ~$1, but the adafruit preferred is like ~$0.58

onyx hinge
#

I think each chip uses a few dozen words of flash

ornate breach
#

I only have the AT25DF081A listed

#

8Mb (1MB)

#

I'm just curious how it checks the SPI Flash and validates that you are actually using what is specified. I probably just need to look deeper

tulip sleet
#

it gets the mfr ID fields back from the chip (JEDEC id) and vets them

slender iron
#

@onyx hinge I wonder if we should split it out of displayio like we did the audio stuff

onyx hinge
#

I assume you found an example of specifying multiple parts ```EXTERNAL_FLASH_DEVICE_COUNT = 3
EXTERNAL_FLASH_DEVICES = "S25FL116K, S25FL216K, GD25Q16C"

#

doing a code search locally (git grep) for EXTERNAL_FLASH_DEVICES will help find where the magic happens

#

@slender iron I considered that, or more properly speaking, I considered that you would suggest it. I can see doing it, but this first effort gives us a good idea of the code size savings either way.

slender iron
#

heh

#

splitting out parallelbus would be good too

onyx hinge
#

pushed to a branch in my fork but I won't PR it

slender iron
#

since it's often unimplemented

onyx hinge
#

yup

tulip sleet
#

so we would leave in gizmo, hallowing, and some feather display support built in?

onyx hinge
#

there's an epaper gizmo, though

tulip sleet
#

hmm

onyx hinge
#

I think the circuitplayground displayio build has trimmed other things out though

tulip sleet
#

it doesn't even have longints, i think

#

but if there's an epaper feather, then not sure how to choose which to omit

ornate breach
#

One thing I was curious if it's possible to make consistent is the i2c address argument in initializing i2c devices.

import board

i2c = board.I2C()

import displayio
import adafruit_displayio_ssd1306
display_bus = displayio.I2CDisplay(i2c, device_address=0x3D)
display = adafruit_displayio_ssd1306.SSD1306(display_bus, width=128, height=64)
sensor = adafruit_bmp280.Adafruit_BMP280_I2C(i2c, address=0x77)
#

for bmp280 it uses address where displayio uses device_address

#

I'm sure there are other instances. But I'm not sure it's worth filing an issue for a small nuance between libraries.

manic glacierBOT
slender iron
#

@ornate breach I think it's too late to change it

ornate breach
#

I figured ๐Ÿ™‚

slender iron
#

good to keep in mind for new apis though

ornate breach
#

yeah, I think it shows a nice progression and standard. Also, curious if there is any drivers written yet for the QT42 capacitive touch sensors yet?

#

I've got a accessory board I'm working on that uses one, but I don't want to reinvent the wheel if someone has done the footwork already

manic glacierBOT
bitter bronze
slender iron
#

@ornate breach not that I know of. the place to check is the bundles

ornate breach
#

๐Ÿ‘

#

I'll double check the bundles. It's my before work starts end of the year goal to get a driver written for it

#

I don't feel like it should be too hard

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

@hierophect it looks like HAL_I2C_Mem_Read uses a uint16_t for the address to read, implying that it can only send one or two bytes before doing the repeat start and read. While this would be useful for most use cases, it would imply putting a limit on the size of the out/send buffer for write_then_readinto which would be a change to the API.

Off the top of my head I can't think of a case where I've needed to write more than 2 bytes to set up a read, so it would probably work for mos...

manic glacierBOT
manic glacierBOT
bronze kernel
#

Guys. Do circuitpython libraries work on MicroPython?

#

I want to use CircuitPython neopixel library

#

I work on ESP32

#

Ping me if you answer

solar whale
#

@supple gale @idle wharf FYI -- I was able to get things working on my Big Sur Macos system -- had to remove the ~/.espressif folder then reinstall the esp-idf... also using with bash. I was also able to flash the file to the umfeathers2 on /dev/tty.usbmodem01 --- no need for SiLabs driver anymore!

solar whale
#

Also successfully built/flashed metro_esp32s2 and magtag.

orchid basinBOT
mild fog
#

Anyone know of any documentation or examples of creating custom services and characteristics for BLE with circuitpython?

manic glacierBOT
tulip sleet
# mild fog Anyone know of any documentation or examples of creating custom services and cha...

Assuming you want to act as a peripheral, you could take a look at the services in https://github.com/adafruit/Adafruit_CircuitPython_BLE_Adafruit. Unfortunately there is no Learn Guide for detailed use of the BLE library yet. A key thing to know is that the class variables assigned to instances of Characteristic and the like are characteristic specifications. The actual characteristic objects are created at run time.

mild fog
#

This has been helpful

manic glacierBOT
manic glacierBOT
manic glacierBOT
quartz wedge
#

@tulip sleet is that deep_sleep code you are referencing above available for circuitpython on the magtag?

manic glacierBOT
#

Trying to run this project
https://learn.adafruit.com/pyportal-iot-plant-monitor-with-aws-iot-and-circuitpython?view=all
In this code: esp32spi_simpletest.py

What pins should I use? The uncommented definitions are not defined.

code snippet:
esp32_cs = DigitalInOut(board.ESP_CS)
esp32_ready = DigitalInOut(board.ESP_BUSY)
esp32_reset = DigitalInOut(board.ESP_RESET)

If you have an AirLift Shield:

esp32_cs = DigitalInOut(board.D10)

esp32_ready = DigitalInOut(board.D7)

es...

lone axle
#

the next PR on circuitpython-org will be #600 ๐ŸŽ‰

tulip sleet
#

@quartz wedge I am working on the sleep code right now. It will probalby be in the next beta.

lone axle
#

in the docs language is there a way to specify multiple possible types for a param? and/or object types like BuiltInFont? i.e. in this param it can be either str or BuiltInFont:

:param str text_font: The path to your font file for your data text display.
tulip sleet
#

@lone axle Union[type1, type2]

#

that is from type annoation, e.g.
def foo(x: Union[int, float]): ...

lone axle
#

thank you!

tulip sleet
#

THere is also Optional[type1] ,which means a type1 object or None.

manic glacierBOT
onyx hinge
#

@tulip sleet didn't you point me at a Linux screen shot annotation program? I can't remember/find it now

tulip sleet
#

ksnip -- it's actually multi-platform

#

it has attractive numbers in circles for multi-step directions

onyx hinge
#

thank you!

lone axle
#

@onyx hinge if you are looking for more options ive been using and liking Flameshot on Linux.

#

it has resizable box with many editing and export options.

tulip sleet
#

I use flameshot too, but it doesn't allow supplying an existing image to annotate

lone axle
#

Ah I see

tulip sleet
#

but it's the fastest to just pick up a screenshot

lone axle
#

I also wish it had a way to copy the last thing again onto the clipboard.

tulip sleet
manic glacierBOT
#

Initial working version of light sleep and deep sleep, after several API iterations. Started coding from https://github.com/tannewt/circuitpython/tree/sleepio/ .

  • alarm.time.TimeAlarm implemented for both monotonic time and epoch time values.
  • alarm.pin.PinAlarm objects can be created, but cannot yet be used to sleep. (So not yet completely implemented.)
  • Three ways to wait for alarms:
    1. alarm.wait_until_alarms(alarm1, ...): Wait for alarms without sleeping. Does not distur...
thorny jay
cursive condor
#

nope, but it's an interesting idea ๐Ÿคจ

ornate breach
#

Yay, my broad was added to MU editor (or rather it was merged into their master) so it should be part of the next Mu release

manic glacierBOT
manic glacierBOT
arctic fractal
#

ValueError: Layer must be a Group or TileGrid subclass.

# Main tab
main_tab = displayio.Group(max_size=3)

# Create button
graph_btn = Button(x=0, y=0, width=WIDTH/3, height=HEIGHT/6, style="RECT", fill_color=black, outline_color=0, label="Graph", label_font=font, label_color=white)
temperature_btn = Button(x=WIDTH/2, y=0, width=WIDTH/3, height=HEIGHT/6, style="RECT", fill_color=black, outline_color=0, label="Temp", label_font=font, label_color=white)

# Button group
button_group = displayio.Group(max_size=3)
button_group.append(graph_btn)
button_group.append(temperature_btn)

main_tab.append(button_group)

What am I missing?

stuck elbow
#

hard to say, which line is the error at?

arctic fractal
#

line 73 so quite a bit of stuff before this

stuck elbow
#

which one is it in what you pasted?

arctic fractal
#

5

stuck elbow
#

so graph_btn = Button(x=0, y=0, width=WIDTH/3, height=HEIGHT/6, style="RECT", fill_color=black, outline_color=0, label="Graph", label_font=font, label_color=white)

#

sorry, I can't really tell what happened here with the information you provided

arctic fractal
#

no worries, im new to circuitpython so im most likely doing something very wrong

stuck elbow
#

my guess is that some global or attribute gets set to something wrong somewhere earlier

turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

56

Voice Channels

6

Members

25949

Roles

34

tulip sleet
#

@onyx hinge I need to make space for additions for sleep on the M0 boards. Turning off complex arithmetic nets almost 1700 bytes. I'm thinking this will affect fewer people than disabling native _pixelbuf.

onyx hinge
#

I think that's most likely

#

Let's try to get the movable heap stuff in right after that if we can

#

.. do you know how much you need for sleep?

tulip sleet
#

i'll look

#

bbbiab

#

@onyx hinge de_DE is overflowing metro m0 by 672 bytes

#

sleep is not actually enabled on the M0 boards; it's just some new stuff in microcontroller and supervisor that tell you why you were running and why you were reset. Eventually we'd want sleep even on these boards, maybe.

#

Did you see that gcc 10 actually got back 1-2k bytes on a build? or were the results weird?

onyx hinge
#

Some builds got way over full with gcc10, I didn't look at the m0 boards though.

tulip sleet
#

i have it downloaded; i could try some by hand.

#

gcc10 saved 732 bytes on de_DE on metro m0, bringing it to 60 free bytes (on my sleep tree)

blissful pollen
#

@tulip sleet is there someplace I can easily grab the UF2 for your sleep mode PR? Wanted to try it out and never grabbed a different persons build before (or else I'll figure out how to grab the PR and just build it)

tulip sleet
blissful pollen
#

I have the feathers2 set up but if you have MagTag ready the bin works, don't think i've got the UF2 loader on it yet

tulip sleet
#

I have not tried the feathers2 build

#

these were just built fresh

blissful pollen
#

Awesome thanks! (I should still figure out how github works to pull/build PRs)

#

I'll play around with the feather and post in the PR for sure what I find

tulip sleet
#

Here is a sample program. The key lines for sleeping are the two at the end.

#

Do read the documentation in ``shared-bindings/alarm/init.cand inalarm/time/TimeAlarm.c` because there are various tricky things to know

blissful pollen
#

Will do thanks. I did read the esp32s2 docs when I was trying it on Arduino earlier too

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Tested with the FeatherS2 and been working great. One quirk, not sure if it is intended. My program connects to wifi, waits a few seconds and sleeps. If I start the program with USB connected, and then remove the USB the code never detects the removal and wifi is active during deep sleep (I'd assume actually in wait_until_alarm). May just be an item to document.

#

Tested with the FeatherS2 and been working great. One quirk, not sure if it is intended. My program connects to wifi, waits a few seconds and sleeps. If I start the program with USB connected, and then remove the USB the code never detects the removal and wifi is active during deep sleep (I'd assume actually in wait_until_alarm). May just be an item to document.

The non-detection of USB being removed is a known issue, and might be fixed by https://github.com/hathach/tinyusb/pull/563. I...

manic glacierBOT
#

I was helping someone with a PyPortal-using-BLE issue, and it turns out the ESP TX/RX pins on a few Airlift-style boards are labeled only RX and TX, even though they are only connected to the ESP32.

This PR adds ESP_TX and ESP_RX names to the existing TX and RX pins, which is upward compatible.

However, I think that it would actually be better to remove the TX and RX names and also board.UART(), since these are not externally available pins.

If you agree, let me k...

manic glacierBOT
#

It looks like this is being caused by PR #86 to the adafruit/Adafruit_CircuitPython_CircuitPlayground library . By adding a property of "_unsupported" to the Express class, which raises a NotImplementedError when accessed, it causes any process (like 'dir(cp)) which accesses that property to stacktrace. I guess the question is whether it is more valuable to have a good message when someone tries to access a non-existent feature or to have commands like dir() work.

#

Thanks for the notice, I havenโ€™t been on Discord for a few days.

Iโ€™m working on the code size, but with no great gains yet. I have one optimization that recovers 64 bytes, but not enough for the metro_m0_express. Will push that shortly, also fixing the conflicts.

I did not fully follow the implementation of allocate_memory_node or supervisor_move_memory, but I feel I understand them at the high level anyway, and the high level is solid.

Thanks for the review. For that matter, I thi...

manic glacierBOT
manic glacierBOT
#

Just so it isnโ€™t forgotten, since I canโ€™t seem to reopen #3702:

I believe the fix proposed there is wrong: It prevents printing an exception twice, which I do in #3696 (once to measure the length of the traceback, once to get the text) and which people may want to do for other reasons, itโ€™s available from Python via sys.print_exception(). (For some reason, it also causes the terminalio screen to be drawn over the stage screen, havenโ€™t investigated that yet.)

The problem observed i...

manic glacierBOT
manic glacierBOT
cobalt grail
#

I got my MagTag to crash when I fed it some BMP files. Half of them gave back an unsupported format error message, but half of them rebooted the MagTag. Should I create an issue for this, and in that case in what repo?

lament sentinel
#

displayio seems like the relevant place which is in the main CP repo. That's where I'd go

#

A scary amount of C code in this area, so does seem like the kind of thing that would shoot you on a bad day

mild fog
#

Does anyone know if there are any plans for a circuitpython/feather NFC board?

lament sentinel
mild fog
#

Well, the antenna could be larger than the feather board itself, but that's also just one antenna pictured, there are many kinds/sizes I would imagine.

lament sentinel
#

OK, so I guess I'm sticking with "no" as my answer.

mild fog
#

Yeah, it was a long shot

lament sentinel
#

There may be better information from someone else, so don't lose hope

manic glacierBOT
lone axle
#

there is this little stemma breakout NFC device, perhaps it could fit on a feather or similar form factor. Not sure if there are plans in the works to make that sort of all in one device though.

lone axle
onyx hinge
#

@lone axle I don't know whether there's a circuitpython lib for that stemma NFC device though

lone axle
#

ah. very good point. I hadn't noticed that.

#

I just grabbed a few of them in a recent order. Maybe I can cobble together a working diver library.

onyx hinge
#

rise to the challenge

ornate breach
#

@lone axle youโ€™ve given me an idea

#

Iโ€™m gonna make some kind of RFID microcontroller board for IoT projects

#

๐Ÿ™‚

lone axle
#

Nice!

manic glacierBOT
manic glacierBOT
#

I'm using Adafruit CircuitPython 6.1.0-beta.1 on 2020-11-20; MagTag with ESP32S2
the adafruit-circuitpython-bundle-6.x-mpy-20201126 library on a MagTag.

I'm getting intermittent crashes when connecting to wifi. For most of the day yesterday it happened once in a while and if I re-saved in Mu, the connection would work on the second try. Then last night it would not stop crashing and I gave up and went to bed. This morning I'm trying to write the bug report and now it won't crash at all. M...

manic glacierBOT
turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

56

Voice Channels

6

Members

25951

Roles

34

ornate breach
#

sooo close to 26K

manic glacierBOT
manic glacierBOT
lone sandalBOT
lone sandalBOT
lone sandalBOT
manic glacierBOT
#

I belatedly checked and each build that freezes in Adafruit_CircuitPython_NeoPixel builds in _pixelbuf, according to the support matrix.

pirkey_m0 freezes DotStar but does NOT have _pixelbuf. Other DotStar-freezing builds have _pixelbuf. Does this mean that pirkey_m0 should remove DotStar? I doubt it can add _pixelbuf, but I could be wrong. @tannewt mind filing a PR that calls for the right thing to be done?

manic glacierBOT
lament sentinel
#

@lone axle this will be fun ```PS C:\Users\bcr00\Source\bcr\blinka-cli> python .\blinka.py --verbose font --fontpath C:\Windows\Fonts\arial.ttf --fontsize 24
๐Ÿค“ options = Namespace(verbose=True, locale='en_US', command='font', fontpath='C:\Windows\Fonts\arial.ttf', fontsize=24, func=<function do_font at 0x00000125EFA21280>, tempdir='C:\Users\bcr00\AppData\Local\Temp\tmpnimjj5ku')
๐Ÿค“ Making a font from C:\Windows\Fonts\arial.ttf 24
๐Ÿค“ Here is a letter e








**
**




*****```

lament sentinel
#
NotImplementedError: unicode name escapes
``` aww. What, we don't want to cart around a megabyte of Unicode metadata?
manic glacierBOT
orchid basinBOT
orchid basinBOT
manic glacierBOT
onyx hinge
#

@tulip sleet is it true that I could hypothetically read the feather sense sensors from adafruit blinka's ble lib?

tulip sleet
#

yes, the adafruit-circuitpython-ble-adafruit library is already written to make that easy

onyx hinge
#

nice! I don't need to do it right this second, but I was going to refer to it in this guide as a possibility

tulip sleet
#
Adafruit Industries - Makers, hackers, artists, designers and engineers!

Thatโ€™s right folks โ€“ Cyber Monday is CIRCUITPYTHON Monday here at Adafruit this year! In addition to our 15% off site-wide sale we are offering 20% off products from our CIRCUITPYTHON category for โ€ฆ

turbid radish
#

๐Ÿ๐Ÿ”ฎIt's CIRCUITPYTHON MONDAY at Adafruit! Use the code ADATHX to get 20% off CircuitPython boards and 15% off items storewide! ๐Ÿ”ฎ๐Ÿ

lone sandalBOT
orchid basinBOT
manic glacierBOT
manic glacierBOT
ornate breach
#

Thanks @gilded cradle

#

๐Ÿฅณ

gilded cradle
#

You're welcome @ornate breach. Good job on the PR.

orchid basinBOT
manic glacierBOT
thorny jay
#

Wait, there is a meeting today? Like in 45 minutes from now... I am NOT ready!

onyx hinge
#

<@&356864093652516868> Hi all! Our weekly meeting will be in about 40-45 minutes from now. If you can, please add your notes to the document -- it's super helpful. https://docs.google.com/document/d/1ADivzRhU6vQCSee7Yj0RAtvy0B4hE6tAQ8hr_N8h6sw/edit?usp=sharing

orchid basinBOT
modern wing
#

Lurking today, in the back of the room. Don't mind me, I'm here for the donuts and coffee. Put my status in the Notes Doc. ๐Ÿฉ โ˜•

trim elm
#

Lurking

modern wing
#

Howdy ๐Ÿ™‚

idle owl
#

@gilded cradle I will be pinging you later for some help with the MagTag library because I have something I want to do and would like to avoid spending hours trying to figure out how when I'm betting you know how immediately. ๐Ÿ˜„

turbid radish
#

Lurking

tidal kiln
#

lurking

turbid radish
#

Last call on neat stuff for tomorrow's newsletter

gilded cradle
#

Sounds good @idle owl

onyx hinge
#

hmmm whenever the newsletter falls on april 1 I think you should do an all pet-photos edition @turbid radish

turbid radish
#

I'll have to run that by PT, he's the punner-in-chief

onyx hinge
#

@ionic elk you're not muted

gilded cradle
#

@ionic elk your microphone is working ๐Ÿ˜‰

idle owl
#

@slender iron Are you running the meeting today?

ionic elk
#

ty sorry!

solar whale
#

rock -paper-scissors

onyx hinge
#

(not just for beginners)

#

๐Ÿ๐Ÿ”ฎIt's CIRCUITPYTHON MONDAY at Adafruit! Use the code ADATHX to get 20% off CircuitPython boards and 15% off items storewide! ๐Ÿ”ฎ๐Ÿ

modern wing
#

20% off CircuitPython, 15% everything else (with some exceptions) ๐Ÿ™‚

#

Haha, beat me to it Jeff ๐Ÿ™‚ Thanks

tulip sleet
#

^^ (added to notes at end of community news)

onyx hinge
#
GitHub

Initial working version of light sleep and deep sleep, after several API iterations. Started coding from https://github.com/tannewt/circuitpython/tree/sleepio/ .

alarm.time.TimeAlarm implemented ...

Adafruit Industries - Makers, hackers, artists, designers and engineers!

The MagTag was made for โ€œdeep sleepโ€ thanks to the always-on EInk display. Thanks to a new pull request, weโ€™re getting the beginnings of light and deep sleep support. We can get dโ€ฆ

ionic elk
#

Oh man that's exciting

#

Joey makes the best stuff

onyx hinge
#

Thanks to other folks who comment on PRs as well -- is it time for you to "level up" and become a reviewer?

#

yup, I think that's why.

old smelt
#

Late and Lurking

modern wing
#

@prime flower How big of a server rack are you looking for?

prime flower
#

Maybe a 6U.

onyx hinge
#

"future (non binding)" hee hee

modern wing
#

I'd check out StarTech on Amazon -- I've heard good things about them, and there might be sales going on from the holiday.

If you have friends in the datacenter industry, there are sometimes mini server racks that are used for shipment then typically discarded. Around a 10U, sometimes bolted to a pallet. Nothing that a socket set that can't handle.

#

Keep in mind the post holes -- some are square open holes, some are telco/audio gear threaded holes.

onyx hinge
#

CircuitCron-py

modern wing
#

Also, consider used from Craigslist/Facebook Marketplace/etc. It's usually a buyer's market. Server racks take up a lot of space, have a limited resale market, and folks want to get rid of them fast.

prime flower
#

@modern wing Thanks for the advice, I'll keep the post holes in mind.. My friends who work in datacenters work for DoD/contractors which decommission instead of discard.

#

Mute buttons are ๐Ÿ”ฅ right now

ionic elk
#

Just from the mental image of Brent having his boards in a pile in his closet, which is the case for my desk, does anyone have good sorting solutions for dev boards in general?

prime flower
#

@ionic elk fortunately my boards are very well organized and fully labelled

thorny jay
#

๐Ÿฆƒ

prime flower
gilded cradle
#

Sounds like a good MagTag project

ionic elk
#

I should pick some of those up

modern wing
#

@ionic elk HakkoUSA has some wicked good clearance sales on AntiStatic bags (100 for ~$1.50). Them along with Sterlite containers from your local big box stores is my strategy.

And colored electrical tape + sharpie marker on the containers for labeling.

ionic elk
#

My boards are all generally pretty small (featherwing size) but I need rapid access to them since I use them so often

#

where do you get the boxes, amazon?

prime flower
#

studybudy microbit app is interesting

onyx hinge
idle owl
#

It turns out the boards are really hard to bork with static. I've been putting ESD foam in the bottom of containers, but I was told it's not necessary.

ionic elk
#

I didn't realize Adafruit had so many of these boxes, I should just pick up some from them

balmy stirrup
prime flower
#

thanks!

onyx hinge
#

portal library unification & substantial harmonization (PLUSH)

modern wing
#

@idle owl Yeah, most of the boards we work with need a lot of effort to zap. But I've had antistatic prevention workflows hammered into me for work, so it feels....weird to not be wearing a strap or work on a mat.

idle owl
#

@modern wing Yeah it's weird tossing a board into a plastic container. I still put the foam in with them.

#

Or had been. I have a bunch of new containers, but no new foam. So...

onyx hinge
#
2   "Feather MIMXRT1011"
2   "SparkFun Qwiic Micro"```
These three seem to each have evil twins
#

we could (in theory anyway) add a check to the CI to make sure all these strings are distinct

old smelt
#

Thanks! Have a great week!

balmy stirrup
#

Thanks!

thorny jay
#

Thanks

modern wing
#

Thanks ๐Ÿ™‚

#

๐ŸฅŠ pow. round 1. kattni vs magtag.

#

Ciao

solar whale
#

๐Ÿ‘‹

#

I use my PIRKEY to do my 2FA for github ๐Ÿ˜‰

onyx hinge
#

true story??

solar whale
#

yes

onyx hinge
#

wow ๐Ÿ™‚

idle owl
#

@gilded cradle Ok... So I managed to get text displaying. And instead of trying to figure out how to align a background image, I changed the image so the core of it is on the right. However. Is there a way to have separate text elements of different sizes? I'm trying two add_text and set_text but it displays them sequentially, not at the same time.

#

@solar whale I have Yubikeys for everything, works on GitHub as well.

#

@gilded cradle e.g. I want a line that's scaled to 2 like a title of sorts, and then the rest of the lines are normal sized.

#

Right now, the only way to get separate lines is adding \n in my string. As far as I can tell.

modern wing
#
gilded cradle
#

@idle owl I'm not quite sure what you're referring to when you say it displays them sequentially

idle owl
#

@gilded cradle It displays the first line, then refreshes and displays the second line where the first one was. Even though I have it set to put the second line further down.

#

sequentially as in sequence in time. One after the other.

gilded cradle
#

You have different text_position values?

idle owl
#

Yes.

gilded cradle
#

Could you send me your code so I can see what it looks like? I'm wondering if it's a bug.

idle owl
#

Sure. Hold on.

gilded cradle
#

In the library I mean

idle owl
#

Right

#

Comment out the image or I can send it to you for the code to run.

gilded cradle
#

I'm going to try running the label code.

idle owl
#

Right I figured. Simply reminding you there's a background image in the code.

gilded cradle
#

Oh, You need to pass an index to the second set_text to tell it to update the right one

idle owl
#

How does an index work?

gilded cradle
#

I need to do some restructuring so you can pass initial text and that will make it easier.

#

Oh, first one is assigned 0 (default value), then 1, etc.

#

So you give the index as the second variable in set_text

#

So, pass a 1 in the second set_text

idle owl
#

Ok trying that now

gilded cradle
#
magtag.set_text("Button A: Holiday Color Cycle\nButton B: Sparkle"
                "\nButton C: Comet\nButton D: LEDs off", 1)
#

Ok, cool

idle owl
#

Ah, it needs to be moved around, but everything is displaying

#

Thanks!

gilded cradle
#

You're welcome. Sorry it wasn't so straightforward.

idle owl
#

No worries, this is how APIs evolve.

gilded cradle
#

yep ๐Ÿ™‚

tulip sleet
#

@gilded cradle @idle owl How about if magtag.add_text returned the index, so you don't have to count:

TEXT_A = magtag.add_text(...)
magtag.set_text(..., TEXT_A)
gilded cradle
#

@tulip sleet there's a PR in for that, but it just needs to be run through black

slender iron
#

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

crimson ferry
#

What's the process for library merges to get released?

slender iron
#

I think any circuitpython librarian can create a new release

#

once that is done, it gets picked up by the bundle automatically

crimson ferry
#

The time between merge and release can create issues. Would it be rude to release my own PRs, as long as they were reviewed and merged by someone else? I don't have any library role, but I'm also happy to be a reviewer... mostly test, not so much code review.

lone axle
#

Someone from the core team could answer more definitively. But I don't think it would be rude at all. I do make releases for my own PRs after they are reviewed and merged by someone else.

slender iron
#

@crimson ferry we can get you access to do it ๐Ÿ™‚

crimson ferry
#

Thanks!

slender iron
#

hrm, gotta ask about it first. turns out it costs a little money first

crimson ferry
#

I don't want to cause any issues, just want to help wherever it's practical

slender iron
#

np, ladyada is looking into it

sleek swan
#

hey quick question; is it possible to play a sound while I change led colors simultaneously?

#

right now I have to wait until the wav ends before turning leds on

manic glacierBOT
gilded cradle
#

@sleek swan are you referring to the MagTag or a different board?

sleek swan
#

@gilded cradle circuitplayground express

#

I dont see how I could this without threading

gilded cradle
#

Ah, I seem to recall an example that could do this using generators. Let me see if I can find it.

sleek swan
#

amazing

gilded cradle
#

I think somebody came up with it at PyCon last year

sleek swan
#

wow that's superb thank you @gilded cradle will try it out right away ๐Ÿ˜„

gilded cradle
#

yw, poke around at other examples too

manic glacierBOT
slender iron
#

@onyx hinge isn't 3767 in?

opal crystal
#

That was me dismissing the comment with a push.

slender iron
#

ah, right

#

thanks ๐Ÿ™‚

onyx hinge
#

okay

#

the broken out savings PR 3773 is in

manic glacierBOT
onyx hinge
#

yeah I am feeling confused by the double pointer and the change from *emb = node->next; to emb = &((*emb)->next); .. it seems like one of them must have been wrong

#

or maybe I am misreading it altogether

opal crystal
#

The double pointer is so I donโ€™t have to make a special case for the start of thee linked list. What youโ€™re quoting is not a change from one to the other, they are different things.

onyx hinge
#

I was starting to see that

opal crystal
#

The first removes a node from the list. The second advances through the list.

onyx hinge
#

OK I understand it better now

#

read whole patch before commenting ๐Ÿ™‚

opal crystal
#

Or maybe read old and new code separately rather than reading the diff, the diff looks more confusing than it is.

onyx hinge
#

that may well be true in this case

#

it was exactly because the two different operations changed order that I was confused

idle owl
#

@gilded cradle Is there an easy way using the magtag library to clear the display? I need to photo the build for this project and I'd rather have an empty display for those images. Does calling refresh() with nothing else going on clear it?

#

Trying that.

#

Nothing happening, but that doesn't mean that's not what it's supposed to do. I'll comment out all the display code for now to get the images.

#

That worked. I'll uncomment everything when I'm ready for it.

idle owl
#

Do I have anything to gain by preloading the font if I'm adding three lines of text at the beginning of my file, before the main loop, and it stays static? There's a preload_font property in the MagTag lib. Wondering if I should be using it. @lone axle You've done a bit with this lib, do you know?

#

I'm thinking I'm not going to gain much since it's rendered first and stays static. But I honestly have no idea how all of that works.

lone axle
#

I am not 100% sure either tbh. I think you are right though the gain may not be much in that use case.

#

I think the effeciency boost shines more if you are changing the text a lot.

idle owl
#

Right, that's what I'm thinking too.

#

Thanks for the input!

lone axle
idle owl
#

@lone axle Perfect, thank you!!

manic glacierBOT
gilded cradle
#

@idle owl did you get the display clearing figured out?

#

I think using set_background with a color value is the right way to do it.

manic glacierBOT
#

This raise a question about unused or never released board...
pIRkey was never released by @ladyada as a product, maybe just in a Top Secret with a few prototype.
This could be the story for PyGamer Advance.

Those are ghost board visible on https://circuitpython.org/downloads
If those start to make problem, it is a bit sad.

We'll remove them if they start breaking the build but no need to do any work before that.

The downloads page is sorted by download count so that w...

#

I don't see the value in showing multiple exceptions for a single error. It gives the impression that more than one thing went wrong. i.e. I think CPython is probably not doing it correctly. I do understand, though, the value of #3696 to get a previous traceback. Would it be worth adding a parameter to mp_obj_print_exception() to indicate that we don't want to clear i.e. when calling supervisor.get_previous_traceback() ? That would involve changing the 15 or so places in the code where mp_obj...

lone sandalBOT
manic glacierBOT
idle owl
#

@gilded cradle That makes more sense. I commented out all the code that did anything with the display except for the refresh before the loop, and it cleared it. I figured it was good enough for me to get images.

gilded cradle
#

ok

idle owl
#

Thanks for the reply and the suggestion!

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

ESP32-S2 light sleep is pretty deep in terms of power saving, but allows the program to resume from where it left off. That's why I included it here. But I agree the side effects are significant. I should document what you need to do to really do a light sleep. It looks like if common_hal_wifi_radio_get_enabled(wifi.radio) is what to check about whether wifi is active. Does that sound right to you?

manic glacierBOT
#

OK. Other chips have various idiosyncratic wakeup mechanisms.

nRF allows an OR'ing of pin DETECT signals (detect low or high). It also has a latch that detects whether the enabled pins were detected, though not necessarily simultaneously. So, e.g., it could wake up when you press buttons 1,2,3, but they don't have to be simultaneous.

SAMD51 has tamper-detect pins with debouncing.

STM is more confusing.

manic glacierBOT
#

Another possibility is to not have separate wait_until_alarms() and sleep_until_alarms(). Instead, we just have a isngle routine (we have to pick one of the names). If light sleep is possible because wifi is off, etc., then go ahead and do it. Otherwise just wait. There could be a property .light_sleep_possible that would tell you whether you were going to sleep or not, though I'm not sure what the program would do with that if it didn't like the answer.

split ocean
#

@slender iron your speedup on .json fetching rocks! It was taking me about 1:40 to grab a reddit .json w 10 entries in it, now it takes about 20 seconds!

manic glacierBOT
#

The esp32s2 brings WiFi support and with that the possibility to have a mechanism for OTA updates.

There are two domains for OTA update implementation:

  • [ ] User Code Update
  • [ ] CircuitPython Update

User Code Update

For this my plan is to expose the circuitpy drive as a network drive.

CircuitPython Update

The plan here is to have the user code handle firmware grabbing and for the flashing part I agree with what @tannewt suggests.

add an esp32s2 specific...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

@60999 Please try to connect with another terminal program, such as putty or Tera Term, as suggested by @dingramax.

I am confused about which board firmware you're using: you say you're using muselab_nanoesp32_s2, but your board is "nodemocu-32-s2", so they don't match. Is it "mocu" or "mcu"? Could you post a pointer to that board? It's possible the pin connections are different.

manic glacierBOT
#

Naming possibilities:

  • Combine wait_until_alarms() and sleep_until_alarms() into one name or the other, or into try_to_sleep_until_alarms() (or attempt_sleep_until_alarms()).
  • Drop the deep in exit_and_deep_sleep_until_alarms(), and/or add try_to

The q is whether to try to point out that these routines might not really sleep, or whether to use the word sleep as time.sleep() does, which may not really sleep.

tulip sleet
#

@slender iron when you're up and available, let's talk about some sleep API naming. tnx

zealous barn
#

I did something without thinking it all the way through, and not sure how to recover. I created a code.py file which does "microcontroller.on_next_reset(microcontroller.RunMode.BOOTLOADER)" then "microcontroller.reset()" -- so now this device boots into bootloader, and when ciruitpython is updated via uploading a new UF2 image, it reboots, sees that code.py file, and reboots back to the bootloader mode.

#

Any ideas on how to erase the SPI flash filesystem from bootloader mode?

manic glacierBOT
#

@60999 Please try to connect with another terminal program, such as putty or Tera Term, as suggested by @dingramax.

I am confused about which board firmware you're using: you say you're using muselab_nanoesp32_s2, but your board is "nodemocu-32-s2", so they don't match. Is it "mocu" or "mcu"? Could you post a pointer to that board? It's possible the pin connections are different.

I use esp32 S2 chip esp-12k development board: nodemocu-32-s2, burning Firmware of
muselab_ nanoe...

onyx hinge
#

@zealous barn the uf2 bootloaders on atmel sam and nrf microcontrollers do not have the capability to interact with the SPI flash.

#

you could upload a first firmware which does this and returns to the uf2 bootloader, or if it's not important that all the content be erased then you can format the filesystem from within circuitpython.

solar whale
zealous barn
#

Unfortunately, not one of those boards (it's my own Programmable USB Hub -- ironically, I'm working on a tool to make it easier for end-users to upgrade Circuitpython and my firmware).

zealous barn
#

Maybe my best bet is to build a custom "erase" UF2

solar whale
zealous barn
slender iron
#

@zealous barn you can also click reset when the status neopixel is yellow to enter safe mode

zealous barn
#

The custom erase UF2 was easy to create and does the trick

slender iron
#

you could do an always safe mode version of circuitpython too

#

that way you wouldn't lose the filesystem

zealous barn
#

Would you suggest USER_SAFE_MODE, or some other flag?

slender iron
#

sure, it's temporary so it's up to you

#

it'll just change the message on the repl

zealous barn
#

Thanks

slender iron
#

np

manic glacierBOT
river quest
#

Now that we have DEEP SLEEP for CircuitPython, it means we get cute Blinka art with a sleepy snake ๐Ÿ™‚

slender iron
#

@onyx hinge you looking at S2 I2C problems?

manic glacierBOT
manic glacierBOT
#

Thanks for the continued work on deep sleep api. ๐Ÿ‘

I will start running tests on my microS2... will be monitoring the deep sleep current as well... I think we will have the least current consumption in timer alarms as every other type of alarm requires more RTC peripherals to be on.

Looking forward to adding Touch and ULP based alarms as well... :)

manic glacierBOT
onyx hinge
#

@slender iron yeah I can give you an update after we finish cooking

slender iron
#

kk, no rush. I can test your I2S PR

#

fyi micro bit v2s are in the store: https://www.adafruit.com/product/4781

onyx hinge
#

@slender iron OK I'm around now

slender iron
#

k, me too

onyx hinge
#

What I think I've learned is, the micro is running but USB has failed or frozen. I believe that because I put a "show a rainbow on the neopixel" in my program, and I see it loop

slender iron
#

huh, interesting. I just had an opposite freeze. cp stopped but usb responding

onyx hinge
#

I made some changes that made it better, but not fixed, and not good changes...

#

.. in mp_hal_stdin_rx_chr I added +vTaskDelay(1); and the necessary headers

#

in the debugger I can't figure out how to step through the USB task to understand what it's doing at this time

slender iron
#

you are more advanced with the debugger than I am

#

I'm trying to add a thing now that will spit out a backtrace whenever a ctrl-c is done over the usb serial

onyx hinge
#

hm this is a different crash profile ... this one was due to writing code.py, and on the next reset I had a freshly formatted filesystem.

slender iron
#

we've definitely seen that

#

kattni filed an issue for it

#

yielding when erasing flash sounds like a bad idea

#

since code is loaded from flash

manic glacierBOT
#

I just had an event like this. Host is Linux. I had written out code.py and the last thing on the console was

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

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
  File "code.py", line 29
SyntaxError: invalid syntax

The full backtrace of all threads in gdb said this

Thread 7 (Thread 1073734432):
#0  0x400324cd in xQueu...
onyx hinge
#

4096 is the size of the flash block in esp32s2?

slender iron
#

it's the block size of external flash

onyx hinge
#

oh of external flash of course

slender iron
#

there is no flash in the esp

#

though it is memory mapped

onyx hinge
#
{
#ifdef CONFIG_SPI_FLASH_YIELD_DURING_ERASE
    vTaskDelay(CONFIG_SPI_FLASH_ERASE_YIELD_TICKS);
#endif
}
``` From the function signature it looks like spi_flash_os_yield should be in IRAM?  Is 0x4002b038 an address in IRAM?
slender iron
#

I don't remember off the top of my head

onyx hinge
#

looks like yes it is

#

starting at 0x4008_0000 is external, 0x4000_0000..0x4007_1fff are internal.

slender iron
#

๐Ÿ‘

#

is CONFIG_SPI_FLASH_YIELD_DURING_ERASE defined?

onyx hinge
#

it must be, the function disassembles to a call to vTaskDelay

slender iron
#

disabling it probably messes up usb when erasing

#

are any of the other tasks not in IRAM?

onyx hinge
#
        bool "Enables yield operation during flash erase"
        default y
        help
            This allows to yield the CPUs between erase commands.
            Prevents starvation of other tasks.
#

yeah several are

slender iron
#

that could be the issue

onyx hinge
#

including the main circuitpython thread which was executing (I was getting error flashes on the neopixel)

#

but maybe it was within a cache? who knows.

slender iron
#

ya maybe

#

we could try disabling the yield

#

it shouldn't block usb interrupts

onyx hinge
#

spi_flash_os_yeield is within usb_device_task so I think that USB can't continue operating until the write completes

#

I thought there was some code where the actual write was delayed a bit .. must not be?

slender iron
#

the usb task on the esp is equivalent to usb_background

#

NOT the usb interrupt

manic glacierBOT
slender iron
#

that's what was confusing me

onyx hinge
#

OK