#circuitpython-dev
1 messages Β· Page 332 of 1
a quick glance would be nice and then an approval
I didn't see anything to be concerned abut in the re-organization of _port_interrupt_after_ticks, and at a high level the explanation of the problem makes sense. No testing performed.
Thanks @jepler! I left fsl as-is because it's directly sourced from the sdk.
I'm curious: what's the device-based testing regime like? Is that documented somewhere? I'd like to get into testing stuff like this and would like to leverage any existing work.
And thanks for such a quick turnaround on this!
Please merge in main so the diff here doesn't include the AnalogIn changes.
I'm curious: what's the device-based testing regime like? Is that documented somewhere? I'd like to get into testing stuff like this and would like to leverage any existing work.
I think you are assuming we're more rigorous than we are. I just replicated the problem and then fixed it. I didn't test on other devices. I rely on folks trying their own main builds and the latest from S3 as a way to find other issues.
You can test PR changes by either pulling the PR down and building loc...
Verified on Trinket M0 that #3532 fixes auto-reload.
I tried the latest code on my prerelease UM Feather S2. Autoreload works as I would expect. It starts code.py on power up and then on mount when my Linux OS writes to it.
I'm not sure why Beta 0 didn't do this when it should have. Regardless, it works now.
@slender iron you closed my issue, but I think it's incorrect, sorry.
When I use 4MB flash, it doesn't reload code.py when the OS mounts
It only does it when I use 16MB flash.
so it can't be the correct behaviour
let me try on my saola with 4mb
ok
do you have any samd boards you can compare against?
Yup,doesn;t do it on my CPX or ItsyBitsyM4
and doesn't do it when I flash my FeatherS2 with 4MB
do you have any non-mac devices
And Mark Olsen also sent me a video of it not doing it on his Soala Wrover, on his Mac
this is a super minor issue
Minor for every board not suing 16MB of flash π
running a second time has no consequence
other than more support work for me to explain to people why π
hahaha
I also still get the 5 second boot time.
soala gets < 2seconds
So there is something fishy going on.
it may be due to ram blanking or something
I wonder if it's the macosx writing to the disk a second time when the disk is bigger or something like that
it's going to be an issue when deepsleep is available and folks want to use any boards with large RAM for battery projects.
no idea if there is something like iotop for macs that would let you see writes?
@atomic summit we don't support deep sleep in circuitpython currently
I know... that's why I said "when available"
π
It's a super common use for ESP32 - IoT battery projects
so extra boot time will just drain batteries faster π¦
But I guess that issue is for another day π
@stuck elbow Not sure either.
@slender iron would it make sense to delay autoreload if it has just reloaded/started?
So this is the correct behaviour? Can't be. As it doesn't do it when I use smaller Flash size of 4MB. Only when I use 16MB.
@atomic summit we'll get there eventually
@stuck elbow the current behavior doesn't bother me and I'd worry about ignoring any writes because they could actually be user triggered
Reloading at any point after mount is totally acceptable because the Host OS may choose to write the disk at any point. The smaller flash sizes may be treated differently by the host OS.
If it were a CircuitPython bug I'd expect it to happen regardless of USB being connected.
oh right, you would have to ignore them, not just delay
otherwise you get even longer "boot time"
@atomic summit if you care about battery in your project, you can always disable autoreload in your code
oh wow I didn't realize you had CI produce artifacts for every board for every PR! Go github actions I guess eh? This is much easier than the process I just did. (the standard PR pull, build via cmdline, and fish out firmware.uf2)
@stuck elbow Can auto-reload be changed by the user in code? Or only at the firmware level?
it's runtime setting
in the supervisor module, IIRC
but it would probably have to be done in boot.py to happen before USB gets mounted
Yup! It's nice but a little slow. :-)
hmm, I can't find it now in the docs
supervisor.enable_autoreload() and disable_autoreload
so that goes into boot.py?
but then a user can get their code to reload unless they connect via serial and send a ctrl+d ?
off and on again or reset ...
I guess ultimately no matter if it's a CPY specific issue or something OS level, it's a crappy user experience to have it happen, and also a foreign experience for those already using CPY.
@thorny jay a hard reset is a terrible way to get your code to restart as it forces a disconnect and remount of the USB.
It's fine on a board that doesn't have USB mounting.
If I code, I have Mu and the terminal window is build in.
@atomic summit your code can re-enable autoreload if it determines it doesn't want to go to deep sleep
@atomic summit your code can re-enable autoreload if it determines it doesn't want to go to deep sleep
and if it does go to deep sleep, it restarts anyways
Sure, but again, a totally foreign concept to code for, for those experienced in CPY to have to do.
it is an advanced thing
hahaha... or a "work around" thing π
circuitpython is for beginners first
it's fine if you need a workaround for not being a beginner
Can I unsolder the 16Mb and put a 4Mb? π
Right... so to explain to a new user why bard A does this... but board B does like this.
I will solder a 4Mb(?) on a QT-Py...
Right... so to explain to a new user why bard A does this... but board B does this.
It's magic.
they both do this
Or more specifically, board a,b,c,d,e,f,g,h does it like this... but these few do thinsg differently.
it's just your operating system that decides to do something else with the bigger filesystem
Clock seems to be behaving now, and a simpler βdemonstrate the issueβ program is working fine, so it appears to be resolved and Iβll close this item. Thanks for taking a look!
Did you try the Mac tricks: https://twitter.com/todbot/status/1312632671453863936?s=20
@atomic summit the whole argument is moot, because you don't really care about baterry power when connected to usb anyways
@atomic summit the whole argument is moot, because you don't really care about baterry power when connected to usb anyways
and it doesn't happen when you are not connected
I'm not talking about battery use stuff..
what if I am running code that logs every time it starts up..? I get dbl logs every boot when connected to USB
I thought you were worried that the restart would cause more battery use?
I am... but that's for a later date when deep sleep happens
well, you will get double logs every time you change any file anyways then
for now, it's about "this board does something different to every other board" and that's a bad user experience in my mind.
right, when I am deliberately changing code.. which is different to just plugging it in.
bad/confusing user experience
there is no difference at the block device level, a write is a write
shame you can't send a pull request to Apple to make it stop doing that
Ok, I am now getting it to do the restart code.py even on 4MB flash builds
so it's not 16MB specific
I deleted all of the hidden files macOS adds
and now every plug in, it dbl runs code.py
so it's not a flash size issue
or more specifically a partition size issue
does that trick @thorny jay linked to help?
oh, I missed that link
I'l try a bit later, need to get back to renovating my garage
There are actually two tricks (that might be identical) one from the original tweet and one from Adafruit I linked to.
I have the feeling that I already had double reload, but I cannot tell on what board, with what computer and what version. At one point I felt it was just an anoyance, but could survive that.
at least it doesn't remount on reload, or you would have a loop
but there are some disk checking or antivirus programs that completely waste circuitpy drives
Nowdays I make my own double reload, because I use main.py that import my application. So when I go to another version, it reload (I copy my app), if I import another app, it reload, if I add a library, it reload.
So all in all, it reload a lot.
The waster was an old version of Mu that wanted to install demo image/sound/... that was a nightmare when using non express board.
Ok, so if this is all stuff folks working with CPY on a Mac are used to, then my concerns are moot, and I'll just accept it as expected behaviour and stop annoying folks about it π
I'm still very new to CPY so don't have a lot of my own "use case history" to leverage.
Thanks @thorny jay and @stuck elbow for your insights and to @slender iron for looking into it for me.
I modified one of my esp32s2 boards, removing the 4MB flash and soldering in a 16MB one. No PSRAM. Windows, no reload, Linux, no reload, MAC OS, reload. My code.py is just a routine that cycles a rgb led. Its pretty fast as there is no PSRAM to test but you see the rgb cycle stop then restart.
Yes, bult two versions, and loaded on the same hardware, only diff is the flash chip. And the flash size setting. Its interesting. Super time waster but its pouring rain here today.
time wasters are fun π
The setting in this case is in the boards directory, mpconfigboard.mk
CIRCUITPY_ESP_FLASH_SIZE=16MB
For some reason on MACOS the board is being detected as a keyboard and is being probed? At least the error message comes up that the attached keyboard is unusable.. Doesn't happen with the 4MB flash version.
Hey all, using circuitpython on a QT py with 6.0 beta. I thought displayio was native but I keep getting "Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: no module named 'displayio'"
I believe you need to install the adafruit circuitpython bundle
https://learn.adafruit.com/adafruit-tft-gizmo/circuitpython-displayio-quickstart
Shows you how. Basically copy what you need to the lib folder on the CIRCUITPY drive
Thats not specific to the QT py but should be similar
yeah that's the problem I have the library and I've tried bus_device, display_text, and displayio_ssd1306
displayio itself is a module that comes from core circuitpython C code. It is conditionally enabled in the compilation per-board. SAMD21 / m0 boards frequently have it disabled because the extra bytes it takes to compile into the firmware image is too much.
You can add a flash chip to the QT Py, and use the QT Py Haxpress .UF2
ouch...well that sucks. Thanks for the help though. The chips were out of stock when I bought the qt py. Does the Haxpress have it enabled by default on the firmware?
aaaaaah
maybe I can compile my own firmware and remove some of the other modules I won't use... π€ haven't done that yet
sounds like fun if I can do it lol
running the latest 6.0.0 beta 2, I get an error trying to read the battery voltage internally, as referenced here:
https://learn.adafruit.com/adafruit-feather-sense/pinouts
I should be able to just read pin A6 and multiply it out to convert to a voltage, however.
AttributeError: 'module' object has no attribute 'A6'
when running the following:
import board
import analogio
vbatval = analogio.AnalogIn(board.A6)
Am I missing something painfully obvious?
Adafruit CircuitPython 6.0.0-beta.2 on 2020-10-05; Adafruit Matrix Portal M4 with samd51j19
>>> import board
>>> i2c = board.I2C()
Traceback (most recent call last):
File "", line 1, in
ValueError: MTX_B1 in use
Use board.VOLTAGE_MONITOR instead of board.A6.
ouch...well that sucks. Thanks for the help though. The chips were out of stock when I bought the qt py.
@steady coral Ok, so I have feature request for @river quest that can increase sale. I want to be able to make a basket, put out of stock product in, then get a warning or automate my purchase when all the product I want can be put in the same shipping. I had 4 product I really wanted, but I had to wait weeks before 3 of them became available simultaneously. And this is only possible if once they were available and you could add them to your basquet. Adafruit could figure out... if we produce this piece, then those 10 basquet can be fullfill and we will satisfy those order.
BTW, I did some really quick crude benchmarks for FP. Perhaps this could be enhanced and put into the testing somewhere to check for releases which change performance: Adafruit Forums: Benchmarks for CircuitPython?
artifacts are uploading correctly after this was merged, and the warnings are gone from the overview page.
The setting in this case is in the boards directory, mpconfigboard.mk
CIRCUITPY_ESP_FLASH_SIZE=16MB
@supple gale I am not sure which board you are talking about but I seem to remember seeing 'USB_DEVICES = "CDC,MSC,HID"'' in the Feathers2 mpconfigboard.mk a while back which confused me..
Thank you Jerry! that was it! looking at the code you have linked, both variables board.VOLTAGE_MONITOR, as well as board.BATTERY give the same results.
@blissful palm Its actually a Stetelthings MAIA which is another ESP32-S2 board. No PSRAM. And yes I wondered about the USB_DEVICES and thought it was a copy from the original espressif_saola_1_wrrom/wrover config. But I dont see that there. And searching only see it on two board configs. I will remove it and see if that please MAC OS.
I am guessing that this is some sort of timing difference between the boot. And MAC OS seeing something, checking if its really a keyboard, then code.py reloads (as it should). Not having a USB sniffer and not being anywhere close to my area of expertise I leave it there. I
I have some progress. The above example works perfectly fine, and there is no visible flickering or anything. A version with more pixels lit:
for i in range(16):
buffer[i] = 3
buffer[16+i] = 2
buffer[32+i] = 1
also works perfectly fine. However, if you replace the pass in the while loop with time.sleep(1), you get the flickering. So far so good.
The interesting thing is, you also get the flickering if you use time.monotonic()! That is, somet...
@blissful palm Recompiled without the USB_DEVICES. Still get the double reload on MAC OS.
The time.sleep() and time.monotonic() functions break the timer
interrupt on which PewPew10 display relies, so we can't use them
anymore. Instead I'm adding a time-keeping function to the display
code itself, which then can be used in pew.tick() internally.
This is a proof of concept for the fix. If we agree to it, I will also need to add a corresponding code change to the frozen pew.py library to make use of this function.
this is compile-tested on
- stm32f405 feather
- matrixportal
- nrf52840 feather
but not actually tested-tested.
I built and tested this on Matrix Portal running the Monster eyes project everything is working well. I can test a few other devices as well.
Looks good to me. Thanks!
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.0.0-beta.2-57-g70a94c8d2 on 2020-10-10; Adafruit Matrix Portal M4 with samd51j19
>>> import board
>>> i2c = board.I2C()
>>>
>>> # just for grins...
>>>
>>> i2c.deinit()
>>> import busio
>>> i2c = busio.I2C(board.SCL, board.SDA)
>>> i2c = board.I2C()
>>> i2c
<I2C>
Tested this on Feather M4 with the rainbow 2 line text scroller from here: https://learn.adafruit.com/rgb-led-matrices-matrix-panels-with-circuitpython/example-two-line-colorful-text-scroller and it's working well.
I've been doing a bit more testing and used these steps to clean up the filesystem on the device https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting#macos-loves-to-add-extra-files-2978466-45
And though it didn't stop the code reload, it did reduce the boot time from 5secs to 3secs
I'm a little perplexed as to why the boot time would change with these filesystem changes.
Obviously your MAC is doing things...
As that would suggest the OS is doing something once the USB is brought up during boot that is holding up the boot?
@thorny jay Yeah, sure, but I'm curious why it would hold up the boot process.
I still have 4 weeks to wait before I can help you with the FeatherS2. π
Sorry π¦
post really sucks atm π¦
I also tried removing USB_DEVICES = "CDC,MSC,HID" due to the discussion @supple gale and @blissful palm were having but that make no difference either
This is still on the version from yesterday pre analogin
going to play with that later today
You could also play with remounting the file system as writable from CircuitPython (and that is automatically not from the host): https://learn.adafruit.com/circuitpython-essentials/circuitpython-storage
It is something you put in code.py to be able to log on the flash, that is normally not writable from the CP side.
I am totally unsure this would have any effect on boot time... but it could stop the MAC from beeing able to access in read/write.
Yeah, but that also prevents folks from being able to write to the USB to copy code on without either doing the IO hack, or having them alter the boot.py via code to disable it.
you can boot it in safe mode to disable it
not sure how that's done on the esp, on other devices you just press reset while it's booting
then it doesn't execute your code, so it mounts r/w
also, I don't think it's holding up the boot, it just makes it restart before it finishes booting
This is the boot video. Build from today. It boots very fast, probably because it no PSRAM. You can see the code.py reload. Note it doesnβt reload twice if the Mac is logged off.
I have another noob question. I am trying to modify circuitpython and I am on the right track but is there a way to see prints in a console once it is compiled and installed as the boot loader?
I have largely made changes blindly by reading the code and fixing compilation errors but I need to debug a bit.
sure, there is the mp_printf function you can use
yes
just grep the code for examples...
I am updating a shared module (shared-module/_stage/__init__.c) but it doesn't seem to build my changes when running make. confirmed by adding nonsense to the code and it compiles successfully. Not sure what to do.
Also if there is a place with docs I am happy to read that instead I just didn't find a whole lot on modifying circuitpython itself
I got it
how do we compile the unix port again?
make -C ports/unix -j20
make: Entering directory '/home/ajnin/circuitpython/ports/unix'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
In file included from ../../lib/axtls/ssl/ssl.h:75,
from ../../extmod/modussl_axtls.c:16:
../../lib/axtls/ssl/tls1.h:43:10: fatal error: version.h: No such file or directory
43 | #include "version.h"
| ^~~~~~~~~~~
compilation terminated.
make deplibs && make or so
aha command history says make -C ports/unix deplibs thanks you got me to the right place
import sys
if sys.implementation.name in ('micropython', 'circuitpython'):
# uPy allows normal generators to be awaitables
coroutine = lambda f: f
else:
import types
coroutine = types.coroutine
i can't wait to delete this code from circuitpython tests
Alright I got everything except for the print to work haha.
I am trying to use mp_printf() to print a hex value but it is throwing me errors
error: implicit declaration of function 'mp_print_int'; did you mean 'mp_print_str'?
its a hex value
int16
I tried to look through examples and read the print implementation but didn't quite see a similar case.
paste your line?
mp_printf(c, "YEAHHHH COLOR");
excuse my professionalism
this is also my first dive into C haha
Oh whoops sorry that was when it was mp_print_int from the error
I just tried printf
maybe try something like shared-module/vectorio/Polygon.c does
#define DEBUG_PRINT(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__)
I will do that!
i just wasted 2 hours trying (unsuccessfully!) to get gdb to work with the unix port.
Does someone have it written down somewhere how to do this (or just know gdb well enough to do it and share)?
I can launch micropython from gdb and set b method_name and it'll break there - but list is sorely confused and it doesn't seem to know about local variables.
I still have 4 weeks to wait before I can help you with the FeatherS2. π
@thorny jay Are you in the US? I could send you a pre-release S2. I have an extra.
@wise shard the way you normally use printf, you provide a format string: mp_printf(print, "%d", c)
Until we get to the bottom of the issue, that seems more like a workaround than a fix. But I guess thatβs better than nothing. Also, programs that use time.sleep() themselves would still get the flickering, such as networksetup.py (which, granted, doesnβt run on CircuitPython).
Iβm wondering whether a git bisect would bring some insight, but havenβt spent the effort myself so far.
We do have a reasonable suspicion that it is related to how the RTC timer is used for time keeping on the SAMD21 with the new sleep code. It is a hack that was necessary due to missing features of RTC (and that is why it's fine on SAMD51, say, not that there are any PewPew devices with a LED matrix with SAMD51). I think that this workaround may be a good idea, because it makes PewPew independent of any future changes around timers and sleep modes, and thus one less thing to worry about.
Hey all, just looking to be pointed in the right direction. I am compiling new firmware for the QT Py, so that I can add displayio (it is in the haxpress firmware but not the regular one). I have a list of frozen modules but I do not see one for DisplayIO. Is there another location where I can find something like Adafruit_CircuitPython_Displayio?
Frozen module list:
@steady coral displayio is a built-in module written in C, you would enable it in the makefile for the board you are compiling for
for example, here is how it is enabled for the ugame10 board: https://github.com/adafruit/circuitpython/blob/main/ports/atmel-samd/boards/ugame10/mpconfigboard.mk#L19
do you have an nrf52840 or stm32 you could test with? I expect all the m4 boards to function about the same, but testing these other too would be good. I'll set aside a bit of time on monday for it if you don't have the chance.
@tannewt Thanks for all of the feedback! I added in two methods.
make_transparent which takes in a pixel value to make it transparent.
make_opaque which also takes in a pixel value and will make delete the current ColorConverter's transparent_pixel if it is the same color. I'm not sure this is an appropriate way to do it so I am open to feedback!
I compiled everything and loaded it but I still see the pixels so I am hoping with your expertise you might be able to guide me to what ...
Quick status update: Iteration 3 of the generic movable allocation system, built on top of the existing supervisor heap, works (as far as tested with the terminal tilegrid, more thorough tests still to be done), but adds a fair bit of code. Now working on iteration 4 to see if redesigning the supervisor heap to intrinsically support movable allocations will achieve the same goals with less code.
I hope nobody is waiting for me, cause Iβm having fun down here in this rabbit hole! π
I noticed that the firmware for QT Py (standard version) has USB_MIDI and I wanted to disable this to free up some stuff to add DISPLAYIO, so I tried CIRCUITPY_USB_MIDI = 0 in the mpconfigboard.mk file but the compiler says: undefined reference to `usb_midi_module'
[Makefile:408: build-qtpy_m0/firmware.elf] Error 1
I see what you mean though: firmware.elf.lto.o:(.rodata._usbd_driver+0x54): undefined reference to `midid_init'
I thought I could just disable it with = 0 but it's referenced...
no let me try that
π nice! That worked. I am getting closer, I was able to free up about 5,000 bytes haha...now I need to disable some more stuff so I can fit it on π€£
USB midi, touchio, and USB HID took it from somewhere in the 30,000 overflow to 25,000 overflow
if you don't need analogio, it's rather big
ok thanks for the tip!
The generation of "qstr defs" involves running the C preprocessor on a selection of source files, extracting pattern matches from them, and writing them out into a single output file. Then, a second sequential step reads all that output to produce individual "qstr" files. Especially with a non-lto build on a powerful desktop computer, these sequential steps actually have a pretty large effect on the overall build time.
The improvements came in two discrete steps; refer to the individual ...
I'm trying to test out the 2 line text scroller linked above with Feather nrf52840 but having some trouble. I think it may be unrelated to this PR though. It seems the board pins are different. I'll see if I can get the correct pins worked out.
(though the CI will tell us if I'm wrong)
Hey everyone, can anyone point me to videos/tutorials that would get me started doing what you'all are doing? I have some arduino sensor boards that I'd like to use with circuitpython. I have C#, js and python experience but have been in the enterprise software development world my whole career and never played in the hardware layer.
Also, if there is a better place to post this, my apologies and please point me there, thanks...
I tried to follow the pins from here: https://learn.adafruit.com/rgb-matrix-featherwing/pinouts#nrf52840-featherwing-wiring-3070338-12. My initializer looks like this:
matrix = rgbmatrix.RGBMatrix(
width=64, height=32, bit_depth=4,
rgb_pins=[board.D6, board.A5, board.A1, board.A0, board.A4, board.D11],
addr_pins=[board.D10, board.D5, board.D13, board.D9],
clock_pin=board.D12, latch_pin=board.RX, output_enable_pin=board.TX)
It's not throwing errors any mo...
I see now there is a separate feather wing needed for the nrf feathers, that is the source of my trouble.
I did also built this for stm32f405 and flashed a device with it. No issues that I noticed. But I'm not set up to run the matrix with that feather either.
This change:
- adds await() support as the backing implementation hook for CircuitPython async/await noun/verb pair.
- enables async/await on lots of boards.
- removes all special cases of
if sys.implementation.name in ('micropython', 'circuitpython'):from micropython async tests. These tests now behave like CPython in CircuitPython.
By using __await__() rather than __iter__() (uPython uses iter), CircuitPython is more amenable to library interoperation with CPython. ...
@bitter solar The #help-with-circuitpython channel is a good place to learn. Check out the pinned message there for resources.
Huh, you can't view GitHub actions build logs when not logged in, even for public projects.
Thanks for this, I'm very excited. Particularly I'm happy to see the identical code that can be written in Python3 and in CircuitPython with these changes.
In fact isn't that what this line is doing?
To placate the so-called "pre-commit hook", these added trailing newlines must be deleted.
Would the total number of changes be smaller if you made CIRCUITPY_FULL_BUILD = 0 imply MICROPY_PY_ASYNC_AWAIT = 0?
Thanks @onyx hinge I'll fix it up a little later today. Bad rebase bit me and I was running out the door π
I wonder if I need to update my main to get that pre commit hook. The approval workflow passed on my repo but clearly it is a little different.
Thanks for the testing you could do! I'll run this on some HW I do have, tomorrow.
This decreases the link time, especially on desktop machines with many CPU
cores. However, it does come at a slight cost in binary size, making the flash
section about 200 bytes bigger for circuitplayground_express.
Before, linking build-circuitplayground_express/firmware.elf takes
8.8s elapsed time, leaving 3128 bytes free in flash.
After, linking build-circuitplayground_express/firmware.elf takes 2.8s elapsed
time, leaving 2924 bytes free in flash. (-6 seconds, -204 bytes free)
...
A call to supervisor_start_terminal remained in
common_hal_displayio_display_construct and was copied to other display
_construct functions, even though it was also being done in
displayio_display_core_construct when that was factored out.
Originally, this was harmless, except it created an extra allocation.
When investigating #3482, I found that this bug became harmful,
especially for displays that were created in Python code, because it
caused a supervisor allocation to leak.
I ...
Good morning <@&356864093652516868> -- just a gentle reminder that there is no meeting TODAY as it is Indigenous Peoples' Day (https://en.wikipedia.org/wiki/Indigenous_Peoples'_Day). The meeting will be held TOMORROW at 2PM ET.
?serverinfo
@solar whale argh my error- corrected, thanks
Is there a practical way to isolate/hide the code files that run on CP away from the other files that appear to the user when a board is connected to a PC and shows up as a storage device?
I tested this on the STM32F405 Feather and the nRF52840 Feather. all work fine.
Longshot ask here: Is there an audio library that allows me to turn different notes/frequencies on or off on the fly? Example: Piano consisting of 10 keys, and when a certain key is pressed, play a certain note/frequency. (That part is simple, works well) But if two buttons are pressed, play the two associated frequencies -- and when a button or buttons are pressed, stop playing the associated notes. Would be nice if there was a library to do this, so I don't have to reinvent the wheel. Seems like a common situation, but can't find many resources covering this. (Chords)
@timber mango there is a mixer module that lets you mix several sounds together
It also depends on how you're going to play the sounds. Digitally it's easy to mix two sounds. But if you're using piezo buzzers with PWM (for example), you will need multiple buzzers to play more than one note.
To be clear, I'm looking for generated tones, not samples. And it'll be output from the board straight to headphones.
you can generate samples
And if you're not going to generate samples / digital audio, the solution depends on how you're planning to generate the sounds.
@timber mango Jon Park did a tutorial on making a teletype audio input that did something similar: https://learn.adafruit.com/clue-teletype-transmitter/overview
It doesn't need to be super high quality. It's for a musical trainer, not a performance level project. I'm using Arduino and tone() right now, which is working well, but I'm considering moving over to CircuitPython and looking at audio libraries. Speed is an element, as well, since you want key presses to be non-delayed.
I took a little time to test evezor's canbus featherwing with adafruit's feather stm32f405 express. @teal bear provided me with a free sample.
It works! My test was pretty quick and simple, with the stm32 as the receiver and a prototype Adafruit Feather M4 CAN as the sender.
Suggestions about the featherwing, which you should feel free to take with a grain of salt:
- Offer a 0.1" pitch jumper for the CAN H/L lines
- I do like the pass through connector concept though, I just didn't have the parts on hand to use it
- For better feather compatibility, connect only one "3V" pin not two. A hypothetical future feather might place CAN RX/TX on the same pins but have 3V/Aref pins instead of two 3V pins
- Consider placing RX and TX labels on the silk next to the pins
- I would have preferred a solder jumper to enable the termination resistor
thanks - I'll pass that up the pipe. (it's a very short pipe)
0.1" pitch jumper ... me too :p
@fringe trench Iron control. I don't have a hot air setup here, or flux or solder paste. I'm fairly certain it was a fluke and I couldn't repeat it if I tried. I have another pair to solder up at some point, so we'll see.
crystal ball says: 6 months from now, Kattni is teaching people how to solder.
@idle owl this is my heat gun plan, but I have yet to activate it. https://www.sparkfun.com/products/10326
@fringe trench I believe it is a better way to do it as long as it's capable of the right temperatures.
Hi All - I'm curious if anyone has done any development to support the parallel capture controller I/O on the SAMD. I did a little bit of sleuthing around here first, but most of the references go back a year or two. I found a brief reference by @meager fog from 2018 that there might be some code lurking around out there.
Anyone familiar with this interface? Or more specifically, how to take advantage of it from the SAMD?
@old smelt We don't have CircuitPython code for it, only Arduino. https://learn.adafruit.com/adafruit-ov7670-camera-library-samd51
@idle owl - that is a start. Thanks! I'll check it out.
But I cannot stop staring at that picture. Must...look...away...
@slender iron it seems like PR #3426 is causing double auto-reload of code.py
is it something to do with how the host os treats large partitions ?
A curious error on two builds:
/usr/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /tmp/firmware.elf.uSD8rO.ltrans66.ltrans.o: in function `common_hal_mcu_pin_is_free':
<artificial>:(.text.common_hal_mcu_pin_is_free+0x30): undefined reference to `pin_PA30'
I'll investigate.
+++ b/ports/atmel-samd/common-hal/microcontroller/Pin.c
@@ -223,9 +223,11 @@ bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t* pin) {
#ifdef MICROPY_HW_NEOPIXEL
if (pin == MICROPY_HW_NEOPIXEL) {
// Special case for Metro M0 where the NeoPixel is also SWCLK
+#ifndef IGNORE_PIN_PA30
if (MICROPY_HW_NEOPIXEL == &pin_PA30 && DSU->STATUSB.bit.DBGPRES == 1) {
return false;
}
+#endif
return !neopixel_in_use;
}
#endif
``` @slender iron any idea how it's getting by without the "ignore" check? It started breaking in my PR which changes LTO linking ..
is it something to do with how the host os treats large partitions ?
@analog bridge That's my assumption. That PR just makes everything the actual size it should be. I know there is a point where FAT12 becomes FAT16 but I'm not sure what the boundary is. @tulip sleet would remember
@onyx hinge not sure. does ignore actually not declare the object or just omit it from the microcontroller pin table
@analog bridge @slender iron 16MB is the normal transition from FAT12 to FAT16 (it actually depends on number of clusters, so it could be different the clusters are not 512 bytes, but they usually are)
hrm, and the 16MB storage will use the first few MB for circuitpython code and not the FS
so the FS won't hit 16MB
If the display is paused, _PM_swapbuffer_maybe will never return. So, when brightness is 0, refresh does nothing. This makes it necessary to update the display when unpausing.
Closes: #3524
i believe its 2MB. 4086 clusters
MIN_FAT16 is 4086, anything below that is FAT12.
fmt = FS_FAT12;
if (nclst >= MIN_FAT16) fmt = FS_FAT16;
if (nclst >= MIN_FAT32) fmt = FS_FAT32;
ah! and I think the partition on the 4MB version is just under 2
seems to be 1MB on mine. (4MB flash). On the 16MB I get a 12MB CIRCUITPY drive. fwiw.
π
@slender iron Have a minute for a question?
yup!
Excellent. In the meeting when Limor suggested including an example for the LED Animation library that resets the board on M0 if time.monotonic() is over 100k, you seemed like you were going to say something, and then didn't. Did you have another suggestion or some input on that?
ha ha, ya. I was thinking ahead about whether we want to reset the internal clock on reset
Ahh ok.
So not really related to the example then, it would be behind the scenes things?
I think we'll want to remember the start up time and subtract it out from the internal clock
yup
Fair enough. As long as I have you here, I don't know what code is needed to reset the board. Is it microcontroller.reset or something?
yup, I think it's that exactly
I could be wrong π
I'll find out!
np
It reset doing that from the REPL, so I suppose that's right π
And the code works. Hurrah.
π
@slender iron She said 100k when she mentioned it, but I'm looking at a print of time.monotonic() and it only has 5 digits printed. So I would assume that the timing precision would be lost over 1000.0 or at the top end 10000... am I misunderstanding this?
it's not as clear as a decimal value because it depends on bits
hmm alright
True that. I'll ping him. Thanks!
np
@tulip sleet See above. I'm looking to avoid the loss of timing precision for LED Animations. On the M0, right now, if you let it run long enough, they slow down because of loss of precision in time.monotonic(). I'm writing the code that resets the board before that happens, but wanted to know what to set it to. Limor said 100k, but that doesn't jive with the printout I'm getting in the serial console for monotonic().
The code works, but I need to know a good number to set if time.monotonic() > foo:
@supple gale @slender iron @analog bridge This is the definitive FAT documentation (it's more than FAT32, despite the title). See in particular page 14: "Fat Type Determination": http://download.microsoft.com/download/0/8/4/084c452b-b772-4fe5-89bb-a0cbf082286a/fatgen103.doc
@idle owl I think I figured out the boundary for loss of precision in an issue. Let me look...
@tulip sleet Thanks!
@idle owl https://github.com/adafruit/circuitpython/issues/342#issuecomment-337228427. time.monotonic() starts to lose precision at 2**22, which is only about 1.165 hours. So I'd say reset (microcontroller.reset()) once you reach an hour (3600 seconds).
@tulip sleet Perfect, thank you so much!
an hour is easy to remember and understand
Indeed it is
At 1.165 hours it would start losing the ability to count each single millisecond, though probably the times LED animations deal with are probably bigger, like 10ms or 100ms aren't they?
@tulip sleet I'm writing an FAQ for the LED Animation guide that explains the slow-down on M0, and includes this example. May I run it by you once I'm done to make sure I explain it right? I can't copy what you wrote it's WAY more detail than this needs. In fact, reading what you wrote, I may need your input before I write it.
sure
(not that resetting hourly is bad or would usually represent a problem)
well, we could say about an hour per msec, but once an hour is an easy rule of thumb, and probably wouldn't disturb anyone
Thanks. Ok, so basically, on the M0, time.monotonic() is only capable of a certain number of digits, so the precision of the float decreases over time. After a particular amount of time, it's no longer a float, meaning.... ok I'm lost here on how to explain this I think.
How would you explain this to a newbie? Someone running LED Animations on their CPX, and the comet slows down if they leave it running too long.
it's still a float, but it loses accuracy
actually it's not an hour per msec, since the loss doubles about every hours
it would be like a clock that ticked only every 2 secs instead of every second after it ran for a while, then after another hour it would only tick every 4 seconds. So the loss in accuracy is the smallest interval we can measure. That interval goes above 1msec after about an hour.
Ahhhhh
i am wrong about doubling every hour, that's not true. The internal tick count is still accurate, but when it gets converted to a float we lose precision. That is, there is an internal tick count that's still accurate, but there's no way to pass that value to the Python code.
Fair enough
Another example (not a float), is suppose you could only represent a monetary value as, say 4, significant digits. You could represent $99.99 exactly, but once you get to $100 you have to start quoting the value in tens of cents, not exact cents. But that's probably too stretched of an analogy
Hmm, not such a stretch maybe.
I liked the clock one but it doesn't cover the digits issue.
I saw this "convert a PR into a release note" github action and thought you might find it interesting with sooo many changes going on.
https://github.com/tiangolo/latest-changes
@idle wharf My ideal would be that it modifies a draft release, not a committed file.
That one just popped up on twitter for some reason, but If I stumble into that one specifically... I'll let you know. π
Sounds good @cwalther. Don't lose sight of how much added code is too much. Running the CI will build all the boards and tell you if any are out of space.
@tulip sleet Ok here's my attempt at explaining it: https://learn.adafruit.com/circuitpython-led-animations/faqs#on-the-samd21-why-does-my-animation-slow-down-if-i-leave-it-running-for-a-while-3074335-3 I have a PR in for the example I wrote to include in the FAQ, so the example is currently missing.
I explained time.monotonic() in my Hacking Ikea Lamps guide, so I linked to it instead of going into it much in the FAQ.
Thanks for the fix! I wonder if @PaintYourDragon should add brightness support when adding gamma correction. It makes sense to do those both at the same time.
@idle owl it's not that the clock is inaccurate, but that it ticks less often. So instead of seeing the second hand tick every second, jumping from one second to the next, it just jumps in two-second intervals, then four, etc. Also, I am confused: is this SAMD21 specific? I thought is was just on builds that don't have longints. I thought if the build supported monotonic_ns() (like, say, Metro M0), then you don't have this problem.
it is true on non-express builds on M0 boards
trinket M0, Gemma M0, PyQT without external flash
more specifically, any board that doesn't implement monotonic_ns()
but non-express is easy
refresh it
so it's not as if time slowed down, it's just that the clock is less accurate. For instance, if you were trying to see how long something took (like, say measuring your pulse), and the seconds jumped betwee 0,4,8, etc. you would get pretty frustrated.
Ah alright
"on a SAMD21..."
good catch
Very cool! Thank you for all of this work.
Have you thought about what hardware and library APIs could benefit from this?
"slow down" isn't the right wrods. "jerky" or rough is better..
@tulip sleet Alright refresh again.
the second hand jumps two seconds at a time, then later four seconds, etx.
that's good! looks quite clear to me
Excellent! Thank you so much for your help!
yw!
If anyone has a moment: https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation/pull/68
It's for a QT Py guide (and the FAQ), but I figured it was good to have a few examples that run on M0 in the library so I put them there instead of the Learn repo. Also, easier to maintain.
why don't you say "after about an hour has passed" instead of "a certain amount of time". That motivates the 3600 seconds.
or after about 70 minutes (1.165 hours is 69:54, according to alexa)
i just got an echo show and am using voice to compensate for bad elbow
We have one of those. Have fun with her hearing you when you didn't mean for her to, and mishearing you when you need her to. π
i was wrong that it only takes an hour to go from two to four seconds. It takes about one hour to go from one to two, then about two hours to go from two to four, etc.
Also use headphones in meetings and during AAE. Phil cares not a bit about using her name.
i have been disabling it at times π
@tulip sleet I updated the clock bit to say "after another two hours"
ok, excellent: clear explanation for a confusing concept π
Great! We did it! π
Can you take a look at my LED Animation PR? It's only added examples.
I compiled everything and loaded it but I still see the pixels so I am hoping with your expertise you might be able to guide me to what the next step should be. smile I spent the better part of yesterday trying to figure out why but alas I was not able to.
Hrm, I thought it might be an issue with what calls the ColorConverter but the code looks right: https://github.com/adafruit/circuitpython/blob/main/shared-module/displayio/TileGrid.c#L439-L450
The next step I'd do is print out the ...
The color is a simple value without it's own memory so don't call m_del on it. Instead, you'll either want a sentinel value that means the color is invalid, such as 0x1000000, which is higher than 24 bits of color. Or, you can use a separate boolean to track when the color is valid.
I think you'll want to raise an exception (mp_raise...) here if the given color doesn't match the existing one.
Raise an exception here if one color has already been marked as transparent.
I don't want to leave the FAQ hanging long without the example since the page is already live.
Thank you!
off to π₯
Oh right. Dinner. Oi... lost track of time!
@idle owl just was lurking and read your FAQ entry and it reads and makes perfect sense to me the way you described it
@blissful pollen Thank you so much!
This looks good to me!
In my ninja branch I had started splitting this processing at the build level so that this step would be done on changed files only. Obviously, that is a larger change than this one. :-)
@idle owl I also looked at the PR (not really used to doing reviews yet!) I don't have the express or haxpress to actually try it but the examples all look good from all my time in this library before. Do I just put a comment in there to say such?
I don't think so? I've left a couple comments but that's it
Let us know if you'd like to be able to merge PRs following review and we can add you to the CircuitPythonLibrarians group on GitHub. You'd be official! π
You're also welcome to comment a few more times to get the hang of it, if you'd rather.
Simply let us know!
You can add me when you have a moment, as you said I'll probably just comment a few times to make sure I understand things first so I don't merge something I shouldn't
Great! I'll do that tonight or tomorrow. That's perfect. The Git and GitHub guide also has a page on reviewing.
Thanks (yeah I realized I just commented on a merge request, hadn't refreshed it before oops!)
There's always this one π https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation/pull/69
Very cool! Thank you for all of this work.
Have you thought about what hardware and library APIs could benefit from this?
Yes, I can't wait wait to make a context manager for communication resources, e.g., SPI.
Devices like BME680 take wall clock time to generate their results. I want to see library developers produce APIs that accept a context manager that provides access to a bus object. That context manager would bundle a chip select pin and the SPI bus together ...
Thank you!
No problem, that was an easy one π
I suspect this is the issue: https://github.com/adafruit/circuitpython/blob/main/supervisor/shared/tick.c#L128-L130 It turns off interrupts at a fairly high level. You can comment these interrupt things out temporarily to test. We'll want to push them lower into the critical section of the RTC read instead of here.
This code was there before but I suspect reading SysTick is much faster than reading the RTC.
I replied on the issue. I suspect we won't need this.
wow @slender iron thank you for all the merges
π I backlog the CI
Hey @slender iron I'm sure you are aware that change turns on the async/await syntax for CircuitPython.
It's a fairly big addition - thanks for taking it. I hope this greatly expands CircuitPython applicability with the top tier hardware support y'all have created and now an available asynchronous programming paradigm that tries to be faithful to CPython.
I believe it's non-intrusive to users who want to use CircuitPython as they always have and I hope it's useful to others (besides me)!
haha, that's the smallest big change I've seen π
I appreciate your persistence with it. I'm happy to see us match CPython
Big implications for the questions you will get in this channel though π¬
you are the person who added it π
hopefully matching CPython will lead to fewer gotchas and questions
Yeah, I'd like to consider any functional difference as a bug. It should work the same way. There is a lot of surface area though and people are creative. Should be good fun though. Feel free to @ me :-p
π thanks!
I don't plan on teaching people how to use it so they'll be on their own. I'd be happy to promote any tutorials or libraries you create though.
Sweet! I'll make a context manager for busio when I get a chance. A tutorial would be a good thing to do as well yes.
π I'm open to native async aware hardware apis too
they'd just live alongside the existing ones
k, walk time before the sun goes down
OK, we had #3542 go in. @cwalther shouldn't that fix the only problem we've identified that prevented us from merging this PR before now?
@onyx hinge "I will make those other changes to the next revision. Be sure to thank Jeff for me " -- Andrew
Cool, thanks Andrew, @teal bear
@slender iron TRANSPARENCY WORKED. I was passing in the wrong value haha. I changed it to the decimal representation and everything came together nicely. π I will add in your feedback now!
Thanks for the direction!
@onyx hinge Hey Jeff, working with @teal bear and @north path on the Evezor project. Thanks for your feedback on the Can Featherwing, we appreciate it!
I was actually copying some value that was being set as .pixel but I think the entire value was truncating or something
it was 8184
hrm, glad you sorted it out
hey @slender iron do you know how often pidcodes goes through their PRs?
Thanks again!
or how long it roughly takes?
@ornate breach they haven't recently that I know of. I intend on merging into my aggregate PR every so often though
I need to
gotcha. I'm hoping they get it done before I launch my board
still have over a month but some PRs have been sitting for a while
Maybe I just need to fork over the 6K to get a VID hehe..
I'll try and merge them into the aggregate tonight
okay, do I need the PID verified before doing a PR on the CP repo?
I'll be doing that in like... the next few weeks (hopefully) to add my board.
no, I'll accept them if they are in my aggregate branch
I've gotten a couple of emails from the guy who does it. I'll poke them again.
Okay cool
I'm pretty excited. I've got my DAP rig all ready to hopefully DAP my board tomorrow π
feather m4 express + adafruit SD breakout, some headers setup for contact. bin loaded on the SD card and verified that the feather sees the card.
I turn off the shadow registers because 1) reading the SSR doesn't actually lock the other two (see the errata) and 2) the fallback is to read twice anyway. So, I might as well just read them twice because it'll be faster than waiting for the sync flag.
Fixes #3376
nice!
can't wait to get this board out to the masses. Also really loving the Qt Py
i've made 3 tutorials on my company blog so far
all CP based. Really getting to love CP

it's surprising how much simpler it is to do basic interrupts in CP than it is in C
debouncing is about the same complexity (throw a delay in there)
Anyway, thanks for your help!
Still haven't forgot about the Lattice Tree feather wing. Just haven't quite figured out programming it quite yet hehe..
Specifically, see 2.2.3 in https://www.st.com/resource/en/errata_sheet/dm00037591-stm32f405-407xx-and-stm32f415-417xx-device-limitations-stmicroelectronics.pdf
This fix makes sense to me especially in light of the erratum. Assuming the test case originally supplied passes now (the one that sees time.monotonic going backwards), fine to merge. Thanks!
@tannewt Thanks for the review!! I am so close to finishing this up but alas I ran into an error when adding the exceptions.
I keep running into:
../../shared-module/displayio/ColorConverter.c: In function 'common_hal_displayio_colorconverter_make_transparent':
../../shared-module/displayio/ColorConverter.c:133:9: error: implicit declaration of function 'mp_raise_RuntimeError' [-Werror=implicit-function-declaration]
133 | mp_raise_RuntimeError(translate("transparent_c...
@wise shard "implicit declaration" usually means you need to add an #include at the top
thanks!
np, will do a full review tomorrow
Fixes #3504 hopefully.
cc @deshipu and @cwalther
async/await keyword support has been accepted into CircuitPython as of https://github.com/adafruit/circuitpython/pull/3540
There is currently no native scheduler implementation or interrupt-scheduled coroutines (yet!) but as @dhalbert mentioned back in August simple time-based pure-python async scheduling has been demonstrated on CircuitPython; also it's easy to reproduce from scratch (and completely understand) with not much more than following along with the good Mister Beazley https://w...
oh no
CircuitPython for new micro:bit π€π€
as usual they picked an outdated and weak mcu
Itβs a CLUE with half the RAM as near as I can tell?
nRF52833 vs nRF52840 - really brings it out of the customised-interpreter-nightmare purgatory the original ended up in
Running the following code will set custom hostname of wifi interface.
import wifi
wifi.radio.set_hostname("custom-hostname")
@hybrid scarab I think nrf52833 is technically supported in CircuitPython, the pca10100 and simmel seem to have it. You won't get all the capabilities of an 840 though. "Built-in modules available: _bleio, analogio, audiobusio, audiocore, audiomixer, audiopwmio, board, busio, digitalio, gamepad, math, microcontroller, os, pulseio, pwmio, random, rtc, storage, struct, supervisor, time, usb_hid, usb_midi, watchdog" https://circuitpython.org/board/pca10100/
pull requests welcome to add microbit v2!
@onyx hinge ooo! nice
Hello There!
I am trying to make a custom board for CircuitPython my design is based around the feather M0 (Pin configurations). i have done with the hardware testing and everything is working as it should be. except for the SPI flash (which uses the same pins as ITSYBITSY M0 Express.
I have tested the board using no SPI flash configuration and the CIRCUITPY device shows up on my win 10 and Mac, but when configuration the CircuitPython firmware to use external flash the drive won't sho...
one more thing...
Using the example flash_info from Adafruit_SPIFlash give this results in the serial monitor
Unknown flash device 0xC22815 (i have googled and found out that this is the correct value for my SPI flash)
Adafruit Serial Flash Info example
JEDEC ID: FFFFFF
Flash size: 0
I can take a run at fixing this, but looking over it I am a bit concerned about the mimxrt10xx port fix. Currently the other ports define and use CIRCUITPY_FULL_BUILD = 0 (or 1) and that is used to set other values such as MICROPY_CPYTHON_COMPAT.
The mimxrt10xx does not set full build, so it defaults elsewhere to being defined to 1. If we set ORDEREDDICT = CIRCUITPY_FULL_BUILD it will include this feature for that port when it should not. If we define CIRCUITPY_FULL_BUILD to 0 the...
@blissful pollen I've invited you to join the CircuitPythonLibrarians team on GitHub.
@blissful pollen You now have merge/write access to 280+ repositories on the Adafruit GitHub. Use your powers wisely! π
@idle owl MUHAHA π thanks!
You can ALWAYS ask us questions before doing anything, never hesitate to do so, we're always happy to answer questions.
For sure!
So if you're unsure, ask. No worries.
Otherwise, remain positive and supportive, and test things before merging if possible or necessary. E.g., keep doing what you're doing. π
Sounds good, yeah last thing I want to be is the person who breaks the build
It'll happen! We've all broken something at some point. But we learn from it and pass that on and it happens less and less, obviously.
I am not sure why I got this single failure. π
https://github.com/adafruit/circuitpython/pull/3529/checks?check_run_id=1245283514
<@&356864093652516868> Hi all -- the weekly discord meeting is in about 90 minutes. Please take the time to add your notes to the document https://docs.google.com/document/d/1OiVJFRT-x4RwJv98aJRrXWwUi1p77obFGyLtlMalWFI/edit -- it's super helpful. If you don't have a mic or prefer not to speak for any reason, just note that and I'll read your notes aloud. If you don't have time to add your notes, but plan to speak during Hug Reports or Status Updates, either add your name or let me know so I can add it. Otherwise, I'll assume you're lurking (which is just fine!) If it's your first time speaking in the meeting, make sure we've added you to the Circuitpythonistas role. I'm looking forward to catching up with everyone! (Now's a good time to add your In The Weeds topics too)
Not sure if I will be ready for the meeting... I am warming up my soldering iron to hax a QT-Py and to make my Matrix Portal M4 by 64x64 compatible. And then some friend ask me if I will watch some apple live event. Not to mention that I have a work meeting to also prepare.
I just tested it with PewPew10 and it seems to fix the issue #3504, there is no flickering visible anymore.
Hey guys, I published a guide on how to install CircuitPython on the Seeeduino Xiao board. I would love to hear your feedback https://www.youtube.com/watch?v=1GKF9u7pVgs
Dear friends welcome to another tutorial. Today I am going to show how to install CircuitPython on the Seeeduino Xiao board! Yes, believe it or not, we can program this tiny board using Python, a staggering achievement of engineering. Subscribe for weekly videos βΆ https://bit...
@wispy badger thanks for sharing! did you submit it to the python on hardware newsletter too? If not, hint-hint π
@onyx hinge no I didn't. I am new here. How to do it?
Adafruit publishes a weekly newsletter and community based activity is really the core of it. You can email anne AT adafruit.com, or twitter @anne_engineer #circuitpython-dev or send us pull-request against the current draft on github https://github.com/adafruit/circuitpython-weekly-newsletter/
Cool stuff! I need to subscribe to that newsletter!
It has a readership list of several thousand last time I heard, so it can be a great way to get eyes on your python on hardware project. And by the way, welcome to the community!
Thank Jeff! It is nice to meet you and your lovely community.
Your name seems familiar to me, so I jumped to the conclusion that you were not new. π
I just found out about CircuitPython and I love it!
pull requests welcome to add microbit v2!
@onyx hinge I don't think it has native USB connected directly unfortunately. It got me thinking about code editing over BLE again
Tested on the SAMD21 boards; Pulsein works fine and didn't see any other issues. I tested without setting RTC_READREQ_RREQ in rtc_set_continuous(), and it looks like it works fine without that bit set.
@onyx hinge I tried to send an email to anne AT adafruit.com but it is not a valid email
I think it's anneb@
@wispy badger my mistake, tannewt had it right
thanks guys!
If you can provide some guidance on how/where this needs to be done, I'll be happy to try.
Assuming the test case originally supplied passes now (the one that sees time.monotonic going backwards), fine to merge.
Yup! I ran it for a while with no issues.
Tested on the SAMD21 boards; Pulsein works fine and didn't see any other issues. I tested without setting RTC_READREQ_RREQ in rtc_set_continuous(), and it looks like it works fine without that bit set.
I just tested it with PewPew10 and it seems to fix the issue #3504, there is no flickering visible anymore.
@microDev1 Looks like you're using the Config instead of falling back to the USB Device name. Do I have that correct? Will https://github.com/adafruit/circuitpython/pull/3530 still be needed?
hey all, lmk if you have any thoughts about what a pleasant way of setting entries in a look up table in python should work. Size is limited to 8 entries and map a temperature to a fan speed. Current default plan is to make it work similar to a dictionary but π€·
should the temp entries be sorted?
@slender iron I just tried to build and test CP with your STM RTC fix in it. I wanted to try SH1107 I2C, but the build seems to not include the SH1107 quirk? I'm probably missing something obvious but I'm getting the "extra keyword arguments" error from my SH1107 driver with this build.
@grim dagger are you on my branch?
I think it's based on the latest so it should have it
@slender iron yes they should be sorted
I'm on master. Wasn't sure about master or main. I have sync'd to the latest adafruit stuff and sync'd submodules. Your fix is already merged so I thought this would work.
main
Argh
or at least that's how they'd be used. There are 8 lut slots and the sensor expects each to be greater than the last
@pastel panther are the temps fixed? if not I think a dict with a size limit makes sense
@slender iron The number of lut entries is fixed, is that what you mean?
I agree that it's not dictionary-ish
I was wondering if the temp thresholds are fixed
Can't seem to build main:
Switched to branch 'main'
Your branch is up to date with 'origin/main'.
mark@mark-ubuntu-8460p:~/circuitpython$ cd ports
mark@mark-ubuntu-8460p:~/circuitpython/ports$ cd stm
mark@mark-ubuntu-8460p:~/circuitpython/ports/stm$ make V=1 BOARD=feather_stm32f405_express
make: *** No rule to make target 'lib/protomatter/src/core.c', needed by 'build-feather_stm32f405_express/genhdr/qstr.split'. Stop.
mark@mark-ubuntu-8460p:~/circuitpython/ports/stm$
@grim dagger make sure all of your submodules are up to date (I suspect protomatter isn't)
no, the temp thresholds in the lut are not fixed, you can update them
I'll be in the voice channel if anyone wants to do a mic check. See you in about 14 minutes for the meeting.
kk, I think a dictionary-like object with a limit of 8 entries is fine
you can handle the ordering internally
ya
@grim dagger make sure all of your submodules are up to date (I suspect protomatter isn't)
@slender iron is "git submodule sync" not enough?
sync only sync the url source
you also want git submodule update
git status should show a change
before you update
I'm thinking I'll raise an IndexError if they try to set a 9th and instruct them to update or remove an existing entry
@lone axle are you able to paste links today, especially during the news section?
yes git status was trying to tell me. sorry... have never worked with a project that has submodules before!
np π it's a common cause for confusion
@onyx hinge yep, will do.
I don't think we want to increase the binary size at all. #3529 is currently failing due to running out of space on the French translation for the metro_m0_express.
Good afternoon all you wonderful folks -- happily lurking (notes doc updated) π
Ahhh so that is why it failed. Ran out of memory. That is kinda scary
@wise shard it's a reality of the samd21 builds
TIL! I am happy to close my PR and just have that custom code in my personal build if needed
Not sure how much people need this feature π€£
no, we can make room π
lurking
The game of life has gone through several generations with the STM RTC fix. Much much further than I've ever seen before. This fix seems to fix the I2C issues I've been seeing.
Thanks
lurking
Totally lurking... still editing my notes.
@uncut nexus Are you lurking or participating?
late and lurking
Gremlins are abound today.
lurking - I put it in the hug reports notes
@uncut nexus I see that now! Thank you!
π©οΈ
No worries! Do it up.
π§
We've all been there. Just the other day, I had a very important zoom that was disconnected due to a Windows 10 update. Yeah, I had the update settings to delay until after hours. No, that wasn't respected.
We hear ya Jeff
Take this survey powered by surveymonkey.com. Create your own surveys for free.
On Oct 9 @adafruit tweeted: "Raspberry Pi Halloween Effects Door β ak.." - read what others are saying and join the conversation.
(lurking)
Unfortunately, it doesn't look like that flash is actually used by any boards. It's hard to say it will work if it isn't used.
It should be usable with a corrected config. I find the best way to debug new flash is by sniffing the SPI lines with a logic analyzer and/or setting a breakpoint, via a debugger, here: https://github.com/adafruit/circuitpython/blob/main/supervisor/shared/external_flash/external_flash.c#L224
hey i made a blockchain in python that uses python as the smartcontract language
and ive been a maker since make volume 4
i want to partner with circuitpython somehow... idk how but maybe some sort of hardware iot blockchain thing?
circuitpython is open source software so you are free to use and extend it
well sure but i want to get more involved with the community somehow
just saying 'go play with it' isnt really as fun as working with people
Thanks for having me too! And you are welcome
Indeed, thanks Kattni π The more, the merrier!
@carmine mesa we're doing a community meeting atm in the circuitpython voice channel
ok ill join and listen
π welcome!
I was in the middle of editing the Hug report... and browser freeze. I hope the content was consistent.
maybe i can explain my project? its pretty cool and deep into the python internals
@wise shard you just missed two hug reports for you π
notes doc is here: https://docs.google.com/document/d/1OiVJFRT-x4RwJv98aJRrXWwUi1p77obFGyLtlMalWFI/edit#
CircuitPython Weekly for 13 October 2020 Video is available here on YouTube. Join here for the chat all week: http://adafru.it/discord The CircuitPython Weekly happens normally at 2pm ET/11am PT on Mondays. Check the #circuitpython channel on Discord for notices of cha...
@carmine mesa you can take a couple minutes during status updates to talk about it or wait to in the weeds
the weeds is probably better
cool lets do that
will add you to circuitpythonistas so you can speak
thanks!
@carmine mesa please mute until the weeds
np
Yeah @idle owl I have seen you PR for LED animation on M0. Great that reset after one hour to keep monotonic_ns precise. Dunno where it is published, but since I lurk on the learn guide repo...
@thorny jay Published it to the LED Animation library. It's in the examples.
These are the API docs where I would start: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/protocols/esp_crt_bundle.html
@brentru might have experience with it for nina.
Have to go to another meeting :-(. Have a good week, all! π
Later @solar whale!
thanks @solar whale!
This isn't the keyboard you're looking for. π
Or marketting for S2 getting out of beta or ???
I take a 4 day week-end, so I might look at that fest thing.
We could use the register lib I assume?
FAT code in Python. π
thanks everyone! message me if youre interested in blockchain. our repo: https://github.com/lamden/lamden
Ok, thanks. Just for fun... I can try.
Ahh ok makes sense.
Long term plan. π
that's the logic for writing to the flash
Thanks!
Thanks!
Thanks.
Thanks!
Dropping off. Have a good one, all!
looks like the build passed: https://github.com/adafruit/circuitpython/pull/3546
Hey <@&356864093652516868> here's the notes document for the next meeting: https://docs.google.com/document/d/1YnwzXSsa2jI8DdzguNvYpXXwG7-MEip9TyDt3PmvwvM/edit?usp=sharing See you next Monday at the usual time, 2PM ET / 11AM PT. Everyone is encouraged to attend! Please add your hug reports and status updates even if youβll be attending the meeting - itβs super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and weβll read them off during the meeting. Hope to see you there!
hmm. so I successfully loaded the bin to my board but it doesn't show up on my computer. hmmm
if you have serial but not the drive, that means the flash config is incorrect or it's mis-soldered
Please do this as a property instead. That way it's simpler to read and write it.
Glad we had the Discord discussion about this, it helped me follow what was going on better. Thanks @tannewt
The key is, this reduces the length of time that interrupts are disabled when reading the RTC. This is especially important on SAMD21 but fixes were applied to each port that potentially required them.
I've got the 33dee4a build from S3 installed on my Feather STM32F405 and I am seeing some odd behavior with time.sleep() taking longer than it should I think. I am running this code:
import time
for i in range(0,10):
print(i)
time.sleep(0.01)
This code is taking roughly 10 seconds to complete printing the numbers. At first I was thinking perhaps it's off by a factor of 10, but oddly enough if I tweak it to time.sleep(1) instead I am seeing pretty much the s...
Checked the board and pin assignments and soldering
I'm seeing a similar error on a PyPortal where upon start up, an I2C UVC sensor may or may not work. And it appear random. It has worked for hours at a time and then just refuse to start with a "Value Error: No I2C device at address:39"
Which brings up a question: How does one decide if everything is up to date? It seems like a daily reload of CP and all libraries shouldn't be required every time there might be a suspicion that the libraries are out of date. Is there tool that can look ...
Confirmed, the flickering is much improved on a PewPew 10.2 with the binary from CI, though not totally gone. Interestingly, the influence of the USB connection is reversed now: With a USB connection, I never get any flickering. Without a USB connection, I still get some flickering when CPU usage is low (much time spent in time.sleep()).
@gamblor21 I think it's fine to turn on ORDERDDICT for iMX. It's alpha and can be changed.
@veng1 I suspect the PyPortal is unrelated to this because it is a SAMD51. Check out circup for updating: https://github.com/adafruit/circup
Add new board Bast Wifi
Thanks @FoamyGuy! I used time.monotonic to measure that it's taking 7 seconds to run...... looking into it now.
@slender iron should it initialize properly from the bin generated by run the make BOARD=CP_Sapling_m0 ?
Or do I need a different bin?
do you have a bootloader installed?
I think by default the bin will be positioned for a bootloader
No, I was using the DAP to program the bin I built
The printout on the serial monitor indicates it successfully programs
Would that bin not work for boot loading or do I need to do something different?
Hmm okay
The top of the subsecond counter is the frequency - 1. Maybe this was an issue before.
This is a new board for the atmel-samd port using the samd51, 64MB flash file system, wifi esp-01s socket, rs485 on-board and a few other nice-to-have things. Hopefully everything is good with the addition and getting it supported directly in the CircuitPython repository would be greatly appreciated. Please let me know any questions or concerns. Thank you!
Curious if this is intending to be in Cpy6, or it it will still be a while before this gets rolling again.
Tested with an stm32f411ce blackpill. Time accuracy is much improved, and the I2C tests still pass.
@stuck elbow is the bootloader the same for every samd21e18a chip?
no, it uses LEDs that may be on different pins
you can use the one for fluff m0, it has all leds disabled
where do I find the bin for your fluff?
Hi @makermelissa
I already made the changes in the points that you asked me. Thank you very much for you review
weird, there is no link on the downloads page, I thought it was added
nvm, I'm going to make one off the uf2 repo
I can still trigger a double call to supervisor_start_terminal(), and thereby the leak, by constructing two displays. That requires setting CIRCUITPY_DISPLAY_LIMIT to 2, which in the wild is only the case on the monster_m4sk board. Is that a relevant case?
cloned to local and adding config stuff
I think the sleep issue is fixed in #3549
ah, there was no release yet since fluff was added
@ornate breach you can also build circuitpython to not be offset and run on its own
I should be able to build this and try it out tonight. But it won't be until pretty late, have a few hours of teaching starting shortly before I can get back to it.
okay... so after the bootloader is on and it shows up serial and as bootdrive
I just drag the CP uf2 to the boot drive for the board
alright... it came back up as Circuitpython drive
that's really exciting
now... I need to flash the neopixel
I wonder how you develop for the Matrix Portal M4... or let's say how you power the Matrix Portal M4 and communitate with it? Windows 10 on my laptop complained that this USB device was pumping too much power (it was in French, but I have a picture). And that of course because I was with a lot of white pixel. Do you use a splitter to have power from an external source but USB data to your computer? Do you power the matrix externaly and not from the Matrix Portal M4? Do you reduce the brightness while developping and change that depending if USB is connected? What is your trick (and is it documented in the learn guide)? ( Maybe for @gilded cradle )
@thorny jay I was able to plug it into the USB-C port on my Macbook Pro (which should deliver up to 3A). If you are using a USB3 port, I think 900mA is max, so you may need to use a powered USB hub. I'll have to give it a try whether that works to know for certain.
Sorry, using an old second had T440p... one USB might be "high power", I need to give it a try.
hey @slender iron should the neopixel be on when the CP uf2 is loaded?
Also, powering a 64x64, it might not help to have the dubble of pixel.
You can always connect the matrix power to one of these and external power: https://www.adafruit.com/product/368
@ornate breach if you have it setup
I was thinking that maybe this kind of thing was the trick: https://www.8086.net/product/usb-pwr-splitter
Yeah, something like that would probably work too.
Thanks, that will be for tomorrow or my long week-end. But the auto-orientation of the Matrix Portal is impressive... even work for the Blinka Logo that is always on the top left, whatever the orientation it seems (at least the boot time orientation).
Nice, I hadn't tried that out.
@cwalther determined that for boards with 2 displays (monster m4sk), start_terminal would be called for each one, leaking supervisor heap entries.
Determine, by comparing addresses, whether the display being acted on is the first display (number zero) and do (or do not) call start_terminal.
stop_terminal can safely be called multiple times, so there's no need to guard against calling it more than once.
Slight behavioral change: The terminal size would follow the displays[0] size, not...
@thorny jay a powered usb hub may work too
hey @slender iron I can see the repl in the arduino serial monitor but it won't pull up in MU
you'll need to do a PR
okay, I'll need to work on that then
Does anyone know if MicroPython is going to support the micro:bit V2 soon? That caught me by surprise today but one's in the post for me now...
When attempting to use board.A0 with CircuitPython 6.0 Beta 2 with NeoPixels, I am seeing this error:
code.py output:
Traceback (most recent call last):
File "code.py", line 4, in
ValueError: A0 in use
It can be reproduced with this simple bit of code
import board
import digitalio
pin = digitalio.DigitalInOut(board.A0)
Oh, looks like it requires a soft reboot.
Hi I'm going through Kattni's How to "Add a New Board to CircuitPython" for my ESP32S2 Module Clip board and I'm pretty much there except for needing a VID&PID, well 2 I guess as you can attach either WROOM or WROVER variants to the board.
The guide suggests asking for help here...
The board also got some smaller updates like a touch-sensitive logo, and the MCU handling the USB port has been changed from Kinetis KL26Z to KL27Z
Ah yeah tannewt was (of course) right, no native USB.
Resolving issue #3278 Unify ORDEREDDICT setting. Removed the setting from all the ports. Added it to circuitpy_mpconifg.h based on the CIRCUITPY_FULL_BUILD. As noted in the issue this will now include this feature in the mimxrt10xx port.
Could you give us a "manufacturer" name and official board names?
I am the Manufacturer "Targett" and the Board names are "ESP32S2 Module Clip" Wroom and Wrover.
I'd propose the name targett_module_clop_wroom and targett_module_clip_wrover in my fork.
I am getting a merge error I think in the test unix build. Digging through all the make files it seems the end of the test calls a custom make command including -DMP_CONFIGFILE="<mpconfigport_coverage.h>
This coverage file defines: #define MICROPY_PY_COLLECTIONS_NAMEDTUPLE__ASDICT (1) and the only place in all the source code it appears is here.
The one (and only) function this define includes references the ORDEREDDICT define that was moved to a central area. `py/circuitpy_mpconfig...
FYI, I also tried this with the absolute newest image and the behavior is still there, so it hasn't been fixed yet.
@askpatrickw You are correct... with the current implementation #3530 is still needed.
I tested this successfully on Feather STM32F405. time.sleep() is working as expected now.
Thank you for your response, i guess am gonna have to replace the spi flash with W25Q16JV-IQ, is it supported? its my only option
as for debugging i am not sure i can do it without your help!
@simple pulsar I think there is already a version of MicroPython for that chip
@onyx hinge @stuck elbow There's a nice, hands-on summary on https://www.youtube.com/watch?v=FH3XJpeLbjA and the technical stuff lurks on https://tech.microbit.org/latest-revision/ - the soft power on/off button is an interesting addition.
Just announced, the new micro:bit brings new features and refinements. The headline features are the new built in speaker and microphone. Other new features include a touch sensitive logo button, improved power regulation for accessories and components and also the board spec ...
shame they didn't connect the main mcu to usb
What difference does that make? Is more efficient?
it would allow porting circuitpython to it, because then you can make the CIRCUITPY disk visible to the computer
as it is, you always have to "compile" whatever you want to put on it into a hex file
which really sucks
also, you can't make it act as a keyboard or mouse
or a midi device
Interesting. I thought I saw a discussion about USB HIDs for microbit.
it would have to be implemented and flashed to the "helper" chip that programs it
Ah, it was Bluetooth specific: https://forums.adafruit.com/viewtopic.php?f=53&t=169020
Accidentally had a hyphen (-) in one of the QSTR signal names. Change to underbar (_). Fixed.
I formatted the CIRCUITPY drive with windows formatting utility and it fixed double auto-reload.
This must be something to do with how we set-up the file system which might be different for a large user_fs.
Tested this on microS2.
It looks like a file was created with the incorrect name. This resolves the issue by combining the 2 different files into a single correct one.
It looks like the official board name in circuitpython is electroniccats_bastwifi. I just submitted #562 to remove the old file and rename this one to the correct name. This should fix the issue.
discord bot library broke the community bundle build https://github.com/adafruit/CircuitPython_Community_Bundle/runs/1251586987?check_suite_focus=true
Multiple top level py files not allowed. Please put them in a package or combine them into a single file.
@kdb424 6.0.0 will have light sleep during time.sleep for all ports. I've just started the light and deep sleep API for sleeping until an alarm. I'm targeting ESP32S2 to start but once the API is set, it shouldn't be too hard to bring other ports.
@Targett363 I saw your PR to pid.codes. I'll merge it into my aggregate PR and then you can use those.
Hello all, new here wondering if anything precludes using circuitPython on Arduino MKRWifi 1010 and MKRGSM1400. I could find MKRZero and MKRWan circuitPython available for them
they are both samd21 so should work
wifi and such will not
unless you write a custom library to use them
Scott, tank you so much. Git newbie, I thought I'd done something fatally wrong over there.
I need Wifi + Bluetooth for a new project and got a few MKR1010 lying around here, oh well I guess this is way over my knowledge grade here, thanks
@slender iron re discord bot community bundle: do you know if it's possible to have the actions that run on the PR check for this and fail at that stage as well. That way we could try to catch and fix before it's merged. I can try to look into that, but have little experience with actions. I am unsure of the bounds of what all it can do (or if there is some reason we wouldn't want it to do something like this).
@lone axle I was surprised that it wasn't run already. It should be doable
Does the community bundle pull in changes automatically? So if this user fixes it in their repo then it will automatically be fixed in the community bundle? Or do they need to fix it in theirs and make a new PR to pull in the changes?
the bundles pull the latest release automatically
@slender iron do you confirm the infos I was given re arduino MKRWifi1010 & MKRGSM1400 : board should work but no luck with Wifi/Bluetooth or GSM ?
yup, the wifi and ble are separate chips that we don't support
the BLE might be workable with the new ble_hci stuff but we haven't tested it
too bad, thanks anyway
let arduino know you want it π
will do π
@digital ibex Is there a difference in discord.py and adafruit_discord.py in your library? at first glance I didn't notice anything, it looks like maybe one is a newer version?
Ya, that's a weird thing to define. Maybe just remove it and replace the uses with checking if ordereddict is enabled?
Can you reproduce this on a Metro M4? I don't have a MatrixPortal yet.
It is used on a number of non-Adafruit boards so it may work better. Since you are creating your own board, I suggest you learn to debug this issue. Feel free to ask for help in the #circuitpython channel on the Adafruit Discord https://adafru.it/discord.
$ ag -Q W25Q16JV_IQ
supervisor/shared/external_flash/devices.h
282:#define W25Q16JV_IQ {\
ports/nrf/boards/hiibot_bluefi/mpconfigboard.mk
10:EXTERNAL_FLASH_DEVICES = "W25Q16JV_IQ"
ports/nrf/boards/hiibot_bluefi/pins.c
117: ...
One question about unicode.
Can this handle unicode? Maybe we should take a string explicitly.
Please include UnexpectedMaker in the name. This will not be the only Feather form factor S2 board.
DNS hostnames can only be English language letters, digits, and hyphens. I don't know if the ESP32 firmware checks for that.
It did not have the same issue despite them both using PA02 for A0.
I also tried different formats with different allocation units (FAT16/4096, FAT32/8192) and did not see any change after formatting on a windows machine and then trying the board on a macos machine (Big Sur Preview and Catalina). This was with a Stetelthings Maia board, modified by replacing the flashing with 16MB.
I might look more closely at the mac and see why it tries to write but I cant really see the issue. As someone said its something to do with the volume size. Perhaps APFS, a...
Does it work after a soft reboot but not in the first run of code.py?
@jepler is this on your radar? it should probably be in the release candidate.
Here are some suggestions that should make it a bit smaller. Thanks!
Use the non-_maybe version here. That way it'll raise a standard error. Custom error strings are nice but they take up space.
As is, I think this will fail if the transparent color is black.
if (self->transparent_color >= 0x1000000) {
While this is nice, I think it's ok to accept anything because all will be opaque after a successful call. This will save a bit of space.
Hmm, but mine should be the only board called "FeatherS2" as that is its actual name, not "Feather S2". This is what appears on someones local LAN, so I cant see any issue with keeping the name as is and it's what I'd prefer.
It works when it first starts up, but the pin doesn't work after a soft reboot like it's not getting reset or something.
With the typo fixed, this works in my tests (with an imaginary sharp and a real four-wire display) and removes the last blocker for #3482 I can think of. But someone should probably give it a quick test on a real Monster M4sk.
(One thing I was wondering while testing but didnβt investigate: is the terminal supposed to show up on both displays? Because when I initialize the (inexistent) sharp display first, then the four-wire one, I donβt see any terminal activity on the latter.)
It also does the same thing with A2, but A1, A3, and A4 act normal.
New problem, on a small number of boards, for certain translations the build is failing. These are all M0 builds that were not set to CIRCUITPY_FULL_BUILD = 0 so they are building with more features then the other M0 boards. But for some build translations are running out of flash.
By moving ORDEREDDICT to a central location it was using the FULL_BUILD define. I could introduce a new define but then we are almost back to where we started from, except instead of per port build specificati...
So basically it's failing on SAMD21 express builds with a few translations. We can try to squeeze those particular translations by setting CFLAGS_INLINE_LIMIT lower. If you look at the way CFLAGS_INLINE_LIMIT is used in the various mpconfigboard.mk files, you can see some existing examples. Or we can simply disable it for all SAMD21 builds.
I have no idea why this would be the case for just this board. I'll get one in a few days and see if I can reproduce it. Thanks!
@lone axle I was intending to make a version that runs on PC. discordbot.py is that version and it is a work in progress.
@digital ibex ah. It turns out the community bundle needs either a single py file or a directory with multiple inside.
Oops! I will fix that.
Can you move those py files into a dir and maybe rename the one to pc_discord.py
Yep, thank you.
I didnt know that until today either. Im going to look into adding an actions check for it
This is going to be too small, unfortunately. 35 is really the minimum. Below a certain point the compiler starts to mysteriously throw away code.
25 for CFLAGS_INLINE_LIMIT is unfortunately too small.
So I'd say let's just not implement ordered dicts for SAMD21's. @tannewt How do you feel about that?
So I'd say let's just not implement ordered dicts for SAMD21's. @tannewt How do you feel about that?
Overall, I'm ok with that. We only need it for the BLE library as far as I know: https://github.com/adafruit/Adafruit_CircuitPython_BLE/pull/97
@lone axle I fixed it! I'm tagging the code right now. I think the PC version will make its home in a new repo.
@tannewt have you tested this code on any boards? I just tried HEAD of main branch and my Feather RT1011 doesn't boot, it works for the v6 beta 3, bisecting between HEAD and beta 3 led me down to this commit as the breaking one :sweat_smile:
Yes. I don't have your boards so I didn't test them. I added you as a reviewer for that reason. I did test on the EVKs (1020 is broken), the new Metro and the Teensys.
I'll undo those changes. Is there a pattern to use to exclude a feature only from SAMD21 I can copy?
I'll undo those changes. Is there a pattern to use to exclude a feature only from SAMD21 I can copy?
In circuitpy_mpconfig.h, you can just guard the definition so that if it's already defined in mpconfigport.h, then you don't redefine it:
#ifndef MICROPY_PY_COLLECTIONS_ORDEREDDIRECT
#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (CIRCUITPY_FULL_BUILD)
#endif
MICROPY_PY_URE is guarded in a similar way.
Thanks for your patience in working throgh this!
(One thing I was wondering while testing but didnβt investigate: is the terminal supposed to show up on both displays? Because when I initialize the (inexistent) sharp display first, then the four-wire one, I donβt see any terminal activity on the latter.)
Right now it's only on the first. We don't handle multiple displays well. I was wondering if we should allow a group to show on multiple displays. That doesn't work now because the transformations from the display are pushed down into ...
any ideas on how we can free up some space on the metro m0?
there is 2k free with gcc 10...
Go ahead and turn it off in all SAMD21 boards; making the change inside #ifdef SAMD21 in the atmel-samd/mpconfigport.h
@tulip sleet should I roll back the changes that were board specific?
@blissful pollen yes, since really there are no SAMD21 boards that need OrderedDIct. The ones that fit are accidental, because we removed other things, or because they don't have many pins. The Feather and Metro M0 are the standard SAMD21 boards, so if they don't work for those, no reason to add to the others.
Go ahead and turn it off in all SAMD21 boards; making the change inside #ifdef SAMD21 in the atmel-samd/mpconfigport.h
According to the data sheet for the MX25R1635F, the JDEC should be 0xc2, 0x28, 0x15. In the devices.h file, the capacity parameter is specified as 0x18 for that chip. So I think the value may be incorrect in devices.h - thus it is not being recoginized.
Updating the entry to:
/ Settings for the Macronix MX25R1635F 8MiB SPI flash.
// Datasheet: https://www.macronix.com/Lists/Datasheet/Attachments/7595/MX25R1635F, Wide Range, 16Mb, v1.6.pdf
// In low power mode, quad operations can on...
Got it! Should I remove the transparent_color parameter in that case or keep it for API consistency?
Keep it in case we support multiple colors later.
Thanks! This kind of progression, where we run out of space after adding a feature, and have to figure out how to compensate, is completely typical.
@tannewt Thank you again for all of your reviews. π I initially kept the unused parameter but the linter was not happy with an unused parameter so I removed it. If you'd rather I use it superficially or something please let me know the best way and I can add it back in. Otherwise it is cleaned up.
Also sorry my git history is a bit of a mess... I am happy to rebase and clean that up if needed. First time using the github UI to merge in suggestions. Not sure I will do that again haha.
According to the data sheet for the MX25R1635F, the JDEC should be 0xc2, 0x28, 0x15. In the devices.h file, the capacity parameter is specified as 0x18 for that chip. So I think the value may be incorrect in devices.h - thus it is not being recoginized. Updating the entry to: / Settings for the Macronix MX25R1635F 8MiB SPI flash. // Datasheet: https://www.macronix.com/Lists/Datasheet/Attachments/7595/MX25R1635F, Wide Range, 16Mb, v1.6.pdf // In low power mode, quad operations can on...
According to the data sheet for the MX25R1635F, the JDEC should be 0xc2, 0x28, 0x15. In the devices.h file, the capacity parameter is specified as 0x18 for that chip. So I think the value may be incorrect in devices.h - thus it is not being recoginized. Updating the entry to: / Settings for the Macronix MX25R1635F 8MiB SPI flash. // Datasheet: https://www.macronix.com/Lists/Datasheet/Attachments/7595/MX25R1635F, Wide Range, 16Mb, v1.6.pdf // In low power mode, quad operations can on...
Credits to Brian β Brian Dean bsd@bdmicro.com BDMICRO, LLC https://www.bdmicro.com
According to the datasheet for the MX25R1635F, the JDEC should be 0xc2, 0x28, 0x15. In the devices.h file, the capacity parameter is specified as 0x18 for that chip. So the value is incorrect in devices.h
/ Settings for the Macronix MX25R1635F 8MiB SPI flash.
// Datasheet: https://www.macronix.com/Lists/Datasheet/Attachments/7595/MX25R1635F, Wide Range, 16Mb, v1.6.pdf
// In low power mode, qua...
@tannewt if u can guide me maybe i can be of help to test this flash ship and get it working.
Was wondering if Adafruit Cpython could be run on an stm32h7.. I really do need all that power and really do want to use Cpython... I know I can load Cpython but I'm not sure about the Adafruit version.
Wait wrong channel.. I'm new
Hi,
I'd love to get a couple of USB VID/PID for our project DynOSSAT-EDU, the world's first open source nanosatellite educational kit compatible with CircuitPython and Arduino :)
Our CircuitPython fork: https://github.com/BHDynamics/circuitpython (auto build fails because of duplicate VID/PID since it's set to 0)
UF2 Bootloader fork: https://github.com/BHDynamics/uf2-samdx1
The hardware repos are set on private because we'll release later this month/early november, but I can giv...
@hanyelkomy, take a look here for great instructions:
https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github
If you're already familiar with git, it'll be a breeze. If not, the instructions are detailed so you shouldn't have any problems.
Basically you'll fork the CircuitPython repo, check out your fork to your local system, create a branch to make your changes on, build and test them, push your changes to your fork, then submit a pull request to get them merged.
...
@bd34n Thanks again for your answer, but i meant how can i test this spi flash and get its settings?
Unless the chip is really weird, which on first glance it doesn't appear to be, it's a matter of reading the data sheet for the various parameters needed for the definition block. You've got the device ID above in your pasted image - 0x85, 0x60, and 0x16 - that will allow it to be detected and configured based on the other parameters. Tthen verify how many status registers, startup time, speed, etc, and update the values in the definition. That should all be available in the datasheet. If the...
@indigo wedge did you make any progress last night with the airlift firmware? If you set debug=True in the initial call in the airlift library, does it print out anything from the ESP32? I can try to duplicate your setup (minus your special board) to confirm what is and isn't working
no, didn't get any further, yes I get boot prints if I enable debug, it fails at the step where it passes the uart and gpios to _bleio.Adapter, I get a HCI write error, i tried doing busy=rts, gpio0=cts and busy=cts, gpio=rts
the wifi part of the firmware works
Whoops will re-run to remove this unused string.
I will update this copy since it is not just a pixel.
@slender iron I am going to make a PR to add HCI _bleio to all boards for which it will fit (plain Metro M4, etc.). Right now it's only enabled for the MM4 Airlift Lite board. Would like to get this into the rc
Boards with plenty of flash have room for the HCI version of _bleio. Previously this was enabled only for Metro M4 Airlift Lite, but since most any board can use an Airlift breakout, add it to all where it will fit. It is on by default for CIRCUITPY_FULL_BUILD.
CIRCUITPY_BLEIO_HCI is not enabled on SAMD21 boards due to size, and not on nRF since they have native BLE.
The added size is about 21.3kB.
I'll do this as a draft first to see what fails due to size.
Is there a table of the size of the CP drive for each board?
It looks like it is the size of the SPI chip except on the Trinket M0 it seems to be about 48k.
Specifically, my guess is the QT Py would only have 48k for CP without the optional SPI on the back.
@hazy plover it's in the product descriptions in the store. Non-express SAMD21 (M0) boards are 64kB (minus overhead). Express boards are generally 2MB, but a few are 8MB (PyPortal, I think). There are some special cases like certain non-product nRF52 boards where part of the large internal flash is used.
"Express" means it has an external flash chip
@tulip sleet ya, we can get that in for rc
@tulip sleet If it's there, I missed it and I've spent quite a while working on it.
The Store says the PyPortal has an 8MB chip and Windows says it has an 8MB CP drive.
The Store says the M4 Express has an 2MB chip and Windows says it has an 2MB CP drive.
The Store says the Trinket M0 has an optional chip and Windows says it has an 48k CP drive.
So, again, my question is should one expect that, at a minimum, the CP drive will have approximately the size of the external flash chip. I don't have one of everything to test but that's my conclusion from the 3 different boards I have.
that is correct. But the Trinket does not have an optional chip (the Py QT does). You need a separate build of CPy to access the optional chip. I'll check the Trinket product description
the major major motivation for the external chip is to use it for CIRCUITPY
@tulip sleet
That brings up another question. Why can't CP identify the size of the flash drive without a separate build?
the smaller build has other missing features, so you want the larger build. The SAMD21 has 256kB flash. When there's no external flash, there's only 192kB for CPy and 64kB for CIRCUITPY. When there's an external chip we can use the whole 256kB for CPy, and enable a bunch more features (like longints0
The larger build will recognize the 2M chip on the QT Py. Will it also automatically recognize the 4M from the same family?
I think that is the largest that will fit the narrow package.
Each build specifies the chips it tries to recognize. We don't include data for all possible chips because it would take too much space. It's the EXTERNAL_FLASH_DEVICES line in files like this: https://github.com/adafruit/circuitpython/blob/f1e8f2b404ef45edf08b019c1e68d595aa69b357/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk#L13
you can add another flash device to that value and make it a comma separated list. Then you also need to change EXTERNAL_FLASH_DEVICE_COUNT to 2 or whatever.
you can find examples in other mpconfigboard.mk files
In reading through several .mk files, they all seem to be only set up for one specific size like 2X16. If different size were specified in the list, would the actual chip be recognized as the correct size or does it only work with one size?
@hazy plover it works with whichever chips are in the list of EXTERNAL_FLASH_DEVICES. The devices have ID information that is checked to determine which chip it is (including its size).
it tries all the chips in the list
@tulip sleet Great. Thank you.
On a different question, I have a PyPortal reading a I2C UV sensor (GUVB-C31SM) which seems to work fine once it gets started. However, sometimes it soft reboots several times.
What are the most common reasons for reboot on start-up?
is it connected to a host via USB? If the host is writing to CIRCUITPY (it could just be the metadata for the filesystem), then the board will restart on each write. If you have any utility software on the host computer, such as an indexer or anti-virus, backup program, or disk utility, those programs can generate writes to CIRCUITPY.
Yes. Connected to Win10 via USB. I'll try an external supply.
vanilla win10 wil not do this: it's usually due to some third-party piece of software
@indigo wedge were you testing on an i.mx board? how did you get around the problem of needing ByteArray.h, but CIRCUITPY_NVM = 0, which disables that?
@tulip sleet After half a dozen power cycles using an external supply, no soft reboots. So it's probably anti-virus.
Thanks again.
you might see if you can prevent your antivirus from scanning that particular drive. which one is it? I like to keep track of this kind of thing
Bitdefender.
I'll make a note, thanks! and glad it works otherwise
I'm getting fairly valid results comparing to a Newport 818-RAD which is a cosine corrected detector. I still need to assemble a goniometer to measure intensity versus angle for both detectors and then test my constant current source that is controlled by CP to step the UVC LED intensity across a broad range to insure my detector is linear.
Circuit Python has made this fairly easy.
@tulip sleet I just implemented ByteArray.c on imx, but haven't really tested it yet
_bleio just uses it for bonding info, which isn't even implemented in the HCI version yet
I could try to conditionally compile the bonding stuff so that if CIRCUITPY_NVM is 0, it doesn't try to include ByteArray.h. I may do this to get the other builds working that are now failing due to this (including Spresense and i.mx)
that probably makes more sense π
Hi Enrique! We're trying to minimize giving out Adafruit PIDs. When your source is released, you can get a PID from pid.codes. They also have testing PIDs that you can use temporarily.
Note that we already have other satellite platforms:
Hi! Please make a pull request with the change. We'd love to see it fixed. Thanks!
More info on how to make a pull request here: https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github
@tulip sleet or @onyx hinge could you turn off the VM opt for the metro m0 FR build? it's causing us size issues
it's a bit hard for me to test because I'm using gcc10
I can include it in the PR I'm making for _bleio hci
+++ b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk
@@ -33,3 +33,8 @@ RELEASE_NEEDS_CLEAN_BUILD = 1
CFLAGS_INLINE_LIMIT = 35
SUPEROPT_VM = 0
endif
+ifeq ($(TRANSLATION), fr)
+RELEASE_NEEDS_CLEAN_BUILD = 1
+CFLAGS_INLINE_LIMIT = 35
+SUPEROPT_VM = 0
+endif
``` is this what you want? it makes the fr flags be like the de_DE flags
ya, that's what I'm thinking. I'm curious how much space it gets us
I also need a third opinion on https://github.com/adafruit/circuitpython/pull/3555
jepler go ahead and do a separate PR if you have time, since I'll be a while.
OK sure thing @tulip sleet
or jeff can put it in his PR that is failing due to it
@slender iron I agree FeatherS2 is ambiguous. I think UMFeatherS2 would be fine.
Font missing 1 characters
huh that's a surprise
k, please reply dan
FeatherS2 is pretty generic, because "Feather" is generic. How about "UMFeatherS2"?
@slender iron the actual problem is interesting ... There a space that was entered as unicode U+202f 8239 NARROW NO-BREAK SPACE ββ―β instead of just "space". This causes memory usage to increase, because some tables have to be 16 bits instead of 8 bits.
maybe the python script should check for odd spaces like that
so how much space do we get by fixing that?
and will we actually mess something up if a break does occur there?
From what I understood, French puts space before and after punctuation which we put space after in English. so the translated string said "Output_: ", trying to prevent a line break before the ":"
wow my laptop builds circuitpython slow π
looks like 3 messages in total are affected.
472 bytes free in flash
π
I'm not quite sure what the point of that wiki page is, whether to allow or disallow it
ekkk
the non-breaking space is included when the punctuation mark is two parts, like semicolon or question mark (but not say period or comma)
https://docs.weblate.org/en/latest/admin/checks.html#custom-checks OK I'll read this and see if I can figure out how to disable this check for circuitpython
@tannewt Thank you again for all of your reviews.
No problem! Thank you for improving things. :-) (We're working on the metro m0 size issue now separately as well.)
I initially kept the unused parameter but the linter was not happy with an unused parameter so I removed it. If you'd rather I use it superficially or something please let me know the best way and I can add it back in. Otherwise it is cleaned up.
For unused parameters you can do (void) transparent_color; in the func...
This should fix the extra memory used by the French translation. Before merging, check that actions shows more than 300 bytes free on the feather_m0_express french build.
@slender iron thanks for alerting me about that, I hadn't looked at PR build statuses yet today.
I always check early on days I want to release since the CI is slow
Locally, I get
253224 bytes used, 472 bytes free in flash firmware space out of 253696 bytes (247.75kB).
while before this I was seeing just 24 bytes free.