#circuitpython-dev

1 messages · Page 309 of 1

pastel panther
#

(and _read_register)

#

@balmy sail do you have more than one ADXL343 sensor ?

#

or 345

balmy sail
#

2x 343s

pastel panther
#

what micro are you using ?

balmy sail
#

pi zero, but also have pi4 if we need

#

also have a load of different arduinos

pastel panther
#

any circuitpython compatible boards?

#

not a bit deal if not

balmy sail
#

the pi's are compatible arent they? im using circuit python on the zero with i2c and he adxls

#

ah yeah, ive got a couple of m0 feathers

pastel panther
#

kinda? They technically run normal CPython and use Blinka to allow the circuitpython libraries to be used

#

I don't know that it matters either way.

solar whale
#

@slender iron sorry -- I tried your esp32s2-busio branch and the I see the same behavior on Linux -- still fixed by Mac.

pastel panther
#

I'm just used to primarily working on new drivers on a Metro M4/ Feather M0, etc.

#

@balmy sail let's stay on the Pi for now

balmy sail
#

ok

#

im happy to swap if need be

pastel panther
#

it would be useful to test the I2C and SPI side by side, so if it's not too much trouble, try to get the second 343 working on the other pi

balmy sail
#

ok

pastel panther
#

I think it may be useful to see what if any quirks there are to working on the Pi, but it it gets annoying we can switch

balmy sail
#

thats easy then, ive already got them working on i2c on the zero, can use the pi4 for spi

pastel panther
#

great!

#

lmk when you've made a fork of the existing library and checked out a copy of your fork on the Pi4

#

also let me know if you're not familiar with anything I'm suggesting

solar whale
#

@slender iron I was using this build ```Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 2.0.0-7343-g3621fc08b on 2020-05-28; Saola 1 w/Wrover with ESP32S2

ionic elk
#

@indigo wedge where did you get the pin definitions used in the pins.c for the EVK?

#

I'm finding some issues

#

Not that it's easy, do you find NXP's documentation to be like, obnoxiously bad?

indigo wedge
#

you can download the HW files from nxp.com and there's schematics there

ionic elk
#

Ok cool that's what I'm looking at

indigo wedge
#

I find all HW documentation bad 😉

ionic elk
#

But like dang they don't even give you a table for the Arduino connections, you have to piece them together over like three sheets

#

I've got the schematic open it's all good

indigo wedge
#

ah ok

ionic elk
#

I was just wondering if you'd found a pin table somewhere else that was conflicting

pastel panther
#

@balmy sail I'm going to be in a different window so please @ me as much as needed to get my attention

balmy sail
#

will do, thanks for all the help

pastel panther
#

same to you!

slender iron
#

@solar whale let me push the latest

#

ok, pushed as c17a87d8e

solar whale
#

got it -- building now

slender iron
#

I am curious to see if it helps the FS problem

#

I should probably split that fix out if it does

solar whale
#

oohh -- first test is OK -- let me erase and do a clean flash

slender iron
#

🤞

solar whale
#

wooho! -- it works!!

#
boot_out.txt  lib
slender iron
#

ok great!

manic glacierBOT
ionic elk
#

@slender iron @indigo wedge Have you ever had a DAPLink on an mimxrt EVK get stuck in this "MAINTENANCE" mode?

#

I can't tell if my board has just bricked itself or what but I can't program it over either the DAP or JLink anymore

indigo wedge
#

hmm, i remember it happening to me once i don't quite remember how i got out of it

manic glacierBOT
indigo wedge
#

@ionic elk it might be i downloaded the daplink fw for the evk and copied it over and that exited the mode

ionic elk
#

Normally when an MBED dap is in maintenance mode that's a reset pin related thing but I'm not pressing anything and the Jlink isn't even plugged in

#

so you had to re-flash the DAP firmware?

indigo wedge
#

i can't quite remember if it was this evk or another one so dont take my word for it

ionic elk
#

how does a DAP screw up its own programming? what the heck man

manic glacierBOT
manic glacierBOT
ionic elk
#

My other SPI devices work just fine

indigo wedge
#

Hmm, not sure if I have one on hand

manic glacierBOT
#

Another interesting case of timing in CircuitPython: Question about stepper motor control

A user is interested in achieving a certain rpm with a stepper motor and the discussion yields a suggestion which is likely to be interepreted as a while/for loop with 'kit1.stepper1.onestep(direction=stepper.FORWARD, style=stepper.INTERLEAVE); time.sleep(0.006)' in it.

raven canopy
#

Teensy noob fail. didn't realize they don't have JTAG broken out on the board. back to the retailers of fine devkit boards... 🤦 🤣

slender iron
#

yeah...

#

@solar whale I'll have a branch with fixes but not busio here shortly

manic glacierBOT
slender iron
#

☝️

rose dust
#

@tulip sleet and @simple pulsar thanks for the help. Have the Clue working as a display for BLE beacons now. It is decoding Ruuvitag and TLM data so I can see temps around the house.

tulip sleet
#

very nice!

solar whale
#

@slender iron will try esp32s2 later or in morning. Is it necessary to reinstall esp-Idf after the changes or are they picked up automatically?

slender iron
#

@solar whale you shouldn't need to reinstall, just update the submodule because we actually use that one

#

the other is just used to install the tools

solar whale
#

Ok. Thanks

slender iron
#

np, thanks for the help!

tulip sleet
#

@slender iron I have a q re bleio_scanentry_data_matches() in shared-module/_bleio/ScanEntry.c. I am not sure it is doing what I think it should do. Looking at the else if (!any) { part, which would seem to me to return false prematurely if the first prefix doesn't match the first structure.

#

i thought it was trying match the first prefix against all the strcutures. If it can't and !any is true (i.e., all), then it should give up

slender iron
#

ya, sounds right

tulip sleet
#

i was writing the python equivalent and couldn't suss it out. OK, I'll see about fixing it.

manic glacierBOT
slender iron
#

thanks @tulip sleet. this is what happens without unit tests...

tulip sleet
#

yah, i really want to write unit tests for the advertisement parsing I am writing in Python.

manic glacierBOT
slender iron
#

@vale spire you ever debugged a "byte code not implemented" error? Maybe on esp?

tulip sleet
#

@slender iron I wonder if you are just reading bad data

slender iron
#

with the byte code thing?

tulip sleet
#

yes, maybe see when it happens and see whether the adjacent bytecodes make sense. Maybe it's an edge condition on a page read or something

#

is it an imported mpy?

slender iron
#

it's not a file reading issue because it's a regular .py

#

so it parses ok

#

so it's something around import

tulip sleet
#

is esp32s2 tossing things in and out of ram?

#

i thought it was doing some "paging" possibly?

slender iron
#

it does have instruction and data caches but I don't think that's the issue

tulip sleet
#

i meant manually, i thought maybe the esp8266 was doing that, or maybe that was flash sections

slender iron
#

I don't think it is

tulip sleet
#

if you make the program bigger or smaller does it change?

slender iron
#

it's about as small as I can get it

tulip sleet
#

(but my original theory of a bad .mpy read is shot)

slender iron
#

it does go away if I print every gc alloc

#

though it may crash later

crimson ferry
#

Probably unrelated, but I did see "byte code not implemented" early on with esp32s2, but I attributed it to unerased flash (possibly some kind of memory/pointer issue a factor). Not really sure.

slender iron
#

it may be the weird stack things

#

@crimson ferry I bet it's the same issue

crimson ferry
#

I haven't seen it since I started erasing always before flashing ...could be coincidence

tulip sleet
#

the printing is maybe forcing somethign out of a register

slender iron
#

yup

#

@crimson ferry are you importing libraries?

crimson ferry
#

No, only core modules

slender iron
#

ya, it's something to do with a py module

#

my testlib.py is:

#
print("running import")

def hello(param):
    print(param)
#

code.py is:

#
import testlib
testlib.hello("world")

print("hello top level")

def nested():
    print("hello nested")

nested()
#

the testlib.hello call fails

crimson ferry
#

If I run that, but delete the hello function and comment out the call in code.py, it never gets to the "hello top level" and subsequent attempt to save makes the drive disappear (time to re-erase and re-flash)

#

(Guru Meditation Error)

slender iron
#

yup, that's what I'm seeing

slender iron
#

kk, got it fixed

tulip sleet
#

sooo, what was it?

slender iron
#

the register window hiding stack values

orchid basinBOT
slender iron
#

fix is incoming. just added another comment

manic glacierBOT
#

From the change:

// xtensa has more registers than an instruction can address. The 16 that
// can be addressed are called the "window". When a function is called or
// returns the window rotates. This allows for more efficient function calls
// because ram doesn't need to be used. It's only used if the window wraps
// around onto itself. At that point values are "spilled" to empty spots in
// the stack that were set aside. When the window rotates back around (o...
solar whale
#

@slender iron just tried latest master on esp32s2 -- FS works OK on linux -- blinky works (time.sleep() still won't go below 1 second) Anything in particular you want me to try?

slender iron
#

@solar whale the newer fix should make imports work

solar whale
#

library imports? I have been importing blink.py ok

slender iron
#

ah, I think it's calling something from a library that fails

solar whale
#

ok -- have not tried

#

trying to think of something to try that does not use busio...

slender iron
#

I just made a library with a function that prints (posted above)

solar whale
#

ok -- that works ```
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.4.0-beta.0-389-g6ace4ee7e on 2020-05-28; Saola 1 w/Wrover with ESP32S2

import test
running import
world
hello top level
hello nested

#

but as code.py I get ```
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
running import
NotImplementedError: byte code not implemented

slender iron
#

ya, that should be fixed now

#

dan just merged it

solar whale
#

ah -- will pull

slender iron
#

tomorrow will be busio debugging on the stream

crimson ferry
#

naïve question... for a completely new processor family like xtensa, I assume the .py-to-bytecode is the same, but bytecode-to-C for the port has to be written or heavily tweaked? Was the ESP32-S2 able to use a good chunk from MicroPython ESP32? (otherwise, the port seems to have gotten where it is insanely fast, even considering how much work has gone in)

solar whale
#

all good now ```uto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
running import
world
hello top level
hello nested

#

What time is your stream tomorrow?

tulip sleet
#

@crimson ferry the python VM is pretty much the same, since it's C code executing the byte codes. The new work is implementing the peripheral modules (digitalio, etc. etc.), and also accomodating peculiarities of the architecture.

solar whale
#

Thanks, tough time for me, but I'll watch it later.

tulip sleet
#

the ESP32 has idiosyncrasies, and the underlying HAL library Scott is using has a complicated build structure.

solar whale
#

idiosyncrasies -- you are being very kind...

crimson ferry
#

Thanks, Dan. peculiarities and idiosyncrasies... wouldn't want it to be boring 😉

solar whale
#

@slender iron I saw a note in the last PR about fixing time.sleep() not to crash. It still doos not go < 1sec -- is that correct?

slender iron
#

@solar whale I haven’t looked into that yet so I don’t know.

solar whale
#

np. Thanks.

manic glacierBOT
bleak tiger
#

Is there a podcast of this weeks CircuitPython meeting? I’d like to catch up!

raven canopy
simple pulsar
#

@solar whale When you say '<1sec' for time.sleep() do you mean below millisecond resolution?

solar whale
#

no - if you put in .25 sec -- it delays 1 second

simple pulsar
#

Is that only on a specific CP version or specific boards? I may have missed some context here on the conversation.

solar whale
#

yes only on esp32s2

#

clealy a WIP -- no concern

simple pulsar
#

@tulip sleet For https://github.com/adafruit/circuitpython/pull/2974 is there a performance argument for doing the "spill" conditionally if it's only needed for GC? At the moment there only appears to be one other execution of cpu_get_regs_and_sp in the code and I think it's a one-off but I'm just wondering if it's more future-proof if it's conditional?

GitHub

From the change:
// xtensa has more registers than an instruction can address. The 16 that
// can be addressed are called the "window". When a function is called or
// returns the...

tulip sleet
#

