#circuitpython-dev

1 messages ยท Page 257 of 1

raven canopy
#

import is definitely safer, and i think its probably better namespace-wise.

tough flax
#

Yeah, I don't like any of this... but I like running out of memory randomly even less

raven canopy
#

definitely. also, it doesn't help per se, but wrapping the read in a try...except and catching the MemoryError is an option.

tough flax
#
#This is a section for AAC Device Scanning
#It sends keycodes for 1-4 & Backspace and lights up blue
mode1 = Mode("Scanning", "#0000ff")
mode1.keyPress(1, "1")
mode1.keyPress(2, "2")
mode1.keyPress(3, "3")
mode1.keyPress(4, "4")
mode1.keyPress(5, Keycode.BACKSPACE)

mode1.modeChange((1,2),"Windows",2.0)
#

I could make a "config file" like that

#

The tuple in the last command means "switch 1 & 2 together"

#

The 2.0 means "for 2 seconds"

#

All of the methods could take that style - first is integer or tuple, then action, then duration of hold

#

Might be simple enough?

#

That would waste no memory on string management - it would all by done by the runtime at import time.

raven canopy
#

i don't consider it much more dificult than reading INI style, when putting my i've never seen either of these things goggles. documentation and support...those usually make up for confusion.

tough flax
#

Well, one nice thing is that the comments in this file won't hurt me... I found that parsing the COMMENTS in the .INI file blew through memory

#

Just allocation/fragmentation

#

So I could comment the hell out of it

raven canopy
#

there might still be a hit as a raw .py though. still needs to be parsed in RAM.

tough flax
#

Yes, but should be done in C, right?

#

And it should be tuned

raven canopy
#

๐Ÿค” hmm. i couldn't be sure without running it through the gc paces.

#

holy moly. its 10-to-2... i should go to bed. ๐Ÿ˜†

tough flax
#

Yeah 10-to-3 here ... me too

manic glacierBOT
simple pulsar
#

@tough flax I've found import order makes a large difference but is very unpredictable as to the effect. Have you tried this order at the top? ```import board
from digitalio import DigitalInOut,Direction,Pull
from time import sleep, monotonic

Also try swapping these two around

import adafruit_dotstar
import SettingsParser```

#

I tend to do the built-in libraries, then frozen libraries, then adafruit, then mine by default now

#

You can save a few bytes with brightness=1.0 too to avoid the second buffer that library makes for non-1.0 values. This is a bit insignificant when you only have 1 pixel but it sounds like you are desperate to save some bytes.

simple pulsar
#

You'll get a more predictable/well-timed file close and cleanup using a with statement for the file.open() but i'm not sure if that will ultimately make any difference.

onyx hinge
#

Can anyone check if this gives a weird error and puts their board in safe mode? ```>>> print(time.time())
Assertion 'MP_OBJ_IS_TYPE(self_in, &mp_type_tuple)' failed, at file ../../py/objtuple.c:254

manic glacierBOT
#

Otherwise, examples like the one attached to the related issue fail
because tud_hid_ready never returns true.

Testing performed: Adapted the example to nrf particle xenon (it was
handy), removed dependency on IR, verified that the problem occurred
before this change, and that it was fixed after this change.

Closes: #2048

My reproducing program:

from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
from adafruit_hid.keyboard_layout_us import Ke...
slender iron
#

@tulip sleet @meager fog @raven canopy GitHub got back to me and said their plan is a 60 job concurrency limit per org ๐Ÿ˜„

manic glacierBOT
raven canopy
slender iron
#

yup, exactly

#

@exotic pumice for now reproducing the busio.I2C module impl in rust would be interesting

onyx hinge
#

nice! let me know if I can help with the CI switch, I kid myself into thinking that sort of thing is fun

slender iron
#

I think once we had an example we'd potentially use it more

raven canopy
#

interesting. i imagine its backend is Azure. No doubt it will get further integration in the future.

slender iron
#

@onyx hinge I won't be able to take a crack at it until next week since I'm traveling

#

I do think it's worth doing sooner rather than later

onyx hinge
#

@slender iron no worries

raven canopy
#

yeah, i'm on board too. (as if that was a question. automation seems to be my jam). ๐Ÿ˜„

simple pulsar
#

@onyx hinge Any board? I've got Metro M4 plugged in.

slender iron
#

๐Ÿ˜ƒ well, if either of you do start it, then post here so we can build off of it

onyx hinge
#

@simple pulsar I was on a particle xenon, not sure if it's general or not -- might be tied to not having an rtc implementation come to think of it

#

@simple pulsar knowing it worked on a samd board would be great too

simple pulsar
#
>>> import time
>>> print(time.time())
946684946
>>> print(time.time())
946684951
slender iron
raven canopy
#

or even trigger builds on other CI providers, like CircleCI. nice! could even split up things across CI. e.g. build boards in Actions, run unix/docs/etc in Travis.

onyx hinge
#

@simple pulsar that is a good data point, thanks! I'll do a bit more testing here, but kinda suspecting it is specific to nrf

manic glacierBOT
#

While debugging an unrelated issue, I discovered that in master branch on a particle xenon, this hits an assertion failure:

import time
time.time()

The debugger says:

Breakpoint 1, __assert_func (file=0x8db34 "../../py/objtuple.c", line=254, 
    func=0x9a9b0 <__func__.12400> "mp_obj_tuple_get", 
    expr=0x8db0c "MP_OBJ_IS_TYPE(self_in, &mp_type_tuple)") at ../../main.c:486
486	    mp_printf(&mp_plat_print, "Assertion '%s' failed, at file %s:%d\n", expr, file, line);...
onyx hinge
#

yeah a metro m4 express with 5.0.0-alpha on it doesn't have the problem, so it's nrf specific, or samd51 anti-specific

exotic pumice
#

trololo I ran rust-bindgen on shared-bindings/busio/I2C.h and got back a 105908 line file. I think it generated bindings for all of circuitpython XD

manic glacierBOT
exotic pumice
#

and like all of asf

#

wheee

raven canopy
#

just realized this morning that audacity can create samples to test with mixervoice, so i can rule out downsampling noise quantization. ๐Ÿคฆ

exotic pumice
#

is this the pinmux macro used in common_hal/busio/i2c? #define PINMUX(pin, mux) ((((uint32_t) pin) << 16) | (mux))

#

convert to u32, shift left 16, or with the mux?

onyx hinge
#

@exotic pumice that's how I read it

exotic pumice
#

where is gpio_set_pin_function and friends defined?

#

it looked like ports/atmel-samd/asf4/samd21/hal/include/hal_gpio.h but there's too many levels of indirection

#

and my trail ended with an empty inline function in the hpl

#

I'm just gonna try to extern it based on the definition I found and hope the linker can figure it out later

onyx hinge
#

@exotic pumice I assume at ports/atmel-samd/asf4/samd51/hpl/port/hpl_gpio_base.h (or /samd21/) in a static inline void function

#

(so nothing that would end up with extern linkage, frustratingly for your use-case)

exotic pumice
#

why can't I extern that?

#

because static?

onyx hinge
#

hmph, looks like I'll have to wait to play with the gitlab CI, because I had not signed up for the actions beta and now I'm in what I'm sure is a lengthy queue to get enabled ๐Ÿ˜ฆ

#

@exotic pumice "static inline" means it's intended for the C compiler to put a copy of the function body at each site where it's used, and so there's no copy available for linking to

exotic pumice
#

right

#

well that'll be fun

onyx hinge
#

so yeah you could hypothetically modify asf4 to move the implementation to a source file and change it to be a "regular extern function" type as a first step. That's pretty offensive if you have to do it for all those low level APIs

#

I can see why they would do it for efficiency, though most circuitpython ports currently link with lto, so there would be the opportunity for that function body to be inlined whether or not the definition is in the header file or not

exotic pumice
#

yeah I'll figure it out later lol

tough flax
sudden coral
#

This needs some tidying up and corner case handling before it'll be PR-ready, but some time hopefully tonight (or tomorrow) I'll be submitting a PR for... PEP-498 (f-string) support in CircuitPython! ๐ŸŽ‰ (also cc @slender iron so you know you can ignore my dms from earlier... lol)

print(f'hi')
print('hi'.format())
x = 1
print(f'{x}')

def foo():
    return 'CircuitPython is fun'

print(f'{foo()}')
print(f'{this_var_does_not_exist}')
hi
hi
1
CircuitPython is fun
Traceback (most recent call last):
  File "../../tests/basics/string_pep498_playground.py", line 10, in <module>
NameError: name 'this_var_does_not_exist' is not defined
swift arrow
#

@tulip sleet made the comment "We have a C-based library we are planning to use instead of the python-based SD library."on June 15.

#

I ask because I have been playing around trying to figure out the issues against the CP adafruit_sdcard lib.. and I fixed the issue with the Samsung SD cards issue #13 / and #15. I'm just waiting on my pull request to be accepted / merged.

#

Well until it's accepted and merged I "think" I fixed it ๐Ÿ˜ƒ

tulip sleet
#

The SD part of the SDFat library. Away from desktop until Monday, but sounds good!

swift arrow
#

so not "adafruit_sdcard"

#

I was going to look at the large write hangs.. but it would not be much point if the python library is going away.

#

Though what I learned about Samsung SD cards may prove helpful regardless.. Samsung SDcards seem to check command CRC values when they shouldn;t be.. ie the default is not to check.. but they default to checking.. So once I added valid CRC codes it started working for Samsung cards.

#

I had read somewhere they did it because it added reliability/stability to large cards.. which got me to thinking about our large write issue.. what if we try turning on CRC command codes.. So I am going to try that and see what happens.

tough flax
cerulean sparrow
#

Is there a good way to measure how long board.DISPLAY.refresh_soon() is taking on circuit python? I want to benchmark some code changes, but it appears it will take some C code to complete. Currently I am using this code, but I am getting very high resolution:

    board.DISPLAY.refresh_soon()
    
    millisStart = int(round(time.time() * 1000))
    print("Start Refresh:")
    board.DISPLAY.wait_for_frame()
    
    millisEnd = int(round(time.time() * 1000))
    print("End Refresh:", millisEnd - millisStart)
manic glacierBOT
#

This implements (most of) the PEP-498 spec for f-strings, with two
exceptions:

  • raw f-strings (fr or rf prefixes) raise NotImplementedError
  • one special corner case does not function as specified in the PEP
    (more on that in a moment)

This is implemented in the core as a syntax translation, brute-forcing
all f-strings to run through String.format. For example, the statement
x='world'; print(f'hello {x}') gets translated at a syntax level
(injected into the lexer) to...

manic glacierBOT
#

