#circuitpython-dev

1 messages Β· Page 297 of 1

serene warren
#

I'm trying to get a handle on using Github. Decided to switch over from Win 10 to Raspberry Pi 4B+ 4G. So, two learning curves.

wraith tiger
#

@serene warren You could also install a linux distro on Win10 with WSL.

turbid radish
#

WSL is great

#

Thanks Scott

onyx hinge
#

An ARM microcontroller board with built-in battery and power management, all in a compact package that fits in your pocket.

Why? I've built a lot of wearable lighting projects and got tired of wiring together the same 3 parts: arduino, charging controller & battery. They alwa...

slender iron
#

@gilded cradle was the odroid a PR to platform detect? we should count that as a blinka pr

serene warren
#

Thanks for the suggestion @wraith tiger . Win 10 machine isn't a very virulent young machine so I don't ask a lot from it and since GIT was designed for Linux I figured I put one of these dozen or so Pi's to work.

gilded cradle
#

@slender iron It was both, but must have been merged after stats taken.

onyx hinge
simple pulsar
#

Very quiet for me

tiny oriole
#

oof. keeps going in and out for me

serene warren
#

Drew is breaking up

fierce girder
#

Darn, I think it is this USB C audio adapter

#

Thanks @idle owl

ionic elk
#

catalina womp womp

#

worst friggin os

gilded cradle
#

That's why I refer to it as MacOS Cataclysm

onyx hinge
#

hug reports to the engineers who probably said it was a bad idea but implemented it anyway (catalina permissions)

gilded cradle
#

It could also be called MacOS Catastrophe

fierce girder
#

Very weird. I can't reconnect to voice. Oh well, I'll wait for the YouTube πŸ˜ƒ

ionic elk
#

STM? Not being standard and making sense? Noooooo

#

pshhhhh

#

never

tiny oriole
#

lol

idle owl
#

@fierce girder Please mute

#

Thanks!

fierce girder
#

Ok.. wish that was default

#

The connection dropped and then finally came back

tiny oriole
#

sure πŸ™‚

fierce girder
#

Switching push to talk as I can never hit mute fast enough when my client connects

idle owl
#

@inland tusk You can also send an email to support@adafruit.com with your support and thanks, if you wish.

half sedge
#

BME Oxymeter?

slender iron
#

BLE

onyx hinge
half sedge
#

CMS50D+

tiny oriole
#

Pulse/oxymeter also cought my ear πŸ˜›

inland tusk
#

@idle owl I certainly will do thatπŸ˜€

half sedge
#

There was a video on YouTube from the guy with a Swiss accent... I wanted to acquire on directly!

fierce girder
#

Connection is bad. No voice from me today. Thanks

idle owl
#

@fierce girder Ok thanks

tulip sleet
#

CMS50D pulse oximeter is a little more complicated than "BM1000" and similar, which use the bluetooth.org predefined service

half sedge
#

Pulse+Oxymeter video from
Andreas Spiess: https://www.youtube.com/watch?v=fsJjHEnlQkU + 4 hours ago: https://www.youtube.com/watch?v=FIVIPHrAuAI

The coronavirus shows us that we die if our lungs cannot extract enough oxygen from the air. Other reasons exist why we do not have enough oxygen in our blood.
This is why we will have a look at non-invasive, simple, and cheap oxygen and pulse sensors (Oximeter) and find out...

β–Ά Play video

The Covid-19 pandemic motivated a lot of people to start movements to help. Especially makers began to build open-source respirators and other useful tools. I was asked by a viewer to contribute, too. So this is my first little contribution.
I am a proud Patreon of GreatScott!...

β–Ά Play video
#

So @tulip sleet you are working on the BM1000 ?

tulip sleet
#

i have both, i had looked at their traffic a couple of months ago

#
#

there are MANY sellers, but the pictures narrow it down to only a few models

#

CMS50D has history logging, the other one does not

onyx hinge
#

simp_ble

half sedge
#

I sure want one that work with Circuit Python. What I understood is that most are eating battery... so CMS50EW is BLE and working on LiPo and not two AA. GMS50D+ is great because it record one day. It need something that turn off the screen to save battery.

idle owl
#

Easy_BLE?

onyx hinge
#

(pronounced "simple")

tiny oriole
#

sBLE?

#

πŸ˜›

onyx hinge
#

I tend to favor subclassing too

raven canopy
#

Agreed. Since we don't support "callback" across CircuitPython.

half sedge
#

Take care, thank you all.

serene warren
#

Thank you all.

onyx hinge
#

πŸ‘‹

raven canopy
#

Take care all! Stay safe and sane!

slender iron
#

stopped

onyx hinge
#

strangely it was a shorter meeting today than it has been in the last weeks

tidal kiln
#

πŸ‘‹

raven canopy
#

Blame Catalina?

#

😁

tiny oriole
#

lol

raven canopy
#

πŸ‘‹ ttyl

lone axle
tulip sleet
#

@timber mango thanks for your feedback and the youtube videos!

ionic elk
#

Has anyone on here tried Pigweed yet?

turbid radish
#

I'm posting availability in the newsletter, not tried it out

#

Maybe more people will know about it by tomorrow

ionic elk
#

I was wondering what the mention was for - the pw_env_setup is the most exciting thing to me

solar whale
#

@lone axle the LORA/RFM9X uses a different transmission mode allowing for longer range -- it is not compatible with the RFM69

lone axle
#

Ah Thank you, I missed that the numbers were different 69 vs. 96

solar whale
#

you're not the first or last πŸ˜‰

lone axle
#

@solar whale I have no experience with the radio stuff. Do I understand it correctly that https://www.adafruit.com/product/3177 can be used to test the things you are working on? If so does it require multiple devices, like one sender one receiver?

solar whale
#

I am working on both libraries but I put in the PR for the RFM69 (that one) first. Yes, two units are necessary... the code is similar on both libraries but the actual radio configurations (register settings) are very different.

lone axle
#

Okay cool. I'm not sure when I will have the opportunity to get them, so perhaps someone will get to the PR before me. But they are showing some in stock at my local store, I've eyeballed them a few times looking for a reason to get some and start playing with them. I'll see about getting them ordered online through that store.

manic glacierBOT
solar whale
#

@lone axle if you are more interested in the LoRa/RFM9x I can post the PR to that as well so you can test it instead.

lone axle
#

The RFM69 one is fine for me I think. Don't know much about either to be honest. Mostly just wanting to make sure the ones that are possibly available are actually the right thing needed to try it out.

solar whale
#

OK -- either would be OK -- I just have a bit of cleanup to do on the RFM9x examples before posting it. I just thought I'd hold off in case there (likely) are changes to be made on the RFM69, they will also probably apply to the RFM9x. I use the RFM9x more since they also work with LoRaWan.

slender iron
#

@ionic elk what sort of things are you managing for different packages? pin availability?

ionic elk
#

It's really just the pins made available via the microcontroller module

slender iron
#

kk

ionic elk
#

Not exactly a super critical feature, it won't break anything - it was just getting ungainly and was a pretty easy fix

slender iron
#

I wish that was part of CMSIS

ionic elk
#

also helps to visualize differences between chips

#

You wish pin layouts were part of CMSIS? That seems like it'd be a little intense for manufacturers

slender iron
#

in SAMD they provide #defines for each pin

#

they certainly have the data

ionic elk
#

Yeah no such luck with stm32 -___-

slender iron
#

just haven't found it in a good form

#

ya, just looked again

#

πŸ‘

ionic elk
#

I just wrote a python script that can take a copy paste CSV file that you make out of the datasheet altfunction diagrams that automatically turns it into my pin object format

slender iron
#

cool cool, that's the best option now I think

ionic elk
#

so mapping new chips should be much easier now

#