@simple pulsar I have not looked in detail at this, @slender iron would be more up on the code. I think we might also look at what MicroPython did for ESP32 (and maybe that's where @slender iron got the idea).

simple pulsar
#

Interesting. I'd never even heard of xtensa before this. My coffee table is made out of old SPARC IPXs though so I have a constant reminder of register windows 🙂

tulip sleet
#

do you have a picture of that coffee table? 🙂

manic glacierBOT
onyx hinge
#

good morning!

lone axle
#

Is it possible (and/or relatively easy) to create a build of Circuit Python for a specific device that does not include the USB Serial connection? So it won't connect to the host device via serial which means that REPL and serial console will be inaccessible?

bleak tiger
#

Thanks @raven canopy I usually listen in on apples podcast service.

onyx hinge
#

@lone axle I'm sure it's possible, but I don't know how. Is the goal simply to prevent UART access, or is it to reclaim flash space ?

tulip sleet
#

@lone axle yes, it's not hard, you have to adjust USB_DEVICES .mk variable. I have such a build for an HID volume control I am using.

lone axle
#

I want to have multiple devices connected to a host machine (Android if it matters) but only have 1 of them show up as /dev/ttyACM0 and not have any of the rest connect. That way I can always be sure to find my device at /dev/ttyACM0 instead of some other number.

#

Thank you!

solar whale
#

only the first to connect will be /dev/ttyACM0

#

the rest will connect but as /dev/ttyACMx

onyx hinge
#

@lone axle linux ?

lone axle
#

@solar whale right. So by preventing all of the others connected to serial at all I can be sure that I'll only ever have /dev/ttyACM0

#

@onyx hinge yes mostly... Android.

onyx hinge
#

On my debian linux system, there is a neat feature called serial by-id. A given device will always have the same name within this directory. However, your software has to be prepared to use such filenames

solar whale
#

ah -- misunderstood

onyx hinge
#

/dev/serial/by-id/usb-Adafruit_Industries_LLC_Feather_STM32F405_Express_24002500F005D42445632302-if00

tulip sleet
#

change USB_DEVICES in the mpconfigport.mk for your board to be something like:

USB_DEVICES = "MSC,HID"

default is "CDC,MSC,AUDIO,HID"

onyx hinge
#

e.g., this STM32F405 always appears at exactly this path

manic glacierBOT
onyx hinge
#

there's also by-path, so /dev/serial/by-path/pci-0000:02:00.0-usb-0:2.4:1.0 should always indicate the device plugged into the specific port

#

but I dunno if android has these nice things

lone axle
#

Ooooh, That is neat. I don't seem to have a by-id directory in /dev/ on this device though. This happens to be a fairly cheap no name Android tablet, I'm sure the specific implementation of Android on this device is a bit wonky.

onyx hinge
#

I really like it. It's even better in combination with the program tio which is a simple terminal program which can automatically reconnect. So when I tio /dev/serial/by-id.... it will keep the terminal open even if I reset the device with the reset button

#

just to repeat, /dev/serial/by-id , by-id is not directly in /dev.

lone axle
#

nifty!

raven canopy
#

the joys of systemd/udev/sysfs!

#

i've spent too much time in that space lately. 😄

topaz quest
#

@onyx hinge I had not seen tio before — that is .. impressive

slender iron
#

@tulip sleet For https://github.com/adafruit/circuitpython/pull/2974 is there a performance argument for doing the "spill" conditionally if it's only needed for GC? At the moment there only appears to be one other execution of cpu_get_regs_and_sp in the code and I think it's a one-off but I'm just wondering if it's more future-proof if it's conditional?
@simple pulsar The only other call is when getting the stack bounds and it's done only a few times. We have much bigger performance things to worry about than this.

GitHub

From the change:
// xtensa has more registers than an instruction can address. The 16 that
// can be addressed are called the "window". When a function is called or
// returns the...

topaz quest
#

now I need to find how to install it on openSUSE

slender iron
#

looks up tio for mac

topaz quest
#

it says it supports FreeBSD so I guess it should work

slender iron
#

it's on brew 🙂

topaz quest
#

reminds me I need to figure out how to install brew on new job's mac

simple pulsar
#

@slender iron I was not referring to current issues, more future ones.

manic glacierBOT
#

Testing the SPI module of the 1010 EVK shows normal results with a BMP280, but has no results with a 128x32 SSD1306 using DisplayIO (screen cross-tested on an STM32 to make sure it works). This could indicate a problem with either SPI or the DisplayIO module on the mimxrt port.

I don't currently have an I2C version of this screen, or another OLED screen to test with, so if anyone else has a DisplayIO device and a 1010 EVK they could verify this with it'd be helpful. I have this problem bo...

onyx hinge
#

@ionic elk apologies if it's already been suggested, but is the SPI bus rate right? If it's wildly wrong (too fast) maybe some displays still work and others fail due to being out of spec

#

should be quick to verify which is why I suggest it

mental nexus
#

Q. High Memory Usage of Label: I'm working on a Markdown parser/renderer and am using a bunch of 'label' instances to draw the text on the screen. Label seems to use quite a bit of memory for each character in a tileGrid. For example, it uses at least 208 bytes for a 8x9 pixel 'a' character (maybe as much as 240 bytes when it's all done). I originally expected that the tileGrid would just use a pointer back to the original glyph.bitmap, but since it uses so much RAM, I'm suspicious that it's make a "copy" of the bitmap. Do you guys have any insights into what is causing the RAM usage and any options for reducing the memory usage? Important: I want to use a proportional font, so using an fixed (x,y) grid terminal approach is out.

onyx hinge
#

@mental nexus each tilegrid instance has a lot of associated data, and the design of the on-disk font code also uses one Bitmap for each distinct glyph that is loaded. It leads to a lot of excess memory usage.

#

@mental nexus and a "label" is made of one tilegrid for each glyph

#

but I see you have already encountered that issue

onyx hinge
#

while that's the status quo we'd love to see someone improve things

mental nexus
#

Thanks @onyx hinge understood about one tileGrid per character. However, I'm confused about how tileGrid is using the bitmap. The label function passes in the glyph.bitmap, which I assumed was a pointer. But I'm suspicous that something more nefarious is going on. Otherwise, by looking at the C code, I didn't think there was so much overhead would take up that much space 200+ bytes per character.

#

The outcome is that if I want to write text to the whole screen it would take less memory just to keep a display buffer bitmap and manipulate that. In reality, I think I'm missing something here.

onyx hinge
#

displayio_tilegrid_t has a lot of fields. I agree they didn't seem to add up to 200 bytes when I checked just now, though

mental nexus
#