I've also submitted this upstream as https://github.com/micropython/micropython/pull/4998 - modulo the lack of translation support upstream (at least in the way CircuitPython does it?), the PRs are identical. I'm happy for both projects to benefit from this, but since I mostly work in CircuitPython (and I'm also not sure how often CircuitPython rebases off upstream), I wanted to make sure the PR here landed as my higher priority ๐Ÿคทโ€โ™‚๏ธ

main meteor
#

@tough flax I don't know of one, but I could make a part like that fairly quickly if you don't want to.

manic glacierBOT
onyx hinge
#

huh a new message I don't recall seeing while trying to build the docs โ€” otoh, I'm not sure this laptop is set up right for doc building anyway. Seems like sphix shouldn't be looking at these files! /home/jepler/src/circuitpython/ports/nrf/drivers/bluetooth/s132_nrf52_2.0.1/s132_nrf52_2.0.1_API/include/ble.h:document isn't included in any toctree

#

sphinx is 1.8.5

#

oh is it a super old circuitpython source tree, and that's no longer where the nrf sdk stuff comes from?

manic glacierBOT
tough flax
#

@main meteor no, I was just hoping there was a more up to date eagle library I was missing. The newest I can find is 2015

main meteor
#

It looks like there hasn't been a commit since then on github. I just realized I hadn't pushed any updates to my library in 3 years, so I just did.

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
onyx hinge
#

What's the philosophy of freezing modules into the nrf ports? Right now it feels like they have plenty o' flash storage space (at least, this particle xenon does; are they all the same at 1MB?) I have validated that adafruit_hid works and created a PR. I've also just validated that neopixel works, but haven't PR'd it yet.

idle owl
#

@onyx hinge We only freeze modules in when absolutely necessary. The nRF boards should have enough space to not warrant frozen modules.

onyx hinge
#

@idle owl maybe a comment to that effect on #2051 is warrented so it doesn't get merged blindly

manic glacierBOT
idle owl
#

<@&356864093652516868> Here is the notes doc for the CircuitPython Weekly for 12 August 2019. Everyone is welcome to attend! Please include your hug reports and status updates in the notes even if you'll be attending the meeting - it's super helpful! If you're going to miss the meeting, feel free to include hug reports and status updates in the notes and we'll read them off during the meeting. Hope to see you there! https://docs.google.com/document/d/1LjcLPbieUa4qvX4jyJJLf6Q4G6UuA5m4NjUX93gs3rk/edit?usp=sharing

strange cargo
#

I'm confused about when to use DISPLAY.wait_for_frame() vs. DISPLAY.refresh_soon()

#

and if either of them will help me ... I'm trying to do a side-scrolling thing and it's coming out slower than I expected.

#

I have the latest CircuitPython (4.1.0)

#

the function sceneCycle(...) has several calls to wait_for_frame() and refresh_soon(), but I'm not sure if I've ordered or arranged those in the best way

manic glacierBOT
manic glacierBOT
stuck elbow
#

@strange cargo scrolling right now requires redrawing the whole screen, so it's slow

#

@strange cargo maybe you could instead scroll in steps or whole screens

strange cargo
#

@stuck elbow , yes if I leave the background static and just move the characters it is very fast. I was hoping some clever use of wait_for_frame() and refresh_soon() could speed up the background scrolling, but when I shuffle those calls around it ends up tearing the screen more and not really going faster.

stuck elbow
#

the pixels can be sent to the screen only so fast

#

one thing you could try is play with the hardware scrolling of the display itself โ€” that doesn't require sending new data, except for the narrow strip of the new content โ€” but that is not currently supported by displayio, so you would have to hack it yourself by sending commands to the display yourself

#

and of course then it would only work with the one display you use

#

by the way, wait_for_frame and refresh_soon are going to be removed in 5.x and replaced with a simple refresh

strange cargo
#

does MakeCode have some tricks/optimizations that CircuitPython hasn't applied? I look at the scrolling in this J.P. demo and it seems faster than what we can do with CP now.

stuck elbow
#

that'c C code, no?

#

it's much faster

#

actually I don't know how they implemented scrolling

manic glacierBOT
onyx hinge
#

Maybe this is something for "in the weeds" today: What if a UF2 of circuitpython plus "the initial filesystem image" for each supported board was a build artifact of circuitpython? The benefits are (A) once done, it's easy for anyone with git to find out "what was shipped with board BB in release RR", (B) by scripting it, it is repeatable and (C) by providing a "fully reinitialize" option, it might help some users. On the other hand, (X) some users will accidentally use "fully reinitialize" and lose their own code, (Y) this doubles the number of build artifacts again, and (Z) it's a fair bit of work to do this for each supported board (source the file(s), add to git, etc)

To that end, I've written an alpha-quality "mkfatimg" program in C which uses oofatfs to produce a filesystem image containing the usual circuitpython meta-files like .fseventsd. https://github.com/jepler/mkfatimg

#

.. I did go ahead and throw a brain dump about this into "in the weeds"

manic glacierBOT
idle owl
#

@onyx hinge Looks good! I'll turn it over to you when we get to In the Weeds and let you talk through it and start the discussion.

idle owl
#

@pastel panther or @gilded cradle Do either of you have a minute to test OBS with me?

gilded cradle
#

I do

pastel panther
#

sure

idle owl
#

Right on. Can you jump into the CircuitPython audio chat?

gilded cradle
#

Sure

manic glacierBOT
modern wing
#

Good afternoon all you wonderful folks! I'll be on the call today, lurking happily ๐Ÿ˜ƒ

onyx hinge
#

is there a keystroke to mute/unmute my mic in discord?

stuck elbow
#

you can set one

ruby atlas
#

Lurking only - no mic, meetings at any time

stuck elbow
#

you can set it to "push to talk"

modern wing
#

Can you ever have too many epaper screens?

stuck elbow
#

do you have any round ones?

slender iron
#

@stuck elbow no, have you seen some?

onyx hinge
#

@slender iron are you damaging the screens in your testing/coding?

stuck elbow
#

I've seen round oleds and memory displays, but I woulnd't be surprised with epaper ones

raven canopy
#

Lurking

slender iron
#

@onyx hinge I don't know of a hotkey. no, not damaging, just different driver ics

tidal kiln
#

lurking

timber mango
#

lurking

turbid radish
#

not lurking ๐Ÿ˜ƒ

slender iron
#

๐Ÿ‘

silver tapir
#

Lurking.

slender iron
#

@stuck elbow I think we got some sample round ones

river quest
#

yah, will post some photos soon of the round displays

stuck elbow
#

\o/

river quest
#

they are super-cool

stuck elbow
#

are the pixels addressed in a spiral? ;-)

slender iron
#

round tft iirc

river quest
#

CircuitPython day celebrations!

CircuitPython Day 2019 | Code + Community = CircuitPython <3
https://www.codensolder.com/blog/circuitpython-day-2019-codecommunitycircuitpython-lt3

modern wing
#

I hope development on the round epaper doesn't have you going in circles.....

slender iron
#

welcome @nimble narwhal are you listening in (aka lurking)?

river quest
slender iron
#

otherwise we'll call on you later

river quest
stuck elbow
#

mmm, licorice

river quest
#
Adafruit Industries - Makers, hackers, artists, designers and engineers!

FEATHER takes flight with the Wio Lite W600 from Seeed Studio. Wio Lite is a new product line from Seeed, and Wio Lite W600 is the first product in this series. Similar to the great Adafruit Featheโ€ฆ

slender iron
#

๐Ÿ’ฏ hug report for @swift arrow

onyx hinge
#

that's a mouthful

turbid radish
old smelt
#

Lurking. Late. Mobile. Dying battery...

gilded cradle
#

@turbid radish will that also work with breakouts with displayio drivers?

turbid radish
#

@gilded cradle it should but I don't go over that in the guide. I do point out as long as you have a board.DISPLAY object set up, it should just work

gilded cradle
#

Ok, it's not board.DISPLAY on the breakouts, but you do have an equivalent object.

turbid radish
#

It might be good, as time allows to update it for general displayio wiring and use

gilded cradle
#

Yeah

turbid radish
#

yes, the equiv object should work

slender iron
#

looks

onyx hinge
#

I really appreciate the degree to which you minimized that reproducer program

simple pulsar
#

I've just noticed a REPL peculiarity on 4.1.0-rc.1 whilst discussing something unrelated with a fellow midi user. Note how the stack trace on exception accumulates: ```
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.1.0-rc.1 on 2019-07-19; Adafruit Metro M4 Express with samd51j19

from adafruit_midi.program_change import ProgramChange
ProgramChange(200) ### intentional illegal value
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "adafruit_midi/program_change.py", line 56, in init
ValueError: Out of range
ProgramChange(200) ### intentional illegal value
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "adafruit_midi/program_change.py", line 56, in init
File "<stdin>", line 1, in <module>
File "adafruit_midi/program_change.py", line 56, in init
ValueError: Out of range
ProgramChange(200) ### intentional illegal value
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "adafruit_midi/program_change.py", line 56, in init
File "<stdin>", line 1, in <module>
File "adafruit_midi/program_change.py", line 56, in init
File "<stdin>", line 1, in <module>
File "adafruit_midi/program_change.py", line 56, in init
ValueError: Out of range

slender iron
#

ya, looks weird

#

my guess is that it's repl only

simple pulsar
#

I can check against the pukka 4.1.0 and then log as a bug if that does it?

slender iron
#

what do you mean by pukka?

raven canopy
#

I looked on Trellis M4's page Saturday. No dice. ๐Ÿ™

#

Yep

onyx hinge
#

I have to step away. thanks all, talk to you later!

pastel panther
#

bye @onyx hinge ๐Ÿ‘‹ Thanks for stopping by

raven canopy
#

Yeah, the timers/periphs and the VM re-entrance are the biggest things imo. Aside from USB of course.

#

Yeah, definitely where I'd start. Sleep = loop ends.

#

RSTDBY and ONDMD flags...so confusing. ๐Ÿ˜

solar whale
#

sorry I have to miss this -- will listen to the recording -- have a good week all ๐Ÿ‘‹

raven canopy
#

But, more complicated/convoluted will start to limit small boards, which I imagine are the target boards.

#

Happy day did it last year

#

But CPython only stops script execution with time.sleep(). I don't see that as equivalent to setting a PC in sleep mode.

silver tapir
#

Are both ways or doing this, compatible with a wakeup from GPIO?

stuck elbow
#

no

simple pulsar
stuck elbow
#

so pukka is like echt?

slender iron
raven canopy
#

Thanks everyone!!

silver tapir
#

Thanks for hosting @idle owl .

errant grail
#

Thanks everyone! Mondays, Wednesdays, and Thursdays highlight my week.

modern wing
#

I'll agree @errant grail -- as I'm recovering from an injury, these fun meetings give me something to look forward to, takes my mind off of things.

raven canopy
#

๐Ÿ‘‹ later

errant grail
#

@modern wing Hope you recover quickly!

manic glacierBOT
#

