#circuitpython-dev

1 messages Β· Page 332 of 1

onyx hinge
#

@slender iron since gamblor reviwed #3532 is there anything else you're looking for at the moment?

slender iron
#

a quick glance would be nice and then an approval

manic glacierBOT
#

I'm curious: what's the device-based testing regime like? Is that documented somewhere? I'd like to get into testing stuff like this and would like to leverage any existing work.

I think you are assuming we're more rigorous than we are. I just replicated the problem and then fixed it. I didn't test on other devices. I rely on folks trying their own main builds and the latest from S3 as a way to find other issues.

You can test PR changes by either pulling the PR down and building loc...

atomic summit
#

@slender iron you closed my issue, but I think it's incorrect, sorry.

#

When I use 4MB flash, it doesn't reload code.py when the OS mounts

#

It only does it when I use 16MB flash.

#

so it can't be the correct behaviour

slender iron
#

let me try on my saola with 4mb

atomic summit
#

ok

slender iron
#

do you have any samd boards you can compare against?

atomic summit
#

Yup,doesn;t do it on my CPX or ItsyBitsyM4

#

and doesn't do it when I flash my FeatherS2 with 4MB

slender iron
#

do you have any non-mac devices

atomic summit
#

And Mark Olsen also sent me a video of it not doing it on his Soala Wrover, on his Mac

slender iron
#

this is a super minor issue

atomic summit
#

Minor for every board not suing 16MB of flash πŸ˜‰

slender iron
#

running a second time has no consequence

atomic summit
#

other than more support work for me to explain to people why πŸ˜‰

#

hahaha

#

I also still get the 5 second boot time.

#

soala gets < 2seconds

#

So there is something fishy going on.

slender iron
#

it may be due to ram blanking or something

stuck elbow
#

I wonder if it's the macosx writing to the disk a second time when the disk is bigger or something like that

atomic summit
#

it's going to be an issue when deepsleep is available and folks want to use any boards with large RAM for battery projects.

stuck elbow
#

no idea if there is something like iotop for macs that would let you see writes?

slender iron
#

@atomic summit we don't support deep sleep in circuitpython currently

atomic summit
#

I know... that's why I said "when available"

slender iron
#

πŸ‘

atomic summit
#

It's a super common use for ESP32 - IoT battery projects

#

so extra boot time will just drain batteries faster 😦

#

But I guess that issue is for another day πŸ™‚

#

@stuck elbow Not sure either.

stuck elbow
#

@slender iron would it make sense to delay autoreload if it has just reloaded/started?

manic glacierBOT
slender iron
#

@atomic summit we'll get there eventually

#

@stuck elbow the current behavior doesn't bother me and I'd worry about ignoring any writes because they could actually be user triggered

manic glacierBOT
stuck elbow
#

oh right, you would have to ignore them, not just delay

#

otherwise you get even longer "boot time"

#

@atomic summit if you care about battery in your project, you can always disable autoreload in your code

manic glacierBOT
atomic summit
#

@stuck elbow Can auto-reload be changed by the user in code? Or only at the firmware level?

stuck elbow
#

it's runtime setting

#

in the supervisor module, IIRC

#

but it would probably have to be done in boot.py to happen before USB gets mounted

manic glacierBOT
stuck elbow
#

hmm, I can't find it now in the docs

#

supervisor.enable_autoreload() and disable_autoreload

atomic summit
#

but then a user can get their code to reload unless they connect via serial and send a ctrl+d ?

thorny jay
#

off and on again or reset ...

atomic summit
#

I guess ultimately no matter if it's a CPY specific issue or something OS level, it's a crappy user experience to have it happen, and also a foreign experience for those already using CPY.

#

@thorny jay a hard reset is a terrible way to get your code to restart as it forces a disconnect and remount of the USB.

#

It's fine on a board that doesn't have USB mounting.

thorny jay
#

If I code, I have Mu and the terminal window is build in.

stuck elbow
#

@atomic summit your code can re-enable autoreload if it determines it doesn't want to go to deep sleep

#

@atomic summit your code can re-enable autoreload if it determines it doesn't want to go to deep sleep

#

and if it does go to deep sleep, it restarts anyways

atomic summit
#

Sure, but again, a totally foreign concept to code for, for those experienced in CPY to have to do.

stuck elbow
#

it is an advanced thing

atomic summit
#

hahaha... or a "work around" thing πŸ˜‰

stuck elbow
#

circuitpython is for beginners first

#

it's fine if you need a workaround for not being a beginner

thorny jay
#

Can I unsolder the 16Mb and put a 4Mb? πŸ™‚

atomic summit
#

Right... so to explain to a new user why bard A does this... but board B does like this.

thorny jay
#

I will solder a 4Mb(?) on a QT-Py...

atomic summit
#

Right... so to explain to a new user why bard A does this... but board B does this.

thorny jay
#

It's magic.

stuck elbow
#

they both do this

atomic summit
#

Or more specifically, board a,b,c,d,e,f,g,h does it like this... but these few do thinsg differently.

stuck elbow
#

it's just your operating system that decides to do something else with the bigger filesystem

manic glacierBOT
thorny jay
stuck elbow
#

@atomic summit the whole argument is moot, because you don't really care about baterry power when connected to usb anyways

#

@atomic summit the whole argument is moot, because you don't really care about baterry power when connected to usb anyways

#

and it doesn't happen when you are not connected

atomic summit
#

I'm not talking about battery use stuff..

#

what if I am running code that logs every time it starts up..? I get dbl logs every boot when connected to USB

stuck elbow
#

I thought you were worried that the restart would cause more battery use?

atomic summit
#

I am... but that's for a later date when deep sleep happens

stuck elbow
#

well, you will get double logs every time you change any file anyways then

atomic summit
#

for now, it's about "this board does something different to every other board" and that's a bad user experience in my mind.

#

right, when I am deliberately changing code.. which is different to just plugging it in.

#

bad/confusing user experience

stuck elbow
#

there is no difference at the block device level, a write is a write

#

shame you can't send a pull request to Apple to make it stop doing that

atomic summit
#

Ok, I am now getting it to do the restart code.py even on 4MB flash builds

#

so it's not 16MB specific

#

I deleted all of the hidden files macOS adds

#

and now every plug in, it dbl runs code.py

#

so it's not a flash size issue

#

or more specifically a partition size issue

stuck elbow
#

does that trick @thorny jay linked to help?

atomic summit
#

oh, I missed that link

#

I'l try a bit later, need to get back to renovating my garage

thorny jay
#

There are actually two tricks (that might be identical) one from the original tweet and one from Adafruit I linked to.

#

I have the feeling that I already had double reload, but I cannot tell on what board, with what computer and what version. At one point I felt it was just an anoyance, but could survive that.

stuck elbow
#

at least it doesn't remount on reload, or you would have a loop

#

but there are some disk checking or antivirus programs that completely waste circuitpy drives

thorny jay
#

Nowdays I make my own double reload, because I use main.py that import my application. So when I go to another version, it reload (I copy my app), if I import another app, it reload, if I add a library, it reload.

#

So all in all, it reload a lot.

#

The waster was an old version of Mu that wanted to install demo image/sound/... that was a nightmare when using non express board.

atomic summit
#

Ok, so if this is all stuff folks working with CPY on a Mac are used to, then my concerns are moot, and I'll just accept it as expected behaviour and stop annoying folks about it πŸ™‚

#

I'm still very new to CPY so don't have a lot of my own "use case history" to leverage.

#

Thanks @thorny jay and @stuck elbow for your insights and to @slender iron for looking into it for me.

supple gale
#

I modified one of my esp32s2 boards, removing the 4MB flash and soldering in a 16MB one. No PSRAM. Windows, no reload, Linux, no reload, MAC OS, reload. My code.py is just a routine that cycles a rgb led. Its pretty fast as there is no PSRAM to test but you see the rgb cycle stop then restart.

teal bear
#

@supple gale did ypu build a new CP that has the new chip settings?

supple gale
#

Yes, bult two versions, and loaded on the same hardware, only diff is the flash chip. And the flash size setting. Its interesting. Super time waster but its pouring rain here today.

teal bear
#

time wasters are fun πŸ˜‰

supple gale
#

The setting in this case is in the boards directory, mpconfigboard.mk
CIRCUITPY_ESP_FLASH_SIZE=16MB

#

For some reason on MACOS the board is being detected as a keyboard and is being probed? At least the error message comes up that the attached keyboard is unusable.. Doesn't happen with the 4MB flash version.

steady coral
#

Hey all, using circuitpython on a QT py with 6.0 beta. I thought displayio was native but I keep getting "Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: no module named 'displayio'"

supple gale
#

Thats not specific to the QT py but should be similar

steady coral
#

yeah that's the problem I have the library and I've tried bus_device, display_text, and displayio_ssd1306

low sentinel
#

displayio itself is a module that comes from core circuitpython C code. It is conditionally enabled in the compilation per-board. SAMD21 / m0 boards frequently have it disabled because the extra bytes it takes to compile into the firmware image is too much.

crimson ferry
#

You can add a flash chip to the QT Py, and use the QT Py Haxpress .UF2

steady coral
#

ouch...well that sucks. Thanks for the help though. The chips were out of stock when I bought the qt py. Does the Haxpress have it enabled by default on the firmware?

crimson ferry
steady coral
#

maybe I can compile my own firmware and remove some of the other modules I won't use... πŸ€” haven't done that yet

#

sounds like fun if I can do it lol

manic glacierBOT
#

running the latest 6.0.0 beta 2, I get an error trying to read the battery voltage internally, as referenced here:
https://learn.adafruit.com/adafruit-feather-sense/pinouts
I should be able to just read pin A6 and multiply it out to convert to a voltage, however.

AttributeError: 'module' object has no attribute 'A6'

when running the following:

import board
import analogio

vbatval = analogio.AnalogIn(board.A6)

Am I missing something painfully obvious?

manic glacierBOT
manic glacierBOT
thorny jay
#

ouch...well that sucks. Thanks for the help though. The chips were out of stock when I bought the qt py.
@steady coral Ok, so I have feature request for @river quest that can increase sale. I want to be able to make a basket, put out of stock product in, then get a warning or automate my purchase when all the product I want can be put in the same shipping. I had 4 product I really wanted, but I had to wait weeks before 3 of them became available simultaneously. And this is only possible if once they were available and you could add them to your basquet. Adafruit could figure out... if we produce this piece, then those 10 basquet can be fullfill and we will satisfy those order.

manic glacierBOT
manic glacierBOT
blissful palm
#