I couldn't decipher everything in there but it didn't seem like it would take 200+ bytes of overhead for a "single-tile" label with one glyph. That's why I was wondering if it was somehow grabbing the bitmap and copying it, but I couldn't comprehend everything in there. [FYI I estimated the # of bytes used by a pre/post comparison of gc.mem_free() before and after the tileGrid instantiation inside the label function.]

onyx hinge
#

200 bytes seems in the general area of what I recall

manic glacierBOT
#

@tannewt @arturo182 Ok, I think this should be good to go. I've run quite a lot of tests on all the Busio modules along with DigitalIO and AnalogIO, and I've only had one breakout issue so far (#2977). Everything else seems to be pretty good - DigitalIO has all the right pullup and drive behavior, AnalogIO gets good resolution, and Busio works as expected on everything but the displays.

Since I was running so many comparisons, I also dug up some STM32 issues while working on this. Seems li...

onyx hinge
#

You're 100% right that it's extremely limiting and it's hard to see a way for non-core code to improve on things. I don't think anybody is allocated time to work on it at the moment, so in a sense we're depending on the community to help us out.

ionic elk
#

@onyx hinge I tried some lower rates yeah, and the exact same sketch (copy pasted) works on STM32

#

It might still be something simple, I haven't looked into it too closely other than verifying that the SPI pins were working and at least trying to make it work. My primary goal for my i.MX testing PR was to turn the vague issues - "test this thing" - into specific ones.

#

Fortunately, haven't run into anything other than that one displayIO issue! Which is good because the STM32 bugs are piling up lol

mental nexus
#

Thanks @onyx hinge just wanted to make sure I wasn’t missing something with the current label code.

onyx hinge
ionic elk
#

@onyx hinge Oh dang maybe that Label thing was why my unicode stuff was so unbelievably slow.

#

I'm working with Joey's Babel code this weekend. Maybe I'll turn up something useful.

#

Man, what possessed NXP to connect a bunch of the pins on their Arduino connector and then not document that anywhere but on the schematic itself?

#

Just wanted it to be a fun easter egg for people to find out that D2 is hardwired to D10 and D3 to D13??

#

big oof

manic glacierBOT
mental nexus
#

Thanks @onyx hinge seems like I’m not alone here. But I’m unsure I have enough expertise yet to help out with improving the core code. But definitely there should be a better way. Thanks for the insights!

manic glacierBOT
#

During the implementation of low power mode a couple of Discovery boards were mistakenly marked as having low power crystals, but actually only have DNP slots that require the user to install them. This resulted in these dev boards being unable to boot fully due to infinite loops on failure in some of the STM32 HAL functions.

This PR sets the Discovery boards crystal settings based on their manual data, which should help with the boot problems. Unfortunately, I don't have most of the Disc...

timber mango
#

the joys of systemd/udev/sysfs!
@raven canopy I am also working in that space. In my case, I believe it is not enabled in the UDOO Bolt kernel. 😦 I submitted an issue to change that.

raven canopy
#

I am also working in that space. In my case, I believe it is not enabled in the UDOO Bolt kernel. 😦 I submitted an issue to change that.
@timber mango it seems a strange approach to pipe the GPIO solely through the ATMega on that board. but, i guess it does allow them to skip things like devtrees/etc.

manic glacierBOT
#

Add support for the GigaDevices GD25S512MD 64 MiB flash chip. This chip is pin-compatible with the Macronix MX25L51245G added in https://github.com/adafruit/circuitpython/pull/2731 .

Additionally, the GigaDevices GD25S512MD uses multiple status bytes whereas the Macronix uses only a single status byte, so it gave me more opportunity to more thoroughly test the fix involving CMD_READ_STATUS2: https://github.com/adafruit/circuitpython/pull/2847 .

I believe all of the chip parameters are c...

mental nexus
#

@onyx hinge @lone axle I rolled a new text label functions to avoid any tileGrids and write to a display-sized bitmap buffer. Speed is similar but memory is way reduced. I call that a win. I’ll create an issue post the three simple functions I am using. Maybe it will give others a starting point to improve from.

onyx hinge
#

@mental nexus neat! you might also consider turning it into something that can go in Community Bundle.

timber mango
#

@raven canopy Even more strange, on the UDOO Quad, all the external pins are connected to both the main CPU and the Arduino compatible chip. Personally, I think that is just asking for trouble.

raven canopy
#

@timber mango yeah. UDOOs are really interesting designs. more than i could do, so i don't mean to come off as critical. it just seems a headache to use outside of that constraint.

mental nexus
#

Thanks @onyx hinge for the encouragement. Clearly this is a pain point so maybe it can help make someone else’s life easier! I’ll read up on contributing to the family community libraries.

timber mango
#

yeah. UDOOs are really interesting designs. more than i could do, so i don't mean to come off as critical. it just seems a headache to use outside of that constraint.
@raven canopy There are reasons I do not particularly like the UDOO Bolt, so I understand. It is so new that I do not think UDOO has done all they could for the initial release. I think they hurried it a bit to get it out. There are many holes that need to be plugged, especially for developers.

lone axle
#

@mental nexus Cool! I look forward to playing around with it some.

manic glacierBOT
mental nexus
#

In order to reduce the memory usage of the label function (Adafruit_CircuitPython_Display_Text library), I created a library that uses a bitmap buffer for text writing. The textMap library and an example can be found here: https://github.com/kmatch98/CircuitPython_textMap @lone axle @onyx hinge

lone axle
#

@mental nexus Nice! Looking into this now over some coffee

mental nexus
#

@lone axle coffee is a great idea! Here it is in action. It’s not going to be super fast but gets it the job done with less RAM.

lone axle
#

Cool!

#

Had to tweak a few things to get it running on Edge Badge with the builtin screen but got it working now. It is fairly quick on there actually. Though right now some of the text is not on the screen since it's smaller.

lone axle
#

same speed with the pink and teal boxes moved onto the screen

mental nexus
#

Looks good to me. For the NRF52840 I have about 65kB remaining. It looks like there is some memory leak per time through the while loop but seems to work comfortably for now.

#

In doing this I discovered that the builtinFont (terminalio.FONT) is structured differently than the BDF loaded fonts. The built in font is a fixed dimension font and seems to be designed for easy use with tileGrid. If you want to use terminalio.FONT we will have to adjust this library to accommodate it.

timber mango
#

Could BDF fonts be easily converted on the fly to a terminalio.FONT format?

mental nexus
#

@timber mango I think it may be easier the other way around to convert the built in to the BDF style. The reason is that the BDF style handles proportional fonts (each glyph can be a different size) while the built in just has a fixed size.

timber mango
#

I guess that is the price of proportional fonts. In that case, should not all fonts used be BDF style?

mental nexus
#

I’m unsure of the history of the built in font but the fixed fonts are good if you want to put it in a tileGrid.

crimson ferry
#

I use fixed fonts almost exclusively (and terminalio.FONT extensively due to its low memory footprint) so that it's easy to align columns. (And have predictable text widths that don't depend on the letters used)

timber mango
#

hey guys, sorry to interrupt. quick question of the topic, do you know if it is possible to execute two functions in the same time? Thanks 🙂

crimson ferry
#

No, but you may be able to create the appearance of simultaneity by structuring the actions within timing loops.

#

Also, certain kinds of inputs can be buffered to be handled within a code loop as time permits (see: gamepad, pulseio, etc)

timber mango
#

i just try to blink some led in same time (one on a strip and one on the Playground express...

#

is it possible to do that in Make Code ?

#

thanks @crimson ferry i will have a look!

manic glacierBOT
kind river
#

@timber mango I've had good luck using generator coroutines

timber mango
#

@kind river hi. Can you be a little more specific, i'm just a noob :/

kind river
#

I'll try to find the tutorial I used

timber mango
#

😉 thanks. you tube reached the end of my abilities for the moment 😄

timber mango
#

thanks i will have a look

kind river
#

@timber mango It's a bit complex if you are new to python. Feel free to ping me with any questions

timber mango
#

sure will 😉

rich merlin
#

Does the rfm9x listen() function allow the radio to asynchronously receive and store packets, that I get later using receive() ? I am using an rmf9x M0 feather and the receive() method w/ a timeout. I really need the M0 to do other things, and wish my code wasn't blocked during the wait. I didn't understand the explanation for listen(), but I'm hoping it will help with my situation. I also wonder if the receive() parameter 'keep_listening' will help.

lone axle
#

@rich merlin I don't think it will receive asynchronously exactly. But you can call listen() in your main loop and it will return None after a timeout period if there is no message received. Then you can do some other work and eventually loop back around to check again.

#

I do believe the library will "remember" the incoming message even if it comes while you are not actively in the middle of a listen() call the message would get returned to you the next time you call listen() even if some time has passed since the message was actually sent/received. I'm not 100% certain though.

rich merlin
#

@lone axle your description of listen() matches what thought receive() did (or should do).

lone axle
#

@rich merlin Ah, sorry yeah I think I confused those two sorry about that receive() is what it is called

solar whale
#

Without interrupts, there is no real way to not block. I hate to admit it, but the Arduino Radiohead library will work better for that. Also be aware that the feather M0 rfm9x will be very memory constrained under CIrcuitPython.

#

There has been some discussion of trying to add some interrupt support for such devices but it is a a ways off.

rich merlin
#

@solar whale I now see the keep_listening parameter to send() and receive(). And I see how those methods call listen() after they are done if keep_listening is true. So if I use keep_listening=true, then (I think) while my CP main loop is off doing other things, the radio will be putting the next incoming packet into the FIFO and will set rx_done. So when my CP loop comes around to receive() again, the method will return right away, returning the packet that came in while I was busy. Is this correct? If so, I'm happy.

solar whale
#

@rich merlin I agree it should work that way in principle, but looking at the code, there may be a problem with that -- this line https://github.com/adafruit/Adafruit_CircuitPython_RFM9x/blob/master/adafruit_rfm9x.py#L863 will cause the Mode to be set to reset to RX and if I recall correctly, that causes the input FIFO to be flushed. I may be mistaken and need to review the datasheet. I recall experimenting with this in the past and I think this part should be revised to fix this. It seems to circumvent the whole purpose of "keep_listening". I will look into this tomorrow and see if I can verify the operation and possible workaround. Thank you for raising this. I will open an issue in the repistory to track this.

#

I may be confusing things -- In a quick look at the data sheet _ I don't see why there should be a problem, The issue may have been with switching between transmit and receive. It may well be OK as is. Please give it a try and let me know! I'll dig deeper into this tomorrow an report back.

rich merlin
#

@solar whale I see why you wrote the issue. I have a pair of Feather M0 with RFM95 cards and will try to write a test.

#

I have been wondering: What do expect would happen if more than one packet arrived before I called receive()? Which packet would receive() return? (first or last)?

solar whale
#

Good question -- my thinking is that it will return the first since the FIFO pointer should be pointing to it. But that needs to be verified as well.

#

I have to go offline now, but it'll be fun to explore this ... thanks!

rich merlin
#

@solar whale I could not reproduce the issue. It is ok as is. I tested with each feather running CircuitPython 5.3.0 and library bundle 20200529, including version 2.0.0 of your library. I tried to make a test that would clearly show it working or failing by just looking at log file, but failed. So I made a transmitter send a packet every second, and the receiver do a receive every 5 seconds. The receive timeout was 0.2 secs. When keep_listening = True, the receiver got a packet every time, without waiting. Even when I killed the transmitter, the receiver would still get a packet one time after the tx was dead. With keep_listening=False, the receiver almost never got a packet (timeout still 0.2 secs).

#

@solar whale also from this test I found that when keep_listening is True, and multiple packets arrive between calls to receive(), then the most recent packet is returned.

solar whale
#

@rich merlin Thanks for the test. I have run some as well and agree that "keep_listening=True" is working as intended. Sorry for the false alarm. I'm still trying to recall the issues I had in the past but it is good to know it is working OK now. As to receiving multiple packets .. so much for my instincts.... I have also confirmed your finding -- last packet received. It's always good to test 😉 I will close the issue I opened -- let me know if you run into any problems. Good luck.

solar whale
pseudo gale
#

The MakerDiary nRF52840 MDK won't run the HEX version of CircuitPython that's currently available for it, as it came shipped with a new UF2 bootloader. I tried using the HEX -> UF2 conversion script, but it didn't work. Is there something I'm missing?

solar whale
#

hmm that does not work -- but python3 uf2conv.py -f 0xADA52840 -c -o filename.uf2 filename.hex does create a file

#
Converting to uf2, output size: 709120, start address: 0x26000
Wrote 709120 bytes to test.uf2
raven canopy
solar whale
#

odd -- when I build the board locally it runs ```Create build-makerdiary_nrf52840_mdk_usb_dongle/firmware.uf2
python3 ../../tools/uf2/utils/uf2conv.py -f 0xADA52840 -c -o "build-makerdiary_nrf52840_mdk_usb_dongle/firmware.uf2" build-makerdiary_nrf52840_mdk_usb_dongle/firmware.hex
Converting to uf2, output size: 726528, start address: 0x26000
Wrote 726528 bytes to build-makerdiary_nrf52840_mdk_usb_dongle/firmware.uf2

#

but if I run uf2conv.py manually it won't accept -f ADA52840 -- but -f NRF52 seems to work...

#
Converting to uf2, output size: 702464, start address: 0x26000
Wrote 702464 bytes to test.uf2
#
Family ID needs to be a number or one of: SAMD21, SAML21, SAMD51, NRF52, STM32F1, STM32F4, ATMEGA32, MIMXRT10XX
pseudo gale
#

@raven canopy done

raven canopy
#

@pseudo gale thanks!

manic glacierBOT
lone axle
#

Is there something I could do to try to fix this actions error or does it just need to wait a while for something else to happen?

simple pulsar
#

What's the correct link for ulab documentation? https://learn.adafruit.com/ulab-crunch-numbers-fast-with-circuitpython/overview has https://circuitpython.readthedocs.io/en/latest/shared-bindings/ulab/__init__.html which 404s (I think it used to work) and that's also findable with DuckDuckGo. Google finds https://circuitpython.readthedocs.io/en/latest/autoapi/ulab/index.html which works. Is latter correct? Shall I put some feedback in for that guide?

Adafruit Learning System

Use numpy-like commands to process data quickly

lone axle
#

Looks like that error went away on the next retry from a commit.

onyx hinge
#

@simple pulsar that link got broken with the "stubs" work, I'll go fix it in the guide. In the future, you can report broken links in guides using the page itself.

#

(I'm sure you know that, saying it for the benefit of anyone else reading)

simple pulsar
#

I don't need to do this but I've just noticed the // isn't supported on ulab. Was this considered? ```>>> ulab_sine2
array([0, 2057, 4106, ..., -6140, -4106, -2057], dtype=int16)

ulab_sine2 // 2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unsupported types for floordiv: 'ndarray', 'int'

#

On 5.3.0 on CLUE I'm seeing some strange behaviour with min/max in ulab on int16s. Either I'm doing something silly or this is a bug? ```>>> length=10

ulab_sine2 = ulab.zeros(length, dtype=ulab.int16)
ulab_sine2
array([0, 0, 0, ..., 0, 0, 0], dtype=int16)
for i in range(length):
... ulab_sine2[i] = int(math.sin(math.pi * 2 * i / length) * 32767)
...
...
...
ulab_sine2
array([0, 19259, 31163, ..., -31163, -31163, -19260], dtype=int16)
ulab.numerical.max(ulab_sine2)
-19259
ulab.numerical.min(ulab_sine2)
0

manic glacierBOT
manic glacierBOT
#

There's something odd going on with ulab.numerical.min and ulab.numerical.max with the int16 data type. Example below from nRF52840-based CLUE:

Adafruit CircuitPython 5.3.0 on 2020-04-29; Adafruit CLUE nRF52840 Express with nRF52840
>>> import ulab
>>> import ulab.numerical
>>> length=6
>>> someint16s = ulab.array([0, 12345, 23456, -20_000, -30_000, 0], dtype=ulab.int16)
>>> ulab.numerical.min(someint16s)
0
>>> ulab.numerical.max(someint16s)
-20000

I'd expect `...

rich merlin
#

@solar whale New problem with the rfm9x library is that it's too big for my poor little M0 feather. My project also need the gps library, which consumes ab 6800 bytes. The current rfm9x lib consumes 9500 bytes. With those 2 I am out of mem before I get all my own stuff loaded. When I use the previous rfm9x lib - which consumes 8300 bytes (1200 less) I can run (so far - I'm not done adding the code I need).

#

Sorry I'm just whining. I can't believe I'm counting bytes again like I had to 30 years ago. Too late for me to switch MCU.

solar whale
#

you are using the .mpy versions, correct?

rich merlin
#

Yes, using mpy. Their size on disk is about the same as reported by gc.mem_free(). I called mem_free() before and after the import of the lib and printed the diff.

solar whale
#

I wish I had something to offer - the M0 is really difficult and those are both big libraries. If you are not using the node addressing or "reliable" datagram you could get away with taking much of the new stuff out (there is one 256byte buffer) and a bunch of new code. There are probably some savings to be had with a careful scrubbing of the code. I have not done that.

#

but you will always be struggling with the M0 RFM9x

timber mango
#

@rich merlin Why is it too late to switch MCUs? The M4 (SAMD51) should run everything the M0 (SAMD21) can, but much faster. You will also gain access to more libraries the M0 can not run.

rich merlin
#

@timber mango Because I'm a cheapo. Also because I'm using the m0 and LoRa combo feather. I didn't realize it's limits when I bought them.

main meteor
#

@rich merlin If you can't switch MCUs, perhaps you can switch environments? All that stuff might fit nicely in the Arduino environment.

solar whale
#

It'll run fine under Arduino

#

but's it's so "non-pythonic" 😉

rich merlin
#

Heavy sigh. I guess I have to accept the results of my first experiment with CircuitPython: it's not right for this project.

timber mango
#

@rich merlin This is why I am starting to prefer using breakout boards versus combination boards. I can connect a breakout to anything, but a combination board is not changeable.

rich merlin
#

The lack of concurrency in CP was also killing me. I was doing some wierd things just to make it look like it was doing concurrent things.

timber mango
#

Heavy sigh. I guess I have to accept the results of my first experiment with CircuitPython: it's not right for this project.
@rich merlin I think it would be fine with the right MCU. 😉

rich merlin
#

OK so then I ask for advice: I have never used Arduino, and this was my first python anything. Should I try Micro Python or Arduino next?

solar whale
#

@rich merlin Hopefully it's been a good introduction to the potential applications of CP and you will keep it in mind for the next project.

timber mango
#

You will not get concurrency with Arduino either, but at least you do have interrupts.

solar whale
#

For these boards, I would go to Arduino. -- that said, I have not tried using MicroPython on SAMD boards at all..

rich merlin
#

Geeze there's a lot I don't know about Arduino. I though it was 'c' and threads would just work.

timber mango
#

Every computing environment and MCU combination has pluses and minuses to it. It is frequently quite difficult to pick two that can do what you need done.

rich merlin
#

Yep. So after this 10 minutes of discussion, I think I will clone the rfm9x library and try to squeeze it.

#

Not give up on CP or my hw just yet

solar whale
#

Good luck! let me know if you run into problems -- be happy to help.

timber mango
#

@rich merlin Do not forget to contribute any modifications back to the library. 🙂

solar whale
#

do you need the node addressing or "reliable datagram' (ACK packets?)

#

While you are at it, i would also look at the GPS library -- may find some savings there as well.

#

you will need the mpy-cross tool to create .mpy versions -- no hope without that

rich merlin
#

@timber mango will do. @solar whale Is the a 'howto' for mpy-cross, and whatever, for making libraries?

solar whale
#

looking

rich merlin
#

my dev i

rich merlin
#

my dev machine is a mac

solar whale
#

should be fine.

#

the link above will get you the mpy-cross tool -- if you want to see the whole library contributing process go to the beginning of the guide.

rich merlin
#

thanks. Off I go. check in later

solar whale
#

Have fun!

timber mango
#

Hi there,
Does anyone knows how to create a list of array for different LED on strips on make code? It work on my playground express but not on the strip.
thanks

manic glacierBOT
#

This adds the async def and await verbs to valid CircuitPython syntax using the Micropython implementation.

Consider:

>>> class Awaitable:
...     def __iter__(self):
...         for i in range(3):
...             print('awaiting', i)
...             yield
...         return 42
...
>>> async def wait_for_it():
...     a = Awaitable()
...     result = await a
...     return result
...
>>> task = wait_for_it()
>>> next(task)
awaiting 0
>>> next(task)
awaiting 1
>>>...
solar whale
timber mango
#

@solar whale i know but its been 2 days and no one answered me 😟

solar whale
#

ah -- sorry to hear that -- I have never used makecode - so can not help. Good luck.

simple pulsar
manic glacierBOT
#

While we wait for the list of microcontrollers that are too micro to async, here's an example that shows how exception propagation is able to be handled in an async/await context.

>>> async def it_throws():
...     yield
...     raise Exception('ack')
...
>>> async def it_catches():
...     try:
...         await it_throws()
...     except Exception as e:
...         print('ah ha, I caught', e)
...
>>> task = it_catches()
>>> next(task)
>>> next(task)
ah ha, I caught ack
...
rich merlin
#

What is your fave edit/build environment? I'm trying VS Code because I'm used to Visual Studio. I'm wishing I could edit the adafruit_rfm9x.py file, then launch the python interpreter to show my mistakes. But of course VS code out of the box does not know about the other adafruit libraries. Do you know of a guide on IDE setup for building these?

orchid basinBOT
rich merlin
#

@solar whale well I guess it wasn't worth a try. I went to the previous version of the rfm9x library, that's 1200 bytes smaller. Still I ran out of RAM after adding a blinking LED. And I still need to add a PWM output.

#

So, I'm off to Arduinoville. Any recommendations for a starting point and/or a source of good reference material?

pseudo gale
#

I'm having an issue getting CP to build. I followed all the instructions on the Adafruit site, but I'm running into this issue:
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
xargs: arm-none-eabi-gcc: No such file or directory
make: *** [build-makerdiary_nrf52840_mdk_usb_dongle/genhdr/qstr.i.last] Error 127
make: *** Deleting file `build-makerdiary_nrf52840_mdk_usb_dongle/genhdr/qstr.i.last'

I even tred installing gcc-arm-none-eabi manually without success.

low sentinel
#

Take control over your gcc binary path.

PATH=/github/gcc_arm/gcc-arm-none-eabi-9-2019-q4-major/bin/:$PATH make BOARD=feather_m0_adalogger TRANSLATION=fr -j 12 V=2
pseudo gale
#

Thanks!

pseudo gale
#

So on further examination, it appears that there are deeper issues with compatibility on my MakerDiary nRF52840 MDK. I tried converting it all sorts of ways into a UF2 for the new bootloader, but it did not take. I even tried older versions of CP. The device was able to flash an example blink code provided by the developer, so I know that it is functional. I'm stumped. Edit: Looking at the community pages for the device, I’m apparently not the only one having issues either.

manic glacierBOT
manic glacierBOT
#

And here's an async lib I threw together for this: https://github.com/WarriorOfWire/circuitpython-utilities/tree/master/budget_async

You can use it kind of like an asyncio event loop. This was really easy to put together; there is much opportunity for others to make better things.

It ties async/await to an event loop that you'd most likely call next() on in a tight while: True loop in your main application function. While in a coroutine you can await, you can await loop.sleep() a...

#

@jepler This was a trivial error that was entirely my mistake: in certain cases, you can treat uint16/int16 on the same footing, but not here.

In any case, I have patched the code. https://github.com/v923z/micropython-ulab/pull/121 should fix the issue. If you agree, you can merge it into master. When pulling code into circuitpython, keep in mind that master contains the approx sub-module now, which you might not want to include on your end, so you have to unset the switch in ulab.h...

manic glacierBOT
solar whale
#

@rich merlin I would definitely start here https://learn.adafruit.com/adafruit-feather-m0-radio-with-lora-radio-module/setup?preview_token=IU2C_sI1Vkd78VJQTNxu1w with the Arduino setup for using the M0 RFM9x. This is not the simplest intro to Arduino! You should take a few minute to make sure you can load things like the "blink" sketch before going too deep into it. This will throw a lot at you if you are new to Arduino - setting up and installing libraries. The RadioHead Library has to be installed "manually" - that is not through the IDE's library manager. When you get to it, you can use either the v 1.62 link in the guide or just above that there is a link to get the latest version of the library from airspayce http://www.airspayce.com/mikem/arduino/RadioHead/ I have recently tried both and they both work. I'd recommend the latest version. Note: use the examples from the guide for your first tests rather than e examples from the libraries. The examples are tailored to the pinouts of the AdaFruit boards. Good luck -- if you have issues ask either in #help-with-arduino or in #help-with-radio depending on the nature of the problem.

manic glacierBOT
gentle bronze
#

@solar whale can I ask you a favor 🙂

solar whale
#

@gentle bronze sure!

gentle bronze
#

I couldn't build circuitpython for esp32s2, it is my first time to build it. I am on ubuntu 18.04, you are the linux user I know did it ```cpython/ports/esp32s2$ make V=1 BOARD=espressif_saola_1_wrover all
IDF_PATH=/home/hathach/Documents/adafruit/cpython/ports/esp32s2/esp-idf cmake -S . -B build-espressif_saola_1_wrover/esp-idf -DSDKCONFIG=build-espressif_saola_1_wrover/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;boards/espressif_saola_1_wrover/sdkconfig" -DCMAKE_TOOLCHAIN_FILE=/home/hathach/Documents/adafruit/cpython/ports/esp32s2/esp-idf/tools/cmake/toolchain-esp32s2.cmake -DIDF_TARGET=esp32s2 -GNinja
CMake Error: The source directory "/home/hathach/Documents/adafruit/cpython/ports/esp32s2/build-espressif_saola_1_wrover/esp-idf" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
Makefile:215: recipe for target 'build-espressif_saola_1_wrover/esp-idf/config/sdkconfig.h' failed
make: *** [build-espressif_saola_1_wrover/esp-idf/config/sdkconfig.h] Error 1

#

It complains there is no CMakeLists.txt in the build-espressif_saola_1_wrover/esp-idf Do I need to run any other setup command first ?

solar whale
#

did you run install.sh in esp-idf? then in esp-idf run . ./export.sh

gentle bronze
solar whale
#

I have to re-run the `. ./export.sh' every time I start from a new terminal session

gentle bronze
#

hmm, maybe I need to do in the submodule as well, let's me run it again 🙂

#

it makes no difference 😦

#

I could run idf.py just fine in the terminal, but runing the make command still complain the the missing CMakeLists.txt

solar whale
#

if you type 'env' do you see all thsi in your PATH ```PATH=/home/jerryneedell/projects/circuitpython_master/ports/esp32s2/esp-idf/components/esptool_py/esptool:/home/jerryneedell/projects/circuitpython_master/ports/esp32s2/esp-idf/components/espcoredump:/home/jerryneedell/projects/circuitpython_master/ports/esp32s2/esp-idf/components/partition_table:/home/jerryneedell/projects/circuitpython_master/ports/esp32s2/esp-idf/components/app_update:/home/jerryneedell/.espressif/tools/xtensa-esp32-elf/esp-2020r1-8.2.0/xtensa-esp32-elf/bin:/home/jerryneedell/.espressif/tools/xtensa-esp32s2-elf/esp-2020r1-8.2.0/xtensa-esp32s2-elf/bin:/home/jerryneedell/.espressif/tools/esp32ulp-elf/2.28.51-esp-20191205/esp32ulp-elf-binutils/bin:/home/jerryneedell/.espressif/tools/esp32s2ulp-elf/2.28.51-esp-20191205/esp32s2ulp-elf-binutils/bin:/home/jerryneedell/.espressif/tools/openocd-esp32/v0.10.0-esp32-20200420/openocd-esp32/bin:/home/jerryneedell/.espressif/python_env/idf4.2_py3.8_env/bin:/home/jerryneedell/projects/circuitpython_master/ports/esp32s2/esp-idf/tools:/home/jerryneedell/bin/gcc-arm-none-eabi-9-2019-q4-major/bin:/home/jerryneedell/.local/bin:/home/jerryneedell/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
IDF_TOOLS_EXPORT_CMD=/home/jerryneedell/projects/circuitpython_master/ports/esp32s2/esp-idf/export.sh
IDF_TOOLS_INSTALL_CMD=/home/jerryneedell/projects/circuitpython_master/ports/esp32s2/esp-idf/install.sh

#

let me make sure it still works here

#

make BOARD=espressif_saola_1_wrover clean then make BOARD=espressif_saola_1_wrover

gentle bronze
#

here is my env IDF_TOOLS_EXPORT_CMD=/home/hathach/Documents/adafruit/cpython/ports/esp32s2/esp-idf/export.sh IDF_TOOLS_INSTALL_CMD=/home/hathach/Documents/adafruit/cpython/ports/esp32s2/esp-idf/install.sh IDF_PATH=/home/hathach/Documents/adafruit/cpython/ports/esp32s2/esp-idf PATH=/home/hathach/Documents/adafruit/cpython/ports/esp32s2/esp-idf/components/esptool_py/esptool:/home/hathach/Documents/adafruit/cpython/ports/esp32s2/esp-idf/components/espcoredump:/home/hathach/Documents/adafruit/cpython/ports/esp32s2/esp-idf/components/partition_table:/home/hathach/Documents/adafruit/cpython/ports/esp32s2/esp-idf/components/app_update:/home/hathach/.espressif/tools/xtensa-esp32-elf/esp-2020r1-8.2.0/xtensa-esp32-elf/bin:/home/hathach/.espressif/tools/xtensa-esp32s2-elf/esp-2020r1-8.2.0/xtensa-esp32s2-elf/bin:/home/hathach/.espressif/tools/esp32ulp-elf/2.28.51-esp-20191205/esp32ulp-elf-binutils/bin:/home/hathach/.espressif/tools/esp32s2ulp-elf/2.28.51-esp-20191205/esp32s2ulp-elf-binutils/bin:/home/hathach/.espressif/tools/openocd-esp32/v0.10.0-esp32-20200420/openocd-esp32/bin:/home/hathach/.espressif/python_env/idf4.2_py2.7_env/bin:/home/hathach/Documents/adafruit/cpython/ports/esp32s2/esp-idf/tools:/home/hathach/.local/bin:/home/hathach/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/SEGGER/JLink:/home/hathach/opt/xPacks/@xpack-dev-tools/arm-none-eabi-gcc/9.2.1-1.1.1/.content/bin:/home/hathach/opt/xPacks/@xpack-dev-tools/riscv-none-embed-gcc/8.3.0-1.1.1/.content/bin:/home/hathach/ti/msp430-gcc/bin:/home/hathach/ti/MSPFlasher_1.3.20:/home/hathach/Applications/fomu-toolchain-linux_x86_64-v1.5.5/bin:/home/hathach/Applications/cov-analysis-linux64-2019.03/bin

solar whale
#

works OK for me.

gentle bronze
#

not much luck for me, I am on current tip of master

solar whale
#

yes I am as well -- I am on Ubuntu 20.04 -- also I did not clone from espressif -- i did the install from the submodule in the master repository

#

I think there are some configurations set by scott in the repositiry.

gentle bronze
#

I just run the install.sh and export.sh in the submodule, all the PATH is currently set to the submodule idf, I guess it would be fine. hmmm 🤔

#

ah, what is your cmake version mine is 3.10.2

solar whale
#
jerryneedell@jerryn#2399eedell-ubuntu-macmini:~/projects/circuitpython_master/ports/esp32s2$ cmake --version
cmake version 3.16.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).
#