Observed on 4.1.0-rc.1 and briefly discussed on Discord. 4.1.0 has same issue with accumulation of stack trace stuff in Traceback output:

Adafruit CircuitPython 4.1.0 on 2019-08-03; Adafruit Metro M4 Express with samd51j19
>>> from adafruit_midi.program_change import ProgramChange
>>> ProgramChange(200) ### intentional illegal value
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "adafruit_midi/program_change.py", line 56, in __init__
ValueE...
slender iron
modern wing
#

@slender iron Thanks!

onyx hinge
#

Back at the office. On the drive, what came to mind is: the build artifact to start with is not a FAT binary image or a UF2 file .. it's a .zip file. Also, all the tooling is already done if you want to make zip files ๐Ÿ˜ฒ

slender iron
#

๐Ÿ‘

lone sandalBOT
manic glacierBOT
silver tapir
#

@gilded cradle To repac, you where helping me with porting stuff to riscv, PlatformDetect was done, and I'm in the middle of adding code to blinka.

onyx hinge
#

thanks tannewt

gilded cradle
#

Yep

silver tapir
#

I'm a bit loss with was is missing. Can I send a PR and you can help by pointing out what's next?

gilded cradle
#

Sure

silver tapir
#

Thanks a lot, I'll reviews the pins and send it.

gilded cradle
#

Sounds good. I'll keep an eye out for it.

manic glacierBOT
manic glacierBOT
#

@jedgarpark discovered that sending a ProgramChange 2-byte message using usb_midi incorrectly produces two ProgramChange messages, the first with a zero patch byte value and the second with the correct patch byte value. One and three-byte messages seem to be unaffected.
The zero-value ProgramChange message was interpreted by Macintosh-based MIDI sniffers as incorrectly formatted. I used Windows 10-based MIDI sniffers to view the message traffic for the test.
I tested and confirmed ...

simple pulsar
#

@stuck elbow echt is a new one to me!

manic glacierBOT
#

its totally a windows thing (no problems building on the raspi)... May even be a my windows thing (running Insider Preview builds). It builds ok in travis, but the rf24.mpy is not in the correct subfolder "circuitpython-nrf24l01" under lib (see the release notes). I'm currently adding another module under the same folder that will emulate BLE advertisements using the nRF24L01. Hopefully having more than one py file in th...

manic glacierBOT
#

I agree the color converter would ideally be the place for any dithering. I started looking at making a change like that, and it quickly snowballed into a bunch of changes. Large sweeping changes could easily slow rendering speed. Even this simple change to OnDiskBitmap slowed things down 100ms (~10%).

One of the key things color converter would need is the X,Y position on the screen of the current color. This could be passed to the function a pointer to a struct of pixel data instead of ...

manic glacierBOT
#

While investigating #1908, I observed the following:


Next, I started tracking how dma_channel_enabled tracked with calls to dma_{en,dis}able_channel. I found that, contrary to what the code in find_free_audio_dma_channel requires, it appears that channel->CHCTRLA.bit.ENABLE can be set to false asynchronously.

When this happens, it's possible for both AudioOut and PDMIn to simultaneously believe they have been allocated the same DMA channel, and to make conflicting uses of it.

...

manic glacierBOT
#