The setting in this case is in the boards directory, mpconfigboard.mk
CIRCUITPY_ESP_FLASH_SIZE=16MB
@supple gale I am not sure which board you are talking about but I seem to remember seeing 'USB_DEVICES = "CDC,MSC,HID"'' in the Feathers2 mpconfigboard.mk a while back which confused me..

manic glacierBOT
supple gale
#

@blissful palm Its actually a Stetelthings MAIA which is another ESP32-S2 board. No PSRAM. And yes I wondered about the USB_DEVICES and thought it was a copy from the original espressif_saola_1_wrrom/wrover config. But I dont see that there. And searching only see it on two board configs. I will remove it and see if that please MAC OS.

I am guessing that this is some sort of timing difference between the boot. And MAC OS seeing something, checking if its really a keyboard, then code.py reloads (as it should). Not having a USB sniffer and not being anywhere close to my area of expertise I leave it there. I

manic glacierBOT
#

I have some progress. The above example works perfectly fine, and there is no visible flickering or anything. A version with more pixels lit:

for i in range(16):
    buffer[i] = 3
    buffer[16+i] = 2
    buffer[32+i] = 1

also works perfectly fine. However, if you replace the pass in the while loop with time.sleep(1), you get the flickering. So far so good.

The interesting thing is, you also get the flickering if you use time.monotonic()! That is, somet...

supple gale
#

@blissful palm Recompiled without the USB_DEVICES. Still get the double reload on MAC OS.

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Looks good to me. Thanks!

Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.0.0-beta.2-57-g70a94c8d2 on 2020-10-10; Adafruit Matrix Portal M4 with samd51j19
>>> import board
>>> i2c = board.I2C()
>>> 
>>> # just for grins...
>>> 
>>> i2c.deinit()
>>> import busio
>>> i2c = busio.I2C(board.SCL, board.SDA)
>>> i2c = board.I2C()
>>> i2c
<I2C>
atomic summit
#

And though it didn't stop the code reload, it did reduce the boot time from 5secs to 3secs

#

I'm a little perplexed as to why the boot time would change with these filesystem changes.

thorny jay
#

Obviously your MAC is doing things...

atomic summit
#

As that would suggest the OS is doing something once the USB is brought up during boot that is holding up the boot?

#

@thorny jay Yeah, sure, but I'm curious why it would hold up the boot process.

thorny jay
#

I still have 4 weeks to wait before I can help you with the FeatherS2. πŸ™‚

atomic summit
#

Sorry 😦

#

post really sucks atm 😦

#

I also tried removing USB_DEVICES = "CDC,MSC,HID" due to the discussion @supple gale and @blissful palm were having but that make no difference either

#

This is still on the version from yesterday pre analogin

#

going to play with that later today

thorny jay
#

It is something you put in code.py to be able to log on the flash, that is normally not writable from the CP side.

#

I am totally unsure this would have any effect on boot time... but it could stop the MAC from beeing able to access in read/write.

atomic summit
#

Yeah, but that also prevents folks from being able to write to the USB to copy code on without either doing the IO hack, or having them alter the boot.py via code to disable it.

stuck elbow
#

you can boot it in safe mode to disable it

#

not sure how that's done on the esp, on other devices you just press reset while it's booting

#

then it doesn't execute your code, so it mounts r/w

#

also, I don't think it's holding up the boot, it just makes it restart before it finishes booting

supple gale
#

This is the boot video. Build from today. It boots very fast, probably because it no PSRAM. You can see the code.py reload. Note it doesn’t reload twice if the Mac is logged off.

wise shard
#

I have another noob question. I am trying to modify circuitpython and I am on the right track but is there a way to see prints in a console once it is compiled and installed as the boot loader?

#

I have largely made changes blindly by reading the code and fixing compilation errors but I need to debug a bit.

stuck elbow
#

sure, there is the mp_printf function you can use

wise shard
#

Ah cool!

#

And that will show in the serial monitor?

stuck elbow
#

yes

wise shard
#

Thank you very much!

#

You are two for two on my questions today πŸ˜„

stuck elbow
#

just grep the code for examples...

wise shard
#

I am updating a shared module (shared-module/_stage/__init__.c) but it doesn't seem to build my changes when running make. confirmed by adding nonsense to the code and it compiles successfully. Not sure what to do.

#

Also if there is a place with docs I am happy to read that instead I just didn't find a whole lot on modifying circuitpython itself

#

I got it

low sentinel
#

how do we compile the unix port again?

make -C ports/unix -j20
make: Entering directory '/home/ajnin/circuitpython/ports/unix'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
In file included from ../../lib/axtls/ssl/ssl.h:75,
                 from ../../extmod/modussl_axtls.c:16:
../../lib/axtls/ssl/tls1.h:43:10: fatal error: version.h: No such file or directory
   43 | #include "version.h"
      |          ^~~~~~~~~~~
compilation terminated.
onyx hinge
#

make deplibs && make or so

low sentinel
#

aha command history says make -C ports/unix deplibs thanks you got me to the right place

low sentinel
#
import sys
if sys.implementation.name in ('micropython', 'circuitpython'):
    # uPy allows normal generators to be awaitables
    coroutine = lambda f: f
else:
    import types
    coroutine = types.coroutine

i can't wait to delete this code from circuitpython tests

wise shard
#

Alright I got everything except for the print to work haha.

#

I am trying to use mp_printf() to print a hex value but it is throwing me errors

#

error: implicit declaration of function 'mp_print_int'; did you mean 'mp_print_str'?

#

its a hex value

#

int16

#

I tried to look through examples and read the print implementation but didn't quite see a similar case.

low sentinel
#

paste your line?

wise shard
#

mp_printf(c, "YEAHHHH COLOR");

#

excuse my professionalism

#

this is also my first dive into C haha

#

Oh whoops sorry that was when it was mp_print_int from the error

#

I just tried printf

low sentinel
#

maybe try something like shared-module/vectorio/Polygon.c does

#define DEBUG_PRINT(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__)
wise shard
#

I will do that!

low sentinel
#

i just wasted 2 hours trying (unsuccessfully!) to get gdb to work with the unix port.

#

Does someone have it written down somewhere how to do this (or just know gdb well enough to do it and share)?

#

I can launch micropython from gdb and set b method_name and it'll break there - but list is sorely confused and it doesn't seem to know about local variables.

idle wharf
#

I still have 4 weeks to wait before I can help you with the FeatherS2. πŸ™‚
@thorny jay Are you in the US? I could send you a pre-release S2. I have an extra.

stuck elbow
#

@wise shard the way you normally use printf, you provide a format string: mp_printf(print, "%d", c)

manic glacierBOT
#

