#circuitpython-dev
1 messages ยท Page 362 of 1
Correct @raven canopy
๐ just wanted to make sure you knew. its one of those sneaky details. ๐
I generated a json file locally that I'm just using for my test code
@raven canopy it's nice to see you dipping your toes back in!
Yes, it should be an asset for the bundle.
hai hai. its nice to be dipping again. ๐
@tulip sleet
These are duplicated above, next to the D0/D1 version of the pins; check out the full file to see it, it's outside the normal diff context.
They are reversed in one pair versus the other. Which one is right? TX/RX is 10/9 or 9/10?
oh my, I'll double check!
I have nothing connected to the QT Py except for the USB C cable and I am reading the pin value for A3 and it gives me a reading that fluctuates between around 25000 and 32000 and that does not make sense to me. Is this normal?
Here is my code:
import board
import time
from analogio import AnalogIn
therm = AnalogIn(board.A3)
while True:
v = therm.value
print(v)
time.sleep(0.1)
You are reading electrical noise on the pin because it's unconnected.
Demo is working! https://tranquil-massive-cilantro.glitch.me/ (random name generated by glitch) I have it downloading adafruit_ssd1305 and adafruit_ht16k33 by default, but you can specify a libs parameter. It will download any dependencies as well. It just needs a bit more polish, but this looks like it is totally doable using JavaScript. Currently the JSON and zip files reside on glitch so I didn't have to deal with CORS policies and I need to have it detect the latest bundle version still.
yay for testing, booo for massive cilantro which sounds like my own personal nightmare (yuk!)
Demo is working!
Nice! Its quite speedy, to boot.
I have it downloading adafruit_ssd1305 and adafruit_ht16k33 by default
The ht16k33 folder was empty when I tried it a couple times, but probably a minor issue.
Currently the JSON and zip files reside on glitch so I didn't have to deal with CORS policies and I need to have it detect the latest bundle version still.
The libraries page JS might give you a head start on grabbing the latest version of the JSON file: https://g...
Looks like the imx EVK 1010 evaluation board doesnโt have many pins broken out (for example to develop ParallelBus). And actually ParallelBus may not get much use on the early boards for the RT1011. Iโll keep my eyes open to see how the imx development proceeds and see if thereโs a topic that makes sense to get involved with.
Looks like I spoke too soon, I looked one more time and found an app note on an 8bit parallel demo on the EVK1010 board (6800 bus, not 8080 like on our typical LCDs): https://www.nxp.com/docs/en/application-note/AN12813.pdf using the FlexIO. So it looks like thereโs room to explore on the board you mentioned.
Just for completeness (and for future me when I forget where I found this), hereโs an 8080 parallel LCD demo (ParallelBus) on an older NXP chip and demo board. Seems like the โFlexIOโ configuration is similar to that on the RT1011: https://www.nxp.com/docs/en/application-note/AN5313.pdf
For what it's worth, I crudely adapted the Arduino interface for use with a Raspberry pi. Useful in the interim.
@mental nexus the I/O layout of the 1010-evk is a bit weird and limited. Be especially careful if you're using the schematic because some things that look like they are connected are NOT because a 0 ohm resistor is marked "DNP" or "do not populate"! On the doubled Arduino-style headers there are some connections on the inner half but far from all connections are used.
Thanks for the warning. In looking at the docs, many of the pins arenโt broken out to headers. For 80 pin package I guess they use them for other purposes on the board. Will stew on this a couple more days and decide whether to order one of these.
say, I was looking at the _data/files.json file on the circuitpython-org repository and noticed it's technically not correct json (there's a , at the end of some lists), but I don't know where the code generating it is to maybe issue a fix ?
@jaunty juniper I think they are usually generated by code but were hand-modified the last time around due to a bug
yes, that might be it, I just grep -v'd some stuff out of the json
and while you're in there check if you can use json.write / json.dumps with sort_keys=True
@slender iron Ping me when you're around to chat about the pre-commit page. No rush.
@jaunty juniper if you want to take this on ^^ it would be helpful. If the issue is too terse I am happy to expand on it
looks like my hand edit did add trailing commas:
I updated issue #4470 with more information so someone else may have a chance of understanding what is needed ๐
(it says "issue opened" above, but it was transferred from circutpython-org where I'd mistakenly opened it initially)
ah I see
I was investigating ways for circup to get info on the latest beta without doing parsing on its own
#4470 needs to be fixed before the next release of any kind
I feel like I'm being dense, but I can't find an example in shared-bindings that takes a string as an input parameter. I'm looking to add a filepath input string to a function, and can't seem to find how to track down an existing example.
@mental nexus a lot of things take opened files rather than filename strings ..
Yep, that's exactly the issue! : https://github.com/adafruit/circuitpython/issues/4197
@mental nexus try ipaddress_ipv4address_make_new in shared-bindings/ipaddress/IPv4Address.c
Cool, will look there.
It's parsed as a generic object { MP_QSTR_address, MP_ARG_OBJ | MP_ARG_REQUIRED }, then checked for being a string by shouting at it MP_OBJ_IS_STR(address) and then the bytes and (byte-?)length of the string can be extracted by additional shouting GET_STR_DATA_LEN(address, str_data, str_len);
Exactly what I was looking for. Thanks jepler!
@ladyada requested atexit, so cleanup can be done when a program finishes.
The CPython atexit is fairly complicated. Note carefully the order in which the routines are called, and that atexit.unregister() unregisters all instances of a particular function.
@slender iron (when you're up) and @onyx hinge too if you're interested. I would like to have a little release planning meeting about what should go into 6.2.0 and when we should branch it. @ionic elk has STM sleep code that will be ready to go soon, but it has some internal refactoring and renaming and will require revision of the nRF sleep PR. The nRF sleep PR is blocked by a USB issue I need to look at. We can also talk about whether the new flash stuff and any I2C fixes should go into RP2040 before 6.2.0.
@tulip sleet I'm around all day
Firmware
Adafruit CircuitPython 6.2.0-beta.1-dirty on 2021-03-22;
Code/REPL
import time
import board
import busio
import wifi # without this import, i2c won't work
import adafruit_mpu6050
i2c = busio.I2C(board.SCL, board.SDA)
time.sleep(1) # without this delay, i2c won't work
mpu = adafruit_mpu6050.MPU6050(i2c, address=0x69)
while True:
print("Acceleration: X:%.2f, Y: %.2f, Z: %.2f m/s^2" % (mpu.acceleration))
print...
Please try 6.2.0-beta.4. We added, #4387, which may well fix this problem. That PR was mistakenly omitted from the release notes for beta.4 -- I will fix that.
Thank you @dhalbert! - I will update it now and test this again.
Does this really benefit from the debounce delay? Or could it be simplified to not include it. I haven't tested it without yet. Simply wanted opinions. https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/master/CircuitPython_Essentials/CircuitPython_Digital_In_Out.py
Seems like spamming the result is irrelevant here, because the LED is on or off.
no, because who cares whether the light goes on and off due to bounces. It may not even be visible
it might be interesting to come up with an example where debouncing is crucial: a simple one would be counting button presses
like printing out a character on each press
There's quite a few already. I usually do simple state machines to handle it though, so you can track press and release without a separate module.
Not sure we've done anything with the debounce being the focus though. Maybe Dave Astels did at some point since he wrote the debounce lib?
No idea.
@tulip sleet happy to chat or get on a video call about it but I don't feel like I have a high level overview of the state of things.
The
ht16k33folder was empty when I tried it a couple times, but probably a minor issue.
Oh yeah, I just noticed mine is too. I'll look into this next.
The libraries page JS might give you a head start on grabbing the latest version of the JSON file: https://github.com/adafruit/circuitpython-org/blob/master/assets/javascript/libraries.js
Thanks
And while I love cilantro...tranquil, massive cilantro does sound ominous. ๐ป
Yeah, I should probably change the name...
Closing in favor of the issues on the CLUE and CircuitPlayground libraries.
closing for lack of activity
Hi @dhalbert, I just updated to beta.4 and the issue is now fixed!. Thank you again for your hard work and for replying so fast. This ticket can be closed.
I see now that your system works a little different, in that alarm_time_timealarm_set_alarms does not set an interrupt.
Hej weblate GANG - Got my matching tattoo today! @fossil gorge @still zephyr 
We believe this the error "common_hal_busio_spi_write: status 400" has been fixed #4048. Please feel free to re-open (or open a fresh issue if "re-open" is not available) if this problem still exists.
We are aware of the problem getting the 1020-EVK to work at all (#3510) and hope to address it soon.
Note that in the datasheet, "SDI" indicates Serial Data In from the point of view of the microcontroller, which is MISO (microcontroller in, secondary out) in SPI parlance.
@tulip sleet trying to run build_board_info.py locally I run into Expecting value: line 71 column 5 (char 979) because it loads the current files.json from circuitpython-org, should I PR a fix for the file ?
certainly if it's easy clean up the current file ; thank you
We believe the SPI "status 400" problem has been fixed by #4048. However, we will use this issue to track the reported I2C problem.
Ok, the empty folder issue is fixed. It turns out a required JSZip function was not an asynchronous function, but rather used callbacks, so it basically added the files after the download initiated. Easy enough fix using promises.
Fixes error on json.load().
Thanks for fixing this. Since this file is auto-generated, is this likely to be an issue in the future?
Spot checked and the changes look okay
Thanks for fixing this. Since this file is auto-generated, is this likely to be an issue in the future?
This was my fault. It doesn't normally contain trailing commas. I had to edit it by hand due to https://github.com/adafruit/circuitpython/issues/4470
just to share some frustration .. I was trying to check out how I2C works on the 1010-EVK with some 6dof sensor I wasn't familiar with. didn't work. Started checking the schematic and .. after much hair-pulling .. noticed that THE WHOLE SENSOR is a "DNP" part. Oh, that's why it didn't show up on bus scan...
What's "DNP"? I assume not "Do Not Pull-hair"?
do not place
do not populate
see last paragraph here: https://en.wikipedia.org/wiki/Bill_of_materials#Configurable_BOM
Two Learn Guide feedback entries:
On Win 7 after trying out datalogging example T\the Pico became ReadOnly. Used flash nuke to unbrick it then CRASH !!!! (blue screen of death) repeatedly But on Win 10 it works fine. On Win7 it causes crash as soon as module is plugged into USB (with CIRCUITPY in it)
Using the beta 4 version. Will try new version as soon as it becomes available. Problem is only related to Win7. On Win 10 it's working fine.
I wonder if anyone has come across a c...
@tulip sleet I'm around if you want to talk 6.2
now is good
I'm around but it'd be slightly inconvenient to hop in a voice channel right now
@fivdi Want to PR here as well? https://github.com/adafruit/pico-sdk We can then merge this into CP sooner than upstream has it.
@tannewt ok. Against which branch of https://github.com/adafruit/pico-sdk?
Might be worth testing the TCS34725 with native i2c at 100kHz before going ahead with proposed change as @fivdi noted that the change doesn't appear strictly necessary based on the data sheet.
@kevinjwalters The tests described in the PR were performws with native I2C at 10, 100 and 400kHz.
I am playing around with the new Touch Deck guide but I am trying to use a FeatherS2. Unfortunately it doesn't use the same pins as the tft_featherwing expects. Now the problem is that tft_featherwing_24 and tft_featherwing_35 don't expose the ts_cs and sd_cs pins. I was able to get it to work, but should these be exposed so users can use other feather boards with those libraries easily?
This sounds awful familiar...rewinds Discord a mere three hours.....
what, when I told you to watch out for DNPs? yeah. ๐
You should be able to pass some keyword arguments to set them: https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing/blob/c9e46e5680237d91cb66b70b63a1399d57e5cf85/adafruit_featherwing/tft_featherwing.py#L34
Right, except that is only in the parent class and not the subclasses.
{ MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_09) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO_10) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_GPIO_09) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_GPIO_10) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO_10) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_09) },
Before my change there are a magnificent THREE different pairs of UART RX/TX pins available!
...
The sub classes need to accept and then pass through kwargs here: https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing/blob/c9e46e5680237d91cb66b70b63a1399d57e5cf85/adafruit_featherwing/tft_featherwing_35.py#L36
I created a pull request if the keyword arguments should be exposed in the subclass.
To answer your original question though, yep it definitely should allow for that. Excellent thanks for making that PR. I will review that tonight or tomorrow.
Using the actual argument names like you did instead of kwargs like I said is actually better I think. Good call on that. It will make the documentation more clear.
Don't tell me about FeatherS2 pinout... I gave up on that fight, but @slender iron did continue trying to convince for a change.
I am not trying to carry the torch on that fight. I did chuckle a little when I ran into this issue.
without this, the baud rate could be wrong; in my testing, it was low by a factor of 2 when requesating baudrate=1_000_000 (1MHz).
When passing the baudrate in to LPSPI_MasterInit, the setting is made automatically, but LPSPI_MAster_SetBaudRate just returns it via the out-parameter tcrPrescaleValue.
This is related to #3062 but is not a solution for it, as there remain long inter-byte gaps.
Now with correct 1MHz SCK rate, but still with multi-microsecond gaps between bytes:
![image]...
How can I test the 8-bit parallel display with a Feather RP2040? I don't see a set of 8 consecutive gpios on it, is there some trick?
can you test, whats the max SPI clock rate?
The SPI clock itself will go fast, here's 30MHz:

