#circuitpython-dev
1 messages Β· Page 297 of 1
@serene warren You could also install a linux distro on Win10 with WSL.
@gilded cradle was the odroid a PR to platform detect? we should count that as a blinka pr
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.
@slender iron It was both, but must have been merged after stats taken.
Complete details provided in this post: https://forums.adafruit.com/viewtopic.php?f=57&t=158718 Feather M4 Express does not launch user code because memory locations at the beginning of unp...
Very quiet for me
oof. keeps going in and out for me
Drew is breaking up
That's why I refer to it as MacOS Cataclysm
hug reports to the engineers who probably said it was a bad idea but implemented it anyway (catalina permissions)
It could also be called MacOS Catastrophe
Very weird. I can't reconnect to voice. Oh well, I'll wait for the YouTube π
lol
sure π
Switching push to talk as I can never hit mute fast enough when my client connects
@inland tusk You can also send an email to support@adafruit.com with your support and thanks, if you wish.
BME Oxymeter?
BLE
BLE Rover:
Get a CLUE fromΒ @Adafruit IndustriesΒ plugged into a Bit:2:Pi fromΒ @4tronix_ukΒ add theΒ @ryanteckΒ Motor Controller Board for Raspberry PiΒ https://t.co/NbstuggwvS
With two motor and this code:Β https://t.co/6yiRn4xMxVΒ you have a rover.
Standard motor library works perf...
CMS50D+
Pulse/oxymeter also cought my ear π
@idle owl I certainly will do thatπ
There was a video on YouTube from the guy with a Swiss accent... I wanted to acquire on directly!
Connection is bad. No voice from me today. Thanks
@fierce girder Ok thanks
CMS50D pulse oximeter is a little more complicated than "BM1000" and similar, which use the bluetooth.org predefined service
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...
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!...
So @tulip sleet you are working on the BM1000 ?
i have both, i had looked at their traffic a couple of months ago
https://www.ebay.com/itm/Bluetooth-OLED-fingertip-pulse-oximeter-Spo2-Monitor-pedometer-APP-analyzing-US/174154441433
https://www.ebay.com/itm/Bluetooth-Finger-Tip-Pulse-Oximeter-SPO2-PR-Blood-Oxygen-Heart-Rate-Monitor/202660064253
(SpO2 error is Β±4%, pulse rate error is Β±2 bpm or Β±2%, whichever is greater. 1)Display of SpO2 value. 4)Automatic storage for SpO2 and PR value. 11)The device will automatically enter to blank screen state when there is no operation for one minute.
there are MANY sellers, but the pictures narrow it down to only a few models
CMS50D has history logging, the other one does not
simp_ble
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.
Easy_BLE?
(pronounced "simple")
I tend to favor subclassing too
Agreed. Since we don't support "callback" across CircuitPython.
Take care, thank you all.
Thank you all.
π
Take care all! Stay safe and sane!
stopped
strangely it was a shorter meeting today than it has been in the last weeks
π
lol
π ttyl
What is the difference between "packet radio RadioFruit" and LoRa Radio? Like these two products? https://www.adafruit.com/product/3179, and https://www.adafruit.com/product/3177
@timber mango thanks for your feedback and the youtube videos!
Has anyone on here tried Pigweed yet?
I'm posting availability in the newsletter, not tried it out
Maybe more people will know about it by tomorrow
I was wondering what the mention was for - the pw_env_setup is the most exciting thing to me
@lone axle the LORA/RFM9X uses a different transmission mode allowing for longer range -- it is not compatible with the RFM69
Ah Thank you, I missed that the numbers were different 69 vs. 96
you're not the first or last π
@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?
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.
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.
Unfortunately the bootloader's filesystem is fake. When a UF2 is written it goes directly to the internal flash. This isn't possible to do from CircuitPython since it's running from that flash.
Looks like builds with frozen modules are failing. You'll want to use git submodule to fetch tags within them as well.
@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.
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.
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.
@onyx hinge when you have time: https://forums.adafruit.com/viewtopic.php?f=60&t=163745
@ionic elk what sort of things are you managing for different packages? pin availability?
It's really just the pins made available via the microcontroller module
kk
Not exactly a super critical feature, it won't break anything - it was just getting ungainly and was a pretty easy fix
I wish that was part of CMSIS
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
Yeah no such luck with stm32 -___-
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
cool cool, that's the best option now I think
so mapping new chips should be much easier now
(that's not package related though just peripheral mapping)
the rust folks may have something for it already
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
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
there is a separate micropython fork for openmv
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.
I think it's ok to leave but we could add something to it
Maybe This file is a part of CircuityPthon (http://circuitpython.org/), a fork of MicroPython (http://micropython.org/)?
hahahaha
i'm sorry that's mean I don't laugh at you I laugh with you
Are you using CubeMX?
nah, just looked in the datasheet
CubeMX is nice for the clock visualization... it's big and clumsy but the clock diagram is solid
ya, atmel start is nice for that too
but I'd rather having a tool that can create it based on current register state π
github actions is starting to get me down. this was supposed to be simple!
@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.
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?
@onyx hinge persevere!
thanks @raven canopy -- I'll do my best
('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)
Thank you @timber mango
The ItsyBitsy M4 also has a Bluefruit LE SPI Friend connected to it. π
OK, I am going back to not being here. π
@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
looks like brent and @crimson ferry https://github.com/adafruit/nina-fw/commits/master
@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
@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.
Oh I think I lost --tags in that command due to do many quick edits
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.
@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.
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.
@fallen anvil do you know if the RT RTC is actually counting subseconds? I can't find a divisor
@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.:
SAMD51 is much better, and has calibration:
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
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?
Add 8M flash in features description.
This adds support for Litex, along with support for the Fomu FPGA board.
This PR was originally made against https://github.com/tannewt/circuitpython/pull/4
It has since been rebased and updated to work with the version of circuitpython present in this repository.
@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
Ah cool. I'll sort through the currently ones and see if I can get a better idea of what's available.
adafruit usually uses a gigadevice one
@tulip sleet ya, I think I made it more complicated. looks like 32k implicitly means 32.768k
@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.
I think this is correct now, but frustratingly some of the builds spent the night in the "queued" state so we don't have green from CI yet. @dhalbert what would you like me to do?
@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...
Looks like the initial build failure should be addressed by adding a pattern to exclude_patterns in conf.py in the toplevel, this is what sphinx consults.
@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?
Thanks for the changes! @tannewt this looks good to me for now, but pending your feedback I'd like to revisit this nvm sector location stuff as part of the internal flash fixes down the line.
@onyx hinge do you mean you want to use the same bus object (ParallelBus or FourWire) for a second display?
@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
does protomatter need to live across VM instantiations?
displayio does static allocations for that reason, I think, more than anything else.
right
as a Display, yes, it needs to
we want protomatter to be a Display, with all that entails, like showing repl output
https://github.com/adafruit/Adafruit_CircuitPython_Gizmo/blob/master/adafruit_gizmo/tft_gizmo.py#L46 if this code "works" then some part of that must work just fine...
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
here it looks like busio.SPI and displayio.FourWire are both allocated dynamically
i don't know that the Gizmo lives across VM's. It looks like not
is there a way to ask for that?
this is just like any other external display
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
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
no, I just create it from python code, like tft gizmo does its bus
so are there any statically allocated objects in the protomatter C impl
a _protomatter.Protomatter object contains additional pointers to "allocated stuff"
right, but that object is allocated on the heap?
the TFT Gizmo has no static objects that live across VM's
I must not be understanding what you mean by "static"
I mean not allocated on the heap, but existing as a C decl
The protomatter C library has some globals
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
+ 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);
}
it's a cop-out but for now I am deinitializing framebuffer displays when restarting the vm
This allows the auto refresh and console to work, but only until the end of the vm
I think that may just be the usual github flakiness about cancel jobs, since the ones that never started were still in "waiting to start" state. I pushed an update, let's see how it goes.
@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.
@ionic elk Looks like there was a hiccup: https://www.githubstatus.com/
Welcome to GitHub's home for real-time and historical data on system performance.
no wait that was two days ago
@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
@slender iron I remember now that we talked about that
@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?
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...
@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
@tulip sleet ok, I was only really tweaking it out of curiosity during my makefile cleanup
and it might need to be customized for certain things in the STM HAL
btw, smallest flash sector size on the H7 is 128k π¬
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)
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 π
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
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.
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
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
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
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 π€
seems like it's courting trouble to erase part of your program everytime you update nvm
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
non-express boards have been identified as important for the stm port?
The previous run completed, and a re-run jobs button was presented. I've clicked it, and it appears the new checks have started.
π€·ββοΈ 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
@billmoser thanks for your contribution!
@burtyb Thanks for your contribution! It looks like the initial build failure is because you didn't list your new board in build.yml. Check out our guide: https://learn.adafruit.com/how-to-add-a-new-board-to-circuitpython/get-setup-to-add-your-board and let us know if you get stuck.
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 ?
@jepler glad I could help out a little -- I'm really digging circuitpython, so nice to use instead of C :)
This looks good to me! I'm fine with a NVM refactor after this.
I'm going to merge this and will watch the CI. I think it should be fine.
@jepler What did you try when getting it to work across soft resets? Seems like you are close and having it will be useful when we support multiple panels in the future.
You shouldn't use this library for a board that isn't CircuitPlayground. You can add one for your board if you like.
One comment about freezing in the circuitplayground library plus the build fix that Jeff pointed out. Thanks for the PR! Interesting form factor for the board!
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))) {
Thanks for the PR @xobs! Sorry it got lost in my repo. Let me know if you need any help with my requested changes.
We do have macros for linker placement in instruction tightly coupled memory (ITCM) for the iMX RT which runs off external flash. It has a similar problem. You could use that here and it the linker. It'll take up more RAM but then move the core VM mechanics into RAM which is hopefully faster.
https://github.com/adafruit/circuitpython/blob/master/supervisor/linker.h#L35
Please update the include guards to match the path better.
#define MICROPY_INCLUDED_LITEX_TICK_H
Please delete all of the commented out stuff here. We have the STM32 port as a reference and don't need it here.
I think for the litex/fpga port we'll want to have standard pin names for the FPGAs themselves and the SoC gateware will need to tell us how the peripherals are connected to pins.
Did you try moving the three protomatter allocations? If that works, we could add an api or simply go with hacking it.
I'm not sure why I thought I needed that, I've removed it and updated build.yml.
@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
@trim elm Yes.
@trim elm You can add it to your list, yes. Verify with me what labels you intend to add before doing it.
@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
Ok.
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.
@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?
@pastel panther ^^
taking a peek now it seems easy enough
@robust nymph it's something @ivory yew and @fathom trellis have been thinking about
change find_device() a bit with a new flag that skips looking for a device and uses whatever user specified
yeah we have lots of thoughts but some sort of global pandemic is taking up all of our bandwidth. π
@raven canopy Can adabot add issue labels?
current status: https://http.cat/503
I think once my current two CircuitPython projects ship I will have more time to think about libraries. :3
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?
@trim elm yes, actually. i have been thinking about changing the infrastructure check to more of a these-are-missing-add-them function...
@raven canopy Ok, cool.
@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.
@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.
yeah circup is the way to go for now. π
@raven canopy Yeah changing that is fine.
@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
@idle owl π i should have bandwidth this week. its a quick one, and focus has been rough this week on my other projects.
@robust nymph I'm going to make some food but I think I'll take a quick try at it after that though.
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.
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...
@meager fog Are you the maintainer of the documentation Blinka port to the jetson-nano?
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...
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
I found out that https://github.com/adafruit/Adafruit_Python_PlatformDetect calls procfiles
this isn't ideal when working in a container environment where its quite difficult to call virtual filesystems
you can see more details about the problem here: https://forums.developer.nvidia.com/t/using-gpio-from-within-a-docker-container/110260/14
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
This falls under non-issues if you are not considering containerisation for the supported SBCs
sounds like it'd be helpful for you so we should decide there π
alright I'll write an issue now
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
Thanks alot @slender iron! Stay safe and stay healthy
you too! I'm just hanging at home doing my part π
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...
One last thing for now. Just because there are established idioms to handle a lot of things, it does not mean there is no room for a new idiom or idea. Go is not Python. We are using Python, so we must work within its boundaries.
@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.
Ok, I'll check it out shortly. I added a quick uninstall command and made a pull request https://github.com/adafruit/circup/pull/28
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
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.
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
Ah, look at my pull request
so that I can add some logic to pass instead of exit
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.
Ok same here soon. I'll mess with it a bit more.
@lone axle It should not be looking just for drives named CIRCUITPY because that can easily be changed. π
Heads up (cc @gilded cradle ) I just pushed version 0.0.7 of circup (https://github.com/adafruit/circup).
Hope you're all well and staying safe. The UK is in lockdown. Interesting times...
Alright, I've removed all references to "STM32".
I've been playing tricks with the linker script to accomplish the same.
Should I call RAM "ITCM", place all .itcm. sections into SRAM, and modify linker.h to add another exception for litex? I'm not sure if it will be fast enough, but I can try.
I've updated it to generate a "serial number" based on the contents of the VERSION field.
For some reason, Github didn't email me about this today. Bizarre.
I've pushed changes that should address the issues raised here.
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 [36;1mgit submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/*[0m
2020-03-24T18:41:5...
@geekguy-wy you can easily make multiple kinds of exception class names, throwing exceptions on error is the best way to indicate something went wrong and its up to the caller to catch the exception.
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.
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?
@copper crescent can you paste a link to it here?
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.
@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.
Oooh, the --allow-empty is a good trick to keep in mind. I didn't know about that. Thank you Jeff!
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?
@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.
doh, I did it on the wrong one
alright looks like it's trying again now π€
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
@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.
@fallen anvil Could you link to the PR? I can test on a PyPortal for ya.
@onyx hinge not too surprising. datetime is huge. how pared down is the micropython version? could sub-set it...
@lone axle FYI, I have a working requirements.txt install and output for circup here https://github.com/stevenabadie/circup/tree/29 . Still have some cleaning up to do I'll work on later.
@prime flower Its mostly to make sure I'm not breaking anything that's already in use before I move on.
@robust nymph nice! I will tinker around with it some more tonight.
@fallen anvil I've self-requested a review, will test by tomorrow PM on a pyportal titano if thats OK?
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 π
perf, wanted to make sure it wasnt blocking your work
no prob
@fallen anvil are you building a board for this?
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.
neat! do make sure you have access to GPIO0/GPIORX/GPIOTX on the esp32 module
Yup, those were the first ones that went in π
@fallen anvil I can test it on a hw config with separate ESP32, I'll see what I can free up most easily.
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 π )
@onyx hinge @lone axle thanks for the help, the checks look happy now :)
@fallen anvil what's VSPI_READY for?
Is that what's historically been on pin 33? RDY/BSY
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 π
We'll need corresponding changes in ESP32SPI library
My mistake, it's configurable in user code at init.
phew!
But, for example, current code often is esp32_ready = DigitalInOut(board.ESP_BUSY) (e.g., PyPortal)
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 π
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.
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.
Right, I'll keep poking
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.
OK, so in the #else (not optimized), shouldn't VSPI_READY be pin 33?
(but thats exactly why I'd like more eyes on it)
Again, I could be mistaken, I thought The READY was from the CP library, not the NINA firmware... I'll keep digging
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
Right, totally, of course it has to come from NINA
Its very easy to tangle this in your head, especially if you've got an esp32 on both ends...
Fix pushed. Good catch.
thanks @copper crescent !
@slender iron is there a memory allocation function I can call which will work both in normal times and during soft reset?
no, I don't think so
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
flash_ram_cache?
yes
@tidal kiln when you have time: https://forums.adafruit.com/viewtopic.php?f=60&t=163821
It was fixed as 0/0 even though it used to get it from the current
SPI state. This makes it more explicit with kwargs.
Thanks to magpie_lark and kmatocha on the Adafruit Support forum
for finding the issue: https://forums.adafruit.com/viewtopic.php?f=60&t=162515
@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...
@slender iron done
thanks @tidal kiln
π sure, np.
Looks good to me, I remember this issue from the STM32 settings problem where the default was "1" and never overwritten. Nice to see it more explicitly defined here.
<@&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
If anyone has any feedback on adding requirements.txt support to circup, have a prototype to test out. Not sure if going in the right direction on this or not. https://github.com/adafruit/circup/issues/29
Whoohoo! I just put in my first pull request! (It's a minor one, but still) https://github.com/adafruit/Adafruit_CircuitPython_PCT2075/pulls
@vague folio Thank you!
@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. :)
i think C/C++ users agree...the goal of python exceptions is to not let people skip or forget those errors, and to error as soon as possilbe!
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. ...
@vague folio Congrats and thanks!
No problem! I'll contribute when I can.
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.
You can imagine what happens with return self->handle.rxData - data; if rxData = 0.
Hint: Nothing good ;)
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
yikes
Fix looks good, but I can't approve for merge. π
(maybe one day I'll ask for that level of responsibility)
@ivory yew Keep up the reviews and we'll get you hooked up.
oh in that case I'll stop reviewing. π
You can but that wouldn't be very Cash Moneyβ’οΈ of you.
Is there a way to software emulate motor and servo kits?
@ivory yew Na, we got you hooked. π
@ivory yew you'd think
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
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...
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.
@indigo wedge feel free to merge after approval from anyone when reviews even if they can't merge themselves
These boards were somewhat recently added to Blinka, but didn't appear on circuitpython.org yet.
hey folks, this discussion is getting a little off topic for circuitpython. we follow python conventions. some folks like some, some dont. hey, i am not a fan of whitespace-effect :D
This adds a backlight_on_high flag to the Display constructor (defaulting to True) to allow for swapping the polarity of the backlight pin for boards where pulling the backlight pin low turns the display on.
@slender iron see the images i posted above, it must be approved by someone with write rights that's not the author
I feel like this isn't going to work out right now. Someone else is welcome to take up the mantle.
@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
@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.
@idle owl okay I filed a couple of issues, tagged the board contributors and linked to the guide. Thanks!
Automated website update for release 5.1.0-rc.0 by Blinka.
New boards:
- TG-Watch02A
- uartlogger2
@onyx hinge You're welcome, thank you!
@tulip sleet got a sec?
hoping to clean up my include chain and I'm trying to wrap my head around it
@ionic elk sure
amelia ok?
ok
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?
@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
okay, I'll add that to the release notes
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
you mean to thank the PR submitter next to each bullet point?
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
np, it's ok, and you're right about the file deletions
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?
excellent. I checked ulab functionality but nothing ble
no ble changes but .. you never know
@tulip sleet so next steps are - circuitpython.org PR merge, then forum post, then blog?
right, you're doing great :). The blog post will cause twitter posts due to the @ mentions in the blogpost title
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
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
okay, found the instructions to build website locally
If anyone has a moment, please merge this so we don't end up with conflicts if another PR comes in: https://github.com/adafruit/Adafruit_CircuitPython_Bundle/pull/238
@onyx hinge Thank you
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?
looking...
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>'
do you have this when click "POST A TOPIC"?
@tulip sleet nope
ok, i'll give you some more privs, hold on
thanks
@onyx hinge are you a moderator already? can you point me to a sample post of yours?
i need your forum username
@tulip sleet https://forums.adafruit.com/search.php?author_id=243671&sr=posts my username is apparently "jepler"?
Accounts
I don't think I have any special privileges on the forum yet
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?
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.
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
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.
oy, ok, i'll consult
@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.
that sounds like the easiest; we do have forum support people who are using gmail addresses, etc.
i'll just up your forum privs
okay thanks for the advice @idle owl and clicking in the admin interface @tulip sleet !
@tulip sleet do we have a plan for getting the release download counts back into the json for the website?
@onyx hinge try creating a post again
yup, works now. thanks @tulip sleet https://forums.adafruit.com/viewtopic.php?f=60&t=163875
@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
@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
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 ^^
pulls up AWS console
@slender iron Would low_power wakeup from Comparator interrupt be on the horizon?
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 π
@TG-Techie, if you could at least provide a good photo and some information on the board, I could put something together. Thanks.
@NightSkySK, if you could at least provide a good photo and some information on the board, I could put something together, but if you're able to submit a PR, that'd even be better. Thanks.
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.
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.
@onyx hinge Congrats on your first release!
@onyx hinge π
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
@solar whale I saw that recently too
just started building -- seems happy
@spice crypt what would the comparator be checking against? battery voltage?
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)
Usually an internal reference. Can be external or another AIN pin in case of nRF52 series.
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.
In my case a hall effect sensor. When something comes in close contact the system wakes up and does processing. Otherwise it stays dormant
why is a comparator better than an external interrupt?
Thanks @tulip sleet @idle owl @slender iron for the help and for the trust you placed in me to let me make this release
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.
Cool. Maybe I'll give making the comparator a shot as a coding exercise to get familiar with CP.
π the first sleep PR's focus is just getting our time keeping off of systick
Ah. That's a big deal. I saw your comments regarding the RTC resolution.
@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
https://docs.google.com/spreadsheets/d/1FdapBL3wIJf5T_LqwEcglIMMMRelu_9UjnY62IaQBFA/edit?usp=sharing
Create a new spreadsheet and edit with others at the same time -- from your computer, phone or tablet. Get stuff done with or without an internet connection. Use Sheets to edit Excel files. Free from Google.
downloads per day
@slender iron now @faint galleon is talking about circuitpython on the icebreaker bitsy https://www.twitch.tv/esden
π§
π
@slender iron I successfully did some flash surgery today, thanks for the tip!
@ivory yew Don't forget, this stuff is magic too. My first go-to before I whip out the hot-air https://www.amazon.com/ChipQuik-SMD1-Leaded-Temperature-Removal/dp/B07XD9VFSZ
Created locally with this script: https://gist.github.com/tannewt/7e396947ef1b91dd50cd4cab2dac902c
cc @sommersoft
too much effort. π
@slender iron on it
@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...
kk. i'm thinking a match of timestamp + IP should be a good filter.
i did exclude bots
excellent.
my main concern was just getting a gradient between boards
π
not sure the best way to automate it
yeah. its nice that the service is at least available. but it has some barriers.
does the 15-day retention still apply with how justin set it up?
the number of rc.0 downloads does worry me a bit
the files I pulled down went back to 2/28
that seems like a no. π
is the filename convention workable? i vaguely remember seeing an example before, but can't remember it.
what do you mean?
better-worded: are the filenames easily filtered by timescale, etc?
I just ran them all
I did see the naming but don't remember
Reports information on requests to access the server for the buckets that you own.
Discusses enabling Amazon S3 server access logging to track requests for access to your S3 buckets.
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. ```
oh yeah. i remember reading that. but workable with some padding.
@raven canopy What data are you looking at when you refer to requests wrt downloads?
GETs on each file object
Are they all 200s?
tannewt included only 200s, and i would do the same.
Thank you very much. That was fast!
You might want to have a glance at the bytes sent too in case there's anything suspicious there.
Looks great! Excited to get mine. :-)
Sure! That should be fine.
Is this unique for every ICE40 or the same for all? Ideally it'd be different since this is what we use as the USB serial number.
Looks good to me, I remember this issue from an STM32 settings problem where the default was "1" and never overwritten. Nice to see it more explicitly defined here.
What's the sys.maxint story in CircuitPython? I just put 5.0.0 on my Gemma M0 and it's not there.
@ivory yew I'm trying to fix the MIDI library so it doesn't allocate each receive
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...
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
@slender iron smolmidi is very low allocation
why doesn't smolmidi == midi?
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
but why are there two libraries?
because smolmidi is significantly different from Adafruit's MIDI library
I mean if y'all want it by all means.
I just tested this on 5.0.0 on a Gemma M0 (on REPL):
Adafruit CircuitPython 5.0.0 on 2020-03-02; Adafruit Gemma M0 with samd21e18
>>>
>>> neg_int = -1073741823
>>> neg_int -= 1
>>> neg_int
-1073741824
>>> type(neg_int)
>>> assign_test = neg_int
>>> literal_test = -1073741824
OverflowError: long int not supported in this build
looks
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.
@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.
yay! readinto
(the sysex implementation probably needs some optimization, I don't use it for Sol so I haven't really poked at performance yet)
is it in the community bundle?
No, I don't think either of the Winterbloom libraries are.
@lone axle which OS? I think I may have forgot to add return
@robust nymph I am on windows. Very nice work I really like this workflow.
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.
do you still see a need for targeting local directories instead of the board itself?
https://github.com/theacodes/Winterbloom_SmolMIDI, https://github.com/theacodes/Winterbloom_VoltageIO, and https://github.com/theacodes/Winterbloom_AD_DACs are all of them so far.
Maybe it would allow targeting devices too actually.
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
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
>>>
yup, I think because we decided that one of those would be the standard name (can't remember which)
thanks. wanted to verify. me either - remembering which.
probably VOLTAGE_MONITOR since it prints back. the first listed in pins.c is the name we want to print
@lone axle just pushed what I think should fix the extra blank like in requirements.txt issue.
cool, will test now.
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?
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
Ah ok gotcha. I was actually trying to think of best way to deal with versions.
This with requirements.txt checked into the repo is a great solution
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.
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.
Or someway to parse versions of each library from this repo https://github.com/adafruit/Adafruit_CircuitPython_Bundle
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.
I think the github API could be used to find older release pages and pull the asset from there maybe
Did that most recent commit fix the freeze -r output?
yep all good now
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!
Add new board BDMICRO 'Vina M0'.
This board includes the newly added MX25L51245G 64MB SPI flash chip for the CircuitPython file system. Has been extensively tested with CircuitPython and works well.
Thank you for reviewing!
My apologies ... in my initial pull request to add the new board, I neglected to add the board to the workflows/build.yml, and the automated test failed. I made that change in my fork and somehow it magically showed up above. Is that now part of the pull request? Do I need to do anything else to get that change into this pull request?
And how to restart the automated tests?
@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
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.
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.
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.
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.
Hi @bd34n! No problem iterating. The PR will match your master branch. The tests should automatically run. I have a feeling you need to use spaces instead of a tab and then the test will run. (It is highlighted red in the diff on GitHub.)
@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!
@slender iron thanks
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
does this help? https://circuitpython.org/downloads
I am looking for specific microcontrollers supported by the latest micropython release
I am working on my own cicuitPython board
sorry -- you are looking for micropython - not circuitpython?
circuitPython, made a mistake above
Oh -- try lookingat the list of ports https://github.com/adafruit/circuitpython/tree/master/ports
then under each port you can look at "boards'
It is so strange, nothing about the SAMD51s
(I am making my own board, I am not starting from a pre-designed board)
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
I was wondering if I had missed something, absolutely no problem
As for the SAMD21s there are different versions, J, G and E types
yes as for the samd51
I would like to understand how it affects the performance of circuit python
Good luck -- the people who can best help with that are scattered across several timezones π
No problem, I appreciate your help jerryn
you're welcome -- wish I could have helped more
Thank you, @tannewt. I should have realized the tab issue myself. That bites me on a regular basis editing yaml using emacs. And has prompted me to change my .emacs defaults to disable indent with tabs mode.
@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
Choose the "...18..." variants for the most memory; any less won't work
is this documented anywhere?
@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?
is SAMD J, G and E types all supported? I cant find this info concretely anywhere.
yes, we have boards with all
you can grep through the ports/atmel-samd/boards/* files to find the specific chips in use already
I had a look at those, that was useful indeed
do you have a CPy board already?
oh sorry, no I do not
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.
Noted, thank you for the tip.
you'll also probably need a debugging tool like a J-Link
I read you can use OPENOCD + rasPi gpios to flash SAMD chips, I thought I'd give that a go
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
Thank you for your help @tulip sleet
np, feel free to circle back with q's
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
that's probably a nice exact representation, by accident. Have you seen this? https://www.h-schmidt.net/FloatConverter/IEEE754.html . We only have 30 bits for a float, so consider that the lower two bits are zero
Hmm, posisble I'm being fooled by some randomness here too
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)
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'
Will 2MB of flash be enough to store all libs?
@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.
ah of course, makes sense
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)
that's right, we can't execute from the filesystem
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.
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?
samd51 says it has XIP support for QSPI, maybe it could be done
we don't need execute to use the byte codes, but they need to be in addressable memory.
Isn't that what XIP does, makes the content of the flash appear "memory mapped"?
I wrote a bit of code to make dealing with long neopixel strips a bit easier: https://github.com/dastels/circuitpython_neopixel_zones
@onyx hinge I was looking to explain what's going on but it looks a bit "detailed"!
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.
@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.
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
@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.
Thank you @idle owl. Is this a new library or do you have branches?
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.
@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.
Sorry, one more tiny request. Please don't use - in the board name because we use - to separate parts of the filenames. (We already have two that use dashes but I'd prefer not to have more.)
So, please make it bdmicro_vina_m0. Thanks!
@idle owl OK, good. Are you doing your new work on a branch of the library?
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!
@onyx hinge btw, i'd almost forgotten another horrible detail in this world, ```>>> type(1e6)
<class 'float'>
@timber mango yes. PR == branch. there is a link at the top of a PR. https://github.com/rhooper/Adafruit_CircuitPython_LED_Animation/tree/more-magic
@idle owl @slender iron How do I checkout the more-magic branch??
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.
@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
Looks like you are downgrading ulab in this currently. Please make sure you have the commit that matches master's checked out.
@slender iron It says I am in a "detached HEAD" state. <looks in mirror at HEAD>
ya, that's because you don't have a local branch
you only really need one if you are adding your own commits
Oh, OK. I probably do not need that then, unless I find something I can fix.
π
-sigh-
@ionic elk what boards are you testing with for f7/h7?
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
@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?
@tannewt whoops hopefully that's just a submodule update mixup
Overall the package changes look really really good! I added a few comments about other stuff but nothing super major.
I believe you mean to add a board def for the STMH743 NUCLEO not the discovery.
uint8_t periph_index:4; // Index of the peripheral instance (1 to 3)
We'll want to make a pass over the STM port so that we only init the clocks and peripherals we actually use. No need to do it in this PR though.
Please explain how to create the .csv.
Thanks for understanding! Looks good! Merging now.
Excellent, thank you very much, @tannewt !!
@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.
This branch is going back into a heavily unstable state, I'm pushing some clearly not working code as a shortcut to transfer it between a couple of my computers.
@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
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
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
looking...
it doesn't really say anything about it in the HAL documentation either
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.
between the F4 and H7 basically?
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.
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
ugh, that's terrible, why did they use the same name for the routine
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
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
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
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
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?
@tulip sleet I cringed when I saw that! π¬
welcome to my life
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
But the routine doesn't take a uint64_t for the H7? I'm confused
it's uint32_t DataAddress
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
hmmm. This is the Micropython section for the H7 is the thing
it's literally in a ifdef(H743)
i was shouting because it makes me angry
@tulip sleet I had to hide my eyes! π
I wonder if it doesn't work for them
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
I haven't compiled Micropython for the H743, maybe it's based on a super old version of the HAL and they missed it?
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
stm32lib is a separate submodule that may have been updated
@ionic elk this shows that in the original PR (which was not used directly by Damien, but was squashed), the cast was added, but also an arg was changed
https://github.com/micropython/micropython/pull/3639/commits/b3fdea2dbf905550f2f812367619f9abdd0f512a
AHAHA ST CHANGED IT
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
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
who is they?
mystery solved, thanks for your help everybody. Sorry to blind you with the elegant brilliance of STMicroelectronic's APIs
ST. ST changed it
but the mpy maintainers didn't change it, yeah, I guess so
my distress still remains but the code makes more sense
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
yeah, that api was even worse, because in one case the 64 bits was data and the other it was an address
@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?
@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.
@makermelissa I'll gladly try to add it. should i discord you if i have any trouble?
Thanks @TG-Techie. Just reply to this issue if you do.
@ionic elk I guess you figured it out π
right, something like that is better than just calling HardFault_Handler().
it will show a message when it restarts.
weird, https://github.com/adafruit/circuitpython/actions/runs/64924902 shows "100 completed jobs". A lot of actions runs show 100 completed jobs. But it should be about 119, 117 firmwares + 2 other jobs. Is it capped at 100 now?
another project's CI with >100 jobs, reports "100 completed jobs". https://github.com/jazzband/pip-tools/actions/runs/33424837
considers reporting it, but is too tired
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...
@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.
i will take a look, maybe not right away, but thanks!
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
@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)...
@marble hornet It is like that for a reason - to make it as easy as possible to switch to a different screen.
There's nothing that's unique for every ICE40. And we don't burn in serial numbers as part of Fomu.
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
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
...
@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
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
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
@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
at 25C the range is much smaller
so most of that is coming from temperature variation
typical temperature variation of 32.768kHz crystal
That makes sense, even the 25% (the variability in semiconductor processes tends to surprise people who haven't worked with it).
What happens if you plug two in at the same time? I bet the flash part has a unique id you could use. I think that's pretty standard.
@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 ...
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
@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...
I know Micropython has this ability because I have a 16Gb SD card in my PyBoard 1.1.
It would be really nice to be able to use an SD card for the main storage instead of flash or spi flash. This might breathe new life into some M0 boards that are not really usable for Circuitpython right now because there is not enough main storage available after loading Circuitpython.
Hi Brian,
This is going to be extremely useful, providing plenty of cost effective storage. So much better than using an SD card. Thank you!
@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!
I rewrote issue #2738 to make better sense. π π
PGM_LED is on PA28, not PA15.
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?
We don't program a serial number into the flash.
Only the W25Q128 has a serial number, and that was only used on EVT boards. PVT and hacker boards use the AT25SF161, MX25R1635F, or GD25Q16C, none of which have a serial number programmed from the manufacturer.
If you plug two in at the same time, they will both have the same serial number.
I removed the special cases in the linker script, and enabled ITCM mode.
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?
@bitter bronze sure, just flash the circuitpython firmware from circuitpython.org on it
@bitter bronze The main guide for CircuitPython with installation instructions is: https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython
I moved my Express to a second PC and had to redo the install drop to see the CircuitPython drive, is that expected behavior?
@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.
Ok thanks
good morning!
I live a renegade life style of never safely ejecting
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.
@plucky flint Thanks for the update! I hope you are well π
Yup... we're all in lockdown over here in Airstrip 1. π
@plucky flint We need to make a release on circup for it to get pushed to PyPI.
Ahh.... just tell me what to do and I'll do it.