#circuitpython-dev
1 messages · Page 410 of 1
probably should have just said .gov
You have to enable them per board.
Looks like matrixportal has nothing frozen currently: https://github.com/adafruit/circuitpython/blob/main/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk requests and PortalBase + associated libs would be great to have frozen in I think.
@gilded cradle Yeah, basically, check out CPX, and mimic the mpconfigboard.mk file.
Ok, thanks
I think you might have to add the submodule to CircuitPython though. It's been a while since a froze in a new library.
For ones that aren't already in the frozen dir inside the core I think you may have to add them as new submodules to the core repo as well.
Otherwise, it doesn't know what it's looking for.
For PortalBase, yeah I figured.
Exactly.
I think that'll be really helpful for folks
Thanks all!👋
Yeah boards that require bonkers levels of libraries to do their basic function (or are small) and you are super tight on blowing out the memory, frozen libs are really helpful. Be aware, CircuitPython looks for libraries in root (CIRCUITPY/) first, then frozen libraries second, then the /lib folder third. And the thing about Project Bundles is that they're not smart enough to know where libraries are frozen in. The memory issues come from running the library code, not simply having it on the board. Verify how much better it works once they're frozen, but it's possible you'll end up having to tell folks to do some fiddly things with the project bundles. In theory, you shouldn't, and the Project Bundle will still work fine. CPX project bundles include the CircuitPlayground library, but it doesn't run the code from inside the lib folder, so there's not memory failures. Etc.
I uploaded my pyflate stuff here btw: https://github.com/Neradoc/pyflate-lib
Thank you!
This board is a c3, so it can't support tinyuf2 and with only 2MB of flash, it doesn't have space for ota partitions.
- Add a new variable
UF2_BOOTLOADERto the port makefile that is 1 whenIDF_TARGETis esp32s2 or esp32s3 - Use
UF2_BOOTLOADERto select whether to use a new partition variant,partitions-xMB-no-uf2.csv. I only added 2MB so far - Use
UF2_BOOTLOADERinstead of filtering out esp32c3 to select the .uf2 target
I made these changes with support for future (or past)...
@tulip sleet blocking Requests was the motivation for my singular CP wish list item in 2020 and in 2022 (didn't do 2021)... don't hesitate to ping me for testing, or any other way I could help https://twitter.com/anecdat/status/1478090306902020096
@mental nexus here is my touchscreen viz I did in college: https://www.youtube.com/watch?v=MeLUxsvIVuU
The new MacBook Pro, MacBook Air and iphone have a multitouch capability. This is a demo of capturing and understanding some of that data in Linux. See tannewt.org/touch for more info.
Nice. 13 years ago! I like that you had to call in for help to get to 12 touches.
@mental nexus if you get a moment I would be grateful if you can point me towards the capacitive overlay / display that you're using. Honestly I had never run across the FocalTouch library before, didn't even know we had support for capacitive screens. I would love to get one set up to tinker with as well.
Looks like the json files are only available gzipped (even if the request doesn't ask for gzipped data) [cmc@fresh tmp]$ curl https://analytics.usa.gov/data/live/top-pages-realtime.json &am...
so yeah they do not plan to change/update this to work properly 😕
Possibly a root cause inside the behavior of S3. I suppose that makes it somewhat likely there are other services out there that made a similar decision
I would not have guessed this site / data API was available that long ago tbh. Good on them for actually making the data available even if not in the most convenient of formats (and for doing their development in the open on github). It will make an interesting IoT data displaying project for us but I could also be it being very valuable to web designers trying to figure out how to allocate their resources across so many client OS/browser/display sizes.
The Adafruit capacitive touch displays will provide single-touch capability. I've used the 2.8" version https://www.adafruit.com/product/2090. For the multi-touch capability, I found a conference-room schedule display (Crestron TSW-732) and pulled it apart and was able to decode the touch display pinouts. https://hackaday.io/project/183895-crestron-tsw-732-teardown. It has a multi-touch display using the FT5406 chipset.
Neat! I may have access to some old Android tablets I should open one of those up, I would guess it has a similar driver inside of it.
I'm interested whether I can also reuse the display, but only if I use a chip with RGB and dot-clock driving capability. Perhaps the ESP-32 S3 can do that, but will need some coding.
I've been perusing the bewildering array of displays with touchscreens and have been a bit overwhelmed by the wide array of display controllers and touch controllers. I'm looking to see what chips are most common, but I think there are two or three of each that are in most common use. I'm especially looking for a 7" screen since a larger screen will be more usable for multitouch sensing.
This week I'll plan to finally dive in and order a couple of displays and start seeing what it will take to make them work in CircuitPython (maybe a new display driver library is required).
First look at polling the touchscreen in CircuitPython I can get responses every 7 ms. But let's see how that changes when display updates are going on too.
Here is the notes document for Tuesday's CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord but 24 hours later. 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/18qlzNr5o2KUEwxZWGmxTlj0CBFyns3sBlGcCfc1j1D0/edit?usp=sharing
CircuitPython Weekly for February 22nd, 2022 (TUESDAY!) 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...
Here's the link to the Focaltouch library https://github.com/adafruit/Adafruit_CircuitPython_FocalTouch
anyone knows if the ESP32-S3 has more USB endpoints that the S2 ? (where you basically can't enable CDC2 without disabling Mass Storage)
Just tried it on tinys3, not enough endpoints to enable the other cdc
Catching up on the meeting, thanks again to everyone for being so welcoming! I forgot a hug report for @lone axle for helping me do my first reviews and become more comfortable with that process.
it is hard encoded in CP and might not be updated for the the S3 if different
https://github.com/adafruit/circuitpython/blob/d4c2ffea27f8b5d7d00b1d7ea6c8ae8aa76e3199/ports/espressif/mpconfigport.mk#L60-L70
though the comment reference S2/S3 so it might be up to date
Both the S2 and S3 datasheets say
Device Mode Features
• Endpoint number 0 always present (bi-directional, consisting of EP0 IN and EP0 OUT)
• Six additional endpoints (endpoint numbers 1 to 6), configurable as IN or OUT
• Maximum of five IN endpoints concurrently active at any time (including EP0 IN)
• All OUT endpoints share a single RX FIFO
• Each IN endpoint has a dedicated TX FIFO
oh well
do you want midi too?
thanks for the clarification
@dhalbert Installed 7.2.0-alpha.1-366-g528c2a322 on both M4 Feathers Thursday afternoon (evening?), and got the error on both boards Sunday night (EST).
Unit 1
pi@serialpi:~ $ cat /media/CIRCUITPY/boot_out.txt
Adafruit CircuitPython 7.2.0-alpha.1-366-g528c2a322 on 2022-02-09; Adafruit Feather M4 Express with samd51j19
Board ID:feather_m4_express
pi@serialpi:~ $ grep monotonic_ns screenlog.0
monotonic_ns JUMPED MORE THAN A DAY! 262143997924816 524287999877941 : 34111132 loo...
I was just wondering if there was more wiggle room on the S3 in general
That is the build with the commit of my changes :( . It's also in 7.2.0-alpha.2.
I will try to make some other kind of test that sets the count register forward so it doesn't take three days for confirmation.
@danh, does the new typing module mean we'll unify types between Blinka and MCs? I don't think Blinka can support ulab.numpy.ndarry so curious what the solution should be for that and maybe other discrepancies
I have added the 4MB partition layout to fix the builds of the other c3 boards. Note this will stomp the filesystem of older c3 installations.
I am just factoring it out of Blinka. is the ulab.numpy.ndarray thing for ReadableBuffer, etc.?
https://github.com/adafruit/Adafruit_CircuitPython_Typing. I have not made a release for this yet. I was going to see where I might use it and double-check it before release.
@tulip sleet @onyx hinge want to chat now or pick a time tomorrow?
now is fine for me
I'm in the marie curie voice room
Yeah, there's also rgbmatrix.RGBMatrix too I realize
Not sure about the other typings or where they'll get used though
Ohhhhh I think I see, this is really still only the implementation for Blinka, just not in the Blinka repo
@slender iron I've been chatting with kattni, sorry. I think we'll be done soon, so I'll join if you're still talking
(probably just a coincidence: 3 days is also the half-period of the ticks_ms counter which relies on the same clock as monotonic_ns as far as I remember from another thread. might there be a connection? )
2 questions that came up from the Weekly Meeting stream:
1) What happens if you run CircuitPython on a new board with a Multiple Architecture chip? (e.g. 4x Cortex-M0 + 4x Cortex-A53 + V3D + etc...)
2) How would you go about adding and removing Secondary Memory to a CircuitPython System? (memoryio &&|| ramio and which protocols physically connect it)
@warm stump 1. we don't have any multiarch chips and don't do multicore anyway. 2. we can't support that now. is there anywhere it actually happens?
Nice thanks!
namely the broadcom port in future releases, the pi has many more peripherals than it lets on (some need re-integrating and other things need automatic loaders as far as Pi4 has reached)
it may also be a useful thing for boards which run out of memory very quickly, with that being the reason why the libraries they include are limited
@warm stump I think you are getting ahead of the game
might as well consider it first and foremost before it becomes a problem later (and not on your own)
Sorry, forgot about this one, I should have searched first.
gotta get the broadcom port stable before worrying about the possible future
don't you need a while True: pass to prevent your example program from exiting right after it starts playback?
if retry_count > 0:
if any(self._socket_free.items()):
self._free_sockets()
else:
raise RuntimeError("Sending request failed")
retry_count += 1
What about using a proxy server to uncompress gzip streams?
See if this fails if the program does not exit.
See if due to floating NeoPixel pin.
an adafruit io feature to act as a proxy for "challenging" servers could be cool. or maybe you could make your own out of a serverless platform.
Let's call that ReverseProxyIO?
A rare time I miss the end of a meeting and a bunch of in the weeds I am interested in (of course)
-
For the gzip item I am still planning to look at it more this week, but if anyone else does as well no worries. Seems straigh-forward though.
-
For the native mod hope I didn't open up too much of a can of worms. I agree with basically all the points brought up. Willing to have a longer discussion about it if ever needed as well. I saw a lot of the points discussed on reasons why it has some potential use today but could cause issues too.
I think I'm seeing an issue with adafruit_bus_device with SPIDevice set up for polarity=1. The SCK should be idle high before chip select goes low. Right? SCK does idle high in between the 2 clock pulses. But because it's not idle high before chip select is low, technically there are 9 rising clk edges in that first set of clk toggles.
Zoomed in sck
@fiery fossil it's not unlikely that there's a bug, for the less common phase & polarity settings. It's also curious that in your trace SCK is slowly decaying at the end of the SPI transaction. I would have expected it to be acting as a push-pull output and remain high.
what circuitpython board?
OK, I'd try to figure out why SCK is slowly falling when the transaction finishes -- like, is the pin mode just incorrect somehow?
Yeah, i'm guessing it's deactivating the SPI again before setting chip select high again
you'll need to make the busio.SPI get the boardmicrocontroller in a state where it maintains the SCK pin's output value
I am looking in common_hal_adafruit_bus_device_spidevice_enter in shared-module/adafruit_bus_device/spi_device/SPIDevice.c, thought that might be where it's setting chip select before grabbing the SPI
but it looks like it should be grabbing the SPI first...
but it's just a convention that some users 'manage' the chip select pin using adafruit_bus_device. You could also manage CS manually in your own code if you wanted. busio.SPI must drive SCK into its idle state the whole time the device exists and is idle.
@lone axle not sure if this tidbit has been surfaced yet, but I re-visited the jwst.nasa.gov URL on a DEBUG build and the errors that arise are:E (804107) esp-x509-crt-bundle: Failed to verify certificate E (804107) esp-tls-mbedtls: mbedtls_ssl_handshake returned -0x3000 E (804107) esp-tls: Failed to open new connection
we have a facility in the CircuitPython API:py context = ssl.create_default_context() context.load_verify_locations('path/to/cabundle.pem')but I'm not sure if / how to get a pem file appropriate for that server to maybe override the default bundle, to test?
Interesting! so it does seem likely that it's just the certificate being expired or otherwise non-working for some reason.
Thank you for trying that out!
the certificate per se is probably fine, but something in the chain from our bundle seems off
@prime flower I'm curious if you have any insight into SSL errors in CircuitPython. The initial discussion around this is in a thread here: https://discord.com/channels/327254708534116352/940343619217403984 if more background would be helpful, there was also some discussion in the weeds of today's (and a bit during last weeks) meeting.
Do you have any ideas about why we might be having the certificate fail to verify? or how we could go about getting a .pem file in order to try manually setting it to see if we can get the request to complete? Or really anything you can share about where the certificates that circuitpython uses come from. I'm willing to poke around a bit and try out some different things, but no idea where to go looking.
This should set the power to on by default without preventing the
user code from repeatedly using it.
Fixes #5903
@onyx hinge It should at least be driving idle high while chip select is active low. outside of chip select active low, I don't think it should matter too much
I'm not understanding how adafruit_bus_device and busio interact, I'm missing something
@fiery fossil I see what you are saying, and it could be true in some systems -- particularly those which use hardware management of chip selects -- but CP doesn't force any particular management of chip select. You might have a device without chip select (its /CS wired low on the PCB), and this behavior of letting the SCK output float when "not in use" would cause spurious clock edges as well. I still recommend changing the busio.SPI implementation until it drives SCK all the time, rather than letting it float.
Agree, looking into it
@lone axle Got it! The esp-idf example worked, so I just grabbed the cert from there and plugged it.
I'll post code in the old thread.
That is awesome!! Thank you for all of your help!
I suspect we just need an update to our bundle?
resolves #5916 I confirmed the hard crash as described in the issue.
Tested on Feather TFT ESP32-S2 using this example code (mostly the same as posted in the issue):
import time
import displayio
print("waiting 8...7...6..5...4...3...2...1...")
time.sleep(8)
with open("/allblue.bmp", "rb") as bits:
source = displayio.OnDiskBitmap(bits)
dest = displayio.Bitmap(source.width, source.height, 64)
dest.blit(0, 0, source)
output after this change:
cod...
Thank you, this is just what I expected to see.
I tested on the PyPortal.
Interestingly, before the change it didn't crash, but I don't think it copied anything.
After the change, I get this exception:
code.py output:
Traceback (most recent call last):
File "code.py", line 10, in <module>
TypeError: source_bitmap must be of type Bitmap
Code done running.
Looks good to me.
@onyx hinge It looks like every time the busio spi object is exited, it calls the same deinit function as a busio spi object deinit. Think that is why the clock goes away? https://github.com/adafruit/circuitpython/blob/main/shared-bindings/busio/SPI.c#L114-L141
and the common hal deinit for stm disables the clk spi_clock_disable(1 << (self->sck->periph_index - 1)); https://github.com/adafruit/circuitpython/blob/main/ports/stm/common-hal/busio/SPI.c#L261-L279
and actually also resets the pin reset_pin_number(self->sck->pin->port,self->sck->pin->number);
yeah, that seems plausible...
CircuitPython version
Adafruit CircuitPython 7.2.0-alpha.1-344-ga8d865187-dirty
Custom Board with STM32F412CG
Code/REPL
import time
import board
import digitalio
import busio
from adafruit_bus_device.spi_device import SPIDevice
spi_sns_mag_cs = digitalio.DigitalInOut(board.SPI_SNS_MAG_CS)
spi_sns_mag_cs.direction = digitalio.Direction.OUTPUT
spi_sns_mag_cs.value = True
spi_sns = busio.SPI(board.SPI_SNS_SCK, MOSI=board.SPI_SNS_BIDI, MISO=None,...
Just as a side note to #5745, I ran the pings with 10-minute delays and the boards I've tested would still crash after about 30 pings. As if the pings were eating memory somewhere.
I'm thinking this has to do with the __enter__ and __exit__ for the context manager and using with mag_sns as spi:. Possibly busio is deinitializing. Then when with for adafruit_bus_device, it sets chip select, and then busio isn't reinitialized until after? And then vice versa for the end of the transaction.
Hi
Adafruit CircuitPython 7.2.0-alpha.2-23-gd4c2ffea2-dirty on 2022-02-14; ESP32-S2-DevKitC-1-N4R2 with ESP32S2 (should be equivalent to https://adafruit-circuit-python.s3.amazonaws.com/bin/espressif_esp32s2_devkitc_1_n4r2/en_US/adafruit-circuitpython-espressif_esp32s2_devkitc_1_n4r2-en_US-20220214-d4c2ffe.bin)
W (9514) wifi: got ip
E (11164) ping_sock: esp_ping_new_session(270): create socket failed: -1
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandle...
Let's (try to) eliminate SPIDevice as it relates to the problem.
Here's what SPIDevice's __enter__ should be doing, except written in pure Python:
def __enter__(self) -> SPI:
while not self.spi.try_lock():
pass
self.spi.configure(
baudrate=self.baudrate, polarity=self.polarity, phase=self.phase
)
if...
Possibly resetting the SPI on the STM on entering adafruit_bus_device.SPIDevice here by calling common_hal_busio_spi_configure:
https://github.com/adafruit/circuitpython/blob/main/shared-module/adafruit_bus_device/spi_device/SPIDevice.c#L57
And then not waiting for configuration to complete and setting chip select low.
common_hal_busio_spi_configure does reset the SPI as shown here:
https://github.com/adafruit/circuitpython/blob/main/ports/stm/common-hal/busio/SPI.c#L281-L290
@jepler same result without adafruit_bus_device. The 16 clocks on the read is a bug in ST's drivers that I know about, has to do with their half-duplex support.
import time
import board
import digitalio
import busio
from adafruit_bus_device.spi_device import SPIDevice
spi_sns_mag_cs = digitalio.DigitalInOut(board.SPI_SNS_MAG_CS)
spi_sns_mag_cs.direction = digitalio.Direction.OUTPUT
spi_sns_mag_cs.value = True
spi_sns = busio.SPI(board.SPI_SNS_SCK, MOSI=board.SPI_SNS_BIDI, M...
I'll try full-duplex tomorrow with a NC'd MISO pin. I unfortunately don't have another adafruit board around.
I could also try this in C with their drivers and see if I get the same SCK behavior.
For what it’s worth, I tried the lates ESP IDF version and running idf.py menuconfig I only see an option for configuring a board with up to 16MB of flash.
I had tried to flash N8R8 onto it before and it didn't work. Maybe some param I overlooked is different. But it will flash as a 16MB, so it's usable for now :-)
Adafruit CircuitPython 7.2.0-alpha.2-23-gd4c2ffea2-dirty on 2022-02-14; ESP32-S3-DevKitC-1-N32ishR8 with ESP32S3
I believe I was doing it in the REPL there. I still have the project sitting on a table somewhere so I will try to pull it out tomorrow and update it and see what it is doing.
I got the board working with circuitpython. Would follow the guide to create a pull request.
Have created PR #6037 for initial support. Need help with assigning a PID, I believe the VID is the Lilygo one as reference to the existing ESP32S2 based board.
On page 821 of RM0402 STM32F412 reference manual there is this little note:
The idle state of SCK must correspond to the polarity selected in the SPIx_CR1 register (by pulling up SCK if CPOL=1 or pulling down SCK if CPOL=0).
Sounds like I need to add a pull up resistor to my SCK. Which I guess would make sense to tri-state the clock when not in use if you had a multi-master setup... Surprised that isn't better documented.
But then that begs the question of what do you do on SPI busses with multiple slaves that have different POL and PHA requirements... hmm. I'm going to close this for now as I don't think it is a CPy issue.
Slightly confused - are we saying that currently time.localtime(posix_seconds) always returns in UTC?
i.e. does it do the same as time.gmtime(posix_seconds)?
if not, how does it figure out what local time should be? it doesn't seem to automagically pick up the timezone from secrets.py
(my timezone is currently == UTC, which makes it harder to spot potential issues!)
@jepler I was able to get this result by setting the SCK GPIO_InitStruct.Pull to GPIO_PULLUP.
https://github.com/adafruit/circuitpython/blob/main/ports/stm/common-hal/busio/SPI.c#L183

hmmm does 1.18 remove support for deprecated FROZEN_MODULES? This will be a bit of work, if so.
Thanks for working on this issue.
Sorry for the duplicate.
No worries, You can simply update and push changes to any existing ones in the future and everything updates.
Just tested with 7.2.0-alpha.2 and it is still occurring both in the REPL and in my actual code.
The project I was using this on is https://github.com/gamblor21/Laughing_Skull (code-distance.py is the version being ran).
@minor plume @lone axle @proven garnet @idle owl I am thinking about the outbreak of problems when a library is updated with type annotations but adafruit-blinka is not updated. The problem is that we didn't specify the blinka version. I think we should add a minimum version adafruit-blinka>=6.20.4 in setup.py install_requires and in requirements.txt for type-annotated libraries that depend on circuitpython-typing types. That would force the latest adafruit-blinka to be downloaded, and also complain on systems where python is too old (e.g v3.6) to handle that blinka.
Does this make sense to you?
But I would also like to get circuitpython-typing into the mix in the future. We can make blinka depend on circuitpython-typing later.
we might consider bumping blinka a major or minor version after the circuitpython-typing change to make this easier to remember (e.g 7.0.0 instead of 6.20.4)
@gilded cradle also of interest to you ^^
Sounds good to me
I think it would not be all type-annotated libraries because many don't depend on the circuitpython-typing types -- they just depend on regular from typing types
so it doesn't have to be a huge sweep
👍
Yep makes sense to me as well.
That makes sense to me. I guess I should look at the circuitpython-typing module at some point soon.
I need to release it. It is in a repo but I didn't release it yet.
it will not be in the bundle
@gilded cradle on a somewhat related topic, yesterday I updated this guide page: https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/installing-circuitpython-on-raspberry-pi to list python 3.7 or later (previously 3.6). And the RasPi OS version to Bullseye because it Buster is now marked as legacy.
Do you know of anywhere else that we would need to update to reflect python 3.7?
or, more accurately, it doesn't need to be in the bundle.
@tulip sleet So I’ll change requirements.txt and setup.py in my pull request, and the collective we can deal with the larger stuff separately.
I'm not sure. For Blinka on Raspberry Pi specifically, that's fine. It does run on other OS, boards, etc too.
that would be a good test, thanks!
Sounds alright to me. Do we know how many libraries would need to be updated at this point?
I think that makes sense
I don't think it is that many, because it's mainly libraries that have ReadableBuffer, etc. annotations
is that right, the issues have been with libraries that have such from circuitpython_typing annotations?
If it was required for Bus Device does that mean the other libraries that depend on it would get the same error?
Yeah, the major one is Bus Device which so many of the libraries depend on
yes, the transitive bus device dependency is the issue. So let's fix bus device first
So could we put it there and all the others we get made? Like just requiring it for Bus Device would trickle that requirement to anything that uses it right?
My python packaging knowledge is limited, but you could trigger the Blinka and Bus Device update when wanting a new version of a library using it, right?
As opposed to having to also put that requirement in every library that uses it directly
if you install library A, and it depends on busdevice, but not a specific version, then busdevice will not get updated, and blinka won't either, and then you might get a failure. So it needs to propagate to the other libraries that need updated blinka and busdevice
but many libraries don't need updated busdevice and blinka
the mistake was that we started adding type annotations to libraries without updating their busdevice or blinka required version
My only concern is inconsistent infrastructure files.
Wait, no, those are inconsistent anyway.
Nevermind.
Making sure I understand: basically anything that uses Bus Device should get minimum Blinka requirement so it doesn't freak out, is that right?
I guess there's no harm in using an older bus device though regardless of Blinka version, the old one works fine still if someone has it.
right, the issue is that the addition of from circuitpython_typing import ReadableBuffer, WriteableBuffer into busdevice did not also force the requirement of a version of adafruit-blinka that supports that
@tulip sleet this is puzzling me with the micropython merge, maybe it rings a bell immediately for you. all or almost all asyncio tests fail in the unix port ```Traceback (most recent call last):
File "extmod/uasyncio_basic.py", line 51, in <module>
File "/home/jepler/src/circuitpython/extmod/uasyncio/core.py", line 222, in run
File "/home/jepler/src/circuitpython/extmod/uasyncio/core.py", line 191, in run_until_complete
File "/home/jepler/src/circuitpython/extmod/uasyncio/core.py", line 176, in run_until_complete
File "extmod/uasyncio_basic.py", line 31, in main
AttributeError: 'SingletonGenerator' object has no attribute 'await'
SingletonGenerator has a __next__ but no __await__; is this related to how micropython sort of conflates the two?
micropython did not add __await__ when they implemented async/await. Kenny/WarriorOfWire did add that when he added async/await to CircuitPython. I had to add https://github.com/adafruit/Adafruit_CircuitPython_asyncio/blob/19f0ce9e34ce5cc5d0cc156b1874a47bd9e33bbd/asyncio/core.py#L52 (SingletonGenerator.__await__) and Task.__await__. to the basic asyncio library.
I have not yet figured out how to add __await__() to _uasyncio. I tried it but it didn't work.
so we are not using _uasyncio in our version of asyncio
Thanks, that helps! I think I fixed my tests.
by changing __iter__ to __await__ in extmod/uasyncio for the sake of the tests
Who's around who understands the type hint stuff we've been doing? I added two things to a library that's already hinted, and I don't want to leave them undone since they'll get missed.
@onyx hinge Quick question in regards to the natmod stuff, I noticed you were building x86 tests. To do so locally so I just go to the unix port and run make from there? Haven't came across it before
Basically, can someone typehint this property and setter for me 😄
https://github.com/adafruit/circuitpython/pull/6031 is breaking ru builds but not just by overflowing memory
I think the setter is -> None
@slender iron I'll look into it. This? ../../supervisor/shared/translate.c:91:38: error: right shift count is negative [-Werror=shift-count-negative] 91 | return 1 + (compressed->data >> (8 - compress_max_length_bits)); | ^~
except it's a tuple, not an int, so the other setter I was going to model after is not appropriate I think.
Setters are typically None yeah
yup
But it takes a value which is also in need of something...
Is the library on GH?
This update isn't. I'll start a thread with the code.
Sweeeet
@blissful pollen I think you need to make -C ports/unix VARIANT=coverage -j2 then run the steps you can see under "Build native modules" and "Test native modules" in .github/workflows/build.yml in my PR
you can change -j2 according to the number of CPUs / cores in your computer
quick update on the merge of 1.18: unix port builds & passes make VARIANT=coverage test. Haven't tested anything else. Will go look at this message compression thingy first.
Thanks I'll take a look into it! Just needed that starting place
Status / checklist:
- [x] Initial merge completed
- [x] Unix
make VARIANT=coverage testpasses - [ ] Other test-related stuff passes
- [ ] boards without frozen modules work
- [ ] boards with frozen modules work
- [ ] CI is all green
@anecdata Please use https://github.com/adafruit/circuitpython/blob/main/ports/espressif/tools/decode_backtrace.py to decode the backtrace. Run it with the board name python tools/decode_backtrace.py ESP32-S2-DevKitC-1-N4R2 and then copy and paste the whole line starting with Backtrace:.
Thank you for the PR! What usb VID and PID did you use? You can get them from Raspberry Pi as well: https://github.com/raspberrypi/usb-pid
I tested on a Feather ESP32-S2 TFT, with the test program #5903. No errors, and the voltage is reported. Thanks!
I am not sure how to go about doing that. As I am not the vendor of the board, just got it from internet to use for my own purpose. I used the same VID as the lilygo board with esp32s2 so I assume that is the VID for Lilygo. PID I just made up one for testing purpose, I was hoping the team can help me assign one as the documentation says. Hope this helps.
so it looks like I assumed a translated string would always be <256 bytes in the utf-8 encoding, but the russian translation has this which comes in at 262 bytes in the utf-8 encoding: Pinout использует %d байт на элемент, что потребляет больше, чем идеальные %d байт. Если этого нельзя избежать, передайте allow_inefficient=True в конструктор
@slender iron @tulip sleet quick question. I'm trying to add boards to circuitpython.org and a couple of boards (espressif_esp32s3_devkitc_1 and espressif_esp32s3_devkitc_1_nopsram) are on the site, but don't seem to be in circuitpython. Were they renamed or removed?
@gilded cradle they were renamed, I think
espressif_esp32s2_devkitc_1_n4r2
espressif_esp32s3_devkitc_1_n8
espressif_esp32s3_devkitc_1_n8r2
espressif_esp32s3_devkitc_1_n8r8
Ok cool. I'll just remove those from the data file because the other ones are accounted for
I think we could get our Russian translator to trim some of these.
it turned out there were more variations (2 levels of flash, 2 levels of RAM), so we renamed them.
or do it ourselves for now with Google translate
Thanks, I was a bit stuck on that.
if (compress_max_length_bits <= 8) {
return 1 + (compressed->data >> (8 - compress_max_length_bits));
} else {
return 1 + ((compressed->data * 256 + compressed->tail[0]) >> (16 - compress_max_length_bits));
}
}
``` It's supposed to be handled, but gcc throws up an error in the unreachable arm of the if-statement..
The translations in Russian are less telegraphic than they are in other languages.
so I also have a pretty simple fix, I think.. turn it into a #if / #else / #endif instead
This also includes the changes from #6031 at the time I began working on the build problem first seen there.
If the Russian is in UTF-8, are most characters one byte or two? I was just wondering whether these non-Latin character sets cause double-length strings in general
Most characters will be 2 bytes in the UTF-8 representation.
I wonder if for these languages some other encoding would be better, though I'm not sure what
better -> "shorter"
when it comes to the huffman code table and the "words" table we write them out as a 1-byte or 2-byte encoding, depending whether there are any code points >255 (so only code points <65536 can be used). so everything except american & western european ends up using 2 bytes
i should look at some Russian websites and see what they serve up
const mchar_t values[] = { 32, 97, 105, 115, 116, 99, 100, 101, 128, 109, 110, 111, 112, 114, 117, 1072, 1074, 1077, 1080, 1086, 39, 46, 131, 138, 98, 147, 144, 102, 103, 108, 136, 132, 141, 133, 146, 140, 120, 1076, 1083, 1084, 1085, 1089, 1090, 1091, 245, 217, 193, 216, 130, 129, 149, 45, 48, 95, 155, 169, 158, 177, 148, 104, 156, 139, 118, 119, 121, 1073, 150, 163, 1079, 1081, 1082, 157, 142, 137, 154, 1087, 151, 135, 1095, 1099, 1103, 134, 191, 207, 200, 223, 199, 194, 40, 41, 49, 50, 67, 68, 73, 79, 80, 82, 83, 84, 85, 176, 238, 218, 159, 171, 107, 167, 224, 165, 205, 170, 246, 192, 195, 172, 1053, 1055, 1075, 175, 181, 1078, 166, 164, 152, 143, 153, 160, 1088, 145, 162, 161, 173, 174, 1092, 1096, 1100, 219, 247, 37, 186, 47, 168, 51, 52, 53, 54, 56, 58, 61, 65, 66, 69, 76, 77, 78, 87, 225, 198, 187, 179, 201, 184, 178, 226, 180, 204, 206, 208, 122, 1041, 1042, 1044, 252, 1054, 239, 182, 183, 196, 1093, 1094, 1102, 242, 243, 210, 34, 42, 60, 189, 71, 72, 213, 188, 185, 86, 228, 215, 227, 214, 229, 231, 106, 234, 230, 113, 236, 235, 197, 1047, 1048, 253, 1050, 1052, 248, 251, 241, 1057, 1060, 220, 212, 190, 244, 209, 202, 254, 221, 203, 1097, 1098, 1101, 222, 33, 44, 211, 57, 59, 62, 250, 70, 237, 88, 96, 232, 1040, 1056, 1058, 1064, 1069, 1071, 233, 35, 43, 89, 91, 93, 126, 1045, 1059, 1063, 240, 55, 74, 123, 125, 1043, 1062, 249, 1105 };
Korean is not currently turned on, are you saying if there is a single two-byte character, they are all 2 byte?
russian is the new largest language
and the translation is not close to done
What choices besides storing UTF-8 or UTF-16 seem feasible to you?
that's the thing, I don't know of any
"Pinout uses %d bytes per element, which consumes more than the ideal %d "
"bytes. If this cannot be avoided, pass allow_inefficient=True to the "
"constructor"
msgstr ""
"Pinout использует %d байт на элемент, что потребляет больше, чем идеальные "
"%d байт. Если этого нельзя избежать, передайте allow_inefficient=True в "
"конструктор"
```to be fair, this is not much larger than the English
.. in code points
153 -> 160. it's in utf-8 bytes, which because of reasons led to a more efficient implementation of "know when decoding a string is complete", it's over 255.
moscowtimes.ru is UTF-8
``` If you had an efficient way to use 12-bit values instead of 16-bit values you'd get some savings, since the highest unicode code point is <2048. but that doesn't help with all languages, CJK languages have lots of higher numbered code points
yes, CJK is going to be big. But since a code point can be a whole word, it might be a bit of a wash.
making the entries in values[] and words[] variable length like utf-8 hurts in cases like CJK (because some things are 3 bytes) but also it creates a problem for efficiency, you can't just index you have to count by code points
albert@tuna:~$ cat >foo.txt
использует
halbert@tuna:~$ more foo.txt
использует
halbert@tuna:~$ od -c foo.txt
0000000 320 270 321 201 320 277 320 276 320 273 321 214 320 267 321 203
0000020 320 265 321 202 \n
0000025
in the UTF-8 of the Russian above, the first byte of the pair is always 320 or 321 (octal!)
since it's a small-alphabet language. I am not pushing for a solution here, I am just wondering how to store such UTF-8 strings more efficiently in general.
that is, it's a small number of codepoints, but not in the zero block
there are some other 'compression' schemes for unicode separate from huffman & dictionary style compression. They tend to be optimized for certain scripts. Often they have a code saying 'all the next values will be from some other 'page' of unicode, but they're all 1 byte' and have control characters to switch among some common or recently used pages
I forget what these algorithms are named
it's also worth noting that for our "dictionary" encoding we take advantage of the fact that character values 128..160 (?) are always unused, and for non-western-european, 128..255 are unused. those are the values[] entries that stand for whole sequences of code points.
switching to utf-8, or something else that would use more 'single byte values' would take away from that space of numbers we can use to represent repeated character sequences (that we call 'words' sometimes, even if it's a bit erroneous as they're unrelated to whitespace breaks)
It's almost certain that there's a better way than I have thought of, but there's a whole series of trade offs and layers that have been piled here and you may have to pick more than one thing apart in order to do better..
thanks for the background on this, I ddin't know we used the upper byte values for word entries
@tulip sleet SCSU and BOCU
https://www.unicode.org/notes/tn6/
The byte/code point ratio is 1 for runs of code points from the same block of 0x80 code points (and for Hiragana), and 2 for runs of CJK Unihan code points, as with [SCSU]. The startup overhead is very low (similar to [SCSU]), which makes it useful for very short strings like individual names. The maximum number of bytes per code point is four.With BOCU-1, texts in languages with Latin-based scripts take about the same amount of space as with UTF-8, while texts in all other languages take about 25%-60% less space. Compared to UTF-16, texts in all languages with small character repertoires take approximately half as much space in BOCU-1. For large character sets, i.e., Chinese/Japanese/Korean, texts are about the same size for UTF-16 and BOCU-1.
Got the following error when build for raspberry pico on master branch.
make BOARD=raspberry_pi_pico -j 2
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
mkdir -p build-raspberry_pi_pico/genhdr
text data bss dec hex filename
250 0 0 250 fa build-raspberry_pi_pico/boot2.elf
GEN build-raspberry_pi_pico/genhdr/moduledefs.h
QSTR updated
../../extmod/ulab/code/numpy/transform.c: In function 'transform_compress':
../../extmod/ulab/code/numpy/transform.c:85:15: error: 'shift_ax' may be used uninitialized in this function [-Werror=maybe-uninitialized]
rshape[shift_ax] = true_count;
^
cc1: all warnings being treated as errors
make: *** [../../py/mkrules.mk:74: build-raspberry_pi_pico/extmod/ulab/code/numpy/transform.o] Error 1
make: *** Waiting for unfinished jobs....
@tulip sleet There are a few things hardcoded into the Adabot library checks for ignoring - if you're not going to put Typing in the bundle, it may be courteous to also add it to the hardcoded ignore list. I'm verifying the other things Adabot checks for right now on this repo so it's not an issue that it'll ignore all library infrastructure checks.
Should CircuitPythonLibrarians have access to the Typing repo? @tulip sleet
The same build seems to work just fine with 7.1.1 tag
I can add if so, but wanted to verify first.
I could put typing in the bundle. I'll fix the Circuitpython librarians thing
I'm literally already on the page.
it's not bad to be in the bundle, it's just not necessary
@fierce dust when you check out a different branch or tag, make sure your submodules are up to date. I am not entirely confident of the commands, I know what I run but I think it's different than what is suggested for the community. make fetch-submodules; git submodule update may be it, @tulip sleet do you want to say what's actually right?
Up to you. Add to bundle, or add to Adabot's ignore list 🙂
I fixed the other settings on that repo too. So it should be good to go.
If it's actually in the bundle then won't circup actually install it? do not want.
it got uploaded to pypi as adafruit-circuitpython-typing; does that or just circuitpython-typing make more sense to you? The actual repo is Adafruit_CircuitPython_Typing, but the import as you know is import circuitpython_typing
This is exactly what I did with fresh cloned master branch. make fetch-submodules the make BOARD=raspberry_pi_pico -j 2
i was also thinking it might get included in Learn Guide project bundles
@fierce dust otherwise, make sure you're using the specific arm toolchain that we are using during CI, because sometimes different compilers give different diagnostics.
Not sure the PyPI name matters to imports. I guess it might alleviate confusion...
(gcc-arm-none-eabi-10-2020-q4-major)
Sounds like maybe it doesn't belong in the bundle then with all of those concerns.
@onyx hinge Ok, will give it a go. Thanks.
make fetch-submodules at the top level is the "best" way, but is slower than git submodule update. Do make fetch-submodules the first time or else it will fetch 10GB of RPi broadcom firmware
ok, let's put it on the omit list. I can do that if you tell me where, or you can do it
speaking of submodules, something in ports/stm seems to be making things very grumpy. Switching branches is telling me things like ```warning: unable to rmdir 'ports/stm/st_driver/stm32f0xx_hal_driver': Directory not empty
maybe I will leave it, in case someone else uploads their own version. adafruit-circuitpython-asyncio is similarly inconsistent when it comes to the actual name to import
That's fine with me.
I prefer consistency in naming in general.
this is the result of making new submodules for the STM HAL libs. I eventually recloned my fork instead of trying to figure out how to fix it
@tulip sleet that's frustrating, OK
i tried a bunch of ways to fix it, but did not succeed
every once in awhile something really seems to leave git confused
it means the dependency will be on adafruit-circuitpython-typing in install_requires in setup.py, and in requirements.txt. I'm confused about whether this will be confusing or not.
Nah because most imports aren't the full name.
thanks for another brain on this
@onyx hinge Change arm tool change to the correct version solves the problem. Thanks.
I thought Black ran on the entire library repo. I ran pre-commit manually and it ignored some obvious issues, so did Pylint. I'm a little confused.
@lone axle Are you around for a type hint question?
Nevermind! Got it sorted with Tekktrik.
That's a cool tool. Seems to be a problem with an error return from the lwip component's ping. Why is there no common-hal; line in the trace?
espressif/build-espressif_esp32s2_devkitc_1_n4r2/esp-idf/../../esp-idf/components/lwip/apps/ping/ping_sock.c:347 (discriminator 5)
espressif/../../shared-bindings/wifi/Radio.c:536
espressif/../../py/objfun.c:136
espressif/../../py/runtime.c:656
espressif/../../py/runtime.c:671
espressif/../../py/vm.c:1102
espressif/../../py/objfun.c:297 ...
Is this an opt build? The compiler could have brought the underlying call in common-hal directly into the shared bindings bit. The LoadProhibited error is usually due to an invalid memory address being passed.
Oof, Learn in the editor is loading images like it's the 90s. It's not stopping me from doing what I need to, but it's combination annoying and hilarious.
they don't make them like they used to anymore
Not even close.
even nostalgia is not the same anymore
Hah, truth.
I don't know what an opt build is. This was built with:
make -j clean all BOARD=espressif_esp32s2_devkitc_1_n4r2 DEBUG=1
I noticed voices 0 and 1 are used in https://www.youtube.com/watch?v=hAPRO0Tg_G0 - did this get fixed?
@idle owl cookiecutter, etc. are still using black 20.8b1. Circuitpython, when it does black uses the latest (it doesn't specify the version in the pre-commit yaml file).
Are we planning to move to black 22.1.0? The main difference I see is that it is now putting spaces around the ** operator
Um.... Oh, CircuitPython itself. We can move the libraries whenever, really. It's a relatively easy Adabot patch for Eva. But she's going to be teaching Tim and I how to use Adabot, so we could do that for the example patch when we're learning. That's at the end of this month.
Does that work?
sure, I am just asking because I accidentally ran the 22.1.0 black over adafruit-blinka, and it made one change with **, which then the test job complained about. blinka doesn't use pre-commit (I opened an issue about that), so I could just change the version blinka uses now.
or I could undo the change
That works on both counts.
Nah, update it.
We'll do the rest later this month.
tnx fer guidance!
You're welcome!
hey, so, I've had a Hiibot IOTS2 for a few months (well a year), and it shipped with tinyuf2 and CP6 on it. I'm not sure I identified who makes them outside of the github user (BradChan) associated with the tindie page, who tried and failed to PR it to Circuitpython repeatedly (due to not having a PID and not responding when asked about it).
I have a PR ready, should I just get a pid from Espressif myself ?
@idle owl no worries to do now, but just wanted to clarify what route you were picking for the getter method: do you want it to throw an error or return None?
It sounded like returning None was the move but just wanted to clarify.
Tested this locally and with the other code I have. All worked. I'd take this PR over the one I submitted (#6014). I'm not sure why the raise_msg_str was causing me issues, but it is working here. The important change is the one in dynruntime.h with mp_parent_t.
None of this will be visible to a user until the CIRCUITPY_ENABLE_MPY_NATIVE is enabled.
Native modules are a feature of MicroPython that allow for code compiled to native assembly to be loaded dynamically into MP. This can be really helpful for adding fast code without having to recompile the main runtime.
There are some things we need to handle before we can enable it:
- [ ] Establish a file name suffix convention so it's clear what platforms a native file support.
- [ ] Also include this info in the file itself and error if the suffix or internal metadata don't match.
...
Got a question on free memory on esp32s2 wroom based board. It has 320k sram onbaord. However under micropython it shown as have 140k+ mem free, but the same board on circuitpython only shown as 46k+ mem free. Was wondering what is the reason behind the discrepancy?
@tulip sleet the PR for bus device, should Blinka version be specified in requirements.txt?
Saw it and want to know the fix if I come across it during typing
you're right, that should be done on both of those PR's! I'll fix
Is the goal to release those now and then finally do the Blinka one?
At least in terms of order of operations
yes, that's the idea. Then I could go back and release Blinka as 7.0.0 and redo those, if we wanted to.
it turns out the circuitpython_typing/ directory in adafruit-circuitpython-typing overrides the circuitpython_typing.py file installed by adafruit-blinka, so you get the new circuitpython_typing if both are installed
I think it's a tradeoff we make to leave room for the lwip sockets and IDF allocations
espressif_esp32s3_devkitc_1_n8
espressif_esp32s3_devkitc_1_n8r2
espressif_esp32s3_devkitc_1_n8r8
these are the esp32-s3 devkit-c variants, should all be in the just-released 7.2.0-alpha.2. The first is "nopsram", the second is 2MB PSRAM, and the third is 8MB PSRAM. All have 8MB SPI flash.
Thanks.
heres a minimal implementation for anyone who wants to take a crack at adding to circuitpy https://github.com/chrmlinux/tinyESPNow
@tulip sleet you probably saw this: https://twitter.com/1st1/status/1493748843430567942
This PR fixes ticks in moduasyncio.c to work with adafruit version of asyncio, and enables _uasyncio module. With this PR, C-version of Task and TaskQueue are used in the asyncio.
Here's Rossum's issue discussing TaskGroup: https://bugs.python.org/issue46752
The _uasyncio implementation of Task does not provide__await___(). Our internal implementation of async/await (done by @WarriorOfWire) requires that. Otherwise code is going to fail. I had to add __await__() in the Python version in a couple of places:
https://github.com/adafruit/Adafruit_CircuitPython_asyncio/blob/28ef812f14ef1fde1036eb83a4878bd14aa9a67d/asyncio/task.py#L152
https://github.com/adafruit/Adafruit_CircuitPython_asyncio/blob/28ef812f14ef1fde1036eb83a4878bd14aa9a67d/a...
Thank you for the comment. Now I understand why _uasyncio is missing in the modules. I'll close this PR.
If you can see how to add __await()__, that would be great. but it's rather deep in method resolution. I haven't had time to look further.
I appreciate your work, and we can use these commits in the future, in any case.
_uasyncio is not used for asyncio, right now because the _uasyncio implementation of Task does not provide__await___(). Our internal implementation of async/await (done by @WarriorOfWire) requires that. Otherwise code is going to fail. I had to add __await__() in the Python version in a couple of places:
https://github.com/adafruit/Adafruit_CircuitPython_asyncio/blob/28ef812f14ef1fde1036eb83a4878bd14aa9a67d/asyncio/task.py#L152
https://github.com/adafruit/Adafruit_CircuitPython_...
In #6038 I ended up with the following changes to fix extmod/uasyncio to work during the host-computer tests. I'm not sure if it's a relevant piece of the puzzle:
diff --cc extmod/uasyncio/core.py
index 12833cf0c,12833cf0c..c3ce3ccaf
--- a/extmod/uasyncio/core.py
+++ b/extmod/uasyncio/core.py
@@@ -36,7 -36,7 +36,7 @@@ class SingletonGenerator
self.state = None
self.exc = StopIteration()
-- def __iter__(self):
++ def __await__(self):
ret...
If any reviewers have a moment today. Would appreciate if anyone can take a look at: https://github.com/circuitpython/CircuitPython_Library_Screenshot_Maker/pull/11. This change is needed to make the project files screenshot for my PyPortal Winamp guide look correct. (There are some files meant for PC only that should be excluded from the CIRCUITPY drive screenshot). It's in CircuiptPython org so I can't tag librarians as a group, but happy to have anyone who can take a look.
I did! I liked several of those tweets.
approved!
Thank you!
Ok, all of those are added in, so we should be able to close this.
@tulip sleet I'll probably get started on writing the docstrings for asyncio. Is taking the existing documentation and porting it into the code as docstrings sufficient?
Well, I guess the existing documentation is for uasyncio right? I guess that's a starting point, but (correct me if I'm wrong) there are differences between that and asyncio.
Not sure how that will translate for docstrings though
The differences are very minor. Note that I did not use black on the asyncio code - it's very close to the micropython code, and if I blacken it, it will be much harder to merge changes. I will ask upstream if they could use black on the original.
Okay, I think I saw the comment disabling pylint and black in at least one of the files, I'll be sure not to touch them
At this point, are type annotation for the library going to be more in the way than not? I was going to do them in a separate PR but if there's the want to keep it close to the MicroPython code, I could see the value of not doing it right now.
yes, I'd say omit them for now
Sounds good!
note that type annotations are mostly relevant to code completion in IDEs in my opinion, and they already have that for asyncio
@proven garnet I looked more closely, and they do use black on the files, but as black --fast --line-length=99
it was pylint that had many more complaints, now I remember
without the 99, it changes about 12 lines across three files
so don't do it for now, but it's less of a worry than I thought
Got it, thanks for the clarification!
They've previously asked us to use the same USB VID/PID for "similar" boards (varying only in flash/psram capacity), let us know if you need help modifying tools/ci_check_duplicate_usb_vid_pid.py to make this OK with the CI.
If the board maker has a USB PID, we request that they assign a VID for CircuitPython (and for UF2, if applicable).
@proven garnet I think I understand what I was missing with regards to your PR question. I wasn't considering that you can also "get" the range... so the NotImplementedError needs to be in both. It was initially, but I removed it from the property because it seemed redundant. But if you can also print(range) for example, it needs to raise the error in both. I'll update it and submit the fix.
@proven garnet So does that mean the @property should be -> None as well now?
I would say if you're adding NotImplementedError it's appropriate to use the "eventual" type because it's impossible to actually get anything at (for example, you don't even get None since it raises the exception). So keep it as int in that case!
Ok thanks
@proven garnet When you have a moment, https://github.com/adafruit/Adafruit_CircuitPython_ADXL37x/pull/2
@proven garnet Also you don't need to comment if it's all good, but you could also check the type hints in the new sections of this one in case I did them wrong https://github.com/adafruit/Adafruit_CircuitPython_ADXL34x/pull/34
Just approved! I can take a look at the other too
Thank you!
Looks like you could remove the pylint: disable for busio there too
Looks good to me!
@proven garnet Has anyone gone over doing releases with you yet?
No, just approving and merging
Ok, if no one else gets to it, how about Friday we can go over it on your lunch? I've got Things ™️ today and tomorrow to deal with.
Sounds great to me!
Perfect. Added to my calendar. Wait - 12p-1p ET is your lunch?
ET, yup!
Ok great. It's in my calendar so I'm more likely to remember. 😄 @proven garnet Don't hesitate to ping me on Friday though if I end up missing it.
Will do, and same here 🙂
opt is without the DEBUG=1. I think the compiler inlines for debug still actually. The unoptimized builds don't fit in the flash space we've set aside.
This will free up some memory on a few of the boards that use the PortalBase library, which currently does not function on the MatrixPortal and is pretty close to the max space on the others.
@tulip sleet is this correct? I assume this is written this way intentionally for under the hood but Sphinx gives a SyntaxError for doing return True from an async function. Trying to see about how to get around that, but just making sure.
Hmm, it's failing with this error:
usage: mpy-tool.py [-h] [-d] [-f] [--merge] [-q QSTR_HEADER]
[-mlongint-impl {none,longlong,mpz}] [-mmpz-dig-size N]
[-o OUTPUT]
files [files ...]
mpy-tool.py: error: the following arguments are required: files
make: *** [../../py/mkrules.mk:167: build-matrixportal_m4/frozen_mpy.c] Error 2
Nope, it's this error actually:
Error: Build matrixportal_m4 for de_DE took 1.[11](https://github.com/adafruit/circuitpython/runs/5221196089?check_suite_focus=true#step:9:11)s and failed
make: Entering directory '/home/runner/work/circuitpython/circuitpython/ports/atmel-samd'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
mkdir -p build-matrixportal_m4/genhdr
FREEZE ../../frozen/Adafruit_CircuitPython_PortalBase ../../frozen/Ad...
Make sure that the submodule is pointed exactly at a tagged release, not at the tip of main.
this should be ok. I tested the construct in CircuitPython and CPython, and it doesn't raise an error. I wonder if Sphinx is assuming an older version of Python
Make sure that the submodule is pointed exactly at a tagged release, not at the tip of main.
I don't think I did that. How is that done?
I must use an I2C device that wants a write that is not followed by a stop bit or a (immediate) read.
The underlying Wire library offers clients the ability to send or suppress the stop bit after a write on the I2C bus.
The CircuitPython busio library always sets this flag to True in busio,writeto, forcing a stop bit after a write (except when using write_then_read).
Please expose the underlying control of Stop Bit behavior by adding an optional (keyword?) parameter to busio.writet...
you can totally do that, just as two separate calls: one write then one read. if you write, by default it will add a stop. if you write-then-read it will not add a stop. we do this because linux kernel doesn't allow a write without a stop in a single call without a followup read. this way we can make sure drivers will work on linux as well as microcontrollers.
https://circuitpython.readthedocs.io/en/latest/shared-bindings/busio/
please try it :)
I went into the submodule and checked out the release tag for each and then committed. Hopefully that's right.
@makermelissa If you go to the top level at circuitpython/, there is a make target: make update-frozen-libraries, which does this for you. It will update all that need updating.
Thank you for the prompt response! Unfortunately, a write followed by a
read does not work in circuitpython. The write is terminated by a stop
bit, which causes the peripheral device to abandon the operation.
I need to write data from the controlling microprocessor (without a
following stop bit), wait for a signal from the peripheral device
indicating data is ready, then read from the peripheral device then send a
stop bit/condition (then release the bus lock).
I can do it in c++, but not i...
what is the device you are writing a driver for? so far we've been able to support all the i2c chips we've seen that follow i2c standard.
Did you try writeto_then_readfrom() ?
I did not, but I will.
The specification from the device manufacturer says I must wait until a
digital signal from the device indicates that the data is available before
reading. In my preliminary tests, there seemed to be a significant delay
between the completion of the write and the signal indicating "data ready"
to read. I expected that writeto_then_readfrom would attempt the read
before the data was ready, but I can try it to see if it works to ignore
the data-ready signal...
Thanks,
D...
Just echoing @todbot 's experience here, I'm doing wav playback over PWM on Feather RP2040 and it has wreaked havoc on my typical iterative development workflow. Having to reset board manually, open REPL, ctrl-d, save code.py, then go through a similar dance to reset the board each time. On occasion it seems to be causing my USB mouse to stutter!
Please tell us the device so we can look at the datasheet. The usual way of doing this is that the device does clock-stretching until it is ready. Is the signal you are talking about another pin, or is it a part of the I2C transaction.
The device is a lighting control system. If I had access to/control of the
peripheral device software, I might be able to change it to look more
conventional, but I do not.
The specification of the peripheral device says I must write, then wait for
a data ready signal before reading. I will try writeto_then_readfrom, but
I suspect it will attempt the read before the data is ready... It may be
inelegant, but I believe the peripheral device conforms to the I2C
specification, but I'm not an I...
The signal is coming from another pin.
I cannot send the datasheet as we are bound by an NDA from the vendor.
I will try writeto_then_readfrom. Perhaps the clock-stretching is enabled
and the digital IO pin for "data ready" is superfluous.
On Wed, Feb 16, 2022 at 3:01 PM Dan Halbert @.***>
wrote:
Please tell us the device so we can look at the datasheet. The usual way
of doing this is that the device does clock-stretching until it is ready.
Is the signal you are talking about a...
a data ready line in between write and read is really completely outside the i2c spec, please contact the vendor cause they're doing something very weird.
OK, thanks. I will definitely contact the vendor about this.
I have had great success accessing other I2C devices using CircuitPython,
but this one is killing me.
On Wed, Feb 16, 2022 at 3:09 PM ladyada @.***> wrote:
a data ready line in between write and read is really completely outside
the i2c spec, please contact the vendor cause they're doing something very
weird.—
Reply to this email directly, view it on GitHub
<https://github.com/adafruit/circuitpython/issues/60...
@tidal kiln For the TFT feather, the final pin name is TFT_I2C_POWER ?
I mean I can dig it up, and so on, but you were in there recently, so I figured ask.
for arduino
Oh hmm
I meant for PrettyPins
Let me check CP
I2C_TFT_POWER
Blergh.
That's why that's what it is on PP.
Yah.
I will ask Limor which one she wants as canonical.
And submit a fix to the other I guess.
MAKE_STUFF_GO is my submission 🙂
Duly noted! 😄
All the other TFT pins are names starting with TFT_, so the arduino choice is more consistent
Noted, and mentioned. Thanks
Did a git pull and then git status on CircuitPython... what is all this? Untracked files: (use "git add <file>..." to include in what will be committed) ports/stm/st_driver/CMSIS/ ports/stm/st_driver/README.md ports/stm/st_driver/STM32F0xx_HAL_Driver/ ports/stm/st_driver/STM32F1xx_HAL_Driver/ ports/stm/st_driver/STM32F2xx_HAL_Driver/ ports/stm/st_driver/STM32F3xx_HAL_Driver/ ports/stm/st_driver/STM32F4xx_HAL_Driver/ ports/stm/st_driver/STM32F7xx_HAL_Driver/ ports/stm/st_driver/STM32G0xx_HAL_Driver/ ports/stm/st_driver/STM32G4xx_HAL_Driver/ ports/stm/st_driver/STM32H7xx_HAL_Driver/ ports/stm/st_driver/STM32L0xx_HAL_Driver/ ports/stm/st_driver/STM32L1xx_HAL_Driver/ ports/stm/st_driver/STM32L4xx_HAL_Driver/ ports/stm/st_driver/STM32L5xx_HAL_Driver/
a bunch of submodules in STM were changed
But if they're remote, why are they untracked locally?
Also the espressif/esp-idf is still showing "modified" after doing the submodule update thing. 😕
you could do git clean -xxffdd ports/stm and that might help. got to the top directory and do make fetch-submodules again. But Jeff and I found that our clones were somewhat messed up
Usually the submodule thing fixes modified files.
Oh hmm ok.
Should I simply reclone then?
you can do git submodule init --update again too, and it should not pull the the whole broadcom repo
If you don't have a lot of ongoing work, that would be easieest
I think I already blew away the only ongoing stuff I had. So no, there's nothing.
you'll need to do make fetch-submodules which will take a while, and rebuild mpy-cross
I ended up doing that, and i pushed a bunch of in-process work, so it was worth ti
Is my ESP build environment going to disappear too?
I mean whatever, I'm redoing it regardless. But want to know.
yes, you'll have to do esp-idf/install.sh again
too
but that fetches stuff elsewhere, so it won't take as long
Alright, setting up new one now.
@tulip sleet OK, so I did the fetch-submodules and rebuilt mpy-cross. I should be good to go?
esp-idf/install.sh, but you don't have to do that now
I'll do it now because I'll forget what's involved when I need it.
@tulip sleet Where do I run that from?
What directory
cd ports/espressif
ok
@minor plume Hey, sorry I missed your PR, I have been slammed with work. I left a small comment, but besides the quote format looks good to me. I also have a change I haven't had a chance to merge I would love for you to take a look if you have time sometime. I'll probably push it up to github later this week, but it should allow you to install any version of a package like poetry/npm etc.
No problem. Happy to look at both things. I’m traveling at the moment but I’ll get to them as soon as I can.
Thanks, enjoy your travels. I'll make a PR when I finish. I think in the long run it might be best to actually use Poetry Core to do dependency resolution, but its a but tricky right now for a number of reasons. I looked into using CircUp as well but even though there is a lot of overlap I think Poetry core really fits the paradigm best in the long run.
For now I did the resolution myself using the bundle index. Also I looked into the Github api which I know Circup uses but they have an api limit of like 60 requests per hour for anonymous requests, which makes it hard to do complete resolution. Poetry uses Pypi when it can but because of gaps in the Python ecosystem also installs and resolves dependencies that way when necessary. Basically I'm saying, everything has a lot of workarounds because the Python community has only recently been addressing all this.
a small warning: poetry does not yet support yanked releases: https://github.com/adafruit/uf2-samdx1/releases/download/v3.14.0/update-bootloader-feather_m0-v3.14.0.ino. This came up when we had a bad release for something which we had yanked. Eventually we just deleted the release
we weren't using poetry, but someone else was
@tulip sleet That's very good to know. I have had one question lingering perhaps you know the answer to. Are the bundles just auto-built when a package has a new release, or do they promise any sort of compatibility between the packages?
a bundle is just a snapshot, produced when any library in the bundle has a new release
circup doesn't use the github API, it uses direct links
@tulip sleet I ran pre-commit manually before doing the PR, and it altered the circuitpython.pot file. I git stash'd and git stash dropped to get rid of the changes, and uninstalled the pre-commit hooks. It passed remotely without issue. What's the deal there?
Also poetry is suuper slow, but I think its because the pypi dependency support is still being improved.
it would do that if it thought the translations were out of date. Did you bring your fork up to date before the PR?
@jaunty juniper Oh okay, good to know. So it downloads for dependency resolution?
Probably not.
It was a fresh clone though.
I'll try to fix it once this PR is merged.
before starting a PR branch, I always bring main up to date
Okay so it's not Python version because it fails to build the docs even at Python 3.7... I also can't wrap the code in question with a try/except for SyntaxError as it still gets raised. I tracked down what is actually throwing the error in CPython because @tulip sleet is right in that it is valid syntax and I also confirmed that it is like he did. Here's what's throwing it but I'm C illiterate, so if anyone knows what this code is in CPython and why Sphinx autodoc would throw it when parsing an async function that returns a value, that might help
Ah, the line number would help wouldn't it...
It's too much for poor matrixportal to handle .. by a lot :cry:
/usr/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: build-matrixportal_m4/firmware.elf section `.text' will not fit in region `FLASH_FIRMWARE'
/usr/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: region `FLASH_FIRMWARE' overflowed by 33872 bytes
I didn't think about it because I cloned it just now.
I forgot about my fork until after, and didn't want to get caught up in a rebase. The merge was clean, so I left it alone for now.
@jaunty juniper Nevermind I just went through the code.
the dependencies are in the bundle zip, and it uses the headers from https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/latest to extract the latest tag of the bundle:
server: GitHub.com
date: Wed, 16 Feb 2022 21:41:13 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Accept-Encoding, Accept, X-Requested-With
permissions-policy: interest-cohort=()
location: https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/tag/20220216
that error message is gone in main in cpython
what is the version of python you are using?
I can't build the docs locally for some reason so I'm having the CI do it. I've tried 3.10 and 3.7 and neither work
In my local repo
Okay that's what I have piku doing as well. I would like to use PyPi in the long run, is there a reason you chose not to?
Ok, hmm. Now to figure out what to leave out. I did give it everything relevant to it.
i am forgetting which repo this is, and could you show me the command line you are using?
It is? I think can see it in main (sorry thought I linked main): https://github.com/python/cpython/blob/main/Python/compile.c#L3089
i'll try it
you're right, I typed the search string wrong
it thinks it's a generator
now I remember it's asyncio. I'll try building the docs
Sounds good, I ask because I'm sitting on a PR for the docstrings
I can add it as a draft if that would help
you mean pypi to resolve dependencies ? Many libraries are not on pypi.
@proven garnet
albert@tuna:~/repos/Adafruit_CircuitPython_asyncio$ sphinx-build -E -W -b html docs _build/html
Running Sphinx v4.4.0
loading intersphinx inventory from https://docs.python.org/3/objects.inv...
loading intersphinx inventory from https://docs.circuitpython.org/en/latest/objects.inv...
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 3 source files that are out of date
updating environment: [new config] 3 added, 0 changed, 0 removed
reading sources... [100%] index
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index
generating indices... genindex py-modindex done
writing additional pages... search done
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded.
The HTML pages are in _build/html.
halbert@tuna:~/repos/Adafruit_CircuitPython_asyncio$ python --version
Python 3.9.10
building for me, hmm
Yes. Okay. That's good to know. I have just started looking into all this, been very busy with work. I guess that makes using Poetry / PyPi more challenging.
Thanks for the info!
the dependencies are in the requirements directory in the bundle. There is a json file with all the dependencies, computed by the bundler, like that: https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/download/20220216/adafruit-circuitpython-bundle-20220216.json
circup does not use it yet (but the learn guide bundler does)
I'll stick with using the bundle json indices for now.
Are you on main?
I think main is only building the __init__.py file so it doesn't hit the error
In my PR I expanded the files it would document, I'll draft and tag you on the PR
(Based the contents of api.rst)
@jaunty juniper Okay that's what I have working currently (if I understand you correctly). I need to dig into CircUp more. Is there an index anywhere mapping version of a package to build, in the long run thats what would be most helpful for Piku.
@proven garnet i believe you, i'm looking at whether we can change the code
@onyx hinge or @tulip sleet regarding frozen libraries, would it make more sense to point to the library folder inside of frozen directories instead of the entire repo or does it sort that all out automatically?
Currently basically I take the version, use poetry core and find a candidate package using the bundle package indices. Then use the bundle package index to resolved dependencies. But by allowing installation from different bundle builds and using those json files I havent figured out how I am going to resolved dependencies between bundle builds yet. I guess I just assume it will work.
I also haven't addressed some of the issues CircUp does like checking that the dependency is micro-controller only etc.
it sorts all that automatically. It is assuming the libraries it's freezing are the top dir in a submdoule
Ok, cool. Thanks.
(I may be missing some context in this conversation)
I was looking in the issues for circuitpython related to i2c issues on the RP2040 but I can’t find any. I was wondering if anyone was having issues using i2c scan on the RP2040?
MatrixPortal build was too big because I added a bunch of frozen libraries
I'm just trying to figure out what to shave off
Someone messaged my tindie shop saying they couldn’t run the i2c scan on an RP2040 board with circuitpython using a similar code as they used on CPX
you have to remove an entire library
I’m waiting to get code and whatnot back from the person but I figured I’d ask here if any i2c scan issues have been seen
I haven't run into any that I can remember, and I've been doing a lot of STEMMA QT breakout stuff with a QT Py RP2040 recently.
there were issues in the past but they were fixed. Find out what version they are using. MicroPython had a few potential issues until recently -- if they might happen to have been using MicroPython
Not necessarily with I2C scan, but no issues using I2C boards.
Yeah, I’ve not run into any issues myself but I’m hoping to figure out the details
the scanning is done with a zero-length I2C write, which has to be done with bitbangio because the RP2040 hw I2C doesn't support zero-length writes. There is a 1-sec potential timeout on that (which is too long, it should be shorter). There are a few badly-behaved devices that don't like zero-length writes, but very few
@proven garnet change the yield in that function to await asyncio.sleep(0). I think that will fix the problem. We don't generally want to use bare yields like that. In this case it makes the compiler think it's a generator
Sounds good, I'll make that change! Thanks for that
I removed DisplayText from MatrixPortal since it really contains 3 variations and only one is loaded in memory, but it uses 60k of frozen space.
I need to test the builds (and make sure I'm comparing apples to apples) but it looks like we get ~300 bytes of flash space back from the 1.18 upgrade. if accurate, not bad!
by the way, let me re-ask, I'm not sure what to do about the Hiibot IOTS2: I have a PR ready to add it, should I get a pid from Espressif ? The github user (BradChan) associated with the tindie page where the board is sold, tried and failed to PR it to Circuitpython repeatedly (due to not having a PID and not responding when asked about it). I'm not even sure of who Hiibot are or if the Bluefi and IOTS2 are actually affiliated with them...
@tulip sleet That worked but now getting the draft PR has a new error for using await outside of async function, different part though so progress!
@tidal kiln CircuitPython pin name updated to match Arduino. PrettyPins updated to reflect change. Warnings and text added about Arduino requiring manually setting the pin. Please take a look at your convenience. https://learn.adafruit.com/adafruit-esp32-s2-tft-feather/pinouts
@tidal kiln You might have better wording for the warnings.
I mean, that looks cool, but I see no reference to the products added to CP with the hiibot name
http://www.hibottoy.com/HiiBotCircle.html (though the site is in chinese, so I'm navigating blind)
@lone axle Do you have a TFT Feather ESP32-S2?
Hmm. I was going to see if you wanted to toss together a simple CP graphics test, but it looks like this is what I want - https://github.com/adafruit/Adafruit_CircuitPython_ST7789/blob/main/examples/st7789_240x135_simpletest.py Does that seem correct?
@lone axle I need to put together a page in the guide on using the display. Wanted to start with a simple thing, and then I'm going to show a GitHub Stars thing that Limor already has code for. I think that simpletest will work.
Good catch thank you
have you tested the neopixel behavior in arduino? says that's auto also
@tidal kiln Updated.
No, but I thought you did?
And it should be changed?
How simple are you thinking? Label with "hello world" only or a bit more? It could show a Blinka BMP file as well maybe? Text and bitmap images are two things most people end up wanting to do I think.
Good call.
Probably want to do two separate example for that. That simpletest seems simple enough for displaying Hello World. But a really simple bitmap example would probably be helpful.
@idle owl not automatic
I think making line 22 be async def runner(... would work, but it needs to be tested
OK updating now.
#include <Adafruit_NeoPixel.h>
Adafruit_NeoPixel strip(1, PIN_NEOPIXEL);
void setup() {
pinMode(NEOPIXEL_POWER, OUTPUT);
digitalWrite(NEOPIXEL_POWER, NEOPIXEL_POWER_ON);
strip.begin();
strip.fill(0xADAF00);
strip.show();
}
void loop() {
}
Text updated
comment out the power stuff and no neopix
maybe....if it'll fit.
Sure
@tidal kiln After the section is fine.
For people not reading the text and only the alerts, it's close enough.
yah...it's a neopixel section. ok. yah. that should work.
Found a copypasta fail on my part and fixed that too.
I mean I need to test that the change doesn't break asyncio
@tidal kiln Thanks for proofing this for me.
Just double checked, this one works as is on TFT Feather to show a Hello world label: https://github.com/adafruit/Adafruit_CircuitPython_Display_Text/blob/main/examples/display_text_bitmap_label_simpletest.py
Oh I was looking in the ST7789 library (or whatever one it is).
That example is far simpler though.
the other one includes shapes.
Which is also ok.
Ah, the purple and green rectangles? I think that is the standard driver one.
I'll have to redo them anyway for the pins.
Right. Yeah, I was thinking that one, but it occurs to me that I'm already doing a complicated example, so maybe the basic one is better for this
That one plus a Blinka bitmap example to start
Then the GitHub Stars viewer.
@lone axle Can you toss together a centered Blinka bitmap display example? Or to the left if it's easier, doesn't really matter, but centered might look nicer on that display. That or find one that already exists which I suppose is also likely...
Ya, please see if espressif will grant a PID for it
ok BBIAB again, hopefully pizza is ready this time.
@proven garnet still works with async def runner(...) so add the async there too
I tested compiling locally and it was still failing, so I removed a couple more frozen libs and disabled some modules that likely aren't used such as sharpdisplay, sdcardio, and bleio. If any of those are actually needed, we can shuffle it around some more.
@dhalbert Please take a look at this when you have a chance. Thanks!
Hah! This is why I asked you... That would have taken me significantly longer.
So simple too!
Excellent. This is really helpful.
Hooray! 
Will do, thanks for the help!
@lone axle Oh, while you have it there, can you do a simple example that displays the battery data from the onboard sensor? That's the other one we thought folks wanted.
There's a spot for a BME280, but it's not populated yet.
But there's the battery monitor on there.
Ooo nice, I didn't realize it had the battery monitor
Yep!
Yeah I can make that one as well in a moment.
Thank you!
is the screenshot the default code it ships with ? https://cdn-learn.adafruit.com/guides/cropped_images/000/003/501/medium640/FTFT_display_on.jpg?1641832392
I like the idea of reproducing those in CP, sometimes people ask for the demo code and are disappointed that it's not CP
I have the factory source code if that would help you.
It's obviously Arduino.
I'm not certain about what it looks like, I think I already blasted both of mine so I can't verify it is the product image.
ah, I meant that as a suggestion to put in the guide, and guides in general: people get the board, there's something displayed on it, they want to look at the code to see how it's done (obv. it's not originally in CP, but having CP code to do it sounds like a good place to start)
Oh!
I do like the idea. I think it's not something Limor would necessarily want me to be putting time into, but if you're interested in doing it, I can think about where to put the examples in the guide. Would you be interested in doing a short writeup for it as well? Basically, if all the info is there for me, adding it to the guide is trivial. It's writing everything out that I would be told not to put time into.
I did it ages ago with the Circuit Playground Express for the same reason you're thinking of. I agree with the concept.
FWIW, it's typically the product image when it's a display, so that's probably an accurate thing to mimic. But we also have been trying to post the source code as well, which might be easier than simply trying to do it based on a photo.
Beautiful! Thank you!
I had the units and properties backwards. Just updated the gist with those corrected.
Thank you! I will be adding it tomorrow most likely, so no worries.
@jaunty juniper Re your wsgi server: I was primarily interested in serving up files (and large files, at that; the javascript for the game is quite large). I added the routing only because it was in the original code I adapted.
But having a WSGI server for wifi.radio would make a lot of sense
I basically just ported the code from ESP32SPI
a couple of people contributed fixes and a file serving demo
i don't actually know very much about the general use of wsgi, and how one would use it to serve static files efficiently
we could put it in the community bundle, or possibly adopt it
is it non blocking in some way, or does it just return after each serve
it returns after each serve, polling in a loop for the next
or more accurately, you poll it in the main loop
whenever I see party parrot I always think of @candid sun now
well, i could just throw away what I have and adopt that, it's really doing the same thing
i didn't start with the old wsgi server because it wasn't a fileserver inherently
Everything can be a party parrot if you put your mind to it
(wrong chat window sorry)
i was just trying to make the tiniest simple server in a hurry
unless it's better to start clean ? a webserver could be an application for wsgi, but are there file serving optimizations that would be missing ?
the fileserver in your examples does read chunking, which is all I was doing, and the code does EAGAIN, which the original code I had didn't do... it's really pretty much the same. I was thinking how to add route parsing, but wsgi has that already
i was just websearching about using wsgi servers for serving up files
On espressif, responding to Press any key to enter the REPL. Use CTRL-D to reload is delayed.
The cause is port_idle_until_interrupt not waking up on any keys pressed. On other ports, a usb interrupt will wake the loop up, but on espressif, this a FreeRTOS task that is awoken upon ctrl+c being received by tinyusb.
My workaround is a little hacky, but shouldn't cause any issues as far as I can tell.
I'm surprised I haven't noticed this myself. The explanation makes sense, though. No testing performed.
scott noticed it on his deep dive stream and i noticed it about a week ago
Don't portal boards have SD card slots? It'd be nice to put back sdcardio. Is the inclusion of FakeRequests unavoidable? well, I guess it's not very big...
Would select be useful in coordination with asyncio? Or does async accomplish the same thing? µP has uselect. There's not really a peek or available in CPython sockets that I can see.
~Don't portal boards have SD card slots? It'd be nice to put back sdcardio.~ Oh, that applied only to matrixportal, which doesn't have an SD slot.
Correct.
Is the inclusion of FakeRequests unavoidable? well, I guess it's not very big...
Yeah, it's more of a convenience thing. We could remove it.
Hello! I'm trying to build CP 7.1.1 and having a few issues. I followed the Adafruit article about it, and ran this on a fresh checkout after installing the required dependencies:
make fetch-submodules
git checkout 7.1.1 # this is commit ea3c70a95
make -C mpy-cross V=2
It starts to build mpy-cross, but soon fails trying to build ../py/objgenerator.c due to unused variables and -Werror being set:
../py/objgenerator.c:83:66: error: variable 'n_kwonly_args' set but not used [-Werror,-Wunused-but-set-variable]
size_t n_state, n_exc_stack_unused, scope_flags, n_pos_args, n_kwonly_args, n_def_args;
There are 5 warnings total in this file, this is the first one. I edited mpy-cross/mpy-cross.mk and removed -Werror from CWARN , and it eventually finished building, with more warnings (4 in ../py/vm.c).
I couldn't find any reference to these warnings with Google searches, or in GitHub issues, or in Discord logs here. Am I missing a step? I can't reconcile the presence of -Werror and these unused variables in the tagged version; I don't see how it could possibly build. Is there another way to build 7.1.1 without making these changes? – edit: I'm on macOS 11.6 if that makes a difference.
@wide mantle what version of gcc are you using?
I installed the toolchain as explained in the docs; the command is xtensa-esp32s2-elf-gcc. Calling it with --version returns 8.4.0.
I'm not sure what compiler the mpy-cross version uses. it might actually use clang
oh ok; in that case that would be 13.0.1
if you got it building, then you should be able to use mpy-cross
I wouldn't worry too much about hacking it
I used to develop on mac but have switched over to Linux for it now
that's also what I thought for mpy-cross, but I'm getting tons of other errors trying to build the rest for a FeatherS2 Neo.
what does your git status show?
HEAD detached at 7.1.1
and no files that are changed?
I have 8.4.0 of xtensa-esp32s2-elf-gcc here too
is there a reason you are doing 7.1.1 and not main?
there's the .mk that I changed, and a bunch more that I assume are side-effects from the build, maybe? or related to submodules.
I'd be suspicious of the others
umm… yeah 🙂 I'd rather run a released version (hopefully tested too) rather than bleeding edge
mind posting the first chunk of git status?
bleeding edge will generally be better
we haven't done anything majorly destabilizing
though we did update the idf
ya, the new commits line is a submodules thing
try doing the make fetch-submodules in the top level again
I did run make fetch-submodules but the docs mention it before checking out the tag
do I need to re-run it after too? I wondered about that and didn't see it in the article
yup, do it after you switch commits
ok… that makes a lot of sense. Thanks! I'll give it a shot. I suspect this might help with the other build issues I encountered with the firmware itself.
hopefully
oh! but I had tried that. Every time I did the command output started with:
# This update will fail because the commits we need aren't the latest on the
# branch. We can ignore that though because we fix it with the second command.
# (Only works for git servers that allow sha fetches.)
git submodule update --init -N --depth 1 || true
fatal: not a git repository: ~/src/circuitpython-7.1/ports/stm/st_driver/../../../.git/modules/ports/stm/st_driver
Failed to clone 'ports/stm/st_driver'. Retry scheduled
BUG: submodule considered for cloning, doesn't need cloning any more?
Submodule path 'data/nvm.toml': checked out 'e5b149599d14a8841167fe552846ca36925b87a0'
Submodule path 'extmod/ulab': checked out 'a99e0b98787266369eaa33bdae271de761eca05b'```
and more errors.
e.g. ```error: Your local changes to the following files would be overwritten by checkout:
modules/5.10.82+/kernel/net/netfilter/xt_DSCP.ko
modules/5.10.82+/kernel/net/netfilter/xt_HL.ko
Aborting
st_driver was a git submodule and now it isn't
you can delete those files if they are in the way
since you haven't changed much, you can rely on git to pull files back in if it needs them
great, thanks
Thanks for figuring this out! We usually intercept the USB interrupt but, as you said, we don't in this case. This works! I don't think it's hacky. :-)
I got further and apparently close to a full build, but it failed to link build-unexpectedmaker_feathers2_neo/firmware.elf:
xtensa-esp32s2-elf-gcc: error: esp-idf/components/esp_wifi/lib/esp32s2/librtc.a: No such file or directory
make: *** [build-unexpectedmaker_feathers2_neo/firmware.elf] Error 1```
This feels like it could be a board-specific issue… maybe? The only commands I had run related to `esp-idf` were the `install.sh` for the toolchain and sourcing `export.sh` to add them to the path and set environment variables. The path itself where it's trying to find the files is correct, there are a bunch or `.a` files in there but not these two.
does your git status show anything with esp-idf?
modified: esp-idf (modified content, untracked content)
sometimes there are submodules in the idf that don't get updated
ya, change into esp-idf and do git submodule update .
(don't do that directly at the top level otherwise you'll download gigs of repo content)
I see. Thanks again! It clearly did update some files.
🙂 when in doubt git status
aha! now I see these two .a files. I agree with you but I've not found the status output super clear with submodules, it often just says something like "modified content" and I'm not always sure what to do.
when that's the case I usually cd into the submodule and rerun git status
Wrote 2642432 bytes to
build-unexpectedmaker_feathers2_neo/firmware.uf2
woohoo! thanks so much 🙂
🎉
I'm always amazed at the size of .uf2 files. 2.5 MB for all this? 🤯
uf2 doubles the binary size
because it encodes 256 bytes written to flash in 512 byte blocks to match usb mass storage write sizes
why can't it use the full 512 bytes if that's the amount that's fetched from the storage device? instead of only half of it.
there is metadata in the other half
like the total number of block and what block number it is
just a few bytes though
because it can't assume that blocks are written in order
ya, its nice to have a power of two 🙂
it should compress reasonably well if you are worried about the size
the waste is a shame, but it's even more impressive that CP takes such little space
you probably download more browsing the web
definitely
2.5MB isn't that much anymore
most web pages are way over this amount
and those are our largest uf2s due to all of the networking code
the uf2s aren't actually stored on the device at that size
the uf2 filesystem is fake
yep I see it: 1,321,184 bytes for circuitpython-firmware.bin. crazy!
@slender iron actually, I just realized you might be the right person to ask about CIRCUITPY_DISPLAY_LIMIT in displayio. This is the reason why I'm building CP myself instead of using a pre-built image; I have two SSD1327 OLED screens connected and I can't use them with displayio without bumping this value to 2 (which I did in the .mk file for my board, this worked well). But I'm not sure why it's hardcoded like this. Is the idea to not waste space in extern primary_display_t displays[CIRCUITPY_DISPLAY_LIMIT];? This is clearly a good reason given that most users will have 0-1 screens, but it feels like this could probably be addressed by making it dynamic rather than fixed-size – linked list or re-allocated array of pointers or other. I found the constant itself on a GitHub issue where someone was complaining about it being set to 1, so I'm likely not the only one with this use case.
I am just a hobbyist playing with boards I acquired myself. I don't know how to go about getting this information from the Chinese manufacturer whom produced them. Any points would help me to get this moving along.
@wide mantle ya it’s for the static allocation because display objects live after the vm
We could have one be static and the rest dynamic but that’d involve reworking it internally
right, that makes sense. I could see something like displayio.enable_extra_diplays(how many more) being useful.
May I "pull up" my desire to get the MAC-Address of an established connection here again?
Is there somewhere a "make a whish site" for features in CP.
Currently, with the example of Scott I can differentiate between different Apple IOS models, but not devices.
(If a user has for example two iPhones of the same model, maybe one private and one business phone)
Also so far I did not find in any Bluetooth connection to Windows PC a DeviceinfoService.
For me to have a member **MAC-a...
https://github.com/espressif/usb-pids/pull/34 got merged so we can merge this too now :)
When you got the serial number from the DeviceInfoService, was it unique?
I am worried that the address you are going to get from the connection is going to change over time for a particular device. BLE likes to use random generated addresses for security reasons, and iOS is particularly interested in doing that.
@onyx hinge I am getting
../../supervisor/shared/translate.c:90:10: error: "compress_max_length_bits" is not defined, evaluates to 0 [-Werror=undef]
90 | #if (compress_max_length_bits <= 8)
on clean builds at the tip of main. I am confused because the PR should have picked this up.
Apple IOS Phones / Pads do not respond with a serial number.
When the phones are changing their MAC-Addresses, how do the "partners" are finding their pairing information when connecting again.
For my purposes also "unique" pairing information of a connection would be as helpful as the MAC-address.
I just want to "see who did connect to me" during advertising and disconnect from the connections "I am not interested in for the moment".
You mean you get no value for the serial number field, or some unknown (but possibly unique) value?
Pairing uses the IRK stuff, I forget the details. The device wishing to pair sends a key.
I did implement getting the address from a connection in _bleio, though I am having some build troubles for unrelated reasons. I can give you a test build when I get the build working. Which board do you need a build for?
And were you not able to use the address in the initial advertisement to identify the connection?
@onyx hinge the builds were actually failing in the PR builds, but for some reason the failure is being ignored, and the build continues. See for example: https://github.com/adafruit/circuitpython/runs/5207893901?check_suite_focus=true and expand the build step
@tulip sleet yeah I saw it too, a fix is in the merge-1.18 branch. it also helps explain why I did it like I did
that symbol isn't defined yet during qstr generation, so it can't be used in a preprocessor directive.
I think things end up "fine" because it just prevents any qstrs in that file from being generated
we should fix it so the qstr generation error causes the build to fail at that point
that would be smart
are you out at the moment?
want me to look into that? I am a bit between things
done-ish with the 1.18 merge (pending review) and looking for a reason to postpone physically modifying a floppy drive
since 1.18 is in process, I think it would be good to fix now
separate it from the 1.18 PR and apply now
oh I can do that too
i reverted it locally to do an unrelated build
do you think the resulting builds are actually broken?
I don't know - I was about to test one, but it's an english build
okay
I suspect it would be broken independent of language, the diagnostic occured during the en_US build as well
well, I am seeing error messages, etc.
still worth fixing, because it causes a confusing large build error locally
i would say
yes I agree
i mean the strings are working in the en build
oh, wait, I don't know if it works, because I reverted the fix, so my testing does not say
@tulip sleet when you get a chance I managed to get the asyncio documentation to build. Had to change a fix more asynchronous generator errors, so just a heads up. I don't have the hardware on me right now to run tests on the changes, but they're in the PR draft.
I will, sure, thanks!
@onyx hinge ok, I built en_US and fr from the tip of adafruit/main, and the error messages are still showing
@tulip sleet So if the build printed this and stopped (the ellipsis is by me for efficiency of pasting in discord) that'd be good? ```../../supervisor/shared/translate.c:90:10: error: "compress_max_length_bits" is not defined, evaluates to 0 [-Werror=undef]
90 | #if (compress_max_length_bits <= 8)
| ^~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Command '['arm-none-eabi-gcc', '-E', '-DNO_QSTR', ..., '../supervisor/shared/translate.c']' returned non-zero exit status 1.
make: *** [../../py/mkrules.mk:100: build-adafruit_feather_rp2040/genhdr/qstr.split] Error 1
yes, I think so, since in the future there may be more serious errors in the qstr build step and we should have those stop the build
it makes sense, and it seems to have been an oversight in how I was using the multiprocessing facility
executor.map(maybe_preprocess, itertools.repeat(command), itertools.repeat(output_dir), check)
executor.shutdown()
Apparently this DOES wait for all of the works submitted to executor.map to complete but it DOESN'T raise any exceptions that occurred in the work. You have to actually iterate through the return value of executor.map for that to happen.
got it, I thought this was just a make status check missing
I am surprised there is not an optional arg for that
And were you not able to use the address in the initial advertisement to identify the connection?
Never mind, it's your code that's advertising, not the iPhone. etc.
the return of executor.map is a generator, you have to try actually consuming the items in the generator before the exception will get thrown. shutdown must wait for everything but swallow the exceptions intead...?
Dan noticed that builds were printing a scary message like
but continuing, apparently, just fine. This two part PR:
- makes the scary message be followed by an actual error that stops make
- fixes the original problem, which was harmless but wouldn't have been allowed to creep in if not for the first problem
This PR solves most of the TODO stuffs of atmel-samd alarm module. Notable changes are:
- Make light sleep work with TimeAlarm (enable RTC_IRQ)
- PinAlarm sets up pins just before light sleep, and resets them after wakeup. [1]
- Support edge parameter of PinAlarm
- Support all tamper pins in PinAlarm for deep sleep.
- Implement SleepMemory
- Add board_deep_sleep_hook() function to be called just before deep sleep. [2]
[1] It is because PinAlarm does not have deinit.
[2] It is a...
Here are two builds, Feather nRF52840 and ItsyBitsy nRF52840, that implement _bleio.Connection.address. I did not add a corresponding change in the library yet, but you can get to the address by reaching into the Connection object. See the print statement in the test program below, which I used with the Bluefruit Connect app on an iPhone and an iPad
I did not try this with a pairing connection, and I did not try it waiting more than a few minutes between iPhone connections to see if the ...
The ESP32-S3 has a built-in LCD controller, including the ability to drive parallel (8080) and dot-clock driven displays. If CircuitPython can directly drive RGB displays, it may allow the use of lower-cost displays. I'm interested to understand whether using CircuitPython to drive RGB displays is feasible or if there are issues that make it not worthwhile.
I verified the Espressif RGB LCD demo is ...
Hi and thank you for looking into this!
I am using a ItsyBitsy nRF52840.
From this code:
def connectionid(self, c):
try:
if DeviceInfoService in c:
try:
dis = c[DeviceInfoService]
s = ""
try:
s += dis.manufacturer
except:
s += "-man"
try:
s += dis.model_number
...
Thank you! Builds are working.
Using the firmware in the zip provided. (Thank you!)
I am getting this results:
Note: This is not code, this is my debug output!
<Address 4f:15:bd:df:4b:d1>
|Apple Inc.iPad5,3-#|
set self.isconnected = True
-> here I turned **off** bluetooth in IOS settings
playsound ((880, 0.25), 262)
-> the sound iss generated in my code if the connection "goes away"....
!!!!!!!!!!!!!!!!!!! Start advertizing: 101
hid nc. 199.104 29792 29776 -16
-> here I turned **on**...
But I don't want to give up...
There must be a way to find out to whom a connection talks...
Getting the IRK (Identity Resolving Key) might help. That I think will last until you forget the device and repair. I don't see where to get it at the moment, but will look further later.
just an idea: on the hardware-level and depending on the timing of the data ready signal, you might be able to (ab)use it to stretch the clock.
When you waste 5 minutes trying to put an ESP32-S2 board into the bootloader like it's an RP2040.... 🤦🏻♀️
You mean you don't just randomly mash buttons until it is in bootloader mode?
Depends on the board type, I guess.
I rarely remember so a few random tries rarely hurts 🙂
It's more that it never would have worked that way. I could have done it forever. Best I would have gotten is the ROM bootloader, which doesn't even mount anything, so I wouldn't have noticed 😄
Thanks for the idea!
I'm looking at all options...
On Thu, Feb 17, 2022, 11:07 bludin @.***> wrote:
just an idea: on the hardware-level and depending on the timing of the
data ready signal, you might be able to (ab)use it to stretch the clock.—
Reply to this email directly, view it on GitHub
https://github.com/adafruit/circuitpython/issues/6044#issuecomment-1043128740,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEOHKJMQFSNAH6QHR6YPWTDU3UMMBAN...
@slender iron How far did we get with CP on the micro:bit v2? Does it work?
It used to work via BLE
USB won't work due to the board design
it looks like they have a forum here (found by googling for lilygo) https://community.lilygo.cc/
since you're the customer, you can post there to make requests!
@proven garnet Are you around?
An other alternative is poyo, a lightweight YAML Parser for Python. The project status is currently uncertain and it has some serious issues, but it is way more lighter than PyYaml or StrictYaml, so let's give a try. :)
So today I tried to port it to MicroPython, following the instructions [here](https://docs.micropython.org/en...
Yup! Just grabbing food but I'll be back at my desk in like 5
Nice, ping me then. No rush!
@proven garnet Are you planning to try to get your CP build environment up now? Or will that need to wait?
I was gonna do that now
It probably takes about 10 minutes if everything goes properly. There's one part that takes most of that time.
Keen. Let me know if you have any questions!
I did it yesterday again, so I might actually remember answers.
I just finished fetching the submodules
That's the long bit 😄
Sweeeeeet
So, test by building for CPX before we make any changes.
When you're ready.
I think that's the example in the guide
Let me check
I did git status and I'm sitting here for a bit, is that normal?
I definitely meant to do git branch
Sometimes it sits for a bit yeah.
But not ages...
And yeah, the example in the guide is conveniently CPX.
Sounds good, I'll get the python packages now
Excellent
I have a build-circuitpython venv for it.
But don't go learning virtual environments simply for this if you haven't used them before.
Once or twice but not enough to really know them that well haha
@tulip sleet was recently saying it was Russian now.
OK I thought I saw that go by. Thanks.
Save it for another day. 🙂
Are you on MacOS? Or other..?
Windows, using MSYS2
Ah ok
I've had issues with pre-commit on Windows so trying it this way
It's really struggling to get the cryptography library via pip...
I don't have pre-commit going on my CircuitPython build. It did something locally yesterday that it didn't do remotely, so I removed it. Changing so few things that I am not concerned about the stuff pre-commit does
hmm
If I can avoid pre-commit, can I do windows? I don't know why it's struggling, it just keeps cycling though versions and none of them seem to sit well with it
Once I'm actually submitting code, I'll add it.
You're not submitting code
so you don't need pre-commit yet
Pre-commit runs checks when you commit code.
We're going to be building locally only.
New plan, I'm gonna try to use my windows environment, just pulled my repo there to be current
Yeah give it a try.
Traceback (most recent call last):
File "../py/makeversionhdr.py", line 132, in <module>
make_version_header(sys.argv[1])
File "../py/makeversionhdr.py", line 83, in make_version_header
git_tag, git_hash, ver = info
TypeError: cannot unpack non-iterable NoneType object
make: *** [../py/py.mk:253: build/genhdr/mpversion.h] Error 1
make: Leaving directory '/c/Users/adelaney/Documents/Github/circuitpython/mpy-cross'
Oof. @tulip sleet Can you assist?
I'm in the top level folder
That's the right directory, yeah.
Which is the extent of my mpy-cross error troubleshooting. Dan will know better.
Another alternative is, well, Python. The parser is already built-in, it's got data structures with maps, lists, ints, floats, strings, binary strings, ..., and it supports comments.
iT is not getting the version info properly. Are you running this in Windows proper or in WSL?
Proper
give me a few minutes. But we almost never do builds in Windows, it's too hard to get it working properly
For it I can look into getting WSL up and running
do you have a Linux machine or a Linux VM?
If you have questions I do run WSL. Probably forgot most of what I did though 🙂
in the repo, could you run git rev-parse --short HEAD
Windows 10 but it seems I have WSL already installed I must have had it for something else a while ago
if you have WSL1 installed you probably want to get rid of it and install WSL2. WSL1 is quite slow on disk io. The builds take a long time
Ab037bd21
Looks like I've got WSL2 from looking up how to check
Windows 11 does have a few nice feature upgrades to WSL as well. I just updated yesterday. But I ran fine in Win10 with it for a long time too
what's probably happening is that get_version_info_from_git() in py/makeversionhdr.py is returning None for some reason. But I'd want you to put some print statements in there to check it all. If you want to switch to WSL2 it might be easier
Working on the latter option now!
Okay new error, maybe?
make: Entering directory '/home/adelaney/circuitpython/mpy-cross'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
mkdir -p build/genhdr
GEN build/genhdr/moduledefs.h
QSTR updated
make: msgfmt: Command not found
make: *** [../py/py.mk:260: build/genhdr/en_US.mo] Error 127
make: Leaving directory '/home/adelaney/circuitpython/mpy-cross'
When trying to build mpy-cross
What I found when I was setting up WSL was anytime I hit an error like msgfmt: command not found google it and figure out how to install it (usually apt get or pip install)
Got it thanks!
Is any part of this likely to change in the future? ```import time
while True:
print("Hello, World!")
time.sleep(4)```Asking because I have the option to add it as a code snippet into Learn, which means it's not editable except by folks with Learn access, or I can put it on GitHub where it can be updated by anyone. I feel like no part of that will change, but I wanted a second opinion.
I can't imagine it changing
Neither could I. Thanks.
Anyone know how to get what I think is the toolchain arm-none-eabi-gcc?
Oh it's in thr intro I must have missed it thank you!
it is in the Linux part. you follow the initial WSL stuff, and then switch to Ubuntu Linux. I can make that clearer if it s not
@onyx hinge @tulip sleet do we want MP 1.18 in CP 7.2?
at this second I am writing a review sentence saying I want to defer until after 7.2.0
haha, ok
New error, but I'll start a thread to declutter the chat. Is this the best channel?
IThank you for doing this! looked this over and I don't see anything. I want to check for asyncio.py whether we need both __await__() and __iter__(), but that should not affect this merge.
Do we need to change our frozen module specifications to use manifests? I don't see any changes to any mpconfigboard.mk files.
I would rather wait and merge this after 7.2.0, because of the possibility of unforeseen problems.
That's fine with me
@dhalbert this section creates a manifest file from our existing makefile goo
For what it's worth I looked through and didn't notice anything that I think would cause any issues. If I get a moment later I'll try to build it and run it on a couple boards (I'll see if I have one that uses frozen modules to test that).
Would you mind adding _n8 to the end of the board name? I know the dev board only has one module it comes with now but I wouldn't be surprised if espressif made another mini module later and put it on the same board. Adding the n8 would allow us to distinguish it in the future.
Here's the first of many questions:
1. The IDF has some high level constructs for connecting the display. Should these be used, or will I need to burrow down closer to the hardware to make the links to CircuitPython.
I think it depends on how you plug into displayio.
2. Currently, the displayio makes a framebuffer, and the "bus" is just a pipe for shoving data down. In contrast, with the RGB LCD driver, it defines its own display buffer. Do I need a separate displa...
[2] It is an empty function by default. In Wio Terminal, the hook function is used to turn off RTL8720 coprocessor. (RTL8720 is enabled on board reset, and draws considerable amount of power.)
Did you try using board_deinit for this? I think it's meant to be used in the same way.
@idle owl After talking earlier I will not admit how long I just spent clicking buttons on an UnexpectedMaker FeatherS2 to get it into boot mode 🤣
In circuitpython.readthedocs.io, the API documentation for msgpack.pack gives the buffer parameter the type annotation circuitpython_typing.WriteableBuffer. bytearray is listed as one of the types that implements that protocol. However, this code fails:
>>> import msgpack
>>> buf = bytearray(20)
>>> msgpack.pack([2,3], buf)
Traceback (most recent call last):
File "", line 1, in
OSError: stream operation not supported
msgpack.unpack has a similar issue with `buffe...
Tested on both a Feather nRF52840 and an UnexpectedMaker FeatherS2 both with the base build and a custom build where I included a frozen module to ensure it was included and loaded.
Both worked.
Is there a Pin in use message you can use instead? Adding another message takes more space and requires new translations.
Thank you for the PR! I've left a few comments.
@maholli you are using SAMD51 sleep as well right? Mind testing this PR?
I think changing the suffix of the file will make the translation scripts ignore it. (And therefore leave this as-is.)
Please remove anything that is #if 0'd out. The git history has a copy if we need it.
Yes, this is where code to add a descriptor to a characteristic for a GATT server goes. So, it should be fine as-is for GATT client.
Did you try enabling the performance changes? What was the outcome?
@tannewt Sure I'll kick the tires on this PR tonight.
@t-ikegami your comment adding edge support for PinAlarm reminded me of this SAMD5x errata. Did you run into this?
<img src="https://user-images.githubusercontent.com/29153441/154559182-16533ef8-e47f-46fd-a426-d34bdd3edab6.png" width="400">
Another side effect of the default high is that, at least on the MagTag, it cycles the speaker amp, which causes clicking and a quiet hum.
@tulip sleet want me to grab one of the 7.2.0 bugs from you so we can get an rc out and branch it?
Sure. I am just about done with the USB enumeration deep sleep one (#5935). How about 5872?
I am thinking that maybe we should revert the default HIGH (see #5931 above). The MagTag clicking is really distracting.
sure! I'll look after I get back from a run
I don't think we need to revert it because we'll need a "special case this pin for a board" method either way
maybe a board specific reset hook that can override the default
it was changed to fix neopixels on the esp dev boards anyway
maybe I will move 5931 to 7.2.0 then, and maybe you can take that one 🙂
kk, I've got an idea on how to do it
have a good run! It was 59 degrees here today
I've been brainstorming a usb host api too
I'll try and braindump it today
that sounds nice! It's 46 here now...
gonna be a little chilly
😂 Fair!
Oof, it's dumping snow here at the moment. Poured rain yesterday. 🙄
Does the below code have to change? It is referencing CIRCUITPY_OPT_CACH_MAP_LOOKUP_IN_BYTECODE which was removed in 1.18. Maybe it has to change to MICROPY_OPT_MAP_LOOKUP_CACHE (or a CIRCUITPY equivalent). I ran into it when I was trying to enable the latter option. I found reference to the new MICROPY_OPT_LOAD_ATTR_FAST_PATH only.
- Fixes #5935.
Check whether CPy awoke from true deep sleep. If so, don't bother to wait 5 seconds for USB or BLE workflow connected, even if there is already a workflow connection. When asked to sleep again, enter true deep sleep even if USB has been connected in the meantime. A hard reset s needed to get out of a true deep sleep loop.
Big thank you to Dan for the help! @idle owl I got the environment set up, but probably can't test things now. Feel free to leave any helpful tidbits for testing those changes (we can start a thread) and I also see the guide you sent shows how to freeze a module
Sounds good!
In some discord discussion, @tannewt suggested that we needed to be able to special-case certain pins, for reasons such as the above.
Yes!
Or use an external tool to convert yaml to json, load this json on the board, then parse it with the built-in json parser.
Testing a frozen module in CP
Hey folks, it isn't helpful to suggest non-YAML alternatives here. That's missing the point of the issue.
yup
Thanks
Did you try enabling the performance changes? What was the outcome?
No, I didn't want to complicate things or make this PR harder to merge.
The one build failure is due to a transient CI problem, unrelated to the PR.
TIL you can display a bitmap using only displayio. Also TIL you can't scale a bdf font. I mean you can... but it won't look right.
I was going to ping Foamyguy to find out whether the artifacting was a bug in the software, but was informed elsewhere that they're not meant to be scaled, and so weirdness is to be expected. So foamyguy escaped a useless ping.
I think it may be worth spending a little time on the performance stuff to see if it's difficult. I think it's the headline change of 1.18 so MP knowledgeable folks may expect it when we promote that we've merged in 1.18.
CircuitPython version
Adafruit CircuitPython 7.1.1 on 2022-01-14; Adafruit Feather ESP32-S2 TFT with ESP32S2
Code/REPL
import board
import audiobusio
audio = audiobusio.I2SOut(word_select=board.A0, data=board.A1, bit_clock=board.A2)
Behavior
CircuitPython hard crashes to safe mode.
Auto-reload is off.
Running in safe mode! Not running saved code.
You are in safe mode because:
CircuitPython core code crashed hard. Whoops!
Crash int...
I deeply explained in my previous comment that a yaml parser would be very difficult to have in MicroPython/CircuitPython at the current stage of the firmware.
So I think it is helpful to suggest non-YAML alternatives here.
Brightness changes now happen when the LED isn't active or
initialized. When not init, CP may crash.
Fixes #5872
- Fixes #5842.
supervisor.set_rgb_brightness() was not making sure the status LED was inited before changing its color.
Tested on FunHouse.
@slender iron ok, competing PR's; I thought you were going to do the pin one first 🙂
so the status LED is off (mostly) when user code is running? I did an init and deinit
it is when code.py is run
it may be white when in the repl
but not init
I don't think you should call init/deinit because the user may have used the pins/resources already
okee, I'll close my PR
lemme check the API doc to make sure it makes sense now
we are calling init/deinit on our private object
people sometimes set brightness to zero in boot.py
so if the API doc is OK, I'll close mine
it doesn't make a ton of sense now
so I'll update it
don't we have a value range checker now?
found it and updated the shared-bindings for it too
@tidal kiln Examples incoming. Hoping to have the associated guide pages public tomorrow. Depends on review obvs. https://github.com/adafruit/Adafruit_Learning_System_Guides/pull/2014
Guide feedback was basically all "why is there no wifi or TFT examples in the guide" so... I imagine you're getting it too.
@idle owl looks good. nice set of examples.
Thanks! Foamyguy wrote a few of them for me. Super helpful.
I reproduced this issue running CP 7.2.0-alpha.2. No autoreload occurred after editing code.py
The stack from gdb and the variables you mentioned:
#0 0x0000a628 in common_hal_mcu_enable_interrupts ()
#1 0x0001ccf8 in port_idle_until_interrupt ()
#2 0x00015a36 in mp_hal_delay_ms ()
#3 0x000237cc in time_sleep ()
#4 0x000100ee in fun_builtin_1_call ()
#5 0x000140a0 in mp_call_function_n_kw ()
#6 0x000299e6 in mp_call_method_n_kw ()
#7 0x00015070 in mp_execute_bytecode ()...
[GitHub won't let me do a suggestion]
mp_arg_validate_int_range() returns the int, so you can do this all in one go:
set_status_brightness((uint8_t)mp_arg_validate_int_range(mp_obj_get_int(lvl), 0, 255, MP_QSTR_brightness));
can we resolve the QTPY UART pins issue before 7.2.0 ? 2 pins out of 13 are taken until it's fixed.
https://github.com/adafruit/circuitpython/issues/5904
@tulip sleet I'd rather not change that line. Your version has three function calls on a single line. I think the current version is clearer
@jaunty juniper want to make a PR? I think you just need to wrap the #define DEBUG_UART_... in a #if DEBUG test for the board
I don't think we want to blanket disallow debug uart on boards
There is no crash in 7.2.0-alpha.2 and later, so some fix has made this go away.