but the gap between bytes gets relatively longer and longer at higher baud rates, limiting the effective throughput:

@tulip sleet quick question for you about power, got a sec?
I would like a way to collapse all the Groups down to a single Group that I can then append to
If I collapse the background into a bitmap, I can reuse the background by just making the 1st append the single bitmap.
I think this will free up ram for tight run time projects.
@stuck elbow I think they have to be consecutive but need not be aligned, so try D4 as the base
Can we add a thickness to this function? make it a default to 1 but allow user to set line width.
Also, can the line end in a Dot, Arrow, or nothing?
Sometimes you just need indexed persistent storage without wifi.
this is actually much harder than you'd think! line thickness needs to be handled as a low-level polygon drawing function.
@dhalbert 786k is the new 400k.
Adafruit CircuitPython 6.2.0-beta.4 on 2021-03-18; Raspberry Pi Pico with rp2040
>>> import board, busio
>>> i2c = busio.I2C(scl=board.GP1, sda=board.GP0, frequency=786_000)
>>> big_buf = bytearray([0x81, 0x46, 0x81, 0x55])
>>> i2c.try_lock()
True
>>> i2c.writeto(60, big_buf)
From three runs measuring a chunk of clock pulses
Average Frequency = 399.436 kHz
Average Frequency = 401.070 kHz
Average Frequency = 399.787 kHz
Do...
This was raised by user "cake" on the discord chat on 24 March 2021 at 1:43 pm central.
Firmware
Adafruit CircuitPython 6.2.0-beta.4-84-gc81007afb-dirty on 2021-03-24; Adafruit PyPortal with samd51j20
Code/REPL
import board
import displayio
import vectorio
import time
display = board.DISPLAY
rect_palette = displayio.Palette(color_count = 2)
rect_palette[0] = 0xffffff
rect_palette[1] = 0x00ff00
rect_palette.make_trans...
I was talking to Scott about releases; free now
I'll be giving a short talk at the open hardware summit where I'll definitely touch on this
I think I basically have it figured out but just wanted to check - when the USB delay is called, we want to delay the interval for a deep sleep alarm until the deep sleep actually starts, right? In ESP32-S2 I think it does this automatically because esp_sleep_enable_timer_wakeup doesn't actually set an interrupt itself, the actual deep sleep command sets that up. But it's relevant for STM32 because the alarms that alarm_time_timealarm_set_alarms creates can go off in the middle of the USB delay.
when we start the USB delay we have no idea whether we should be real or fake deep sleeping
Right now I've made it so that when common_hal_alarm_enter_deep_sleep is called, it calls alarm_time_timealarm_prepare_for_deep_sleep which sets the alarm again, which will either replace it if it was too short (went off during USB delay) or too long (in which case it overwrites it)
are you saying like if we want to deep sleep for 10 seconds but have to wait for 5 seconds for USB that we actually sleep for only 5 seconds after the first 5 seconds (i.e., make it more accurate?)
I'm saying that if I sent a command to sleep for 2 seconds on STM32, unless I have a system to catch that, the alarm will go off during the USB delay and it will never be able to wake up
yes, got it, so on the ESP32-S2 this was not a problem because the alarm time was only considered when we actually started sleeping. Maybe the name of the function should be more accurate
@onyx hinge oh, I missed gpio6 because it wa son the other side, thanks
I remember noticing that
There are two ways to solve that - either we catch the problem before deep sleeping and just restart, or I can make it actually only start the timer once it's decided to fake/real deep sleep. I picked the second because it's closer to the ESP32
I agree with the latter
In the majority of cases, alarm_time_timealarm_set_alarms does actually start the alarm. We just need an extra check to make sure it doesn't expire before deep sleep, so the code can always wake up.
Now that I think of it, this could actually happen with user code... if someone (foolishly) puts another form of delay or long calculation between alarm_time_timealarm_set_alarms and common_hal_alarm_enter_deep_sleep, this could still happen
It might actually be a clearer API to always start all time alarms only when actually sleeping? Or does that interfere with the ambitions to have alarms function as a proxy ISR?
The speeds you ask for may not be precisely available based on the way the peripheral clock is generated. It's usually generated by dividing a higher-speed clock. I don't think it's necessarily a bug; you'd need to study the clock setting in the I2C driver.
This is common: for instance, when we have high SPI speeds on other chips, they are very approximate because the divisors are quite small.
Currently one option is to use the vectorio library and draw a polygon (rectangle). I think it will created โfilledโ polygons only.
If you need an example of a vectorio polygon look at the needle on the recent Dial widget here: https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout/blob/main/examples/displayio_layout_dial_simpletest.py
If youโd like other basic examples let me know and I can try to find one m
@ionic elk The alarm times are set as a time in the future, as an absolute time.monotonic(). That is, I want to wake up at time x, not x seconds from now. So whatever makes sense to preserve those semantics is best. If the alarm time has already expired, then we wouldn't sleep at all (or deep sleep would wake up immediately after exiting the VM).
Oh and here is the link to the vectorio documentation:
https://circuitpython.readthedocs.io/en/6.1.x/shared-bindings/vectorio/index.html
@tulip sleet the current system is not sufficient, then. If that is the intent, we need to change both the ESP32-S2 and upcoming ports to double-check before deep sleeping that their wakeup time interval has not already elapsed, and restart (possibly with a warning saying they were late)
Ah I seem I'm kind of repeating you there
we should probably do that; it was not a big deal because we were envisioning sleep times of minutes or hours, not a few seconds
this was all directed toward the magtag, waking up very occasionally to update things and then go back to sleep
Yeah I mean the super trivial way would be to just throw a value error if you try to sleep under 5s
deep sleeping for 2s in any case is kind of silly (even though it will work just fine on every sleep restart after the first plug-in)
that might make sense. We were just being sloppy/urgent.
Yeah it's no biggie, just digging these things up as I go ๐
it's worth the clean-up thinking, thanks.
if you don't want to bother with it now, it can be a long-term issue
I may go with my current system as of right now just because it's working and I want to get my stuff in
(ie both the ESP32-S2 and STM32 will push out the wakeup date by 5s after first plug-in)
So based on your testing of 4-byte writes this issue title could be revised.
other trivial question, do we want to have a shortcut for setting the timealarms to relative time?
Seems like relative time is used a lot in the examples anyway and makes sense for many applications
we decided not, to make the semantics clear
since it was "relative to what start time"?, and that wasn't obvious
but you could propose it
again, the magtag examples were more like: wake up at 9am and get the weather, as opposed to wake up 24 hours from now
so for longer periods it was an "alarm", not a "timer" (comparing your phone functionality, for instance)
yeah a line that is not thickness 1 needs to be drawn as a filled poly!
Probably would want to include it in the call itself, maybe, alarm_time_timealarm_set_delay_after_sleep
specifying that it's after sleep actually starts
or something
or it could be a different keyword arg, I think that's the idea of the monotonic_time keyword arg name. There may be some discussion of this in the original issue or PR.
Seems like something to just propose in an issue. I'll do some research to see if there's existing basis.
btw, we decided to defer these new sleep impls to past 6.2.0 to get the current beta to stable quickly
@ionic elk how much imx-brain do you have active at the moment?
@tulip sleet one more thing for you. Do we care about second-level resolution re: alarm times? For short alarms they're often off by 1s, but as per the above I don't know that we care
@onyx hinge I can re-brain some i.MX, just finished an STM32 task I'm out of the weeds mentally
what's up
I am trying to figure out how to phrase the question ๐
the context is https://github.com/adafruit/circuitpython/issues/3062
more like i.MESS amirite
SPI transfers have absurdly long pauses between bytes
but all I do is, call their SDK function
and I don't know a better question to ask than, is that just how it is?
maybe, is there some other SDK function I overlooked for doing this with DMA, which is what someone in the issue mentioned? The lpspi API just has blocking and non-blocking versions, but neither uses DMA to the extent I can follow what they do
Have you poked around inside the SDK function to see if it's doing weird stuff? Maybe it wants you to do some kinda DMA thing?
ah ninjad
drivers/fsl_lpspi_edma.h oh maybe the dma related stuff is in a different file entirely
my question might be are the blocking calls slotting something weird in there, like a flash access or something that's taking lots of time
shouldn't be?
SDK manual shows both Peripheral and eDMA sections
so they're considered separately there too
OK, well, now I know why I couldn't find DMA
I don't know if I found that one yet
I don't think NXP docs are very good but still probably nice as a reference
.. is there no html version ? ๐ข
@tulip sleet Mu works with Pico now? Or will..? Guide feedback mentioning the 2 COM ports.
@idle owl 2 COM ports has been disabled for now
@onyx hinge ๐คทโโ๏ธ
largely because of mu
Oh I thought that was still a Pico issue. Fair enough.
Thanks.
I knew it had been disabled. Was conflating things.
@ionic elk so far the main thing I'd tried was identifying the routines used during SPI'ing (in the sdk) and put them in itcm but that didn't make any difference
@onyx hinge apparently there are also examples at <SDK_ROOT>/boards/<BOARD>/driver_examples/lpspi you could try those and see how the speed comapres
sorry am I flaking on what itcm is
oh right address ram
I don't exactly know, but my understanding is it's a region of memory that is faster for fetching instructions from -- instruction tightly-coupled memory
yep just forgot momentarily, google was giving me silly company names
Well, sorry I'm not more helpful here, I didn't write i.MX busio so I'm not super strong on it.
But I think DMA is probably your best shot, especially if you can find SDK examples for it
thanks for talking through it, it is nice in itself
STM32 uses the DWT for the neopixel writes, which I don't think should be messed up by anything else in the port, but maybe there's something going on with port_get_raw_ticks?
@onyx hinge I'm looking at https://github.com/adafruit/circuitpython/issues/4470 how would one test it locally though ? (outside of a bunch of prints I guess)
@jaunty juniper good question!
Comparing to existing files is tough, especially due to the unsorted nature of the files. There are json diff programs but I've found that the files of that size tend to give them trouble, particularly the browser-based ones
I'd just make a plausible looking change and manually check the language list.
ok btw you can use them as 'raw' RGB tft displays, you dont get displayio but you can always draw to em.
https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display
This looks promising, I will give it a try, thanks.
I have been tackling the CORS issue. I set up a GitHub IO website with these pages hoping that would fix the issue, but is still was running into the same error since the domains are different.
I worked around it currently by having it using a public CORS proxy for now, so it's getting the zip and json data from GitHub successfully, so this is very close to being done. In terms of security, this is fine because everything is public already. However, I don't want to be reliant on somebody ...
You can write files to the CIRCUITPY drive from user code. This guide gives you the basics.
Back to considering S3, I haven't tested it, and not sure if it's already been tried, but could we configure the S3 bucket to allow GET from * using the AWS S3 CORS configuration?
@jaunty juniper honestly i'm not sure if/how to run build_board_info locally... hm
I can test it by adding a print at the end
and then there's moving language_allow_list and the related daunting prospect of testing build_release_files.py, I guess CI will have to do that
CI does that everytime so I wouldn't worry there
I just tested a random file on S3 and get the CORS error still, but enabling the setting might work. I would need some AWS credentials setup on the circuitpython-build-tools repo to have it upload the bundle and json files there as well. Let me see if I can get this working first. I have a few tricks up my sleeves to try still.
I can setup your credentials for S3, or enable CORS on the S3 bucket (I haven't done this yet, just checked and they're blank), if we go that route.
Is the process to add a new board to Mu documented anywhere? I received guide feedback asking for it to be added to the "adding a board to CircuitPython guide" and I don't know the process well enough to add it.
@idle owl @tulip sleet is probably the expert about that at the moment. As I understand it, the process will be greatly simplified (or totally eliminated) once they take some enhancements he's been working on, but the schedule for that on mu's end was unknown last I heard.
Thanks. I'll talk to Dan about it when he's around next.
the status quo is that somewhere inside mu is a list of USB IDs and if your product is not an Adafruit product then you need to add it there. Soon, though, it'll just look for some other things in the USB information that say CircuitPython, is approximately the thing
Firmware
Adafruit CircuitPython 6.2.0-beta.4 on 2021-03-18; Raspberry Pi Pico with rp2040
Code/REPL
import time
import board
import digitalio
import analogio
import usb_hid
from adafruit_hid.mouse import Mouse
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
mouse = Mouse(usb_hid.devices)
kbd = Keyboard(usb_hid.devices)
x_axis = analogio.AnalogIn(board.A0)
y_axis = analogio.AnalogIn(board.A1)
btn_left =...
The guide feedback linked the file that needs to be changed, and what needed to be added. But I wasn't going to simply take that as valid.
@idle owl the Mu file containing the VID/PIDs for boards now wildcards all Adafruit boards. I have a PR pending to Mu that eliminates the need for this entirely: it looks at the interface description string for the REPL connection and decides it's a CircuitPython board that way
is the board an Adafruit or non-Adafruit board?
This would be a non-Adafruit board. The guide is how to add your board to CircuitPython.
So ostensibly it's other folx adding boards.
They haven't yet accepted my PR, but they haven't even started reviewing it. They were actually stuck on some CI problems.
@tulip sleet So for non-Adafruit boards, this still stands? they can submit a PR to Mu Editor, editing this file: https://github.com/mu-editor/mu/blob/master/mu/modes/circuitpython.py And adding their board to valid_boards. The format is like this: (VID , PID, "Manufacturer Name", "Device name")
yes, though my PR will supersede any new PR for a single new board
Removing this line resolves the issue.
The url is not present, so I don't know which line you mean. Could you edit your post?
Ok @jwcooper, let's go ahead and try using S3. It looks like none of my tricks are working.
Are the only-1s-accuracy alarm times just due to overhead or something like that? As long as they aren't being rounded to truncated to the nearest second, we could potentially fix that later.
@tidal kiln You around?
Do you actually have one of these nunchuck adapters? https://www.adafruit.com/product/4836
Dig out that old Wii controller and use it as a sleek controller for your next robot if you like. The Adafruit Adafruit Wii Nunchuck Breakout Adapter fits snugly into the Wii connector, and ...
i do
Aw come on.
Ok I need a favor. Can you check the I2C address?
Because the text on the back says 0x52, and the product copy and guide say 0x53
So something isn't right there.
interesting. yah. let me check. the adapter itself really doesn't have an address. it's just an adapter. but let me see what a nunchuk reports as...
I am 99% confident they are 0x52.
>>> import board
>>> i2c = board.I2C()
>>> i2c.scan()
[]
>>> i2c.scan()
[82]
>>> hex(82)
'0x52'
>>>
first scan with just adapter
second with nunchuk plugged in
nunchuk = original nintendo model
not the one in shop, if that matters?
This hopefully fixes linking on Windows with cmd.exe
np. mario out!
I'm going to have to make note of that. I remember not seeing it when I did a scan, but working when I tried the code. I bet I didn't have a nunchuk plugged in when I scanned...
worth checking, but still not 100%. there can be some odd things that don't scan well, but work fine otherwise.
I graphed the data