ans all the other tools

gentle bronze
#

thanks, let's me try to update it first, 18.04 latest is only 3.10

solar whale
#

good luck!

gentle bronze
#

yeah @solar whale it builds now, my cmake is too obsolete 🙂

solar whale
#

yay!

gentle bronze
#

sorry for the wait, my internet speed is a shame 🤣

solar whale
#

no problem -- glad it is working.

gentle bronze
#

-DCMAKE_TOOLCHAIN_FILE=$IDF_PATH/tools/cmake/toolchain-esp32s2.cmake should be

#

-DCMAKE_TOOLCHAIN_FILE=$(IDF_PATH)/tools/cmake/toolchain-esp32s2.cmake

solar whale
#

hmm -- it works as is for me, but I agree with your change.

gentle bronze
#

yeah it works cmake -S . -B build-espressif_saola_1_wrover/esp-idf -DSDKCONFIG=build-espressif_saola_1_wrover/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;boards/espressif_saola_1_wrover/sdkconfig" -DCMAKE_TOOLCHAIN_FILE=DF_PATH/tools/cmake/toolchain-esp32s2.cmake -DIDF_TARGET=esp32s2 -GNinja

#

but the macro is not correct, the $ swallow the I in IDF

#

maybe it is not matter anymore

solar whale
#