(that's not package related though just peripheral mapping)

slender iron
#

the rust folks may have something for it already

ionic elk
#

packages are still kind of annoying because you basically have to check each datasheet, there isn't a global appnote that tells you what they change across all lines

slender iron
#

right

#

which h7 board are you starting with? I want to take a peek at it's RTC

ionic elk
#

H743

#

most annoying part so far is that the ADC is totally different and has weird pin labelling because it's differential

#

oh you mean the board I'm doing the 743 nucleo

#

then probably the OpenMV even though we don't have a camera module

#

I haven't looked yet at how micropython does that

slender iron
#

there is a separate micropython fork for openmv

ionic elk
#

Also, quick question - do we want to keep the This file is part of the MicroPython project, http://micropython.org/ thing across all licenses? Seems like it might be nice to move that over to circuitpython.org.

slender iron
#

I think it's ok to leave but we could add something to it

ionic elk
#

Maybe This file is a part of CircuityPthon (http://circuitpython.org/), a fork of MicroPython (http://micropython.org/)?

slender iron
#

Β―_(ツ)_/Β―

#

H7 LSI is 32k and the external is 32.768k 🀦

ionic elk
#

hahahaha

#

i'm sorry that's mean I don't laugh at you I laugh with you

#

Are you using CubeMX?

slender iron
#

nah, just looked in the datasheet

ionic elk
#

CubeMX is nice for the clock visualization... it's big and clumsy but the clock diagram is solid

slender iron
#

ya, atmel start is nice for that too

#

but I'd rather having a tool that can create it based on current register state πŸ™‚

onyx hinge
#

github actions is starting to get me down. this was supposed to be simple!

timber mango
#

@lone axle When you get RFM69 or RFM9x stuff, I recommend getting the breakout boards because you can connect them to any MCU with SPI. They also cost less than integrated modules and will not limit the memory you can use. I have two of the RFM69 breakouts connected to M4 boards - an ItsyBitsy M4 Express and a Feather M4 Express.

fallen anvil
#

Is there anyone around who can educate me about the NINA firmware? I'm interested in modifying it to use the SDIO interface but worried I simply don't have enough knowledge to be anything more than dangerous at the moment.

#

Specifically, are the current choices for MISO/MOSI/SCLK/CS anything more than arbitary?

raven canopy
#

@onyx hinge persevere!

onyx hinge
#

thanks @raven canopy -- I'll do my best

fallen anvil
#

('cos MOSI is on top of SD_CLK right now, so I've got to at least move that one sideways if I want to preserve SPI too)

lone axle
#

Thank you @timber mango

timber mango
#

The ItsyBitsy M4 also has a Bluefruit LE SPI Friend connected to it. πŸ™‚

#

OK, I am going back to not being here. πŸ˜‰

slender iron
#

@onyx hinge it's usually git submodules that are complicated πŸ™‚

#

@fallen anvil I'd assume arbitrary the NINA firmware is inherited from Arduino and @prime flower has poked at it

#

someone else has here too but I can't remember

onyx hinge
#

@slender iron I've tried several commands that should get tags, and logs indicate they do, but "describe" still gives a ref, not a tag-based description. git describe --dirty --always shell: /bin/bash -e {0} 65bb9c0c7

#

I'm going to step away and make dinner instead of continuing to gnaw at this

fallen anvil
#

@indigo wedge has it on his board but the config of the chip (i.e. which pins are defined to be used for the various functions) all looks a bit arbitary. I was going to drop it onto my board (instead of the Murata module I've got on there now, which is hard work) but wanted to re-arrange the pins to be able to use the SDIO and high speed SPI... just wondered if there were any gochyas before I started.

#

Specifically, why MOSI had been moved from IO19 to IO14, which means we can't use the IOMUX to drive the SPI.

onyx hinge
#

Oh I think I lost --tags in that command due to do many quick edits

fallen anvil
#

Bedtime. Will start looking to see if I can make the pinning a bit more configurable in the morning. Would be nice to get the high speed modes, but not at the expense of back compatibility.

crimson ferry
#

@fallen anvil I haven't gotten deep into the pin selections, but as far as I can tell, Adafruit NINA (forked from Arduino) uses whatever the ESP32 board defines as SCK, MOSI, and MISO. The other pins for ESP32SPI (CS, GPIO0, RST, RDY) are user-assignable and handled in the CP ESP32SPI library.

fallen anvil
#

No worries. I'll investigate. I'm happy to make the changes but don't like blundering into code I don't know until I've at least checked that I'm not getting in anyone's way. It looks easy enough to just add some defines at the top of the file to support multiple configs. I'll beat on it tomorrow. As I understand it we max out the spi at 8mhz at the moment, but changing the pinning to go via the iomux will let us go considerably faster than that.

slender iron
#

@fallen anvil do you know if the RT RTC is actually counting subseconds? I can't find a divisor

tulip sleet
#

@slender iron I was looking at the STM clocks the LSE low-frequency crystal clock is meant to be used with a 32.768kHz crystal. The LSI RC clock is specified as "32kHz", but I think this is just because it is really sloppy, e.g.:

#

you were mentioning it was 32kHz vs 32.768kHz, but I think the STM clock aspires to 32.768 kHz, and if a board were designed with a crystal, that would be the freq

ivory yew
#

Hmm looks like the flash chip I had picked for Sol is unavailable now. Any advice on picking an alternative without having to re-layout that section of the board?

orchid basinBOT
manic glacierBOT
slender iron
#

@ivory yew flash chips generally have the same footprint so you should be able to place a different one in the same spot. CircuitPython even supports detecting the correct one out of some options

ivory yew
#

Ah cool. I'll sort through the currently ones and see if I can get a better idea of what's available.

slender iron
#

adafruit usually uses a gigadevice one

#

@tulip sleet ya, I think I made it more complicated. looks like 32k implicitly means 32.768k

fallen anvil
#

@slender iron Is this for periodic interrupt purposes? You can select one of the count bits to interrupt on (PI_FREQ in section 20.6.4.4 of the manual). AFAIK it counts at the 32.768KHz tick rate of the XTAL.

manic glacierBOT
manic glacierBOT
#

@jepler I canceled the job and expected to find a "re-run jobs" button, but there isn't one :frowning_face: . Is there a minor change you can push to see if we can restart things? But if there's not going to be a "restart jobs" button, I'm worried about merging this in yet. Try another push and let's see what happens. We should have at least one perfect build before merging. Perhaps we should open an issue about this in https://github.com/actions/checkout/issues. And let's monitor the other i...

manic glacierBOT
onyx hinge
#

@slender iron The display constructed in board.c has a way to use the bus object within the statically allocated displays. But if I create a display from Python code, I don't see how this storage can be used. Is it, and I'm overlooking something?

manic glacierBOT
tulip sleet
#

@onyx hinge do you mean you want to use the same bus object (ParallelBus or FourWire) for a second display?

onyx hinge
#

@tulip sleet no, the context is protomatter (led panel driver). I am trying to figure out if it is "safe" for the protomatter equivalent of a "bus" object to not be allocated in that area

#

or, if it has to be, how to do it

#

tannewt and I discussed this last week and concluded that part of my design, in which there's a Protomatter wrapper class implemented in Python, had to go due to memory management issues; but as I sit down to work on it I'm unclear about this part

tulip sleet
#

does protomatter need to live across VM instantiations?

#

displayio does static allocations for that reason, I think, more than anything else.

onyx hinge
#

right

#

as a Display, yes, it needs to

#

we want protomatter to be a Display, with all that entails, like showing repl output

tulip sleet
#

so the "bus" object has to be allocated statically. I don't see that it's different. But maybe just waiting for Scott is better, as I wasn't party to all that

onyx hinge
#

here it looks like busio.SPI and displayio.FourWire are both allocated dynamically

tulip sleet
#

i don't know that the Gizmo lives across VM's. It looks like not

onyx hinge
#

is there a way to ask for that?

tulip sleet
#

this is just like any other external display

onyx hinge
#

if I can just have it NOT live across vm resets that would be fine for now too

#

backing up, the problem I'm facing is that I have a working way to create these displays, but if auto refresh is enabled it crashes soon after the vm is reset

tulip sleet
#

did you add the protomatter object to the list of root pointers? If you didn't, then the heap objects it holds will be gc'd because no one else may have a pointer to them

onyx hinge
#

no, I just create it from python code, like tft gizmo does its bus

tulip sleet
#

so are there any statically allocated objects in the protomatter C impl

onyx hinge
#

a _protomatter.Protomatter object contains additional pointers to "allocated stuff"

tulip sleet
#

right, but that object is allocated on the heap?

#

the TFT Gizmo has no static objects that live across VM's

onyx hinge
#

I must not be understanding what you mean by "static"

tulip sleet
#

I mean not allocated on the heap, but existing as a C decl

onyx hinge
#

The protomatter C library has some globals

tulip sleet
#

e.g. like primary_display_t displays[CIRCUITPY_DISPLAY_LIMIT]; in shared-module/displayio/__init__c.

#

if any of those globals have pointers to heap objects, then they need to be in the root pointer list

#

otherwise the heap objects will not be marked as used during a gc

#

also those objects canno be reused across VM instantiations

#

@onyx hinge hmm, actually the display objects are not in the root pointer list, but are instead handled specially in displayio_gc_collect(), which is called from gc_collect() in main.c

onyx hinge
#
+            displayio_framebufferdisplay_collect_ptrs(&displays[i].framebuffer_display);
#

I did add this code..

#

the other global pointer within protomatter is just back to an object which is also pointed to by the FramebufferDisplay object ```void displayio_framebufferdisplay_collect_ptrs(displayio_framebufferdisplay_obj_t* self) {
gc_collect_ptr(self->framebuffer);
gc_collect_ptr(self->callback);
displayio_display_core_collect_ptrs(&self->core);
}

onyx hinge
#

it's a cop-out but for now I am deinitializing framebuffer displays when restarting the vm

manic glacierBOT
ionic elk
#

@slender iron git CI is failing for giggles again on the Thunderpack. Do we have any idea what's up with that? When I try to re-run all jobs, I get a red site banner saying "error requesting job from git actions", and then the job starts but usually cancels part of itself and reads as having failed.

tulip sleet
#

no wait that was two days ago

ionic elk
#

This has happened pretty regularly to me

#

I don't think it's a sporadic outage thing.

slender iron
#

@onyx hinge dynamically allocated things get moved to a static allocation when the vm finishes

#

@ionic elk hopefully the switch to checkout v2 will help things

onyx hinge
#

@slender iron I remember now that we talked about that

ionic elk
#

@tulip sleet I've discovered that enabling -flto drops all builds of Circuitpython into the WWDG_IRQHandler at startup. Do you have any ideas what could be causing that?

manic glacierBOT
#

The baud rate used by the MIDI (Musical instrument Digital Interface) standard is 31250. This rate is defined in the file ports/nrf/nrfx/hal/nrf_uarte.h, but was not in the baudrate_map[] in UART.c. Serial MIDI will not work without this. While I was at it I added the other unused baudrate from nrf_uarte.h, 56000, although I don't know what devices/standards use this. The adafruit forum conversation precipitating this PR is here:
[How to enable @micropython.viper](https://forums.adafruit...

tulip sleet
#

@ionic elk There are some other changes for -flto. If you don't need this now, I'd say forget about, and we can debug this later.

#

we have to make sure the ISR is marked used, and there are some other compile flags

ionic elk
#

@tulip sleet ok, I was only really tweaking it out of curiosity during my makefile cleanup

tulip sleet
#

and it might need to be customized for certain things in the STM HAL

ionic elk
#

btw, smallest flash sector size on the H7 is 128k 😬

tulip sleet
#

if you don't need the space, yeah, not important

#

how big is the flash?

ionic elk
#

2M

#

Every sector size is the same. Buffering it shouldn't be a big deal though I've got a 128K storage cache I can use (as micropython does)

tulip sleet
#

so it's not an issue about the size of microcontroller.nvm, etc., good

#

so why did they make the flash sector sizes rational? They never do that πŸ™‚

ionic elk
#

Lol they're actually all 128k I won't even need a table matching function

#

But I definitely think I'll need to consider making a proper caching system here, 128K erases will really bog down the speed with my old code

tulip sleet
#

how long does a 128kB erase and write take? Maybe with nvm, we need to go to a fancier scheme: a smaller nvm that we rewrite in the next available block. We only do an erase when we wrap around.

ionic elk
#

yeah the existing nvm implementation that just got put in is inefficient for that reason - it really needs to be worked into the internal flash module as something that gets squirreled into the flash-write system

#

I'm revisiting all of that now

onyx hinge
#

could "nvm" be placed on the external flash with more flexible erasure rules? aside from meaning you'd have to disable NVM on non-express boards of course

tulip sleet
#

it could be, but right now we don't partition the external flash into filesystem and other. I'd just leave it for now as a TODO

ionic elk
#

My personal feeling is to carve out a section after the filesystem or in the actual program flash sectors for NVM, and just have it buffered in the flash write module

#

I wonder if I can do atomic flash writes to the ISR_FLASH section without borking anything, there's room there πŸ€”

onyx hinge
#

seems like it's courting trouble to erase part of your program everytime you update nvm

ionic elk
#

I like to live dangerously

#

but yes that is a valid concern

#

Not a lot of options though, on most STM32F4 chips the only internals you can feasibly buffer are the 16K ones, and there's only 4 of them. One has to be the ISR, if you have a bootloader that's another, and taking another entire quarter for NVM leaves you only 16k for your entire filesystem.

#

32 is already basically unacceptable so I don't see enabling NVM on the main F411 or F401 devboards without a fix

onyx hinge
#

non-express boards have been identified as important for the stm port?

manic glacierBOT
ionic elk
#

πŸ€·β€β™‚οΈ As in boards without external flash? I mean, I get questions about the Blackpill and Pyboard Nano, and most boards that I see for the STM32 in general are either the F401 or F411

manic glacierBOT
#

The 64x32 display isn't very useful for showing the console -- you get only 2 rows by 8 chars.
Making the display persist over soft resets is proving difficult. Instead, it resets itself at soft reset.

Because of the less than useful nature of the console, I wonder if the work could be accepted in this state; and later on we can come back and work on it when we have framebuffer lcds large enough for it to matter. @tannewt ?

manic glacierBOT
manic glacierBOT
#

I'm aware that I need to preserve

  • all the involved pins (existing never-reset code should cover this, though)
  • the _protomatter.Protomatter object with its own internal allocations (these can't be moved without additions to protomatter's C API)
  • the 565-format bytearray that is used as the target for the FramebufferDisplay and converted to protomatter's internal format
  • the callback object which lets FramebufferDisplay notify the underlying framebuffer that it's been changed
    Bec...
#

I presently define _PM_allocator to call m_malloc. Here are its uses within protomatter:

core.c:    if((core->rgbPins = (uint8_t *)_PM_ALLOCATOR(rgbCount * sizeof(uint8_t)))) {
core.c:        if((core->addr = (_PM_pin *)_PM_ALLOCATOR(addrCount * sizeof(_PM_pin)))) {
core.c:    // _PM_ALLOCATOR() by definition always aligns to the longest type.
core.c:    if(!(core->screenData = (uint8_t *)_PM_ALLOCATOR(screenBytes + rgbMaskBytes))) {
manic glacierBOT
manic glacierBOT
trim elm
#

@idle owl Is "documentation" a desired standard issue label? It is in the list of standard issue labels in adabot, but about 160 libraries do not have it

idle owl
#

@trim elm Yes.

trim elm
#

Ok

#

@idle owl Is that something that I should work on when I'm blocked on other stuff?

idle owl
#

@trim elm You can add it to your list, yes. Verify with me what labels you intend to add before doing it.

trim elm
#

@idle owl ok. It seems like all most of them are missing is documentation, so I was gonna do that and then let adabot tell me if any others were missing other labels

idle owl
#

Ok.

robust nymph
#

Is there an existing workflow to specify and/or install CircuitPython libraries for a project other than including a copy of those libraries in the project repo and copying to the hardware? I thought circup was the tool to do this but it appears to only manage the libraries already on the hardware.

lone axle
#

@robust nymph I think it is more typical not to include them in project repos and instead manage it at the device level.

#

I wonder though what the best way is

#

circup could be modified possibly to target a local directory?

trim elm
#

@pastel panther ^^

pastel panther
#

πŸ€”

#

probably

lone axle
#

taking a peek now it seems easy enough

slender iron
#

@robust nymph it's something @ivory yew and @fathom trellis have been thinking about

lone axle
#

change find_device() a bit with a new flag that skips looking for a device and uses whatever user specified

ivory yew
#

yeah we have lots of thoughts but some sort of global pandemic is taking up all of our bandwidth. 😐

trim elm
#

@raven canopy Can adabot add issue labels?

ivory yew
#

I think once my current two CircuitPython projects ship I will have more time to think about libraries. :3

robust nymph
#

Ok good to know. When I first seen circup I thought it would be a way to do something like a requirements.txt to specify and install libraries for the project. Is that something worthy of making a ticket for to see if interest?

raven canopy
#

@trim elm yes, actually. i have been thinking about changing the infrastructure check to more of a these-are-missing-add-them function...

trim elm
#

@raven canopy Ok, cool.

raven canopy
#

@idle owl Library Overlord approves? πŸ˜„

#

i mean, anyone can do it; doesn't have to be me. the hacktoberfest label script has a living example of updating labels.

robust nymph
#

@ivory yew completely understand pandemic circumstances. I would be willing to attempt to help if there is a general idea of how best to proceed.

#

For now I'll start looking through circup to see how it works.

ivory yew
#

yeah circup is the way to go for now. πŸ™‚

idle owl
#

@raven canopy Yeah changing that is fine.

lone axle
#

@robust nymph the repo is here https://github.com/adafruit/circup. You can make an issue and/or a pull request if you make the changes. Nice idea to support requirements.txt

raven canopy
#

@idle owl πŸ‘ i should have bandwidth this week. its a quick one, and focus has been rough this week on my other projects.

lone axle
#

@robust nymph I'm going to make some food but I think I'll take a quick try at it after that though.

robust nymph
#

Ok sounds good. I'm going through the source learning how it works now so I may be able to help later and can help test.

manic glacierBOT
#

IDEA: On library functions that raise an error condition, we should move towards having the error condition returned to the caller if it can be represented as a boolean or an int. We have already done this with the send() function in the adafruit_rfm69 library and I am using this in my current code. It works very well!

Personally, I would much rather handle errors in my code than have an error raised and have my code crash. It is better for the caller to be able to handle errors as much as...

woven shore
#

@meager fog Are you the maintainer of the documentation Blinka port to the jetson-nano?

manic glacierBOT
#

That's fine in simple cases, or where the function doesn't have a legitimate value to return. But e.g. a function that return a boolean... how do you indicate an error? If any int is a valid result?

Go uses its multiple return value capability to have the convention of returning a separate error value (nil means no error). That approach could be used in Python as well. But Python has exception handling for this (Go doesn't).

My feeling is that CircuitPython should use the established P...

woven shore
#

Wanted to ask something about the platform_detect library

#

I'm running a docker container from within a jetson nano host and I can't get blinka running without running the container in privileged mode

#
    volumes:
      # udev rules for GPIO
      - /etc/udev/rules.d:/etc/udev/rules.d
      # system access for GPIO
      - /dev:/dev
      - /sys/class/gpio:/sys/class/gpio
      - /sys/class/i2c-dev:/sys/class/i2c-dev
      - /sys/class/i2c-adapter:/sys/class/i2c-adapter
      - /sys/devices:/sys/devices
      - /proc/cpuinfo:/proc/cpuinfo 
      - /proc/device-tree/compatible:/proc/device-tree/compatible # This doesn't get mounted
    devices:
      - /dev/gpiochip0:/dev/gpiochip0 # for GPIO
      - /dev/gpiochip1:/dev/gpiochip1 # for GPIO
      - /dev/i2c-0:/dev/i2c-0
      - /dev/i2c-1:/dev/i2c-1
      - /dev/i2c-2:/dev/i2c-2
      - /dev/i2c-3:/dev/i2c-3
      - /dev/i2c-4:/dev/i2c-4
      - /dev/i2c-5:/dev/i2c-5
      - /dev/i2c-6:/dev/i2c-6
woven shore
#

this isn't ideal when working in a container environment where its quite difficult to call virtual filesystems

slender iron
#

do you know what an alternative to procfiles would be?

#

a github issue is the best place to collect all of this info

#

it'll just scroll away here πŸ™‚

#

@gilded cradle is the person who will work with you there for platform detect

woven shore
#

This falls under non-issues if you are not considering containerisation for the supported SBCs

slender iron
#

sounds like it'd be helpful for you so we should decide there πŸ™‚

woven shore
#

alright I'll write an issue now

slender iron
#

issues are great because others can find it and chime in if we leave it open

#

thanks!

#

all the links above are a good reference

woven shore
#

Thanks alot @slender iron! Stay safe and stay healthy

slender iron
#

you too! I'm just hanging at home doing my part πŸ™‚

manic glacierBOT
#

In some cases that return ints as valid values, you can return None for failure, or just return None for all failures represented as booleans. If it is not None then the operation succeeded. For cases where ints are valid return values, those values are usually in a range. You can return a value outside the acceptable range of return values. If the int values are all positive, return a negative error code. If the acceptable ints are all negative, return a positive error code.

I use the...

lone axle
#

@robust nymph took me a bit to get the building tools working in my environment but I'm up and running now. I have a fork of the repo here https://github.com/FoamyGuy/circup So far I've only added --dir option to the freeze command it currently works like this circup freeze --dir "./" would run freeze on the current dir.

#

seems to be working alright so far. I'll give the other commands a try, but not sure if I'll get to it tonight.

robust nymph
lone axle
#

It seems that it still wants the device connected in order to work

#

it does target the local directory, but fails out before it can try if there is no connected CIRCUITPY

robust nymph
#

If I try to run circup without a device I get Could not find a connected Adafruit device.

#

Are you seeing something different? It looks like the error I'm seeing is what should be expected with no device connected.

lone axle
#

Yep same thing for me.

#

there is a check early on that calls find_device() and exits if it does not find anything

#

I was trying to see if click offers some way to see all args as a list. Or if there is any reason not to use sys.argv

robust nymph
#

Ah, look at my pull request

lone axle
#

so that I can add some logic to pass instead of exit

robust nymph
#

Click doesn't use *args as normal

#

Had to find that earlier

lone axle
#

I don't know if nargs=-1 would work. Will it "consume" the args before they can go to the other parts of the command?

#

I would need to check if --dir was passed at all no matter where in the stack it is I think.

#

😴 time soon though I'll play around with it some more tomorrow.

robust nymph
#

Ok same here soon. I'll mess with it a bit more.

timber mango
#

@lone axle It should not be looking just for drives named CIRCUITPY because that can easily be changed. πŸ™‚

plucky flint
#

Hope you're all well and staying safe. The UK is in lockdown. Interesting times...

manic glacierBOT
manic glacierBOT
#

On the re-run there were some spurious failures. I looked at two, and they were the same. When fetching tags inside submodules, it failed (possibly on the first one?) insisting that there is no "origin" remote.

2020-03-24T18:41:57.1329727Z ##[group]Run git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/*
2020-03-24T18:41:57.1329968Z git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/*
2020-03-24T18:41:5...
manic glacierBOT
onyx hinge
#

thought I'd start with a quick detour into seeing whether datetime could be adapted to circuitpython. I got excited when I saw it was in micropython_lib .. but .. it doesn't work. including in current micropython master branch, unix port with default configuration..

AttributeError: type object 'tzinfo' has no attribute '__new__'
#
>>> datetime.date.today() - datetime.date(1975,4,8)
datetime.timedelta(16423)
``` however remarkably little fiddling was needed.  whee.
copper crescent
#

It looks like my pull req #2727 failed checks with what looks like an unrelated apt error, do/can I need to do anything with it to retry?

lone axle
#

@copper crescent can you paste a link to it here?

copper crescent
lone axle
#

Thank you

#

Sometimes there is a Re-Run jobs button but I'm not seeing it in this case. (and to be honest I've not had much luck with it, I think there is a bug with actions that is/was affecting it. Jeff E. was possibly working on the fix for that the other day, but I'm not certain).

#

I believe making a new commit that makes a trivial change would get the actions to re-run. But to be honest I don't have much knowledge of the actions system / setup. And I am way more familiar with PRs on the libraries rather than the main repo at this point. I would probably have to defer to someone who works on the main project more to know if you should, and how best to go about retrying.

onyx hinge
#

@copper crescent @lone axle I pressed the "re-run jobs" button

#

however, sometimes it fails for reasons we don't fully understand, in which case the advice of pushing any change is the best we know how to do

#

let's see what happens

#

git checkout --progress --force 5e559be9b59d4f6bf00907563414916228205199

#

when this fails (and it did) I think the next recourse is to push any change. You can create a "No change" commit with "git commit --allow-empty" if you use the commandline.

lone axle
#

Oooh, the --allow-empty is a good trick to keep in mind. I didn't know about that. Thank you Jeff!

copper crescent
#

Thanks, I'll give that a try

#

It doesn't look like that triggered it or do I need to unresolve and resolve again or something?

lone axle
#

@copper crescent did you push the changes to your fork / branch? I'm not seeing that any new changes showed up in the PR

#

if you ran the command above git commit --allow-empty I think you would still need to push after that.

copper crescent
#

doh, I did it on the wrong one

lone axle
#

alright looks like it's trying again now 🀞

onyx hinge
#

unfortunately, datetime doesn't fit on a metro m4: ```Adafruit CircuitPython 5.0.0-rc.0-16-gdf8beccee-dirty on 2020-03-04; Adafruit Metro M4 Airlift Lite with samd51j19

import adafruit_datetime
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
MemoryError: memory allocation failed, allocating 169 bytes

#

let alone pytz, which is much larger by the looks of it

#

time (ehehe) to cut my losses

fallen anvil
#

@prime flower , @crimson ferry I just abstracted out the pinning definitions in the NINA firmware. I've made a PR but I can't test on an existing board as I don't have one...would one of you mind giving it a whiz before merging it? Apologies if this isn't the right place for this discussion (point me somewhere else).

#

...this is a precursor to looking at QSPI support.

prime flower
#

@fallen anvil Could you link to the PR? I can test on a PyPortal for ya.

fallen anvil
raven canopy
#

@onyx hinge not too surprising. datetime is huge. how pared down is the micropython version? could sub-set it...

robust nymph
fallen anvil
#

@prime flower Its mostly to make sure I'm not breaking anything that's already in use before I move on.

lone axle
#

@robust nymph nice! I will tinker around with it some more tonight.

prime flower
#

@fallen anvil I've self-requested a review, will test by tomorrow PM on a pyportal titano if thats OK?

fallen anvil
#

Yeah, no worries. Now I have some pin definitions to work with I can look at modifying a layout.

#

so, I have plenty to get on with πŸ™‚

prime flower
#

perf, wanted to make sure it wasnt blocking your work

fallen anvil
#

no prob

prime flower
#

@fallen anvil are you building a board for this?

fallen anvil
#

Just dropping it onto the VersiBoard2 as a replacement for the Murata module that's on there already...but given I have to make some other changes anyway I'll update the design to accomodate it rather than bodgewiring.

prime flower
#

neat! do make sure you have access to GPIO0/GPIORX/GPIOTX on the esp32 module

fallen anvil
#

Yup, those were the first ones that went in πŸ™‚

crimson ferry
#

@fallen anvil I can test it on a hw config with separate ESP32, I'll see what I can free up most easily.

fallen anvil
#

No prob. Theres no great rush. Need to pay attention to not wiring RXD to RXD and TXD to TXD on my board for the next while (it's a favourite trick of mine πŸ˜• )

copper crescent
#

@onyx hinge @lone axle thanks for the help, the checks look happy now :)

crimson ferry
#

@fallen anvil what's VSPI_READY for?

#

Is that what's historically been on pin 33? RDY/BSY

fallen anvil
#

Thats the BUSY signal back from the SPI, but moving it to 21 means we can use it as IO3

#

..this is why I'm being careful...these changes will break existing implementations if I'm not 😐

crimson ferry
#

We'll need corresponding changes in ESP32SPI library

fallen anvil
#

why?

#

Is it used over there?

#

That starts to get painful if this change propagates

crimson ferry
#

My mistake, it's configurable in user code at init.

fallen anvil
#

phew!

crimson ferry
#

But, for example, current code often is esp32_ready = DigitalInOut(board.ESP_BUSY) (e.g., PyPortal)

fallen anvil
#

Um..are we talking about on the NINA device or the hosting device?

#

I really don't care where you put it on the host πŸ™‚

crimson ferry
#

Well, I'm trying to get my head around both... whether existing all-in-one boards' code works as-is, and whether separates need re-wiring.

fallen anvil
#

So, my target is that there is NO change for existing boards. If I don't meet that then this isn't a goer. Hopefully all I've done is abstract out the pinning so that it can be changed when a new board comes along.

crimson ferry
#

Right, I'll keep poking

fallen anvil
#

If you don't have CPPFLAGS +=-DOPTIMISED_PINNING set in your makefile then there should be no change in behaviour. If you do have that set then I'm free to play...I think.

crimson ferry
#

OK, so in the #else (not optimized), shouldn't VSPI_READY be pin 33?

fallen anvil
#

(but thats exactly why I'd like more eyes on it)

crimson ferry
#

Again, I could be mistaken, I thought The READY was from the CP library, not the NINA firmware... I'll keep digging

fallen anvil
#

CP sets ~CS, NINA responds with ~READY, but I think you're right, it's on the wrong pin.

#

Yep, line 118 of SPIS.cpp

crimson ferry
#

Right, totally, of course it has to come from NINA

fallen anvil
#

Its very easy to tangle this in your head, especially if you've got an esp32 on both ends...

#

Fix pushed. Good catch.

slender iron
#

thanks @copper crescent !

onyx hinge
#

@slender iron is there a memory allocation function I can call which will work both in normal times and during soft reset?

slender iron
#

no, I don't think so

onyx hinge
#

I can set what memory allocation protomatter calls by a #define but since I now need it to do allocations in both contexts I need something which automatically adapts .. assuming that's not nonsense

slender iron
#

the external flash cache does it so you can look in there

#

looks

onyx hinge
#

flash_ram_cache?

slender iron
#

yes

manic glacierBOT
manic glacierBOT
#

@tannewt updated the displayio.FourWire command to include options for baudrate, polarity and phase, and to fix a bug where the polarity and phase were not updated properly: https://github.com/adafruit/circuitpython/commit/ab74f45bfbed78fd752e3ed3a12c01fa910ad672

Please note that these SPI bus settings only go into effect the first time displayio goes to access the SPI bus. (Meaning that if you query the settings without accessing the bus with displayio, you will likely see just th...

tidal kiln
#

@slender iron done

slender iron
#

thanks @tidal kiln

tidal kiln
#

πŸ‘ sure, np.

manic glacierBOT
idle owl
#

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

robust nymph
vague folio
lone axle
#

@vague folio Thank you!

manic glacierBOT
#

@ladyada I understand that. However, I still believe very strongly that errors should not be tripped from library routines. Library routines should be quiet and not disturb the countryside. ;) It should not require try..except..finally clauses just to catch errors tripped by a library routine. It is very easy to make library routines quiet. :)

manic glacierBOT
#

As someone who writes a decent amount of python for work (though not CircuitPython, yet), just wanted to chime in in support of exceptions. Yes, they can be disruptive when they kill your program, but the philosophy/python idiomatic "way" is that accidentally swallowed/silent errors are much worse.

Library routines should be quiet and not disturb the countryside.

Look to the Python standard library for guidance here - they are library routines too:

>>> abs("hi")
Traceba...
#

Add external flash support for Macronix MX25L51245G 64MiB SPI flash.

This flash chip provides 64MB of flash for the CircuitPython filesystem and exported USB mass storage device. I have tested it extensively with no issues. The data sheet for the chip is listed in the patch directly for reference within in the devices.h file.

I checked the data sheet very carefully when specifying the values for the device parameters. If anyone wants to double check me on those, I welcome any feedback. ...

idle owl
#

@vague folio Congrats and thanks!

vague folio
#

No problem! I'll contribute when I can.

half sedge
#

Super happy dad here... my son decided on his own to follow YouTube tutorial and start coding in Python. He installed Python and PyCharm and started coding. So I showed him my Circuit Playground Express... the REPL, basic loop and print.

manic glacierBOT
indigo wedge
#

Spent two weeks on and off chasing this issue, it would cause the board to reset so I thought it was a brownout, soldered so many caps and filtering resistors, turns out it was a memory violation screams

ivory yew
#

yikes

#

Fix looks good, but I can't approve for merge. πŸ˜›

#

(maybe one day I'll ask for that level of responsibility)

idle owl
#

@ivory yew Keep up the reviews and we'll get you hooked up.

ivory yew
#

oh in that case I'll stop reviewing. πŸ˜›

indigo wedge
#

hehe

#

I have write access, surely I can approve my own code

ivory yew
#

You can but that wouldn't be very Cash Moneyℒ️ of you.

fading geode
#

Is there a way to software emulate motor and servo kits?

idle owl
#

@ivory yew Na, we got you hooked. πŸ˜‰

indigo wedge
#

So I'm flashing FW to a ESP32 over 9Mb UART using CPY

#

it's been about 15 minutes, 24% complete

#

can't back out now

manic glacierBOT
#

Try...Except..Finally blocks increase code size. There is no reason to do this, either in a library routine or mainline script code. When return values and parameters are properly documented, there are no surprises, and no code expansion due to try..except..finally blocks. Again, I say that just because something is done a certain way, it does not mean it has to continue to be done that same way. It is fine for the Python standard libraries to do things the way they do, and I have to deal wit...

indigo wedge
manic glacierBOT
#

It is a deep convention in Python to use exceptions to indicate errors. From PEP 20: The Zen of Python: Errors should never pass silently. For more details: https://inventwithpython.com/blog/2018/08/17/the-zen-of-python-explained/ (and many more such explanations). You can argue with it, but we try to be Pythonic in general, so I think you'll have to live with it.

#

^ & respectfully, it's not just done "because we've always done it this way" - it's because a lot of smart people have put a lot of thought into the problem over a long period of time & we happen to agree with the conclusion they reached. It's certainly a fair thing to disagree about, but please don't assume that it's based on dogma.

slender iron
#

@indigo wedge feel free to merge after approval from anyone when reviews even if they can't merge themselves

orchid basinBOT
manic glacierBOT
manic glacierBOT
indigo wedge
#

@slender iron see the images i posted above, it must be approved by someone with write rights that's not the author

onyx hinge
#

@idle owl if a board that will be in 5.1. is not on circuitpython.org do I want to open an issue about it at circuitpython-org or what? These are non-adafruit boards and I think they may not be for sale but not sure

idle owl
#

@onyx hinge That would work, yes. @gilded cradle Often adds the board to circuitpython.org and an issue is probably a good way to communicate the need.

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 5\.1\.0\-rc\.0
onyx hinge
#

@idle owl okay I filed a couple of issues, tagged the board contributors and linked to the guide. Thanks!

orchid basinBOT
idle owl
#

@onyx hinge You're welcome, thank you!

ionic elk
#

@tulip sleet got a sec?

#

hoping to clean up my include chain and I'm trying to wrap my head around it

tulip sleet
#

@ionic elk sure

ionic elk
#

amelia ok?

tulip sleet
#

ok

onyx hinge
#

Adafruit CircuitPython 5.1.0-rc.0 on 2020-03-26; Adafruit Metro M4 Airlift Lite with samd51j19

#

Adafruit CircuitPython 5.1.0-rc.0 on 2020-03-26; Adafruit Feather nRF52840 Express with nRF52840

#

@tulip sleet do you have a way to automatically check that the assets made it to s3, or is spot checking the way to go?

tulip sleet
#

@onyx hinge I don't check them all, just make sure the filenames are what I want. The subjobs will fail if the uploads fail, so no need to double check. When we were uploading assets to github, that was much more of a problem, becuase the github uploads were unreliable.

#

i notice you left off the "thanks" on each change. Scott and I have tried to include that to acknowledge outside contributors especially. Also I think you could omit the "changes since 4.x.x", since that info can be gotten from the 5.0.0 release

onyx hinge
#

okay, I'll add that to the release notes

tulip sleet
#

in my notes, i talked about converting to bbcode and html, but scott mentioned a script that is in circuitpython/tools, which I hadn't noticed. So you could try that. Scott puts the whole thing in a [QUOTE]; I don't do that

#

and feel free to edit my notes

onyx hinge
#

you mean to thank the PR submitter next to each bullet point?

tulip sleet
#

right

#

take a look at a previous one for examples

onyx hinge
#

I feel better about listing the breaking changes since 4.x.x, because at least a few users probably missed 5.0.0 and the extra reminder about potentially deleting all your files seems like a good thing to have.

#

but if you feel strongly I'll take that out

tulip sleet
#

np, it's ok, and you're right about the file deletions

onyx hinge
#

Updated with thanks per PR

#

updating a 4.x pyruler to 5.1.0-rc.0 deleted all my files as promised πŸ™‚

#

er, hm, did it?what's going on ..

#

no, my code's still there, huh.

#

Adafruit CircuitPython 5.1.0-rc.0 on 2020-03-26; Adafruit PyRuler with samd21e18

#

OK, that's my spot checking

#

Anybody else feel like kicking the tires of the 5.1.0-rc.0 before I move on to wider announcements?

tulip sleet
#

i will try a BLE something

#

@onyx hinge my bbq thermometer program still works

onyx hinge
#

excellent. I checked ulab functionality but nothing ble

#

no ble changes but .. you never know

onyx hinge
#

@tulip sleet so next steps are - circuitpython.org PR merge, then forum post, then blog?

tulip sleet
#

right, you're doing great :). The blog post will cause twitter posts due to the @ mentions in the blogpost title

onyx hinge
#

can I preview circuitpython.org as it will look after the PR is merged? In that big data file I do see -"version": "5.0.0-rc.1" +"version": "5.1.0-rc.0" so I think it's going to change those download links as we want

tulip sleet
#

circuitpython-org README describes how to preview if you want; you have to install some ruby stuff. But it sounds fine; shouldn't be necessary

onyx hinge
#

okay, found the instructions to build website locally

idle owl
#

@onyx hinge Thank you

onyx hinge
#

hum @slender iron 's release notes to bbcode script didn't work for me right away. I didn't try very hard to diagnose.
I'll try danh's method which involves using some web page. AttributeError: 'AdafruitBBCodeRenderer' object has no attribute 'emphasis'

#

oh wait maybe it's superficial

#

@tulip sleet how do I make a post an announcement? Is it possible I need fresh privileges on the forums?

tulip sleet
#

looking...

simple pulsar
#

This isn't an issue for me but I'm curious why this method doesn't show up as having a __str__ method in CP but str() does work on it? ```>>> mode[0].lower.str
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'bound_method' object has no attribute 'str'

mode[0].lower.repr
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'bound_method' object has no attribute 'repr'
str(mode[0].lower)
'<bound_method>'

tulip sleet
onyx hinge
#

@tulip sleet nope

tulip sleet
#

ok, i'll give you some more privs, hold on

onyx hinge
#

thanks

tulip sleet
#

@onyx hinge are you a moderator already? can you point me to a sample post of yours?

#

i need your forum username

onyx hinge
#

I don't think I have any special privileges on the forum yet

tulip sleet
#

is that account associated with your non-adafruit email? Maybe we should create a new account for your adafruit email

#

have you been using the same account to order stuff?

onyx hinge
#

This is the account I use to order stuff, it is affiliated with my non-adafruit e-mail address. I can create a new account if that helps something.

tulip sleet
#

i think that would be good; because then requests for staff orders, etc. are clearly from a staff person

#

i had a personal account, and a new one was created when i started getting paid, under my @river quest.com email

onyx hinge
#

okay, but this account is already tied into the learn system

#

I don't mind doing it I'm just not sure of the consequences.

tulip sleet
#

oy, ok, i'll consult

idle owl
#

@tulip sleet @onyx hinge I changed my email in my adafruit.com account to my Adafruit email address from my personal one to have it use that instead and had no issues.

tulip sleet
#

that sounds like the easiest; we do have forum support people who are using gmail addresses, etc.

#

i'll just up your forum privs

onyx hinge
#

okay thanks for the advice @idle owl and clicking in the admin interface @tulip sleet !

slender iron
#

@tulip sleet do we have a plan for getting the release download counts back into the json for the website?

tulip sleet
#

@onyx hinge try creating a post again

tulip sleet
#

@slender iron I have to get us permissions for the logs, then @raven canopy will take a look. I'm behind in contacting Justin about it; my AWS privs seem to have changed

slender iron
#

@tulip sleet I can ask justin now and take a crack at it. I don't like that the downloads page is no longer sorted meaningfully

tulip sleet
#

hold on for a bit more info...

#

We need access to the adafruit-circuit-python-logs. Anyone with r/w access to the adafruit-circuit-python bucket should have access to that. But I don't think it should be public, if it has IP addresses or other identifying information of the downloaders

#

if it doesn't, then it could be read-only public. @slender iron ^^

slender iron
#

pulls up AWS console

spice crypt
#

@slender iron Would low_power wakeup from Comparator interrupt be on the horizon?

slender iron
#

can you describe it in more detail? after ble midi I'll probably swing around to pin and rtc wakeup

#

I'm new to low power πŸ™‚

orchid basinBOT
spice crypt
#

Sure. So low_power on time.sleep() will have limited use, at least in my application. To wakeup the board from external inputs, one could configure a pin as a comparator (A low power peripheral on most micros, including nrf52840) rather than just use an AIN pin that would have to be polled periodically.

nRF52840 Part Spec Page 114: https://infocenter.nordicsemi.com/pdf/nRF52840_PS_v1.0.pdf

#

Then again, if a rising/falling edge would be capable of waking up as well, an external comparator could be implemented.

#

Let me know if I should put in a request on GitHub.

manic glacierBOT
#

I just wanted to chime in and say that often times an exception is generated due to invalid inputs to a function call. When this occurs a better fix than try/except is to use if statements to validate soon-to-be inputs before making the call. This makes the logic on handling those corner cases clearer. This isn't the case when network or device errors occur though.

tulip sleet
#

@onyx hinge Congrats on your first release!

idle owl
#

@onyx hinge πŸŽ‰

solar whale
#

just a FYI -- I pulled the latest master to get 5.1 and saw tons of warnings like this ```jerryneedell@Ubuntu-Macmini:~/circuitpython_master$ git pull
remote: Enumerating objects: 158, done.
remote: Counting objects: 100% (158/158), done.
remote: Total 272 (delta 158), reused 158 (delta 158), pack-reused 114
Receiving objects: 100% (272/272), 52.13 KiB | 920.00 KiB/s, done.
Resolving deltas: 100% (200/200), completed with 68 local objects.
From https://github.com/adafruit/circuitpython
5dc3a8960..59eb35da3 master -> origin/master

  • [new tag] 5.1.0-rc.0 -> 5.1.0-rc.0
    warning: Submodule in commit 24d1fd2bf1325ea6ede4a73cc6e8251d486f42a4 at path: '(null)' collides with a submodule named the same. Skipping it.
    warning: 24d1fd2bf1325ea6ede4a73cc6e8251d486f42a4:.gitmodules, multiple configurations found for 'submodule.lib/axtls.path'. Skipping second one!
    warning: 24d1fd2bf1325ea6ede4a73cc6e8251d486f42a4:.gitmodules, multiple configurations found for 'submodule.lib/axtls.url'. Skipping second one!
    warning: 24d1fd2bf1325ea6ede4a73cc6e8251d486f42a4:.gitmodules, multiple configurations found for 'submodule.lib/axtls.branch'. Skipping second one!
#

there were hundreds of such warnings

slender iron
#

@solar whale I saw that recently too

solar whale
#

just started building -- seems happy

slender iron
#

@spice crypt what would the comparator be checking against? battery voltage?

onyx hinge
#

I have seen that too. The commit 24d1fd2 is relatively recent but no idea how it relates to those messages. Many of them are about submodules not touched by that commit. (some submodules were modified by that commit)

spice crypt
#

Usually an internal reference. Can be external or another AIN pin in case of nRF52 series.

slender iron
#

what is the external thing it is connected to?

#

aka, how is it useful?

onyx hinge
#
the superproject which submodules actually need to be fetched. This is
tricky for submodules that were renamed in the fetched range of commits.``` found this.  Maybe it's actually related to the renaming of stm port which has submodules inside.  I don't really know.
spice crypt
#

In my case a hall effect sensor. When something comes in close contact the system wakes up and does processing. Otherwise it stays dormant

slender iron
#

why is a comparator better than an external interrupt?

onyx hinge
#

Thanks @tulip sleet @idle owl @slender iron for the help and for the trust you placed in me to let me make this release

spice crypt
#

Saves a component. :-) More flexibility.

#

Anyway, if low-power supports a logic transition as a wake up source I'll be very happy. Just time.sleep() won't be as useful.

slender iron
#

ya, it's on my radar

#

after I finish ble midi and the current sleep PR

spice crypt
#

Cool. Maybe I'll give making the comparator a shot as a coding exercise to get familiar with CP.

slender iron
#

πŸ™‚ the first sleep PR's focus is just getting our time keeping off of systick

spice crypt
#

Ah. That's a big deal. I saw your comments regarding the RTC resolution.

ivory yew
#

@slender iron I successfully did some flash surgery today, thanks for the tip!

#

also buying a hot air station is the best decision I've ever made

slender iron
#

downloads per day

fierce girder
slender iron
#

πŸ™‚

spice crypt
ivory yew
#

too much effort. πŸ˜›

tulip sleet
#

@slender iron on it

raven canopy
#

@slender iron did you see any evidence of inflated request numbers? in my toying around, CloudWatch was reporting 3 requests each time i downloaded a file. i couldn't narrow down if it was the S3 we interface/redirects...

slender iron
#

I didn't look that closely

#

I did exclude bots πŸ™‚

raven canopy
#

kk. i'm thinking a match of timestamp + IP should be a good filter.

i did exclude bots

excellent.

slender iron
#

my main concern was just getting a gradient between boards

raven canopy
#

πŸ‘

slender iron
#

not sure the best way to automate it

raven canopy
#

yeah. its nice that the service is at least available. but it has some barriers.

slender iron
#

ya, it's pretty raw

#

I do like having downloads by day though πŸ™‚

raven canopy
#

does the 15-day retention still apply with how justin set it up?

slender iron
#

the number of rc.0 downloads does worry me a bit

#

the files I pulled down went back to 2/28

raven canopy
#

that seems like a no. πŸ˜„

raven canopy
#

is the filename convention workable? i vaguely remember seeing an example before, but can't remember it.

slender iron
#

what do you mean?

raven canopy
#

better-worded: are the filenames easily filtered by timescale, etc?

slender iron
#

I just ran them all

#

I did see the naming but don't remember

#

A log file delivered at a specific time can contain records written at any point before that time. There is no way to know whether all log records for a certain time interval have been delivered or not. ```
raven canopy
#

oh yeah. i remember reading that. but workable with some padding.

simple pulsar
#

@raven canopy What data are you looking at when you refer to requests wrt downloads?

raven canopy
#

GETs on each file object

simple pulsar
#

Are they all 200s?

raven canopy
#

tannewt included only 200s, and i would do the same.

simple pulsar
#

You might want to have a glance at the bytes sent too in case there's anything suspicious there.

raven canopy
#

good datapoint. filters out cancelled downloads.

#

and post-response failures.

simple pulsar
#

What's the sys.maxint story in CircuitPython? I just put 5.0.0 on my Gemma M0 and it's not there.

slender iron
#

@ivory yew I'm trying to fix the MIDI library so it doesn't allocate each receive

manic glacierBOT
#

This PR restructures the STM port of Circuitpython to be more generic about the STM32 chip lines so as to support the F7 and H7 series of chips, which run on the Cortex M7 core at up to 480MHz with advanced peripherals including Camera and Ethernet modules. Changes so far include:

  • A new Packages directory to organize different chip layouts between lines.
  • Changes to the Makefile to condense board-level flags to the minimum and support the new chip series.
  • Minor stylistic changes t...
simple pulsar
#

I'm just playing with numbers on a Gemma M0 with 5.0.0. It looks like I can't directly assign -1073741824 but I can get there by decrementing, this must be a bug? Shall I ticket this ```>>> neg_int = -1073741823

neg_int -= 1
neg_int
-1073741824
assign_test = neg_int
literal_test = -1073741824
OverflowError: long int not supported in this build

ivory yew
#

@slender iron smolmidi is very low allocation

slender iron
#

why doesn't smolmidi == midi?

ivory yew
#

I stopped short of making it no allocation, which could probably be accomplished by having the user pass in the message object for population, so it can be re-used between calls to receive.

#

It's just the name of the library

slender iron
#

but why are there two libraries?

ivory yew
#

because smolmidi is significantly different from Adafruit's MIDI library

#

I mean if y'all want it by all means.

manic glacierBOT
slender iron
#

looks

ivory yew
#

I actually thought of making smolmidi optionally no allocation by allowing you to pass in an existing message or leave it as None and it'd make one for you. Best of both worlds. shrug.

lone axle
#

@robust nymph I got a chance to play with your requirements.txt changes for circup. It is working but I am getting extra empty lines in the file created by freeze -r in between each library.

slender iron
#

yay! readinto

ivory yew
#

(the sysex implementation probably needs some optimization, I don't use it for Sol so I haven't really poked at performance yet)

slender iron
#

is it in the community bundle?

ivory yew
#

No, I don't think either of the Winterbloom libraries are.

robust nymph
#

@lone axle which OS? I think I may have forgot to add return

slender iron
#

that would be nice!

#

adds readinto to BLE MIDI

lone axle
#

@robust nymph I am on windows. Very nice work I really like this workflow.

ivory yew
#

It would, I just keep forgetting to do it

#

and right now my computer is ... uh... out of commission because I'm completely re-organizing my desk.

lone axle
#

do you still see a need for targeting local directories instead of the board itself?

ivory yew
lone axle
#

Maybe it would allow targeting devices too actually.

robust nymph
#

I think because the install currently only pulls from the upstream modules I assumed checking locally could come later.

#

Yeah, I haven't messed with what happens when two circuitpython devices are connected. Just got two more delivered today so I can test tonight.

#

Need to run but bbl

tidal kiln
#

for the feather nRF52840, BATTERY is the lipo voltage divider pin?

#

and appears to be aliased?

>>> board.BATTERY
microcontroller.pin.VOLTAGE_MONITOR
>>> board.VOLTAGE_MONITOR
microcontroller.pin.VOLTAGE_MONITOR
>>> 
slender iron
#

yup, I think because we decided that one of those would be the standard name (can't remember which)

tidal kiln
#

thanks. wanted to verify. me either - remembering which.

slender iron
#

probably VOLTAGE_MONITOR since it prints back. the first listed in pins.c is the name we want to print

robust nymph
#

@lone axle just pushed what I think should fix the extra blank like in requirements.txt issue.

lone axle
#

cool, will test now.

robust nymph
#

On the local folder need, wondering what the use case would be for that.

#

Do you mean local location of the source library bundle or local installed libraries location?

lone axle
#

well when I first asked the question I perhaps misunderstood what you meant. I was thinking you meant to check in the versions of libraries to your repos

robust nymph
#

Ah ok gotcha. I was actually trying to think of best way to deal with versions.

lone axle
#

This with requirements.txt checked into the repo is a great solution

robust nymph
#

The current upstream install command installs the most recent published version of the package. I added a check to see if the library was already installed on the device. However, there is not currently anything to deal with installing a specific version.

lone axle
#

ah

#

New version works perfect

robust nymph
#

Would need to dig through the existing functions more but I don't there is currently a way to find versions in old bundles. It grabs the current library bundle and checks version in that bundle with the versions on the device. There would need to be new feature added to go through all bundles and grab versions.

#

Ok cool, I think current method works to easily distribute a project so people can install the right packages. Could come back to more complexity later.

lone axle
#

I think the github API could be used to find older release pages and pull the asset from there maybe

robust nymph
#

Did that most recent commit fix the freeze -r output?

lone axle
#

yep all good now

robust nymph
#

Ok great! I'm going to look at trying to add tests to the install_module function tonight and then hopefully make a pull request tomorrow.

#

Thanks for testing and feedback!

lone axle
#

Yep, thank you as well.

#

I'll keep an eye out for it and test again when the PR is iup

manic glacierBOT
manic glacierBOT
raven canopy
#

@robust nymph if you have the version number, you can point directly to the release asset for each repo. f-string example:

https://github.com/adafruit/{full_repo_name}/releases/download/{lib_version}/{full_repo_name.lower().replace("_", "-")}-{cirpy_maj_version}.x-mpy-{lib_version}.zip
robust nymph
#

Thanks for the info! I'll see what's possible there. I'm not sure how much it will increase time to install but will give it a shot.

#

I think right now circup is grabbing the whole most recent library bundle once and then copying them (edit: the specific module I mean) over to the device.

raven canopy
#

actually, the above will need to be tweaked. it would be going from the other direction (filename -> repo name).

yeah, iirc, using the bundle was deliberate so to reduce time & transactions.

robust nymph
#

Ok, will just stick with ignoring versions for now in the requirements.txt. It will still output the versions with freeze -r in case it's determined to add support for them later.

eternal lantern
#

Stemma Button(https://www.adafruit.com/product/4431) appears to be in Normally Closed position by default instead of Normally Open . The button is connected to A2 Stemma Port via TFT Gizmo bolted to a CircuitPlaygroundBlueFruit running cpython 5.0.0 (2020-03-02) whereas the onboard BUTTON_A and BUTTON_B appear as Normally Open. The syntax used for BUTTON_A is button_A.switch_to_input(pull=digitalio.Pull.DOWN)
Unsure what args to use for the Stemma button, but using Pull.UP or Pull.DOWN or no args seem to make no difference in the desired button behavior. While i can simply invert (not) the output and move ahead, I am curious what I am missing? Is it simply due to the external pullup as the Stemma button is designed, or is there a library that sorts out such things that I overlooked.

manic glacierBOT
slender iron
#

@eternal lantern you shouldn't need any pull for the stemma button since the board has a pull up. just not value and you should be on your way!

eternal lantern
#

@slender iron thanks

median moth
#

Hello everyone!

#

I am looking for a list of supported MCUs of CircuitPython

#

On here, there are no traces of the "M4" boards ie SAMD51

solar whale
median moth
#

I am looking for specific microcontrollers supported by the latest micropython release

median moth
#

I am working on my own cicuitPython board

solar whale
#

sorry -- you are looking for micropython - not circuitpython?

median moth
#

circuitPython, made a mistake above

solar whale
#

then under each port you can look at "boards'

median moth
#

It is so strange, nothing about the SAMD51s

#

(I am making my own board, I am not starting from a pre-designed board)

solar whale
#

I think most start with a 'similar' board and adapt.

#

I'm not sure what you mean by nothing about the SAMD51s- there are many

#

ah -- I see the pinout list and the README does not include them...

#

sorry -- hopefully one of the core developers and help you with that later today

median moth
#

I was wondering if I had missed something, absolutely no problem

#

As for the SAMD21s there are different versions, J, G and E types

solar whale
#

yes as for the samd51

median moth
#

I would like to understand how it affects the performance of circuit python

solar whale
#

Good luck -- the people who can best help with that are scattered across several timezones πŸ˜‰

median moth
#

No problem, I appreciate your help jerryn

solar whale
#

you're welcome -- wish I could have helped more

manic glacierBOT
tulip sleet
#

@median moth https://learn.adafruit.com/how-to-add-a-new-board-to-circuitpython can help with the details. The SAMD21 variants are mostly number of pins and amount of memory. Choose the "...18..." variants for the most memory; any less won't work. SAMD51 has a much more practical amount of RAM and flash if you want to write larger programs.

#

SAMD51 has hw floating point

#

and performance is notably better in general

median moth
#

Choose the "...18..." variants for the most memory; any less won't work
is this documented anywhere?

tulip sleet
#

@median moth no, but in the past people have asked for guidance in various ways when designing a board. We could give minimum memory requirements in the guide. Also, having some external SPI flash is really a good idea to get adequate filesystem size

#

do you have one or more CircuitPython boards already?

median moth
#

is SAMD J, G and E types all supported? I cant find this info concretely anywhere.

tulip sleet
#

yes, we have boards with all

#

you can grep through the ports/atmel-samd/boards/* files to find the specific chips in use already

median moth
#

I had a look at those, that was useful indeed

tulip sleet
#

do you have a CPy board already?

median moth
#

oh sorry, no I do not

tulip sleet
#

I would strongly recommend getting one or more to try out before you make your own board, so you have a working example, and so you can see what the limitations are of the various chips in a practical way.

median moth
#

Noted, thank you for the tip.

tulip sleet
#

you'll also probably need a debugging tool like a J-Link

median moth
#

I read you can use OPENOCD + rasPi gpios to flash SAMD chips, I thought I'd give that a go

tulip sleet
#

you can but it's fairly painful. openocd doesn't have great support for samd21; its support was tested on earlier chips

#

you can get a J-Link mini Edu for ~$20.

#

and you will want to be able to use gdb, etc., probably

median moth
#

Thank you for your help @tulip sleet

tulip sleet
#

np, feel free to circle back with q's

simple pulsar
#

I was just writing something to illustrate how time.monotonic() works

#

I'm running this on an a CLUE ```>>> while True:
... now = time.monotonic()
... now_ns = time.monotonic_ns()
... if now != previous:
... print("monotonic() = {:.6f}".format(now),
... "| monotonic_ns() =", now_ns)
... previous = now

#

And output like this pops out ```monotonic() = 73690.028191 | monotonic_ns() = 73690028056000
monotonic() = 73690.061569 | monotonic_ns() = 73690060094000
monotonic() = 73690.090179 | monotonic_ns() = 73690092077000
monotonic() = 73690.123558 | monotonic_ns() = 73690124029000

#

I can understand that the formating for {:f] is imperfect, i.e. 73690.028191 should be 73690.031250

#

but it's curious that the ns numbers are close to the format ones? The line i cited is 73690028056000 which is 73690.028056000

tulip sleet
simple pulsar
#

Hmm, posisble I'm being fooled by some randomness here too

tulip sleet
#

or it's just an artifact of the float conversion, which has its issues (there are multiple issues in the micropython repo about float printing accuracy)

onyx hinge
#

hum that reminds me, multiplying by 1e-9 is less precise than dividing by 1e9, since 1e-9 is inexact but 1e9 is exact in floating point

#

If you want to print timestamps and bypass any problems with float precision, ```def fmt_ns(timestamp_ns):
s, ns = timestamp_ns // 1000000000, timestamp_ns % 1000000000
return "{}.{:09d}".format(s, ns)

def fmt_us(timestamp_ns):
s, ns = timestamp_ns // 1000000000, timestamp_ns % 1000000000
us = (ns + 500) // 1000
return "{}.{:06d}".format(s, us)

def fmt_ms(timestamp_ns):
s, ns = timestamp_ns // 1000000000, timestamp_ns % 1000000000
ms = (ns + 500000) // 1000000
return "{}.{:03d}".format(s, ms)

timestamp_ns = 73690028056000
fmt_ns(timestamp_ns)
fmt_us(timestamp_ns)
fmt_ms(timestamp_ns)

#
'73690.028056'
'73690.028'
median moth
#

Will 2MB of flash be enough to store all libs?

onyx hinge
#

@median moth it will be enough for all the libs that can be used by a particular project, since python files imported from flash use RAM and 2MB flash is much bigger than the available RAM.

#

but depending on the use of your board, consider that maybe the flash would also store bitmaps, sound samples, etc.

median moth
#

ah of course, makes sense

onyx hinge
#

it would be neat if there was a way to use modules on flash without using up (much) RAM, but I don't think it works that way

#

mpy-compiled python modules that are "frozen into" the in-MCU flash do use less RAM

#

(that's my understanding anyway)

tulip sleet
#

that's right, we can't execute from the filesystem

main meteor
#

It would be cool to have FRAM instead of flash, and the ability to use it as additional RAM, but that would be a huge rewrite and would require a parallel interface to get any reasonable speed.

onyx hinge
#

ESP32-S2 supports SPI RAM in some capacity. I think it can be a severe performance bottleneck if used poorly, though

#

is FRAM one of the "retains with power off" types?

main meteor
#

Yup. It's really fast, and non volatile.

#

It also doesn't wear out like flash.

onyx hinge
#

samd51 says it has XIP support for QSPI, maybe it could be done

tulip sleet
#

we don't need execute to use the byte codes, but they need to be in addressable memory.

onyx hinge
#

Isn't that what XIP does, makes the content of the flash appear "memory mapped"?

umbral dagger
simple pulsar
#

@onyx hinge I was looking to explain what's going on but it looks a bit "detailed"!

timber mango
#

I have code that allows neopixel strips and rings to be chained together and still be treated as if they are all on different pins.

#

It also allows each "unit" to go in forward or reverse directions from pixel #0.

#

This may just be a different way to do what @umbral dagger has done.

idle owl
#

@umbral dagger We built something similar into the LED Animations library. I don't think it's currently published though - it was part of a WIP PR that was put on hold, iirc.

onyx hinge
#

flipping sections of the strip seems like an excellent addition

#

I wonder if treating two sections like one section would be useful too e.g., assigning one pixel would change [0], [20] and [40] on the underlying strip

#

as usual there are a million ways to expand on a basic idea

timber mango
#

@onyx hinge I think I could probably add that to my code pretty easily by using a list to hold the pixels for each section and treat that as a strip.

#

@idle owl What PR is that? I would like to look at it.

idle owl
timber mango
#

Thank you @idle owl. Is this a new library or do you have branches?

idle owl
#

I don't understand the question. The library itself is already published, the PR adds a lot more functionality that we put on hold waiting on a few other things with NeoPixel etc to settle.

umbral dagger
#

@timber mango I didn't do reverse yet. Just something simple I had use for so I shared incase it's of use to others.

manic glacierBOT
timber mango
#

@idle owl OK, good. Are you doing your new work on a branch of the library?

manic glacierBOT
#

Ok,, thank you for that feedback. I didn't know. I wondered, though - I noticed that most boards all used underbars. I also noticed a few they used a hyphen, so I thought it while not common, it was ok. I have renamed the board, rebuilt locally and tested the resulting firmware. And also updated the workflows/build.yml file - didn't want to forget that again! :-) Tests are running now.

Thanks!

simple pulsar
#

@onyx hinge btw, i'd almost forgotten another horrible detail in this world, ```>>> type(1e6)
<class 'float'>

slender iron
timber mango
#

@idle owl @slender iron How do I checkout the more-magic branch??

simple pulsar
#

Does anyone know how long gc times typically are on CircuitPython? I'm just curious here as I'm writing about inter statement delays in CP.

slender iron
#

@timber mango Add rhooper as a remote and then checkout the branch

#

so git remote add rhooper https://github.com/rhooper/Adafruit_CircuitPython_LED_Animation.git , git fetch rhooper and then git checkout rhooper/more-magic

manic glacierBOT
timber mango
#

@slender iron It says I am in a "detached HEAD" state. <looks in mirror at HEAD>

slender iron
#

ya, that's because you don't have a local branch

#

you only really need one if you are adding your own commits

timber mango
#

Oh, OK. I probably do not need that then, unless I find something I can fix.

slender iron
#

πŸ‘

timber mango
#

-sigh-

slender iron
#

@ionic elk what boards are you testing with for f7/h7?

daring merlin
#

from what ive been able to gather, there is no circuitpython library for NeoMatrix. can you still just use the standard CP NeoPixel strip library on a matrix? that's what ive been attempting to do for the past hour or so, assuming that it was effectively the same thing as a strip, but i havent had any luck and idk if this is because i need to use an actual matrix library or if i have a faulty board or a short etc

ionic elk
#

@slender iron I have a Nucleo H743ZI, a Nucleo F767, and an OpenMV (H743VI)

#

@slender iron also, I'm working on flash at the moment, and I just wanted to ask - when I dump my flash memory using the system, it's clear that the filesystem isn't overwriting existing material that readily - when I delete text or a while file, it stays in the flash memory and it moves up to a new location to write to, even though the filesystem shows the item is gone. Is that working as intended and it'll eventually roll over and overwrite existing stuff? Or have I done something wrong I need to revisit?

manic glacierBOT
tulip sleet
#

@ionic elk The blocks that are written are chosen by the host's FAT filesystem implementation, because MSC is a block device. We aren't doing any clever remapping to do wear-leveling. But whatever host you're using may be doing something like that. Or it may simply be doing some kind of transactional writes to minimize possible corruption. E.g. write a new version of the file elsewhere instead of rewriting the existing blocks, then in one fell swoop change the pointer to the file.

manic glacierBOT
ionic elk
#

@tulip sleet would you happen to know what this syntax means? (uint64_t)(uint32_t)src

#

This is where you'd normally put a *src

tulip sleet
#

that looks like a double cast, but I don't know why. Can you point to the line?

#

it's conerting a pointer to an integer, and then promoting the integer. But it seems redundant unless the original src is more than 32 bits

ionic elk
#

micropython's stm32 flash.c line 284:

    for (int i = 0; i < num_word32 / 8; i++) {
        if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_FLASHWORD, flash_dest, (uint64_t)(uint32_t)src) != HAL_OK) {
            // error occurred during flash write
            HAL_FLASH_Lock(); // lock the flash
            return;
        }
        flash_dest += 32;
        src += 8;
    }
#

That function is programming 32 bits at once, but that still doesn't explain the wonk double cast to me

tulip sleet
#

looking...

ionic elk
#

it doesn't really say anything about it in the HAL documentation either

tulip sleet
#

i'm going to look at the decl of HAL_FLASH_Program...

#

so it takes the src ptr, converts it to a 32-bit int, and then promotes it to 64 bits so it matches the 64-bits for
HAL_FLASH_Program(uint32_t TypeProgram, uint32_t Address, uint64_t Data)

#

because you are writing 64 bits at once

#

i think it's just written this way to be clearer.

ionic elk
#

between the F4 and H7 basically?

tulip sleet
#

well, it looks like the HAL expecs to write a single 64-bit word at once, is that right? That's the way the hardware works?

#

I don't hink it's F4 vs H7.

ionic elk
#

The F4 interface is for 64 bits of actual data, but the H7 HAL asks for an address

#

Since the H7 programs 32 bytes at once

#

not 1-4 bytes

tulip sleet
#

ugh, that's terrible, why did they use the same name for the routine

ionic elk
#
HAL_FLASH_Program(uint32_t TypeProgram, uint32_t Address, uint64_t Data)
vs
HAL_FLASH_Program(uint32_t TypeProgram, uint32_t FlashAddress, uint32_t DataAddress)
#

Β―_(ツ)_/Β―

#

that's ST for you

tulip sleet
#

that is really confusing, and worse, DataAddress is not even a pointer, which would help the compiler to do type-checking in this case, since it would complain you're passing an int to a pointer. gross

ionic elk
#

hahahaha

#

it is like this for all of their stuff FYI I don't think they use pointers basically ever

#

it's always 32 bit ints for addresses

tulip sleet
#

the explicit promote to 64-bits in the micropython code helps, because maybe the compiler will complain that you're truncating the 64-bits to 32 bits when passing it if you were compiling for H7

#

anyway, i think the micropython casts are fine and are protective. It makes you want to make sure to do -Wall also

ionic elk
#

Sorry can you explain again what the casts do exactly? They protect against me accidentally passing the wrong data type, like if I put in the standard 64 bit data?

#

Wouldn't the compiler complain about that anyway?

timber mango
#

@tulip sleet I cringed when I saw that! 😬

ionic elk
#

welcome to my life

tulip sleet
#

no, no, they override the type-checking. If you didn't have them, since src is a pointer, you'd get a type error. So you add an explicit cast to say "treat this pointer as an integer", and then, since the routine takes a uint64_t, it gets further converted from 32 to 64 bits

#

always understand what a cast is doing, because it's often doing something potentially unsafe. There are int-to-float kinds of casts too, but the basic idea is that you're either subverting the type system or asking for an explicit conversion

ionic elk
#

But the routine doesn't take a uint64_t for the H7? I'm confused

#

it's uint32_t DataAddress

tulip sleet
#

the micropython code was not written for the H7, so this won't work. You have to write two different versions of the code, one for F4 and one for H7, and pass a pointer in one case and the actual 8 bytes of data in the other

#

EVEN THOUGH THE ROUTINE HAS THE SAME NAME, which is STUPID

#

it should be called HAL_FLASH_Program_from_ptr or something like that on the H7

#

i was shouting because it makes me angry

ionic elk
#

hmmm. This is the Micropython section for the H7 is the thing

#

it's literally in a ifdef(H743)

timber mango
#

i was shouting because it makes me angry
@tulip sleet I had to hide my eyes! πŸ™ƒ

ionic elk
#

I wonder if it doesn't work for them

tulip sleet
#

ok, i see, it's passing the src ptr rather than fetching the val from the src. So i don't know why they have the (uint64_t), because the routine takes a uint32_t

#

i thought that was the F4 code

ionic elk
#

I haven't compiled Micropython for the H743, maybe it's based on a super old version of the HAL and they missed it?

tulip sleet
#

my mistake

#

let me look at the blame for that

#

it's from two years ago, with no changes. So I don't understand why the uint64_t cast is there, since the routine takes a uint32_t

#

i'm looking at the original pr

ionic elk
#

stm32lib is a separate submodule that may have been updated

tulip sleet
ionic elk
#

AHAHA ST CHANGED IT

tulip sleet
#

i don't know that the (uint32_t) part of the cast is really necessary, but it makes it clearer, because the idea is that you're starting with a 32-bit pointer

ionic elk
#

2017 version, they still had 64 bit data as the value but it was actually for a 32 bit address

#

So they just forgot to update this and I guess didn't have CI run on the H743

tulip sleet
#

who is they?

ionic elk
#

mystery solved, thanks for your help everybody. Sorry to blind you with the elegant brilliance of STMicroelectronic's APIs

#

ST. ST changed it

tulip sleet
#

but the mpy maintainers didn't change it, yeah, I guess so

#

my distress still remains but the code makes more sense

ionic elk
#

Oh yeah the "they" was the Mpy maintainers, they didn't catch the switch

#

Yeah it makes total sense for this 2017 API, they're casting as a 32 bit int to avoid casting errors, and then expanding it to a 64 bit int to match the interface

tulip sleet
#

yeah, that api was even worse, because in one case the 64 bits was data and the other it was an address

ionic elk
#

@tulip sleet also, clearly the micropython code is showing that the RAM is addressed by word, but the flash is addressed by byte. Is this kind of differentiation shared across ports?

tulip sleet
#

@ionic elk we show that kind of thing by using uint8_t* vs uint32_t*, right. But for the port-agnostic routines, we should try to hide the details of the flash mechanism.

orchid basinBOT
orchid basinBOT
tulip sleet
#

@ionic elk I guess you figured it out πŸ™‚

ionic elk
#

yep

#

reset_into_safe_mode(FLASH_WRITE_FAIL);?

tulip sleet
#

right, something like that is better than just calling HardFault_Handler().

#

it will show a message when it restarts.

onyx hinge
#

considers reporting it, but is too tired

manic glacierBOT
#

Unfortunately this is not possible, STM32F4 and variant macros STM32F405xx etc are from the ST HAL - the HAL uses #ifdef constantly so I cannot set them to 0 safely. We'd need to make CPY_STM32F4 style versions.

This might be worth longer discussion. Micropython uses exclusively ifdef(STM32XX) to designate areas as F4/F7/H7 etc. Do you want a new CFLAG we set as 1 or 0 for every variant? That could end up being 10+ CFLAGS that are all 0...

ionic elk
#

@tulip sleet I've finished my internal flash rework for stm as a part of my H7 PR, if you'd be interested in reviewing.

tulip sleet
#

i will take a look, maybe not right away, but thanks!

simple pulsar
#

Should https://learn.adafruit.com/adafruit-gemma-m0/circuitpython#gemma-default-zip-install-6-14 have a note about when Windows 7 Driver directory can be deleted? That would free up some valuable space for a good subset of Gemma M0 users. Mentioned in https://forums.adafruit.com/viewtopic.php?f=52&t=163572

Adafruit Learning System

The Gemma M0 will super-charge your wearables! Small, light, and it's easy to use, so you can do more.

marble hornet
#

@slender iron I think i know the answer but I'm just double checking for posterity. there isn't a way to extract the set_column_window_command and set_row_window_command from a finished Display object? ex: the below data isn't stored anywhere it can be retrieved from python side? https://github.com/adafruit/Adafruit_CircuitPython_SSD1675/blob/b6790f38f0041f6fc139ab2ca81948020da1343c/adafruit_ssd1675.py#L88-L94

#

It seems like almost all of the tft drivers use the same commands (the the default ones you set)...

timber mango
#

@marble hornet It is like that for a reason - to make it as easy as possible to switch to a different screen.

manic glacierBOT
median moth
#

hello~

#

It seems the itsybitsy M4 doesn't operate with an external crystal, I was wondering what implications this had on the board and how it works

median moth
#

as far a I can see the 32K clock is crucial for RTC, WDT and EIC

manic glacierBOT
#

actually the unstable version went in a branch that is not pull-requested yet. it's jepler/circuitpython@protmatter-displayio-v2.

What's changed so far is:

  • I created an allocation/deallocation function which can use heap if available and supervisor allocation if needed
    • this involved exposing a new function in the supervisor allocator to check if a block was allocated by it, not by the heap
  • I placed a protomatter_protomatter_obj_t in primary_display_t, but do not use it yet
    ...
onyx hinge
#

@median moth OSCULP32K doesn't require external parts and can be used as input to RTC and so on, if I read that image correctly. However, that's just based on a few moments of looking at that image and the datasheet so it's also possible I'm incorrect.

#

I think XOSC32K is the clock that requires the external crystal

median moth
#

As seen here, the itsybitsy doesnt have a XOSC32K

onyx hinge
#

right, so something needing the 32.768kHz clock would need to configure the registers to use OSCULP32K which the datasheet calls "32.768 kHz ultra low-power internal oscillator". I assume that by "internal" it means that no external component is required

#

From the source code, it checks has_crystal and decides which source to use for the RTC. (ports/atmel-samd/peripherals/samd/samd51/clocks.c) ``` init_clock_source_osculp32k();

if (has_crystal) {
    init_clock_source_xosc32k();
    OSC32KCTRL->RTCCTRL.bit.RTCSEL = OSC32KCTRL_RTCCTRL_RTCSEL_XOSC1K_Val;
} else {
    OSC32KCTRL->RTCCTRL.bit.RTCSEL = OSC32KCTRL_RTCCTRL_RTCSEL_ULP1K_Val;
}
#

supervisor/port.c: clock_init(BOARD_HAS_CRYSTAL, fine); some boards have this define, but itsy bitsy m4 doesn't: boards/metro_m4_express/mpconfigboard.h:#define BOARD_HAS_CRYSTAL 1

median moth
#

Do you know how much it affects the RTC to go internal oscillator only?

#

Thanks for looking into this by the way @onyx hinge

#

If it only matter for RTC I might skip it on my design as I dont expect the board to run continuously as such an accurate RTC might not matter

onyx hinge
#

@median moth good question! I'll see if the datasheet makes a claim about accuracy of the internal 32k

#

looks like 2% variation with calibration, and 25%!? without

#

so most of that is coming from temperature variation

main meteor
#

That makes sense, even the 25% (the variability in semiconductor processes tends to surprise people who haven't worked with it).

median moth
#

Great, thanks lots for your help @onyx hinge

#

Seems like I should be good without

manic glacierBOT
#

@caternuson I just did a retest with plain Bitmap. My original test was probably slower to my use of layered Bitmaps, I have a static background one below the main one, elegant but slow.

Here's a basic 201x200 with auto refresh off:

>>> bitmap = displayio.Bitmap(201, 200, 8)

>>> def fillscreen1(bmp, col_idx):
...     for x in range(201):
...         for y in range(200):
...             bmp[x, y] = col_idx

>>> def refresh_screen(disp):
...     while True:
...         ref ...
keen jay
#

Good afternoon everyone. I have a question regarding the circuitpython port for STM32 boards from ST micro, namely the STM32F412G-Disco. I'm curious about the circuitpy drive and if there's a modification to the firmware that could be applied to have it make use of the SPIFlash present on the board

#

When flashing the board with CircuitPython 5, I only end up with a 32k circuitpy drive instead of something roomier

manic glacierBOT
#

@tannewt I'm not sure I'm asking for that kind of support - it's not that I'm asking the system to monitor power etc. I'm just asking it not to go into a zombie mode that never resets. And I'm asking for it as a configurable option.

I think the simplest implementation of this request is to have a mode (configurable in boot.py) that says "On brownout, shut down all FLASH access and things that can corrupt filesystems, etc. and then periodically check to see if the brownout is over. If po...

manic glacierBOT
manic glacierBOT
#

@rossfl, yes, I like it. Lots of storage, and not terribly expensive. Easy to interface. Bigger than the smaller chips, though still a relatively small SMD chip. I'm using it on my "Vina" board and it's been great and working very well.

Real thanks go to the good design of the CircuitPython external_flash and devices.h and the mpconfigboard.mk processing - which makes it so easy to add new device support and then select them on a per-board basis. Thumbs up to that!

timber mango
#

I rewrote issue #2738 to make better sense. πŸ™‚ πŸ˜‰

manic glacierBOT
#

Looks like there are some pre-commit check setup errors. A lot of errors like this:

Err:1 http://azure.archive.ubuntu.com/ubuntu xenial/main amd64 libunistring0 amd64 0.9.3-5.2ubuntu1
44
Could not connect to azure.archive.ubuntu.com:80 (52.177.174.250), connection timed out
45

Also looks like some other pull request pre-commit checks are failing with the same or similar reason. Hopefully transient?

manic glacierBOT
lone sandalBOT
bitter bronze
#

I have a developer edition of the Circuit Playground Express. It does no appear to have Circuit Python but I see it as MAKECODE drive. Can I add Circuit Python to the board and if so how?

stuck elbow
#

@bitter bronze sure, just flash the circuitpython firmware from circuitpython.org on it

simple pulsar
arctic violet
#

I moved my Express to a second PC and had to redo the install drop to see the CircuitPython drive, is that expected behavior?

solar whale
#

@arctic violet Not usual, but it happens. It may depend on how it was disconnected from the first PC -- sometimes it can get corrupted. if you eject the CIRCUITPY drive before disconnecting, it should be there when reconnected to another PC.

arctic violet
#

Ok thanks

onyx hinge
#

good morning!

arctic violet
#

I live a renegade life style of never safely ejecting

plucky flint
#

Heads up... cicup 0.0.8 just pushed to master (not sure who releases it on PyPI???). Thanks to Steven Abadie for his amazingly useful requirements.txt contribution. Hurrah. πŸŽ‰

#

Hope everyone is well, in spite of the current virus pandemic. Stay well and be safe folks. πŸ€—

#

-> back to lurking.

idle owl
#

@plucky flint Thanks for the update! I hope you are well πŸ™‚

plucky flint
#

Yup... we're all in lockdown over here in Airstrip 1. πŸ˜‰

idle owl
#

@plucky flint We need to make a release on circup for it to get pushed to PyPI.

plucky flint
#

Ahh.... just tell me what to do and I'll do it.