Would be good is someone else could check it in case my SQ25 is misbehaving but that seems unlikely.
$ make BOARD=adafruit_feather_rp2040 -j 32
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
Traceback (most recent call last):
File "gen_stage2.py", line 82, in <module>
typer.run(main)
File "C:/msys64/mingw64/lib/python3.8/site-packages/typer/main.py", line 859, in run
app()
File "C:/msys64/mingw64/lib/python3.8/site-packages/typer/main.py", line 214, in __call__
return get_command(self)(*args, **kwargs)
...
The language menus are in an arbitrary order, making it potentially confusing when looking for one. The order used is the one from the files.json file, which in turn depends on the way languages are listed with os.scandir in the circuitpython repository (build_board_info.py).
The displayed language names are in the board.html template. To sort by name the code uses Liquid's {%capture%} and split to make a new list with the name and the language code, so it can be sorted. This requir...
What is your current path? I was hoping pathlib would handle the path stuff for windows.
is this the correct list of excluded languages ? {'el', 'cs', 'ko', 'en_GB', 'hi'}
wait I could just look in the locale directory
(I looked, and it is)
Hi all! Linked below is a WebSerial demo with some tweaks for circuitpython.
This <200 line html file lets you access the serial terminal of your circuitpython boards using your browser!! Confirmed working in Chrome and MS Edge (v89+). Firefox and Safari will likely not work.
copy the text into a .html file and give it a go ๐
https://github.com/maholli/serialTerminal.com/blob/main/index.html
I'm always looking for easier ways to have my students connect to their circuitpython boards and this will be a game changer! File is small enough that I'll likely distribute boards to students with a similar html file onboard.
@lime trellis this is fantastic! I had tried the Google demo and some others, and they didn't quite work.
ditto! all credit goes to mmiscool. I just forked and added buttons so we can easily send some control characters to our boards
can the index.html be served or must it be local
it can be served
doesn't google chrome force pages to be accessed over https to use the serial port?
yes, but MS edge doesn't. Adafruit should host some version of the page so it's readily available
yeah, that would be really cool
update: works great hosted via github: https://maholli.github.io/serialTerminal.com/
On Ubuntu 20.04 with Chrome 89.0.4389.90, I am getting "Serial Connection Failed"
after choosing and hitting Connect
yeah I'm seeing that too from another device. Try connecting from https://www.serialterminal.com/. There appears to be something goofy as a result of github hosting.
The Google demo has the typing in-line, instead of a separate line. That can't be too hard. Let me find it...
THis does a weird disconnect when I try to type, though, that was the problem
agreed it should be tweaked to feel more like a terminal. props to the creator for making a simple template for us
I think a merging of the two might work out
https://googlechromelabs.github.io/serial-terminal/ works great for me in chrome and edge. able to halt, use REPL, etc...
are you on windows or linux
windows
that may be the difference. Try resetting the board and reconnecting with the Connect button and see if you get spurious DISCONNECTED
If I was previously connected, it works for me, but it does not work when started from scratch with a board that wasn't connected to web serial previously
both scenarios seem to work on windows. I'll try my linux machine tonight
would be interested to hear, thanks
This is awesome! Does Chrome have a way to edit files on the CIRCUITPY drive? It would be awesome for Chromebook users to have a web editor like MU to do all their work in.
https://photos.app.goo.gl/RrA6ntgNwnJnfuS16 My feather RP2040 driving the 128x32 oled has a glitch. Same code works with all of my other MCU. I believe I had the same issue with a Pico. That is Liz code without modification (AFAIR).
Found device at D:, running CircuitPython 6.2.0-beta.4-84-gc81007afb.
adafruit_debouncer==1.3.10
adafruit_displayio_ssd1306==1.3.1
adafruit_bitmap_font==1.3.7
adafruit_display_text==2.17.0
All is up to date.
Running Liz "I voted" badge on the Feather RP2040 and a FeatherWing 128x32 (I2C) I get garbage on the screen.
A video: https://photos.app.goo.gl/RrA6ntgNwnJnfuS16
All libraries are up to date and run the latest firmware.
The same screen on any of my other Feather does work with the same code.
I believe I have had the same issue with a pico and manual wiring to the FeatherWing.
Other piece of code driving that screen on the Feather RP2040 did not display that kind of problem (but may...
I don't know why I did believe it was from Liz. Maybe because of the "voting intro" in her video???
I need C.R.U.D. I get from btree or I could have used a text fileWm E Fitzpatrick(703) @.***
-------- Original message --------From: ajs256 @.> Date: 3/24/21 4:51 PM (GMT-05:00) To: adafruit/circuitpython @.> Cc: bill22152 @.>, Author @.> Subject: Re: [adafruit/circuitpython] btree for Circuitpython (#4477)
You can write files to the CIRCUITPY drive from user code. This guide gives you the basics.
โYou are receiving this because you authored the t...
Moves the language allow list to generate_download_info() and use it there too.
This syncs the list of languages on circuitpython.org with the builds.
I did some tests by adding a print of the generated json and using a test script digging into the data structure to compare it with the file generated from main (adding the same print to main), using beta and stable tags, checking that only the languages vary by what is expected.
Thank you โThis looks a lot like what I expected. Not merging because I hope @dhalbert will take a look too, and because CI's not through.
Could you try i2c = bitbangio.I2C(...) and see if it works better? That would again point to an issue with how the RP2040 I2C hardware is being used.
MicroPython has an optional btree module. Have you used it before? We have not turned it on in any CircuitPython builds.
This looks good to me! Thanks for doing this!
Minor Python thing: you can do return sorted(list(languages), key = lambda s: s.casefold()) as sorted(..., key=str.casefold). Not worth re-running for that, though.
We just pass the frequency on to the pico-sdk. Its frequency-setting code is here:
https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2_common/hardware_i2c/i2c.c#L63=L90.
It does trigger the error: "TimeoutError: Clock stretch too long"
# Set up display & add group
#i2c = board.I2C()
i2c= bitbangio.I2C(board.SCL, board.SDA)
display_bus = displayio.I2CDisplay(i2c, device_address=0x3C)
# ^^^ TimeoutError: Clock stretch too long
display = adafruit_displayio_ssd1306.SSD1306(display_bus, width=128, height=32)
group = displayio.Group(max_size=1)
display.show(group)
PS: Just in case I also checked inverting SDA/SCL but it give the same effect.
I recently filed a similar issue with a Feather RP2040 displaying garbage on a 128x64 OLED FeatherWing
Please see the issue for details, and I found a workaround by using a bus speed of 400kHz instead of the default 100kHz using i2c = busio.I2C(board.SCL, board.SDA, frequency=400000)
It seems specific to the RP2040 as I tried it with a number of other boards and displays and only had the issue with the RP2...
Using CircuitPython extension in VSCode. View>Command Palette>CircuitPython:.. fail with an error message that the command resulted in an error. That is true for all CircuitPython commands like Show Available Libraries...
Have you opened the D:\ folder in VSCode? The CP extension uses the boot_out.txt file found in the root of the D: drive and without it I have found the extension gives errors like what you describe.
Can you enable the VECTORIO_SHAPE_DEBUG macro and see if the rectangle shape is just computing the wrong width? It may be an issue with a transform.
That's what I thought. I put in https://github.com/raspberrypi/pico-sdk/issues/283 for this. It's curious the bitbangio code is also slow. I'll close this when it's acknowledged by RPi folk.
Just a "heads up" to others who have not been keeping up with the CP development tools... I updated to the tip of main today as I do most days and tried a build the adafruit_feather_rp2040. It failed because it now apparently needs cascadetoml to have been installed. No big deal, but a surprise. I went back to the building CP guide and noted what I think is a new step pip3 install -r requirements-dev.txt https://learn.adafruit.com/building-circuitpython/build-circuitpython I ran this and found I was missing several packages ... Everything is working now but it was a confusing start to the day.
Removing this line resolves the issue.
The url is not present, so I don't know which line you mean. Could you edit your post?
@dhalbert Thank you for the prompt response! I apologise, that comment was a leftover from the issue template that I missed and left there by accident. The rest of the issue description should be correct now.
Closing due to lack of activity...
This patch fixes some of the build problems but not all of them
0001-supervisor-Resolve-genhdr-devices.h-No-such-file-or-.patch.txt
The other type of problem I saw was in flash device naming changing slightly, it looks like fixing that may be more of a manual problem.
This is the RP2040 doing clock stretching apparently but will be interesting to see if it's doing it in appropriate places for fast mode.
This resolves: https://github.com/adafruit/circuitpython/issues/4478 where residual graphical debris was left over when vectorio.Rectangle is moved.
Turns out the rectangle was 1 pixel too large. Also corrected the rectangle area that handles refreshes, will slightly reduce the dirty area by 1 row and 1 column.
I've got a pre-commit question. I've staged only a few files for a commit. When I run pre-commit I get this:
margaret@iMac circuitpython % pre-commit
[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to /Users/margaret/.cache/pre-commit/patch1616685107.
Check Yaml...........................................(no files to check)Skipped
Fix End of Files.........................................................Passed
Trim Trailing Whitespace.................................................Passed
Translations.............................................................Passed
Formatting...............................................................Failed
- hook id: formatting
- files were modified by this hook
[WARNING] Stashed changes conflicted with hook auto-fixes... Rolling back fixes...
It's not saving the formatting fixes on my files, maybe because I have un-staged files? How can I get the formatting to update the files that I have staged and make a commit?
@mental nexus you can run formatting on a specific set of files by pre-commit run --files file1 file2...
Ok, I'll try that. In the meantime I messed up my branches and misplaced my files. Bleh. Will get help in the git channel.
Thanks Jerry! I should have let folks know in the meeting
I did revise the Building guide very recently after someone reported the issue. I will try to make an announcement in-channel if I do revise the instructions.
(The build issue was that data/nvm.toml was empty and needed a git submodule update --init.)
What that was saying was that some changes you had weren't staged, so they got stashed. However, some of the files that were modified by the pre-commit hooks changed files that were stashed when pre-commit was started, and git wasn't able to reconcile the difference between the two, so it couldn't "undo" the stashing.
@onyx hinge we really shouldn't need dma for spi
the peripheral has a 16 word transmit FIFO
(though dma insulates the transfer from interrupts)
@slender iron my gut agrees with you, yet using the FIFO-based API in the sdk gives the results seen on the PR: big gaps between bytes
If you have something I could look at first before doing DMA I'm open to it
I considered seeing whether by bypassing the SDK and just touching the registers I could do better
I have used btree in 'Python', 'C' and 'C++' projects in the past and it works well at mapping hash arrays to storage..
It's light weight and easy to use.
Will MicroPython run on a PyPortal?
welll looks like my fix for flash files wasn't right & complete. I hope it's still a step in the right direction @slender iron
MicroPython is not supported on the PyPortal. If you would like some kind of keyed storage immediately, you can use the json module and read and write JSON files, though it will not be as efficient as btree. We can leave this open if you would like something like btree in the long run.
No worries @onyx hinge. Iโll look at the flash stuff after breakfast. Is the sdk waiting on a fifo empty flag instead of fifo full?
Adafruit CircuitPython 6.2.0-beta.2 on 2021-03-01; Raspberry Pi Pico with rp2040
mem_free = 137
Traceback (most recent call last):
File "code.py", line 74, in
File "adafruit_display_shapes/rect.py", line 47, in init
MemoryError: memory allocation failed, allocating 19200 bytes
try:
Disp = displayio.Group(max_size=(20+3*(12+1)))
# Blue Background
Disp.append(Rect(0, 0, WIDTH, HEIGHT, fill=BLUE)) #line 47
...
Following up on: https://github.com/adafruit/circuitpython/pull/4432
This change removes display_area_expand since it didn't check for empty areas and moves to display_area_union which properly checks for empty areas.
Also adds one use of display_area_canon to vectorio to reduce duplicated code.
Even if RAM is free, it may not have a large enough contiguous "chunk" available for the size of the item you're trying to create.
If it will work for you, the best option is probably to use a vectorio.Rectangle since that won't need to allocate so much RAM for the display_shapes.Rect (that uses a bitmap). If you are using a lot of shapes (polygons, rectangles, circles), consider using vectorio for all of them. Here are the [docs for vectorio](https://circuitpython.readthedocs.io...
This question is better asked in discord or the foruums. You are running out of RAM due to something, probably what's in ... lots of code ...
Also, as of 6.2.0-beta.3, a Group uses an unbounded list internally, so you can just remove the max_size; it is now ignored as of beta.3.
I could have 59 if the program would continue to run.... but its ending
before I get there..
Does the vectorio module have bitmap fonts?
On Thu, Mar 25, 2021 at 12:40 PM kmatch @.***> wrote:
Even if RAM is free, it may not have a large enough contiguous "chunk"
available for the size of the item you're trying to create.If it will work for you, the best option is probably to use a
vectorio.Rectangle since that won't need to allocate so much RAM for the
display_shapes.Re...
@onyx hinge got a link to the spi code in the nxp sdk?
You can use bitmap_label for any text and then vectorio for polygons circles and rectangles.
Sounds like you have a lot going on so youโll have to search for any opportunities to save RAM.
Also, if I comment out the board.DISPLAY.show(Disp) line
The code runs as it should. So all the Groups are being build and layered as they should, It's only when I attempt to Show() that is dies, but it doesn't always die at the Show() most times it will loop and die when I am re-adding the groups.
@slender iron https://github.com/adafruit/MIMXRT10xx_SDK/blob/master/devices/MIMXRT1011/drivers/fsl_lpspi.c#L778
while (LPSPI_GetTxFifoCount(base) == fifoSize)``` the most basic thing you suggested to check seems to be as expected
ya, that looks correct
If youโre willing to share your code I have a base PyPortal here I can try it out on.
yet from the traces it never successfully gets a 2nd byte into the FIFO before the first byte is shifted out.
there is a retry loop in common-hal
if (((NULL == rxData) || (rxRemainingByteCount - txRemainingByteCount) < rxFifoMaxBytes))```
This was a bit confusing to wrap my head around, but I think it's right
the retry loop in common-hal is only for the "is busy" case, if it's not busy the single call does the whole transfer. /* Check that LPSPI is not busy.*/ if (LPSPI_GetStatusFlags(base) & kLPSPI_ModuleBusyFlag) { return kStatus_LPSPI_Busy;
didn't nxp post the code on github now?
I dunno, the one we use was just imported by arturo into a repo with empty history
right, I feel like greg pointed me to it on github
oh that would be useful. It didn't seem to be any of them here https://github.com/NXP
yup, that's what greg pointed to
It's not obviously, hugely different than what we have
https://www.nxp.com/docs/en/errata/IMXRT1010CE.pdf nothing obvious
yes
ยฏ_(ใ)_/ยฏ
switching to that is basically what I was intending to do
it all looks right to me
but .. how is it spending 8000 CPU cycles between putting a byte in the FIFO !?
well its likely on a slower memory bus
so checking all the registers could be slow
have you logic analyzered the spi flash?
I'm trying to remember where I saw the memory structure map
a/devices/MIMXRT1011/drivers/fsl_lpspi.c
+++ b/devices/MIMXRT1011/drivers/fsl_lpspi.c
@@ -777,2 +777,3 @@ bool LPSPI_CheckTransferArgument(lpspi_transfer_t *transfer, uint32_t bitsPerFra
*/
+__attribute__((section(".itcm.LPSPI_MasterTransferBlocking")))
status_t LPSPI_MasterTransferBlocking(LPSPI_Type *base, lpspi_transfer_t *transfer)
@@ -1813,2 +1814,3 @@ void LPSPI_SlaveTransferHandleIRQ(LPSPI_Type *base, lpspi_slave_handle_t *handle
+__attribute__((section(".itcm.LPSPI_CombineWriteData")))
static uint32_t LPSPI_CombineWriteData(uint8_t *txData, uint32_t bytesEachWrite, bool isByteSwap)
@@ -1897,2 +1899,3 @@ static uint32_t LPSPI_CombineWriteData(uint8_t *txData, uint32_t bytesEachWrite,
+__attribute__((section(".itcm.LPSPI_SeparateReadData")))
static void LPSPI_SeparateReadData(uint8_t *rxData, uint32_t readData, uint32_t bytesEachRead, bool isByteSwap)
``` I tried putting MasterTransferBlocking and everything it calls that is not inlined into itcm and it did not help
hrm
it's possible I got it wrong since I had to write it out rather than use our macros
0x00000000000019e8 0x4c build-imxrt1010_evk/supervisor/flexspi_nor_flash_ops.o
0x00000000000019e8 flexspi_nor_flash_page_program
.itcm.LPSPI_CombineWriteData
0x0000000000001a34 0x50 build-imxrt1010_evk/sdk/devices/MIMXRT1011/drivers/fsl_lpspi.o
.itcm.LPSPI_SeparateReadData
0x0000000000001a84 0x68 build-imxrt1010_evk/sdk/devices/MIMXRT1011/drivers/fsl_lpspi.o
.itcm.LPSPI_MasterTransferBlocking
0x0000000000001aec 0x22c build-imxrt1010_evk/sdk/devices/MIMXRT1011/drivers/fsl_lpspi.o
0x0000000000001aec LPSPI_MasterTransferBlocking
.itcm.common_hal_neopixel_write
0x0000000000001d18 0xd8 build-imxrt1010_evk/common-hal/neopixel_write/__init__.o
0x0000000000001d18 common_hal_neopixel_write
```but the map file looks right
ya, seems right
what is you change the wait to read the current amount once and set the difference?
instead of checking to see if it's full each write
I'm sure the low speed bus is still much faster than the spi transmit
does the data need to be coming from the right RAM area?
for dma yes
dma can't access TCM
afaik
an interrupt could be slowing down the cpu core
maybe usb
do you get the gaps when not connected to usb?
Bumping this, as i ran across it for my use case.
Building a remote anemometer/wind vane station, with solar/battery and LoRa.
The anemometer is a simple pulse device, with 1 pulse per rotation. I expect it to be pulsing in the low seconds to milliseconds range.
This rules out using the frequencyio and pulseio modules, and leaves me with countio, which will have the problem @dmopalmer mentions of not using period timing.
This means i will have to do longer samples, wasting more power...
import gc
import time
import sys
import board
import busio
import adafruit_bme280
import displayio
from adafruit_display_shapes.rect import Rect
from adafruit_display_shapes.line import Line
from adafruit_display_text.label import Label
from adafruit_bitmap_font import bitmap_font
def printf(format, *args):
sys.stdout.write(format % args)
def eprintf(format, *args):
sys.stderr.write(format % args)
i2c = busio.I2C(board.SCL, board.SDA)
bme280 = adafruit_bme280.Ada...
This should be doable with Python code because members of each group are accessible. It isn't something we need to add to the core.
`import gc
import time
import sys
import board
import busio
import adafruit_bme280
import displayio
from adafruit_display_shapes.rect import Rect
from adafruit_display_shapes.line import Line
from adafruit_display_text.label import Label
from adafruit_bitmap_font import bitmap_font
def printf(format, *args):
sys.stdout.write(format % args)
def eprintf(format, *args):
sys.stderr.write(format % args)
i2c = busio.I2C(board.SCL, board.SDA)
bme280 = adafruit_bme280.Ad...
`
import gc
import time
import sys
import board
import busio
import adafruit_bme280
import displayio
from adafruit_display_shapes.rect import Rect
from adafruit_display_shapes.line import Line
from adafruit_display_text.label import Label
from adafruit_bitmap_font import bitmap_font
def printf(format, *args):
sys.stdout.write(format % args)
def eprintf(format, *args):
sys.stderr.write(format % args)
i2c = busio.I2C(board.SCL, board.SDA)
bme280 = adafruit_bme280....
Looks like a good cleanup! Thank you!
@slender iron figured it out ๐
nice!!! what was it?
30MHz transfer yay
there are several delays which are configured by default ``` masterConfig->pcsToSckDelayInNanoSec = 1000000000 / masterConfig->baudRate * 2;
masterConfig->lastSckToPcsDelayInNanoSec = 1000000000 / masterConfig->baudRate * 2;
masterConfig->betweenTransferDelayInNanoSec = 1000000000 / masterConfig->baudRate * 2;
is it toggling CS every byte?
If I set them all to 0, the gaps go away. I think it's the betweenTransferDelay
this flag also may have helped: xfer.configFlags = kLPSPI_MasterPcsContinuous
anyway, I'll tidy it up but this looks very good at the moment
No, we never enable the "internal" CS output
we always use our software CS in CircuitPython
.. right?
no, Continuous on its own tightened things up a bit but it was not the resolution.
hrm, weird
// SPI bus noise before they are put into SPI mode.
config.baudRate = 250000;
hmmm, these initial settings were also made with a baudRate of just 250kHz, so they ended up being very big numbers when you switched to 30MHz instead of 250kHz. the settings were relative to some default baudrate, which we then set to another rate
those default delays were hidden inside SDK, not in CP
๐
Great news! Using S3 solves the CORS problem. For the moment, I only have it allowing a couple test sites I'm using and the Adafruit GitHub pages domain (where it will ultimately end up). We can add other domains as well or just open it wide up.
@fivdi Want to PR here as well? https://github.com/adafruit/pico-sdk We can then merge this into CP sooner than upstream has it.
@tannewt ok. Against which branch of https://github.com/adafruit/pico-sdk?
Good question! I just made a circuitpython branch to track what we're using in CP. Thanks!
last thing to check is whether the sdk code needs to be in itcm to work at 30MHz
nope, fine without it
๐
It's possible to configure very large gaps between transfers (bytes), and indeed this is what we ended up with by using LPSPI_MasterGetDefaultConfig.
Set all the delays to zero, enable a bit for "continuous transfers", and cap the speed at 30MHz per the datasheet's restrictions.
After this change, here is a view of a transfer at 30MHz:

I tested on the MIMXRT1010-EVK both wi...
One question. Good otherwise! Nice bug hunting!
Is this true for the 1060 as well? I bet it is but it'd be good to check.
Ok, here's my first cut at it. Main changes:
- Separate the stagnant graphics (stored into the
background_Dispgroup)and dynamic graphics (foreground_Dispgroup) into separate groups. - I further broke
foreground_Dispinto three subgroups, each subgroup holds one set of measurement lines:T_group,P_groupandH_group - After each measurement, pop all the items out of the
T_groupand re-append all the lines. Repeate withP_groupandH_group. - I replaced the stagnant rec...
One more thing, the display_shapes library has a Sparkline in case you don't want to roll your own like you did here.
Yes. I hadn't checked before but I did just now -- the same 30MHz limit is specified in https://www.nxp.com/docs/en/nxp/data-sheets/IMXRT1060IEC.pdf
Nice work! Thank you!
@tulip sleet I have a tricky problem.
Thanks @cedar moth. In VSCode,I have opened the drive on the Pico (F: in my case ) and then opened the code.py file (which is a simple flash the LED program), and tried running it. If I try View>Command Palette>CircuitPython:... it still fails with the "resulted in an error message". Other commands also fail. I have similar failures with the Pico-go commands. I'll keep poking around. Any ideas about a good help sight for VSCode.
@tulip sleet On STM32, the WKUP pin function just fine when in true deep sleep, but it cannot actually wake from WFI, and it in fact disabled all other functions of that pin when not in sleep mode. So it's impossible to have a program that can handle both true and false deep sleep without making a judgement on whether the program is connected to usb when the alarm is created
In the ESP32 case, the program only makes that judgement when it actually starts deep sleeping, since a pin can function as both a false and true deep sleep wakeup.
Or maybe I should dynamically reconfigure the pin only when true sleep actually starts, based on whether it was requested earlier... that's probably the way to go, nevermind.
yup, the last thing is what i was going to say; you just have to remember the pin and do the work when you know
definietely faster - esp32spi not working now but probably because some edge case in timing is being hit in the nina-fw.
@tulip sleet yeah STM32 only has one viable wakeup pin so it's actually pretty easy
@dglaude I am not seeing this problem with the following simpler test program. Could you try this one? I am testing with the absolute latest build (built locally): 6.2.0-beta.4-93-g0105b30a0
import board
import displayio
from adafruit_display_text import label
import adafruit_displayio_ssd1306
import terminalio
import time
displayio.release_displays()
i2c = board.I2C()
display_bus = displayio.I2CDisplay(i2c, device_address=0x3C)
display = adafruit_displayio_ssd1306.SSD1...
displayio.ParallelBus on the Feather RP2040 works!
๐
however, I expected it to be a bit faster, is there a frequency setting somewhere?
I see there is, just undocumented
If you have any speed comparisons vs other boards, I'm interested. Here's my benchmark that I've used to compare a couple of boards: https://github.com/adafruit/circuitpython/pull/4047#issue-560212220
It should default frequency to the fastest I got it to work
but I thought it may be faster too but cannot see anything that is slowing it down compared to other ports. Let me know if you notice anything
i played with my original code and placed a show() after each section
(background, Temp, Humid, Pres) and the issue went away...
Maybe to many groups at one time? strange...
But now I'm switching to your code.. Thank you...
Also?? you didn't like my printf() function?
@blissful pollen it defaults to 30_000_000, I got it to work with 62_500_000
I'm really not familiar with pio yet
which display are you using?
Z320IT002 โ that is a 3.2" tft with ILI9341 COG
Hmmm yeah I will have to play around again to see. I ran into issues going any faster on the display I have. But that's why frequency is there ๐
I appreciate its presence
though I think it might go even faster, if the pio allowed
I mean the display could probably handle it
It takes 2 PIO cycles to control so I know that maxes at 60Mhz (120 divided by 2 instructions). The frequency setting takes that into account... or should unless I made a mistake hmm
Maybe doing show() cleared out some of the old memory references that you obliterated when redoing the Group, so maybe they can get freed up by the garbage collector. Your guess is as good as mine. Whatever works!
As for printf, that was new to me. Rather than fight it, I traveled a known path. Didn't want to get distracted from the core problem at hand. But I will add something new to things I need to learn about.
well, I did a binary search looking when I get the fequency out of range error, and I found exactly 62_500_000
hehe, the datasheet says write cycle is 33ns, so 30Mhz sounds about right
Getting there, sorry! Usual catastrophe of things competing for my attention.
I was really expecting the parallel interface to be faster than SPI, but it isn't
Maybe it hits a CP limit elsewhere? I'd have thought so too
Thanks, that's a better fix than what I proposed.
I've split this changeset from #4378 so the two tangentially related things aren't muddied together, and so that #4378 is no longer blocked by this somewhat more controversial (and far reaching) change.
I know the i2c pullups on the RP2040 are a little on the weak side for i2c, but I've got tested prototypes that appear to be reliable with them. There's some related discussion on #4378.
This change may or may not be worthwhile or useful to someone, but with the issues bitbangio presen...
I've refined this PR to its original clear purpose: removing the short-write bitbang for 1-2 byte writes, supporting only 0-byte writes.
I have raised a new PR #4488 for the i2c pullup changes.
@blissful pollen possible, I will look closer with a logic analyzer over the weekend
Thanks! I am going to test this change almost immediately with several sensors, in conjunction with some other I2C testing I am doing.
Written to get audiomixer working on the RP2040, but this may work on other non-M4 devices.
Tested on an ItsyBitsy M4 (for compatibility) and Feather RP2040.
The RP2040 seems to have a separate audio issue after repeat playings adding in a crackle. I could reproduce this without audiomixer so think that is a separate issue. First play through is clean sound.
Here is how I tested it on both devices.
import board
import audiocore
import audiomixer
import digitalio
import time
from audiopwmio import PWMAudioOut as AudioOut
time.sleep(1)
a = AudioOut(board.A0)
one = audiocore.WaveFile(open("one.wav", "rb"))
two = audiocore.WaveFile(open("two.wav", "rb"))
mixer = audiomixer.Mixer(voice_count=2, sample_rate=16000, channel_count=1,
bits_per_sample=16, samples_signed=True)
print("playing")
a.play(mixer)...
mmmm maybe now we would need an equalizer widget ๐ค
Hardware
Metro M4 Express Airlift link
Firmware
Contents of INFO_UF2.TXT:
UF2 Bootloader v3.13.0 SFHWRO
Model: Metro M4 AirLift
Board-ID: SAMD51J19A-Metro-AirLift-v0
CircuitPython version adafruit-circuitpython-metro_m4_airlift_lite-en_US-6.1.0.uf2
Issue
Board does not show up as CIRCUITPY drive, even after going thr...
Firmware
adafruit-circuitpython-adafruit_feather_rp2040-en_US-6.2.0-beta.4.uf2
adafruit-circuitpython-bundle-6.x-mpy-20210324
Adafruit CircuitPython 6.2.0-beta.4 on 2021-03-18; FeatherS2 with ESP32S2
Code/REPL
import board
import busio
import adafruit_rfm9x
spi = busio.SPI(clock=board.IO36, MOSI=pin.IO37, MISO=board.IO35) # Init SPI Bus
print("SPI bus INIT OK")
rfm9x = adafruit_rfm9x.RFM9x(spi=spi, cs=board.IO5, reset=boar...
I tested this on several sensors and an SSD1306 display. All work fine. Thank you!
This is very unusual. I successfully loaded recent builds on a Metro M4 Express AirLift. Can you get to the REPL? Try to ctrl-C and try import storage; storage.erase_filesystem(), which will reformat CIRCUITPY.
What kind of host computer are you using, and what version of the operating system?
If the reformat doesn't help, I'd suggest two more things::
- If it's Windows, clear out the USB devices using the USB Device Cleanup tool from here: https://www.uwe-sieber.de/misc_tools_e.htm...
Looking at the datasheet for the RT1062, it looks like it includes a touch screen controller for resistive touch screens:

I think I found a mistake in the documentation for the stm32f405 feather. In https://learn.adafruit.com/adafruit-stm32f405-feather-express it says the following ```Only MicroPython has support for CAN bus at this time. Arduino has an open issue, no support. CircuitPython does not have CAN support.
FYI, the docs for aesio functions don't mention padding: https://circuitpython.readthedocs.io/en/latest/shared-bindings/aesio/index.html. This might be a useful addition to reduce confusion either for those that have never used it or those that are used to the underlying nRF52 functionality. Came up in https://forums.adafruit.com/viewtopic.php?f=60&t=177264
For crackles and reproducible CircuitPython hangs with audio see #4208. Also #4431 for memory corruption.
And copy some files onto CIRCUITPY while audio is playing if you want extreme crackles reminiscent of 8bit computers loading data off tape - keep your volume low.
Thanks for your detailed display update on hackaday. Itโs good to see the details since it doesnโt always โjust workโ. Anyway, looking at the ILI9341 it looks like a minimum 20ns write time in parallel mode, so is 50Mhz the top limit?
@mental nexus yeah, that would be the maximum guaranteed to work, but in practice you can usually go faster
@mental nexus also, I think the slowness is not due to the slow speed of the clock, but pauses between transmissions
I plan to work on this over the weekend a bit, and the first thing I want to do is to compare with samd51 to see if there is any noticeable difference in speed
Compared to the pyportal I have seen slightly faster pure redraw rates from the ESP32-S2 so Iโm interested in how the RP2040 compares. I just ordered a Teensy 4.1 so Iโm interested to see how fast the iMX. I seem to remember seeing a limit somewhere in the imx datasheet of 75MHz but Iโll need to dig deeper.
Thanks - I have fixed that. canio is available on the STM32 Feather. @onyx hinge The same guide remarks that CircuitPython has just added SDIO support! However, it is still considered unstable and may see further development. Would you say it is more stable now or should we leave that.
Thanks. I am working on a project that will use a can bus and wanted to clarify and make things clearer for myself and others.
@kevinjwalters suggested adding info about padding in the aesio documentation. Some user confusion here: https://forums.adafruit.com/viewtopic.php?f=60&t=177264.
Alternatively perhaps the module might be smarter about padding itself. (I have not looked into this in any detail, so I may be wrong that it makes sense.)
BTW, nRF provides native AES support.
tnx - I have opened an issue for this
@tulip sleet I don't think we need to say SDIO is experimental on stm32f405 feather anymore
๐ I will update the guide
appreciate it @tulip sleet
hi if you have tech support questions, please post them to the seeed xiao forums :)
Please disregard.
The FeatherS2 has labels SDI and SDO on the board, but when connecting the RFM module, they must connect to the opposite:
SDI -> MISO and SDO -> MOSI
Where as on the Pico and some other boards it's MOSI -> MOSI and MISO -> MISO.
Which sort of makes sense, In -> Out, Out -> In
In my case, I have simply flipped the pins in code:
import board
import busio
import digitalio
import adafruit_rfm9x
import feathers2
# Make sure the 2nd LDO ...
@unexpectedmaker please add to your documentation!
I'm not sure I see the problem -- SDI is Serial Data In so in the Master device this is MISO - Master In Slave Out
@kevinjwalters please test out this PR :)
@prime flower I looked at the Wiznet5k+Requests issue, but don't know how to fix the incompatibility
Is there a UF2 for this?
@gamblor21 Are volume levels the same? I think they should "fail" to match due to https://github.com/adafruit/circuitpython/issues/3210
yes you can download UF2 artifacts from the actions run matching this PR
https://github.com/adafruit/circuitpython/actions
definietely faster - esp32spi not working now but probably because some edge case in timing is being hit in the nina-fw.
Nice work! Thank you!
hi, I'm looking a way to get nice animations for Dotstar rbw 2328 stripes
like you can find with processing NEopixels through fadecandy
@timber mango #help-with-circuitpython is better for "how do I" questions, but check out the LED animations guide from Adafruit: https://learn.adafruit.com/circuitpython-led-animations
ah sry, 1st time here
welcome!
thanks
yay this now works for ESP32SPI!
I re-tested this and the 128x64 OLED is working for me in SPI mode with #4487. It may have been fixed even earlier.
Double checked that sdcardio still works after #4487.
this issue seems specific to the BNO055 which is a wretched chip, may be related to clock stretching
I just faced the same problem with my PyPortal Titano under Win10. Looking in the Device Manager, I found a USB Mass Storage device that was disabled. I enabled it and CIRCUITPY mounted instantly.
@bludin Thanks for the tip! Do you have any idea how that happened? Was there some USB error at some point and Windows may have disabled it?
@lone axle hihi can you look at https://forums.adafruit.com/viewtopic.php?f=60&t=177110&p=863371#p863371 - it seems a little wierd that a titano with 256KB of RAM cannot run this program. like it seems that some change in the text/label system is hogging all the RAM
I can take a look later tonight or over the weekend. But I don't have a Titano to test with. I do think the theory posed about the larger screen size is likely on the right track though. At first glance it looks like the code makes a Bitmap object based on the size of the display. One thing I would recommend is using bitmap_label instead of label in all cases that I have come across it leads to less memory usage, and with longer strings the savings can be fairly significant. It should be easy to try it by switching the import at the top of the file. I'll post a comment on that thread once I have a chance to dig in further.
@dhalbert I didn't notice anything along these lines. The only reason why I even looked in that place is because the description of the USB Device Cleanup tool mentioned that you could also delete USB devices one by one from the Device Manager.
Possibly the Bitmap could be reduced to half the screen size and then scaled by 2 using a Group. That would save some memory I believe at the cost of slightly "chunkier" resolution.
There may also be some savings to be had by not using the PyPortal helper library. It looks like that is being used only for the display and playing sounds at first glance. Those could possibly be done with core APIs only and it would save a few imports.
@lone axle i think there's something else, 256KB is a massive amount of RAM.... is the bitmap being made thats 16-bit color?
looks like only 4 colors to me:
plot = displayio.Bitmap(GWIDTH, GHEIGHT, 4)
I am running Ubuntu 20.04. Now that I think about it this is the first update Iโve done w this OS on these boards, but like I said worked for some boards
I found that with the following code, the with-statement is never entered (circuitpython waits forever). However, if I change the type of spi bus to board.SPI() aka busio.SPI, it completes.
# spi = board.SPI()
spi = bitbangio.SPI(board.SCK, MISO=board.MISO, MOSI=board.MOSI)
cs = digitalio.DigitalInOut(board.D10)
dev = adafruit_bus_device.spi_device.SPIDevice(spi, cs)
print("before with-statement")
with dev as card:
print("with-statement")
print("after with-statement"...
@ladyada this is one of the problems that prevents bitbangio to work with adafruit_sdcard, the other is that the constant write value during an SPI read transaction is not supported.
@jackhwolf I also tested on Ubuntu 20.04 Have you tried the storage.erase_filesystem() yet, and have you rebooted the host machine between trials?
Has to stay enabled in unix port for the sake of tests/extmod/ure_debug.py
I wonder if a better way to do this would be to have a
synthiomodule with a class that takes in a midi stream and generates audio samples.
MIDI would be a good way to buffer changes into the sound generation code.
There you go :) Essentially the same code, but taking MIDI stream as input.
@onyx hinge or @mental nexus do you know if using a PCF font would be expected to consume less RAM than the same font, but BDF format? I know there was a loading speed boost, but unsure about other RAMifications ๐
@prime flower are you around ?
@onyx hinge https://github.com/hathach/tinyusb/discussions/753#discussioncomment-535334 mentions a conflict between the CAN peripheral buffer and USB. Is this some kind of issue for us?
in meeting, ill be free in 25m
No rush... I've blocked out time to work on AzureIoT today focusing first on the ESP32SPI
Firmware
Tried both the 6.1.1 stable and the below with same results on the feather nrf52840
Adafruit CircuitPython 6.2.0-beta.4 on 2021-03-18; Adafruit Feather nRF52840 Express with nRF52840
tried 2 versions on the feather nrf52840
adafruit-circuitpython-bundle-6.x-mpy-20210303
adafruit-circuitpython-bundle-6.x-mpy-20210326
The code.py is the example ble_broadcastnet_battery_level.py
I'm getting the below error in the library adafruit_ble_broadcastnet
line 171 se...
@idle wharf ping!
@lone axle I would expect the final memory usage to be about the same
Hey @prime flower I'm trying to get just the SPI version working again.
https://github.com/askpatrickw/Adafruit_CircuitPython_AzureIoT/compare/fix24-spi
The send is failing... (let me get you a screen grab)
1967.96: DEBUG - Sent!
1968.83: INFO - - iot_mqtt :: connect :: iotc-738e1892-03dd-4ad0-be4a-c69e3c9a5182.azure-devices.net
1968.83: DEBUG - Attempting to establish MQTT connection...
1968.83: INFO - Establishing a SECURE SSL connection to iotc-738e1892-03dd-4ad0-be4a-c69e3c9a5182.azure-devices.net:8883
Traceback (most recent call last):
File "code.py", line 106, in <module>
File "/lib/adafruit_azureiot/iotcentral_device.py", line 160, in connect
File "/lib/adafruit_azureiot/iot_mqtt.py", line 387, in connect
File "/lib/adafruit_azureiot/iot_mqtt.py", line 133, in _create_mqtt_client
File "/lib/adafruit_minimqtt/adafruit_minimqtt.py", line 437, in connect
File "/lib/adafruit_minimqtt/adafruit_minimqtt.py", line 271, in _get_connect_socket
RuntimeError: Repeated socket failures```
I'm using the iotcentral simple example as my test.
I can't see what is wrong with iot_mqtt connect or _create_mqtt_client
I was just about to use the minimqtt spi sample to verify it works first. But if you see something obvious that would be helpful.
Correct, bad choice of words before I got the screen ouput. The registration steps do suceed
@tulip sleet That USB vs CAN memory doesn't ring a bell for me.
yeah, I don't know what to make of it
Your credentials and scope and everything else are correct?
Is the root cert for AzureIoT in nina-fw still correct?
@gamblor21 Are volume levels the same? I think they should "fail" to match due to #3210
I didn't test, they sounded "close" but not sure I have anything around sensitive enough to test that. I will see if I can reproduce it.
As to the crackling mostly just pointed it out that it was pre-existing and not due to the mixer code.
That is interesting,... I did have to update the Nina FW. I just got the airlift, so if latest firmware is good then I'd say so.
this is with Azure IoT Hub or Azure IoT Central?
IoT Central, on a known working instance. Verified the scope, id and key are good
lol i am confused...hol don
So, registration.py first file is OK?
Or are you running a file which interfaces with adafruit_azureiot/iotcentral_device.py
I'm using the IoT Central simple example to validate the library changes as I go.
https://github.com/adafruit/Adafruit_CircuitPython_AzureIoT/blob/master/examples/azureiot_central_simpletest.py
IoTMQTT looks like it matches latest MiniMqtt... https://github.com/adafruit/Adafruit_CircuitPython_AzureIoT/blob/master/adafruit_azureiot/iot_mqtt.py#L111
It looks like it's failing during get_connect_socket in MiniMQTT, I'd start by looking here: https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT/blob/master/adafruit_minimqtt/adafruit_minimqtt.py#L243 and validating the: host, port, ssl context, and interface
Thanks @prime flower its helpful to have someone validate you're headed on the right path.
I'm also going to run the minimqtt spi sample once to verify nothing in my firmware(s) or dependencies is involved. Not likely I think, but worth checking.
Agreed
I'd try to test with only MiniMQTT as much as possible to narrow down the issue if you can
achievement unlocked! ๐
Adafruit CircuitPython 6.1.0 on 2021-01-21; Adafruit QT Py M0 Haxpress with samd21e18
>>> print("i am not cat")
i am not cat
>>>
Thank for that @tidal kiln
@lone axle talking about pcf fonts .https://github.com/endico/breathable/issues/1
I invoke a calibration mode with import("calibrate") at the beginning of code.py In calibrate.py, I set text in 2 labels, run some timers and press some buttons. It doesn&...
@tulip sleet I'm trying to get https://www.serialterminal.com/ to work. It connects only when using that URL, none of the other URLs from maholli, or trying from a local version of the index.html. But I'm not sure it's doing anything once I'm connected. I'm using Chrome.
I can type something in, and it shows up below n next to >. But it doesn't appear to be a REPL or anything.
maholli only tested it on windows
did you click the "Connect" button in the upper left?
Yes.
i have similar issues on Linux
And it popped up a window for me to click on a device. Chose the CPX, and then kinda nothing.
Hmm ok.
yeah, I get this:
i am using Chrome, but I get it on Linux after I try to type somethign
https://googlechromelabs.github.io/serial-terminal/ also works in windows, according to maholli, and it doesn't have the Arduino-style single-line input
but it keeps disconnecting on Linux
I have a Windows VM, but that's a whole other bucket of fish.
That works for me on MacOS!
close the browser and reopen it; sometimes it works after it fails for me, but it doesn't work the first time; it's weird
yeah, sometimes I get it to work without knowing why
like, what it I do that's it now working?
someone needs to spend some time on this. it may well be a Chrome bug in the implementation of Web Serial.
but the potential is great
hmm yeah
i'd expect the low-level implementations to be different for each OS. I saw something similar (works on some platforms, not others), when trying their gamepad support
Restarted browser, still "connects" but then nothing happens.
if you type ctrl-C or return, then nothign?
No response.
The googlechromelabs one works. on MacOS.
the serialterminal.com one doesn't.
try the googlechromelabs one with a fresh browser
I did, it still works
well, that's as much news as serialterminal.com, maybe
maybe it's a paragraph that says: this is flaky, but try it out; if you're a JavaScript/browser expert, maybe you can help
hmm maybe yeah
the serialterminal.com one looks inspired by Arduino Serial Monitor
Tried serialterminal.com in my windows VM, but I'm unconvinced it's not working other than because USB is flaky in a VM.
i'll try it on a real windows machine
It's ok. We don't need to spend more time on it right now. I'll ping Limor with the results and see what she thinks
@idle owl i just had to power up my desktop Windows machine. the googlechromelabs one works. serialterminal.com is flakier
This required both adding support for the "default write value" in bitbangio.SPI, and also supporting duck-typing in adafruit_bus_device's SPIDevice which, surprisingly, was overlooked when we fixed I2C.
Now, the following code works, tested on RT1010-EVK:
import os
import board
import bitbangio
import adafruit_sdcard
import storage
import digitalio
spi = bitbangio.SPI(board.SCK, MISO=board.MISO, MOSI=board.MOSI)
cs = board.D10
sdcard = adafruit_sdcard.SDCard(spi, d...
Deferring this to 7.0.0 or post 6.2.0
@prime flower You'll be happy to know that the minimqtt sample worked flawlessly so it is definitely something in the config or he way the library is calling Minimqtt.
I'm going to setup an IoT Hub and work that side as well so I can verify against the IoT Central path. Thanks again !
@tulip sleet "RM0091" is about STM32F0x1/STM32F0x2/STM32F0x8, so it doesn't relate to STM32F405/407. The latter are the only ST MCUs that have canio enabled
I think CircuitPython is only on F4/F7/H7 so it's not relevant for us
ah, good, whew
That "Hello World" count down does work fine with my
Adafruit CircuitPython 6.2.0-beta.4-84-gc81007afb on 2021-03-23; Adafruit Feather RP2040 with rp2040
(same as the one that fail on the "I Voted" that is problematic)
@dglaude Could you try reproducing the "I Voted" bug, and then try this test firmware:
feather-rp2040-i2c-sda-hold-time-fix.uf2.zip
Looks good to me. I haven't tested it, I can try just have to see if I have a display with an SD card on the back laying about somewhere.
@tulip sleet I don't think it's pertinent to the help channel discussion but, regarding reload() vs reset() , reload has some memory it doesn't free (under the hood )right?
it restarts the VM; it's the same as typing ctrl-d. But the heap starts from fresh
Ok @dhalbert working on your request...
But first I wanted to confirm both my RP and the OLED are "OK".
This code was running before and still work fine: https://twitter.com/DavidGlaude/status/1375557719646740482?s=20
So there is an "issue" with the "I Voted" code (or something "different"):
@dhalbert That UF2 fix it for me... the I Voted code works great.
The hello world and my scd30 code also works.
Everything works!
Great! That is the third device improved by this SDA hold time delay! Thanks for testing!
@tulip sleet Super happy to could have help... There is something amazing about that OLED. It was going in "autonomous scrolling, partial or full screen". And if not "powering off" the scrolling from the I VOTED (with old firmware) was able to scroll your Hello World. That screen/driver have some "hidden" feature and seems to do things on it's own. At one point with the garbage random pixel on the screen it was like a starfield effect (ร la StarTrek or StarWar).
Is there a way for me to access storage.erase_filesystem() without being able to access the device repl?
will test when there's artifacts!
uuuuuuh USB keyboards are so complicated
why?
When connecting an SH1107 128x64 OLED FeatherWing to a Feather RP2040 via STEMMA QT I2C, the display does not blank on initialization and displays pixelated "noise" when updated.

This does not occur when using an [SSD1306 1.3" 128x64 OLED Display](https://w...
This is a core circuitpython issue, so transferring to https://github.com/adafruit/circuitpython
Incorporate https://github.com/adafruit/pico-sdk/pull/2, which lengthens SDA TX hold time.
This fixes I2C problems with the TCS34725 color sensor, and SSD1306 and SH1107 OLED driver chips.
Fixes #4482.
Fixes #4082.
Fixes #4498.
Does the RP2040 have a preconfigured USB PID/VID?
The chip itself not any of the current dev boards
Different layouts introduce multiple types of changes, and I want a code that can for example select all (ctrl-a) and say switch to the 5th tab of firefox (ctrl-5).
5 on a french keyboard is shift-( but the position is the same, and the shortcut is actually ctrl-( not ctrl-shift-( so the keycode is unchanged. That is often the case, where number shortcuts will be based on position rather than character, otherwise it would add modifiers.
a on the other hand is switched with q, so the keycode changes, but the actual shortcut is the same. That is also usually the case, where the letter shortcuts are based on the letter.
So if I want to make a macro keypad that works on multiple setups by only configuring the layout it's a little complicated.
@ornate breach in bootloader mode it does have a particular PID/VID for sure. after that it gets whatever the loaded software chooses.
https://datasheets.raspberrypi.org/rp2040/rp2040-datasheet.pdf see 2.8.4.1 "identifying the device" for info about the rom uf2 bootloader
you might also take a look at https://github.com/raspberrypi/usb-pid
It may not be the fastest way, I see there's only one allocation to date.
I has a company now so many Iโll eventually be purchasing a VID once Iโm making the big bucks ๐
Might be a few years but thatโs okay ๐
a patch for folks who don't want to wait, latest builds fix bitbangio and you can read/write the SD card with SPI!
import os
import busio
import digitalio
import board
import storage
import adafruit_sdcard
import bitbangio
# Connect to the card and mount the filesystem.
spi = bitbangio.SPI(board.CLK, board.CMD, board.DAT0)
cs = digitalio.DigitalInOut(board.DAT3)
sdcard = adafruit_sdcard.SDCard(spi, cs)
vfs = storage.VfsFat(sdcard)
storage.mount(vfs, "/sd")
# Use the f...
also verified with a teensy 4.1's SDIO card slot
@jepler did you mean to close this, or did you do this change in another PR?
@tannewt is it true that translations that do not change from the original English can be omitted? @garethhcoleman if true that may save you at lot of work (or maybe too late!).
#4387 is merged now what should we verify\fix next ?
btw, I tried serialterminal.com (online and locally) on Mac (Chrome) and it was able to connect, but only if I set a baud value. That's a bug in the page, it's undefined if never set (even though the menu says 9600)
@jaunty juniper just configure keycodes instead of characters, and it becomes simple
Did you consider or measure the effective impact of switching from 4 conditioned writes to multiple conditions followed by 4 branching unconditional writes?
Probably in this case it is okay because it is per-frame, but seemingly innocuous change can have dramatic pixel fill rate or frame latency impact in this area so Iโm somewhat skeptical of doing more work than is necessary.
@garethhcoleman It should be the case that translations that are same can be omitted. that may save you at lot of work (or maybe too late!).
It is too late! But in case anyone wants to translate to Australian English it might help!
I flagged 4 translations of "MicroPython" into "CircuitPython" - just to note this isn't an attempt to remove attribution, just aiming for consistency across all error messages. If you agree then perhaps the source could be updated?
I encountered a crash in re.match (in the unix port). It may require that you build with DEBUG=1.
This is not entirely frivolous, the task that led me to this crash was trying to write a proper lexer for adafruit_pioasm. (I'll probably just set the idea aside for now)
$ ./ports/unix/micropython -c "import ure as re; re.match('wwwwwww|xxxxxx|yyyyy|zzzz|bbbb|cccc|dddd|eeee|ffff|gggg|hhhh', 'a')"
micropython: ../../extmod/re1.5/recursiveloop.c:79: recursiveloop: Assertion `!"recur...
I investigated further and filed https://github.com/micropython/micropython/issues/7078 upstream.
{ MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_09) }, is the correct RX pin
Typical test:
import displayio
import rgbmatrix
import board
displayio.release_displays()
matrix = rgbmatrix.RGBMatrix(
width=128, bit_depth=4,
rgb_pins=[board.GP0, board.GP1, board.GP2, board.GP3, board.GP4, board.GP5],
addr_pins=[board.GP6, board.GP7, board.GP8, board.GP9],
clock_pin=board.GP10, latch_pin=board.GP11, output_enable_pin=board.GP12)
mem = memoryview(matrix)
mem[0] = 65535 # OK
mem[0] = 65536 # errors (out of range)
Prior to this...
import board
import busio
uart = busio.UART(None, board.TX, baudrate=9600)
while True:
pass
i should be passing board.RX in there, was testing if the wrong pin is passed...it hardfaults when instead we should get an exception that the pin cannot be used as a uart RX!
@tyomitch thanks for the updates. Just a gentle note that here on the Circuitpython github, our general policy is to update PRs without force-pushing, so we can see what you've edited and the comments are not lost. It makes it easier to tell when re-testing with hardware is necessary. Is this ready for another review?
Just learned this week about make -j to use all my processor cores for compiling CircuitPython. Just think how productive Iโll be after learning that. ๐คทโโ๏ธ
I saw Scott do that on stream a couple weeks ago, same with me!
@tannewt I'm having a similar problem and can't seem to initialize uart library with a buffer size greater than 64:
>>> uart = busio.UART(board.TX,board.RX,baudrate=9600,bits=8, parity=None, stop=1, timeout=10, receiver_buffer_size=96)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: Could not initialize UART
I'm talking to a Simcom 7080G LTE Modem and basic AT commands work fine but when I try to enable GPS and output current location the ...
Can you explain this return? If you return here after a fake sleep alarm occurs, won't it skip the alarm_woken_from_sleep check that instructs it to soft reboot?
This PR adds the common_hal prefix to a number of sleep-related functions to identify that they are implemented on the port level, and adds the new weakly linked common_hal_alarm_pretending_deep_sleep function, which is required for both the NRF and STM32 sleep implementations. It also fixes a small problem with the deep sleep implementation in main.c, where the 5 second USB delay would set up to use port_idle_until_interrupt but never actually call it.
Result of a discussion with ...
FYI - I have created a pull request (https://github.com/adafruit/CircuitPython_Community_Bundle/pull/62) for the Community Bundle to add a new uschedule library (https://github.com/cognitivegears/CircuitPython_uschedule) - please let me know if there is anything that I can help with!
CP currently has hashlib based upon frozen code, providing sha1 and sha256 for instance.
aesio, c lib based, but not included by default in the Pico port.
SHA hash functions are widely used primitives you need for all sorts of things.
I needed them for TOTP code generation (hmac with sha1) for instance.
The pure python code works and is compliant, but takes time (0.2 sec per hmac on the pico)
sha1 and sha256 can be implemented with a small c code and should not take much flash space....
Low priority message for @idle owl: I just noticed that I don't have a board.LED thing for the CLUE. So I use led = DigitalInOut(board.WHITE_LEDS). Maybe that could be an issue for your learn guide thing about blink. Regards.
we'll review any PR we get, we recommend starting with one function to start :)
@thorny jay It does seem like if there is only one LED pin (regardless of color), it should be board.LED.
The trouble comes when there are multiple colors of LEDs on a board... in addition to board.RED_LED and board.BLUE_LED, should perhaps the red LED also get an alias of board.LED so thre's always a board.LED?
I would say so
Kattni said one of the LED need the name LED, if there is only the blue it will be the blue. So I guess we need a LED alias for the WHITES in CLUE usecase.
I added some advice about make -j to the Building CircuitPython guide a few days ago.
Wow. I never knew about that either. That cut a build of mine down from 1m32s to only 39s
Can -j be the default?
there's not a super great way to make -j the default that I know of
I mean, you sure can do it with a line like this in a Makefile: MAKEFLAGS += -j4 except 4 isn't the right number for everyone
Does it have to be -jx or can it be just -j?
I did just -j no number
Is this ready for another review?
Yes please :)
I will try to avoid force-pushing PRs, but for the record, overwritten commits are not lost, and you can see the changes since the first review at https://github.com/adafruit/circuitpython/compare/fc9b42a..b40d072 -- inevitably very noisy because of an intervening global reformatting (a52eb88)
@fossil gorge Generally it's recommended to use -j# where # is the number of cores or threads in your system.
Using no number or a very large number uses more memory (potentially including swap space) and provides no performance benefit. It can even run your computer out of memory entirely.
For instance, the raspberry pi build has over 500 object files in it. "make -j" will try to invoke the compiler in parallel up to that many times!
Ah, I see. I thought that -j defaulted to the number of processors/cores, not "all the things"
Maybe make has been changed in the last 15 years, weirder things have happened ๐
Really? Name 42 ๐
(literally not joking, that's just about the last time I updated my idea about how make works)
Fair enough
i tried -j before just reading about -jx, and it reduced make clean from 3m to 1m. nice!
If the '-j' option is followed by an integer, this is the number of
recipes to execute at once; this is called the number of "job slots".
If there is nothing looking like an integer after the '-j' option, there
is no limit on the number of job slots. The default number of job slots
is one, which means serial execution (one thing at a time).
-j [jobs], --jobs[=jobs]
Specifies the number of jobs (commands) to run simultaneously. If there is more than one -j option, the last one is effective. If the -j option is given without an argument, make will not limit the number of jobs that can run simultaneously.
From my local man make. on macOS 11.2.3 with M1 proc
I've also seen make -j$(nproc) used in examples to automatically use the number of cores.
-j 16 was 5 seconds slower than -j for me
nproc as a shell command is available on most linux but not on mac
and since we all use Python here, another alternative is: ```NPROC=python3 -c 'import multiprocessing; print(multiprocessing.cpu_count())'
Is that also true on the GitHub build system?
When building core CP that is
I hope so -- I grabbed that line from micropython-ulab's build which runs on github's build system (linux & mac)
Worse case, you follow it up with a || # for a default number
for circuitpython we've just hard-coded -j2 in a number of places, and there's even this ... curious ... ```PARALLEL = "-j 5"
if "GITHUB_ACTION" in os.environ:
PARALLEL = "-j 2"
Hmm
@hierophect In earlier design of pretended deep sleep, it enters REPL first when an event occurs and then does soft reboot at Ctrl-D in REPL. (please look at the state diagram discussed before)
After the discussion with @dhalbert the design has changed to do soft reboot directly. So, return false is no longer needed.
Re -j: This is what I wrote up a few days ago: https://learn.adafruit.com/building-circuitpython/build-circuitpython#use-all-your-cpus-when-building-3086075-16.
For macOS, you can use sysctl -n hw.ncpu
On my machine: 3.2 GHz Quad-Core Intel Core i5 I didn't see any real difference in compile time no matter if I used -j or whether it was set to -j, -j1, -j4 or '-j8`. But I perceived it to bog down my machine with larger values. It took between 140-146 seconds for all of these builds (for pyportal). This machine is from 2015, so maybe it's time for an upgrade.
I've been working on getting audio (wav) working on my Feather RP2040 and I'm also having these similar issues but wildly inconsistent behavior. Mine is coupled with the Adafruit I2S mono amp (https://www.adafruit.com/product/3006). Using the same StreetChicken.wav test file. I'm not sure how far long I2S audio is on this new board but I figured I'd throw in what I'm experiencing if I can help at all.
Is there a preference to what pins we should be using for I2S audio? My setup is as follo...
That's a great point. My main motivation was to fix an issue where when area1 was combined with an empty area (defined as empty by x1==x2==0) that it would return an area with x1=0 and x2=area1.x2. This caused unnecessary dirty rectangle redrawing.
But your point is about performance of the union command vs. the code in expand. I didn't look at any performance differences. I've never done any performance testing down at the C-level. If you give a good example of how best to do thi...
I think a test for this would be a chore. Native time functions have a 32khz resolution iirc and either call should surely take less than 31 microseconds? You could time a frame with several 1px overlapping rectangles but thereโs quite a bit of noise in that aggregate signal. Iโve wrapped code up higher in the displayio draw stack to A/B test things in this way but I do not have a clear example for you to follow.
Last time I was actively adding to vectorio I wanted to make a more convenient ...
@ladyada , thank you so much! Everything is working now. Is there any way for me to figure out where I went wrong/what happened?
@lone axle hihi i see a green dot, i have a req about this guide https://learn.adafruit.com/circuitpython-display_text-library/overview
Yep, whatcha got?
can ya update that guide to talk about fonts too
like bitmap_font
does have to be a lot but folks dont see how to use custom fonts
wait
now im confused, there is a page
@tidal kiln when yr around can ya explain the thing you were asking about
now im confused >.<
this guide for fonts:
https://learn.adafruit.com/custom-fonts-for-pyportal-circuitpython-display/overview
i think there's enough to dealing with fonts - creating and using, that more info in that guide would help
One thing that does seem to be missing is a page or section with a basic example that actually shows the code for loading and using a custom font.
that display text guide above is good - it covers https://learn.adafruit.com/circuitpython-display_text-library/overview well
think in terms of 3 parts:
- displayio
- text
- fonts
i think we have the first two covered well, but need a little more for the third one
What kinds of things would you like to see added or expanded upon in https://learn.adafruit.com/custom-fonts-for-pyportal-circuitpython-display/overview ?
a section showing example code would be a good addition I think. Maybe some "outside the box" font uses like the FontAwesome stuff that Jeff E got into at one point?
yep. that sort of stuff. like you mention above, not sure theres a good basic example that focuses on just the font aspect
ok thanks for clarifyng - i wanted to make sure i got it right ๐
foamy, dya wanna come up with a few things we could do to update that guide and call it a 'project'?
Yep, I can do that for sure
i'm assuming that guide is the best place? the URL is a bit misleading (pyportal) but the actual guide name seems more fitting
Yeah, a more general name might be good. Don't know if changing it causes too much trouble though.
If I'm reading the code correctly len should be passed into the error message as well as 9.
FWIW my C skills are very rusty.
Major +1 to this. It would be really handy for projects that aren't plugged into a computer all the time.
Is this a website issue? Or is the Pynt missing modules it should have?
hmmmm there's "py" in the name, I wonder...
nah it's not the only one
ah it's aliases
Test Case:
Want to measure duty cycle and convert to RGB values
Test Setup:
PWM input from RGB LED conroller connected to pin 18 on Pico (used a level converter to bring 5V down to 3.3V)
Using this version on the Pico "Adafruit CircuitPython 6.2.0-beta.4-116-g010232574 on 2021-03-27; Raspberry Pi Pico with rp2040"
Square wave is a 7.83 KHz
Test program:
import board, import pulseio
pulses = pulseio.PulseIn(board.GP18, maxlen=2, idle_state=True)
print(len(pulses))
Error:
...
Alias boards (different name for identical build) did not have their modules listed, due to looking for the directory by the name of the alias (doesn't exist), instead of the original it copies from.
circuitplayground_express_4h, circuitplayground_express_digikey_pycon2019, edgebadge, pyportal_pynt, gemma_m0_pycon2018, pewpew13.
Thanks @lesamouraipourpre for signaling.
@I should have read this before, @kmatch98 and I were having a similar discussion here . https://github.com/adafruit/CircuitPython_Community_Bundle/pull/63
Maybe you could draw this in the python level!?
@stiff pelican If I recall correctly, the Pynt actually uses the same build as the PyPortal. It is just renamed.
yep
there's a PR two messages above to fix it ๐
Ah -- sorry - I missed that !!
(I was working in that file earlier last week, it's an easy fix)
but it will only apply to future releases
oh alias boards are also not in the support matrix on readthedocs
and I remember noticing that it (the matrix) also doesn't identify the internal adafruit_bus_device due to the CIRCUITPY_* define that enables it not following the format of the others
I guess I'll set my sights on https://github.com/adafruit/circuitpython/blob/main/docs/shared_bindings_matrix.py next
I have noted some guides still refer to adding the bus_device library to boards .... I guess it does no harm other than taking up space. I think the core module is used even if the library is on the file system
seems so
should I add to this ? https://github.com/adafruit/circuitpython/issues/2021 it's also about missing modules in the support matrix
Cheers @jaunty juniper and @solar whale . That's a very quick turnaround.
to be fair I was a little quick to push it, a minor detail of coding style but I should have sit on it a little bit
๐ Quick heads up folks... the next beta release of Mu is out, feedback most appreciated, blog post about the changes here: https://madewith.mu/mu/users/2021/03/29/beta3.html
We expect there to be some CircuitPython related updates in betas 4 and/or 5. We hope to maintain a fortnightly beta release schedule as things "come together" for a final release soon-ish. (It's ready when it's ready). Thanks for the help and support.
Hi. Could someone add me to the circuitpythonistas role please? Many thanks.
@stiff pelican Done
Does CP in general support AP mode or is this an ESP32 S2 limitation? This is an issue because AP mode allows for wifi credentials to be updated.
I'd add to the list of modules that are not captured: adafruit_bus_device, recently added to the core, also missing from the matrix, since it's based on CIRCUITPY_BUSDEVICE.
Also, the aliased boards are missing from the Support Matrix. These are boards where the build is identical to another, and therefore is not generated on its own, but only listed separately on circuitpython.org and copied to S3. As seen in build_board_info.py:
https://github.com/adafruit/circuitpython/blob/main/...
Thanks! I think there's a slight simplification that can be done to improve the code and potentially detect future mistakes.
I'm surprised the default is the string "[]" and not the list []. This was a bug before your change, but why not correct it now?
For that matter, isn't it a bug if board_id not in support_matrix? So writing board_modules = support_matrix[board_id] is shorter and will raise an error during release building if what we expect is not the case.
@onyx hinge ok so, I have never responded to a review like that before, github tells me I can click on "insert a suggestion", make your change and that will automatically make a commit once approved ?
@jaunty juniper I have seen other people use "suggestions", I just create a new commit, push it to the pr, and mark the conversation resolved. Mentioning the person who made the original review is good etiquette too.
@idle owl if you're not utterly sick of the topic I would like to talk to you about pre-commit and bundle libs, https://github.com/adafruit/cookiecutter-adafruit-circuitpython/issues/121 -- short version of the question is, we want duplicate code detected within which one or more of the following? (A) the library's actual code (B) the examples (C) the tests
I need to think about this.
The little red LED should always have LED. I'm working on adding that as I go.
I am deep into shared_bindings_matrix (which provides the support_matrix dict) to add aliased boards to the readthedocs Support Matrix page (as well as adafruit_bus_device), and that might actually replace PR#4507 since support_matrix[alias] will then work as expected
I'm never sick of talking about pre-commit!
Duplicate code checking should ONLY be done on the library code proper. Examples and tests should NOT be checked for duplicate code.
Good morning ๐
Is there an effective commandline flag to entirely disable duplicate code checking?
The NeoPixels are always on board.NEOPIXEL regardless of the number. I think in the case of CLUE, it should be board.WHITE_LED.
Going to attempt to lurk and work this morning
Lurk and work. It's like Lunch and Learn only lurkier and workier.
Did not notice the little RED near the microUSB.
Very few boards don't have it. ๐
For the meeting, need to get back into doing more for Circuitpython which is my goal for my new Thursday stream ๐
The white one are "aggressive"... maybe usefull for color detection, but not super friendly.
@idle owl is there an effective commandline flag to entirely disable duplicate code checking?
@thorny jay Exactly what they're for.
No.
That is the whole thing.
You can't disable it.
You can only increase the threshold to make it stop running on the whole repo. Or force Pylint to run on files separately.
@onyx hinge Do you understand now why there are shenanigans?
To me it looks like pylint --disable=duplicate-code,... effectively disables the check
locally I have pylint 2.6.0, is that the current?
Unless that was added in the last few weeks, it is a red herring.
2.7.1 is what we're using
upgraded to 2.7.2, and the commandline --disable= also works for me
2.6.0 had not fixed the duplicate check yet.
pylint 2.7.2
$ pylint --disable=pointless-statement,missing-module-docstring *
************* Module b
b.py:1:0: R0801: Similar lines in 2 files (long spew omitted)... (duplicate-code)
Your code has been rated at 9.95/10 (previous run: 9.95/10, +0.00)
$ pylint --disable=duplicate-code,pointless-statement,missing-module-docstring *
Your code has been rated at 10.00/10 (previous run: 9.95/10, +0.05)
Checking change logs.
I recall you checked putting the disable in as a comment in a .py file
We also tried adding it to .pylintrc but I swear we tried it on command line as well.
I guess we didn't. So that was all pointless.
@idle owl I wanted to use led_animation on the QT-Py, just an I2C sensor, a bit of code and blinking RGB using it. But I ran out of flash space. Works fine on the haxpress. I just needed colorcycle that only needed color for the Rainbow. So I started by removing everything except the two__init__, colorcycle.mpy and I replaced color.mpy by a stripped down version as color.py with only the needed color for the Rainbow (the MPY version was running out of memory). So now I can do rainbow, blinking, blinking between two color and still color. I could strip down a littly bit the init too as it contain a lot of thing I don't use. Would you consider a small version of led_animation?
@onyx hinge Whatever. If you made it work, then PR to cookiecutter, and create an Adabot patch. We have to fix all the libs if that's the case.
@idle owl yeah the second part I'm not thrilled about
I'll update my comments on that cookiecutter issue and if after reading it you feel like we've ended up on the same page then we can initiate actually doing all the stuff...
We don't want to support two versions of libraries. It's a support nightmare. You're welcome to submit it to the Community Bundle. When I wanted animations on a QT Py, I put the code in code.py - https://learn.adafruit.com/qt-py-and-neopixel-leds/basic-animations-for-qt-py
Ok
I kind of needed "blink.animate()" way of working as animation is not the sole goal but the indication of the sensor value. Here a CO2 sensor. I try to find a "language" where the color, or blinking speed or alternating of color is an "universal" or "understandable" indicator. Like GREEN/YELLOW/RED for traffic light. "Rainbow" could mean the air quality is perfect. "RED/BLUE" like police light mean emergency to open the window.
Fair enough.
I'll to incorporate what I need in the body. That library inflated to many usecase, but too much for QT-Py. I believe the QT-Py RP2040 will solve all the space and memory issue. ๐
But as this is for COVID refresh air indicator in school... availability is more important than a lot of other criteria.
That is the plan ๐
That makes sense.
if coding in arduino would let you attain your other goals, it's worth considering too
Yeah, that's an option. Now I have a PoC and it is working... it's for a friend that does not seems to be afraid to solder and program. So if he want to do better, he can.
Just realized yet another wrinkle with pre-commit & pylint ... ugh, it's complicated!
Yes.
I think there is a possibility that duplicate code checking within the main package is not correct under pre-commit because of reasons
I believe it.
@idle owl OK I wrote a long new comment on https://github.com/adafruit/cookiecutter-adafruit-circuitpython/issues/121 but ultimately I'm concluding that the status quo isn't super broken, so maybe not touch it right now. But I do want the thoughts written down while I've got a good grasp of them.
Makes sense.
The getting the thoughts down. I haven't read it yet, no idea if your thoughts make sense to me yet.
fair enough. you have other priorities today anyhow
But less worky
<@&356864093652516868> hey all! the weekly meeting will be taking place in about an hour. Scott will be your host today. Please get your notes in the doc! No need to do anything if you'll just be listening in. https://docs.google.com/document/d/1CXqf-nL0NEFt2aXH2ouDlDym6o2VWNz8JRLPNmWUnQQ/edit?usp=sharing
CircuitPython Weekly for 29 March 2021 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates early. During the meeting, we go through them as a round robin sorted by username. If you canโt make the meeting and would still like to participate, ...
Anybody speaking?
Nope.
A CircuitPython program running on the Cytron Maker Pi Pico using one row of its LEDs for a larson scanner. All sixteen GPIO pins are driven with PWM to allow the apparent brightness of the blue LEDs to be varied. An Adafruit Feather nRF52840 Express in the background plays the swoosh sound samples via commands sent over a serial connection betw...
Listening only for now
2FA has quickly become an easy to implement solution for all online services willing to add extra safety to user accounts.
As a result, users are now overwhelmed with 2FA requests for anything.
I need them for Github, Discord, Hosting account, Online shops, bank and exchanges...
For one, I don't feel comfortable with all these keys only stored ...
@fossil gorge Still listening only?
For now, yes
Listening only
Is that going to be iOS only? The BLE workflow?
Will BLE include desktop support as well?
SCD30 sensor on a small OLED driven by Feather RP2040 (a better Pico).
Because it is so small and my eye are getting old, I can press the A, B or C button to print one of the value bigger.
Code: https://t.co/oQfHIQmoAd
I was not able to reproduce the hang using PWM out at 7.83 KHz from one Circuitpython board into a Pico.
A few comments:
- The stack output doesn't show us anything - it is a thonny stack and not from circuitpython
- The print of len(pulses) probably doesn't show what you think it does, pulsein needs calls to popleft() to get values. So, you
may want to do something like:
...
pulses_in=[]
while pulses:
pulses_in.append(pulses.popleft())
print(len(pulses_in), "pulses_i...
@fossil gorge Still listening only?
No, I'm "fully here" now
(Also you're blinking intermittently like you have audio coming through.)
Instead of empirically determining the I2C SDA hold time, calculate the number of clock ticks to get the 300ns required value. See https://www.nxp.com/docs/en/user-guide/UM10204.pdf#page-48, table note [3] for the origin of the 300ns value.
The hardware default is 1, but that is arbitrary, since the length depends on ic_clk. 2 was enough to fix several I2C devices. 5 was need for PA1010D. However, the calculated value is 38 for 300ns. So the other values were quite marginal; this should ...
Thanks. Now sure why that is, since I'm on Push To Talk, but muted to be safe
Happy early birthday, @blissful pollen!
That looks SO slick!
Thanks! Would be more fun if it wasn't going to be -8C ๐ฆ
Oi, yeah for sure.
May not be fun weather, but if that's the biggest concern, you're in good shape ๐
๐ฐ
There was the "use bytearray" advice.
And use binary font (unsure).
Reduce color depth.
Avoid recursivity?
Use generator rather than build big list.
Thanks all!
Thanks!
Have a great week everyone!
Thanks.
Thanks
๐
Cheers!
Makes sense, since frame buffer is 565.
Thanks for this! It's odd that the original code was left in all the time, just for testing purposes.
@kevinjwalters Were you able to test? Thanks!
@Gadgetoid Since you are not going to use this after all, I will just close this to keep our pending PR list clean. If you think it should remain open, I'm happy to reopen.
I made this a draft just so it's not merged accidentally.
@dhalbert I think I need a recent version of gcc to cross compile this up? I've not looked into installing that on my linux hosts. If there's a UF2 I'm happy to test this.
@kevinjwalters The build artifacts for this PR are here: https://github.com/adafruit/circuitpython/actions/runs/688127024. Just scroll down a bit and download the .zip file for the board. Or in the "All checks have passed" section above, click "Show all checks", then choose a board, and then find the "Artifacts" dropdown just above the white-on-black logging part of the page.

Does CP in general support AP mode or is this an ESP32 S2 limitation? This is an issue because AP mode allows for wifi credentials to be updated.
CP doesn't have an API for it yet. It is not an ESP32-S2 limitation.
Here is the notes document for Mondayโs CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if youโll be attending the meeting - itโs super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and weโll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1sRuIt_eSshrvOPdPVI2f9sZlvCzpVltRkLHKIa3MCHY/edit?usp=sharing
CircuitPython Weekly for April 5th, 2021 Here is the notes document for Mondayโs CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if youโll be attending the...
I believe there is a CircuitPython backend to Thonny that will work better than the MicroPython one. The MicroPython one "runs" the code through the REPL which we don't really support. Instead, we expect the code to execute to be written to the code.py file on the disk. Mu is an alternative that does this: https://learn.adafruit.com/getting-started-with-raspberry-pi-pico-circuitpython
You are right! It should be 9, len);. Want to make a PR? Thanks!
I just converted the code from CLUE to Pi Pico for this https://www.youtube.com/watch?v=mgiP1rzDgJo and first impression is the level parameter is not implemented it. The code varies it to provide a simple envelope (like a VCA) but on Pi Pico everything is full blast.
The pins shouldn't matter because it's all PIO under the hood. It's likely a timing hiccup with the DMA and sample conversion code.
It'd be great to get more crypto APIs made available. Some chips actually have hardware acceleration as well. The aesio PR has lots of really good API discussion: https://github.com/adafruit/circuitpython/pull/2823 (Basically Python's cryptography library is too monolithic to copy.)
i can see items in this channel in the livestream but I don't see them here in discord. hmm
what livestream?
the weekly meeting. wasn't i watching it live?
It was three hours ago or so
oh, doh!
๐
we don't stream to youtube live
but you can jump in here and join the circuitpython voice channel to listen live
that's ok. i didn't realize it wasn't live and was very confused
np ๐
I just wanted to make a comment about memory usage. Last week I ran into a memory issue last week that kmatch and jose david were kind enough to help with and I finally got things to work.
I wrote some text to the screen on a Clue and replaced it a few times and then drew an emoji bitmap (not a huge one)
It seems like it should have placed only modest demands on the board. but that was enough to cause fragmentation and I couldn't load the bitmap
Is it possible to do this without a float? Float math will be slower than integer math.
My main point is that the first thing everyone's first thought was to stop using the clue library. Libraries like that are supposed to make things easy for people like me. I did something small and the first thing I'm supposed to do is stop using the library? LOL
I could understand If I was doing something big
ya, it's the challenge of having a library to do everything, even the things that you don't want to do
Also, using memfree, it looks like the clue library was barely using any memory
๐คทโโ๏ธ
my preference would be to move away from those monolithic libraries in favor of smaller composable components
if the failing allocation was large, it would be a fragmentation issue
my oldest deep dive covers this: https://www.youtube.com/watch?v=baa5ILZTRkQ&list=PLjF7R1fz_OOXBHlu9msoXq2jQN4JpCk8A&index=49&t=4s
Live stream of @tannewt debugging memory issues in CircuitPython.
Visit the Adafruit shop online - http://www.adafruit.com
LIVE CHAT IS HERE! http://adafru.it/discord
Adafruit on Instagram: https://www.instagram.com/adafruit
Subscribe to Adafruit on YouTube: http://adafru.it/subscribe
Join our weekl...
I moved the bitmap allocation to the beginning and things seem to be fine now. and made a few other tweaks
๐ makes sense
I doubt we'll add a separate API for this. I think these touch screens can likely be read already with AnalogIn.
Actually I am changing level as looping samples play which works on the nRF52840 implementation. Perhaps that's not "in the spec" ?
are there any known issues with enabling the uctypes module (#define MICROPY_PY_UCTYPES (1)) when building for the trinket m0? i was able to compile (by changing the warning flags for one step) and haven't run into any issues yet
@slender iron Thanks, that link sounds helpful!
Approving. This won't work for 1mhz though I think. It looks like the SCL fall time for 1mhz is 120ns instead of 300.
probably not. it's likely off to save space