apparently, but it should be fixed -- did you try it with the correction?

gentle bronze
#

the build is still cloning .... idf submodules. I will leave it to complete first, then edit and retry.

simple pulsar
#

Has anyone used the BLE code with more than one Advertisement type in start_scan ? I have two CPB's chatting between themselves with ads and one sometimes goes deaf. I'd normally suspect my code but it's the same code on both and from a few runs if i just listen for Advertisement then it works. Both 5.3.0. One happens to have a Gizmo attached. I'm about to check/refresh libraries...

gentle bronze
#

@solar whale it is still cloning 🤣 , I will go out, and upate the result with edit make file later on

manic glacierBOT
#

We can now rely on weblate to regularly update the individual language files from the template, so "make translate" only needs to update the template file circuitpython.pot.

This is advantageous because updating the other files in locale/ was a frequent source of merge conflicts; resolving the conflict incorrectly was something that could easily occur (and did).

Testing performed: that "make check-translate" finds missing translations, that "make translate" only updates circuitpython.po...

manic glacierBOT
#

This gets us

* the new "approx" submodule

* the new "equal / not_equal" predicates (since we can't do `array == array` due to technical limitations)

* vectorise() for vectori(s/z)ing arbitrary Python functions with reasonably good performance

This is definitely vectorize(). Since it was an original numpy function, I stuck with the American spelling:)