We do have a reasonable suspicion that it is related to how the RTC timer is used for time keeping on the SAMD21 with the new sleep code. It is a hack that was necessary due to missing features of RTC (and that is why it's fine on SAMD51, say, not that there are any PewPew devices with a LED matrix with SAMD51). I think that this workaround may be a good idea, because it makes PewPew independent of any future changes around timers and sleep modes, and thus one less thing to worry about.

steady coral
#

Hey all, just looking to be pointed in the right direction. I am compiling new firmware for the QT Py, so that I can add displayio (it is in the haxpress firmware but not the regular one). I have a list of frozen modules but I do not see one for DisplayIO. Is there another location where I can find something like Adafruit_CircuitPython_Displayio?
Frozen module list:

stuck elbow
#

@steady coral displayio is a built-in module written in C, you would enable it in the makefile for the board you are compiling for

steady coral
#

thanks, do you know what line I should add

#

aah ok thanks πŸ‘

manic glacierBOT
manic glacierBOT
#

@tannewt Thanks for all of the feedback! I added in two methods.

make_transparent which takes in a pixel value to make it transparent.
make_opaque which also takes in a pixel value and will make delete the current ColorConverter's transparent_pixel if it is the same color. I'm not sure this is an appropriate way to do it so I am open to feedback!

I compiled everything and loaded it but I still see the pixels so I am hoping with your expertise you might be able to guide me to what ...

#

Quick status update: Iteration 3 of the generic movable allocation system, built on top of the existing supervisor heap, works (as far as tested with the terminal tilegrid, more thorough tests still to be done), but adds a fair bit of code. Now working on iteration 4 to see if redesigning the supervisor heap to intrinsically support movable allocations will achieve the same goals with less code.
I hope nobody is waiting for me, cause I’m having fun down here in this rabbit hole! πŸ™‚

steady coral
#

I noticed that the firmware for QT Py (standard version) has USB_MIDI and I wanted to disable this to free up some stuff to add DISPLAYIO, so I tried CIRCUITPY_USB_MIDI = 0 in the mpconfigboard.mk file but the compiler says: undefined reference to `usb_midi_module'

stuck elbow
#

sounds like something you have enabled depends on it

#

in which file is the error?

steady coral
#

[Makefile:408: build-qtpy_m0/firmware.elf] Error 1

#

I see what you mean though: firmware.elf.lto.o:(.rodata._usbd_driver+0x54): undefined reference to `midid_init'

#

I thought I could just disable it with = 0 but it's referenced...

stuck elbow
#

it should work

#

did you do make clean?

steady coral
#

no let me try that

#

πŸ‘ nice! That worked. I am getting closer, I was able to free up about 5,000 bytes haha...now I need to disable some more stuff so I can fit it on 🀣

#

USB midi, touchio, and USB HID took it from somewhere in the 30,000 overflow to 25,000 overflow

stuck elbow
#

if you don't need analogio, it's rather big

steady coral
#

ok thanks for the tip!

manic glacierBOT
#

The generation of "qstr defs" involves running the C preprocessor on a selection of source files, extracting pattern matches from them, and writing them out into a single output file. Then, a second sequential step reads all that output to produce individual "qstr" files. Especially with a non-lto build on a powerful desktop computer, these sequential steps actually have a pretty large effect on the overall build time.

The improvements came in two discrete steps; refer to the individual ...

bitter solar
#

Hey everyone, can anyone point me to videos/tutorials that would get me started doing what you'all are doing? I have some arduino sensor boards that I'd like to use with circuitpython. I have C#, js and python experience but have been in the enterprise software development world my whole career and never played in the hardware layer.

#

Also, if there is a better place to post this, my apologies and please point me there, thanks...

manic glacierBOT
#

I tried to follow the pins from here: https://learn.adafruit.com/rgb-matrix-featherwing/pinouts#nrf52840-featherwing-wiring-3070338-12. My initializer looks like this:

matrix = rgbmatrix.RGBMatrix(
    width=64, height=32, bit_depth=4,
    rgb_pins=[board.D6, board.A5, board.A1, board.A0, board.A4, board.D11],
    addr_pins=[board.D10, board.D5, board.D13, board.D9],
    clock_pin=board.D12, latch_pin=board.RX, output_enable_pin=board.TX)

It's not throwing errors any mo...

manic glacierBOT
manic glacierBOT
#

This change:

  • adds await() support as the backing implementation hook for CircuitPython async/await noun/verb pair.
  • enables async/await on lots of boards.
  • removes all special cases of if sys.implementation.name in ('micropython', 'circuitpython'): from micropython async tests. These tests now behave like CPython in CircuitPython.

By using __await__() rather than __iter__() (uPython uses iter), CircuitPython is more amenable to library interoperation with CPython. ...

crimson ferry
#

@bitter solar The #help-with-circuitpython channel is a good place to learn. Check out the pinned message there for resources.

onyx hinge
#

Huh, you can't view GitHub actions build logs when not logged in, even for public projects.

manic glacierBOT
low sentinel
#

Thanks @onyx hinge I'll fix it up a little later today. Bad rebase bit me and I was running out the door πŸ™‚
I wonder if I need to update my main to get that pre commit hook. The approval workflow passed on my repo but clearly it is a little different.

manic glacierBOT
manic glacierBOT
#

This decreases the link time, especially on desktop machines with many CPU
cores. However, it does come at a slight cost in binary size, making the flash
section about 200 bytes bigger for circuitplayground_express.

Before, linking build-circuitplayground_express/firmware.elf takes
8.8s elapsed time, leaving 3128 bytes free in flash.

After, linking build-circuitplayground_express/firmware.elf takes 2.8s elapsed
time, leaving 2924 bytes free in flash. (-6 seconds, -204 bytes free)
...

#

A call to supervisor_start_terminal remained in
common_hal_displayio_display_construct and was copied to other display
_construct functions, even though it was also being done in
displayio_display_core_construct when that was factored out.

Originally, this was harmless, except it created an extra allocation.
When investigating #3482, I found that this bug became harmful,
especially for displays that were created in Python code, because it
caused a supervisor allocation to leak.

I ...

onyx hinge
solar whale
#

1PM ET?? usually at 2PM

#

pinned Notes says 2PM

turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

56

Voice Channels

6

Members

25198

Roles

35

onyx hinge
#

@solar whale argh my error- corrected, thanks

spice crypt
#

Is there a practical way to isolate/hide the code files that run on CP away from the other files that appear to the user when a board is connected to a PC and shows up as a storage device?

manic glacierBOT
timber mango
#

Longshot ask here: Is there an audio library that allows me to turn different notes/frequencies on or off on the fly? Example: Piano consisting of 10 keys, and when a certain key is pressed, play a certain note/frequency. (That part is simple, works well) But if two buttons are pressed, play the two associated frequencies -- and when a button or buttons are pressed, stop playing the associated notes. Would be nice if there was a library to do this, so I don't have to reinvent the wheel. Seems like a common situation, but can't find many resources covering this. (Chords)

stuck elbow
#

@timber mango there is a mixer module that lets you mix several sounds together

honest dust
#

It also depends on how you're going to play the sounds. Digitally it's easy to mix two sounds. But if you're using piezo buzzers with PWM (for example), you will need multiple buzzers to play more than one note.

timber mango
#

To be clear, I'm looking for generated tones, not samples. And it'll be output from the board straight to headphones.

stuck elbow
#

you can generate samples

honest dust
#

And if you're not going to generate samples / digital audio, the solution depends on how you're planning to generate the sounds.

blissful pollen
timber mango
#

It doesn't need to be super high quality. It's for a musical trainer, not a performance level project. I'm using Arduino and tone() right now, which is working well, but I'm considering moving over to CircuitPython and looking at audio libraries. Speed is an element, as well, since you want key presses to be non-delayed.

onyx hinge
#

I took a little time to test evezor's canbus featherwing with adafruit's feather stm32f405 express. @teal bear provided me with a free sample.

It works! My test was pretty quick and simple, with the stm32 as the receiver and a prototype Adafruit Feather M4 CAN as the sender.

Suggestions about the featherwing, which you should feel free to take with a grain of salt:

  • Offer a 0.1" pitch jumper for the CAN H/L lines
    • I do like the pass through connector concept though, I just didn't have the parts on hand to use it
  • For better feather compatibility, connect only one "3V" pin not two. A hypothetical future feather might place CAN RX/TX on the same pins but have 3V/Aref pins instead of two 3V pins
  • Consider placing RX and TX labels on the silk next to the pins
  • I would have preferred a solder jumper to enable the termination resistor
teal bear
#

thanks - I'll pass that up the pipe. (it's a very short pipe)

#

0.1" pitch jumper ... me too :p

idle owl
#

@fringe trench Iron control. I don't have a hot air setup here, or flux or solder paste. I'm fairly certain it was a fluke and I couldn't repeat it if I tried. I have another pair to solder up at some point, so we'll see.

teal bear
#

crystal ball says: 6 months from now, Kattni is teaching people how to solder.

onyx hinge
fringe trench
idle owl
#

@fringe trench I believe it is a better way to do it as long as it's capable of the right temperatures.

old smelt
#

Hi All - I'm curious if anyone has done any development to support the parallel capture controller I/O on the SAMD. I did a little bit of sleuthing around here first, but most of the references go back a year or two. I found a brief reference by @meager fog from 2018 that there might be some code lurking around out there.

#

Anyone familiar with this interface? Or more specifically, how to take advantage of it from the SAMD?

idle owl
old smelt
#

@idle owl - that is a start. Thanks! I'll check it out.

#

But I cannot stop staring at that picture. Must...look...away...

idle owl
#

@old smelt Right?

#

And you're welcome. Good luck!

analog bridge
#

@slender iron it seems like PR #3426 is causing double auto-reload of code.py

#

is it something to do with how the host os treats large partitions ?

