#circuitpython-dev

1 messages ยท Page 28 of 1

manic glacierBOT
manic glacierBOT
solar whale
#

@slender iron I'm having some issues with nrfutil -- the version I have is old (looking for python 2) did you install it via homebrew (on a mac) or via pip?

slender iron
#

nrfutil on pip requires python 3.10 or lower

#

nrfutil 7 is actually a direct download from nrf

#

so that's what the CI does

solar whale
#

hmm -- I'll take a look

slender iron
#

I'm salty about it

solar whale
#

OK -- now have a .zip --- took a few gyrations but now to attempt to load it.

#

first I have to find my bangle2 ...

manic glacierBOT
solar whale
#

@slender iron

#

Now -- how do I access it?

slender iron
#

nice! I use file glider on ios

#

and bluefruit connect for the repl

#

the testflight versions will be better

#

not sure what is in the app store now @solar whale

solar whale
#

I'll give those a try

#

my watch keep buzzing every few seconds..is that expected?

#

Glider or Bluefruit connect don't seem to be able to connect. keep disconnecting..

slender iron
#

ya, it buzzes the status codes

#

since the only led is the backlight

solar whale
#

ok - Bluefruit connect sees it, but wont connect

slender iron
#

are you using the testflight of glider?

solar whale
#

not sure where I got it

#

it is not in testflight

slender iron
#

ok, looks like 1.0.2 is live and 2.0.0 is waiting review

jaunty juniper
slender iron
#

I think that should work

#

I think the iOS apps are easiest if you are like me and want it connected to your phone for notifications

solar whale
#

I tried.. but no luck -- yet

slender iron
#

you should be able to connect through nrf connect too

#

the latest glider can see existing connections

solar whale
#

I will try reloading CP to it

slender iron
#

what does the status bar at the top say for BLE status?

solar whale
#

Reconnecting

slender iron
#

ah, ok. that means it thinks its connected once already

#

did it connect to your android already?

solar whale
#

at one point

slender iron
#

you should be able to hold the button to reset CP and then press it during the fast pulse (think fast blue flash) to have it publicly advertise again

#

the hold is 10ish seconds

solar whale
#

it went to safe mode ??

slender iron
#

that'll happen if you press too early after the restart

#

wishes it had a status rgb led

solar whale
#

ah -- go it it back to advertizing

#

glider sees it but won't connect

slender iron
#

hrm, did you get the testflight version? that's what I'm using

solar whale
#

yes

slender iron
#

hrm, what does the setting > bluetooth page say? what does CP say?

solar whale
#

where? glider (and nrf connect) say "peer removed pairing information)"

slender iron
#

ah, you'll need to forget it from settings > bluetooth then

#

iOS settings

solar whale
#

yay! glider is in !!!

slender iron
#

๐ŸŽ‰

solar whale
#

very cool !

slender iron
#

we have improvements to bluefruit connect for the repl

#

are you planning on using it day-to-day or just trying it?

#

I don't think I posted my code anywhere

solar whale
#

just playing.... no rush

#

ok -- NRF connect now connects -- but how can I see REPL?

slender iron
#

that's in bluefruit connect

#

on testflight

solar whale
#

ah --

#

how do I get that in testflight?

slender iron
#

I'm looking. I'm not sure if its setup

solar whale
#

ok -- no worries -- I did not mean to tie you up. I can play with glider.

slender iron
solar whale
#

got it

slender iron
#

build 55 should have just been pushed

#

there is a terminal mode in the uart settings

solar whale
#

it is echoing

#

got it -- nneed to add \r to EOL

slender iron
#

did you select terminal mode?

solar whale
#

yes finally -- thanks for the demo code -- I think I can work with it now. Thanks for being patient.

slender iron
#

thank you for the patience!

solar whale
#

after selecting terminal mode I also changed the EOL character to "\n\r"

#

this is very cool!

slender iron
#

ya, its a weird wireless world

slender iron
tulip sleet
#

thanks @onyx hinge!

slender iron
#

doc changes don't need a release

slender iron
#

(or is it pulled into stubs?)

tulip sleet
#

that I don't know

#

anyway, all merged.

slender iron
#

๐Ÿ‘

solar whale
#

@slender iron Are these fonts availble somewhere self.font64 = bitmap_font.load_font("share_tech_64.bdf") self.font64.load_glyphs("0123456789:") self.font32 = bitmap_font.load_font("share_tech_32.bdf")

slender iron
#

ah, lemme find them

solar whale
#

Thanks -- Is there a way to upload a whole directory via glider -- or does it have to be one file at a time?

slender iron
#

open the files app

#

glider makes the FS available there (and any other app that can read from the files app)

solar whale
#

very nice!

slender iron
#

ya, I was using Runestone to edit code.py

solar whale
#

so much to learn!!

slender iron
#

๐Ÿ™‚

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.4-32-g6bec65833b-dirty on 2023-02-28; Adafruit Feather RP2040 with rp2040

Code/REPL

# example from adafruit_circuitpython_floppy repo

Behavior

Traceback (most recent call last):
  File "", line 1, in 
  File "floppy_vfs.py", line 41, in 
OSError: [Errno 19] No such device

(because data read back as all zeros instead of correctly decoding mfm)

Description

No response

##...

solar whale
#

Progress

slender iron
#

Nice!

#

I wonder why the time is wrong

solar whale
#

I think its ok 4:17 pm here?

#

shuold it fit on the screen

slender iron
#

in the pic it doesn't look right

solar whale
#

no -- looks too big

#

or maybe something else

slender iron
solar whale
#

I ran it from REPL -- I try it as code.py -- do you need anything in settings.toml?

slender iron
#

don't think so

solar whale
#

Getting notifications nowโ€ฆ still something odd with the time. Still pretty impressive

slender iron
#

I wonder if those are old font files

#

I just grabbed them off my comp

#

not my watch

solar whale
#

they do just seem to be too large

slender iron
solar whale
#

larger than in your picture.

solar whale
#

much better !

#

Thank you!

slender iron
#

no problem!

#

battery life isn't great though

#

I charge every night

solar whale
#

one step at a time!

#

thanks so much for the code -- it will make it so much easier to try things.

slender iron
#

np

#

my main reason to do it was to prioritize notifications

#

๐Ÿ™‚

solar whale
#

When I used notification on the bangle2 espruino code, it kept crashing -- I'm looking forward to seein ghow this runs.

slender iron
#

nice!

#

I've seen some hangs on disconnect

#

and I poke it by "writing" boot_out.txt from glider

#

I've been meaning to debug that

#

it doesn't happen so often that its unusable

#

if the battery dies completely it may start in safemode because it doesn't see the flash

#

you can get to the repl to restart then though

#

I spend months using SWD to get out of safemode ๐Ÿ™‚

solar whale
#

Does it jsut should the last notification?

slender iron
#

it shows the top priority one

#

or the last in case of a tie I think

solar whale
#

OK

slender iron
#

but you can change it ๐Ÿ™‚

solar whale
#

I need to read the code ...

#

yup!

#

This has been a great start! I have to go offline, but thanks so much for the help. I'll let you know what I can break ๐Ÿ˜‰

slender iron
#