The specific submodule ref is in a pending PR [v923z/micropython-ulab#122](https://github.com...

patent elbow
#

Has anyone been able to attach an esp32 s2 to a Segger Jlink with OpenOCD? I tried this weekend and it just gave me an error trying to connect to the jlink device.

solar whale
#

Does J-Link support espressif chips?

patent elbow
#

I haven’t had any luck though.

orchid basinBOT
manic glacierBOT
#

I'm also unable to replicate on 5.4. If you're using an old build, it might be related to #2866. In any case, I've modified the crystal settings in #2979 - if 5.4 still isn't working for you, you could give it a shot.

Closing for now since we aren't able to reproduce it, and it seems like the Atmel problem is possibly a custom board layout issue. Please do feel free to update though if you continue having any problems on the STM32 boards, we're trying to work out the kinks in the new low p...

simple pulsar
#

@tulip sleet I have a live case of file corruption on one device out of three where the host says they are all the same and the devices. I tranferred the file off by printing out the bytes() and I can see it's corrupt on a 128byte boudary (not a 512 one). I put some details in latest post in https://forums.adafruit.com/viewtopic.php?f=60&t=165721 - anything more I should do to capture debug info before I try ejecting the drive on Windows host?

manic glacierBOT
#

@k0d @tannewt Unfortunately, it looks like I can't mess with the settings on the F7 or H7s without messing up their boot behavior. I thought it was just the Nucleos after my first round of testing but now I'm having issues on the H746 discovery as well.

What these boards need is a full implementation of the low power domain for the H7 and F7. I can work on that this week but for now I've made a TODO comment for each of them so this can at least still be submitted as a hotfix for the Disco...

#

@k0d Right now, the new low power code in port.c has some caused problems with certain combinations of settings that cause boards to fail to boot if their oscillator settings don't match the actual board or the settings in clocks.c. Specifically, each board using an external LSE needs to have the backup domain configured properly or it won't exit the boot stage. I tried to make the system cleanly fall back to an internal oscillator if it fails, but my testing is showing it isn't working as ...

tulip sleet
#

@simple pulsar are you doing an eject after each Windows Explorer copy? The host's view of the filesystem does not necessarily reflect reality; it reflects the host-side cached copy of the filesystem. If the data hasn't been completely written to the device yet, the host doesn't know that. So a disturbance (like a reset) on the device side could lose data.

tired cloak
#

I was wondering what the best way to submit a feature request for Circuit Python? I'm assuming GitHub, but still a noob with GitHub.

tulip sleet
manic glacierBOT
tired cloak
#

@tulip sleet thanks!

tulip sleet
#

@simple pulsar checking checksums on the host side doesn't really help because it's not reality, it's only the host's view. It can take up to 90 seconds for Windows to write to a FAT12 device if you don't Eject.

simple pulsar
#

@tulip sleet I've had it broken for about an hour now

#

Are there any counters on the CP's usb side of things to check for errors/weirdness? (5.3.0 on CPBs)

gentle bronze
#

@solar whale I still hit another link error 😓 ```LINK build-espressif_saola_1_wrover/firmware.elf
xtensa-esp32s2-elf-gcc: error: esp-idf/components/esp_wifi/lib/esp32s2/libcoexist.a: No such file or directory
xtensa-esp32s2-elf-gcc: error: esp-idf/components/esp_wifi/lib/esp32s2/libcore.a: No such file or directory
xtensa-esp32s2-elf-gcc: error: esp-idf/components/esp_wifi/lib/esp32s2/libespnow.a: No such file or directory
xtensa-esp32s2-elf-gcc: error: esp-idf/components/esp_wifi/lib/esp32s2/libmesh.a: No such file or directory
xtensa-esp32s2-elf-gcc: error: esp-idf/components/esp_wifi/lib/esp32s2/libnet80211.a: No such file or directory
xtensa-esp32s2-elf-gcc: error: esp-idf/components/esp_wifi/lib/esp32s2/libpp.a: No such file or directory
xtensa-esp32s2-elf-gcc: error: esp-idf/components/esp_wifi/lib/esp32s2/librtc.a: No such file or directory
xtensa-esp32s2-elf-gcc: error: esp-idf/components/esp_wifi/lib/esp32s2/libsmartconfig.a: No such file or directory
xtensa-esp32s2-elf-gcc: error: esp-idf/components/esp_wifi/lib/esp32s2/libphy.a: No such file or directory
Makefile:263: recipe for target 'build-espressif_saola_1_wrover/firmware.elf' failed
make: *** [build-espressif_saola_1_wrover/firmware.elf] Error 1

tulip sleet
#

@simple pulsar no counters, there are sanity checks. I would say that the filesystem might have gotten corrupted at some point, and the best thing to do now is just storage.erase_filesystem() to get a cleanly formatted filesystem. If it repeats on this particular board I would wonder about whether there is some failing flash. We don't verify the writes to flash

manic glacierBOT
#

No; Micropython implemented the async verb as producing a generator. Python 3 uses a coroutine instead. The apis are not the same.

This impacts developers of "nuts and bolts" features, like that budget async lib, but it should not impact regular use. I.e., if you have a suitable concurrency lib in your project, you just use it and can choose to write methods with async/await.

I'm aiming to help us get mileage on the syntax, not specifically to Solve The Problem universally....

simple pulsar
#

What's the block size for flash writes? The corruption is a very specific small part and it's not 512 aligned

onyx hinge
#

Weekly meeting is in about 30 minutes. You can find the document at https://docs.google.com/document/d/1LccVESiE1uFUrLv87Tp923LgrxHQgldFc26DX2QiAjo/edit -- if you plan to be "in" the voice chat but will not be speaking, please add your name in alphabetical order in two places, with "(lurking)" behind it. This is a big help.

#

As always, if you have notes that you would like us to read during the meeting, you can add those -- just put (text only) next to them.

slender iron
#

@patent elbow I'd like to figure out the jlink and openocd stuff. I put a 2x5 on my feather saola board connected to jtag

manic glacierBOT
#

It would be nice if anything that would normally go to serial could be set up to log automatically to the SD card.

For example, I've got a PyPortal, and really spotty internet. It seems to get hung up once a day, except when I leave a serial terminal watching it. If I know where and why it was hanging I'd be able to code around those issue to make it more reliable. (The Weather Station code from the PyPortal Adabox.)

If we could have anything that would normally go to serial also go to ...

lucid solar
#

@patent elbow I'd like to figure out the jlink and openocd stuff. I put a 2x5 on my feather saola board connected to jtag
@slender iron Me too...my boards are a little delayed, but hopefully they'll come in a day or 2.

modern wing
#

Good afternoon -- happily lurking today, updated the doc.

tulip sleet
#

@simple pulsar on samd21, the erase size is 256 bytes; the write size is 64 bytes

solar whale
#

Rats -- dragged back to former day job for a meeting -- will have to miss today's CP weekly -- nothing to report -- have a great week all!

simple pulsar
#

It's a CPB btw

onyx hinge
#

Anybody want to do mic or video checks? Now's a great time!

ivory yew
#

can't join today but y'all are all cool, just thought you should know.

tulip sleet
#

@simple pulsar were you using 5.3.0 or 5.4.0?

simple pulsar
#

5.3.0

tulip sleet
#

on nrf, flash page size is 4k

onyx hinge
#

@ivory yew hate to be emotionally needy, but i demand you rearrange your life in order to accomodate the meeting time, because it's nice to get updates from you.

turbid radish
#

Lurking today
[1:55 PM]
Are you subscribed to the Python on Microcontrollers newsletter? Go to adafruitdaily.com and do so for a once a week spam free email

lapis hemlock
#

Shouldn't there be general chatter on the sound channel?

tidal kiln
#

lurking

onyx hinge
#

Nobody's talking at the moment

modern wing
#

Howdy Kattni and everyone!

onyx hinge
#

now they are

simple pulsar
#

Lurking some of the time

onyx hinge
#

cue technical difficulties

serene warren
#

Lurking (as usual)

tiny oriole
#

i heard ya\

old smelt
#

Lurking

serene warren
#

I can see Kattni

modern wing
#

I see both of you

tiny oriole
#

i see both of you

turbid radish
#

It is switching between you two

serene warren
#

now Scott, now Kattni, now Maker.... seems that whoever is talking has the scene

modern wing
#

[still seems discord needs to work out the bugs --- in the popout, it works fine. in the floating box, it's the highest alphabetically]

errant grail
#

lurking

modern wing
#

and @onyx hinge -- your fears are confirmed, your levels were a bit low just now 😦

simple pulsar
#

Try unplugging your 5GBioShield usb stick

tulip sleet
#

@onyx hinge it's not clear it's your headset mic that's picking up

modern wing
#

ooo, good point @tulip sleet -- @onyx hinge are there any other possible audio devices? it did sound really far away, like a built-in mic in the webcam

#

[i learned that the hard way with logitech c920]

turbid radish
#

Lurking

uncut nexus
#

Lurking today

modern wing
#

Happily lurking, but occasionally here in chat 🙂

mental nexus
#

New lurker!

onyx hinge
#

(I restarted discord so all audio bets are off, it seems)

#

(but in the 'test' page if I test my mic and touch the foam ball on the boom mic it is scratchy so it has to be that one)

#

@thick roost if you want to participate in the meeting, let us know. Otherwise I'll mark you as "lurking", feel free to hang out and listen.

thick roost
#

ok i wonder and came for listening 🙂

onyx hinge
#

@raven canopy lurking?

raven canopy
#

nope. just behind... 😄

blissful pollen
#

lurking now that my work call ended

onyx hinge
#
Hack Club

Join Hack Club’s Summer of Making: 6 weeks of professional mentorship, $50k in GitHub hardware grants, & an unparalleled online community. Starting June 18, ages 13–18.

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

Summer of Making – Hack Club… Free hardware from GitHub. GitHub is sponsoring $50k worth of hardware grants for student makers, alongside support from Adafruit & Arduino for g…

half sedge
mental nexus
#

@half sedge I’m here to help to support you with BLE HID inputs if you want to cover in the weeds.

slender iron
#

💯

onyx hinge
modern wing
#

That's an awesome LED wall ruby billie gus It's a ray of bright light during these dark times.

onyx hinge
#

@icy forge let me know if you have hug reports or status updates and we'll come back to you

prime flower
#

@mental nexus wait, you created cyberduck?

mental nexus
#

Yep, quack quack!

prime flower
#

..thats my fav. SFTP client

mental nexus
#

That’s why I added the Û since I didn’t want any letters from them.

modern wing
#

👍

mental nexus
#

Sorry if I confused you @prime flower , I’m not that cyberduck maker, just the person that made the plastic yellow CircuitPython computer duck.

prime flower
#

OH!

#

still cool

onyx hinge
#

thanks for taking notes kattni

slender iron
#

@inland tusk hoping to get it done this week

patent elbow
#

@patent elbow I'd like to figure out the jlink and openocd stuff. I put a 2x5 on my feather saola board connected to jtag
@slender iron I went ahead and ordered the ESP-Prog from DigiKey. I was looking into the time.sleep() bug on eps32 taking at least a second, but without a debugger I didn’t get much farther than figuring out how Python is calling into the Hal for the sleep methods, but nothing seems esp32 specific so currently perplexed.

slender iron
#

@timber mango please mute

#

@low sentinel are you lurking?

gilded cradle
#

@onyx hinge I should say it's wrapped up for the moment. Maybe I'll be able to get back on it soon.

onyx hinge
#

@gilded cradle nothing's ever truly finished

low sentinel
#

@slender iron I'm in the voice chat in case people want to go in the weeds on async. Not specifically planning to talk but I'm here 🙂

modern wing
#

@gilded cradle I was curious and wanted to ask -- will the new RPi with 8gb ram be of benefit to Blinka?

slender iron
#

👍 will look at it later today

gilded cradle
#

I'm not sure @modern wing. It seems to work fine on the 4GB model so far.

slender iron
gilded cradle
lucid solar
#

Stacking headers seem to be working as 'legs'...unexpected feature

ionic elk
#

dual filament single nozzle?

#

wat?

tiny oriole
#

yep. there are a couple of 2-in-1-out headblocks floating around, and it turns out the Marlin firmware has hooks for "single nozzle" dual filament print. it basically sets the firmware so that it is a dual nozzle printer with 0,0 distance between the two nozzles, and it makes it okay with only having one nozzle temp sensor

prime flower
#

@tiny oriole Are you designing your own backend for weather alerts or using NWS?

slender iron
#
  • the memory isn't currently supported though
ionic elk
#

but why? What's the benefit? Does it have separate feeds for each filament? It actually funnels both into the same nozzle?

lapis hemlock
#

You can mix colours.

tiny oriole
#

ill be caching the Alerts api from NWS on a relatively short regular interval, and then the clients in the field will hit MY server as fast as they need to. That way the bulk of the load hits ME, not them

simple pulsar
#

ouch

prime flower
#

@tiny oriole neat! Lmk if you like the NWS API or switch to something else (looking to migrate Adafruit IO's weather api by e.o.y), also keep me updated i love weather projects

tiny oriole
lapis hemlock
lucid solar
tiny oriole
#

@tiny oriole neat! Lmk if you like the NWS API or switch to something else (looking to migrate Adafruit IO's weather api by e.o.y), also keep me updated i love weather projects
@prime flower it's actually not that bad, i really like it, although sometimes it fails to reply, or doesnt reply with fully qualified json, which i havn't fully tracked down if its my fault or their fault yet.

raven canopy
#

new 64-bit Raspberry Pi OS: now they do this... 😄

lucid solar
#

@ionic elk I'm open to test stuff on stm32 this week if you need.

thorny jay
#

Maybe we are missing low power board? One without any LED on by default and such thing.

ionic elk
#

@lucid solar That'd be super! I'll be working on stuff that needs a lot of cross board testing but I'd appreciate your eyes on the F7 boards you've got!

lapis hemlock
onyx hinge
#

Your product has a user accessible USB plug which appears as a CIRCUITPY drive when plugged in.

turbid radish
#

Metro and Grand Central form factors expose more pins

onyx hinge
#

I notice the CircuitBrains does bring out D-/D+ as pins

#

so it supports USB, just doesn't have a connector

thorny jay
#

USB plug can be modified to a place where you can connect USB.

#

What if there was a Serpente without the USB port?

crimson ferry
#

"CircuitPython-Ready"

onyx hinge
#

If you had a breakout with USB in your store, that would be great too (assuming you want to sell it)

simple pulsar
#

Is there another "thing" that exists to connect this to micro-USB?

onyx hinge
#

@simple pulsar I didn't find one for CircuitBrains Deluxe, no

thorny jay
#

BLE?

#

CircuitBrains Basic is in the download section.

crimson ferry
ionic elk
#

I mean for any given board you could just use one of these:

#

I was thinking about these for the STM32 Nucleo boards, which only expose native USB over the pins

tidal kiln
#

"CircuitPython Pro"?

ionic elk
#

referring to what?

#

SMT boards?

tidal kiln
#

as a general board branding...for boards without easily accesible USB?

tiny oriole
#

essentially an NRF socket

ionic elk
#

That'd apply to boards like the Nucleos which I would hesitate to call "pro" material. That word carries a lot of implications

onyx hinge
#

like teensy4.1 for the host usb I guess

thorny jay
#

I need 16 GPIO on an nRF52 to make a Commodor 64 keyboard.

onyx hinge
#

(there's one in my keyboard right now .. er no, it's an itsy bitsy m4 but only using 20 I/Os)

#

@idle owl I'll hand it back to you for wrap-up

tulip sleet
simple pulsar
#

Do the BLE keyboards do both?

slender iron
#

that's a good question. I'm not sure.

serene warren
#

Be safe y'll

modern wing
#

Thank you!

turbid radish
#

Thanks all

gilded cradle
#

Thanks

onyx hinge
#

yay see you all around!

idle owl
#

I need to drop off. Later all.

simple pulsar
#

bye

gilded cradle
#

I'm going to drop off as well. Later

mental nexus
#

Thanks for considering new features in the weeds today. Definitely understood on priorities. Keep up the good work everyone!

manic glacierBOT
slender iron
#

@fathom lava any idea when kattni's hello blink show will be posted?

manic glacierBOT
#

@WarriorOfWire Thanks for making a PR for this! It's nice to see a PR proposal.

I don't want to introduce an async API that is incompatible with CPython because then code will be built on top that we'd have to break later. CPython compatibility also means libraries can be developed and tested in CPython too.

I know MicroPython has been doing a lot of asyncio work recently. Do you know if they've switched away from generators and are now CPython compatible? It's been a while since we mer...

manic glacierBOT
ionic elk
#

@slender iron what is the best way to crash for a clock fault, like timing out the LSE setup? It feels like safe mode isn't really a good fit, since most of the time an LSE fault will prevent USB from even enumerating.

manic glacierBOT
slender iron
#

@ionic elk switching to the LSI makes sense to me. is that possible?

ionic elk
#

I'll try and make that work yeah

#

It's been failing with the setup so far but I'm checking out how Cube does it

slender iron
#

if that doesn't get usb we can think about safe mode + led flashes

ionic elk
#

The annoying thing is that it tends to work if you have a working version that you change without power cycling, but then fails when you reset power.

manic glacierBOT
slender iron
#

ya, the crystal stuff usually only starts on "power on reset" since it can be slow

manic glacierBOT
slender iron
#

@onyx hinge need me to update the translations for the ulab update?

ionic elk
#

@slender iron it's actually not just power on reset, but literally full power cycling, because of the backup domain

#

resetting from a debugger won't break things but actually unplugging and replugging will

slender iron
#

hrm, I thought power on reset meant "reset when the power turns on"

#

right, the debugger does a different type of reset

ionic elk
#

Ok my terminology is off then

#

my b

slender iron
#

is 2979 worth getting into the next beta?

#

np

ionic elk
#

2979 doesn't do a lot other than fix a startup bug for the F4 discovery

#

I had to switch a bunch of changes to "todos" because they were breaking boot

#

it's the basis of a new LSE fix PR I'm working on rn

slender iron
#

I'll probably do beta.1 in the next hour or two so I can merge it and you can follow up later

ionic elk
#

ya sounds good

slender iron
#

kk, I have a couple PRs to poke that I want to get in too

manic glacierBOT
slender iron
#

@onyx hinge fyi I updated 2992 through the github UI so pull before editing locally

manic glacierBOT
simple pulsar
manic glacierBOT
#

I know MicroPython has been doing a lot of asyncio work recently. Do you know if they've switched away from generators and are now CPython compatible? It's been a while since we merged so upstream may have already evolved. If that's the case, we should consider merging in upstream (a large task but this would be another reason to.)

It's still backed by yield_from which [uses iter and yield](https://github.com/mi...

thorny jay
tulip sleet
#

@simple pulsar I just took a look. That's strange, and I can't think of something that would account for that, unless it were that the file you were editing changed length by that much in the middle, and the write to update the data was incomplete in some way.

orchid basinBOT
manic glacierBOT
#

The brownout level is set quite high (2.77V) too soon after POR release on fast chips with slow ramping supplies.

An issue was encountered when testing the PoE-FeatherWing with the Adafruit Feather M4 Express. It would continuously go into safe mode right after boot when connected to PoE. My theory is that as the PoE power is still ramping up, the chip comes out of POR and starts to execute code. It reaches port_init before the inp...

#

I know MicroPython has been doing a lot of asyncio work recently. Do you know if they've switched away from generators and are now CPython compatible? It's been a while since we merged so upstream may have already evolved. If that's the case, we should consider merging in upstream (a large task but this would be another reason to.)

It's still backed by yield_from which [uses iter and yield](https://github....

manic glacierBOT
#

There were two main problems

  • word_buffer was being filled as though with unsigned samples, but during mixing all samples are kept in signed mode
  • If the first buffer was stopped, the voices_active flag got set anyway, even though the output buffer wasn't initialized yet, so the samples were mixed with indeterminate data

We also cover the case where no buffer was playing, and ensure the output buffer is filled.

This now works much better. Tested on neotrellis m4 playing back 4 mp...

onyx hinge
#

@slender iron thanks for doing the ulab translations update. I was at my local hackspace's virtual weekly meeting

#

thanks for the merges

#

@thorny jay scary to recall, but I was very active in comp.lang.python and the python-dev mailing list in the 90s, though my daily interest had waned by 2000.

#

I wonder why weblate is a "first time contributor" every time

manic glacierBOT
#

Asyncio is a pretty complex topic and there's been a lot of work done on it in MicroPython over the years. Support for coroutines via generators was done for efficiency and for the most part users will not notice any difference here. Our uasyncio module is largely CPython compatible and I'd suggest you rebase/merge v1.13 of MicroPython (once it's released, should be soon) as just use that as-is.

manic glacierBOT
manic glacierBOT
#

Mainly efficiency of implementation.

There are lots of layers involved with an asyncio implementation and we've prioritised making the user-facing layers CPython compatible. I don't think it's realistic (or necessary) to make everything CPython compatible, for example it probably requires reference counting to get task clean-up to work the same.

So I guess the question is: what does "CPython compatible" mean to you?

manic glacierBOT
#

In making my weak scheduler PoC I saw that the lack of __await__ and send() on the awaitable object produced by an async function invocation were obstacles to compatibility at least insofar as writing unit tests. I think if I did not have to advance my tasks via next() we would be not too far off. I don't think a full CPython coroutine implementation is necessary here to get the overlap good enough that CircuitPython (limited) code works in a CPython (full) runtime.

manic glacierBOT
#

To be clear though, it is really just that you can't implement an asyncio-api-compatible pure-python scheduler with this bare generator async/await. If I had written a CircuitPython-specific C module that did task scheduling (reeeeimplement asyncio or uasyncio) there would not be Python unit tests and the user-visible code would be compatible with CPython (modulo the library that would need to be built in blinka).
I consider this gap to be a temporary thing with a low-pain forward mig...

manic glacierBOT
#

@dpgeorge while you're in the neighborhood - how would I implement a suspending function in Python using async/await that works both in CPython and Micropython?

Consider:

async def go_next_time():
  yield

async def print_next_time(message):
  await go_next_time()
  print(message)

co = print_next_time('hello')
co.send(None)
co.send(None)

This works in CircuitPython but not in CPython. It is an abuse of the encapsulation, but I'm not sure what alternative means to t...

#

Why can't we do == and !=? We shouldn't introduce a new API just because we can't match MicroPython or CPython.

Here is what you need for the ==, and != operators to work: https://github.com/micropython/micropython/pull/5593

I am not emotionally attached to the equal, and not_equal functions, so if you want, we can remove them. It was more like a temporary measure for circuitpython. As far as I remember, it was specifically a user request.

manic glacierBOT
#

Right, figured out a way that works in both to provide a "sleep":

class TimedWait:
    def __init__(self, duration):
        self.duration = duration
        self.start = time.monotonic()

    def __await__(self):
        yield from self._wait()

    def __iter__(self):
        yield from self._wait()

    def _wait(self):
        while time.monotonic() < self.start + self.duration:
            yield

It's a little circuitous but it will do until we have a C module i...

manic glacierBOT
#

So this bad Python scheduler serves as a proof that there is a subset of functionality that overlaps sufficiently with CPython to write a meaningful pure Python coroutine scheduler (which should not be the ultimate goal here imho).

The async/await syntax of my demo application has been unchanged through this tumult BudgetScheduler has remained API compatible even through misunderstan...

maiden chasm
#

Hi, Is there or going to be any special bootloader for ESP32 S2 to make it ready for CircuitPython?

#

e.g. if I want to play or test CP with my SEOLA board how to start? (I know that it is still on development stage)

lone sandalBOT
manic glacierBOT
solar whale
#

Is there a known issue with the current master build for the teensy 4.0 and 4.1 -- neither will boot for me?

onyx hinge
#

@solar whale in a quick glance I don't see an open github issue like that

solar whale
#

neither did I -- I'll do a few more checks then open one if not resolved.

manic glacierBOT
#

The most recent builds for the teensy 4.1 and teensy 4.0 do nto boot for me
this fails to boot

jerryneedell@jerryneedell-ubuntu-macmini:~/projects/adafruit_github/teensy_loader_cli$ ./teensy_loader_cli -mmcu=imxrt1062 -w ~/Downloads/adafruit-circuitpython-teensy41-en_US-20200602-e889287.hex

this boost OK

jerryneedell@jerryneedell-ubuntu-macmini:~/projects/adafruit_github/teensy_loader_cli$ ./teensy_loader_cli -mmcu=imxrt1062 -w ~/Downloads/adafruit-circuitpython-teensy41-e...
manic glacierBOT
solar whale
#

@onyx hinge thanks -- found build when it first broke -- been awhile -- posted to issue

simple pulsar
#

@tulip sleet The whole file thing is very puzzling. Given the sizes and damage it does look like some sort of editor meets broken file system. I save files to a network file system (samba) and then copy them to the devices. I think I'd bet money on it being Windows but it's strange given the sha256 were all the same, there must be a rare consistency issue with its cached view of the CIRCUITPY drive vs the writes to the CIRCUITPY drive. On the plus side, I've worked out a few tricks for checking and extracting files over the serial console.

manic glacierBOT
tulip sleet
#

@simple pulsar which editor are you using? And I wonder if your workflow could change to use a script that forces an eject or to use an editor directly to do the writing? I would like to have some editor plugins to write files to both CIRCUITPY directly and to a backup location, for safety

simple pulsar
#

@tulip sleet That was trusty notepad++ saving directly to a samba mounted drive but there's clearly no non-bug explanation for the situation I had. Are you just pondering some workaroud to make things more robust?

celest zenith
#

@tulip sleet Not quite the same but have configured emacs to save its backup files (~ suffix) to a location on my home directory instead of the CIRCUITPY filesystem

tulip sleet
#

@simple pulsar there is nothing we can do about the Windows delayed write problem. We've had communications that this FAT12-specific issue is being fixed, but I haven't seen it mentioned in the Windows Insider Previews release notes. The best we can do is force the writes to the drive. There is no way I know of to make Explorer or the DOS copy command to do that. It has to be something that specifically invokes a flush. Some editors do this automatically (Notepad++ does not), and I wrote a plugin for Atom to do it. I will say again that looking at things from the Windows side doesn't tell you what's on the board, just what it thinks is on the board. Yes, it could be a bug in the filesystem code, but it could also be something that caused them to get desync'd. Unless the drive disappears from Windows and then gets remounted, Windows will not know what's on the drive because the caching happens at too low a level.

#

@celest zenith I think emacs and other editors have enough hooks that we could have a "shadow" CIRCUITPY it writes to as well as the drive, or in general, write to two places rather than one. However, I looked for existing editor code and plugins to do this and didn't really find much.

celest zenith
#

certainly with emacs -- I've looked how hard it might be to do it in mu, but it didn't get much farther than reading code

tulip sleet
#

i use emacs all the time, and if i were developing on windows, I might have written that code already 🙂

celest zenith
#

If memory serves it wouldn't be too hard to add a code to write files to a different location with mu but how to configure that backup location was not clear to me

timber mango
#

I know this has been done with some Bluetooth devices that can now work with Circuitpython. My glucometer (for measuring sugar level) has Bluetooth. It would be really nice to be able get the raw data from the device so it could be used to calculate other stuff like A1C. What would be the best way to figure out what the device is sending and how to get the data? No rush on the answer but I just wanted to get this out there before I forget. I have only had about two hours sleep, so I hope I am making sense. 😉

topaz quest
#

@timber mango what device is that? many are using standard Bluetooth profile for glucose sensing — never tried to implement it myself though

tulip sleet
#

@timber mango we have looked into drivers for CGM's, but I don't have one to test with. Sometimes they are rather locked down, sometimes not, sometimes they are classic Bluetooth, not BLE. I think you will actually find a lot of (not CircuitPython) code for various CGM's on GitHub and elsewhere

#

@topaz quest there are lots of nice simple service defns by the Bluetooth standards folks; it's sad not more devices use them. I've only found heart rate monitors and bicycle sensors that actually use the standard defns

topaz quest
#

@tulip sleet I think I have at least one device that uses the standard GLP one, but it's a blood-sample meter, I don't know of any CGM actually using the standard profiles

#

(for any commentary on what I think of a certain encrypted reader device I'll just refer to the last post on my blog, obliquely, just in case.)

timber mango
topaz quest
#

@timber mango yeah that should be using GLP then 🙂

timber mango
#

Oh! Then maybe this will not be as difficult as I thought it would be. 🙂

topaz quest
#

the protocol is a bit of a mess, to be honest, but it's not impossible to implement

#

I've received a contributed driver for the USB part of the Contour devices

timber mango
#

I chose a good meter, in spite of that then. 🙂

topaz quest
timber mango
#

Neat! Thank you! Maybe doing what I want to do will not be such a difficult thing. I recently got a CLUE board.

#

I will look at all of this later. I have only had two hours of sleep, so I am going back to bed now. 🙂

topaz quest
#

enjoy rest! 😄 if you have glucometer questions feel free to tag me in, it's my hobby 😉

ionic elk
#

@gentle bronze when I see this kind of comment in TinyUSB, what is generating it?

/**
  * @brief  System Clock Configuration
  *         The system Clock is configured as follow :
  *            System Clock source            = PLL (HSE)
  *            SYSCLK(Hz)                     = 84000000
  *            HCLK(Hz)                       = 84000000
  *            AHB Prescaler                  = 1
  *            APB1 Prescaler                 = 2
  *            APB2 Prescaler                 = 1
  *            HSE Frequency(Hz)              = 8000000
  *            PLL_M                          = HSE_VALUE/1000000
  *            PLL_N                          = 336
  *            PLL_P                          = 4
  *            PLL_Q                          = 7
  *            VDD(V)                         = 3.3
  *            Main regulator output voltage  = Scale2 mode
  *            Flash Latency(WS)              = 2
  * @param  None
  * @retval None
  */

or do you write them out yourself?

simple pulsar
#

@timber mango 1) Which board do you refer to, 2) can berry syrups program?

solar whale
#

Uno is definitely a no.

tulip sleet
#

@timber mango you can use snek, which is a python-like language, on an Arduino

#

huge

#

an Rpi has at least 512MB of RAM, and now up to 8GB. The processor is 100-1000 times faster, very roughly. It runs an operating system, Linux-based

slender iron
#

Hi, Is there or going to be any special bootloader for ESP32 S2 to make it ready for CircuitPython?
@maiden chasm Not yet no. Right now you should just load it with esptool.py. We are looking into a UF2 bootloader for it.

simple pulsar
#

I can't find anything an easily understood list of boards for MicroPython. BBC micro:bit based on the nRF51822 processor is probably the "smallest".

#

Are there any debug options available on BLE start_scan() ? I've just coded up my own Advertisement matching and it appears to work as opposed to library implementation which seems non-deterministic. The python parts of the library code seem rather simple so I am puzzling over this.

tulip sleet
#

you could do some unit testing on the matching. Are you doing "all" matching or just "any"?

simple pulsar
#

Just one

tulip sleet
#

There is a bug in the existing C implementation

simple pulsar
#

Is there a ticket that describes that one?

tulip sleet
simple pulsar
#

I have one device sending and two devices receiving but one of the rx'ers can see (as in match correctly the Advertisement sub-classes) packets and one can't. Could that bug explain that? I.e. same over the "wire" data is received by both

#

I also have scan responses rattling around. I'm about to try active=False which I believe will stop those as I don't need them and would like to reduce chatter.

tulip sleet
#

it's possible only one device is seeing a scan reponse.

#

otherwise, no, both should be able to see, unless there's a lot of competing traffic

simple pulsar
#

I'll do some more testing on my own matching code.

#

I've seen >15 seconds where nothing has been received on one device sat 10cm from another. Has been a puzzling and frustrating few days!

tulip sleet
#

if you just look at all advertisements and not filter, do you see something? Do you see random advertisements from other devices like your phone?

simple pulsar
#

As soon as I look at all Advertisement I see everything, the two other CP devices and my neighbour's bose headphones, etc. (it's just like the Matrix).

tulip sleet
#

ok, so it sounds like a filtering issue and not a reception issue. fixing that bug is a fairly high priority, but is not my most immediate thing at the moment

#

but if you are trying to use advertisements as the sole data transport, yes, you might try to avoid scan responses to get more effective broadcast. I am not sure if scanners ignore scan responses they don't initiate or not

#

i'm trying to find out but haven't found an answer

simple pulsar
#

Oh, actually there is more going on in that loop than I thought.

#

Is it finding the deepest sub-class match?

tulip sleet
#

i think something like that; I did not write that

lucid solar
#

Someone here knows about USB device descriptors?

tulip sleet
#

yeeesss...

#

@simple pulsar but it would seem like the ordering is then important

lucid solar
#

ah no...CDC has 3 endpoints it seems.

#

MSC has 2

#

plus EP0

tulip sleet
#

there are endpoints and there are endpoint pairs (in/out)

#

sometimes the terminology is used sloppily

simple pulsar
#

Does part of the software release process for CircuitPython include updating the Wikipedia page? I've just noticed it still mentions 5.1.0 https://en.wikipedia.org/wiki/CircuitPython

CircuitPython is an open source derivative of the MicroPython programming language targeted towards the student and beginner. Development of CircuitPython is supported by Adafruit Industries. It is a software implementation of the Python 3 programming language, written in C. ...

lucid solar
#

@tulip sleet I don't get why it says it's not configured

tulip sleet
#

who says it's not configured?

#

line 22?

lucid solar
#

and line 9

tulip sleet
#

this is circuitpython? or something else?

lucid solar
#

tinyusb...it didn't work in circuitpython...so I thought I'd test in tinyusb first.

tulip sleet
#

i would look at the usb-probe report for some vanilla circuitpython device and compare it

slender iron
#

@simple pulsar we don't update it

lucid solar
#

I've got a usb probe report for one cdc and one msc...that works fine.

tulip sleet
#

i'd have to re-remember all this, so I could help, but I'm not sure I'm any further along than you at the moment

#

cdc has control and data endpoints

#

are you trying to do two cdc channels

lucid solar
#

yeah...there is an example on tinyusb....but that didn't work either...but it did on a different board.

tulip sleet
#

ah, ok, so that sounds like a bug if your code is otherwise the same

manic glacierBOT
#

When fixing this it would be useful to keep an eye on any code which might fail on matching sub-classes of one or two Advertisements. As mentioned in discord, I've had the same code running on three boards which transit to each other and receive each other's broadcasts. Sometimes one goes "deaf" and doesn't pick up a particular sub-classed Advertisement for >15s which is really odd compared to its neighbour which receives them fine. The "deaf" CPB then suddenly picks up the next sub-cla...

slender iron
#

@gentle bronze want to chat here? maybe @sour lynx is around

lucid solar
#

@tulip sleet it worked fine on a different board...I was using a 'blackpill' must be some bug with that board. Thanks for your help anyway!

tulip sleet
#

@lucid solar Some STM chips have very limited numbers of endpoints

lucid solar
#

ah...thanks...I didn't know there was a limit.

tulip sleet
#

and hierophect had a lot of trouble with the blackpill in various ways

lucid solar
#

I don't know usb very well yet...that's what I'm trying to change...it's useful to know more I think.

tulip sleet
#

yes, pyboard can't have MSC, HID, and CDC at the same time: not enough endpoints. The SAMD's and nRF are much better in that regard

lucid solar
#

Thanks for the info! Now I need to find out the limits...

#

Seems I can't have more than 2 CDC on the F7, so I'll just give up on this project...2 can be enough I guess.

tulip sleet
#

it's not even F7, it's which F7. F407 has fewer endpoints that F412, for instance

lucid solar
#

F746

#

"1 bidirectional control endpoint + 5 IN endpoints + 5 OUT endpoints"...now at least I know where to look.

#

blackpill "4 bidirectional endpoints"

manic glacierBOT
idle owl
#

@slender iron ping.

slender iron
#

hi hi @idle owl

solar whale
#

@onyx hinge Nice work on the SDIOCard!

onyx hinge
#

@solar whale thanks for testing, you rock

idle owl
#

@slender iron Have you already requested an adafru.it/ URL for your deep dive playlist on YouTube?

slender iron
#

nope

#

hadn't thought of that

idle owl
onyx hinge
#

It is far from finished, we need an SDIO bus object, and of course we have multiple microcontrollers to support.

idle owl
#

Or would you rather something else

#

it can have - but not _ in it.

solar whale
#

Happy to test

slender iron
#

@idle owl that's fine! thanks!

idle owl
#

👍

idle owl
#

The URL http://adafru.it/translatecp is now live and points to our Weblate engage page. Please feel free to use it to get people involved with translating CircuitPython! @onyx hinge

Hosted Weblate

CircuitPython is translated into 14 languages using Weblate. Join the translation or start translating your own project.

lucid solar
#

@tulip sleet I got 3 CDC working on a MXRT1010-evk. Thanks for your guidance, it helped me to understand a bit more.

idle owl
lucid solar
#

@slender iron CPY meeting notes for next week need created.

manic glacierBOT
#

Excellent! I had updated my 2 boards to the latest CircuitPython, but had not updated the bootloader. One board had bootloader version 2.0.0 and the other 3.7.0. I updated both and they now work correctly.

I will just have to tell my PoE-FeatherWing customers they need to update their bootloader to the latest version if theirs is below 3.9.0.

I closed the issue.

gusty topaz
#

All, not sure if this is the right place to follow up on an issue, but the following has been there for a while. I'd love to help with it, but I think it's a bit over my head. Is there any way to bring it under the responsible people's radar. It's related to the locationbeacon capability that was already implemented but it was dropped on the final version of CP. : https://github.com/adafruit/circuitpython/issues/2709

#

I used an alpha version as suggested by @tulip sleet at the time, but just wanted to make sure that it will be available in the official release for everybody to use.

manic glacierBOT
#

So I guess the question is: what does "CPython compatible" mean to you?

@dpgeorge Thanks for jumping in on this! I really appreciate your input.

My philosophy is that "CPython compatible" means that any code written in CircuitPython that only imports modules available in CPython works without modification in CPython. The corollary of this is that any CircuitPython-only code must import a module not available in CPython. This means that CircuitPython-only code will error consistent...

manic glacierBOT
idle owl
#

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

ionic elk
#

@slender iron do you use Sublime Merge?

slender iron
#

@ionic elk off and on

ionic elk
#

do you think it'd be an ok thing to ask Adafruit for?

slender iron
#

are you using it regularly?

ionic elk
#

I basically wish I could have the kind of overview Github gives but locally, does it do that?

#

No I don't have it

slender iron
#

definitely try before you buy

#

it works just fine without purchasing

#

I don't know how to diff against master

#

I mainly use it for staging some of the changes I have

#

I just use github for the overall diff

ionic elk
#

Ok. I'll try and see if it speeds anything up but I won't spend a lot of time on it

slender iron
#

👍

slender iron
#

@ionic elk did you see the issue about teensy no longer starting?

ionic elk
#

uh oh no I did not

#

will check out

slender iron
#

it may be that we need to never reset it's flash pins

ionic elk
#

hmmm I thought I covered those

slender iron
#

do you have the boards?

ionic elk
#

maybe I got the wrong ones

#

I have a teensy 4 somewhere around here

#

But I didn't test that one

#

I don't know how to program it

slender iron
#

kk, I can test if needed too. I don't want to release a new beta with that broken

ionic elk
#

Want me to try and fix it right now?

#

I'm working on fixing the STM32 clock stuff ATM

slender iron
#

ya, if you could take a peek that'd be good

ionic elk
#

k

slender iron
#

thanks!

ionic elk
#

Well, the 4.1 doesn't have pin protection at all, so that's pretty obviously the problem for it. I think it came in after my reset PR

#

and it looks like the 4.0 is missing a bank for the second flash device.

#

(why does it have two from different brands?)

slender iron
#

two what?

manic glacierBOT
slender iron
#

@ionic elk you don't need a jtag to flash

#

in fact, you can't

#

teensy doesn't break out the pins

ionic elk
#

so, is there an non-overridable bootloader loaded on one of the flash chips or something? I'm still kinda wrapping my head around the i.MX flash stuff

slender iron
#

on teensy there is a separate micro that does the loading

#

(iMX also has a rom bootloader itself)

ionic elk
#

Oh that's what thee MKL02Z32VFG4 is, I mistook it for an extra flash chip when I glanced at its digikey page, my bad 😆

slender iron
#

yup yup

ionic elk
#

Well, that's nice. Guess I need to download the whole teensy loader thing

slender iron
#

ya, it's pretty simple

#

it's the magic that makes a teensy

ionic elk
#

Well, and an arduino, and any ST dev board, and most EVKs...

#

lol

slender iron
#

the extra teensy loader is unique to the teensy ecosystem

#

not to say there aren't similar solutions

ionic elk
onyx hinge
#

@slender iron I have a weird build failure on one of my PRs, in the esp32s2 build, nowhere near anything I touched. https://github.com/jepler/circuitpython/runs/731887876 supervisor/usb.c: In function 'init_usb_hardware': supervisor/usb.c:80:31: error: 'USBPHY_DM_NUM' undeclared (first use in this function); did you mean 'USBPHY_VM_NUM'? gpio_set_drive_capability(USBPHY_DM_NUM, GPIO_DRIVE_CAP_3); ^~~~~~~~~~~~~ USBPHY_VM_NUM

slender iron
#

@ionic elk flash and usb are two obvious things to protect

#

could it be the same issue of resetting the port before setting the never reset?

onyx hinge
#

I notice now this is the Action from my fork, brow furrows due to being a draft, maybe it's not built in adafruit/circuitpython

slender iron
#

@onyx hinge I haven't seen that before

ionic elk
#

@slender iron not unless someone snuck in a different reset_port somewhere that isn't port.c, I'm looking at it and it's still fine

slender iron
#

¯_(ツ)_/¯

ionic elk
#

I've got protections on the flash... maybe it's USB? Even though ID and VBUS aren't actually connected?

slender iron
#

does it work if you comment out the reset logic?

ionic elk
#

yes

#

only fails with the pin resets in. hmmmm

manic glacierBOT
surreal scarab
#

hi

tulip sleet
#

@ionic elk I use meld as a mergetool. I used kdiff3 before that, but it stopped working well with the latest Ubuntu

ionic elk
#

@tulip sleet thanks I'll check those out too

tulip sleet
#

@surreal scarab hi, if you have a q, go ahead and pose it

surreal scarab
#

im just starting i youtube channel can i post links to my new vids here when they come out?

#

or streams

tulip sleet
#

what is the subject of them? They should be relevant

onyx hinge
#

ah I commited some bad submodule updates 🤦

surreal scarab
#

unboxings and gaming i only have 3 vids at the moment im edeting the rest

#

just made the channel 4 days ago

tulip sleet
#

that's not really so relevant to the topics in this server, sorry

surreal scarab
#

what would count as relivent thou just wondering