down in tinyusb at tud_midi_n_write, it looks like the ProgramChange message (msg=0xc) is not directly supported -- instead, it uses the cin=0xf option to send it as two one-byte messages. If my reading is correct, it's possible that some receiving software could treat this as two ProgramChange messages, only without a program number attached to the first one, never mind that the document I found from usb.org says it is permitted: (https://www.usb.org/sites/default/files/midi10.pdf)
![mid...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I get the following error accessing an I2C device (VCNL4040) after a soft reboot.
It works normally after a hard reboot, but fails after a soft reboot (control-D)

This occurs with CP4.1.0 and CP 5.0 (current master)

HARD RESET
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.1.0 on 2019-08-03; SparkFun Pro nRF52840 Mini with nRF52840
>>> import vcnl4040...
manic glacierBOT
obsidian compass
#

Hi does "rotaryio' library works with CircuitPlayground express board ?

solar whale
#

@obsidian compass it does appera to be "builtin" to the CPX ```Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.0.0-alpha.0-45-gd99d3bd47 on 2019-07-28; Adafruit CircuitPlayground Express with samd21g18

help('modules')
main adafruit_hid/keyboard_layout_us busio random
_os adafruit_hid/keycode collections re
_pixelbuf adafruit_hid/mouse digitalio rotaryio
_time adafruit_lis3dh errno rtc
adafruit_bus_device/init adafruit_thermistor gamepad storage
adafruit_bus_device/i2c_device analogio gc struct
adafruit_bus_device/spi_device array math supervisor
adafruit_circuitplayground/express audiobusio microcontroller sys
adafruit_hid/init audiocore micropython time
adafruit_hid/consumer_control audioio neopixel touchio
adafruit_hid/consumer_control_code bitbangio neopixel_write usb_hid
adafruit_hid/gamepad board os usb_midi
adafruit_hid/keyboard builtins pulseio
Plus any modules on the filesystem

import rotaryio
dir(rotaryio)
['class', 'name', 'IncrementalEncoder']

obsidian compass
#

@solar whale thanks, seems like somehow it's not working for me . Let me re-flash

solar whale
#

what versin of CP are you using -- this was 5.0 -- I'll check 4.1.0

obsidian compass
#

I am on 4.1

solar whale
#

it is there ```Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.1.0 on 2019-08-02; Adafruit CircuitPlayground Express with samd21g18

help('modules')
main adafruit_hid/keyboard_layout_us collections re
_os adafruit_hid/keycode digitalio rotaryio
_pixelbuf adafruit_hid/mouse errno rtc
_time adafruit_lis3dh gamepad storage
adafruit_bus_device/init adafruit_thermistor gc struct
adafruit_bus_device/i2c_device analogio math supervisor
adafruit_bus_device/spi_device array microcontroller sys
adafruit_circuitplayground/express audiobusio micropython time
adafruit_hid/init audioio neopixel touchio
adafruit_hid/consumer_control bitbangio neopixel_write usb_hid
adafruit_hid/consumer_control_code board os usb_midi
adafruit_hid/gamepad builtins pulseio
adafruit_hid/keyboard busio random
Plus any modules on the filesystem

#

type help('modules') at the REPL and see if it is the same as what I see.

obsidian compass
#

I reflashed the same version and now I see it ๐Ÿ˜› weird

solar whale
#

sigh... good luck !

obsidian compass
#

Able to import the module now, doing a test program ๐Ÿ˜ƒ

#

Success ! +

solar whale
#

Great!

obsidian compass
#

:+1 Thanks for the awesome guide @idle owl ๐Ÿ˜ƒ

manic glacierBOT
manic glacierBOT
onyx hinge
#

Is there a way to search PRs for ones where I've been requested as a reviewer? I feel like there is an outstanding PR which I was requested to review but I can't find it

#

aha review-requested:jepler

tulip sleet
obsidian compass
#

How can we check which all modules/libs are baked in to default .uf2 for a specific board ?

#

Without actually flashing it

stuck elbow
#

look at the board definition

tulip sleet
manic glacierBOT
#

With the current 5.0 master, I now see slightly different symptoms. The program runs after a hard reset, but also runs after a soft reset(Ctrl-D). However, if I run "exec(open('main.py').read())" from the REPL prompt, it dies with the following stack:

 HardFault_Handler Line: 297	
 <signal handler called> Line: 297
     displayio_group_get_refresh_areas (displayio_group_t * self, displayio_area_t * tail) Line: 313	
 displayio_display_get_refresh_areas (displayio_display_obj_t *...
obsidian compass
#

@tulip sleet awesome :D. Is there a build script where modules names to be packaged are mentioned which I can refer?

#

for a particular board(say)

#

@stuck elbow thanks Gotchya ๐Ÿ˜ƒ

tulip sleet
#

@obsidian compass it's somewhat complicated: there are categories of boards, and then for some boards some specific modules are enabled/disabled: CIRCUITPY_SMALL_BUILD, CIRCUITPY_FULL_BUILD, and also varies by port (atmel-samd vs nrf, in mpconfigport.h), and then you look in mpconfigboard.h

#

that's why we're trying to automate figuring it out

obsidian compass
#

@tulip sleet sounds fun, let me see where I could help ๐Ÿ™‚

manic glacierBOT
tulip sleet
manic glacierBOT
#

Feather '840 has very short traces to I2C pins, shorter than other Feathers. Capacitance isn't quite enough. Adding 10pF caps or extra 10k pullups makes those chips work fine on Feather '840, but they don't work properly otherwise. Datasheet says 2.2k or 2.2k-4.7k for pullups. This is lower than most pullups. Metro '840 proto works with these chips with current 10k pullups. Try adding extra 10k pullups from 3.3V to ground on the SDA/SCL pins and see if this issue is still present. We're revis...

slender iron
#

@gilded cradle which library are you using?

gilded cradle
#

Adafruit_CircuitPython_SSD1351

#

it works with CP 4.1.0 Beta 0 and stops working after that

slender iron
#

and which device?

gilded cradle
#

Feather M4 Express

solar whale
#

Have to go make some pita -- back when dough is rising....๐Ÿฅ™

slender iron
#

@gilded cradle try lowering the baudrate

gilded cradle
#

Ok, I'll give that a try

slender iron
gilded cradle
#

Thanks for the suggestion

manic glacierBOT
#

@matthewnewberg I'm totally ok with passing x and y into pixel shaders.

I wouldn't worry too much about performance of dithering because it is a nice-to-have. One could always pre-process images to have dithering before loading them onto the device.

For ePaper performance matters even less because the refresh rate is so low.

Would you like to make the more drastic change of introducing a dithering module? I'm happy to help give pointers on it.

Thanks!

#

Based on the bare-arm test failure I got in upstream PR, this feature added about 700 bytes to the bare-arm build. I can probably find a way to trim that down (though I have very few ideas on that just yet - at work at the moment so can't toy with things much right now).

I'm wondering if finding a better alternative to the dual-buffer chr0-chr2 + chr3-chr5 workaround for switching between reader/postfix buffers would help code size by enough. I'm not sure if mp_readers are seekable, ...

gilded cradle
#

@slender iron, adding the baudrate fixed it. Thanks for the suggestion.

manic glacierBOT
old smelt
#

@gilded cradle - I made the requested change to Adafruit_CircuitPython_Display_Button. I am unfamiliar with how Travis works. What is it using for the automated lint checks? Also - is the creation of the .mpy automated, as well?

gilded cradle
#

Thanks Jason, I'll take a look.

manic glacierBOT
#

Oh, I think I've fixed this in my epd branch: https://github.com/tannewt/circuitpython/tree/epd

IIRC it's an issue of not resetting the group of a display properly: https://github.com/tannewt/circuitpython/commit/312c2408de359f2fe5324a5f29562d1479d7b415#diff-4ce49108868950347d358317f36c0935L238

In the OLED PR I lumped all of the reset logic into one loop not realizing that the continues would skip the display reset bits when hit.

slender iron
#

@old smelt the lint is done with pylint. the mpy creation is automated

manic glacierBOT
old smelt
#

Thanks Scott.

manic glacierBOT
#

Are you refereding to this, USB-MIDI Event Packets on page 16 of https://www.usb.org/sites/default/files/midi10.pdf

MIDI data is transferred over USB using 32-bit USB-MIDI Event Packets. These packets provide an efficient method to transfer multiple MIDI streams with fixed length messages. The 32-bit USB-MIDI Event Packet allows multiple "virtual MIDI cables" routed over the same USB endpoint. This approach minimizes the number of required endpoints. It also makes parsing MIDI events...

subtle sun
#

Playing around with BLE on the Particle Xenon (haven't managed to get my hands on an nrf52840 feather yet).
The samples are running nicely but i can't get the mac address. Is this supposed to work or it is still in progress?

Adafruit CircuitPython 4.1.0 on 2019-08-03; Particle Xenon with nRF52840
>>> import bleio
>>> bleio.adapter.address
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: extra keyword arguments given
manic glacierBOT
solar whale
#

@subtle sun It looks like that will be added in 5.0 -- I am using a build from @tulip sleet repo and it does work ```Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.0.0-alpha.0-161-g1570ef2dd on 2019-08-13; Particle Xenon with nRF52840

import bleio
bleio.adapter.address
<Address e2:04:d5:fa:50:cb>

subtle sun
#

@solar whale Thanks. Ill take a look

solar whale
idle owl
#

Ok I'm missing something here. What do you do when you want to use two I2C devices at the same time?

#

I thought you specified the address and as long as they're different, it's happy, but I'm not seeing an address kwarg.

manic glacierBOT
solar whale
#

@idle owl It may depend on the device -- some are addressable some are fixed addresses - what are you using?

idle owl
#

@solar whale DS3231 RTC FeatherWing and OLED FeatherWing.

subtle sun
#

@solar whale Compiled and flashed and it works as expected. Thanks again.

idle owl
#

@solar whale I think I'm straight up missing something on what I should be doing for the code. Start by assuming I'm simply doing it wrong.

#

I thought to use board.I2C for the i2c object in both initialisation lines, and at least now I'm getting a new error.

solar whale
#

I don't see that the ds3231 has addressing options

idle owl
#

but it's default address is different than the OLED.

#

that isn't enough?

solar whale
#

yes it is hardcoded to 0x68 -- should be fine with OLED

idle owl
#

oh you mean to assign it an address

solar whale
#

what error are you getting?

idle owl
#

oled is 0x3C or 0x3D apparently. (according to master I2C address list)

#

I was getting SCL in use. I am now getting: 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 9, in <module> File "adafruit_ds3231.py", line 97, in __init__ File "adafruit_bus_device/i2c_device.py", line 66, in __init__ AttributeError: 'function' object has no attribute 'try_lock'

solar whale
#

can you post the code?

idle owl
#
import time
import board
import busio
import displayio
import adafruit_ds3231

# i2c = busio.I2C(board.SCL, board.SDA)

rtc = adafruit_ds3231.DS3231(board.I2C)

oled = displayio.I2CDisplay(board.I2C, device_address=0x3C)```
solar whale
#

use board.I2C()

#

need parens

idle owl
#

now I get SDA in use

crimson ferry
#

may need hard reset

idle owl
#

ok

#

Unplugged it and plugged it back in, same error.

solar whale
#

do you have () for both?

idle owl
#
rtc = adafruit_ds3231.DS3231(board.I2C())

oled = displayio.I2CDisplay(board.I2C(), device_address=0x3C)```
solar whale
#

hhm try ```i2c = busio.I2C(board.SCL, board.SDA)

rtc = adafruit_ds3231.DS3231(i2c)

oled = displayio.I2CDisplay(i2c, device_address=0x3C)

idle owl
#

I had that before but I will do it again. Moment please.

#

SCL in use

solar whale
#

or i2c=board.I2c()

idle owl
#

SDA in use.

solar whale
#

ยฏ_(ใƒ„)_/ยฏ

idle owl
#

Fair enough

crimson ferry
#

I was having same issue with 5.0 and displayio OLED (also using other RTC wing and airlift), I think Scott was going to look at the code

idle owl
#

OH.

#

omg.

#

You're right.

#

He said there was an I2C bug, but never clarified what it was.

solar whale
#

cool ! You found it!

idle owl
#

Let me try it with only that line though.

solar whale
#

Sorry - I have to run -- good luck!

idle owl
#

Thanks @solar whale as always!

#

Yes. Even though it fails on the rtc line, it doesn't fail with the RTC alone. It does fail on the I2C alone.

#

@crimson ferry Thank you so much. I even said "So if something happens, don't assume it's me." and Scott said "Yes." And I did it anyway.

#

@slender iron I found your displayio I2C bug.

crimson ferry
idle owl
#

I'll comment for all the good it will do

onyx hinge
#

@tulip sleet re your comment nearly 4 hours ago .. I don't have those links (created/assigned/mentioned/review requests) on the pull requests page. Is it a feature you've opted in to or something?

tulip sleet
#

@onyx hinge maybe it's because I'm a member of the "adafruit" organization

#

btw, I'm testing the nRF PWMAudioOut, using the tip of master, and getting playback artifacts on the second part of a wav file. Should I open a new issue or add to the impl one?

onyx hinge
#

@tulip sleet Thanks for testing! Open new issues, I think, unless the original implementation one is still open.

tulip sleet
#

@onyx hinge ok, not your issue- turns out the file got corrupted while copying to CIRCUITPY. Recopying and it's fine. This is with a potentially flaky nRF52840 that was having trouble, that I got from a user

tidal kiln
#

what's a good way to get file size in bytes? os.stat seems to work, just wondering if there's something "better"?

>>> import os
>>> os.stat('font5x8.bin')[6]
1282
sudden coral
#

@tidal kiln in cpython, even, what you did is the "recommended" (just with named access instead of index). https://stackoverflow.com/a/2104107

#

if os.path.getsize exists that works (apparently in CPython it's an alias for... exactly what you wrote)

tidal kiln
#

@sudden coral thanks. doesn't look like CP has os.path and the os.stat return is just a simple tuple in CP (thus the index)

onyx hinge
#

@tulip sleet noted, thanks for checking further

onyx hinge
#

As expected, I did not reproduce the i2c in use error after soft reboot with particle xenon + oled featherwing

#

@raven canopy want to talk audio mixer?

raven canopy
#

sure. give me a sec; finishing up a PR review.

onyx hinge
#

of course

raven canopy
#

k. done. let me push current code to github. prob need to do a couple commits first.

manic glacierBOT
raven canopy
#

@onyx hinge ready when you are. CirPy voice channel? (any other attendees are fine with me)

onyx hinge
#

@raven canopy yes let me transfer to where I can do voice

onyx hinge
#

../../shared-module/audiocore/Mixer.c|192 col 5| error: asm operand 1 probably doesn't match constraints [-Werror]

#

gcc version 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907] (15:7-2018-q2-6)

#
#define SHIFT 0
    asm volatile("smulwb %0, %1, %2" : "=r" (lo) : "r" (mul), "r" (val));
    asm volatile("smulwt %0, %1, %2" : "=r" (hi) : "r" (mul), "r" (val));
    asm volatile("ssat %0, %1, %2, asr %3" : "=r" (lo) : "I" (BITS), "r" (lo), "I" (SHIFT));
    asm volatile("ssat %0, %1, %2, asr %3" : "=r" (hi) : "I" (BITS), "r" (hi), "I" (SHIFT));
    asm volatile("pkhbt %0, %1, %2, lsl #8" : "=r" (val) : "r" (lo), "r" (hi)); // pack
raven canopy
onyx hinge
#

dangit I was doing that "have to have the last word thing", sorry!

#

have a good remainder of your evening

raven canopy
#

haha. no worries.

#

i may have subconsciously been doing the same. ๐Ÿ˜‰

onyx hinge
#

for those who weren't listening in, I got it building on nrf but the audio levels seem weirdly low. I tried to convince sommersoft to just submit the PR without the asm stuff and leave the chance to optimize it as a gift to future generations

#

I plan to investigate the (probably nrf / pwmaudio specific) audio level problem soon, but maybe not super-soon

#

afk

old smelt
#

It looks like once a button is created with fill=None, the selected_fill setting is ignored and won't show if the button is touched. I've been looking at code for quite a while, and I

#

...am a bit stumped.

#

Snooping around led me to this question: Once make_transparent() has been called for a given button's palette index, will it accept being set to a color at a later time?

#

Or do you have to call make_opaque() first?

#

...something that I tried in a locally modified copy of roundrect.py, but no luck

onyx hinge
#

ooops, while trying to get my metro m4's filesystem to include "tetros" (boot sector tetris) it looks like I corrupted the filesystem.

#

I was just thinking, what a great easter-egg it would be to have a bootable PC game on there

#

is the first sector of the disk fake or something?

#

ah, yes, it is

#

oh well, it won't work out

manic glacierBOT
tough flax
#

Switched from trying to parse a .INI style file to just putting the settings in a .py file ... saved 8K (on a Trinket M0) ๐Ÿ˜ƒ

manic glacierBOT
manic glacierBOT
manic glacierBOT
stuck elbow
#

two layers of laser-cut acrylic

onyx hinge
#

Thinking about MixerVoice makes me even more sure that "something" comprehensive needs to be done about memory allocation for audio. Suppose you wanted to mix 8 wavs, you should be able to do it without allocating full memory for all 8 of them. Putting the audio consumer in charge would be a big improvement there too

indigo wedge
#

So I understand that the ESP32 circuitpython port is not prioritized cause there's no native USB, does that mean that now with the ESP32-S2 close, the port can get redemption?

raven canopy
#

@tough flax awesome!!!

old smelt
#

Anyone interested in a low-level discussion about how make_transparent() and make_opaque() work in displayio? Seems like they may be intended to work dynamically, but I can't create a demo which shows that is possible. On the other hand, I think I can show that they do not work that way. But if the transparency/opaqueness of a shape is NOT supposed to be changed after initialization, I may be barking up the wrong tree.

manic glacierBOT
manic glacierBOT
#

Hi,

I am VERY interested in seeing some kind of source level debugging added to Circuitpython. By this I mean the facility to have a script stop at a certain point (breakpoint), be able to examine and change variables, and the continue after the breakpoint. I am at a point with one script where it would be VERY useful to be able to do this.

For instance, I have verified that code sequences work, by using the REPL, but I am not able to see what my script is actually doing and why it is n...

exotic pumice
#

what is NO_PIN defined to for samd21? I see 84 for samd51 and 0xff for nrf and stm

#

oh nevermind

#

samd51 is 118 samd21 is 84?

#

but the section that defines NO_PIN to PORT_BITS is only in the samd51 peripherals

manic glacierBOT
tidal kiln
#

@tough flax for that .INI parse thing - could you switch to using a native Python data structure (ex: dictionary) to hold the info? if it's a requirement that the old .INI file still be supported, a simple translation program could probably be written

also - i have an Eagle part for the 5mm NeoPixels, but it's not the best - the hole spacing is pretty tight

tough flax
#

@tidal kiln thatโ€™s what we did: and I like the python settings file. It was just nice that new users would have a safer ini experience and their computer would open the text editor for them

#

We made the eagle part, but thanks!

tidal kiln
#

cool. sorry for lag. been deep in other necks of the woods.

manic glacierBOT
#
import adafruit_midi
import time

from adafruit_midi.timing_clock            import TimingClock
from adafruit_midi.channel_pressure        import ChannelPressure
from adafruit_midi.control_change          import ControlChange
from adafruit_midi.note_off                import NoteOff
from adafruit_midi.note_on                 import NoteOn
from adafruit_midi.pitch_bend              import PitchBend
from adafruit_midi.polyphonic_key_pressure import PolyphonicKeyPressure
from ad...
vivid temple
vivid temple
#

2019-08-15 01:33:39,150 Using board at serial port: /dev/ttyACM0
2019-08-15 01:33:39,157 Sending Application image.
2019-08-15 01:33:42,798 No trigger interface found for device with serial number: D3E3CF822FFA, Product ID: 0xCAFE and Vendor ID: 0x1915

2019-08-15 01:33:42,799 Serial: Waiting 500 ms for device to enter bootloader 1/10 time
2019-08-15 01:33:43,304 Serial: Waiting 500 ms for device to enter bootloader 2/10 time
2019-08-15 01:33:43,815 Serial: Waiting 500 ms for device to enter bootloader 3/10 time
2019-08-15 01:33:44,326 Serial: Waiting 500 ms for device to enter bootloader 4/10 time
2019-08-15 01:33:44,837 Serial: Waiting 500 ms for device to enter bootloader 5/10 time
2019-08-15 01:33:45,347 Serial: Waiting 500 ms for device to enter bootloader 6/10 time
2019-08-15 01:33:45,858 Serial: Waiting 500 ms for device to enter bootloader 7/10 time
2019-08-15 01:33:46,368 Serial: Waiting 500 ms for device to enter bootloader 8/10 time
2019-08-15 01:33:46,879 Serial: Waiting 500 ms for device to enter bootloader 9/10 time
2019-08-15 01:33:47,394 Serial: Waiting 500 ms for device to enter bootloader 10/10 time
2019-08-15 01:33:47,906 Serial: Device is either not in bootloader mode, or using an unsupported bootloader.
2019-08-15 01:33:47,908 Serial: Set Packet Receipt Notification 0
2019-08-15 01:33:47,908 SLIP: --> [2, 0, 0]
2019-08-15 01:33:48,910 SLIP: --> [7]

vivid temple
#

got it working now - nvm ๐Ÿ˜ƒ

subtle sun
#

@indigo wedge have they released the ESP32-S2?

indigo wedge
subtle sun
#

@indigo wedge I can't see it in the Espressif Taobao store so i guess they haven't released yet. Hopefully the tweet means the release is near

indigo wedge
#

let me know if it appears ๐Ÿ˜ƒ

#

i know beta silicon was sent out to some members of the community

#

but that one didn't have usb working i heard

subtle sun
#

I also saw those reviews but they were very tight on the details

#

I would love to see eventually a version with BLE + WIFI + USB on the same chip

solar whale
#

@vivid temple for the benefit of others, can you describe what you had to do to make it work? I put the UF2 bootloader on mine so I don't use nrfutil.

indigo wedge
#

@subtle sun I'm sure it will come eventually

stuck elbow
#

@indigo wedge yes

idle owl
#

@slender iron Any idea when you'll have a chance to look at the I2C OLED displayio bug? I know you have your priorities. I'm blocked on it and wanted to know if you had any idea when you might get to it so I can try to plan.

slender iron
#

@indigo wedge we have beta hardware but usb doesn't work. we'll get to it when it's more readily available and we have cycles

#

@old smelt it should be possible to undo but there may be a bug where setting it doesn't cause a redraw

#

@idle owl which bug number is it? I can try to look this week

old smelt
#

@slender iron - thanks for confirming the intent. I think there is a bug there, but I don't know where to file the issue. I'm guessing it is for displayio?

#

I created a short program that I think tests the behavior and shows the failures.

#

It fails the other way, too. That is, if you create a shape with a fill color and then later try to set the fill to None, it does not go transparent.

#

Very repeatable.

#

The original place I saw this symptom was when I noticed that the select_fill color is ignored for a button if the original fill color is None.

idle owl
lunar crown
#

In yesterday's Adafruit Daily, there was a snippit about Bryan and a APDS-9500 Gesture sensor. Clicking thru takes me to new products, but no APDS-9500. Was this just a new product pre-announcement OOPS ?

slender iron
#

@pastel panther would know @lunar crown

#

@old smelt if you can replicate it with just displayio apis then it should be filed on the core

old smelt
#

Ok. I probably can do that. I'm using either the Button or one of the shape objects to make it happen - but it really comes down to the fill() setter in the shape class, which is calling the displayio API function. Hopefully I'm making sense.

slender iron
#

@idle owl working on it now

idle owl
#

๐Ÿ‘

#

I can test things if needed.

#

@tulip sleet Doing the intro to linting guide. Worth creating a venv to install Pylint into? Mine's in one. Is it ok to simply provide the command to create the venv without getting into the details of it?

slender iron
#

@idle owl which feather are you using?

idle owl
#

M4 Express.

slender iron
#

I think it stops working after the first reload

#

not sure why

idle owl
#

Yeah I saw that! Thought it was an illusion

tulip sleet
#

@idle owl I never use a venv; I just install pylint and be done with it

idle owl
#

@tulip sleet Good to know, thanks.

manic glacierBOT
tulip sleet
#

a venv is useful if what you're going to install is going to conflict with existing stuff, or you need to maintain multiple python environments. But I think for most people, they just need one

idle owl
#

@slender iron I'm not even getting CIRCUITPY with this firmware... screen says hallowing m4 express for board type.

#

Also says 4.x

slender iron
#

hrm

#

ok, safe mode

idle owl
#

Ooh I have stuff on the OLED. But SCL in use.

slender iron
#

switches to metro

idle owl
#

Yep. Still getting the same behavior. Ok on first load, SCL in use on soft reboot.

prime flower
#

been fixing MiniMQTT this week - the server and client now properly sync with the keepalive provided to the server. Previous network errors are now handled by the library, for both issues with the ESP module and the socket. Here's an old screenshot showing disconnection from a server due to lack of synchronization , or the network module not communicating.

#

no red !!! disconnects ๐Ÿ˜„

pastel panther
#

heya @lunar crown I missed that that made it in there! The APDS-9500 and the other sensors there are still in development; The TLV493D that @idle owl did and the ICM-20948 that ladyada did will be out a bit sooner because they're adaptations of existing boards, however the APDS-9500 that I'm working on is new to us so it's development cycle will be a bit longer

slender iron
#

@idle owl try this:

lunar crown
#

@pastel panther If you need an alpha tester for the APDS-9500, I'll volunteer. I am interested in the part.

slender iron
idle owl
#

@slender iron I'm still getting SCL in use.

pastel panther
#

@lunar crown I'll keep you in mind if I need some help. I normally do most of the testing myself but if I see a place where you could help out I'll let you know

slender iron
#

hrm, what is your test code?

idle owl
#

checking now

lunar crown
#

@pastel panther Ok.

slender iron
#
import board
import displayio
import adafruit_displayio_ssd1306

displayio.release_displays()

i2c = board.I2C()
display_bus = displayio.I2CDisplay(i2c, device_address=0x3c)
display = adafruit_displayio_ssd1306.SSD1306(display_bus, width=128, height=32)
#

this is mine

pastel panther
#

@lunar crown what specifically did you think you could help with testing?

idle owl
#

I don't have the release

slender iron
#

k, lemme try that

idle owl
#

get SDA in use with board.I2C().

slender iron
#

yup, I see that too

lunar crown
#

@pastel panther I am interested in finding a better gesture sensor that could be used to replace knobs on a radio. So some knob replacement oriented application testing, general debugging of the drivers.

pastel panther
#

@lunar crown Ok, great, I'll let you know if something comes up

idle owl
#

@slender iron is the displayio.release_displays() required?

slender iron
#

@idle owl you should have the release

idle owl
#

Because it seems like it's trying to work with that line.

lunar crown
#

@pastel panther Ok.

slender iron
#

otherwise you'll make multiple displays over the same one

idle owl
#

hmm ok

#

Ok, looks like it's working then. Though I have no idea how to do anything with it. Obviously doesn't work like the original OLED driver.

slender iron
#

it's the same process as other displayio stuff

#

just only two color ๐Ÿ˜ƒ

idle owl
#

@slender iron Want me to review?

slender iron
#

sure

manic glacierBOT
#

Thanks for the fix! Tested on Feather M4 Express with OLED FeatherWing. Initialises successfully without error.

Example code:

import board
import busio
import displayio
import adafruit_displayio_ssd1306

displayio.release_displays()

i2c = board.I2C()
display_bus = displayio.I2CDisplay(i2c, device_address=0x3c)
display = adafruit_displayio_ssd1306.SSD1306(display_bus, width=128, height=32)
manic glacierBOT
manic glacierBOT
tame tiger
lone sandalBOT
manic glacierBOT
#
[adafruit/circuitpython] New branch created: github\-ci
slender iron
lone sandalBOT
manic glacierBOT
#

I left this comment in the ARM community thread linked above:
https://community.arm.com/developer/tools-software/oss-platforms/f/gnu-toolchain-forum/13503/gcc-g-version-8-very-slow-to-compile/159410#159410

I am suspicious that the compiler build itself was done with at least some optimizations turned off. In the 7-2018-q2 (7.3.1) release, lib/cc1 is 20MB in size. In the 8-2018-q4 (8.2.1) and 8-2019-q3 (8.3.1) updates, it is 30MB, which is a huge increase.

By comparison, in the Ar...

onyx hinge
#

interesting findings @tulip sleet

tulip sleet
#

i'm looking at the source tar file now

onyx hinge
#

good luck! There was a lot of stuff there

onyx hinge
#

@tulip sleet I noticed that in build-toolchain.sh there is a block for "is_ppa_release" which sets ENV_CFLAGS to hold -O2. By changing to non-ppa releases, did they introduce this performance regression?

tulip sleet
#

what line number is that? I was kdiff3'ing the gcc7 and gcc8 source releases. The website (not ppa) release for gcc7 and gcc8 has this size difference @onyx hinge

onyx hinge
#

okay, hmm

tulip sleet
#

i am building the latest release to see what the cc1 size will be

onyx hinge
tulip sleet
#

is that what you mean? no diff there between 7 and 8

#

cc1 is 31MB in my build (after strip)

onyx hinge
#

errr line 168

#

what I was suggesting is, adding -O2 to some cflags is gated by is_ppa_release. I thought maybe that was the change, not any revision to the building scripts

#

but since you were comparing the binary size of two non-ppa releases that seems like a bad hypothesis

tulip sleet
#

yah, that's possible, though looking at teh compile lines fly by, I am seeing -O2 on most of them

#

i don't use arch, I was just trying to find another build that was a size comparison

#

I can try the build again and set that flag or disable the check. I have to go out but will be back around lunchtime

#

there is a diff invovling the addition of CXXFLAGS in that script, though I don't see anything wrong with the changes

#

I'm hoping someone on the build team will take a look at my comment ๐Ÿ™‚

#

will check with you when I'm back

manic glacierBOT
onyx hinge
#
-DBASEVER="\"8.3.1\"" -DDATESTAMP="\" 20190703\"" \                                                                                              
-DREVISION="\" [gcc-8-branch revision 273027]\"" \                                                                                               -DDEVPHASE="\" (release)\"" -DPKGVERSION="\"(GNU Tools for Arm Embedded Processors 8-2019-q3-update) \"" \                                       
-DBUGURL="\"<https://gcc.gnu.org/bugs/>\"" -o build/version.o /home/jepler/eabi8/gcc-arm-none-eabi-8-2019-q3-update/src/gcc/gcc/version.c        ``` I don't see any -O when it comes to building gcc proper
#
+make -j$JOBS CXXFLAGS="${CXXFLAGS:-}" CXXFLAGS_FOR_TARGET="-g -Os -ffunction-sections -fdata-sections -fno-exceptions"                          ```
#
+make -j$JOBS CXXFLAGS="${CXXFLAGS:-}" all-gcc                                                                                                   ```
#

I think these have the effect of clearing out optimizer flags, but for C++ files only. Most of gcc proper is compiled as C++ these days, I think

onyx hinge
#

looks like circuitpython doesn't yet have a general audio resampling algorithm in it?

#

I wonder if libsamplerate is even slightly amenable for inclusion in CP. It's two-clause bsd license. i386 libsamplerate.so has 14kB in its "text" segment, but 1.5MB in its "rodata" segment(!!)

#

3 sets of resampling coefficients, from 2464 to 340239(!!)

#

looks like it would need some banging on to create a "libtinysamplerate" that has a more reasonable footprint

onyx hinge
#

cool, current libsamplerate includes octave scripts to generate filters, s possibly a smaller but adequate filter could be generated

tulip sleet
onyx hinge
#

@tulip sleet yes, I did see it

tulip sleet
#

I experimented with different cutoffs, # of coefficients, etc.

onyx hinge
#

Some part of me figured, better to put this off onto a library than to code it ourselvs -- avoiding NIH

#

but taking it from the samd build is probably more practical

tulip sleet
#

i did do some looking and there were surprisingly few helpful libraries or sample code.

onyx hinge
#

libsamplerate seems on a sound footing, it has a small API surface, but the coefficients are way too elaborate, even before you consider that we only have 32-bit FP math

tulip sleet
#

unfortunately I can't seem to find our discussions. I think they were in hipchat and are gone

onyx hinge
#

argh filled up my ssd trying to build arm sdks

#

OK but I'm looking at a random object file in build-native/gcc-final/gcc (web.o) and yes it looks like an optimization-disabled build. This trivial leaf function (rhs_regno(rtx_def const *)) has redundant manipulation of the stack that -O2 eliminates

#

install-native/cc1 is 30-ish megs stripped

tulip sleet
#

@onyx hinge did you try forcing the ppa release setting?

#

line 168 is -O2 for libs, it looks like

onyx hinge
#

@tulip sleet no, my next try is manually putting "-O2" on the line CXXFLAGS= (line 152)

tulip sleet
#

build-toolchain.sh --build_type=ppa and other choices. See around line 52

#

i'm trying to see how to do a clean without unpacking and re-fetching again

onyx hinge
#

x86_64-linux-gnu-g++ -fno-PIE -c -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -I. -I. -I/home/jepler/eabi8/gcc-arm-none-eabi-8-2019-q3-update/src/gcc/gcc -I/home/jepler/eabi8/gcc-arm-none-eabi-8-2019-q3-update/src/gcc/gcc/. -I/home/jepler/eabi8/gcc-arm-none-eabi-8-2019-q3-update/src/gcc/gcc/../include -I/home/jepler/eabi8/gcc-arm-none-eabi-8-2019-q3-update/src/gcc/gcc/../libcpp/include -I/home/jepler/eabi8/gcc-arm-none-eabi-8-2019-q3-update/build-native/host-libs/usr/include -I/home/jepler/eabi8/gcc-arm-none-eabi-8-2019-q3-update/build-native/host-libs/usr/include -I/home/jepler/eabi8/gcc-arm-none-eabi-8-2019-q3-update/build-native/host-libs/usr/include -I/home/jepler/eabi8/gcc-arm-none-eabi-8-2019-q3-update/src/gcc/gcc/../libdecnumber -I/home/jepler/eabi8/gcc-arm-none-eabi-8-2019-q3-update/src/gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I/home/jepler/eabi8/gcc-arm-none-eabi-8-2019-q3-update/src/gcc/gcc/../libbacktrace -I/home/jepler/eabi8/gcc-arm-none-eabi-8-2019-q3-update/build-native/host-libs/usr/include -o web.o -MT web.o -MMD -MP -MF ./.deps/web.TPo /home/jepler/eabi8/gcc-arm-none-eabi-8-2019-q3-update/src/gcc/gcc/web.c

#

this file no optimization

#

the mingw build does pick up optimization though, interesting.

tulip sleet
#

bleh

onyx hinge
#

i686-w64-mingw32-g++ -fno-PIE -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -I. -I. -I/home/jepler/eabi8/gcc-arm-none-eabi-8-2019-q3-update/src/gcc/gcc -I/home/jepler/eabi8/gcc-arm-none-eabi-8-2019-q3-update/src/gcc/gcc/. -I/home/jepler/eabi8/gcc-arm-none-eabi-8-2019-q3-update/src/gcc/gcc/../include -I/home/jepler/eabi8/gcc-arm-none-eabi-8-2019-q3-update/src/gcc/gcc/../libcpp/include -I/home/jepler/eabi8/gcc-arm-none-eabi-8-2019-q3-update/build-mingw/host-libs/usr/include -I/home/jepler/eabi8/gcc-arm-none-eabi-8-2019-q3-update/build-mingw/host-libs/usr/include -I/home/jepler/eabi8/gcc-arm-none-eabi-8-2019-q3-update/build-mingw/host-libs/usr/include -I/home/jepler/eabi8/gcc-arm-none-eabi-8-2019-q3-update/src/gcc/gcc/../libdecnumber -I/home/jepler/eabi8/gcc-arm-none-eabi-8-2019-q3-update/src/gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I/home/jepler/eabi8/gcc-arm-none-eabi-8-2019-q3-update/src/gcc/gcc/../libbacktrace -I/home/jepler/eabi8/gcc-arm-none-eabi-8-2019-q3-update/build-mingw/host-libs/usr/include -I/home/jepler/eabi8/gcc-arm-none-eabi-8-2019-q3-update/build-mingw/host-libs/usr/include -o web.o -MT web.o -MMD -MP -MF ./.deps/web.TPo /home/jepler/eabi8/gcc-arm-none-eabi-8-2019-q3-update/src/gcc/gcc/web.c

#

anyway, as far as building again, can you just remove the build* and install* directories?

#

er except don't remove build-* because that removes the scripts oops

raven canopy
#

@onyx hinge in my now lost PDMIn, I was using the samd filter as a basis. Since nrfx uses different buffer sizes, I played with the number/amplitudes of coefficients. All I ever got was clipped tones in the end though...

tulip sleet
#

yeah, I did that ๐Ÿ™‚ unpacking again

#

i didn't install all the mingw stuff, so the build-prerequisites failed early, but it didn't affect the linux build

#

i will try a ppa build

onyx hinge
#
+++ ./build-toolchain.sh        2019-08-15 11:22:41.081622816 -0500
@@ -149,7 +149,7 @@
        done
 fi
 
-CXXFLAGS=
+CXXFLAGS="-O2 -g"
 if [ "x$BUILD" == "xx86_64-apple-darwin10" ] || [ "x$is_ppa_release" == "xyes" ]; then
     skip_mingw32=yes
     skip_mingw32_gdb_with_python=yes```
#

this is what I'm trying

#

and now I can see that web.o got built with "-O2 -g" flags, yay

#

afk

tulip sleet
#

@onyx hinge ppa build is failing for some reason, maybe requirements in wrong place. Anyway, once you can find cc1 in the build output, you could stop and check its size. Do you want to reply to my post in that ARM comminity thread or shall I?

slender iron
#

nice investigation @tulip sleet and @onyx hinge . it'd be nice to have a modern gcc deb for bionic which github ci supports

#

I was thinking we may want to zip all of our deps up together and simply unzip them in the CI

tulip sleet
#

what's amazing to me is that this issue has lasted through two release cycles with ARM builds

slender iron
#

ya, I think fewer and fewer folks use their release

#

I'd love to port the arch build script to homebrew and use that

onyx hinge
#

People just expect software to get slower over time. And, not sure what's used more, but I bet the windows builds weren't affected

#

Looks like I get a tarball as a build artifact, not debs

tulip sleet
#

can you just find . -name cc1 -ls and strip that to check the size?

onyx hinge
#

When I get back to my desk I'll do that

meager fog
#

@umbral dagger hihi

umbral dagger
#

@meager fog hey

meager fog
#

@umbral dagger ok so for the bitmap stuffs, is there more you can do with the PR to get it shipshape

umbral dagger
#

Yes, scott had a suggestion. I'm looking at that now.

meager fog
#

ok please work on that today

#

@umbral dagger meanwhile, do you have one of these

umbral dagger
#

I do not

onyx hinge
#

Yes about 20MB

#

@tulip sleet

tulip sleet
#

ok, let's report it, do you want to register and post in that thread, or shall I cite you (by name or anonymously)? Someone else opened a support case but we cannot view it. I'll ask that person if they got a reply eyt.

onyx hinge
#

@tulip sleet feel free to name me, do you want me to provide some circuit python build times too?

tulip sleet
#

not needed, other people have said it's 3 times slower

onyx hinge
#

I don't want an account with arm,I think I've avoided that so far

tulip sleet
#

I can cite your github id or just your name

onyx hinge
#

Any way is fine. Or claim the credit for yourself

#

It was your hunch

tulip sleet
#

I'll say you confimed it and changed CXXFLAGS to have -O2, and it fixed it. Whoever made that change can figure out what they really want.

onyx hinge
#

Yes please include or at least describe that diff

tulip sleet
#

definitely

meager fog
slender iron
#

we could just build our own

meager fog
#

@umbral dagger plz order now cause we only have one of the lil displays in stock ๐Ÿ™‚

onyx hinge
#

@slender iron I can do that, like I did for the xtensa toolchain once

umbral dagger
#

@meager fog Ordered.

meager fog
#

@umbral dagger ok next few projects will use those - please keep workin on the PR with scott till then ๐Ÿ™‚

#

@umbral dagger do you have a pi 4?

umbral dagger
#

@meager fog Not yet

meager fog
#

@umbral dagger ok is there a place you can order one

#

also get a camera if you don't have one yet

umbral dagger
#

@meager fog I have a couple Pi cameras kicking around

meager fog
#

ok you'll want the 8mp one

manic glacierBOT
#

@jepler and I confirmed that the downloadable toolchains are not built optimized: https://community.arm.com/developer/tools-software/oss-platforms/f/gnu-toolchain-forum/13503/gcc-g-version-8-very-slow-to-compile/159420#159420:

A co-worker (GitHub @jepler) and I confirmed that the builds are not optimized: they are not built without -O2. Between the 7-2018-q2 and 8-2018-q4 releases, some changes involving CXXFLAGS were made to build-toolchain.sh.

This diff makes optimized bui...

umbral dagger
#

@meager fog That's what I have

meager fog
#

ok gr8! thanx

onyx hinge
tulip sleet
#

Thanks. I think we will wait for a fix, unless we want to host this somewhere for people to download. We are currently recommending the gcc 7 release; the gcc 8 one doesn't do much better on optimization. We do want to make it easy for people to duplicate our build environment.

onyx hinge
#

I agree fully

#

especially when it comes to, say, a mac build.

tulip sleet
#

i did download that, for future reference. it takes a long time to build the whole thing ๐Ÿ™‚

onyx hinge
#

it makes me smile to be your co-worker fwiw

#

afk though, I need to concentrate on other stuff

tulip sleet
#

i also have more on my list ๐Ÿ–ฅ

slender iron
#

@tulip sleet have you tried gcc 9?

#

I wonder if we compile gcc -O3 we'd speed up linking

tulip sleet
#

gcc -O3 would be interesting, though it might be I/O bound. Your idea of making one job per board is interesting, to allow more than 5 jobs but let others squeeze in. I wonder though if they will all get queued at once and still be a monolithic block of stuff in the Travis queue.

manic glacierBOT
manic glacierBOT
#

Last night I was testing the keyboard code on the PyRuler and everything was working fine after I updated the code a few times.

This morning I went to try the new code @ladyada wrote and my ruler will not show up as a CIRCUITPY drive, nor does a USB serial port show up.

About 6.5 seconds after plugging in the ruler would result in this mesage in dmesg:
2068082.010921 AppleUSBCDCCompositeDevice@: AppleUSBHostCompositeDevice::ConfigureDevice: unable to set a configuration (0xe0005000)

...

#

When plugged in, the dotstar is magenta/fuchsia as soon as it is plugged in and stays that way.

Double tapping reset to try to get into the bootloader just now didn't work, the dotstar is solid light blue and there is no TRINKETBOOT. Single reset also resolves to a blue dotstar after the BOOT attempt until the ruler's cable is remove and re-inserted which makes the dotstar pink again.

Just tried again and the BOOT drive works again, maybe user error.

Let me know if there is anything ...

umbral dagger
#

@meager fog You have me curious. Everything should be her on or before Monday.

meager fog
#

@umbral dagger gr8

strange cargo
#

I noticed the MonsterMask is in the store now(!) but also in the product writeup it says no CircuitPython yet. Does anyone know when a MonsterMask uf2 (even a slow one) will show up on circuitpython.org downloads?

#

... also, I was wondering how it will work to have 2 displays accessible to CP. Will there be board.DISPLAY0 and board.DISPLAY1 or in a list like board.DISPLAY[0]?

meager fog
#

yeah we have not done a mask board definition

#

so its only in arduino for now

#

we'll work up a cicuitpy def but...you can't do more than dispayio stuff, like, the eyeball code will not run, its wayyy too optimized

strange cargo
#

I've been using displayio for text and tilegrids with the other devices and it's great for my purposes. This MonsterMask looks really cool. I just ordered 2. can't wait to play with it. ๐Ÿ™‚

meager fog
#

sweet

#

could display images and animations for sure ๐Ÿ™‚

ruby lake
#

with 3 jobs shipping out over the next week, I might actually get to return to some cp

meager fog
#

yay

manic glacierBOT
onyx hinge
#

@slender iron It looks like I need a way to separately enable audiobusio i2s and pdm. Do you want to see what I come up with, or suggest an approach to me?

#

or I could just stub it out at the same time, the hardware is there and I'm sure we'll want to support it eventually

slender iron
#

@strange cargo I picked one up too to get cp going on it

#

@onyx hinge stubbed out and raising a not implemented error is fine. you may find that after doing pdm that i2s is easy

onyx hinge
#

@slender iron will do

raven canopy
#

is still fuming over discovering that he nuked his PDMIn work... if nothing else, i could've saved you some time.

magic wing
#

Is this the right place to ask about the CP libraries source?

raven canopy
#

@magic wing the Source code zip files don't contain the bundle. they are a GitHub release artifact, as i understand it. the adafruit-circuitpython-bundle-py-20190815.zip will contain all of the libraries in pure .py format.

lone sandalBOT
magic wing
#

Aha, thank you

#

One last basic question -- how do I paste a chunk of code or output in Discord and get it to format it as code?

raven canopy
#

surround it with three backticks:
```
code
```

code

you can even use some pretty printing formatting
```python
>>> foo = "bar"
```

>>> foo = "bar"
#

hehe. oops.

magic wing
#

nice, thank you

manic glacierBOT
#

This expands functionality across the STM32F411VE and STM32F412ZG Discovery Boards. Specific features include:

  • Board, microcontroller and DigitalIO support for the F411
  • USB, internal flash, and FatFS support for the F411
  • I2C support on both discovery boards.
  • Conditionals to support boards without filesystems or low numbers of USB endpoints
  • Minor QOL fixes and additions.
tulip sleet
#

@raven canopy Did you ever push the PDMIn work to your fork? (I guess not, but I have an old clone of your fork.)

manic glacierBOT
slender iron
manic glacierBOT
slender iron
#

finished and pushed 11 minutes ago

#

@raven canopy @onyx hinge obviously I'm working on the github ci stuff. looking very promising

manic glacierBOT
#
  • Discover characteristic descriptors during service discovery
  • Allow specifying Characteristic or Descriptor data length, and allow setting to fixed length.
  • Add GATTC/GATTS read/write for Descriptor.
  • Remove named constants for descriptor UUIDs. Better to just do these in Python.
  • change Characteristic properties from keyword arguments to bitmask.
  • Add setting read/write security levels on Characteristic and Descriptor. Introduce Attribute class as a notional supercl...
slender iron
raven canopy
#

@tulip sleet i think it was a combination of overzealous stashing while changing branches, and deleting branches. its proper nuked. though, if you have a copy of a branch with I2SOut.c/h...that should be at least close to the most recent.

#

gotta run to the store real quick

manic glacierBOT
onyx hinge
#

@slender iron I saw, am excited

lone sandalBOT
manic glacierBOT
pastel panther
#

pats @raven canopy's head

#

<rev lovejoy> "there, there" </rev lovejoy>

onyx hinge
#

got my pdm mic breakouts today but didn't play with that, beyond soldering headers on. Instead, I got reasonably far on stubbing out pdm and i2s, and think I follow a lot of the datasheet things in the pdm section better than before

#

I wonder why they made the way DMA works so different than PWM, it was confusing at first coming from that

#

'night all!

exotic pumice
#

circuitpython when? lol

lone sandalBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
slender iron
#

for all of the boards

manic glacierBOT
tough flax
slender iron
manic glacierBOT
solar whale
#

@tough flax That definitely looks like an error . It works but is unnecessary to repeat. It should be done outside the loop. It's the same in the rfm9x_check as well. @prime flower - do you agree? https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/master/pi_radio/rfm69_check.py#L52 https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/master/pi_radio/rfm9x_check.py#L51

tulip sleet
#

@slender iron This is interesting; I think it would save RAM, but did you already change how the qstr pool grows? https://github.com/micropython/micropython/pull/3962. tools/mpy-tool: Set sane initial dynamic qstr pool size with frozen mods #3962 This was committed after our last merge from micropython. It's an easy change to mpy-tool.

manic glacierBOT
manic glacierBOT
tulip sleet
#

@slender iron mpy-tool change above appears to save 180-200 bytes in RAM after importing part of HID on CPX

idle owl
#

@tough flax No idea! LoRa is @prime flower's domain. He should be able to let you know.

manic glacierBOT
prime flower
#

@tough flax @solar whale Yup, looks like an error. Initialization of the RFM9x object should occur outside the loop.

#

and only happen once

tidal kiln
#

just a history check - looks like encode was enabled for M0 boards at some point? it used to not be in there

#

for strings

manic glacierBOT
manic glacierBOT
swift arrow
#

@slender iron I am still looking thru those sdcard issues.. While my sdcard fix does fix the issue with Samsung cards, I do not see where Arduino is doing that.. So why does theirs just work? I am still digging into it.

#

Maybe I can make some progress on the other sdcard issues as well.. I seem to be learning a lot about sdcards, might as well put it to good use eh? ๐Ÿ™‚

slender iron
#

@swift arrow I haven't looked at the arduino impl recently

#

I really appreciate your work on it. you've been making good progress

#

(I'm looking now)

ruby atlas
#

@slender iron git webhooks and a lambda in AWS that posts to a google sheet?

#

Or something

slender iron
#

or maybe just ping this channel with them?

exotic pumice
#

hey @slender iron I had a question that never got answered and it seems maybe you're not knee-deep in code at the moment. Can I repost?

slender iron
#

ya, or link me to it @exotic pumice

exotic pumice
slender iron
#

trying to get caught up on things now

#

@exotic pumice what is the context?

idle owl
#

@slender iron Or I need to do a sweep weekly but that could leave things unanswered for a week if the timing failed. Could add it to Tuesday/Thursdays as well. So Monday/Tuesday/Thursday I sweep.

slender iron
#

I feel like we should track time to reply on issues and prs

exotic pumice
#

the context is busio/i2c uses a pound-def called NO_PIN and idk what it's value is

idle owl
#

Or MWF would probably work better for tracking purposes.

exotic pumice
#

and it seems odd that it's only defined in samd51 peripherals not samd21

slender iron
#

@idle owl ideally it's more than you just doing it

idle owl
#

@slender iron Fair enough but I think I need to take the lead on it regardless. I can start it and start coordinating others as well.

slender iron
#

๐Ÿ‘

#

@exotic pumice the value varies to make sure it's not a valid pin number

exotic pumice
#

yeah ok, but if you look at the 3rd ripgrep result there, it's in samd51 peripherals, and not in samd21 peripherals, how does that work?

ruby atlas
#

I'd volunteer to do a sweep but I just can't predict my free time well right now.

slender iron
#

@exotic pumice I see it in both: ```
ports/atmel-samd/peripherals/samd/samd21/pins.h
40:#define NO_PIN PORT_BITS

ports/atmel-samd/peripherals/samd/samd51/pins.h
41:#define NO_PIN PORT_BITS

exotic pumice
#

oh ok

#

so it's 84 for samd21 then

simple pulsar
slender iron
#

but it doesn't really matter as long as it's an invalid pin number

#

@simple pulsar yup

exotic pumice
#

thanks

idle owl
#

@simple pulsar @slender iron I'll take a look at it.

tidal kiln
slender iron
#

afaik we only track days with the gap between last unreleased commit and now

idle owl
#

And yeah the days thing is only for releases.

tidal kiln
#

ah, ok.

idle owl
#

GitHub was failing to update that issue anyway. Ran into nothing but issues with it.

tidal kiln
#

issues with an issue? you should open an issue.

#

so maybe just some tweaks to that webpage? run more often and (if possible) add better visibility for numbers of days?

#

@idle owl should that issue be closed and sticky removed? leave a comment to check webpage instead?

idle owl
#

I did open an issue. ๐Ÿ™‚

#

I'll talk to Sommersoft about updating adabot to do better PR/issue tracking

#

And I thought I did those things, I'll go do them in a bit here. Yes to both questions.

slender iron
#

thanks all!

manic glacierBOT
tidal kiln
#

i'm updating a README in a CP library
OK to delete the "Building locally" section while I'm in there? We removed that, right?

quasi tendon
#

@simple pulsar I'm trying to work on this JSON issue. Got a minute?

exotic pumice
#

@slender iron do you have a suggestion on how I should handle the static inline void gpio_set_* functions I can't extern?

#

I could maybe steal some stuff out of atsamd-hal idk

manic glacierBOT
slender iron
#

@exotic pumice ya, you can just reimplement against the registers directly

exotic pumice
#

okie dokie

#

it's actually kind of hard to figure out how to write directly to a register with all the hal indirection we both have XD

#

like, the address to write to

tulip sleet
#

@slender iron itโ€™s very satisfying to test BLE when it works. Probably same for display stuff. Three different devices chugging away here: two talking to each other, one talking to phone

slender iron
#

nice!

manic glacierBOT
manic glacierBOT
manic glacierBOT
tulip sleet
#

@slender iron done with CurrentTimeClient review fixes I did manage to cause it to crash by doing an auto-reload while testing. That's what alphas are for. ๐Ÿ™‚

slender iron
#

๐Ÿ™‚ yup

manic glacierBOT
slender iron
#

@tulip sleet merged. going heads down into eink now

manic glacierBOT
slender iron
#

I was caught up on email but I'm probably behind already

manic glacierBOT
river quest
vivid temple
#

@solar whale jerrynLast Thursday at 2:54 AM @iXiiON#3390 for the benefit of others, can you describe what you had to do to make it work? I put the UF2 bootloader on mine so I don't use nrfutil. -- i'm not aware about an uf2 bootlader for the makerdiary usb dongle. So i used the *.hex file, to make it work you have to unplug the stick, press and hold the button and then plug it back into the usb port then the device seems be be ready to be flashed. nrfutils can then write the *.hex file on the device and ciruitpython runs.

keen ocean
#

Greetings <@&356864093652516868> Has anyone successfully connected their #circuitpython-dev devices and scripts onto AWS? Other public clouds? Thanks in advance...๐Ÿ™

manic glacierBOT
tough flax
manic glacierBOT
#

I have my J-Link connected to the PyRuler:

I looked at the attempts to change the color of the LED during the boot process and it looks like it is trying to set it as expected but the LED is not responding -- it just stays magenta.

(gdb) mon reset
Resetting target
(gdb) cont
Continuing.

Breakpoint 3, new_status_color (rgb=<optimized out>, rgb=<optimized out>) at ../../supervisor/shared/rgb_led_status.c:168
168	    current_status_color = rgb;
(gdb) traceback
Undefined comm...
onyx hinge
#

Goal for the day: dma something from the pdm device into memory on nrf. I think the data comes out as signed 16 bits at 16kHz...

raven canopy
#

tip: you need to create an event handler in PDMIn.c to handle the buffer pointers from nrfx. ๐Ÿ˜‰

onyx hinge
#

I wonder, whether it's feasible to generate test waveforms for pdm... Or if I have to rely on the mic

#

Should I be using nrfx "high level" APIs, vs low level register operations? I did the latter for PWM audio out

raven canopy
#

i'd say that's up to you. as long as the cake comes out, it doesn't matter? ๐Ÿ˜†

onyx hinge
#

If there is a general preference among the developers I'll try to follow it

#

Unless nrfx is regarded as buggy, probably better to use it...

pastel panther
#

@keen ocean @prime flower Would be a good person to ask

crimson ferry
#

Is there any reason why bootloader mode would draw more current than CIRCUITPY mode? iOS 13 iPhone can see CIRCUITPY, but throws a dialog about requiring too much power for bootloader mode.

manic glacierBOT
raven canopy
#

@crimson ferry only thing i can think of is a difference in the USB descriptors passed in by both modes. iOS may be expecting a descriptor that isn't passed in during bootloader mode, or a descriptor has a value that triggers that "warning".

crimson ferry
#

@raven canopy Thanks, hadn't thought of that. I have a powered connector coming, I'll see if that helps. I'm trying to see if I can update UF2 from my phone ๐Ÿ™‚

raven canopy
#

that'll be interesting. and, downright awesome.

idle owl
#

We need to remember to do a 5.x lib bundle when we release 5.0.0.

idle owl
raven canopy
#

and maybe drop 2.x bundles? ๐Ÿ˜„

idle owl
#

@raven canopy I know ๐Ÿ˜„

timber mango
#

Hello.
I want to know about esp32 with micropython.
I'm trying to use ble on esp32 with micropython.
I found esp32--bluetooth.bin in Firmware for ESP32 boards`(http://micropython.org/download#esp32)
And esp32 succeeded bluetooth.
However it's CLASSIC Bluetooth.
I want BLE(Bluetooth Low Energy)
Should I??

onyx hinge
#

@timber mango I know that the micropython supports the esp chips, while circuitpython doesn't (circuitpython has chosen to support only devices with native USB support). I don't know whether BLE is technically possible on ESP32.

#

hm, interesting -- remember when we discussed signed vs unsigned audio samples? It seems like pdmin is set up to only permit unsigned 16-bit samples, hm.

#

ValueError: destination buffer must be an array of type 'H' for bit_depth = 16

timber mango
#

@onyx hinge I'm sorry, question about micropython is not good.

onyx hinge
#

It's OK, we might just not be able to give the most accurate information about it

onyx hinge
#

status: I can VERY FAINTLY hear my shouting over a lot of background noise

#

(when recorded via pdm and then played back on the speaker)

#

I would have expected full silence (unchanging PDM values) if I hooked DATA to GND or +3v3, but that's not what I get.

#

yeah, my signal is definitely there but there's a lot that is NOT my signal. I guess I could /should run this same code on my cpx and see how the quality is, for comparison.

#

@idle owl There are a lot of modules that need fixing for audiocore too, though we could also still decide to alias audioio.WaveFile et al from audiocore just for 5.x .. (I know, scott disagrees with that)

idle owl
#

@onyx hinge It's still worth discussing. Will you be around Monday?

onyx hinge
#

@idle owl I think so, but I haven't checked my work meeting schedule. If I don't have something at that time, I will "take lunch" and join the meeting

idle owl
#

@onyx hinge Ok. We can also have a chat outside the meeting.

onyx hinge
#

I should also go ahead and make a PR, just to make sure it's as simple and light on memory as I think it is

idle owl
#

We like them early and often. ๐Ÿ™‚

onyx hinge
#

I hope I got the dimensions right on this bezel. It should look pretty sharp in two colors once it's 3d printed

onyx hinge
manic glacierBOT
#

I believe we should do this because it's easy, and it makes a better user experience, especially if we have any concerns about circuitpython modules not getting updated in time for the 5.x release.

Testing performed: That the shipped .mpy files on a PyPortal (CP 4.x) still work (play audio) with this branch, instead of giving an exception because WaveFile can't be found in audioio.

Flash usage grew by 28 bytes. (I expected 24, there must be some other effect on size/alignment that ...

slender iron
#

@onyx hinge To test audio in I play a tone with my phone next to the mic

#

then you can play it back and capture with a scope or saleae

manic glacierBOT
meager fog
#

@onyx hinge hihi

#

i saw yr email, i can help ya here - fastre than going back n forth

onyx hinge
#

hi @meager fog !

meager fog
#

ok for PDM - ive just done it a few times

#

so i know Things

onyx hinge
#

I'll head back down to the python cave

meager fog
#

okie

#

later is ok too

#

i just saw yr mail about it

onyx hinge
#

I can do at least 40 minutes right now if it's a good time for you

#

ok, which part of this whole thing do you want to start with?

meager fog
#

yah

#

ok so first up, lets check the clk freq

#

on your scope/logic - whats the mhz of the squarewave on clk

onyx hinge
#

scope says 1.03MHz

meager fog
#

ok so did ya read about how PDM works

#

i also did a vid

onyx hinge
#

I know it in general terms, the DATA pin is going to be asserted by the mic according to the edges of CLK and the intensity of the measured sound

meager fog
#

yah and you oversample

#

since its only 1 bit

#

you need to collect lots o bits

#

1MHz = 16KHz x 64 bit oversampling

onyx hinge
#

I think in the nrf the hardware is doing that part

meager fog
#

which is totally fine

#

what do you end up setting in the perif

onyx hinge
#

there is a register for 64x or 80x oversampling

meager fog
#

64 is plenty for now

#

ok so thats good

#

when you look at the DAT line

#

and you blow into the mic, you see it moving more?

onyx hinge
#

nrf_pdm->PDMCLKCTRL = PDM_PDMCLKCTRL_FREQ_Default; // For Ratio64
nrf_pdm->RATIO = PDM_RATIO_RATIO_Ratio64;