manic glacierBOT
onyx hinge
#
+++ b/ports/atmel-samd/common-hal/microcontroller/Pin.c
@@ -223,9 +223,11 @@ bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t* pin) {
     #ifdef MICROPY_HW_NEOPIXEL
     if (pin == MICROPY_HW_NEOPIXEL) {
         // Special case for Metro M0 where the NeoPixel is also SWCLK
+#ifndef IGNORE_PIN_PA30
         if (MICROPY_HW_NEOPIXEL == &pin_PA30 && DSU->STATUSB.bit.DBGPRES == 1) {
             return false;
         }
+#endif
         return !neopixel_in_use;
     }
     #endif

``` @slender iron any idea how it's getting by without the "ignore" check? It started breaking in my PR which changes LTO linking ..
slender iron
#

is it something to do with how the host os treats large partitions ?
@analog bridge That's my assumption. That PR just makes everything the actual size it should be. I know there is a point where FAT12 becomes FAT16 but I'm not sure what the boundary is. @tulip sleet would remember

#

@onyx hinge not sure. does ignore actually not declare the object or just omit it from the microcontroller pin table

tulip sleet
#

@analog bridge @slender iron 16MB is the normal transition from FAT12 to FAT16 (it actually depends on number of clusters, so it could be different the clusters are not 512 bytes, but they usually are)

slender iron
#

hrm, and the 16MB storage will use the first few MB for circuitpython code and not the FS

#

so the FS won't hit 16MB

manic glacierBOT
supple gale
#

i believe its 2MB. 4086 clusters

#

MIN_FAT16 is 4086, anything below that is FAT12.

#
    fmt = FS_FAT12;
    if (nclst >= MIN_FAT16) fmt = FS_FAT16;
    if (nclst >= MIN_FAT32) fmt = FS_FAT32;
slender iron
#

ah! and I think the partition on the 4MB version is just under 2

supple gale
#

seems to be 1MB on mine. (4MB flash). On the 16MB I get a 12MB CIRCUITPY drive. fwiw.

slender iron
#

πŸ‘

idle owl
#

@slender iron Have a minute for a question?

slender iron
#

yup!

idle owl
#

Excellent. In the meeting when Limor suggested including an example for the LED Animation library that resets the board on M0 if time.monotonic() is over 100k, you seemed like you were going to say something, and then didn't. Did you have another suggestion or some input on that?

slender iron
#

ha ha, ya. I was thinking ahead about whether we want to reset the internal clock on reset

idle owl
#

Ahh ok.

#

So not really related to the example then, it would be behind the scenes things?

slender iron
#

I think we'll want to remember the start up time and subtract it out from the internal clock

#

yup

idle owl
#

Fair enough. As long as I have you here, I don't know what code is needed to reset the board. Is it microcontroller.reset or something?

slender iron
#

yup, I think it's that exactly

idle owl
#

Well, good job me. πŸ˜„

#

Alright, thanks!

slender iron
#

I could be wrong πŸ™‚

idle owl
#

I'll find out!

slender iron
#

np

idle owl
#

It reset doing that from the REPL, so I suppose that's right πŸ™‚

#

And the code works. Hurrah.

slender iron
#

πŸŽ‰

idle owl
#

@slender iron She said 100k when she mentioned it, but I'm looking at a print of time.monotonic() and it only has 5 digits printed. So I would assume that the timing precision would be lost over 1000.0 or at the top end 10000... am I misunderstanding this?

slender iron
#

it's not as clear as a decimal value because it depends on bits

idle owl
#

hmm alright

slender iron
#

dan would have an idea

#

he understands floats better than I do

idle owl
#

True that. I'll ping him. Thanks!

slender iron
#

np

idle owl
#

@tulip sleet See above. I'm looking to avoid the loss of timing precision for LED Animations. On the M0, right now, if you let it run long enough, they slow down because of loss of precision in time.monotonic(). I'm writing the code that resets the board before that happens, but wanted to know what to set it to. Limor said 100k, but that doesn't jive with the printout I'm getting in the serial console for monotonic().

#

The code works, but I need to know a good number to set if time.monotonic() > foo:

tulip sleet
#

@idle owl I think I figured out the boundary for loss of precision in an issue. Let me look...

idle owl
#

@tulip sleet Thanks!

tulip sleet
idle owl
#

@tulip sleet Perfect, thank you so much!

tulip sleet
#

an hour is easy to remember and understand

idle owl
#

Indeed it is

onyx hinge
#

At 1.165 hours it would start losing the ability to count each single millisecond, though probably the times LED animations deal with are probably bigger, like 10ms or 100ms aren't they?

idle owl
#

@tulip sleet I'm writing an FAQ for the LED Animation guide that explains the slow-down on M0, and includes this example. May I run it by you once I'm done to make sure I explain it right? I can't copy what you wrote it's WAY more detail than this needs. In fact, reading what you wrote, I may need your input before I write it.

tulip sleet
#

sure

onyx hinge
#

(not that resetting hourly is bad or would usually represent a problem)

tulip sleet
#

well, we could say about an hour per msec, but once an hour is an easy rule of thumb, and probably wouldn't disturb anyone

idle owl
#

Thanks. Ok, so basically, on the M0, time.monotonic() is only capable of a certain number of digits, so the precision of the float decreases over time. After a particular amount of time, it's no longer a float, meaning.... ok I'm lost here on how to explain this I think.

#

How would you explain this to a newbie? Someone running LED Animations on their CPX, and the comet slows down if they leave it running too long.

tulip sleet
#

it's still a float, but it loses accuracy

#

actually it's not an hour per msec, since the loss doubles about every hours

#

it would be like a clock that ticked only every 2 secs instead of every second after it ran for a while, then after another hour it would only tick every 4 seconds. So the loss in accuracy is the smallest interval we can measure. That interval goes above 1msec after about an hour.

idle owl
#

Ahhhhh

tulip sleet
#

i am wrong about doubling every hour, that's not true. The internal tick count is still accurate, but when it gets converted to a float we lose precision. That is, there is an internal tick count that's still accurate, but there's no way to pass that value to the Python code.

idle owl
#

Fair enough

tulip sleet
#

Another example (not a float), is suppose you could only represent a monetary value as, say 4, significant digits. You could represent $99.99 exactly, but once you get to $100 you have to start quoting the value in tens of cents, not exact cents. But that's probably too stretched of an analogy

idle owl
#

Hmm, not such a stretch maybe.

#

I liked the clock one but it doesn't cover the digits issue.

idle wharf
slender iron
#

@idle wharf My ideal would be that it modifies a draft release, not a committed file.

idle wharf
#

That one just popped up on twitter for some reason, but If I stumble into that one specifically... I'll let you know. πŸ˜‰

idle owl
#

I explained time.monotonic() in my Hacking Ikea Lamps guide, so I linked to it instead of going into it much in the FAQ.

tulip sleet
#

@idle owl it's not that the clock is inaccurate, but that it ticks less often. So instead of seeing the second hand tick every second, jumping from one second to the next, it just jumps in two-second intervals, then four, etc. Also, I am confused: is this SAMD21 specific? I thought is was just on builds that don't have longints. I thought if the build supported monotonic_ns() (like, say, Metro M0), then you don't have this problem.

idle owl
#

Oh hmm

#

I may be unaware of how this all applies

tulip sleet
#

it is true on non-express builds on M0 boards

#

trinket M0, Gemma M0, PyQT without external flash

idle owl
#

OK, I updated the FAQ question to say "non-Express board"

#

and the text

tulip sleet
#

more specifically, any board that doesn't implement monotonic_ns()

#

but non-express is easy

idle owl
#

refresh it

tulip sleet
#

so it's not as if time slowed down, it's just that the clock is less accurate. For instance, if you were trying to see how long something took (like, say measuring your pulse), and the seconds jumped betwee 0,4,8, etc. you would get pretty frustrated.

idle owl
#

Ah alright

tulip sleet
#

"on a SAMD21..."

idle owl
#

good catch

manic glacierBOT
teal bear
#

"slow down" isn't the right wrods. "jerky" or rough is better..

idle owl
#

@tulip sleet Alright refresh again.

tulip sleet
#

the second hand jumps two seconds at a time, then later four seconds, etx.

#

that's good! looks quite clear to me

idle owl
#

Excellent! Thank you so much for your help!

tulip sleet
#

yw!

idle owl
#

It's for a QT Py guide (and the FAQ), but I figured it was good to have a few examples that run on M0 in the library so I put them there instead of the Learn repo. Also, easier to maintain.

tulip sleet
#

why don't you say "after about an hour has passed" instead of "a certain amount of time". That motivates the 3600 seconds.

idle owl
#

sounds good

#

Updated the clock analogy too.

tulip sleet
#

or after about 70 minutes (1.165 hours is 69:54, according to alexa)

idle owl
#

to refer to an hour.

#

Hah!

tulip sleet
#

i just got an echo show and am using voice to compensate for bad elbow

idle owl
#

We have one of those. Have fun with her hearing you when you didn't mean for her to, and mishearing you when you need her to. πŸ˜„

tulip sleet
#

i was wrong that it only takes an hour to go from two to four seconds. It takes about one hour to go from one to two, then about two hours to go from two to four, etc.

idle owl
#

Also use headphones in meetings and during AAE. Phil cares not a bit about using her name.

tulip sleet
#

i have been disabling it at times πŸ™‚

idle owl
#

@tulip sleet I updated the clock bit to say "after another two hours"

tulip sleet
#

ok, excellent: clear explanation for a confusing concept πŸ‘

idle owl
#

Great! We did it! πŸ˜†

#

Can you take a look at my LED Animation PR? It's only added examples.

manic glacierBOT
#

I compiled everything and loaded it but I still see the pixels so I am hoping with your expertise you might be able to guide me to what the next step should be. smile I spent the better part of yesterday trying to figure out why but alas I was not able to.

Hrm, I thought it might be an issue with what calls the ColorConverter but the code looks right: https://github.com/adafruit/circuitpython/blob/main/shared-module/displayio/TileGrid.c#L439-L450

The next step I'd do is print out the ...

#

The color is a simple value without it's own memory so don't call m_del on it. Instead, you'll either want a sentinel value that means the color is invalid, such as 0x1000000, which is higher than 24 bits of color. Or, you can use a separate boolean to track when the color is valid.

I think you'll want to raise an exception (mp_raise...) here if the given color doesn't match the existing one.

idle owl
#

I don't want to leave the FAQ hanging long without the example since the page is already live.

idle owl
#

Thank you!

tulip sleet
#

off to πŸ₯˜

idle owl
#

Oh right. Dinner. Oi... lost track of time!

blissful pollen
#

@idle owl just was lurking and read your FAQ entry and it reads and makes perfect sense to me the way you described it

idle owl
#

@blissful pollen Thank you so much!

manic glacierBOT
blissful pollen
#

@idle owl I also looked at the PR (not really used to doing reviews yet!) I don't have the express or haxpress to actually try it but the examples all look good from all my time in this library before. Do I just put a comment in there to say such?

idle owl
#

Yes! That is perfect!

#

Are you added as a reviewer yet for CircuitPython PRs?

blissful pollen
#

I don't think so? I've left a couple comments but that's it

idle owl
#

Let us know if you'd like to be able to merge PRs following review and we can add you to the CircuitPythonLibrarians group on GitHub. You'd be official! πŸ™‚

#

You're also welcome to comment a few more times to get the hang of it, if you'd rather.

#

Simply let us know!

blissful pollen
#

You can add me when you have a moment, as you said I'll probably just comment a few times to make sure I understand things first so I don't merge something I shouldn't

idle owl
#

Great! I'll do that tonight or tomorrow. That's perfect. The Git and GitHub guide also has a page on reviewing.

blissful pollen
#

Thanks (yeah I realized I just commented on a merge request, hadn't refreshed it before oops!)

manic glacierBOT
#

Very cool! Thank you for all of this work.

Have you thought about what hardware and library APIs could benefit from this?

Yes, I can't wait wait to make a context manager for communication resources, e.g., SPI.
Devices like BME680 take wall clock time to generate their results. I want to see library developers produce APIs that accept a context manager that provides access to a bus object. That context manager would bundle a chip select pin and the SPI bus together ...

idle owl
#

Thank you!

blissful pollen
#

No problem, that was an easy one πŸ™‚

manic glacierBOT
#

I suspect this is the issue: https://github.com/adafruit/circuitpython/blob/main/supervisor/shared/tick.c#L128-L130 It turns off interrupts at a fairly high level. You can comment these interrupt things out temporarily to test. We'll want to push them lower into the critical section of the RTC read instead of here.

This code was there before but I suspect reading SysTick is much faster than reading the RTC.

onyx hinge
#

wow @slender iron thank you for all the merges

slender iron
#

πŸ™‚ I backlog the CI

low sentinel
#

Hey @slender iron I'm sure you are aware that change turns on the async/await syntax for CircuitPython.

It's a fairly big addition - thanks for taking it. I hope this greatly expands CircuitPython applicability with the top tier hardware support y'all have created and now an available asynchronous programming paradigm that tries to be faithful to CPython.

I believe it's non-intrusive to users who want to use CircuitPython as they always have and I hope it's useful to others (besides me)!

slender iron
#

haha, that's the smallest big change I've seen πŸ™‚

#

I appreciate your persistence with it. I'm happy to see us match CPython

low sentinel
#

Big implications for the questions you will get in this channel though 😬

slender iron
#

you are the person who added it πŸ˜‰

#

hopefully matching CPython will lead to fewer gotchas and questions

low sentinel
#

Yeah, I'd like to consider any functional difference as a bug. It should work the same way. There is a lot of surface area though and people are creative. Should be good fun though. Feel free to @ me :-p

slender iron
#

πŸ˜„ thanks!

#

I don't plan on teaching people how to use it so they'll be on their own. I'd be happy to promote any tutorials or libraries you create though.

low sentinel
#

Sweet! I'll make a context manager for busio when I get a chance. A tutorial would be a good thing to do as well yes.

slender iron
#

πŸ‘ I'm open to native async aware hardware apis too

#

they'd just live alongside the existing ones

#

k, walk time before the sun goes down

manic glacierBOT
teal bear
#

@onyx hinge "I will make those other changes to the next revision. Be sure to thank Jeff for me " -- Andrew

onyx hinge
#

Cool, thanks Andrew, @teal bear

wise shard
#

@slender iron TRANSPARENCY WORKED. I was passing in the wrong value haha. I changed it to the decimal representation and everything came together nicely. πŸ™‚ I will add in your feedback now!

#

Thanks for the direction!

slender iron
#

@wise shard πŸŽ‰ nice job!

#

were you doing your color as 0xrrggbb?

lofty grove
#

@onyx hinge Hey Jeff, working with @teal bear and @north path on the Evezor project. Thanks for your feedback on the Can Featherwing, we appreciate it!

wise shard
#

I was actually copying some value that was being set as .pixel but I think the entire value was truncating or something

#

it was 8184

slender iron
#

hrm, glad you sorted it out

ornate breach
#

hey @slender iron do you know how often pidcodes goes through their PRs?

wise shard
#

Thanks again!

ornate breach
#

or how long it roughly takes?

slender iron
#

@ornate breach they haven't recently that I know of. I intend on merging into my aggregate PR every so often though

#

I need to

ornate breach
#

gotcha. I'm hoping they get it done before I launch my board

#

still have over a month but some PRs have been sitting for a while

#

Maybe I just need to fork over the 6K to get a VID hehe..

slender iron
#

I'll try and merge them into the aggregate tonight

ornate breach
#

okay, do I need the PID verified before doing a PR on the CP repo?

#

I'll be doing that in like... the next few weeks (hopefully) to add my board.

slender iron
#

no, I'll accept them if they are in my aggregate branch

#

I've gotten a couple of emails from the guy who does it. I'll poke them again.

ornate breach
#

Okay cool

#

I'm pretty excited. I've got my DAP rig all ready to hopefully DAP my board tomorrow πŸ˜„

#

feather m4 express + adafruit SD breakout, some headers setup for contact. bin loaded on the SD card and verified that the feather sees the card.

manic glacierBOT
slender iron
#

nice!

ornate breach
#

can't wait to get this board out to the masses. Also really loving the Qt Py

#

i've made 3 tutorials on my company blog so far

#

all CP based. Really getting to love CP

slender iron
ornate breach
#

it's surprising how much simpler it is to do basic interrupts in CP than it is in C

#

debouncing is about the same complexity (throw a delay in there)

#

Anyway, thanks for your help!

#

Still haven't forgot about the Lattice Tree feather wing. Just haven't quite figured out programming it quite yet hehe..

manic glacierBOT
manic glacierBOT
#

@tannewt Thanks for the review!! I am so close to finishing this up but alas I ran into an error when adding the exceptions.

I keep running into:

../../shared-module/displayio/ColorConverter.c: In function 'common_hal_displayio_colorconverter_make_transparent':
../../shared-module/displayio/ColorConverter.c:133:9: error: implicit declaration of function 'mp_raise_RuntimeError' [-Werror=implicit-function-declaration]
  133 |         mp_raise_RuntimeError(translate("transparent_c...
slender iron
#

@wise shard "implicit declaration" usually means you need to add an #include at the top

wise shard
#

Oh great

#

I will do that

slender iron
#

in this case I think you need "py/runtime.h"

#

iirc

wise shard
#

thanks!

slender iron
#

np, will do a full review tomorrow

wise shard
#

stack overflow was confusing me haha

#

thanks! no rush πŸ™‚

manic glacierBOT
manic glacierBOT
#

async/await keyword support has been accepted into CircuitPython as of https://github.com/adafruit/circuitpython/pull/3540

There is currently no native scheduler implementation or interrupt-scheduled coroutines (yet!) but as @dhalbert mentioned back in August simple time-based pure-python async scheduling has been demonstrated on CircuitPython; also it's easy to reproduce from scratch (and completely understand) with not much more than following along with the good Mister Beazley https://w...

slender iron
stuck elbow
#

oh no

hybrid scarab
#

CircuitPython for new micro:bit πŸ€”πŸ€”

stuck elbow
#

as usual they picked an outdated and weak mcu

hybrid scarab
#

It’s a CLUE with half the RAM as near as I can tell?

#

nRF52833 vs nRF52840 - really brings it out of the customised-interpreter-nightmare purgatory the original ended up in

manic glacierBOT
onyx hinge
#

@hybrid scarab I think nrf52833 is technically supported in CircuitPython, the pca10100 and simmel seem to have it. You won't get all the capabilities of an 840 though. "Built-in modules available: _bleio, analogio, audiobusio, audiocore, audiomixer, audiopwmio, board, busio, digitalio, gamepad, math, microcontroller, os, pulseio, pwmio, random, rtc, storage, struct, supervisor, time, usb_hid, usb_midi, watchdog" https://circuitpython.org/board/pca10100/

The nRF52833 development kit from Nordic.Purchase Price ComparisonContributeHave some info to add for this board? Edit the source for this page here.

#

pull requests welcome to add microbit v2!

hybrid scarab
#

@onyx hinge ooo! nice

manic glacierBOT
#

Hello There!

I am trying to make a custom board for CircuitPython my design is based around the feather M0 (Pin configurations). i have done with the hardware testing and everything is working as it should be. except for the SPI flash (which uses the same pins as ITSYBITSY M0 Express.

I have tested the board using no SPI flash configuration and the CIRCUITPY device shows up on my win 10 and Mac, but when configuration the CircuitPython firmware to use external flash the drive won't sho...

manic glacierBOT
#

I can take a run at fixing this, but looking over it I am a bit concerned about the mimxrt10xx port fix. Currently the other ports define and use CIRCUITPY_FULL_BUILD = 0 (or 1) and that is used to set other values such as MICROPY_CPYTHON_COMPAT.

The mimxrt10xx does not set full build, so it defaults elsewhere to being defined to 1. If we set ORDEREDDICT = CIRCUITPY_FULL_BUILD it will include this feature for that port when it should not. If we define CIRCUITPY_FULL_BUILD to 0 the...

idle owl
#

@blissful pollen I've invited you to join the CircuitPythonLibrarians team on GitHub.

#

@blissful pollen You now have merge/write access to 280+ repositories on the Adafruit GitHub. Use your powers wisely! πŸ˜‰

blissful pollen
#

@idle owl MUHAHA πŸ™‚ thanks!

idle owl
#

You can ALWAYS ask us questions before doing anything, never hesitate to do so, we're always happy to answer questions.

blissful pollen
#

For sure!

idle owl
#

So if you're unsure, ask. No worries.

#

Otherwise, remain positive and supportive, and test things before merging if possible or necessary. E.g., keep doing what you're doing. πŸ™‚

blissful pollen
#

Sounds good, yeah last thing I want to be is the person who breaks the build

idle owl
#

It'll happen! We've all broken something at some point. But we learn from it and pass that on and it happens less and less, obviously.

onyx hinge
#

<@&356864093652516868> Hi all -- the weekly discord meeting is in about 90 minutes. Please take the time to add your notes to the document https://docs.google.com/document/d/1OiVJFRT-x4RwJv98aJRrXWwUi1p77obFGyLtlMalWFI/edit -- it's super helpful. If you don't have a mic or prefer not to speak for any reason, just note that and I'll read your notes aloud. If you don't have time to add your notes, but plan to speak during Hug Reports or Status Updates, either add your name or let me know so I can add it. Otherwise, I'll assume you're lurking (which is just fine!) If it's your first time speaking in the meeting, make sure we've added you to the Circuitpythonistas role. I'm looking forward to catching up with everyone! (Now's a good time to add your In The Weeds topics too)

thorny jay
#

Not sure if I will be ready for the meeting... I am warming up my soldering iron to hax a QT-Py and to make my Matrix Portal M4 by 64x64 compatible. And then some friend ask me if I will watch some apple live event. Not to mention that I have a work meeting to also prepare.

manic glacierBOT
wispy badger
#

Hey guys, I published a guide on how to install CircuitPython on the Seeeduino Xiao board. I would love to hear your feedback https://www.youtube.com/watch?v=1GKF9u7pVgs

Dear friends welcome to another tutorial. Today I am going to show how to install CircuitPython on the Seeeduino Xiao board! Yes, believe it or not, we can program this tiny board using Python, a staggering achievement of engineering. Subscribe for weekly videos β–Ά https://bit...

β–Ά Play video
onyx hinge
#

@wispy badger thanks for sharing! did you submit it to the python on hardware newsletter too? If not, hint-hint πŸ™‚

wispy badger
#

@onyx hinge no I didn't. I am new here. How to do it?

onyx hinge
#

Adafruit publishes a weekly newsletter and community based activity is really the core of it. You can email anne AT adafruit.com, or twitter @anne_engineer #circuitpython-dev or send us pull-request against the current draft on github https://github.com/adafruit/circuitpython-weekly-newsletter/

wispy badger
#

Cool stuff! I need to subscribe to that newsletter!

onyx hinge
#

It has a readership list of several thousand last time I heard, so it can be a great way to get eyes on your python on hardware project. And by the way, welcome to the community!

wispy badger
#

Thank Jeff! It is nice to meet you and your lovely community.

onyx hinge
#

Your name seems familiar to me, so I jumped to the conclusion that you were not new. πŸ™‚

wispy badger
#

I just found out about CircuitPython and I love it!

slender iron
#

pull requests welcome to add microbit v2!
@onyx hinge I don't think it has native USB connected directly unfortunately. It got me thinking about code editing over BLE again

onyx hinge
#

@slender iron oh drat!

#

I must have seen a project of yours before or something

stuck elbow
#

also, it's the wrong nrf chip

#

as usual

slender iron
#

it'll work, just not as well as the 840

#

I imagine they did it for cost

manic glacierBOT
wispy badger
#

@onyx hinge I tried to send an email to anne AT adafruit.com but it is not a valid email

slender iron
#

I think it's anneb@

onyx hinge
#

@wispy badger my mistake, tannewt had it right

wispy badger
#

thanks guys!

manic glacierBOT
manic glacierBOT
pastel panther
#

hey all, lmk if you have any thoughts about what a pleasant way of setting entries in a look up table in python should work. Size is limited to 8 entries and map a temperature to a fan speed. Current default plan is to make it work similar to a dictionary but 🀷

slender iron
#

should the temp entries be sorted?

grim dagger
#

@slender iron I just tried to build and test CP with your STM RTC fix in it. I wanted to try SH1107 I2C, but the build seems to not include the SH1107 quirk? I'm probably missing something obvious but I'm getting the "extra keyword arguments" error from my SH1107 driver with this build.

slender iron
#

@grim dagger are you on my branch?

#

I think it's based on the latest so it should have it

pastel panther
#

@slender iron yes they should be sorted

grim dagger
#

I'm on master. Wasn't sure about master or main. I have sync'd to the latest adafruit stuff and sync'd submodules. Your fix is already merged so I thought this would work.

slender iron
#

main

grim dagger
#

Argh

slender iron
#

master is old

#

(its probably time we deleted it)

pastel panther
#

or at least that's how they'd be used. There are 8 lut slots and the sensor expects each to be greater than the last

slender iron
#

@pastel panther are the temps fixed? if not I think a dict with a size limit makes sense

pastel panther
#

@slender iron The number of lut entries is fixed, is that what you mean?

#

I agree that it's not dictionary-ish

slender iron
#

I was wondering if the temp thresholds are fixed

grim dagger
#

Can't seem to build main:

Switched to branch 'main'
Your branch is up to date with 'origin/main'.
mark@mark-ubuntu-8460p:~/circuitpython$ cd ports
mark@mark-ubuntu-8460p:~/circuitpython/ports$ cd stm
mark@mark-ubuntu-8460p:~/circuitpython/ports/stm$ make V=1 BOARD=feather_stm32f405_express
make: *** No rule to make target 'lib/protomatter/src/core.c', needed by 'build-feather_stm32f405_express/genhdr/qstr.split'. Stop.
mark@mark-ubuntu-8460p:~/circuitpython/ports/stm$

slender iron
#

@grim dagger make sure all of your submodules are up to date (I suspect protomatter isn't)

pastel panther
#

no, the temp thresholds in the lut are not fixed, you can update them

onyx hinge
#

I'll be in the voice channel if anyone wants to do a mic check. See you in about 14 minutes for the meeting.

slender iron
#

kk, I think a dictionary-like object with a limit of 8 entries is fine

#

you can handle the ordering internally

pastel panther
#

ya

grim dagger
#

@grim dagger make sure all of your submodules are up to date (I suspect protomatter isn't)
@slender iron is "git submodule sync" not enough?

slender iron
#

sync only sync the url source

#

you also want git submodule update

#

git status should show a change

#

before you update

pastel panther
#

I'm thinking I'll raise an IndexError if they try to set a 9th and instruct them to update or remove an existing entry

onyx hinge
#

@lone axle are you able to paste links today, especially during the news section?

grim dagger
#

yes git status was trying to tell me. sorry... have never worked with a project that has submodules before!

slender iron
#

np πŸ™‚ it's a common cause for confusion

lone axle
#

@onyx hinge yep, will do.

manic glacierBOT
modern wing
#

Good afternoon all you wonderful folks -- happily lurking (notes doc updated) πŸ™‚

wise shard
#

Ahhh so that is why it failed. Ran out of memory. That is kinda scary

slender iron
#

@wise shard it's a reality of the samd21 builds

wise shard
#

TIL! I am happy to close my PR and just have that custom code in my personal build if needed

#

Not sure how much people need this feature 🀣

slender iron
#

no, we can make room πŸ™‚

trim elm
#

lurking

manic glacierBOT
idle owl
#

Thanks

stuck elbow
#

lurking

thorny jay
#

Totally lurking... still editing my notes.

idle owl
#

@uncut nexus Are you lurking or participating?

tidal kiln
#

late and lurking

modern wing
#

Gremlins are abound today.

uncut nexus
#

lurking - I put it in the hug reports notes

idle owl
#

@uncut nexus I see that now! Thank you!

onyx hinge
#

now my audio is gone

#

guys, I'm going to have to reboot.

solar whale
#

🌩️

idle owl
#

No worries! Do it up.

modern wing
#

🚧

#

We've all been there. Just the other day, I had a very important zoom that was disconnected due to a Windows 10 update. Yeah, I had the update settings to delay until after hours. No, that wasn't respected.

#

We hear ya Jeff

lone axle
low sentinel
#

(lurking)

manic glacierBOT
#

Unfortunately, it doesn't look like that flash is actually used by any boards. It's hard to say it will work if it isn't used.

It should be usable with a corrected config. I find the best way to debug new flash is by sniffing the SPI lines with a logic analyzer and/or setting a breakpoint, via a debugger, here: https://github.com/adafruit/circuitpython/blob/main/supervisor/shared/external_flash/external_flash.c#L224

carmine mesa
#

hey i made a blockchain in python that uses python as the smartcontract language

#

and ive been a maker since make volume 4

#

i want to partner with circuitpython somehow... idk how but maybe some sort of hardware iot blockchain thing?

slender iron
#

circuitpython is open source software so you are free to use and extend it

carmine mesa
#

well sure but i want to get more involved with the community somehow

#

just saying 'go play with it' isnt really as fun as working with people

blissful pollen
#

Thanks for having me too! And you are welcome

modern wing
#

Indeed, thanks Kattni πŸ™‚ The more, the merrier!

slender iron
#

@carmine mesa we're doing a community meeting atm in the circuitpython voice channel

carmine mesa
#

ok ill join and listen

slender iron
#

πŸ‘ welcome!

thorny jay
#

I was in the middle of editing the Hug report... and browser freeze. I hope the content was consistent.

carmine mesa
#

maybe i can explain my project? its pretty cool and deep into the python internals

slender iron
#

@wise shard you just missed two hug reports for you πŸ™‚

wise shard
#

Haha aw cool!

#

I am just listening πŸ™‚

slender iron
#

@carmine mesa you can take a couple minutes during status updates to talk about it or wait to in the weeds

carmine mesa
#

ok cool

#

whatever works best for you

slender iron
#

the weeds is probably better

carmine mesa
#

cool lets do that

slender iron
#

will add you to circuitpythonistas so you can speak

carmine mesa
#

thanks!

slender iron
#

@carmine mesa please mute until the weeds

carmine mesa
#

oh sorry

#

muted

slender iron
#

np

thorny jay
#

Yeah @idle owl I have seen you PR for LED animation on M0. Great that reset after one hour to keep monotonic_ns precise. Dunno where it is published, but since I lurk on the learn guide repo...

idle owl
#

@thorny jay Published it to the LED Animation library. It's in the examples.

manic glacierBOT
lone axle
solar whale
#

Have to go to another meeting :-(. Have a good week, all! πŸ‘‹

idle owl
#

Later @solar whale!

slender iron
#

thanks @solar whale!

modern wing
#

This isn't the keyboard you're looking for. πŸ‘‹

thorny jay
#

Or marketting for S2 getting out of beta or ???

#

I take a 4 day week-end, so I might look at that fest thing.

slender iron
carmine mesa
thorny jay
#

Fail.

#

But that would be in C?

#

SPI in Python... Ok

#

Could be fun.

balmy stirrup
#

We could use the register lib I assume?

thorny jay
#

FAT code in Python. πŸ˜‰

carmine mesa
#

thanks everyone! message me if youre interested in blockchain. our repo: https://github.com/lamden/lamden

thorny jay
#

Ok, thanks. Just for fun... I can try.

balmy stirrup
#

Ahh ok makes sense.

thorny jay
#

Long term plan. πŸ™‚

slender iron
#

that's the logic for writing to the flash

modern wing
#

Thanks!

errant grail
#

Thanks!

thorny jay
#

Thanks.

balmy stirrup
#

Thanks!

idle owl
#

Dropping off. Have a good one, all!

slender iron
onyx hinge
#

Hey <@&356864093652516868> here's the notes document for the next meeting: https://docs.google.com/document/d/1YnwzXSsa2jI8DdzguNvYpXXwG7-MEip9TyDt3PmvwvM/edit?usp=sharing See you next Monday at the usual time, 2PM ET / 11AM PT. 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!

ornate breach
#

hmm. so I successfully loaded the bin to my board but it doesn't show up on my computer. hmmm

slender iron
#

if you have serial but not the drive, that means the flash config is incorrect or it's mis-soldered

ornate breach
#

no serial

#

It programs over DAP just fine it seems.

manic glacierBOT
ornate breach
#

rebuilding the board bin and going to reprogram over DAP

#

hmm... no luck

manic glacierBOT
#

I've got the 33dee4a build from S3 installed on my Feather STM32F405 and I am seeing some odd behavior with time.sleep() taking longer than it should I think. I am running this code:

import time
for i in range(0,10):
    print(i)
    time.sleep(0.01)

This code is taking roughly 10 seconds to complete printing the numbers. At first I was thinking perhaps it's off by a factor of 10, but oddly enough if I tweak it to time.sleep(1) instead I am seeing pretty much the s...

ornate breach
#

Checked the board and pin assignments and soldering

manic glacierBOT
#

I'm seeing a similar error on a PyPortal where upon start up, an I2C UVC sensor may or may not work. And it appear random. It has worked for hours at a time and then just refuse to start with a "Value Error: No I2C device at address:39"

Which brings up a question: How does one decide if everything is up to date? It seems like a daily reload of CP and all libraries shouldn't be required every time there might be a suspicion that the libraries are out of date. Is there tool that can look ...

orchid basinBOT
manic glacierBOT
ornate breach
#

@slender iron should it initialize properly from the bin generated by run the make BOARD=CP_Sapling_m0 ?

#

Or do I need a different bin?

slender iron
#

do you have a bootloader installed?

#

I think by default the bin will be positioned for a bootloader

ornate breach
#

No, I was using the DAP to program the bin I built

#

The printout on the serial monitor indicates it successfully programs

#

Would that bin not work for boot loading or do I need to do something different?

stuck elbow
#

it's offset to leave room for the bootloader

#

so I think you need the bootloader too

ornate breach
#

Hmm okay

manic glacierBOT
manic glacierBOT
ornate breach
#

@stuck elbow is the bootloader the same for every samd21e18a chip?

stuck elbow
#

no, it uses LEDs that may be on different pins

#

you can use the one for fluff m0, it has all leds disabled

ornate breach
#

where do I find the bin for your fluff?

orchid basinBOT
stuck elbow
#

weird, there is no link on the downloads page, I thought it was added

ornate breach
#

nvm, I'm going to make one off the uf2 repo

manic glacierBOT
ornate breach
#

cloned to local and adding config stuff

manic glacierBOT
stuck elbow
#

ah, there was no release yet since fluff was added

slender iron
#

@ornate breach you can also build circuitpython to not be offset and run on its own

ornate breach
#

worked with the uf2

#

I'm derp sometimes lol

manic glacierBOT
ornate breach
#

okay... so after the bootloader is on and it shows up serial and as bootdrive

#

I just drag the CP uf2 to the boot drive for the board

ornate breach
#

alright... it came back up as Circuitpython drive

#

that's really exciting

#

now... I need to flash the neopixel

thorny jay
#

I wonder how you develop for the Matrix Portal M4... or let's say how you power the Matrix Portal M4 and communitate with it? Windows 10 on my laptop complained that this USB device was pumping too much power (it was in French, but I have a picture). And that of course because I was with a lot of white pixel. Do you use a splitter to have power from an external source but USB data to your computer? Do you power the matrix externaly and not from the Matrix Portal M4? Do you reduce the brightness while developping and change that depending if USB is connected? What is your trick (and is it documented in the learn guide)? ( Maybe for @gilded cradle )

gilded cradle
#

@thorny jay I was able to plug it into the USB-C port on my Macbook Pro (which should deliver up to 3A). If you are using a USB3 port, I think 900mA is max, so you may need to use a powered USB hub. I'll have to give it a try whether that works to know for certain.

thorny jay
#

Sorry, using an old second had T440p... one USB might be "high power", I need to give it a try.

ornate breach
#

hey @slender iron should the neopixel be on when the CP uf2 is loaded?

thorny jay
#

Also, powering a 64x64, it might not help to have the dubble of pixel.

gilded cradle
slender iron
#

@ornate breach if you have it setup

thorny jay
gilded cradle
#

Yeah, something like that would probably work too.

thorny jay
#

Thanks, that will be for tomorrow or my long week-end. But the auto-orientation of the Matrix Portal is impressive... even work for the Blinka Logo that is always on the top left, whatever the orientation it seems (at least the boot time orientation).

gilded cradle
#

Nice, I hadn't tried that out.

manic glacierBOT
#

@cwalther determined that for boards with 2 displays (monster m4sk), start_terminal would be called for each one, leaking supervisor heap entries.

Determine, by comparing addresses, whether the display being acted on is the first display (number zero) and do (or do not) call start_terminal.

stop_terminal can safely be called multiple times, so there's no need to guard against calling it more than once.

Slight behavioral change: The terminal size would follow the displays[0] size, not...

slender iron
#

@thorny jay a powered usb hub may work too

ornate breach
#

hey @slender iron I can see the repl in the arduino serial monitor but it won't pull up in MU

slender iron
#

mu matches usb vid and pids

#

you probably need to add yours to mu

ornate breach
#

oh okay

#

do I submit that through their website?

slender iron
#

you'll need to do a PR

ornate breach
#

okay, I'll need to work on that then

simple pulsar
#

Does anyone know if MicroPython is going to support the micro:bit V2 soon? That caught me by surprise today but one's in the post for me now...

manic glacierBOT
manic glacierBOT
onyx hinge
#

The board also got some smaller updates like a touch-sensitive logo, and the MCU handling the USB port has been changed from Kinetis KL26Z to KL27Z
Ah yeah tannewt was (of course) right, no native USB.

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I am getting a merge error I think in the test unix build. Digging through all the make files it seems the end of the test calls a custom make command including -DMP_CONFIGFILE="<mpconfigport_coverage.h>

This coverage file defines: #define MICROPY_PY_COLLECTIONS_NAMEDTUPLE__ASDICT (1) and the only place in all the source code it appears is here.

The one (and only) function this define includes references the ORDEREDDICT define that was moved to a central area. `py/circuitpy_mpconfig...

manic glacierBOT
manic glacierBOT
manic glacierBOT
lone sandalBOT
stuck elbow
#

@simple pulsar I think there is already a version of MicroPython for that chip

simple pulsar
#

@onyx hinge @stuck elbow There's a nice, hands-on summary on https://www.youtube.com/watch?v=FH3XJpeLbjA and the technical stuff lurks on https://tech.microbit.org/latest-revision/ - the soft power on/off button is an interesting addition.

Just announced, the new micro:bit brings new features and refinements. The headline features are the new built in speaker and microphone. Other new features include a touch sensitive logo button, improved power regulation for accessories and components and also the board spec ...

β–Ά Play video
stuck elbow
#

shame they didn't connect the main mcu to usb

simple pulsar
#

What difference does that make? Is more efficient?

stuck elbow
#

it would allow porting circuitpython to it, because then you can make the CIRCUITPY disk visible to the computer

#

as it is, you always have to "compile" whatever you want to put on it into a hex file

#

which really sucks

#

also, you can't make it act as a keyboard or mouse

#

or a midi device

simple pulsar
#

Interesting. I thought I saw a discussion about USB HIDs for microbit.

stuck elbow
#

it would have to be implemented and flashed to the "helper" chip that programs it

manic glacierBOT
manic glacierBOT
orchid basinBOT
slender iron
#

Multiple top level py files not allowed. Please put them in a package or combine them into a single file.

manic glacierBOT
peak cedar
#

Hello all, new here wondering if anything precludes using circuitPython on Arduino MKRWifi 1010 and MKRGSM1400. I could find MKRZero and MKRWan circuitPython available for them

stuck elbow
#

they are both samd21 so should work

#

wifi and such will not

#

unless you write a custom library to use them

manic glacierBOT
peak cedar
#

I need Wifi + Bluetooth for a new project and got a few MKR1010 lying around here, oh well I guess this is way over my knowledge grade here, thanks

lone axle
#

@slender iron re discord bot community bundle: do you know if it's possible to have the actions that run on the PR check for this and fail at that stage as well. That way we could try to catch and fix before it's merged. I can try to look into that, but have little experience with actions. I am unsure of the bounds of what all it can do (or if there is some reason we wouldn't want it to do something like this).

slender iron
#

@lone axle I was surprised that it wasn't run already. It should be doable

lone axle
#

Does the community bundle pull in changes automatically? So if this user fixes it in their repo then it will automatically be fixed in the community bundle? Or do they need to fix it in theirs and make a new PR to pull in the changes?

slender iron
#

the bundles pull the latest release automatically

peak cedar
#

@slender iron do you confirm the infos I was given re arduino MKRWifi1010 & MKRGSM1400 : board should work but no luck with Wifi/Bluetooth or GSM ?

slender iron
#

yup, the wifi and ble are separate chips that we don't support

#

the BLE might be workable with the new ble_hci stuff but we haven't tested it

peak cedar
#

too bad, thanks anyway

slender iron
#

let arduino know you want it πŸ˜‰

peak cedar
#

will do πŸ™‚

lone axle
#

@digital ibex Is there a difference in discord.py and adafruit_discord.py in your library? at first glance I didn't notice anything, it looks like maybe one is a newer version?

manic glacierBOT
#

It is used on a number of non-Adafruit boards so it may work better. Since you are creating your own board, I suggest you learn to debug this issue. Feel free to ask for help in the #circuitpython channel on the Adafruit Discord https://adafru.it/discord.

$ ag -Q W25Q16JV_IQ
supervisor/shared/external_flash/devices.h
282:#define W25Q16JV_IQ {\

ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk
10:EXTERNAL_FLASH_DEVICES = "W25Q16JV_IQ"

ports/nrf/boards/hiibot_bluefi/pins.c
117: ...
manic glacierBOT
#

I also tried different formats with different allocation units (FAT16/4096, FAT32/8192) and did not see any change after formatting on a windows machine and then trying the board on a macos machine (Big Sur Preview and Catalina). This was with a Stetelthings Maia board, modified by replacing the flashing with 16MB.

I might look more closely at the mac and see why it tries to write but I cant really see the issue. As someone said its something to do with the volume size. Perhaps APFS, a...

manic glacierBOT
#

With the typo fixed, this works in my tests (with an imaginary sharp and a real four-wire display) and removes the last blocker for #3482 I can think of. But someone should probably give it a quick test on a real Monster M4sk.

(One thing I was wondering while testing but didn’t investigate: is the terminal supposed to show up on both displays? Because when I initialize the (inexistent) sharp display first, then the four-wire one, I don’t see any terminal activity on the latter.)

manic glacierBOT
manic glacierBOT
#

New problem, on a small number of boards, for certain translations the build is failing. These are all M0 builds that were not set to CIRCUITPY_FULL_BUILD = 0 so they are building with more features then the other M0 boards. But for some build translations are running out of flash.

By moving ORDEREDDICT to a central location it was using the FULL_BUILD define. I could introduce a new define but then we are almost back to where we started from, except instead of per port build specificati...

manic glacierBOT
manic glacierBOT
digital ibex
#

@lone axle I was intending to make a version that runs on PC. discordbot.py is that version and it is a work in progress.

lone axle
#

@digital ibex ah. It turns out the community bundle needs either a single py file or a directory with multiple inside.

digital ibex
#

Oops! I will fix that.

lone axle
#

Can you move those py files into a dir and maybe rename the one to pc_discord.py

digital ibex
#

Thanks for letting me know.

#

I will.

lone axle
#

Yep, thank you.

#

I didnt know that until today either. Im going to look into adding an actions check for it

manic glacierBOT
digital ibex
#

@lone axle I fixed it! I'm tagging the code right now. I think the PC version will make its home in a new repo.

manic glacierBOT
manic glacierBOT
#

I'll undo those changes. Is there a pattern to use to exclude a feature only from SAMD21 I can copy?

In circuitpy_mpconfig.h, you can just guard the definition so that if it's already defined in mpconfigport.h, then you don't redefine it:

#ifndef MICROPY_PY_COLLECTIONS_ORDEREDDIRECT
#define MICROPY_PY_COLLECTIONS_ORDEREDDICT    (CIRCUITPY_FULL_BUILD)
#endif

MICROPY_PY_URE is guarded in a similar way.

Thanks for your patience in working throgh this!

manic glacierBOT
#

(One thing I was wondering while testing but didn’t investigate: is the terminal supposed to show up on both displays? Because when I initialize the (inexistent) sharp display first, then the four-wire one, I don’t see any terminal activity on the latter.)

Right now it's only on the first. We don't handle multiple displays well. I was wondering if we should allow a group to show on multiple displays. That doesn't work now because the transformations from the display are pushed down into ...

slender iron
#

any ideas on how we can free up some space on the metro m0?

#

there is 2k free with gcc 10...

manic glacierBOT
blissful pollen
#

@tulip sleet should I roll back the changes that were board specific?

tulip sleet
#

@blissful pollen yes, since really there are no SAMD21 boards that need OrderedDIct. The ones that fit are accidental, because we removed other things, or because they don't have many pins. The Feather and Metro M0 are the standard SAMD21 boards, so if they don't work for those, no reason to add to the others.

manic glacierBOT
manic glacierBOT
#

According to the data sheet for the MX25R1635F, the JDEC should be 0xc2, 0x28, 0x15. In the devices.h file, the capacity parameter is specified as 0x18 for that chip. So I think the value may be incorrect in devices.h - thus it is not being recoginized.

Updating the entry to:

/ Settings for the Macronix MX25R1635F 8MiB SPI flash.
// Datasheet: https://www.macronix.com/Lists/Datasheet/Attachments/7595/MX25R1635F, Wide Range, 16Mb, v1.6.pdf
// In low power mode, quad operations can on...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

According to the data sheet for the MX25R1635F, the JDEC should be 0xc2, 0x28, 0x15. In the devices.h file, the capacity parameter is specified as 0x18 for that chip. So I think the value may be incorrect in devices.h - thus it is not being recoginized. Updating the entry to: / Settings for the Macronix MX25R1635F 8MiB SPI flash. // Datasheet: https://www.macronix.com/Lists/Datasheet/Attachments/7595/MX25R1635F, Wide Range, 16Mb, v1.6.pdf // In low power mode, quad operations can on...

#

According to the data sheet for the MX25R1635F, the JDEC should be 0xc2, 0x28, 0x15. In the devices.h file, the capacity parameter is specified as 0x18 for that chip. So I think the value may be incorrect in devices.h - thus it is not being recoginized. Updating the entry to: / Settings for the Macronix MX25R1635F 8MiB SPI flash. // Datasheet: https://www.macronix.com/Lists/Datasheet/Attachments/7595/MX25R1635F, Wide Range, 16Mb, v1.6.pdf // In low power mode, quad operations can on...

#

Credits to Brian β€” Brian Dean bsd@bdmicro.com BDMICRO, LLC https://www.bdmicro.com

According to the datasheet for the MX25R1635F, the JDEC should be 0xc2, 0x28, 0x15. In the devices.h file, the capacity parameter is specified as 0x18 for that chip. So the value is incorrect in devices.h

/ Settings for the Macronix MX25R1635F 8MiB SPI flash.
// Datasheet: https://www.macronix.com/Lists/Datasheet/Attachments/7595/MX25R1635F, Wide Range, 16Mb, v1.6.pdf
// In low power mode, qua...

night osprey
#

Was wondering if Adafruit Cpython could be run on an stm32h7.. I really do need all that power and really do want to use Cpython... I know I can load Cpython but I'm not sure about the Adafruit version.

#

Wait wrong channel.. I'm new

manic glacierBOT
#

Hi,

I'd love to get a couple of USB VID/PID for our project DynOSSAT-EDU, the world's first open source nanosatellite educational kit compatible with CircuitPython and Arduino :)

Our CircuitPython fork: https://github.com/BHDynamics/circuitpython (auto build fails because of duplicate VID/PID since it's set to 0)
UF2 Bootloader fork: https://github.com/BHDynamics/uf2-samdx1

The hardware repos are set on private because we'll release later this month/early november, but I can giv...

manic glacierBOT
#

@hanyelkomy, take a look here for great instructions:

https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github

If you're already familiar with git, it'll be a breeze. If not, the instructions are detailed so you shouldn't have any problems.

Basically you'll fork the CircuitPython repo, check out your fork to your local system, create a branch to make your changes on, build and test them, push your changes to your fork, then submit a pull request to get them merged.
...

manic glacierBOT
#

Unless the chip is really weird, which on first glance it doesn't appear to be, it's a matter of reading the data sheet for the various parameters needed for the definition block. You've got the device ID above in your pasted image - 0x85, 0x60, and 0x16 - that will allow it to be detected and configured based on the other parameters. Tthen verify how many status registers, startup time, speed, etc, and update the values in the definition. That should all be available in the datasheet. If the...

tulip sleet
#

@indigo wedge did you make any progress last night with the airlift firmware? If you set debug=True in the initial call in the airlift library, does it print out anything from the ESP32? I can try to duplicate your setup (minus your special board) to confirm what is and isn't working

indigo wedge
#

no, didn't get any further, yes I get boot prints if I enable debug, it fails at the step where it passes the uart and gpios to _bleio.Adapter, I get a HCI write error, i tried doing busy=rts, gpio0=cts and busy=cts, gpio=rts

#

the wifi part of the firmware works

tulip sleet
#

@slender iron I am going to make a PR to add HCI _bleio to all boards for which it will fit (plain Metro M4, etc.). Right now it's only enabled for the MM4 Airlift Lite board. Would like to get this into the rc

manic glacierBOT
#

Boards with plenty of flash have room for the HCI version of _bleio. Previously this was enabled only for Metro M4 Airlift Lite, but since most any board can use an Airlift breakout, add it to all where it will fit. It is on by default for CIRCUITPY_FULL_BUILD.

CIRCUITPY_BLEIO_HCI is not enabled on SAMD21 boards due to size, and not on nRF since they have native BLE.

The added size is about 21.3kB.

I'll do this as a draft first to see what fails due to size.

hazy plover
#

Is there a table of the size of the CP drive for each board?
It looks like it is the size of the SPI chip except on the Trinket M0 it seems to be about 48k.
Specifically, my guess is the QT Py would only have 48k for CP without the optional SPI on the back.

tulip sleet
#

@hazy plover it's in the product descriptions in the store. Non-express SAMD21 (M0) boards are 64kB (minus overhead). Express boards are generally 2MB, but a few are 8MB (PyPortal, I think). There are some special cases like certain non-product nRF52 boards where part of the large internal flash is used.

#

"Express" means it has an external flash chip

slender iron
#

@tulip sleet ya, we can get that in for rc

hazy plover
#

@tulip sleet If it's there, I missed it and I've spent quite a while working on it.
The Store says the PyPortal has an 8MB chip and Windows says it has an 8MB CP drive.
The Store says the M4 Express has an 2MB chip and Windows says it has an 2MB CP drive.
The Store says the Trinket M0 has an optional chip and Windows says it has an 48k CP drive.

So, again, my question is should one expect that, at a minimum, the CP drive will have approximately the size of the external flash chip. I don't have one of everything to test but that's my conclusion from the 3 different boards I have.

tulip sleet
#

that is correct. But the Trinket does not have an optional chip (the Py QT does). You need a separate build of CPy to access the optional chip. I'll check the Trinket product description

#

the major major motivation for the external chip is to use it for CIRCUITPY

hazy plover
#

@tulip sleet
That brings up another question. Why can't CP identify the size of the flash drive without a separate build?

tulip sleet
#

the smaller build has other missing features, so you want the larger build. The SAMD21 has 256kB flash. When there's no external flash, there's only 192kB for CPy and 64kB for CIRCUITPY. When there's an external chip we can use the whole 256kB for CPy, and enable a bunch more features (like longints0

hazy plover
#

The larger build will recognize the 2M chip on the QT Py. Will it also automatically recognize the 4M from the same family?
I think that is the largest that will fit the narrow package.

tulip sleet
#

you can add another flash device to that value and make it a comma separated list. Then you also need to change EXTERNAL_FLASH_DEVICE_COUNT to 2 or whatever.

hazy plover
#

In reading through several .mk files, they all seem to be only set up for one specific size like 2X16. If different size were specified in the list, would the actual chip be recognized as the correct size or does it only work with one size?

tulip sleet
#

@hazy plover it works with whichever chips are in the list of EXTERNAL_FLASH_DEVICES. The devices have ID information that is checked to determine which chip it is (including its size).

#

it tries all the chips in the list

hazy plover
#

@tulip sleet Great. Thank you.
On a different question, I have a PyPortal reading a I2C UV sensor (GUVB-C31SM) which seems to work fine once it gets started. However, sometimes it soft reboots several times.
What are the most common reasons for reboot on start-up?

tulip sleet
#

is it connected to a host via USB? If the host is writing to CIRCUITPY (it could just be the metadata for the filesystem), then the board will restart on each write. If you have any utility software on the host computer, such as an indexer or anti-virus, backup program, or disk utility, those programs can generate writes to CIRCUITPY.

hazy plover
#

Yes. Connected to Win10 via USB. I'll try an external supply.

tulip sleet
#

vanilla win10 wil not do this: it's usually due to some third-party piece of software

#

@indigo wedge were you testing on an i.mx board? how did you get around the problem of needing ByteArray.h, but CIRCUITPY_NVM = 0, which disables that?

hazy plover
#

@tulip sleet After half a dozen power cycles using an external supply, no soft reboots. So it's probably anti-virus.
Thanks again.

tulip sleet
#

you might see if you can prevent your antivirus from scanning that particular drive. which one is it? I like to keep track of this kind of thing

hazy plover
#

Bitdefender.

tulip sleet
#

I'll make a note, thanks! and glad it works otherwise

hazy plover
#

I'm getting fairly valid results comparing to a Newport 818-RAD which is a cosine corrected detector. I still need to assemble a goniometer to measure intensity versus angle for both detectors and then test my constant current source that is controlled by CP to step the UVC LED intensity across a broad range to insure my detector is linear.
Circuit Python has made this fairly easy.

indigo wedge
#

@tulip sleet I just implemented ByteArray.c on imx, but haven't really tested it yet

tulip sleet
#

_bleio just uses it for bonding info, which isn't even implemented in the HCI version yet

#

I could try to conditionally compile the bonding stuff so that if CIRCUITPY_NVM is 0, it doesn't try to include ByteArray.h. I may do this to get the other builds working that are now failing due to this (including Spresense and i.mx)

indigo wedge
#

that probably makes more sense πŸ™‚

manic glacierBOT
slender iron
#

@tulip sleet or @onyx hinge could you turn off the VM opt for the metro m0 FR build? it's causing us size issues

#

it's a bit hard for me to test because I'm using gcc10

tulip sleet
#

I can include it in the PR I'm making for _bleio hci

onyx hinge
#
+++ b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk
@@ -33,3 +33,8 @@ RELEASE_NEEDS_CLEAN_BUILD = 1
 CFLAGS_INLINE_LIMIT = 35
 SUPEROPT_VM = 0
 endif
+ifeq ($(TRANSLATION), fr)
+RELEASE_NEEDS_CLEAN_BUILD = 1
+CFLAGS_INLINE_LIMIT = 35
+SUPEROPT_VM = 0
+endif
``` is this what you want?  it makes the fr flags be like the de_DE flags
slender iron
#

ya, that's what I'm thinking. I'm curious how much space it gets us

tulip sleet
#

jepler go ahead and do a separate PR if you have time, since I'll be a while.

onyx hinge
#

OK sure thing @tulip sleet

slender iron
#

or jeff can put it in his PR that is failing due to it

tulip sleet
#

@slender iron I agree FeatherS2 is ambiguous. I think UMFeatherS2 would be fine.

onyx hinge
#

Font missing 1 characters
huh that's a surprise

slender iron
#

k, please reply dan

manic glacierBOT
onyx hinge
#

@slender iron the actual problem is interesting ... There a space that was entered as unicode U+202f 8239 NARROW NO-BREAK SPACE β€œβ€―β€ instead of just "space". This causes memory usage to increase, because some tables have to be 16 bits instead of 8 bits.

tulip sleet
#

maybe the python script should check for odd spaces like that

slender iron
#

so how much space do we get by fixing that?

manic glacierBOT
slender iron
#

and will we actually mess something up if a break does occur there?

onyx hinge
#

From what I understood, French puts space before and after punctuation which we put space after in English. so the translated string said "Output_: ", trying to prevent a line break before the ":"

#

wow my laptop builds circuitpython slow πŸ˜…

#

looks like 3 messages in total are affected.

#

472 bytes free in flash

slender iron
#

πŸŽ‰

onyx hinge
#

weblate warns about this spacing 😦 😦

tulip sleet
#

ekkk

#

the non-breaking space is included when the punctuation mark is two parts, like semicolon or question mark (but not say period or comma)

onyx hinge
manic glacierBOT
#

@tannewt Thank you again for all of your reviews.

No problem! Thank you for improving things. :-) (We're working on the metro m0 size issue now separately as well.)

I initially kept the unused parameter but the linter was not happy with an unused parameter so I removed it. If you'd rather I use it superficially or something please let me know the best way and I can add it back in. Otherwise it is cleaned up.

For unused parameters you can do (void) transparent_color; in the func...

onyx hinge
#

@slender iron thanks for alerting me about that, I hadn't looked at PR build statuses yet today.

slender iron
#

I always check early on days I want to release since the CI is slow

manic glacierBOT