@onyx hinge what do you think of: ```
512 bytes used, 0 bytes free in FLASH_CONFIG out of 512 bytes (0.5kB).
48 bytes used, 4048 bytes free in FLASH_IVT out of 4096 bytes (4.0kB).
483516 bytes used, 515908 bytes free in FLASH_FIRMWARE out of 999424 bytes (976.0kB).
0 bytes used, 7340032 bytes free in FLASH_FATFS out of 7340032 bytes (7168.0kB).
0 bytes used, 0 bytes free in RESERVED_FLASH out of 0 bytes (0.0kB).
22396 bytes used, 43140 bytes free in OCRAM out of 65536 bytes (64.0kB).
23776 bytes used, 8992 bytes free in DTCM out of 32768 bytes (32.0kB).
7376 bytes used, 25392 bytes free in ITCM out of 32768 bytes (32.0kB).

onyx hinge
#

that's a lot to digest!

#

it makes me wonder about putting it in json instead so we can look at it with tools

slender iron
#

ya, I should figure out how to output a table

#

can totally do json too

#

considered progress bar style too

tulip sleet
#

could do mm/nn used (xx%) would be more compact

#

json output could be written to a standard filename

slender iron
#

I also know the sections like .text, .dtcm_bss etc

#
512/512 100.0% FLASH_CONFIG
  0x60000400 512 .flash_config
48/4096 1.2% FLASH_IVT
  0x60001000 48 .ivt
483516/999424 48.4% FLASH_FIRMWARE
  0x600820ac 8 .ARM.exidx
  0x6000c000 483500 .text
  0x600820ac 8 .ARM.exidx
0/7340032 0.0% FLASH_FATFS
22396/65536 34.2% OCRAM
  0x20200000 2364 .data
  0x20201000 20032 .bss
23776/32768 72.6% DTCM
  0x20000400 2272 .dtcm_bss
  0x20000ce0 20480 .stack
  0x20000000 1024 .dtcm_data
7376/32768 22.5% ITCM
  0x0 7376 .itcm
#

and I'm double counting exidex

tulip sleet
#

if you wrote json, we could have a CI step that says, "hey this build is getting dangerously low", I think that's what you might have had in mind? Write json and then have another pretty-printing script that produces output like the above from the json

slender iron
#

my main goal was to show all the regions, not just flash and ram generically

#

logging it somewhere would be neat

jaunty juniper
#

would it be horribly complicated to have all of that inserted in a database, with git hash, board ID and language, so we can do comparisons ?

slender iron
#

running the db is probably the hardest part

#

this is what the linker prints: Memory region Used Size Region Size %age Used FLASH_CONFIG: 512 B 512 B 100.00% FLASH_IVT: 48 B 4 KB 1.17% FLASH_FIRMWARE: 494272 B 976 KB 49.46% FLASH_FATFS: 0 GB 7 MB 0.00% RESERVED_FLASH: 0 GB 0 GB OCRAM: 24128 B 64 KB 36.82% DTCM: 23776 B 32 KB 72.56% ITCM: 7376 B 32 KB 22.51%

#

looks more correct than mine ๐Ÿ‘€

blissful pollen
#

@onyx hinge Just curious when you were writing a GIF directly to the display did you just handle it direct via SPI with the commands and all?

onyx hinge
#

@blissful pollen did you see the gist link? It's making calls on the display bus object

blissful pollen
onyx hinge
#

so for many common displays those codes (42/43/44) are consistent and set the bounding box of the area to write and then accept the data in RGB565_SWAPPED order

blissful pollen
#

Thanks. Didn't think to just send via the display bus.

slender iron
#
  * Add --error-handling-script=<NAME> command line option to allow
    a helper script to be invoked when an undefined symbol or a
    missing library is encountered.  This option can be suppressed
    via the configure time switch: --enable-error-handling-script=no.
manic glacierBOT
#

Increases drive strength of 32kHz external crystal (LSE), in line with calculations specified in ST AN2867 sections 3.3, 3.4, and STM32L4 datasheet DS12023 Table 58. LSE oscillator characteristics.

The drive strength RCC_LSEDRIVE_LOW is marginal for the 32kHz crystal oscillator stability, and RCC_LSEDRIVE_MEDIUMLOW meets the calculated drive strength with a small margin for parasitic capacitance.

slender iron
#

@tulip sleet @onyx hinge ok. not sure where I should go with this region stuff

#

ld 2.40 looks to fail correctly now

#

but it doesn't print free bytes itself

tulip sleet
#

is what you are printing now good enough? json would be nice but it's a lot of work

slender iron
#

json is easy to print but doing something with it is hard

#

I've gotta make my script work for all ports because its parsing the linker script

#

to get the memory regions, their offset and length

tulip sleet
#

it's parsing the linker script or the linker output you pasted above?

slender iron
#

the linker scripts

#

the .ld files

lone axle
#

@proven garnet do you know if there is setup that needs to be done for the 'upload-release-assets to github' actions task in new libraries to be able to run successfully? This one https://github.com/adafruit/Adafruit_CircuitPython_ACeP7In/actions/runs/4297284805/jobs/7490060429 reports an error Error: Input required and not supplied: upload_url

It seems like it should come from here: https://github.com/adafruit/workflows-circuitpython-libs/blob/3d93baee6d79e829cf6dd463decd1d5fd6031f6c/release-gh/action.yml#L59 but I'm not certain where this inputs object comes from when it runs in the actions container.

tulip sleet
#

you could have a script per port

#

or an optional script per port, so you only have to write one for now

slender iron
#

I'd rather have something consistent

tulip sleet
#

getting the .ld's to be consistent is a big job, is it worth it?

#

the different ports have different memory architectures, may be hard to generalize across them

slender iron
#

I don't think it'll be super bad

#

its all done at the memory region, section and segment level

tulip sleet
#

i am just thinking about whether it is worthe the effort. You could say that we should have one Makefile for all ports also, instead of port/*/Makefile, but we don't. Sure it would be nice, but it's not getting in our way

#

i had a scrum manager who always cautioned us against doing unnecessary work

slender iron
#

that's why I'm considering removing the memory info step all together

tulip sleet
#

but I don't want less information, it's useful

slender iron
#

ya, missing free bytes would be annoying

tulip sleet
#

print what you need to now for i.MX, it's already working, you don't have to refactor it now

slender iron
#

I modified the existing file ๐Ÿ™‚

tulip sleet
#

put it back and copy and rename it ๐Ÿ™‚

slender iron
#

I don't think its much more work to get it going for other ports

tulip sleet
#

it's your time ๐Ÿ™‚

#

but don't give me less info than I have now. I mean i don't care about both free and used, etc. I can do arithmetic

#

but I want to know how full stuff is

slender iron
#
Memory region         Used Size  Region Size  %age Used
FLASH_BOOTLOADER:          0 GB         8 KB      0.00%
  FLASH_FIRMWARE:      250488 B     253696 B     98.74%
FLASH_FILESYSTEM:          0 GB         0 GB
    FLASH_CONFIG:          0 GB         0 GB
       FLASH_NVM:          0 GB        256 B      0.00%
             RAM:       12352 B        32 KB     37.70%
#

is what the linker would give us

#

just have to add a flag

#

that's metro m0

tulip sleet
#

that's not terrible, though it is nice to have the free bytes there immediately.

#

What does it print on overflows?

slender iron
#
/usr/lib/gcc/arm-none-eabi/12.2.0/../../../../arm-none-eabi/bin/ld: build-metro_m7_1011/firmware.elf section `.data' will not fit in region `OCRAM'
/usr/lib/gcc/arm-none-eabi/12.2.0/../../../../arm-none-eabi/bin/ld: build-metro_m7_1011/firmware.elf section `.data' will not fit in region `FLASH_FIRMWARE'
/usr/lib/gcc/arm-none-eabi/12.2.0/../../../../arm-none-eabi/bin/ld: region `FLASH_FIRMWARE' overflowed by 19152 bytes
/usr/lib/gcc/arm-none-eabi/12.2.0/../../../../arm-none-eabi/bin/ld: region `OCRAM' overflowed by 482880 bytes
/usr/lib/gcc/arm-none-eabi/12.2.0/../../../../arm-none-eabi/bin/ld: warning: build-metro_m7_1011/firmware.elf has a LOAD segment with RWX permissions
Memory region         Used Size  Region Size  %age Used
    FLASH_CONFIG:         512 B        512 B    100.00%
       FLASH_IVT:          48 B         4 KB      1.17%
  FLASH_FIRMWARE:     1018576 B       976 KB    101.92%
     FLASH_FATFS:          0 GB         7 MB      0.00%
  RESERVED_FLASH:          0 GB         0 GB
           OCRAM:      548416 B        64 KB    836.82%
            DTCM:       23776 B        32 KB     72.56%
            ITCM:        7376 B        32 KB     22.51%
tulip sleet
#

I do find it a little weird that sometimes we just see negative bytes and sometimes we see an error. I don't know why it can do either

slender iron
#

we added the script because the linker used to be wrong

#

but I have 2.40 and it looks right

#

(it didn't use to count .data into flash)

tulip sleet
#

ah, I thought the script was modified from micropython

slender iron
#

I'm modifying build_memory_info.py

#

I wonder if we're failing builds we don't need to...

tulip sleet
#

the 10.x toolchain still has 2.35. We are not all on arch

slender iron
#

I'm not sure when it was fixed

tulip sleet
#

can you test with the 10.x toolchain?

slender iron
#

I'm looking at the ci output now

manic glacierBOT
lone axle
onyx hinge
#
$ arm-none-eabi-ld -v
GNU ld (GNU Arm Embedded Toolchain 10-2020-q4-major) 2.35.1.20201028
``` this can still get negative bytes free according to our measurement script
#

@tulip sleet @slender iron the negative free space thing is still a thing

slender iron
#

that's an old arm embedded release though

#

what does the newest have?

onyx hinge
#

sorry, which one are you talking about using? I thought you were wanting a test with the 10.x toolchain

slender iron
#

I'm trying with 12.2

onyx hinge
#

.github/actions/deps/external/action.yml: release: '10-2020-q4'

#

OK I was answering about the one currently used in CI, I thought it was the test dan asked for

slender iron
#

yup, it is

#

I'm gonna push a test with 12

#

it may not have fit because of this fix

onyx hinge
#

humm our ci is still on 20.04? we should bump it while we're going up in versions of things

slender iron
#

cancels the run

#

looks like most had already been bumped

manic glacierBOT
#

It is defined in ports/stm/boards/swan_r5/mpconfigboard.h since it is a board-specific property. Adding a default is potentially dangerous since it depends on the characteristics of the baord.

At present, only the Swan R5 board is based on the L4. As new boards are added, they will need to define the correct drive level that is calculated from the board characteristics. If a new board doesn't define this symbol, the [error message produced](https://github.com/adafruit/circuitpython/pul...

#

What I am thinking about is that if a board is based on a reference design with the reference crystal, the drive level is known. I see that F7 and H4 boards also have a default of "low". It sounds like your board is different. But a vanilla board could work with "low", if that's what's fine for the reference design. Otherwise someone starting to port a new board will have to figure this out. That's why I'd rather have a safe default. If it doesn't work, then they can change it.

slender iron
#

ok, so I don't think this is a fixed bug

#

its a difference in behavior depending on the link script

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 8\.1\.0\-beta\.0
slender iron
#

If you do .data: AT(previous_location) it doesn't work. but if you do } > RAM AT> FLASH at the end of the section, it does

tulip sleet
proven garnet
orchid basinBOT
manic glacierBOT
tulip sleet
#

Notable changes to 8.1.0 since 8.0.0

  • Add animated GIF support: gifio.OnDiskGif.
  • Add safemode.py, for programmatic handling of safe mode.
  • Add 7-color e-ink display support.
  • Allow setting pystack size in settings.toml.
  • Add dither support to Palette.
  • Support array.extend(iterable).
manic glacierBOT
#

Built on an ESP32-S3-DevKitC-1-N8R2. The crash limit was actually a little higher but I haven't spent any time looking at that yet. I set the pystack size to 3600 and got the following trackeback:

***ERROR*** A stack overflow in task main has been detected.


Backtrace: 0x40378646:0x3fcf2da0 0x4038262d:0x3fcf2dc0 0x40385daa:0x3fcf2de0 0x403843b0:0x3fcf2e60 0x403826dc:0x3fcf2e90 0x403826d2:0x2d797063 |<-CORRUPTED




ELF file SHA256: 199f30faa96abdc6

CPU halted.

I tried ...

manic glacierBOT
slender iron
#

@wraith crow the first line of the error says it is a stack overflow

#

(the c stack)

wraith crow
#

Yea, I thought that might be important ๐Ÿ™‚

#

Once you have a stack overflow I suppose it's not surprising that the backtrace get's corrupted....

slender iron
#

๐Ÿ™‚

#

it shouldn't crash, our stack checking code should cause the recursion error

jaunty juniper
#

oh make translate does actually warn about the \r

main.c:146: warning: internationalized messages should not contain the '\r' escape sequence
spiral elk
#

Do you think there would be any traction for adding a 'castellated pads' feature to the .org board data and filters?

#

There seem to be at least 40 boards with them.

solar whale
#

@slender iron having fun with the watch. I changed it to a 24hr time and have been fiddling with the msg priorities. Also raised the backlight to 2**15. I could not see it at 2**8. Lots more to explore!

manic glacierBOT
#

Hello, I did not test this with the original workflow. Instead I used the one provided in the https://github.com/adafruit/circuitpython_jupyter_kernel/blob/master/examples/using_magics_and_nbdev.ipynb example. Instructions for installation are provided. I used the following script fromthis learning guide: https://learn.adafruit.com/mqtt-in-circuitpython/connecting-to-the-adafruit-io-mqtt-broker


# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Iden...
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-rc.1 on 2023-01-30; Adafruit QT Py ESP32S2 with ESP32S2

Code/REPL

Adafruit CircuitPython 8.0.0-rc.1 on 2023-01-30; Adafruit QT Py ESP32S2 with ESP32S2
import time
import board
import digitalio
import busio
from adafruit_hid.mouse import Mouse
from usb_hid import devices

import time
# time.sleep(3) # ??? needed delay at start to not crashy-crashy
SCALE = 1

mouse = Mouse(devices)

spi = board....
manic glacierBOT
slender iron
#

@solar whale great! The backlight was that dim because I was using it in a completely dark room with a baby. ๐Ÿ™‚

manic glacierBOT
slender iron
jaunty juniper
#

the msgpack module does this, seemingly to check the byte order and swap if not big endian, couldn't that be done with a #if ? Or is it already done elsewhere ? (I'll look in the struct module)

STATIC uint32_t read4(msgpack_stream_t *s) {
    uint32_t res = 0;
    read(s, &res, 4);
    int n = 1;
    if (*(char *)&n == 1) {
        res = __builtin_bswap32(res);
    }
    return res;
}

couldn't that part with n just be #if MP_ENDIANNESS_LITTLE ?

manic glacierBOT
tulip sleet
slender iron
#

was rp2040 double counting .data?

tulip sleet
#

no idea

#

and the second stage bootloader is very small?

#

or is it about 4k (I have another memory it's 256 bytes -- maybe both are wrong)

slender iron
#

second stage is 256 bytes (252 + 4 checksum)

#

I should test the size command

#

I didn't actually verify its behavior varies

#

only that --print-memory-usage varies

#
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
Memory region         Used Size  Region Size  %age Used
FLASH_BOOTLOADER:          0 GB         8 KB      0.00%
  FLASH_FIRMWARE:      251596 B     253696 B     99.17%
FLASH_FILESYSTEM:          0 GB         0 GB
    FLASH_CONFIG:          0 GB         0 GB
       FLASH_NVM:          0 GB        256 B      0.00%
             RAM:       10856 B        32 KB     33.13%
   text    data     bss     dec     hex filename
 250532    1064    9784  261380   3fd04 build-metro_m0_express/firmware.elf
Converted to uf2, output size: 503296, start address: 0x2000
#

size excludes the .data section from text

#

I trust the linker more than size

tulip sleet
#

maybe the optimizer tunings we have need re-tuning

#

e.g. trinket is 500 bytes bigger. I should look at function sizes.

#

I won't do this immediately

slender iron
tulip sleet
#

going for a walk in about half an hour

slender iron
#

I think we can do it with 9.0

tulip sleet
#

yeah, a bit too much pot stirring now maybe

slender iron
#

we'll stir it with the idf 5 merge and mp 1.20

#

๐Ÿ˜„

tulip sleet
#

i think we will get spattered a bit in the process ๐Ÿ™‚

slender iron
#

the code sizes will change a bunch then anyway

#

I just filed an issue to split out epaperdisplay for displayio too

tulip sleet
#

good point

slender iron
#

that'll help in cp 10

#

@tulip sleet think I should PR my changes without the toolchain update?

tulip sleet
#

the size-printing changes?

slender iron
#

move to AT> everywhere and remove build memory info

tulip sleet
#

and .ld ?

slender iron
#

yup

tulip sleet
#

if you could smoke-test one board from each port, that would be good

slender iron
#

I think its samd only that used the old form

#

I don't think its worth it to do now

#

I want to do perf stuff now

#

we can do it with the gcc update

tulip sleet
#

yes, your .ld changes will not go stale

slender iron
#

new ports should use AT>

tulip sleet
#

that can go in your porting guide

slender iron
#

yes!

#

though I'm not really covering getting it building...

#

its a bit like I'm starting with part 2

tulip sleet
#

it can just be a random note for now

manic glacierBOT
onyx hinge
#

Any sphinx experts handy? I'm trying to guess/understand why the documentation of the __init__ method is not showing the parameters: https://docs.circuitpython.org/projects/mcp2515/en/latest/api.html#adafruit_mcp2515.MCP2515 .. they're all documented in the source https://github.com/adafruit/Adafruit_CircuitPython_MCP2515/blob/main/adafruit_mcp2515/__init__.py#L285

GitHub

A CircuitPython library for working with the MCP2515 CAN bus controller - Adafruit_CircuitPython_MCP2515/init.py at main ยท adafruit/Adafruit_CircuitPython_MCP2515

#

I assume it's something about the sphinx setup but I don't know what.

jaunty juniper
#

could it be that the class docstring overrides the init doc string ?

#

the dosctring is usually on the class I believe

#

(but I'm no sphinx expert)

#

basically there is no documentation for the __init__ method, since it's just the documentation for creating an instance of the class, and appears under the class header

#

similarly to how the docstring for setters is ignored, using only the getter docstring

onyx hinge
#
GitHub

CircuitPython - a Python implementation for teaching coding with microcontrollers - circuitpython/CAN.c at 859a48723f86cd56c671ddc0ee5e66ded6910f75 ยท adafruit/circuitpython

#

with documentation for the constructor in the doc of __init__, and both are shown in the docs

jaunty juniper
#

sphinx in libraries doesn't use autoapi ๐Ÿค”

#

I saw that:

def skip(app, what, name, obj, would_skip, options):
    if name == "__init__":
        return False
    return would_skip

def setup(app):
    app.connect("autodoc-skip-member", skip)

but that adds a __init__ entry

#

or that which is not better:

.. autoclass:: my.Class
   :special-members: __init__
   :members:
#

me, I would put the dosctring at the class level an leave it at that (although I notice that other libraries use a __init__ dosctring)

still zephyr
# onyx hinge Any sphinx experts handy? I'm trying to guess/understand why the documentation o...

Jeff put the parameters at the start of the class, like this, I could make a PR later if needed..

class MCP2515:  # pylint:disable=too-many-instance-attributes
    """

    A common shared-bus protocol.

    :param ~busio.SPI spi: The SPI bus used to communicate with the MCP2515
    :param ~digitalio.DigitalInOut cs_pin:  SPI bus enable pin
    :param int baudrate: The bit rate of the bus in Hz, using a 16Mhz crystal. All devices on\
        the bus must agree on this value. Defaults to 250000.
    :param Literal crystal_freq: MCP2515 crystal frequency. Valid values are:\
        16000000, 10000000 and 8000000. Defaults to 16000000 (16MHz).\
    :param bool loopback: Receive only packets sent from this device, and send only to this\
    device. Requires that `silent` is also set to `True`, but only prevents transmission to\
    other devices. Otherwise the send/receive behavior is normal.
    :param bool silent: When `True` the controller does not transmit and all messages are\
    received, ignoring errors and filters. This mode can be used to โ€œsniffโ€ a CAN bus without\
    interfering. Defaults to `False`.
    :param bool auto_restart: **Not supported by hardware. An `AttributeError` will be raised\
    if `auto_restart` is set to `True`** If `True`, will restart communications after entering\
    bus-off state. Defaults to `False`.

    :param bool debug: If `True`, will enable printing debug information. Defaults to `False`.

    """

    def __init__(

onyx hinge
#

ah ok so the difference is in use of autoapi. OK, I can do it in whatever way non-autoapi needs ๐Ÿ˜• I wish it was consistent with the core

#

thanks for the info all!

manic glacierBOT
orchid basinBOT
orchid basinBOT
orchid basinBOT
slender iron
tulip sleet
slender iron
#

thank you!

manic glacierBOT
onyx hinge
#

There appears to be pyocd support for samd51 ```jepler@eric:~$ pyocd pack find SAMD5
Part Vendor Pack Version Installed

ATSAMD51G18A Microchip Microchip.SAMD51_DFP 3.6.120 False
ATSAMD51G19A Microchip Microchip.SAMD51_DFP 3.6.120 False
ATSAMD51J18A Microchip Microchip.SAMD51_DFP 3.6.120 False
ATSAMD51J19A Microchip Microchip.SAMD51_DFP 3.6.120 False
ATSAMD51J20A Microchip Microchip.SAMD51_DFP 3.6.120 False
ATSAMD51N19A Microchip Microchip.SAMD51_DFP 3.6.120 False
ATSAMD51N20A Microchip Microchip.SAMD51_DFP 3.6.120 False
ATSAMD51P19A Microchip Microchip.SAMD51_DFP 3.6.120 False
ATSAMD51P20A Microchip Microchip.SAMD51_DFP 3.6.120 False

tulip sleet
#

that would be great. openocd claims to, but it doesn't work well

blissful pollen
#

Is there a limit on how much one send you can make for SPI on an ATMEL port? Trying the gif code there and it is sending about 40K of the bitmap. Interestingly enough the second half of the data it seems

manic glacierBOT
onyx hinge
#

[interestingly enough the second half of your message seems]

blissful pollen
#

Iโ€™ll poke at it some more and file an issue. Probably rare to ever write so much SPI data at once.

And my writing was trying to say I only saw the second half of the buffer transmitted. Which seems weird

onyx hinge
#

ah now I understand what you meant.

#

and because of reasons the address used is the end of the buffer, so if the transfer length is altered by truncation to 16 bits, it would be the end of the data that is actually transferred

#

mind opening a bug @blissful pollen ? it'll probably need to be fixed down in the peripherals submodule but go ahead and start it in circuitpython...

blissful pollen
onyx hinge
#

of course, take your time

orchid basinBOT
tidal kiln
#

mainly just curious what changed here? revisiting some very old code. this worked ~2018

Adafruit CircuitPython 7.3.3 on 2022-08-29; Adafruit Feather M0 Express with samd21g18
>>> import board, pwmio
>>> pwm = pwmio.PWMOut(board.A1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: All timers for this pin are in use
>>> 

guessing some timer allocations got rearranged

#

(does same in 8.0.3 fwiw)

tulip sleet
stuck elbow
#

yeah, suddenly you could only have 10 pwm outs

#

I had to scrap my robot

manic glacierBOT
slender iron
tidal kiln
slender iron
#

find a build that works

#

do you know what version of cp it was?

tidal kiln
#

nothing special about that pin. can change to another.

#

nope. not sure. and s3 bucket doesn't go that far back.

stuck elbow
#

iirc the code would let you set use those pins and/or timers, but then it wouldn't work correctly

#

like, you would have several pwm outs sharing the same timer

tidal kiln
#

use case at the time was a single servo

slender iron
#

we moved to s3 later

tidal kiln
#

ah. yah...ok lemme try that. for the grins and/or the giggles.

slender iron
#

I'd be curious to see why

#

maybe the pin data was wrong at some point

tidal kiln
#
Adafruit CircuitPython 3.0.0 on 2018-07-09; Adafruit Feather M0 Express with samd21g18
>>> import pwmio
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: no module named 'pwmio'
>>> 

must've been later than this...trying next...

slender iron
#

try pulseio

#

pwm moved recently

tidal kiln
#

ah. ok. that's probably part of it.

#

i think this code was script updated at some point

#

so original code was pulseio

manic glacierBOT
tidal kiln
#
Adafruit CircuitPython 3.0.0 on 2018-07-09; Adafruit Feather M0 Express with samd21g18
>>> import board, pulseio
>>> pwm = pulseio.PWMOut(board.A1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: All timers for this pin are in use
>>> 
#
Adafruit CircuitPython 2.2.4 on 2018-03-07; Adafruit Feather M0 Express with samd21g18
>>> import board, pulseio
>>> pwm = pulseio.PWMOut(board.A1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Invalid pin
>>> 
stuck elbow
#

bad pin, no biscuit

tulip sleet
#

@tidal kiln there are old releases in the OLD/ directories on S3 for boards that have had builds for that long

tidal kiln
#

oops. copy pasta error. one sec.

#
Adafruit CircuitPython 1.0.0 on 2017-09-12; Adafruit Feather M0 Express with samd21g18
>>> import board, pulseio
>>> pwm = pulseio.PWMOut(board.A1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Invalid pin
>>> 
#

weird. so not sure how this worked way back when.

#

but doesn't really matter

#

this is all getting updated

#

the batch code updating from pulseio to pwm was the main point of confusion

#

@slender iron @tulip sleet thanks for looking. sry for the noise. no real issue here. more of curiosity.

slender iron
#

was it on a different board?

tulip sleet
manic glacierBOT
tidal kiln
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0-alpha
Adafruit ItsyBitsy M4 Express with samd51g19

Code/REPL

display_bus.send(42, struct.pack(">hh", 0, 239))
display_bus.send(43, struct.pack(">hh", 80, 319))
display_bus.send(44, gif.bitmap)

Behavior

When sending a large SPI transfer the transfer is truncated. @jepler found reference in the samd51 spec that the block transfer count size in DMA is limited to a 16 bit value which implies the m...

tidal kiln
#

i was using express above

#

what was done way back in ~2018 remains a mystery

#

but not an issue

#

i'm redoing it all and updating to use a rp2040

#

i was originally updating existing, so was trying feather m0 express again, which led to the confusion

#

but limor wants to also switch to basing on feather rp2040 - so it's turned into a redo

#

code updates aren't huge, but will at least be known working with current hardware/CP release ๐Ÿ™‚

#

bonus - i can use keypad now for button reads. helps simplify things

slender iron
#

๐Ÿ‘

tidal kiln
#

๐Ÿ‘ yep. thanks again for taking a look.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.3 on a Raspberry Pi Pico W with an Adafruit 4682 "Micro SD SPI or SDIO Card Breakout Board" and Adafruit 4830 "MPR121 12-Key Capacitive Touch Sensor Gator Breakout" (although the MPR121 likely has nothing to do with this, it was just part of my build).
Audio is clipped to the 3.5mm audio plug of a simple hamburger speaker.
Issue may be with sdcardio and audiomixer, but am unsure.
Audio files used are at:
https://bit.ly/circui...
manic glacierBOT
#

Fix for #7670

Writes over 64Kb were failing as that is the maximum a DMA write can handle.

Possible other fix would involve chaining DMA transaction buffers but the break between buffers was about 3 microseconds so probably not an issue.

This could be moved into dma.c but then would have to be careful about QSPI (which has this problem but at 4x the size). This was the easier place to put it in, but open if we want to modify it too. It seems only SPI/QSPI uses the routine in question.

manic glacierBOT
tidal kiln
#

@lone axle ping. not urgent.

lone axle
tidal kiln
#

note - they're also struggling with a basic string formatting issue, which is causing the text overlap stuff, but can ignore that

lone axle
#

Yep will take a look

tidal kiln
#

i couldn't recreate this on a magtag

#

and my 2.13" EPD breakout is old enough to be different than currently shipping version

#

so can't test directly ๐Ÿ˜ฆ

tidal kiln
lone axle
# tidal kiln thanks!

The only bit that I am slightly suspicious of are the things like:

humidity_icon.pixel_shader.dither = True
humidity_icon.pixel_shader.convert(0)

I don't quite understand how dither will effect the drawing yet. I wouldn't think it could cause the black box thing, but might be worth trying without.

the call to convert(0) as far as I can tell wouldn't do anything, though I would assume it also wouldn't do anything bad. My understanding is that is like a 1 time conversion that takes an int in and gives another int back out. Since the return isn't being stored or printed or anything it essentially just does it's operation and then throws away the answer.

#

The text migrating to the right is something I've never seen before. Total shot in the dark but it makes me wonder if maybe there is a specific hardware rev where the display and/or driver is slightly different and needs something tweaked in the start sequence. If something is off by a small amount maybe there is some cumulative effect building up over time?

tidal kiln
#
As of May 9, 2021 we're selling a version with SSD1680 chipset, instead of the SSD1675 chipset. Firmware code will need to be updated as they are not code compatible.
#

i was wondering same. but their code is at least using SSD1680.

lone axle
#

I think the only things I've got with similar screens are magtag, and a very old pimorni phat 2.13" I'm not sure of it's exact model, the driver code references SSD1683 which is similar at least.

#

Is there any down side to trying the other 1675 driver? Can it damage the display? If not that is worth a try. Their pictures look like the old one to me more likely

#

with blue PCB makes me think older

tidal kiln
#

good question. i am assuming it's the newer rev, simply based on date of post.

#

and i'm not sure of behavior when using 1675 with 1680

#

doubt it'd damage it. but would it even produce output?

#

or 1680 with 1675

lone axle
#

Coincidentally I was testing some eink drivers recently. In my case one of the wrong drivers produced garbled output on the display, and a different one of the wrong drivers had no visible effect. So I assume it depends on how similar the protocols are, some are probably close enough to work to some extent.

tidal kiln
#

yep

#

ok. thanks for taking a look.

#

felt like something that'd be obvious, but was just overlooking

#

in code

lone axle
#

Maybe they can post a photo of the back side as well. If there are any identifying marks that could help figure out which one they need.

Code looks good to me apart from the two things I mentioned, but I think its unlikely those contribute to the behavior they are seeing.

weak jay
#

its weird making a PR that has code I don't fully understand but works xD

tulip sleet
weak jay
#

Yeah and I can imagine a discontinued product is not something people will be able to easily test

#

That said, I link to code than emulates the displays in a terminal. I wonder if I can add that to the PR to make it easier for folks to visualize and test...

lone sandalBOT
solar whale
#

@slender iron adapted your bangle2 demo to the CPB with gizmo!

slender iron
#

nice!

#

love cp code portability

solar whale
#

It really is nice. This only took a few minutes to do.

manic glacierBOT
lone axle
still zephyr
tidal kiln
still zephyr
#

Yes, indeed, however, nothing similar to the post. LEt me know if you need more help I do have the display

still zephyr
#

let me check I think is the old one... give me 5 minutes

#

Not sure how to identify them

tidal kiln
#

unfortunately, i don't think there's a way from just the board

#

but the invoice description at time of purchase would have had it in the text

still zephyr
#

ok, let me look in github I just did the example so I can take a look..

tidal kiln
#

ah. the older one. SSD1675.

#

they're using SSD1680 in post, per their code - and at least not getting diagonal lines

still zephyr
#

yeah. let me know if you want me to test the code to see if I ahve the same behaviour

tidal kiln
#

thanks. i think the mix/match behavior is all at this point.

still zephyr
weak jay
#

Lemme see if I have one around or can adapt what i have for it

still zephyr
#

Thanks, Ill comment on the PR then.

slender iron
#

@tidal kiln I've had good luck reading the printing on the eink display ribbon to know what version of the display it is

slender iron
#

I wish I could read markings on the driver ic ๐Ÿ™‚

manic glacierBOT
manic glacierBOT
meager fog
halcyon breach
#

Where is the out-of-tree extension module documentation for circuitpython?

stuck elbow
halcyon breach
#

oh, it looks like it still works the same as micropython with USER_C_MODULES directories and -DMODULE_name_ENABLED=1

stuck elbow
#

by accident

halcyon breach
#

Know anything about tracking down sources that create undefined reference to _close ; oh, figured out I can define it with a global int as a hack, as long as it doesn't get called.

manic glacierBOT
#

This is a rough start on an Opus audio codec extension for circuitpython, which is an excellent audio codec. It expects https://github.com/dholth/arduino-libopus to be checked out next to the circuitpython checkout. Not sure it has a place in circuitpython in this state, but it might be interesting to someone. This began as a micropython extension, but crashed on-device when instantiating oggz.oggz(f), and I haven't investigated that with a JTAG probe.

Usage

import oggz
nyan = o...
manic glacierBOT
manic glacierBOT
#

I have finished reading the cp source for all stack code (pystack, cstack, heap).
The C stack is allocated before pystack. Starting from main.c:416, function stack_resize calls supervisor/shared/stack.c:75 which in turn calls :46 function allocate_stack.
This function is similar to the other stack allocations, using allocate_memory for a generic supervisor_allocation.
As a reminder allocate_memory is 'safe'. Populated in supervisor/shared/memory.c:233, it uses `allocate_mem...

manic glacierBOT
#

The following build is latest master, built manually cuz I just reinstalled my desktop and was testing it.

[bill88t@KeyFalse | espressif]> time beetle-cleanmake
[ ... ]
real    0m41,789s
user    4m51,394s
sys     1m18,136s

Quite a bit faster than my pi400.

Reproduced on C3, with a pystack of just 2000!!

Adafruit CircuitPython 8.1.0-beta.0-4-g8a1006999 on 2023-03-04; DFRobot Beetle ESP32-C3 with ESP32-C3FN4
>>> def test(no):
...     print(no)
...     try:
...  ...
brazen hatch
#

Just 2k pystack is enough to break C3.. smh..

#

Well, doesn't C3 have jtag built in? I can prolly debug that

#

Now onto setting openocd on a new machine..

stuck elbow
#

ugh openocd

brazen hatch
#

What about it?

#

Don't I use jtag with openocd?

#

I only know swd, so it's new to me.

stuck elbow
#

it's one option

#

not great

brazen hatch
#

Well, what would you suggest then?
I'm open to testing more stuff.

#

I have time at my hands.

stuck elbow
#

pyocd is nicer, black magic probe is probably an option too

brazen hatch
#

.startswith("py"), i'm all for it.

#

ah nice, it's a pip module

#

Huh, there doesn't seem to be plenty of docs for it.

#

No built-in target for any espressif

stuck elbow
#

aww

#

sorry then

brazen hatch
#

no problem, I will setup openocd now, and try more later

#

black magic probe looks cool, but pi400 can literally do all that

#

esp32c3 has built-in jtag, You plug it in, you get serial + jtag immediately

#

it seems to have an openocd target already

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.3 on 2023-02-23; Adafruit Feather ESP32S2 with ESP32S2

Code/REPL

>>> import wifi
>>> wifi.radio.connect(ssid="myssid",password="0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef")
Traceback (most recent call last):
  File "", line 1, in 
ValueError: password length must be 8-63
>>> wifi.radio.connect(ssid="myssid",password=b'\x01\x23\x45\x67\x89\xab\xcd\xef\x01\x23\x45\x67\x89\xab\xcd\xef\...
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Is there anything beyond RUN_BACKGROUND_TASKS; that is needed, or could be used inside of the main while loop in that function to allow it to bail early if/when the user does ctrl-c?

I added RUN_BACKGROUND_TASKS; here:

https://github.com/adafruit/circuitpython/blob/0ca6cc7741103ced6e2c35fb3d7da708fb030d7f/shared-module/bitmaptools/__init__.c#L377-L378

That does allow the device not to disconnect while the function is running.

However I noticed if I press ctrl-c while it's runn...

manic glacierBOT
#

attempt to resolve #7485

Added code to run background tasks and bail if interrupted.

Tested successfully on PyPortal Titano with the reproducer code in the issue.

This resolves the problem of getting "stuck" during the fill, but the underlying crux is that boundary_fill is fairly slow for filling large spaces. The current implementation is based on this https://en.wikipedia.org/wiki/Flood_fill#Moving_the_recursion_into_a_data_structure There some other more efficient algorithms dis...

manic glacierBOT
manic glacierBOT
brazen hatch
tulip sleet
brazen hatch
#

Hmm, but 8.0.3 isn't in the folders?

#

8.0.0 is there, 8.0.2 is there, 8.1.0 dailies are in, but no 8.0.3

#

This is what confused me and I asked..

#

Anyways, thanks!

#

It's amazing how complicated constructing those urls is. Honestly more complicated than before

#
if sys == "Linux":
 url += "linux-"
 appen = ".static"
 if mac == "aarch64":
   url += f"{mac}/mpy-cross-linux-aarch64-"
   appen += f"-{mac}"
 elif mac == "x86_64":
   url += "amd64/mpy-cross-linux-amd64-"
 elif mac == "armv7l":
   url += "raspbian/mpy-cross-linux-raspbian-"
   appen += f"-raspbian"
 else:
   raise UnsupportedMachineError(f"{sys}_{mac}")
 url += f"-{version[0]}.{version[1]}.{version[2]}"
 if special is not None:
   url += f"-{special}"
 url += appen
 del appen
#

Ah yuesh

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.2 on 2023-02-14; Adafruit Feather ESP32S2 with ESP32S2

Code/REPL

import wifi
# 1 - give it an AuthMode
wifi.radio.start_ap(ssid='Wireless', password='wireless', authmode=wifi.AuthMode.WPA2)
# 2 - give it an AuthMode inside an iterable list to make it iterable as requested
wifi.radio.start_ap(ssid='Wireless', password='wireless', authmode=[wifi.AuthMode.WPA2])

Behavior

1 - It refuses and reque...

stuck elbow
#

hmm, why not add it to a list and do a "".join() at the end?

brazen hatch
#

uhh, I'm kinda hesitant doing fancy stuff on desktop python cuz my brain breathes circuitpython and I have forgotten the differences.

tulip sleet
tulip sleet
manic glacierBOT
brazen hatch
#

Huh, macos mpy-crosses are the only without .static, how weird and incosistent. My brain hurts as to why.

tulip sleet
#

I think the changes of location were on main, not 8.0.x, I didn't realize there weren't missing completely. So the 8.0.x branch is putting them in the old locations. The 8.1.0-beta.0 ones are in the directories?

tulip sleet
#

how about beta.0?

brazen hatch
#

here url

brazen hatch
#

Perhaps it would be a good idea to move the files in the folders manually for 8.0.x.

#

Or else the new code will be the one failing.

tulip sleet
#

maybe, I have to see what THonny wants

brazen hatch
#

My code has a hardcoded url if all other fail.

brazen hatch
#

So it shouldn't matter much for mine.

manic glacierBOT
warm stump
#

First stage of scanning the pinout of circuitpython8 running on the arduino mkr vidor 4000,
there's a bunch of peripheral documentation that's missing or hidden that can't be found on any other board(s)
it thinks its a feather m0 basic proto so some of the required pins are missing. long story short, it might be worth uploading circuitplayground express support onto it instead
because it has the pins already defined in the board module with no changes required

lone sandalBOT
manic glacierBOT
#

I would suggest to use USB_VID = "0x2E8A" (that's the Raspberry Pi foundation) and USB_PID = "0x000B" (that's Circuitpython firmware - according to https://github.com/raspberrypi/usb-pid ). On this page it states in the second sentence after "Use of the IDs" that "In general, the only reason to require one is because Windows uses the product ID to select a vendor-specific driver for a USB device." And from USB's perspective it is just connected to a rp2040, and gets some subfunction...

#

@erongd @dhalbert @tannewt I would suggest to use USB_VID = "0x2E8A" (that's the Raspberry Pi foundation) and USB_PID = "0x000B" (that's Circuitpython firmware - according to https://github.com/raspberrypi/usb-pid ). On this page it states in the second sentence after "Use of the IDs" that "In general, the only reason to require one is because Windows uses the product ID to select a vendor-specific driver for a USB device." And from USB's perspective it is just connected to a rp2040, and gets...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.3 on 2023-02-23; Adafruit Grand Central M4 Express with samd51p20

adafruit-circuitpython-grandcentral_m4_express-en_GB-8.0.3.uf2
update-bootloader-grandcentral_m4-v3.15.0.uf2

Code/REPL

import displayio
import rgbmatrix
import board
import framebufferio
from adafruit_bitmap_font import bitmap_font
from adafruit_display_text.label import Label
import digitalio
import busio
import sdcardio
import st...
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Hi,

This PR solves: aeios.AES.rekey() is not documented #7435

a) Documented the aeios.AES.rekey() function
b) Refactored the arguments validation. Please let me know if that was the idea of "canonicalize arg checking".

Tested with adafruit_feather_rp2040 with the following code:

import aesio
import os
from binascii import hexlify, unhexlify

plaintext = unhexlify("6bc1bee22e409f96e93d7e117393172a")
key = unhexlify("2b7e151628aed2a6abf7158809cf4f3c")
iv = unhex...
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0beta0 on Adafruit Pyportal

Code/REPL

// Designed to decode images up to 480x320

Behavior

When gif is larger than screen, error occurs. Is this an exert? Should it throw an error or display the upper left portion of the gif?

Consider documenting on readthedocs compatibility with palletized colors vs. embedded colors. I tried reducing with a palette early on and it didn't take it. That's fine but...

manic glacierBOT
#

While doing some other work with my Saleae, I noticed large SPI transfers had a gap every 4Kb for about 300 microseconds. Over larger transfers this delay adds up and becomes more apparent the faster the SPI frequency as the delay is constant vs frequency.

This PR adds multiple transaction queuing. The current implementation sends 1 transaction at a time. In the linked [IDF example](https://github.com/espressif/esp-idf/tree/af805df3cb6117cc74f0875831fbab6446824453/examples/peripherals/spi_...

manic glacierBOT
manic glacierBOT
#

Just thought I'd let you know that the LSM6DSO has both I2C and SPI support and I am using it with SPI. I still get the hang. I suspect it happens if my code is at some stage of communicating with the chip while being OTA upgraded causing a reset of the MCU or being reprogrammed with a debugger at the "wrong time". I have not been successful in recovering without interrupting the LSM6DSO power as it does not have a reset pin.

manic glacierBOT
#

I'm not sure why the unix port build is failing. It reports this error:

../../shared-module/bitmaptools/__init__.c: In function โ€˜common_hal_bitmaptools_boundary_fillโ€™:
../../shared-module/bitmaptools/__init__.c:380:9: error: โ€˜RUN_BACKGROUND_TASKSโ€™ undeclared (first use in this function)
  380 |         RUN_BACKGROUND_TASKS;
      |         ^~~~~~~~~~~~~~~~~~~~

Which seems like perhaps there is a missing #include that is needed. But I'm not sure which one if that is the case...

#

Order shouldn't matter, but I'm wondering if the unix port is not compiling the other files with RUN_BACKGROUND_TASKS. The most likely one to be compiled is shared-module/os/__init__.c. You can try putting an #error in that file and see whether it gets hit when you do the unix port compile. if it does get compiled, then check what that includes and how, and try to replicate.

#

I don't think it's so likely this is an electrical problem, but rather it's a timing problem. Running an RGB Matrix requires real-time updates of the matrix, and missing an update can create flicker. It takes about 1/3 of the CPU to do it. It's done at interrupt level, so it should be capable of overriding most other things going on. but writing to an SD card may add uninterruptable things, or may cause contention that introduces latency and therefor flickering. We'll need to do some instrume...

lone axle
#

Whoa, is it a new feature for Github to show actions failure error messages intermixed inline with the code on the 'files changed' page? I've just found one that is showing the error messages at the offending lines.

manic glacierBOT
manic glacierBOT
turbid radish
#

@lone axle the newsletter is ready to crib from for the Discord meeting notes

lone axle
#

Thank you

slender iron
#

@brazen hatch C3 is risc-v cored and pyocd is arm-only atm

analog bridge
manic glacierBOT
lone axle
manic glacierBOT
lone axle
#

<@&356864093652516868> Apologies for not getting a ping out sooner, but the weekly meeting is set to begin here on discord in just a few moments.

onyx hinge
#

and some of us arriving from our internal meeting which just finished .. I'll be back in a few moments

#

https://blog.adafruit.com/2023/02/28/circuitpython-8-1-0-beta-0-released/
Add animated GIF support: gifio.OnDiskGif.
Add safemode.py, for programmatic handling of safe mode.
Add 7-color e-ink display support.
Allow setting pystack size in settings.toml.
Add dither support to Palette.
Support array.extend(iterable).

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

From the GitHub release page: This is CircuitPython 8.1.0-beta.0, a beta release for CircuitPython 8.1.0, and is a new unstable release. Notable changes to 8.1.0 since 8.0.0 Add animated GIF supporโ€ฆ

#

[not 100% sure if this is who you were talking about but note Kyoshii's pronouns on discord are [she/they]]

midnight ember
#

oops

turbid radish
#

๐Ÿ˜

midnight ember
#

Never realized

#

The 7 color stuff on the stream was really neat.

onyx hinge
#

heh and I even wrote the wrong thing first just now. headdesk

#

the important thing is to do one's best and correct when wrong ๐Ÿ™‚

midnight ember
#

thanks for fixing that for me ๐Ÿ‘

turbid radish
#

Oh no

midnight ember
#

๐Ÿ˜ฆ

onyx hinge
#

@lone axle that is a "flood fill" algorithm?

lone axle
midnight ember
turbid radish
#

Great!

midnight ember
onyx hinge
#

that's exciting @timid bolt ! which microcontroller ?

timid bolt
#

rp2040

midnight ember
#

that sounds awesome gneverov!

#

zork style game built with and meant to be played with chatgpt? that's deep.

#

wait, feather m7 or mispoke?

onyx hinge
#

@midnight ember not sure what I said, I meant metro m7

still zephyr
#

๐Ÿ™‚

onyx hinge
midnight ember
#

oh i missed that one

#

will read for sure

timid bolt
#

I found out about veneer functions this week too when adding mp3 decoding functions to ram

midnight ember
#

Will do Scott. Spinning the tires on the iMX, can't wait!

slender iron
#

@timid bolt I've got some elf based tools that can tell you what a function references so you can decide to move deps too

timid bolt
#

it's tricky because adding a function to ram, although it makes itself faster, it makes all the functions that call it slower because of the veneer ๐Ÿคฆโ€โ™‚๏ธ

slender iron
#

yup, damien mentioned that too

#

is there any magic that could put it in two places?

midnight ember
#

Maybe leave it in there as an alias, don't know if that's possible, as a slow phase out instead of a hard deprecation?

lone axle
slender iron
onyx hinge
#

7.2+ support the root_group property

midnight ember
#

There are still some examples in read the docs still using examples as far back as like 7x i think. Breaking old examples especially stuff from read the docs would be concerning from a support perspective at the very least.

onyx hinge
#

er my mistake, it's not settable in 7.2 / 7.3.

ember iris
#

Is there daylight savings in the US between then and now?

slender iron
#

normal time next week

still zephyr
#

Thank you!

turbid radish
#

Thanks Tim!

ember iris
#

Thank you all!

midnight ember
#

Thank you for hosting @lone axle

lone axle
slender iron
#

@timid bolt pushed my changes to elf-section-graph

onyx hinge
#

Yes, next week the parts of the US that observe DST / "summer time" switch, making the meeting "2PM in UTC-4", whatever that means to you.

errant grail
midnight ember
#

@errant grail Was more an act of desperation after hours of fighting against 20W ear shattering squelches. It just worked. Will still end up playing with the mp3 decoder board for sure though.

errant grail
#

Will it still work without shorting the minus output to ground, leaving the cap between plus output and ground? Iโ€™d be concerned about overloading the negative side of the ampโ€™s h-bridge.

midnight ember
#

Not sure I follow. You wouldn't want to use only the positive side of the cap and leave the ground floating.

errant grail
#

Keep the cap between plus and ground but donโ€™t connect the amp neg output to anything.

midnight ember
#

The 20W amp uses a 5mm 12V barrel jack. By unplugging that the sound won't be amplified then and you're sending 3W into the unpowered amp which I'm sure it can handle np.

errant grail
#

Shorting the neg output to ground would unnecessarily heat up the amp chip. The output is basically like a floating h-bridge motor controller.

midnight ember
#

which amp chip the 3w or 20w?

errant grail
#

Only use the 3w ampโ€™s positive output.

midnight ember
#

i played bartlebeats for 24 hours straight np. :/

#

didn't feel the chips though

#

the 3w chip is upside down on the protoboard, i can't get to it with a finger.

#

i didn't amplify it to full volume though, maybe 50%

errant grail
#

Itโ€™s overheat protected, so it should survive. Might shutdown on a hot day.

midnight ember
#

will keep an eye on it this summer in the 105F and 100% humidity workshop.

errant grail
#

Yeah, global warming and all.

midnight ember
#

heat torture testing is just a product of my natural environment lol. i've killed sooo many routers they just can't handle the ambient heat in a garage.

errant grail
#

I finally put in a split heat pump out there. Can work in comfort but canโ€™t stress test stuff as easily.

midnight ember
#

i will keep an eye on it thank you for the advice. i honestly have no idea what i'm doing. it worked so i'm happy.

lone axle
#

Here is the notes document for next Mondayโ€™s CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Note that these timezones will be observing a time change for daylight savings prior to the next meeting. 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/1NZeAkPhnhUytsVP1rKAScEsxPWYmZC2s7yNt4Eqj_cU/edit?usp=sharing

errant grail
midnight ember
#

I'm not sure if it's acting like a coupling capacitor or decoupling capacitor. I should probably go do some research.

timid bolt
#

@midnight ember I'm a little bit skeptical of your 1000 uF capacitor solution. 1. electrolytic caps are polarized, so it's a little sketchy putting them across the differential output, 2. 1000 uF is basically a short circuit at audio frequencies, 3. the 20 W amp is a high impendence load, so it is not at all like a string on Neopixels.
I'm not familiar with the product or what the gain pin does. But you would probably want a 100k resistor in series with the 20 W amp, as the board is probably outputting 3-5 V which is too high for the amp.

errant grail
midnight ember
#

Ohh I could have wired up each leg to the positive only is that what you're saying?

#

Haven't tried that, or for the negative side though it shouldn't do anything on the negative side hopefully.

#

This calls for more experimentation ๐Ÿ™‚

errant grail
#

We should move the discussion to the hardware channel and free this one for software dev.

timid bolt
#

what's the hardware channel called?

manic glacierBOT
#

Normally I'd agree with you @Panometric, but real world experience has thought me differently. This also why I do have transistor-controlled supply to some SPI or I2C devices that lack reset pin (@dhalbert). On I2C it is even harder as they can be back-powered by the I2C pullups making it very annoying.
Feeding extra clock cycles seem to work for some devices on I2C but not all in my experience.
In my case the CS is indeed being controlled and I have verified this with a oscilloscope. Yet, ...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0-beta.0 on 2023-03-01; RP2040-LCD-1.28

Code/REPL

#code from docs

start = time.monotonic()
odg.next_frame() # Load the first frame
end = time.monotonic()
overhead = end - start

face = displayio.TileGrid(
    odg.bitmap,
    pixel_shader=displayio.ColorConverter(
        input_colorspace=displayio.Colorspace.RGB565_SWAPPED
    ),
)
splash.append(face)
main.append(splash)

Behavior

Tra...

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.3 on 2023-02-23; Adafruit Grand Central M4 Express with samd51p20

adafruit-circuitpython-grandcentral_m4_express-en_GB-8.0.3.uf2
update-bootloader-grandcentral_m4-v3.15.0.uf2

Code/REPL

class HiscoreController:
    def __init__(self):
        pass

    def hiscore(self):
        spi = busio.SPI(board.SD_SCK, board.SD_MOSI, board.SD_MISO, baudrate=500000)
        sdcard = sdcardio.SDCard(spi, board.SD...
#

It looks like in your code you are supplying the baudrate= argument to busio.SPI rather trhan sdcardio.SDCard.

Note that usually it would be recommended to set up the SD card once, and to use a mount point like '/sd', but while this would be good to keep in mind it doesn't seem to be related to the specific exception that your code caused.

The forums or our discord are better places to ask for help with your circuitpython programs.

#

A couple of comments here:

  1. Depending on the GIF if it uses the "Restore to previous" disposal method that cannot be fully supported in CircuitPython. In that method the drawing routine is supposed to remember what was behind the GIF before drawn so would require two frames to be stored in memory. For most microcontrollers that isn't practical as it doubles memory requirements.

  2. What can be done is to ensure the transparent background is a set color. @FoamyGuy (can you share your code...

#

Nothing in circuitpython supports transparency directly. User code must use make_transparent() function of Palette or ColorConverter in order to achieve something akin to "green screen" transparency. You can set the color you want to represent as transparent and displayio will omit drawing pixes of that color, allowing whatever is beneath them to be seen.

I was just looking back at the VOD to figure out how that ended up working, as it does require some quirks in the user code.

I used t...

#

It looks like in your code you are supplying the baudrate= argument to busio.SPI rather trhan sdcardio.SDCard.

Note that usually it would be recommended to set up the SD card once, and to use a mount point like '/sd', but while this would be good to keep in mind it doesn't seem to be related to the specific exception that your code caused.

The forums or our discord are better places to ask for help with your circuitpython programs.

ah mind was in daze readin...

timid bolt
#

I was absent last week, was there ever a definitive resolution on what's causing the esp settable pystack crash?

manic glacierBOT
manic glacierBOT
#

I updated this with 2 small changes:

  • changed the int docstring type to ReadableBuffer
  • added a basic example of usage of the function

It seems good to me at this point (pending actions result). Allowing lists or tuples for the points would be a "nice to have" imo, but doesn't need to hold this back.

I retested the latest version on a Feather ESP32-S2 TFT with the example code that was added to the docs.

#

@ryatkins what device are you running it on? It may be the case that there isn't enough RAM in order for it to render it as-is

That is much larger than any GIFs that I tested.

The only idea I can really offer is try to lower the size of the gif. ezgif.com has some compression functionality including possibly scaling the image down some. If you make the source gif smaller but still want to display it larger on the display you could try using scale=2 or some other value on the Group th...

#

Iโ€™m on a Waveshare RP2040-LCD-1.28

Thanks for giving it a try.

How was the performance of the animation?

On Mon, Mar 6, 2023 at 6:18 PM foamyguy @.***> wrote:

For what it's worth, I downloaded that gif that you posted and I am able
to render it as-is on a Feather ESP32-S2 TFT, although it's bigger than the
size of the built-in display, so not everything is actually visible.

If you have access to ESP32-S2 based device it may be worth trying on
there.

โ€”
Reply to this...

timid bolt
manic glacierBOT
#

That looks very nice and usable. It seems the ESP32-S2 has more RAM.

It tried to do the same type of animation with drawing vectors and ran into
RAM issues as well.

What would be really interesting is if CircuitPython supported svgs and svg
animations!!

On Mon, Mar 6, 2023 at 6:46 PM foamyguy @.***> wrote:

@ryatkins https://github.com/ryatkins I didn't do any timing or real
measurements, but anecdotally it seems pretty good to me:

Screencast from 03-06-2023 05:42:42 PM.web...

manic glacierBOT
jaunty juniper
#

oh I didn't know that it was possible to mount an SD card as / (it hides the contents of CIRCUITPY until reload as I guess one would expect if it doesn't error)

vfs = storage.VfsFat(sd)
storage.mount(vfs, "/")
stuck elbow
#

docker for circuitpython when

stuck elbow
#

I meant inside circuitpython

tulip sleet
#

oh lol

jaunty juniper
#

we could look at what it takes to run mpremote mount it's quite a fun feature

slender iron
slender iron
timid bolt
slender iron
#

haven't looked. ๐Ÿ‘€

#

looks like it should be checking the cstack

timid bolt
slender iron
#

do you want to propose both or split them apart?

timid bolt
#

I think we need to have a discussion about PR strategy. I proposing a large breaking change: how would you evolve the product while maintaining backward compatibility.

slender iron
#

generally we have one major release that supports both apis

timid bolt
#

If there's a new api, does it have to be implemented on all ports? Is there a minimum viable set of ports that a feature should be implemented on?

slender iron
#

No, it doesn't need to be on all ports. Starting with one is ok.

manic glacierBOT
timid bolt
#

Every week if I produce a new PR of code, you probably don't want to keep reviewing the sum of that against main. So can work-in-progress start being merged into adafruit/main?

manic glacierBOT
slender iron
#

we do have to be aware that folks will start using new apis so we'll want to be clear about stability

timid bolt
#

Right. That's why I think we need to discuss that to work out a strategy.

#

For example, look at the PRs I have and triage how to merge different part of the functionality.

slender iron
#

I'm happy to do that

timid bolt
#

Great! Would you prefer to do it collaboratively, or asynchronously through PR comments?

slender iron
#

video may be easier

#

or "in the weeds" during the weekly if the timing lines up

timid bolt
#

Cool. Let me know when you want to do that. I'm going to be out on Monday (3/13) though.

slender iron
#

I can in 15 min or so

timid bolt
#

Sure. Amelia Earhart at 9:30.

slender iron
#

@tulip sleet and @onyx hinge can join if they want too

onyx hinge
#

I won't be able to but thanks for the invitation!

timid bolt
#

I'm happy to resched so you can all comment

manic glacierBOT
#

Do I need to treat this new table of interrupt information as a GC root? in some weird case (like if you don't save your IncrementalEncoder object anywhere, i.e., a bug) it might be the only thing that would keep the object alive.

I think you can use MP_STATE_PORT or use a finalizer to stop the interrupts when the object is GCed.

I added the pin change pointers to gc root. Let me know where the pin change infra should go, if not in Pins.c. I envision that it would be shared with o...

analog bridge
#

@slender iron Isn't it better in terms of navigation to separate the reusable from the rest? Ideally, I'd want github to not show them at all.

slender iron
#

I don't think reusable means anything outside of this pr

analog bridge
#

will a _ prefix work?

manic glacierBOT
slender iron
analog bridge
#

ya

slender iron
#

sorry @timid bolt and @tulip sleet for bailing. I forgot I had a mobile app meeting

manic glacierBOT
manic glacierBOT
#

So, it looks like this issue is caused by the placement of RUN_BACKGROUND_TASKS in socketpool_socket_recv_into() for espressif boards. When web workflow is active; the code:

    while (ringbuf_num_empty(&_incoming_ringbuf) > 0 &&
           _read_next_payload_byte(&c)) {

in websocket_background() means that after the test for ringbuf_num_empty is done, calling _read_next_payload_byte() can eventually result in background calls, thus ending up calling websocket_background() ag...

slender iron
manic glacierBOT
#

Also suspect that the delay leads to DC motor "rattling" when establishing a new motor speed at low PWM frequencies since the two PWM control pins aren't changed simultaneously.

Confirmed. At low PWM frequencies in slow decay mode, the delay causes a DC motor to noticeably chatter when switching between velocity zero and coasting (velocity = None) and back. Don't have a setup to test stepping motors, but would expect a similar issue.

slender iron
#

@tulip sleet it looks bleio_hci takes 500+ bytes of bss

tulip sleet
#

is that good or bad ๐Ÿ™‚

slender iron
#

bad? ideally it'd allocate the space when it needed it

#

(I'm looking at bss to make more space for heap on imx)

tulip sleet
#

5 connections by default

#

this is probably it:

// FIX size
#define RX_BUFFER_SIZE (3 + 255)
#define ACL_DATA_BUFFER_SIZE (255)

STATIC uint8_t rx_buffer[RX_BUFFER_SIZE];
STATIC size_t rx_idx;

STATIC uint8_t acl_data_buffer[ACL_DATA_BUFFER_SIZE];
STATIC size_t acl_data_len;
#

in hci.c

slender iron
#

bleio_module_globals_table is 0x98

#

two CDC endpoints is 4k

tulip sleet
#

i am a little fretful if i.MX 1011 is the new SAMD21

slender iron
#

it won't be due to flash

#

but for ram yes

#

1011 is about speed, not ram

timid bolt
#

hey @tulip sleet, the adafruit asyncio library is not a subset of the cpython asyncio, so replacing it with the latter would be a breaking change. So would you still want me to PR my cpython port into that library?

manic glacierBOT
#

spi_device_get_trans_result is blocking until the transaction finishes (when the delay is set to portMAX_DELAY). So we ensure all (up to) 10 transactions return before we move on.

The old code used spi_device_transmit which combines spi_device_queue_trans and spi_device_get_trans_result into one function call, resulting in the same functionality (but with 1 transaction instead of 10).

In the new way up to 10 (as needed) transactions are queued up and then the code waits until ...

tulip sleet
timid bolt
#

For simplicity, I would say that the MP asyncio api is not based on the CPython one at all. I agree porting the examples will be straightforward though, since they don't use much of the api anyway.

tulip sleet
timid bolt
#

For basic stuff it is the same. Advanced methods on Task may vary. CPython has Future. MP has Event, Lock, and Stream which sound the same but are different to CPython's classes of the same names.

jaunty juniper
#

I use Task.cancel(), asyncio.CancelledError, asyncio.run(), Task.done()

#

I used a lock when running multiple seesaw devices trying an async version of the seesaw library

#

(replacing the mandatory 8ms sleep with an async sleep, access must be protected against multiple reads on the same device)

tulip sleet
jaunty juniper
#

but yeah none of that is in the guides

tulip sleet
#

I would say we could skip providing a lot of the more historical stuff in CPython asyncio and still have somethign very usable. We could adapt to more CPython-like Event, Lock, and Stream

#

People can always use an older version of the library for their existing code if they do not want to rewrite it

#

that has been our philosphy about library updates. We are willing to make breaking changes, and we will rewrite all the Learn Guide code as needed.

timid bolt
#

Sorry, Lock and Event and CPython compatible, expect for the ThreadSafeFlag part of MP Event.

#

The CPython api is well layered, so I think it is easy to carve out a subset of it. Not sure which parts are consider "historical" still in 3.11.

tulip sleet
#

only my concept of "historical" ๐Ÿ™‚ , raw use of event loop primitives, non-task stuff, things like that. I want to promote tasks and TaskGroups

#

stuff that was in asyncio guides pre 2015-ish (not sure of the exact dates).

#

not a sharp breakpoint -- it's just that people got more structured about how to use async

timid bolt
#

Makes sense. I think they've cleaned up a lot of that now in the current release.

tulip sleet
#

@timid bolt do you see a big size difference?

manic glacierBOT
#

@jepler I have assigned myself #7595 and #7596. I will look at whether your changes to the cwy43 library are now incorporated. There are some interesting changes listed in the 1.5.0 release notes about cyw43:

Do you think these will make a difference?

Blocking cyw43_arch_wifi_connect_ functions now continue trying to connect rather than failing immediately if the network is not found.

[restructuring of pico_cyw43_driv...

timid bolt
tulip sleet
#

or, saying it a different way, what kind of code can't we write with the current library?

timid bolt
#

There is fat that could be trimmed from everywhere, but I wouldn't say there are chunks of things that can be removed. My motivation for porting from CPython was to get functionality quickly. I needed Future and some other things. Plus it is code that is difficult to get correct, so I didn't want to write it myself.

tulip sleet
#

so having Future and/or Awaitable?

#

you need plain Future instead of Task?

#

ok, there is no Awaitable

timid bolt
#

Yes, need Future. (Awaitable is not actually a class.) I think I had issues with the way MP Tasks worked also.

#

There is also better error checking and reporting in CPython's impl which costs a lot of code size.

tulip sleet
#

in the current doc:

Futures

A Future is a special low-level awaitable object that represents an eventual result of an asynchronous operation.

When a Future object is awaited it means that the coroutine will wait until the Future is resolved in some other place.

Future objects in asyncio are needed to allow callback-based code to be used with async/await.

Normally there is no need to create Future objects at the application level code.

#

emphasis mine

ornate breach
#

Iโ€™m curious if you could have asyncio and asyncio-classic to maintain functionality in the future?

tulip sleet
#

but you need it to write the api libraries you want to write?

ornate breach
#

Then it could be toggled per build or brought in as a library

timid bolt
tulip sleet
#

there are some optional C helpers, but they are invisible

ornate breach
#

I figured. I was just curious if it might be better to maintain two until thereโ€™s a reason to replace the current?

tulip sleet
#

for the average user, if we made this change, it would be upward compatible

#

the functionality we describe in the Learn Guide is the same

#

i was very careful to describe only the minimum in the Guide

#

mostly to make it easier to understand

ornate breach
#

Ah okay

#

I suppose it would allow for more portability of additional asyncio features in the future

timid bolt
#

Futures are needed for "driver writers" to create an awaitable method specific to their hardware. fwiw, the only thing you can pretty much 'await' in MP is sleep. There is no functionality for waiting on hardware, which is how they haven't needed Future.

tulip sleet
#

they have plans, with Event or ThreadSafeFLag, I think

timid bolt
#

I could certainly write a leaner version of CircuitPython asyncio that contains Future and the things I need. But I was quite comfortable borrowing from CPython and I didn't think 29 kB was a lot, considering the larger boards that this targets have MBs of flash, and the library unlocks a lot of potential for those boards to be able to multitask.

tulip sleet
#

so 29kb mpy, you mean?

timid bolt
#

Yes.

#

Also my guess is a lot of the bulk of CPython comes from error reporting, which is something everyone is willing to pay for when debugging async programs. ๐Ÿ˜‚

tulip sleet
#

i guess you already had to make some changes to get it to work

jaunty juniper
#

MB of flash yes, but not RAM, except some ESP32

tulip sleet
#

concurrent.future, contextvars, various decorators, etc.

#

i have to go back and look at your code.

#

i was just looking in futures.py

timid bolt
timid bolt
tulip sleet
#

does the audio stream stuff we were talking about earlier depend on this?

timid bolt
#

Not the current PR because I haven't added async support for audio yet.

#

But any of my new async stuff I'm working on depends on this (e.g., PIO, audio, network, ultimately anything that does IO).

tulip sleet
#

Please go ahead and submit a PR to the library. That will get the code in one place. People can review it and try it, and we can see if its size is a problem in existing code. Maybe we can find some more to trim, or be able to avoid importing except in certain circumstances. We could even release it and put it in the bundle with a different name temporarily, maybe (we haven't done that kind of thing before). We may want to wait until 9.0.0 development to release it as the main library, since the things that would be used by the new libraries will not be in the core.
... Or we could make a temporary new library, asyncio2 or nasyncio or something like that ... We'll talk more about this internally to figure out how we might stage it all.

timid bolt
#

Sounds good. Thank you.

manic glacierBOT
orchid basinBOT
lone sandalBOT
stuck elbow
#

how big is the response?

#

(also, probably more of a help-with-circuitpython thing)

small trellis
#

the response is a single list (shade position, mac address, status success/fail), maybe some other stuff. Under 100 characters for sure

#

Posted it in help-with-circuitpython and was told to come here, I don't mind being ping ponged back and forth but just not sure where this script behavior falls

stuck elbow
#

ah, sorry

#

this channel is mostly for topics related to development of the circuitpython firmware itself

tulip sleet
small trellis
#

OK- I'll delete the question from here to keep it clean

timber mango
#

hi, with the risk of asking a profane question - are there any up to date guides on extending circuitpython with your own C based shared module out there? The only one I found is related to 4.x.x and is not really complete. I'm trying to port an existing one wire bus protocol to circuitpython / esp32. Thanks!

stuck elbow
#

there were some changes recently

timber mango
#

@stuck elbow any project that i can use as a blueprint?

#

Is there a location I can find those changes or do I have to scroll through the changelog?

stuck elbow
#

I think the most recently added new module was the analogbufio, perhaps you could look at that pull request

timber mango
#

Thanks, will do that.

#

I have one general question - does every c and h file require the micropython wrappers or can I write just one exposed file that accesses other source files in the background?

stuck elbow
#

I think it's your judgment, whichever seems clearer, but the reviewers may disagree...

#

if it's 3000 lines of a single file, you will be asked to split it, for example

timber mango
#

I see, makes sense - thanks for the heads up

tulip sleet
timber mango
#

@tulip sleet I did look into the onewire code, but no it is not really similar, unfortunately

tulip sleet
#

if it's specialized we might accept it but not turn it on by default if it's not widely used

timber mango
#

it was meant to be used privately only, but it's based on LIN so I might be able to PR that part of it, but I was not planning to for now

tulip sleet
#

if it's just bitbanging, you can copy shared-bindings/onewireio and shared-module/onewireio and just replace the bitbanging guts. Or just copy OneWire in both of those and make a new class. We always start by copying an existing module or class. That gives you a starting point for all the boilerplate. The actual implementation might be rather small.

#

you will need to add your module or class to various makefile lists in py/circuitpy*. Look there for where the existing onewire file references are and duplicate it.

timber mango
#

thanks for that advice - it is requiring some IRQ handling because of tight timings, not sure if bitbanging would be sufficient for that - I will have a look

#

Oh one question that just came to my mind - if I make the project it usually complains that I need to be on a specific version for build. Is there a way to disable this check while developing?

tulip sleet
timid bolt
timber mango
#

@tulip sleet I might be dreaming, but on my first test build make complained asking me to checkout a specific tag instead of building directly within the main branch - However, running it now again it does not seem to complain so nvm my question ๐Ÿ˜…

tulip sleet
#

๐Ÿ™‚ np

#

it's not cosmic rays -- there's always a reason, but we can ignore that for now until/if it shows up again.

timber mango
#

Yes I'll let you know if I ever see it again!

jaunty juniper
timber mango
jaunty juniper
#

the esp-idf also complains about tags every time you install or source it, with no consequence though, you have to look for it to notice it

fatal: No tags can describe '630c2724fc8c69eeaaa1bb025de52b99c5cb11aa'.
Try --always, or create some tags.
WARNING: Git describe was unsuccessful: b''
tulip sleet
#

@onyx hinge I am trying to revert to using the cyw43 driver inside pico-sdk. I'm confused because there are multiple mbedtls directories floating around: circuitpython/lib/mbedtls, ports/raspberrypi/sdk/lib/mbedtls, ports/raspberrypi/mbedtls, an also circuitpython/lib/mbedtls_errors, which is not elsewhere. Could you explain which to use? I'd assume I'd want the one inside the sdk for now, but it looks like you use mbedtls_errors for something.

#

also we use the certs from the top-level lib directory

onyx hinge
#

@tulip sleet oof it's a bit of a mess isn't it.

#

@tulip sleet lib/mbedtls is what the picow build actually uses. it matches micropython. sdk/lib/mbedtls is not intended to be used at the current time.

lib/mbedtls_errors is also from micropython and has to do with converting mbedtls errors into exceptions with terse text. It's used.

ports/raspberrypi/mbedtls is the worst named thing. It has (A) our mbedtls settings for picow and (B) a copy of the esp certficate handling code that allows it to use the same nina-fw certificate store

tulip sleet
#

so it really might be mbedtls_config

onyx hinge
#

micropython seems to tend away from using nested submodules where possible, and of course it's also using just one copy of mbedtls and lwip across multiple boards ports

tulip sleet
#

sdk/lib/mbedtls is not intended to be used at the current time.

onyx hinge
#

sure, it could be renamed mbedtls_config, and the certificate handling part would be in some other location (probably not in the port)

tulip sleet
#

what is wrong with the sdk/lib/mbedtls that pico-sdk has? Why would they bother if it's not used? Or is it for some pico-sdk wifi code?

#

i'm just worried the cyw43 drivers care, but if mbedtls is above them, then it doesn't matter, I guess

onyx hinge
#

oh also sdk 1.4.0 didn't have sdk/lib/mbedtls anyway

tulip sleet
#

in that case, I will just use the updated driver dir. Also I have to see if they fixed what you are using our fork for