#circuitpython-dev
1 messages Β· Page 42 of 1
I added #welcome message
And thanks @elpekenin, @andibing, and @wtuemura
No space here, this is how the build knows to strip these stubs out.
https://adafru.it/discord -> #circuitpython-dev is the best place to get help developing CircuitPython. Thanks for taking this on!
Ah, my format-on-save did this. I'll revert these.
Seeed xiao nrf52 which I got has a uf2 bootloader, just not the ada one. That works just fine with latest commit with stock bootloader.
I have no clue actually where the source for that bootloader even is
UF2 Bootloader 0.6.2-12-g459adc9-dirty lib/nrfx (v2.0.0) lib/tinyusb (0.10.1-293-gaf8e5a90) lib/uf2 (remotes/origin/configupdate-9-gadbb8c7)
Model: Seeed XIAO nRF52840
Board-ID: Seeed_XIAO_nRF52840_Sense
Date: Nov 30 2021
SoftDevice: S140 7.3.0
Oh wait, yours is looking the same. I didn't see that.
Thanks for the refactor. Very cool to see these advanced uses of PIO.
I think it may be clearer to split this into two structs. One that's input and one that's output. The code below seems weird that its both setting state and throwing errors based on input state.
what doesn't make sense without more context. what_program makes more sense.
static void consider_instruction(introspect_t *state, uint16_t full_instruction, qstr what_program, size_t i) {
This param is missing from the signature above.
@lone axle After the meeting today, if you have a few minutes, I'd appreciate some assistance with submitting a board to OSHWA. Let me know if you'll be around. Thanks!
Yep, I'll be around and happy to help out.
Excellent, thanks! We can coordinate when it's time.
enough time to make a fresh cup of tea before the meeting. yay/phew
same, β
My tea takes 4 minutes to steep. The kettle takes n minutes to boil. My tea is not quick.
Keurig ftw
π
I use an electric kettle for tea and it's pretty quick (1-2 mins)
@solar whale Nice to see you!
Thanks -- Nice to be here
i use an electric kettle and an instant chai mix
can anyone join to hear? im free today π
yup!
@spare jacinth scroll down and under "voice" find "circuitpython" there
in the channel list
to speak you'll need to be a circuitpythonista (which we can add you to if you want)
yeah, saw it
but didnt know if i "could" join
Everyone is welcome!
π
(she's the host)
micro = u, such as ulab is called microlab. perhaps they started out with using u for micro.
and skerr is no stranger to this discord. hi skerr!
Ohh Skerr has a library for his FPGA feather now. Very nice Skerr!
hooray!
1042 very nice.
(automating the testing of github "composite actions" seems to be extremely tricky if not impossible, so mostly you just hope for the best and merge changes, fixing problems when they crop up...)
Well done Deshipu! Hopefully next hacktoberfest will be a little easier for beginners.
I implemented alphablend, others implemented blit. I did recently fix "blit" not showing up in the docs, however.
ohh there's a synthio panel. awesome.
I think maybe Kmatch originally implemented blit but it was inside of Bitmap class at the time. I recently refactored it to bitmaptools when adding a bit of new functionality pushed some builds over the limit.
8.2.2 is working very well on the boards i've updated so far
Picopad is an open-source DIY gaming console kit for young tech enthusiasts. It utilizes a Raspberry Pi Pico module and features a 2β 240x320 IPS display, speaker, LED, buttons, and a microSD slot. Picopad supports programming in C, MicroPython and CircuitPython, enabling users to learn coding sk...
synthio and gamejam. sounds awesome. can't wait.
There was a recent interview on Alpenglow with a former Leap Frog developer. Could try to get in touch with her.
Ooh, thank you for the tip. I'll check that out.
What is PyCamera hardware? Something AdaFruit is making?
or maybe it was alpenglow... can't remember π£
What is a dot clock display?
@onyx hinge Gah! You can absolutely still opt out. π
Flip dot?
https://www.youtube.com/watch?v=TPR9ktd_PJM Elicia who is also the host of embedded.fm π
@solar whale it's a board LadyAda's working on with an OVxxxx camera and an ESP32-S3. It's called "esp32s3-camera" in the board definition
very cool!
Kattni always so busy π
@thorny jay this type of display https://www.adafruit.com/product/1596
the display controller, which in this case would be an ESP32-S3, has to continually refresh it with data, it's not a smart display like an SPI or I2C display
32-bit bitmaps is a thing? since working with circuit python i've started forgetting anything other than 8-bit indexed exists. π
Hug to Scott for the deep dive on USB host too. It was very informative. π€
They're like 24-bit bmps, but can have an 8-bit alpha channel as well. My code currently just discards that as none of the functions currently make use of alpha.
Not enjoying another "Year Without an AdaBox" :sigh:
year isn't over yet
chip shortage is hard π
and they are moving the adabox assembly internally too
Yeah, let's build something together!
I like that idea, aimed at beginners perhaps, stream it so everyone builds it together?
You can make a learn guide.
Where you have like streamyard with 20 different windows open people building the same project. Seems like a neat idea for circuit python day or hacktoberfest.
Thanks, let's talk about it more on CPDay!
There could be a channel on discord, or meeting in the audio.
Thanks, I'll send in a proposal.
take care & have a good week
Thanks for hosting danh
Thanks for hosting Dan π Have a great week everyone!
Thank you Danh for hosting.
@lone axle I'll take a few minutes to stretch; I've been in meetings since 1ET. π Are you good to chat in, say, 10 minutes?
Yep, sounds good.
No stream today @lone axle ?
not today. I've been doing several smaller seperate things today, and I don't have my back ground screen up so just worked with out stream today.
Slowing down I2C bus to 70 kHz got my ESP32-S3 TFT (REV) working with the HTU31D.
i2c = busio.I2C(board.SCL, board.SDA, frequency=70_000)
https://github.com/adafruit/Adafruit_CircuitPython_HTU31D/issues/12
So we just need to modify the espressif port to check for the argument?
@slender iron FYI, for CircuitPython Day, I'll have you start your Deep Dive at 2:30 Pacific.
kk, I'll let folks know this week
Thanks
There's presumably some logic needed, predicated on server_side=True. But it is odd that the exception is Invalid socket for TLS, which I think indicates the socket isn't SOCK_STREAM, though the library sets it when it creates the socket to listen to.
Hi, looking for some help around best practices (and etiquette) about creating a CPy library. I found a MicroPython library for a chip (RV3028-C7) and I'd like to port it to CircuitPython (and include it in the Community Bundle). I see an guide to create a brand new CPY library (using cookiecutter), but I don't see a guide if I want to fork and then modify a library. I guess I could use Cookiecutter and make a note in the documentation that it's a fork... but it feels like it's better to explicitly make a fork in Github. Any thoughts or suggestions?
I think I should be able to fork the library, then add/modify the files as necessary to include in the community bundle.
The reason to fork is if you anticipate changes upstream you want to track. But there will be a lot of differences in detail between the CPy and the MPy versions. Still, your approach of adding cookie-cutter files later is fine. You can create a skeletal library and then copy over the files to the fork.
Hey, guys and gals. So I'm trying to find a script that I can use. To basically turn a pieco into a game controller That uses 2 thumb sticks, 8 to 12 buttons and a D pad.
I Have never used the circuit python before today and I was wondering if this file. So how does it already exist somewhere? And if someone could point me in the right direction, thank you.
π.π°οΈ
π Hi y'all. I'm working on a HomeKit implementation on a Pico W and was working on adding mDNS TXT record support to CircuitPython (https://github.com/adafruit/circuitpython/pull/8262). There's essentially two implementations of the mdns module, and I'm currently only implementing one of them (raspberrypi) because I have the boards to test with. I don't have an ESP board to test out changes under the espressif implementation.
How do the CircuitPython maintainers prefer to manage a situation like this? I'm happy to write some code that looks right and work with someone who has access to some relevant boards to do testing, but I'm just not equipped myself to do that right now.
A limitation of circuitpython's I2C target functionality is the slow response to I2C requests due to the lack of interrupt handling, garbage collection, etc. This can bog down an I2C host if it has a number of such I2C targets connected.
Thus I would like to propose an additional version of the I2C target functionality strictly based on a read-from- and write-to-registers paradigm (like it is found in many I2C devices). This would require the instantiation of registers object per I2C addr...
This should be a ValueError, because it's an argument that's incorrect, and the validation can be done in shared-bindings, instead of here, so that the validation code can be used across different ports.
You [asked in discord](#circuitpython-dev message):
There's essentially two implementations of the mdns module, and I'm currently only implementing one of them (raspberrypi) because I have the boards to test with. I don't have an ESP board to test out changes under the espressif implementation.
How do the CircuitPython maintainers prefer to manage a situation like this? I'm happy to write some code that looks right and work wit...
replied in PR, to keep the discussion together
Great newsletter this week. Really enjoyed Dan's blog post about the debugging adventure on the SAMD boards.
does any keyboard exist for i2c or featherwing? preferably i2c. its for a project i have been working on
Makes sense. I'll move this up to the shared bindings. It should make the ESP-IDF implementation easier too.
Are there any existing good/preferred patterns for materializing an iterable into an array in C?
It's fine to just have one implementation. Create a stub for the Espressif implementation that raises
NotImplementedError, and add a**Limitations**:note in the documentation inshared-bindingsnoting that it's only implemented on RP2040 Pico W. There are other "Limitations" notes you can crib from for style.
Makes sense! I'll check out some "Limitations" examples.
If you can, take a brief look at the relevant API in the ESP-IDF, even if you are not going to implement to see ...
shared-bindings wifi/Radio.c and i2ctarget/I2CTarget.c run through an iterable in a shared argument. It's been more common to take a Sequence, and then use subscript operations to fetch the values, as in keypad/Keys.c. I think I chose Sequence for these to ensure that I wasn't passed a never-ending iterable.
Add doc for this new arg around line 179.
done, though I made it two parts of a single struct which can be more efficient for argument passing and code generation (though I didn't measure).
@tulip sleet want to pair program/handoff today?
i am still being productive, but I would like to talk about how long-lived is clashing with some stuff, and maybe a modification of how it works that would also fix the import problems like https://github.com/adafruit/circuitpython/issues/2687. That is what I am looking at, at this very moment. Could video with you shortly.
Ya, I think something like this is a good idea. It's a shared scratch memory space. We could allow the use of arrays so that you could determine your "unit size". I'm not sure what it'd be called, but a new module for it would be good.
Ok, want to video in 10?
that'd be good
I'm in Amelia Earhart
How do I get started learning micropython
I posted a questing yesterday I would like to solve
@grim egret micropython's discussions are hosted on github these days https://github.com/orgs/micropython/discussions and they have a Discord for chat which you can find linked in their README https://github.com/micropython/micropython/#getting-started
@grim egret I think #help-with-circuitpython may be the best channel for your question. have you tried it already?
I will look thanks
If someone has time and is willing to, i would love some feedback on my TOML lib, hoping to get it as a replacement for current getenv or at least pack it in the comm bundle π€
(#show-and-tell message)
@slender iron I have removed the long-lived implementation, and am wondering whether to keep https://github.com/adafruit/circuitpython/pull/2614. This is what I was thinking of when I mistakenly said there were qstr pool changes. It was ATB tracking changes. The code in this PR was written after ll, so I tried taking out the ll stuff but not sure about what remains. I'm not sure if this is less of an issue without ll. If I remove it there will be less difference in the core heap algorithms (we still do more checking and have more instrumentation, but that is mostly add-ons).
this might be the closest one, though it's sold out right now. https://www.tindie.com/products/arturo182/bb-q20-keyboard-with-trackpad-usbi2cpmod/
I think you can remove it too. We can also add it back if needed. I think bugs associated with it are why the change was made
This PR updates the alphablend function and adds some useful features. It allows skipping a color mask in either source file as well as updating the blending algorithm to use the same one the SVG alpha compositing spec uses. I only added a couple, but this change allows for adding additional blending methods in the future. The result of changing the algorithm is that it handles blending the darker colors much better than the existing code.
@proven garnet I hope I'm not being a bother, just wanted to see if this may have been buried a couple days ago
Can I also limit the maximum size of the CIRCUITPY drive? It doesn't seem quite as straight forward. And the code comments say it expects at least 2M of flash to work.
My reason is that we put the serial number in the last sector of flash 1M-4096B. We'll lock this sector but I'm afraid the circuitpy drive might not handle this properly.
Made a separate PR for this: #8271
I am using rp2040 qtpy , I want to communicate my microcontroller(circuit python) over usb within my pc (python). When i try it via usb protocol, I get PermissionError(13, 'Access is denied.', None, 5).
I don't know how durable your "serial number in flash" concept will be, but it doesn't mean it's not worth trying. For instance, we advise folks that in extreme circumstances they can run a program that erases all flash content: https://learn.adafruit.com/adafruit-feather-rp2040-pico/circuitpython#flash-resetting-uf2-3091244 (this is nuke.c from pico-examples, I think)
at a guess you'll at least need to revise these two in raspberrypi/supervisor/internal_flash.c
Probably fix by defining...
The RP2040, as you know, doesn't have a unique serial number. However, some or all of the external flash chips do:
https://stackoverflow.com/questions/72594333/arduino-rp2040-pico-unique-id
https://forums.raspberrypi.com/viewtopic.php?t=331910
etc.
So you can use that instead, and other people have done so. And it won't be erased by the nuke UF2. (And you won't need the extra settings above.)
CircuitPython can access the flash UID by microcontroller.cpu.uid: https://docs.circuitpython.org/en/latest/shared-bindings/microcontroller/index.html#microcontroller.Processor.uid
The code we use to fetch it is here:
https://github.com/adafruit/circuitpython/blob/main/ports/raspberrypi/common-hal/microcontroller/Processor.c#L88
huh, I wonder how that works. the way I read this schematic, IO10 is NOT connected TO SD_CS (R34 is "NC") and CS is pulled up. That means nothing can pull CS down and the card will never be selected.
maybe it's permanent 1-bit sdio mode
Looks like it is just a bit too big for the Feather M4 Express with French. Any suggestions to free up room?
The safe mode blink on mine was red instead of yellow and I'm not sure why. I can do yellow on the LED myself through code.py.
Updated. If it's not the right color and you're using the regular one, you may have to try the inverted one. Likewise if you were already using the inverted one.
CircuitPython version
Version: adafruit-circuitpython-challenger_rp2040_lte-en_GB-8.2.2.uf2
Code/REPL
import board
dir(board)
Behavior
Adafruit CircuitPython 8.2.2 on 2023-08-01; Challenger RP2040 LTE with rp2040
import board
dir(board)
['class', 'name', 'A0', 'A1', 'A2', 'A3', 'A4', 'A5', 'D0', 'D1', 'D10', 'D11', 'D12', 'D13', 'D5', 'D6', 'D9', 'GP0', 'GP1', 'GP10', 'GP11', 'GP12', 'GP15', 'GP16', 'GP17', 'GP19', 'GP2', 'GP...
I'd be good with disabling FLOPPYIO, that should save some space.
I'm not sure saying "palette index" is correct, because this code operates on RGB and L (luminance) images, not palette images.
@lone axle Do you use the builtin terminal in PyCharm? If yes, do you run into the situation that you can't scroll up when you're connected to the serial console / REPL? There's a user complaining about this, and I remember running into it as well. Your PyCharm and CircuitPython guide page mentiions using the terminal, but nothing about the scrolling thing. Can you add a note about this? If there's a setting, note that, if it's a limitation, note that, etc. Thanks!
I do use the built-in terminal extensively, but don't recall ever having any issues scrolling within it. I run tio inside of that built-in terminal and am able to scroll upwards through lots of the history of commands and serial outputs from before, I'm not sure of the limit, but I have scrolled pretty far successfully at least back through 4 or 5 cycles of ctrl+c / ctrl+d restarting a program to find some output that was printed by prior versions.
Oooh. Can I send you a link to a forum post, and can you reply and perhaps help them troubleshoot?
I distinctly recall the same problem, so I don't think they're wrong about what they're experiencing.
I can add a warning to the guide page, but I'm not sure what to tell them to try other than an external terminal. I don't think I did anything specifically configuration wise on my end around scrolling but I'll poke around my settings some and see if there is anything I forgot about that looks relavent.
Yeah you can link me I'll take a look later today and try to replicate.
@lone axle Here is the post: https://forums.adafruit.com/viewtopic.php?p=982135#p982135 They were using the MicroPython plugin which was never meant for CP, and perhaps is part of the issue. You can read the thread for context. Thanks!
Because one of the PyCamera modes ("onion skin") is doing this operation in a tight loop, I wanted to check on the performance difference this change makes.
Because the LCD is 240x240 I tested like this (though the actual images are smaller, 240x192 or something)
import time
import displayio
import bitmaptools
b0 = displayio.Bitmap(240, 240, 65535)
b1 = displayio.Bitmap(240, 240, 65535)
b2 = displayio.Bitmap(240, 240, 65535)
t0 = time.monotonic_ns()
for _ in range(50):
...
In terms of actually using the onionskin mode it's fine, it doesn't feel "enough slower" to matter to me, on a gut check level.
Ah, good point. I'll word it better.
Sweet. Yeah, I knew it would be a bit slower and the reason I added a Screen mode was because that was the equivalent to what it was doing before and does have it's uses. Thanks for testing the speed.
On this pin diagram, SDI is IO24 / GP24. IO20/ GP20 isn't exposed. Are you looking at something different?
https://ilabs.se/challenger-rp2040-lte-datasheet/
Here is the circuit from iLabs for the Challenger RP2040 LTE:
https://gitlab.com/invectorlabs/hw/challenger-rp2040-lte/-/blob/main/V0.2/challenger-rp2040-lte.pdf?ref_type=heads
On the circuit, the connection labelled SDI on header JP2 goes to the RP2040 pin shown as GPIO20.
I see that this pin ihas no assignment in the microcontroller.pin mapping table.
microcontroller.pin.GPIO20 has no assignment
I suspect there may be other errors in the pinout diagram shown in https://ilabs.se/challenger-rp2040-lte-datasheet/
I tried raising this matter with Pontus Odberg of ILabs, but he hasn't yet replied to an email I sent him with a detailed explanation of why I think the labelling of one of the other pins is wrong. I haven't had time to check through the details of every single pin, but I suppose that various issues will be apparent if you consult the circuit diagram for all the pins on JP1 a...
We do this for the Teensy 4.x as well. I think we use a linker script setting there. On RP2040 we'll likely want a compile time option because RP2040 CP detects flash size automatically.
If you need a tester, I'm very interested in a Framework laptop. :-)
Ah, I see. I hadn't found the schematic. On the schematic, pins 18 and 24 are unconnected.
You can use microcontroller.pin.GPIO20 in CircuitPython in code a in place of board.*, to confirm that the schematic is correct and the pin diagram is wrong.
The scheamtic is indeed wrong.
>>> led = digitalio.DigitalInOut(microcontroller.pin.GPIO20)
>>> led.direction = digitalio.Direction.OUTPUT
>>>
>>> led.value = True
>>> led.value = False
>>>
>>> led = digitalio.DigitalInOut(microcontroller.pin.GPIO24)
>>> led.direction = digitalio.Direction.OUTPUT
>>>
>>> led.value = True
>>> led.value = False
The second set of code, using pin 24, toggles an external LED connected to the SDI pin.
Ok, looks like disabling floppyio worked.
Looks good! Thanks for the updates!
when someone has a moment, this is waiting review: https://github.com/adafruit/Adafruit_CircuitPython_USB_Host_Mass_Storage/pull/1 thanks!
Thanks for the tips. I had assumed that the circuit schematic was the gold-standard for what was actually connected to what. Since the schematic showed the JP1 SDI pin connected to RP2040 GPIO20 and GP20 was not in the list of board.* assignments you gave, I figured that was why my simple test program couldn't get that pin to work as an input using board.*. I will have a crack at what you suggest tomorrow. Clearly something is amiss in either the schematic, the Challenger LTE pinout dia...
May I ask: "Why french?"
i guess that's the lang with most non-ascii chars (accented vowels) in their translated texts, which take more space (2/3 bytes?) than a "basic" char (1 byte)
Non ascii? Do you mean "non ascii 7 bit"?
French is not the language you are looking for, I think every character fit in a byte.
But in French you have longer sentences and you need more words to say the same thing than in English. π
ASCII does for sure not support accents
IIRC from my little experiments with UTF8 in C, in order to have an accent you would need at least 2 bytes, where the first one would have the most-significant-bit set to 1 (to tell it apart from ASCII, as it indeed only uses 7 bits)
And sure, they probably use longer sentences too
Oh wait, there's "extended ASCII" using the 8th bit, is that actually used anywhere? lol
(also, aren't there several non-standarized extensions of ASCII using that 8thE)
CircuitPython uses UTF-8 as the internal coding for str objects. translated messages undergo a complicated encoding, dictionary & huffman compression system at build time. There's also the inclusion of characters in the terminal font for the language, if that's enabled. Over time the translation that uses the most flash space has varied, and it can even vary from board to board.
I was hoping for answer like "Melissa learn French." or "All the Adafruit paid developer use CP in a different language assigned to them as a way to detect problem early, Melissa was lucky to get French." π
- Remember the fan out! Many panels do not manage the clock line. (These use serial wiring on the clocks. Lowering clock speed will improve this. Use scope to verify performance.)
- Many panels do not use termination as it is likely not required unless the cable is long.
- Many panels do not manage the upper and lower capacitance, which can create ghosting if the refresh is too high. (Some have MBI5124 which manages the lower. I do not know if they have the RUC7258 which manages upper.)
*...
Personally I would use 100-400kHz power supply module. (These can be found on Digikey.) Carefully what them with a scope if you get bored. (Use resistive dummy load.)
Personally I would use 100-400kHz power supply module. (These can be found on Digikey.) Carefully watch them with a scope if you get bored. (Use resistive dummy load.)
Having updated my test program as you suggested, I can now confirm that the pin labelled SDI on the Challener RP2040 LTE is indeed microcontroller.pin.GPIO20. I suppose this proves that the schematic is correct and that the pinout diagram has at least one error.
According to the schematic RP2040 GPIO24 is unconnected. I presume then that the mapping should be something like
microcontroller.pin.GPIO20 board.SDI board.GP20
I discussed this with @PaintYourDragon, and the problems mentioned in the forum post were not reproducible, so let's merge this.
Do you have a Mk I or a Mk II board? I have a Mk I.
Is there any way to get this implemented?
It's a longshot but does anyone know why we settled on this style instead of ifeq (...,1)? ```make
ifneq ($(CIRCUITPY_USB),0)
SRC_C += lib/tinyusb/src/portable/espressif/esp32sx/dcd_esp32sx.c
endif
We purchased ours form Pi Hut in January this year. I can see from the order confirmation email that the order was for the MK II version.
However, I have looked very closely at the PCB under our workshop pcb microscope, and I can't see anything on the PCB silk-screen which specifically indentifies it as being a Mk II.
That could account for it, we probably need iLabs to clarify. Assuming the versions are different, that will complicate what to do about the board definition.
guessing - because CIRCUITPY_USB could have multiple non-zero values for various meanings, but all would require that source file
Reply on iLabs Discord indicates there was a change between board revisions
#902533648874618880 message
That link doesn't appear to work if you're not already a member of the discord. If there's any additional useful content in the message can you add it here by copypaste?
iLabs Electronics β Today at 10:44 AM
I saw I was tagged on github for this issue. I'm on vacation right now but will look into it on monday.
But as a quick response to this, yes we did make a revision to the board with regards to io24 and io20. The first version was incorrect making it difficult to use SPI (io24 can't be used as SDI).
I'm still very much of a beginner with CircuitPython, so your handy tip about how to use microcontroller.pin.GPIOx instead of board.* was a big help.
Since you are clearly some rungs higher up than me on the Challenger LTE, CircuitPython and github ladders, I am wondering whether you might like to discuss a project I'm working on that uses Challenger LTE to run a Blynk client. I presume that this isn't the place to have such a discussion. If you are interested, my email is psturgeon@ag...
One further suggestion.
I think you'll want it as input with a pull down. (It is pull up by default.) As-is, you are switching to output without setting whether it is high or low. That'll be unpredictable.
Adafruit Discord is a great place to discuss projects like that: https://adafru.it/discord
It's a community of mostly hobbyists and volunteers, very helpful on a variety of topics.
Even though the nRF## is a suitable workaround, it exhausts pins from the board and undermines the boards built-in capabilities. I hope someone can pick this up! β¨
I'm not sure there was a good reason, like cater says, maybe there were a few values that were not just 0 or 1. I think maybe there are some SIZE values that are 0 (disabled) or non-zero (enabled).
@fract0id - would love to see what you've changed already. Even getting the 3m would be awesome. I am about to go down the road of seeing how things are different, but it's crazy how different the C library is for this one from all the others.
I need to mute this issue for myself
@slender iron merge progress report: long-lived is removed. Trinket M0 and Metro M4 were building fine (not tested). Tried CPX build and it failed. Turns out it is some missing dependencies related to genhdr files in the makefiles: make -j1 and make -j12 give different results on various boards (!), so the success/failure is timing-dependent. Debugging this now.
Mpy introduced some new semi-fake targets for the qstr phase, and this may have soemthing to do with that.
sounds good @tulip sleet let me know if you need me to talk something over or pick something up
I'm having trouble getting my submodules back: ```
BUG: config.c:129: kvi should not be set while parsing a config source
error: path='ports/espressif/esp-idf'; git fetch --tags --depth 1 died of signal 6
fatal: run_command returned non-zero status for ports/espressif/esp-idf
deleted it and it worked the second time
@devout jolt do you have synthio code that takes in midi from a usb keyboard?
I'm practially memorizing that page for next week, heh
π time to get it working where you plug the midi keyboard into cp directly
I have tonnes yes what Paul linked is one
Q - what all triggers the CP firmware to create the boiler plate code.py with print("hello world") ?
that fat fs looks familiar...
but for any "real" synthio work, you'll be creating synthio.Note objects and need to keep track of them.
https://github.com/christinaa/rpi-open-firmware/blob/master/arm_chainloader/drivers/fatfs/ff.h
looks nearly identical to this one
FAT file structs are pretty consistent across the universe I guess
neat! it's always cool seeing a bit of code that's been maintained for decades
and it looks like CP is using the MP fork of the lib
thanks
probably should've asked it more to the point of this weird issue:
https://forums.adafruit.com/viewtopic.php?p=982295
anyone seen behavior where the code.py keeps getting regenerated after being deleted?
I've had that happen on other boards where something corrupts the FAT filesystem. I think I've seen this both by the host OS (say, from not ejecting safely) and from some circuitpython bug that crashed the whole board and nuked the whole flash
and code.py showed up without any other user interaction?
like doing storage.erase_filesystem() ?
yeah I think somehow it's doing that
There are no immediate plans to implement this. If someone feels like working on a PR, that would be great.
How can we use Bluetooth with pi pico w using circuit python?
Where in the source code is the connection between the python commands and the c++ functions?
the python bindings are in shared-bindings (and ports/*/bindings for port-specific modules)
Thanks again. I imagine there are quite a few hobbyists who know an awful lot more than me about the relevant issues. I'll be along to discord in a wee while.
Bluetooth doesn't work in CircuitPython on the Pico W and there is not an ETA at this time. You can follow the feature request here https://github.com/adafruit/circuitpython/issues/7693
@devout jolt I haven't tried combining synthio & displayio yet, but from my experience with mp3 decoding & displayio the best thing I found to do was:
- disable auto_refresh, and only use manual refresh
- ensure that only small portions of the screen were updated at a time
Background tasks can't interrupt other background tasks, so a background screen update blocks audio calculations.
On the other hand, it appears that for both rp2040 and atmel-samd (but possibly not for mimxrt10xx) lengthy (DMA) SPI transactions DO allow background tasks, so I think with the above suggestion it is possible for the audio background task to run during an explicit foreground displayio refresh.
using the audiomixer as a way to get a bigger buffer is a good trick, I like it. I'm surprised you need to use it to control overall volume level though. Right now in synthio the LFO & envelope update rate and the buffer size are tied together but it might make sense to un-tie them so that a bigger audio buffer can be used without introducing a separate mixer.
Thanks @jepler @wtuemura @bergdahl!
@jepler I think we could do some refactoring on some of these and use %q to share parameterize the strings, e.g. the first_in_pin and first_out_pin could be factored out of the messages and referenced by qstrs.
Closed in favor of #8258.
We could backport this to 8.2.x if it gets figured out soon.
@slender iron merge progress: fixed some things with qstr and translation processing in makeqstr*.py and makefiles. Took a deep breath and loaded a build on Trinket M0. It's working, but the wrong translated messages are showing up. qstr names are fine. gc seems to be working
CircuitPython version
Adafruit CircuitPython 8.2.2 on 2023-07-31; S2Mini with ESP32S2-S2FN4R2
Board ID:lolin_s2_mini
UID:84722ED59B67
Code/REPL
import time
while True:
print("Hello World!")
time.sleep(0.5)
Behavior
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
main.py output:
Hello World!
Hello World!
Hello World!
Hello World!
Description
I am trying to use the web workflow as explai...
that's amazing progress, yay!
TIL that the online compiler explorer can build for xtensa mcus. I was curious which implementation of "reset pins according to a bitmask" would be the smallest, though they're all pretty small compared to esp32-s3 flash size π and you can find out right in your browser. https://godbolt.org/z/c5nG36r13
void reset_pin_number(int pin_number);
void reset_pin_mask(uint64_t mask) {
while (mask) {
int pin_number = __builtin_ffsll(mask);
reset_pin_number(pin_number);
mask &= ~(1 << pin_number);
}
}
void reset_pin_mask2(uint64_t mask) {
for (int i = 0; i < 64; i++) {
if (mask & 1ull << i)
reset_pin_number(i);
}
}
void r...
which was a total distraction from what I need to do, which is get the code running. not size-optimize it. π
Awesome! Let me know if you need π on any issues.
Automated website update for release 8.2.3 by Blinka.
Only when in use. This function sets its state when not in use.
Are you able to get the CircuitPython serial output on the display? It'll show wifi status in the top bar. It looks like the serial terminal in vscode doesn't show it.
@tulip sleet you ok if I pick up the idf update?
fer sure
i fixed the mixed-up messages, now looking at build failures when modules are frozen
I don't think there is overlap between ESP-IDF update and the merge
This release is only to fix RGBMatrix timing issues with certain panels on SAMD51 (e.g. MatrixPortal M4). No need to update otherwise. https://blog.adafruit.com/2023/08/11/circuitpython-8-2-3-released/
I would love it if displayio refreshes would happen in the background on RP2040 but in my experience that's not the case. Most of my time spent in CircuitPython projects seems to be figuring out strategies to minimize displayio bus traffic to minimize glitches or timing skew π (Not that this is unique to CircuitPython. In Arduino, especially if using a seesaw board, one has timing issues too, which is why I generally put all the UI on core1 and audio/midi on core0.
As far as audiomixer, I recommend it universally. It's one of the fastest ways to reduce audio glitches (for both audiocore.WaveFile or synthio.Synthesizer playing) when doing anything else: especially displayio & i2c/seesaw. For anything beyond buffer_size=4096, the latency is too great (at ~22kHz sample rate) to be usable musically. Even 4096 isn't good enough for drum stuff, but not too bad. The fact AudioMixer has global level controls is also very nice when balancing, say, WAV-based drums and synthio-based synths.
CircuitPython version
Adafruit CircuitPython 8.2.0 on 2023-07-05; PCA10059 nRF52840 Dongle with nRF52840
Code/REPL
import os, gc
import time
import board
import busio
import _bleio
import pwmio
import storage
import analogio
import microcontroller
from adafruit_ble import BLERadio
from digitalio import DigitalInOut, Direction
from adafruit_mcp230xx.mcp23017 import MCP23017
from adafruit_ble.services.nordic import UARTService
from adafruit_ble.a...
Is anyone on the team running a macOS Sonoma beta build with their boards? Seeing some weird behaviour with a CP board since I updated and am wondering if it could be why.
Weird behavior as in having slow response on code.py file save. Walked with him through the issue in circuit python help. Needs investigation and possible bug report.
It's that if I edit code.py and hit save, it autoreloads but then (in almost all cases) gives me ```code.py output:
Code done running.``` or
OSError: [Errno 5] Input/output error
Code done running.```
If I leave it long enough (10-15 seconds) it'll often reload itself again and then work, but forcibly trying to reload via Ctrl+D doesn't work. Autoreloads due to non-code file changes work fine. I'd post my lengthy code and original device info, but testing showed that the same thing occurs with just `print("hello there")`.
CP 8.2.3 on a ESP32S2 TFT, tried a full wipe/reload with the web-based ESPtool as well, tried with VSCode and Sublime text, viewing serial output via tio.
blank code.py with print("hello there") not showing the print and instead only showing code done running. seems like a bug to me.
CircuitPython version
Adafruit CircuitPython 8.2.3 on 2023-08-11; Adafruit Feather ESP32-S3 TFT with ESP32S3
Code/REPL
import board
a = board.SPI()
a.deinit()
Behavior
[16:33:14.473] Disconnected
[16:33:15.474] Warning: Could not open tty device (No such file or directory)
[16:33:15.474] Waiting for tty device..
[16:33:17.477] Connected
Auto-reload is off.
Running in safe mode! Not running saved code.
Description
No response
###...
I am using native modules for ML algorithms in https://github.com/emlearn/emlearn-micropython
Glad to see that this is being thought of for CircuitPython, as I would like to bring these modules there as well.
Regarding naming convention, I have for now resorted to producing folders with the ARCH name and MPYABI (6.1 for MicroPython 1.20+). This means that the filename is standard and can be imported normally.
I also use CI to produce the .mpy files across the architectures. It's not the...
I tested again on new boards, both with ESP32-S2 and ESP32-S3, with the latest CP 8.2.3. It works well as expected on both boards. Sorry, I now think I did some mistake, maybe a wrong password to my wifi router.
All credit to @lynt-smitka for adding the support for PicoPad to main, but the release of 9.0 might be very far, and waiting for that it is confusing end-user to get the right firmware, having to pick one in the S3. The board is targetted at education, so making this as smooth as possible is important.
PicoPad support was not picked up in the recent 8.2.3 release.
This is an attempt at cherry-picking the thing (my first backporting, so I hope this preserve the credit) and could be include...
I took an UF2 from the artifacts, it boot and run complex piece of code provided by @lynt-smitka that use the wifi network, ntp and display internal temperature on the screen.
So it "Works for Me."
This looks like it has an extremely low chance of causing any problems, and as you point out it'll be beneficial for those with the boards.
well you def shouldnt be able to de'init it since its still being used by the TFT :) but should not hardcrash either
Perhaps it would be best to have a check inside of the SPI type that prohibits it from being deinitialised. Having that exposed only to the C api could allow circuitpy to alloc it for "system usage" and prohibit it's deinit. Shall I go and give it a try?
gooooood question - im going to let @tannewt or @jepler decide who/where it should be fixed :)
Yes, it would be great to have proper download options for PicoPad users. π
I'm putting up a beginner's tutorials on how to get started with CircuitPython and PicoPad, and it will come in handy.
@tannewt you added the 9.0.0 milestone, is there anything specific planned for this?
I'm having a similar issue and eager to validate any fix.
@lynt-smitka if you could give a try to the artefact and confirm it also works for you, it will be easier for reviewers without the hardware to accept this PR.
PS: I believe Adafruit will want to make an 8.2.4 release soon that makes the new Metro ESP32S3 more accessible. Both PicoPad and that metro are the only recent board I could find without an easy download. I don't see the backport, but I have identified the four PR needed, I even feel like proposing one myself, but I don't have the ha...
This is a totally untested backport of metro esp32s3 from main to 8.2.x by applying the 4 PR (that touch the file for that board) from @makermelissa in the same order as they were originally applied.
I don't have the hardware to test, but since I did work on the backport for the PicoPad, I felt I could try again to apply my new cherry-picking skill.
PS: Here is what I did in my branch before submitting this PR...
git checkout -b 8.2.x-backport-metro-esp32s3
git ch...
It seems to be missing a new google doc and new pinned message for the meeting of the 14th August 2023.
Merging MicroPython v1.19.1
Just before this PR was pushed, my manuals tests showed that the silabs port fails when compiling, and some tests fail when make test is done in port/unix. The other ports are compiling. I did some smoke tests on a CPX: a program that played Jingle Bells and made NeoPixel animations happened to be on that CPX, so that tested a bunch of things including frozen modules and generators. Also I did some simple gc testing by creating large bytearrays.
More...
:tada:
I'll look at it in more detail later but I'm excited.
Here is the notes document for Mondayβs CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if youβll be attending the meeting - itβs super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and weβll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/16vLRTp2Bu2ILsgFtmQZ764mjPu3NpBfqv24BjlpqNjs/edit?usp=sharing
Tried and everyhting works fine π
@tulip sleet morning! https://gist.github.com/jepler/be27e86936b7659f6dbcb9b15094b6c5 I got the unix port back to building but there are many test failures. I didn't delve into any of them yet.
Thanks - I don't understand why at least most of these changes should be needed, given that, say, the ringbuf changes were already present in adafruit/circuitpython main. Were you seeing regressions
make test worked for me locally, except that tests failed
@tulip sleet a 'variant' is used during CI ``` - name: Build unix port
run: make -C ports/unix VARIANT=coverage -j2
maybe the unix port was already broken before that -- we just didn't try to build it?
The ringbuf updates I made are from months ago
CI always builds and tests unix VARIANT=coverage
The additions you made for the math constants around line 83 are also at line 146 already. ? confused
in obj.h
I'll re-check that. There are similar blocks in that file that pertain to each object representation A through D.
I think that is an upstream bug, then, or maybe the merge put them in the wrong place (sounds like they could be factored out across representations)?
as for the failing silabs build, this appears to be enough to let the build ALMOST complete but then I get a weird linker error: ```diff --git a/ports/silabs/Makefile b/ports/silabs/Makefile
index 8fd43067f1..71092afcbf 100644
--- a/ports/silabs/Makefile
+++ b/ports/silabs/Makefile
@@ -138,7 +138,7 @@ $(OUTPUT_DIR)/firmware.bin: $(SILABS_BUILD)/$(PROJECTNAME).Makefile $(OUTPUT_DIR
@echo 'Done.'
endif
-$(SILABS_BUILD)/$(PROJECTNAME).Makefile:
+$(SILABS_BUILD)/$(PROJECTNAME).Makefile: | $(HEADER_BUILD)/mpversion.h
+@$(MAKE) --no-print-directory slc-generate
$(OUTPUT_DIR)/firmware.out: $(SILABS_BUILD)/pin_functions.h $(SILABS_BUILD)/pins.c $(OBJ) $(OBJS) $(LIB_FILES)
arm-none-eabi-gcc -mcpu=cortex-m33 -mthumb -mfpu=fpv5-sp-d16 -mfloat-abi=hard -T"build-devkit_xg24_brd2601b/autogen/linkerfile.ld" --specs=nano.specs -Xlinker -Map=build-devkit_xg24_brd2601b/circuitpython_efr32.map -Wl,--gc-sections @build-devkit_xg24_brd2601b/linker_objs -Wl,--start-group -lgcc -lc -lm -lnosys /home/jepler/src/circuitpython/ports/silabs/gecko_sdk/protocol/bluetooth/lib/EFR32MG24/GCC/libbluetooth.a /home/jepler/src/circuitpython/ports/silabs/gecko_sdk/platform/emdrv/nvm3/lib/libnvm3_CM33_gcc.a /home/jepler/src/circuitpython/ports/silabs/gecko_sdk/platform/radio/rail_lib/autogen/librail_release/librail_efr32xg24_gcc_release.a -Wl,--end-group -o build-devkit_xg24_brd2601b/firmware.out
/home/jepler/.local/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld:/home/jepler/src/circuitpython/ports/silabs/gecko_sdk/protocol/bluetooth/lib/EFR32MG24/GCC/libbluetooth.a: file format not recognized; treating as linker script
/home/jepler/.local/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld:/home/jepler/src/circuitpython/ports/silabs/gecko_sdk/protocol/bluetooth/lib/EFR32MG24/GCC/libbluetooth.a:1: syntax error
try the silabs build with -j1. I think it will fail earlier
oh the content in libbluetooth.a is wrong, because I have not done anything to make git-lfs work. ```version https://git-lfs.github.com/spec/v1
oid sha256:0fbcb4da6bc0118f5e61747fc870f6bc66a98a395ae9e14408ebd3a0e5142c4e
size 2706166
the original error was mpversion.h not existing when building some file within the generated Makefile, and the patch fixes that
I'll go have breakfast and a walk and we can talk later. I'll re-check whether there's a duplicated block in obj.h that should be deleted/moved instead of my addition.
@tulip sleet the lines at 146 (152 after my edits) are for MICROPY_OBJ_REPR == MICROPY_OBJ_REPR_B and both copies should be there afaict.
and with git-lfs installed my change to silabs is enough to let my build succeed locally. with -j12; re-checking with -j1 after I go actually have breakfast
hmm, yes, thanks, that should have been upstream
what version are you building for ports/unix locally? (I.e. what is the command line you are using to build?)
run: make -C ports/unix VARIANT=coverage -j2
is that the coverage build for tests? that is building locally (make test).
I am manually putting in these changes and will repush
does the mp_type_stest_fileio extended fields need the extended fields flag also, I would think?
.flags = MP_TYPE_FLAG_EXTENDED,
ok, ports/unix/coverage.c was a bad merge in several respects; fixing that up. May have been an auto-merge
I had already fixed the ringbuf stuff months ago, but it got undone
not at all
Keen, thanks
@onyx hinge pushed new changes; float consts incorporated and the traceback fix. Other fixes done in a somewhat different way by redoing some merges
@tulip sleet great.
did you try the change for the silabs build? ```diff
diff --git a/ports/silabs/Makefile b/ports/silabs/Makefile
index 8fd43067f1..71092afcbf 100644
--- a/ports/silabs/Makefile
+++ b/ports/silabs/Makefile
@@ -138,7 +138,7 @@ $(OUTPUT_DIR)/firmware.bin: $(SILABS_BUILD)/$(PROJECTNAME).Makefile $(OUTPUT_DIR
@echo 'Done.'
endif
-$(SILABS_BUILD)/$(PROJECTNAME).Makefile:
+$(SILABS_BUILD)/$(PROJECTNAME).Makefile: | $(HEADER_BUILD)/mpversion.h
+@$(MAKE) --no-print-directory slc-generate
$(OUTPUT_DIR)/firmware.out: $(SILABS_BUILD)/pin_functions.h $(SILABS_BUILD)/pins.c $(OBJ) $(OBJS) $(LIB_FILES)
I have some code that I evidently wrote in 2019, and I'm not sure how it ever worked. And it's certainly not working now.
@idle owl that's not uncommon π
I can't understand what how it was supposed to work to begin with. So I'm not certain how to fix it.
It's to make a rainbow on a 3W RGB LED, not addressable, but using pwmio on the red, green, and blue signals.
import pwmio
import board
from rainbowio import colorwheel
import digitalio
enable = digitalio.DigitalInOut(board.D10)
enable.direction = digitalio.Direction.OUTPUT
enable.value = True
red = pwmio.PWMOut(board.D11, duty_cycle=0, frequency=20000)
green = pwmio.PWMOut(board.D12, duty_cycle=0, frequency=20000)
blue = pwmio.PWMOut(board.D13, duty_cycle=0, frequency=20000)
while True:
for i in range(255):
r, g, b = colorwheel(i)
red.duty_cycle = int(r * 65536 / 256)
green.duty_cycle = int(g * 65536 / 256)
blue.duty_cycle = int(b * 65536 / 256)```
not yet, I was just working on adapting your gist. Will be afk again for 15 minutes or so.
for i in range(255):
r, g, b = colorwheel(i)```
What the heck?
That's where it's failing, int not iterable.
But I don't get how that was ever supposed to work.
@idle owl I bet before the rainbowio version it returned a color tuple
like there used to be def colorwheel: ... return red_calculation, green_calculation, blue_calculation
for the purposes of this demo you could either (A) find the old one that returns a tuple, paste it in, and explain WHY it's used here (so that the color is split out into red, green and blue) or (B) do some bit arithmetic to get R, G, and B values out of the 24-bit color number
Oh.
That oh was to me realising how this works.
Yeah, I would think this should be math.
Not colorwheel.
That said.... while I am kind of grasping how it should work, I have no idea how to make it do the thing.
bringing in the newest commit(s) from adabot repo.
Oh fair enough.
you can go find this person and berate her for not testing π
Blame @autumn kiln .
yeah must have been
My gut tells me to just undo that change to that file and add a comment explaining that rainbowio's function isn't used because hte separate r, g, b values are needed
because otherwise you'll have g = (color_number >> 8) & 0xff and nobody wants to explain that
nobody wants to learn what that is
So I swapped it to the wheel function. And it runs, but it's a strobe enough to trigger a seizure. It needed a time.sleep(). So, yet again, I have no idea how it worked to begin with.
Maybe the microcontroller was so slow that it didn't matter
ok yikes!
Ok, thank you. I'll swap it back in and update the guide page.
Just tried that but I am still getting:
./../py/mpconfig.h:31:10: fatal error: genhdr/mpversion.h: No such file or directory
with -j12
can you paste the full error for me?
feel free to DM if long
or we could start a thread about this
... [compiling /home/halbert/repos/circuitpython/ports/silabs/gecko_sdk/hardware/board/src/sl_board_control_gpio.c]
In file included from ../../supervisor/shared/safe_mode.h:30,
from ../../supervisor/board.h:32,
from /home/halbert/repos/circuitpython/ports/silabs/gecko_sdk/../boards/devkit_xg24_brd2601b/board.c:27:
../../py/mpconfig.h:31:10: fatal error: genhdr/mpversion.h: No such file or directory
31 | #include "genhdr/mpversion.h"
| ^~~~~~~~~~~~~~~~~~~~
I also tried to get the silabs build not to print out the command lines so much -- it's a bit painful
mpversion.h is wanted when compiling some early stuff from the sdk
did you try that same board?
the line I'm actually interested in is still not one you showed me. The line I am interested in will look similar to make[1]: *** [build-devkit_xg24_brd2601b/circuitpython_efr32.project.mak:202: build-devkit_xg24_brd2601b/sdk/_/boards/devkit_xg24_brd2601b/board.o] Error 1
it shows the actual name of the failing target
make[1]: *** [build-devkit_xg24_brd2601b/circuitpython_efr32.project.mak:202: build-devkit_xg24_brd2601b/sdk/_/boards/devkit_xg24_brd2601b/board.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:137: build-devkit_xg24_brd2601b/firmware.bin] Error 2
can you try again after a make clean if you didn't already?
i did
Iif I do -j1 I see the "No such file or directory" many more times. I cleaned before each build trial
what that change is SUPPOSED to do is force mpversion.h to be generated before Makefile is generated by slc-generate, and that particular target can only be built after that Makefile exists. Clearly that's not what it's accomplishing for you
does it work for you with -j1?
i think our build environments are very close
this is what i meant by "non-deterministic" in the OP in the PR π
I'm on debian stable with gnu make 4.3.
also gnu make 4.3
-j1 should remove the non-determinism
i had cases a few days ago where -j12 worked and -j1 failed, so I used that as a test. I originally started using -j1 to get more reliable V=rules logging
here's something I've found is pretty effective: once you've FOUND the failing target, deterministic or not, make -j1 clean; make -j1 target is pretty effective at reproducing the problem
because it won't be doing the other dependencies of firmware.elf in possibly other orders / parallel combinations
yes, it's reproducible, but with your changes to the silabs Makefile, I am still getting the same error with -j1 and you are not, which is confusing
I do not understand slc-build but it seems like there was a need to specify some source file. They picked one that depends on a generated header (which most do); so using an empty dummy source file instead is a different possible solution. https://gist.github.com/jepler/fc8fe360e9934df44f3a8d2d0b930669
wait, typo I need to fix...
@onyx hinge hmm
--- a/ports/silabs/Makefile
+++ b/ports/silabs/Makefile
@@ -138,7 +138,7 @@ $(OUTPUT_DIR)/firmware.bin: $(SILABS_BUILD)/$(PROJECTNAME).Makefile $(OUTPUT_DIR
@echo 'Done.'
endif
-$(SILABS_BUILD)/$(PROJECTNAME).Makefile:
+$(SILABS_BUILD)/$(PROJECTNAME).Makefile: | $(HEADER_BUILD)/mpversion.h:
+@$(MAKE) --no-print-directory slc-generate
but now I get
$ make BOARD=devkit_xg24_brd2601b clean
- Verbosity options: any combination of "steps commands rules", as `make V=...` or env var BUILD_VERBOSE
Makefile:141: *** multiple target patterns. Stop.
ugh, thanks, I had the whle mpversion thing before the first colon, which was just ... wrong
I would like to bundle up all these non qstr/translation related genhdr things together into a dependency. Right now each one seems to be its own special case. But that can be left for later, and it diverges from upstream.
build is fine now! I will push that.
OK cool. curse Makefile punctuation!
do you want me to look at the mpy-cross windows failure?
fer sure, I did not work on that at all
I had a weird pre-commit experience last night. I am using the same uncrustify version as the CI. I did pre-commit run --all-files. It prettified a bunch of C source files, but it missed a bunch. It added a lot of spaces after commas (that's fine), but for some reason in the CI run, that run found a bunch of additional fixes in nearby files. E.g. mine did pins.c in a board dir, and the CI also found things in board.c. I downloaded and applied the patch that the CI pre-commit generated, and all was well. But I did not understand why the CI found more when my seemingly identical local command did not. I even copied the CI pre-commit command exactly
diff --git a/extmod/moduasyncio.c b/extmod/moduasyncio.c
index 014de0db27..27d25ac31b 100644
--- a/extmod/moduasyncio.c
+++ b/extmod/moduasyncio.c
@@ -29,13 +29,13 @@
#include "py/pairheap.h"
#include "py/mphal.h"
+#if MICROPY_PY_UASYNCIO
#if CIRCUITPY && !(defined(__unix__) || defined(__APPLE__))
#include "shared-bindings/supervisor/__init__.h"
#endif
#include "supervisor/shared/translate/translate.h"
-#if MICROPY_PY_UASYNCIO
// Used when task cannot be guaranteed to be non-NULL.
#define TASK_PAIRHEAP(task) ((task) ? &(task)->pairheap : NULL)
```speculative fix for the failure here: https://github.com/adafruit/circuitpython/actions/runs/5852002423/job/15863643807?pr=8281 by preventing `supervisor/__init__.h` being included if UASYNCIO isn't turned on, as it should not be in mpy-cross.
otherwise, the conditional should be extended , maybe || defined(_WIN32), I would have to refresh my memory as to what the "standard win32 define" is.
I will try that.
first locally on a non-windows build, or did you do that already?
i was thinking maybe we should put #include "supervisor/shared/translate/translate.h" into something like py/runtime.h. It is a change that appears everywhere, sometimes the only change in what otherwise would be the same upstream file
tested on metro m4 build and pushed
or misc.h? that's where MP_ERROR_TEXT is in micropython
yes, that makes more sense; I was thinking about where the mp_raise* routines were
#include "supervisor/shared/translate/translate.h"
was added to many files to handle internationalization. This #include could be part of a pervasive #include like misc.h to reduce changes in upstream files.
Thanks @jepler for the discussion on this.
Maybe do this before the MPy v1.20 merge.
first doc build problem may be a missing space? ``` Encode binary data in base64 format, as in RFC 3548 <https://tools.ietf.org/html/rfc3548.html>_. Returns the encoded data
- followed by a newline character if
newlineis true, as a bytes object.
- followed by a newline character if
newlineis true, as a bytes object.
there are additional doc building errors that occur after that one
i did not run a doc build locally. I can work on that.
hmm listing git files failed - pretending there aren't any
/home/jepler/src/circuitpython/docs/library/framebuf.rst: WARNING: document isn't included in any toctree
/home/jepler/src/circuitpython/docs/library/micropython.rst: WARNING: document isn't included in any toctree
/home/jepler/src/circuitpython/docs/reference/mpyfiles.rst: WARNING: document isn't included in any toctree
docs/library/builtins.rst|36| WARNING: 'any' reference target not found: python:bytes docs/library/builtins.rst|227| WARNING: 'any' reference target not found: python:SystemExit
docs/library/builtins.rst|233| WARNING: 'any' reference target not found: python:TypeError
```the other "warnings" I get, which I think are all treated as fatal errors by the build process
that message is not new, don't worry about it
tnx
or at least don't worry about it right now. I think it has to do with how the typing package is a bunch of generated files, not git files
also the older jobserver warning
my goodness, I've be reading that as "j-observer" instead of "job-server" forever, due to -j -j + observer
we had
|see_cpython| `bytes`.
upstream has
|see_cpython| `python:bytes`.
which does not seem to work for us
oh we probably need to list it in our .. something in the doc config
intersphinx?
intersphinx_mapping = {"cpython": ('https://docs.python.org/3/', None), we have this mapping, so it'd have to be cpython:bytes?
they have ```intersphinx_mapping = {'python': ('https://docs.python.org/3.5', None)}
yes, that's what I am thinking. I think we might have cpython instead of python. I seem to remember dropping the c.... yes, exactly. I would rather drop the c so upstream is unchanged
OK, makes sense to me
@idle owl oh and fwiw I looked through learn but didn't see any other cases that looked like r, g, b = colorwheel...
trying Blinka with the adafruit FT232H board:
AttributeError: module 'adafruit_platformdetect.constants.boards' has no attribute 'ORANGE_PI_4'
Thank you.
this is with Blinka 8.2
could you ask in #help-with-linux-sbcs ? you have to set an env var, if i recall, check the guide for FT232H
ok, thought I did, but I'll move it there
@misty garnet also, make sure adafruit_platformdetect is up to date. Though, this has been in place for a year according to a quick search https://github.com/adafruit/Adafruit_Python_PlatformDetect/blame/96871229e60d51c6b50016eb3994a54d2213552e/adafruit_platformdetect/constants/boards.py#L58 but sometimes pip will update some modules but not others for reasons of its own
pip3 install --upgrade Adafruit-PlatformDetect
yeah, thanks, that did it. I had an old blinka installation and that must not have been updated recently
@idle owl I have an example using colorwheel that Ventrue helped write but it does use red_fade=(full_range>>16)&255 that Jepler mentioned. It works... but I don't know why that works.
If you just need a working example, I have one.
Thank you though!
For reference just in case you want to see what I mean. https://github.com/DJDevon3/My_Circuit_Python_Projects/blob/main/Boards/nrf/ItsyBitsy NRF52840 Express/BLE Candle/code.py
@midnight ember the hand wavy explanation is "it's like taking 2 digits out of the middle of a 6-digit number, but in binary"
I understand every single line and why everything works except that one line added by Ventrue. No clue what that syntax is doing.
Yes that syntax looks like πͺ to me. If it works it works.
the decimal equivalent is (x // 1_00_00) % 100 but for the sake of a tiny bit of efficiency in binary arithmetic it's written with >> instead of // and & instead of % (and the values are different)
had no idea it was breaking it down into binary. i guess everything becomes binary at some point.
well and it's taking the left 2 digits not the middle 2 digits
ohhh because 8+8= 16 = 2 digits. now it makes sense.
that is some super efficient snazzy code.
<@&356864093652516868> We'll have our weekly meeting in about 95 minutes from now in this text channel and in the circuitpython voice channel. Please take the time to add your notes in advance to the document: https://docs.google.com/document/d/16vLRTp2Bu2ILsgFtmQZ764mjPu3NpBfqv24BjlpqNjs/edit -- I look forward to everyone's updates!
CircuitPython Weekly Meeting for August 14, 2023 Here is the notes document for next Mondayβs CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if youβll be ...
>>> hex((f >> 16) & 255)
'0x12'
>>> hex((f >> 8) & 255)
'0x34'
shifting 16 bits = shifting 4 hex digits
that's a little higher level for me to understand, thank you. π€
@midnight ember just looking at your status update, I dunno if you're aware that the "serpentine" argument is intended for 'stacked, but each successive display is rotated 180 degrees' layouts. This doesn't require as long of a cable. It looks like some documentation is missing so I am not surprised that you didn't guess this.
These are listed in the function definition but the constructor arguments are not individually explained... https://docs.circuitpython.org/en/latest/shared-bindings/rgbmatrix/index.html#rgbmatrix.RGBMatrix
sorry about that
cpython is a version of circuitpython designed to run on huge computers called "servers"
and esp32 linux distros?
I wonder if we can have CPython and Blinka on the esp32s3 Linux LadyAda showed recently...
@thorny jay from what I understood in an internal meeting, the linux kernel, or maybe the micropython port for it, does not have gpio support. it'd be cool if someone added it though
no idea if that's simple or tragically complex though
One of the most exciting initiatives in the Python space these days is pyscript which enables Python running natively in your browser. With consistent support from the folks at Anaconda, this project has been making solid strides since its initial release. On this episode we catch up with Fabio Pliger and Nicholas Tollervey to see where they are...
No one has seemed to use that hashtag yet π¦
i can post on the @circuitpython Mastodon account
we can change the order of that in the meeting template
harder to include some media in an email vs a mastodon post, it's easier for me to tag circuitpython on mastodon.
Much appreciated. Have left most commercial social networks, so good to see Fediverse presence.
@midnight ember post where you want and then follow up with an e-mail for more reliable attention?
can do that sure, i have some upcoming projects hoping to tag.
@turbid radish could you send me a link of a social media post I could crib from? Thanks
Those git guide are actually great. I always return to them.
@midnight ember see the 2x2 arrangement here: https://learn.adafruit.com/rgb-led-matrices-matrix-panels-with-circuitpython/advanced-multiple-panels and the rectangular arrangements pictures further down https://learn.adafruit.com/rgb-led-matrices-matrix-panels-with-circuitpython/advanced-multiple-panels#rectangular-arrangements-3082270
figured inverting a row would make things more difficult. thank you.
live and learn π
and thank phil b for implementing the feature, I think it was a bit brain-melting to write.
I tend to prefer the opposite and include files directly to make it clear where things come from. It is part of include-what-you-use and their argument is that something like misc.h would have extra stuff that slows down a compile.
β€οΈ
this community is so amazing. if i could give hugs to everyone for everything they do every week it would take about 5 minutes.
@onyx hinge I backported a second board, the metro-esp32s3... but I don't have the hardware, so I guess @gilded cradle will need to have a look.
@thorny jay I don't have the hardware either. Ladyada tested for me.
ooh I can't wait for that guide. who'll be jamming out for the project video?
I have a metro s3
Thanks @candid sun - lots of retro folks want to tinker with the joystick guide
Oh... so you blindly write the code... and I blindly backported. π
π
I looked at schematics and such, but otherwise yeah
While I'm still in limbo, waiting for my day job's Legal dept, the positivity and kindness in this community has been a breath of fresh air and makes me glad for my decision to change which parts of the Internet I interact with regularly.
based on the state of the documentation I am not surprised you overlooked the option, don't be harsh on yourself π
looking forward to all the activities for CP day. i'll definitely be there foamyguy to learn stuff from the game jam.
not sure what message board is but sounds interesting
ποΈ
we should see how many synthio voices can be accommodated on the 1060 .. 48? 96? π
though in MHz it's not much faster than the 1010 is it?
My brain still needs ποΈ just fromwatching your deep dive on the IDF merge.
600 mhz vs 500
and on Friday!
1 MB SRAM π
Thank you for hosting.
ttyl, thanks all
Thanks Liz!
thanks Liz!
thanks everyone
Thanks for hosting Liz! Have a good week everyone!
Thank you for hosting Liz. Have a great week everyone!
Thanks!
Thanks all! Have a good one!
thanks folks!
Seems to me that the best way to fix is to have displayio check for deinit SPI before using it. If it is, then displayio can deinit itself.
@onyx hinge No idea how I missed that guide. Also read that my 10A PSU likely won't be enough. doh.
i need to get back to trying to build circuitpython on my system.... let me see what was missing
thank you for that link, saved me from a lot of questions. β€οΈ
We're punting most ESP bugs to 9.0.0 because we are updating to IDF 5.0+. Once we do that update, we'll ask for a retest of this issue and go from there.
Thanks @Saentis and @andibing
@gilded cradle <#circuitpython-dev message> user had an old version of platformdetect and FT232H did not work. The requirements.txt says Adafruit-PlatformDetect>=3.13.0, which is pretty old. jepler suggested an upgrade, which worked. Should the requirements.txt be bumped?
tnx
yeah, makes sense
the building circuitpython is kept up to date and is our de facto docs for it: https://learn.adafruit.com/building-circuitpython
root@1eadd933a805:/circuitpython/ports/raspberrypi# make BOARD=raspberry_pi_pico V=2
GEN build-raspberry_pi_pico/genhdr/mpversion.h
python3 ../../py/makeversionhdr.py build-raspberry_pi_pico/genhdr/mpversion.h
Cannot determine version.
CircuitPython must be built from a git clone with tags.
If you cloned from a fork, fetch the tags from adafruit/circuitpython as follows:
make fetch-tags
make: *** [../../py/py.mk:242: build-raspberry_pi_pico/genhdr/mpversion.h] Error 1
root@1eadd933a805:/circuitpython/ports/raspberrypi# python3 ../../py/makeversionhdr.py build-raspberry_pi_pico/genhdr/mpversion.h
Cannot determine version.
CircuitPython must be built from a git clone with tags.
If you cloned from a fork, fetch the tags from adafruit/circuitpython as follows:
make fetch-tags
looks like python is upset for some reason
root@1eadd933a805:/circuitpython# make fetch-tags
git fetch --tags --recurse-submodules=no --shallow-since="2023-02-01" https://github.com/adafruit/circuitpython HEAD
fatal: detected dubious ownership in repository at '/circuitpython'
To add an exception for this directory, call:
git config --global --add safe.directory /circuitpython
make: *** [Makefile:339: fetch-tags] Error 128
ah, docker is confusing git
This works for me.
Next time, let's wait for hardware to be available. Only then do we know that it won't change before release. It'll also make testing easier.
docker seemed the simplest option for my distro
got past the git issue, and now i'm missing the gcc, grabbing one linked from the above guide
LINK build-raspberry_pi_pico/firmware.elf
Memory region Used Size Region Size %age Used
FLASH_FIRMWARE: 804512 B 1020 KB 77.03%
RAM: 52348 B 256 KB 19.97%
SCRATCH_Y: 0 GB 4 KB 0.00%
SCRATCH_X: 3248 B 4 KB 79.30%
Create build-raspberry_pi_pico/firmware.bin
Create build-raspberry_pi_pico/firmware.uf2
Converted to uf2, output size: 1609216, start address: 0x10000000
Wrote 1609216 bytes to build-raspberry_pi_pico/firmware.uf2
root@1eadd933a805:/circuitpython/ports/raspberrypi# make BOARD=raspberry_pi_pico V=1 -j32
that looks like it worked?
iInterface 4 CircuitPython CDC control
iInterface 5 CircuitPython CDC data
iInterface 6 CircuitPython Mass Storage
iInterface 7 CircuitPython HID
iInterface 9 CircuitPython Audio
iInterface 8 CircuitPython MIDI
yep, that looks like progress
ttyACM0, and sdc
0;οΏ½πDone | 8.2.0-45-g75ba17e84-dirtyAuto-reload is on. Simply save files over USB to run them or enter REPL to disable.
Press any key to enter the REPL. Use CTRL-D to reload.
0;οΏ½πREPL | 8.2.0-45-g75ba17e84-dirty
Adafruit CircuitPython 8.2.0-45-g75ba17e84-dirty on 2023-08-14; Raspberry Pi Pico with rp2040
>>>
>>>
next step then, would be to find that usb cable i cut with a 12v SLA battery, lol
a few years back, i dropped that battery, and it sliced a usb cable clean in 2, like i had used scissors
and i cant throw anything out, lol
better to use a cable i already cut up (by accident) then to cut another one up for PIO-usb
ah, that could work too, but id need to wait on shipping
and ive got another cable i had cut up, and was planning to use with https://github.com/ataradov/usb-sniffer-lite
i suppose i could just solder that 2nd cable to a pair of 1x4 headers, and use a breadboard to turn it into a Y for the sniffer
and i can always not plug in half, to reduce the stub when using it for PIO-USB
let me know how that sniffer works. I was thinking it'd be cool to pipe it into wireshark
after getting the PID toggling wrong with MSD, i can see how much value a proper analyzer adds
something that just dumps packets wont flag things like getting DATA0/DATA1 backwards
but then again, wireshark seems to operate at a higher level, and wont show that either
i also just had a crazy idea....
HS usb, identifies itself by giving short chirps after reset, after first identifying itself as FS
if i slap some low-pass filters on the usb lines, and mess up those chirps, could i cause something to fail to identify as HS, but still function as FS?
I think wireshark can do the lower level if captured externally: https://github.com/ataradov/usb-sniffer
screenshot there shows a USBLL analyzer
which screenshot?
ah, i see the issue, i was getting https://github.com/ataradov/usb-sniffer and https://github.com/ataradov/usb-sniffer-lite mixed up
but in theory, there is no reason the lite cant talk to wireshark as well
it just cant capture HS
ya, that's my thinking too. I briefly looked for wireshark "read from serial file" but didn't see anything
may need a small shim to capture pcapng packets from serial
in the past, ive made a wireshark plugin for decrypting and disection packets from the tox protocol
so i have some experience with wireshark internals
the biggest problem, is that while wireshark allows out-of-tree plugins
it doesnt expose headers for building them
so you have to build wireshark from source, and then reuse that left-over source tree
and it tends to break on every version update
I thought I update this now that I appear to have a work around. By increasing the bytearray to 65507 (maximum udp payload size) for holding the udp payload I no longer get the hardware failure fault. But instead I get a Internal watchdog timer expired fault anywhere between 17 and 31 hours. I can work around that by using the safemode.py file to reset the esp32. Now that number maybe arbitrary. e.g maybe less would work also, but I just stuck with it since I can around the hardwar...
Could I get a review on this soon? It will be needed for my CircuitPython Day project/guide.
Here is the notes document for next Mondayβs CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if youβll be attending the meeting - itβs super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and weβll read them off during the meeting. Hope to see you there! <@&356864093652516868>
https://docs.google.com/document/d/1DMsb91O4e6KFiV7sn0TroXW4g6Dr9yukYOOC_vaCMto/edit
CircuitPython Weekly Meeting for August 21, 2023 Here is the notes document for next Mondayβs CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if youβll be ...
@tulip sleet speaking of tests we'll want to tend to the fact that more tests are skipped, after dealing with the failed tests. The skip count went from 30 to 92 according to a quick check locally
I am diffing the test output, yes.
I can look at the viper ones if you like
I dunno what you have started on wrt the tests
I just started looking at the tests a few minutes ago. I ran make test on the tip of adafruit/circuitpython main, and there are failures, including your new synthio tests. I am confused by this -- I thought I would see all pass and skip. Maybe I am running the tests wrong
make VARIANT=coverage test
aha. my next step was to look at the yml π
i'd be happy for you to look at the failures, starting with viper. I did 3 or 4 12-hours days on the merge, and am a bit fried. I could look at some of the skips
i already tried to turn off the viper tests, so new eyes on that would be good. That's the (!CIRCUITPY) stuff I added in mpconfigport, I think (it was late last night)
Jepler - looking forward to see how you get over the dot clock display hurdles on the ESP32-S3 especially the DMA and PSRAM constraints, hope I will be able to understand. Also, Iβm interested how portable you expect it to be for new chips (eg ESP32-P4 and beyond).
that's a downside of my choice to implement it at the register level intsead of using esp-idf, it won't be portable if the register interface has changed.
looking good, will push that
getenv test is failing
:raised eyebrows:
note that I removed btree and framebuf, so those tests will be skipped
out for a walk
i started to look it up, but I think you know already: how do you run a single test?
yes
make VARIANT=coverage TEST_EXTRA=micropython/viper_addr.py test
from ports/unix
@tulip sleet getenv + 17 more tests https://gist.github.com/jepler/bfc293302f4262b0b5abdf55cc82fbf4
I'm stopping for now π we can talk tomorrow if I decide to work.
oops did "fix 18 tests" make something worse? If you let me know what I'll get it fixed when I am working.
oops did "fix 18 tests" make something worse? If you let me know what I'll get it fixed when I am working.
No, I applied the patch wrong (I was in the wrong directory), so it only patched some of the files, not all of them. I wasn't sure I wanted to do a force push, so I reverted, reapplied the patch, and just pushed again. I hadn't pushed since earlier this evening because I was working on the async tests.
FYI, since this issue was raised we (MicroPython) have added a "sub version" along with the main "mpy version". (@jonnor refers to this above, i.e. the current version is 6.1).
So now both the runtime and .mpy files have a version and sub version. As long as the main version matches, a bytecode .mpy file will work. To load a .mpy with native code (i.e. it has an arch set in its header) then the sub version must also match. cc @jepler @dhalbert this might be relevant when you're merging v1....
I'm a little bit further with my usb_host test on RPi Pico. But I'm getting an exception usb.core.USBError: No configuration set now.
Maybe @slender iron has an idea why?
CircuitPython version
adafruit-circuitpython-adafruit_proxlight_trinkey_m0-en_US-8.2.3.uf2 with proximity trinkey 5022
Code/REPL
# Copied and pasted the code form here
# https://learn.adafruit.com/adafruit-proximity-trinkey/proximity-spacebar-game
# and here:
# https://learn.adafruit.com/adafruit-proximity-trinkey/proximity-midi-controller
# The last one to worked for a bit, but not all the time. It didn't run in Thonny though.
# I had to rename ...
I have been attempting to get this to work but have not gotten anything close to working yet. Not sure if my guesstimates are that far off or what. I will look again at this next week but I could probably use some assistance, Where is the best place for getting some technical assistance, Discord?
@tulip sleet some more tests fixed by making sure import uerrno works in the unix port. https://gist.github.com/jepler/d746ebc44792f08f91b747434c9d778a
When the board.SPI() bus is deinitialised, it will fail on the next display write with a valuerror and deinit the display.
The error already exists, so no binary size increase.
Hadn't made a core PR is so long, so decided to fix it myself. It's a tiny one, but works. Enjoy.
Let's hope this one doesn't leave longstanding bugs that haunt my very existence for years to come.
Also, https://github.com/adafruit/circuitpython/pull/8091 has been buried and forgotten, even though it's ready now.
Once it's merged I can go and finally do stop_ap() the same way micropy does.
we are going to merge 8091 as we move on to 9.0.0, so not forgotten! its milestone is 9.0.0. We are doing MicropPython merges and ESP-IDF updates first
kk, thanks for letting me know!
btw, is the esp stuff in need of testing?
not yet, Scott has just started working on ti
microdev did a lot of the work a long time ago and we are picking up where that left off
I took a good read, my brain imploded, and never touched it since.
I can only do small stuff really. Not that comfortable with core just yet.
Thanks for working on fixing this issue!
Unfortunately, I don't think the fix is correct / complete.
In testing with this PR, I was able to get two different kinds of misbehavior, apparently depending on whether I had a code.py or not.
In one case, after I did board.SPI().deinit() and exiting the REPL, my code.py restarted and the ValueError was raised from an arbitrary spot:
Adafruit CircuitPython 8.2.0-77-g8534daeb87 on 2023-08-15; Adafruit Camera with ESP32S3
>>> board.DI...
I'll incorporate these -thanks.
In one case, after I did board.SPI().deinit() and exiting the REPL, my code.py restarted and the ValueError was raised from an arbitrary spot
The way I implemented it, it should only be raised on the next screen write. Aka, the next full line.
It may be that the data is still written while the display is not refreshing, causing the behaviour you saw.
I didn't read the whole displayio source.
In the other case, I got a Safe Mode reset
Here, it seems like the error was raised out...
@onyx hinge Getting the asyncio tests to work involves paying some technical debt. generators used to be function bytecode objects wrapped in a generator object. The person who added async/await built on that (PR #3540 [EDIT], Oct 202), and added a boolean flag. that the generator was a coroutine. But about five years ago MicroPython removed the wrapper object, and just changed the type. Our merging did not ever pick up that change.
There is no room in the function bytecode object to add a flag, so I am thinking about adding a new type that is a coroutine, like the generator type, but different identity to distinguish between the two. I think this is the easiest way to bring this up to date. Did you work on the generator stuff in the past?
@tulip sleet that rings some vague bells. I know we did coroutines "differently" because __await__ vs __next__ as an attribute name was important to us. And that our difference also led us to have a different bytecode format for mpy files (oof) and is why we have a different bycode magic number than micropython
your last sentence: do you mean we are behind, or we diverged in mpy format? We can talk on audio if you are up to it
we diverged
I'm trying to find the relevant PR. but sure we can voice or video in a bit.
sure, ping me after your research
This change:
adds await() support as the backing implementation hook for CircuitPython async/await noun/verb pair.
enables async/await on lots of boards.
removes all special cases of if sys.im...
oh that's the PR you intended to cite, but had a transposition error
I'm thining of MP_SCOPE_FLAG_ASYNC
i did not track down MP_SCOPE_FLAG_ASYNC yet, I was assuming it was MicroPython, but maybe not
hmm, not in their repo
no, it's ours
OK I'll make tea and then we can get on a chat
In the other case, I got a Safe Mode reset
This only occurs at the rare edge case you have no code.py, at all.
@tulip sleet whenever you're ready π
Two options come to mind:
(1) Create wifi.radio.ap for all of the AP-specific functions, and since this is breaking for AP, we could also use the opportunity to simplify those function names (remove _ap). Leave station functions at the wifi.radio level.
(2) Create wifi.radio.ap. and wifi.radio.station.. Functions common to both (e.g., wifi.radio.enabled) stay at the wifi.radio. level. This may be more intuitive, but breaks everything (user code, examples, guides, etc.).
@danh I'll work on exception_chain and vfs_abc tests
Now if the spi bus is deinit'ed the display is not reset.
The ValueError was removed. Having a surprise ValueError on a print() is not a good idea.
I suggest we put there a new serial message instead (I am not going to decide the content of said message).
Now doing:
import board
board.DISPLAY.auto_refresh = False
board.SPI().deinit()
^D
Results in a hang. I have no clue where. No jtag on S3.
I should note that properly solving this edge case will take up a lot of code...
anyone around?
- this is a development channel, i guess you are looking for help and any #help... channel would better suit
- just ask the thing (https://dontasktoask.com/)
oh, crossposted on help-cp too π π€¦
You need to call set_configuration() before doing the read
Thanks a lot! Will try this later today
@tulip sleet looking at the basics_sys_tracebacklimit failure now. probably we need to be checking that value but aren't yet
i wasn't sure how relevant the limit was to your improved tracebacks
actually it looks like the limit is imposed when grabbing the traceback, not when printing it. interesting.
@half sedge it may be worth getting you a debug build for usb host testing
It looks like 1.19 changed the exception object representation extensively, but the merge 1.19 branch seems to have kept the prior layout. Just looking at mp_obj_exception_t in objecxcept.h in 1.19 and in your branch @tulip sleet
was that deliberate or an oversight?
I think It was "keep ours" because of all the work you did on traceback. Do you mean changes, e.g., in mp_obj_exeception_t in objexception.h ?
if it's safe to switch to their new format, that would be fine. We had a lot of our own code
yes
i think I did not realize they had changed the format in v1.19.1, but thought that the changes were due to new traceback.
they are quite different aren't they π
OK adding traceback limiting was not too tough
my newest gist has 5 patches in it; let me know how you would like to handle that. If we coordinate I can push them to your branch. now at: ```895 tests performed (37610 individual testcases)
877 tests passed
39 tests skipped: [snipped]
18 tests failed: async_await extra_coverage import_mpy_invalid import_mpy_native import_mpy_native_gc native_gen uasyncio_await_return uasyncio_basic uasyncio_event uasyncio_event_fair uasyncio_gather uasyncio_gather_notimpl uasyncio_lock uasyncio_lock_cancel uasyncio_task_exception uasyncio_wait_for uasyncio_wait_for_fwd ubinascii_b2a_base64
This contrasts to 56 tests skipped in today's main branch so we're in good shape there.
the mpy tests probably need to be updated because we use different magic numbers than upstream.
https://gist.github.com/jepler/7517e3c9705a82cbdc31b829caedcf88 now 6 patches, fixed the ubinascii thing too
You mean compiling a UF2 but with some extra flag?
why don't you go ahead and push all the patches from today to the PR? If it's easy to break them up into logically separate commits, that would be worth it
i am not done with the async changes yet
OK if you are comfortable with that I can do it.
Discord is best for board bring up questions: https://adafru.it/discord #circuitpython-dev
probably less terrible than you getting acquainted with git am as long as we're coordinated
saves me time!
OK done
I'm going to take a break. later or tomorrow I'm going to start with one of these: extra_coverage import_mpy_invalid
Yup, you can do #define CIRCUITPY_DEBUG_TINYUSB (1) 1-3 in mpconfigboard.h to turn on tinyusb logging
I think it goes out serial though
@tulip sleet I see that fetch-submodules isn't there anymore, and now it is fetch-all-submodules. Is that what I should be running to prepare a change to CP? That said, I did a pull and my working tree is clean according to git and usually I was running the submod thing to clean that up before making changes. Do I not need to do it anymore or something?
fetch-all-submodules fetches for all ports. If you descend into a port, like ports/raspberrypi, you can do make fetch-port-submodules, which is faster because it only fetches the submodules for that particular port.
Oh rad ok.
Thanks.
@tulip sleet Should I be getting permission denied trying to run ./esp-idf/export.sh? I installed the IDF just now. Does it require sudo?
Wait, should I be running that or source it?
source did something. Trying it with that.
Right, you need to do βsourceβ because it sets environment variables
@tulip sleet FYI, if you're running Python 3.11, and you do the ESP-IDF set up, it will repeatedly fail with dependency issues. This is not noted anywhere in the documentation that I can find, unless there is something somewhere more broad saying you have to use <= 3.10 to do anything with building CP in general.
I just heard about this a day or two ago. I will add a warning. I think other builds are ok
Ok. Thanks.
In other news, I can build for ESP for the first time ever, and this is not the first time I've tried.
I need to update the board def for the Metro ESP32-S3.
So there's a reason.
So tannewt was right... I was too fast in proposing a backport to 8.2.x. Any change you do against main will have to be done against 8.2.x.
I am no expert in git, and mostly used your guide (except for git cherry-pick that is maybe not discussed there) but in the PR, I documented the steps I used to do that PR against 8.2.x: https://github.com/adafruit/circuitpython/pull/8280
Ah hmm ok. Thank you for the heads up.
Backporting with cherry-pick make sense for me beause I am not the author of those board support, so I wanted to maintain the original credit. But you can also do two PR and just push your version of the files you will change to both branch.
Oh fair enough. Good call.
I would have tried to make it more difficult, but I believe you are correct.
Both option are easy, my solution only require to have the sha1 hash of the change you want to reapply to another branch, and you can copy that from the github UI.
I think I can instigate it locally ok. It's such a simple change. I could pretty easily "redo" it for the 8.x.x branch.
I would prefer to level up my git skills.
But unfortunately, my priorities are elsewhere. So the simplest option is the one I have to use.
So... yeah.
@candid sun Greetings. Question! I am trying to use the example you wrote for the SD Card BFF. As long as I have the proper pins, it should work on a microcontroller with a built-in SD Card, yes?
i am pretty sure it will
Ok, then something else is going on here.
Thanks for verifying.
Well maybe not.
It's dumping me into safe mode.
I commented out the function and prints at the end, and it is working. So... set up isn't borking it. Something in the function is.
Wait...
No, it erased the entire drive and renamed it to NO NAME.
@slender iron Have the mpy changes been added to main yet?
nope
I'm getting safe mode because Internal watchdog timer expired.
I haven't seen that one before, and have no idea what might cause it.
Metro ESP32-S3
Running an SD card example. Fresh build from main with a new pin in it.
it's a pretty nasty error. I'm not sure what would be causing it
basically some code is hanging that shouldn't
I added a new pin, I verified it with dir(board) and dir(microcontroller.pin). Is that sufficient to PR it? Or should I file an issue about this first and hold off on the PR?
Ooh, let me see if I can toggle it with digitalio.
I think it's fine to PR a pin change. That wouldn't cause the problem. Filing an issue for the watchdog would be good
Got it toggling! Had to try all the pins on the SD card slot with the Saleae running to find it, but it's working. Also, haven't used the Saleae in ages. So that was nice.
Verified on Metro ESP32-S3 with dir(board), dir(microcontroller.pin) and by testing toggling the pin using digitalio.
@slender iron I built from 8.2.x to verify, and if I check the REPL, it says Adafruit CircuitPython 8.1.0-beta.0-255-g7567f7170-dirty. The hash is correct, but not the version. Is that right?
As in it matches the last commit on GitHub
that can be right if your local git doesn't have the tag
Hmm ok
It doesn't.
Thanks.
Wait
Can I commit from the proper previous commit without the tag and PR it and have it work?
git fetch --tags
Thank you
yup, you don't need to have the tag locally
Whew. I think I got it right.
Now the question is how badly did I hose my circuitpython clone π
Please re-test once we've merged IDF 5 support into CircuitPython 9.
Is there a build where this can be tested now?
@slender iron If it says it can automatically merge to the 8.2.x branch, is it likely I got it right?
yup, seems right
Rad. Thanks.
Not quite. I'm working on it now.
Solidly, is the answer to this question.
Hmm. Running code from the REPL can still cause safe mode, correct?
Because running these lines of code in the REPL seems to be fine.
Nevermind.
I guess I hadn't run that exact iteration yet.
Safe mode from the REPL. Got it.
CircuitPython version
Adafruit CircuitPython 8.2.0-75-gc75640eb0-dirty on 2023-08-15; Adafruit Metro ESP32S3 with ESP32S3 (built from main with SD_CS pin added)
Adafruit CircuitPython 8.1.0-beta.0-255-g7567f7170-dirty on 2023-08-15; Adafruit Metro ESP32S3 with ESP32S3 (built from 8.2.x with SD_CS pin added)
Code/REPL
import busio
import digitalio
import board
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
cs = digitalio.DigitalInOut(board.SD_CS...
Oh snap. TIL you can put formatted code in an issue title on GitHub.
I did it simply to differentiate it. I didn't expect it to render.
Just got my makerfabs display and confirmed that R34 is indeed Not Connected. Also note R5 is NC, unsure if the clock really needs a pull-up.
ok, I'm one step further - a new error message π but it doesn't really tell whats wrong:
This might be the error I've been chasing down where on reload the host stack isn't fully reset.
you'll have to save, eject and restart for now
ah, ok. Let me try that
I may have a change somewhere that adds slightly better error messages
@onyx hinge I fixed the basic asyncio stuff by adding a new type, as we described yesterday. The only difference between the types was __await__(). it did still need the iter operations to act like a coroutine. I will work on the uasyncio failures in a little while; hope that's just a naming issue.
@tulip sleet excellent! Let me know when you've pushed that, the "extra_coverage" test depends on the list of built in modules so its .exp file will change again depending on whether the module name is really _uasyncio or _asyncio.
@tulip sleet I'm going to just mark the "native module" test as known not-working. maybe someone else will fix it.
so I've got a suite of changes locally: 7f1b946a3c (HEAD -> merge-micropython-v1.19.1) Skip the import_mpy_native_gc test, it is known to be broken a55e6fe55e Allow natmods to build again (they don't work, however) 9d7754842b update test result e8476f0a66 update invalid-mpy test and result fffe5fd53e Re-add usercmodule sources & endorse new extra_coverage output and these tests still fail async_await native_gen uasyncio_await_return uasyncio_basic uasyncio_event uasyncio_event_fair uasyncio_gather uasyncio_gather_notimpl uasyncio_lock uasyncio_lock_cancel uasyncio_task_exception uasyncio_wait_for uasyncio_wait_for_fwdIf you would like me to look at something more, let me know. Otherwise I'll just rebase this once you're done with uasyncio, update the extra_coverage test result again, and push when it's OK
and I'm fine with making native_gen also SKIP
@onyx hinge I am getting different results with the uasyncio tests; it's not just a naming problem, so still investigating
oof OK. let me know if you want to get more in detail, though I'm having a long lunch with friends today (about 12 to 2 my time / 1 to 3 yours) so I'll be gone for a chunk of time
i am donating blood 1:30pm on so similar
About a year ago, I proposed and contributed analogbufio. I'm not sure how many use this feature, yet I use it a great deal. I have noticed an issue, but not sure if its the implementation, or RP2040 ADC, or CPy. I i try to use the feature multiple times, the wait period between uses is important. If the wait period is too short, the buffer is filled with noise. Any ideas?
Could you file an issue with a really simple example?
turns out the asyncio tests and results changed between v1.18 and v1.19.1, could be a Python asyncio library change or a C change that provoked the changes. I should have spotted that earlier -- could not figure out why the tests were not failing in our current main build.
My App is very complex, but I will work on distilling the issue down to a simple example. Thanks Dan!
I tried board.SPI() as well yesterday, and still ended in safe mode. I verified again today that the following results in the same safe mode reason.
import digitalio
import board
import adafruit_sdcard
cs = digitalio.DigitalInOut(board.SD_CS)
sdcard = adafruit_sdcard.SDCard(board.SPI(), cs)
Okay, now it works as expected.
Currently does not show an error message or raise any exceptions.
I do not want to decide on an error message. But I suggest it's a serial_write_compressed instead of an exception.
This:
try:
print()
except ValueError:
pass
feels dystopian and I don't want to be responsible for it.
I think it would make more sense to simply raise an exception when trying to deinit a bus used by displayio.
No weird side effect at a future point in time.
If you want to free the display's bus, use displayio.release_displays()
This PR exists solely for the purpose of fixing the hardfault.
As a matter of fact, deiniting a board.SPI bus breaks it completely, even across reloads.
So.. we are not fixing something broken into something working.
We are fixing something very broken, into something less broken.
A complete "fix", would be outright denying the deinit from going through.
A board bus property should perhaps not be "deinit-able" at all.
Or any SPI bus would require no displays to be attached to it to ...
CircuitPython version
Adafruit CircuitPython 8.2.3 on 2023-08-11; Raspberry Pi Pico with rp2040
Code/REPL
import usb_hid
REPORT_DESCRIPTOR = bytes((
0x06, 0x00, 0xFF, # Usage Page (Vendor Defined 0xFF00)
0x09, 0x01, # Usage (0x01)
0xA1, 0x01, # Collection (Application)
0x06, 0x00, 0xFF, # Usage Page (Vendor Defined 0xFF00)
0x09, 0x01, # Usage (0x01)
0x75, 0x10, # Report Size (16)
0x95...
THis is the HID Trace of the device I am trying to emulate
The USB device is not brought up until code.py is run. Try putting the actual send
report=bytearray(230)
def send():
dev.send_report(report)
send()
in your code.py (maybe as part of a test loop, e.g. send each time you get some input()). Note that you must do a hard reset to have boot.py re-executed if it changes.
Tried that. This is my code in code.py
'''
import usb_hid
REPORT_DESCRIPTOR = bytes((
0x06, 0x00, 0xFF, # Usage Page (Vendor Defined 0xFF00)
0x09, 0x01, # Usage (0x01)
0xA1, 0x01, # Collection (Application)
0x06, 0x00, 0xFF, # Usage Page (Vendor Defined 0xFF00)
0x09, 0x01, # Usage (0x01)
0x75, 0x10, # Report Size (16)
0x95, 0x01, # Report Count (1)
0x91, 0x02, # Output (Data,Var,Abs,No Wrap,Line...
Sorry if was not clear. This code should be in boot.py:
import usb_hid
REPORT_DESCRIPTOR = ...
dev = usb_hid.Device(
...
)
The remaining code that actually does the send should be in code.py. You have to split it into two pieces:
- The HID device definition goes in
boot.py - The use goes in
code.py
You need to find the device you created in boot.py. There is a convenience routine in the adafruit_hid library to do this: https://github.com/adafruit/Adafruit_CircuitPython_HID/blob/9ec404f8b318af5b4f02855311e5a00233ce29b5/adafruit_hid/__init__.py#L33
Here is an example of its usage in mouse.py:
https://github.com/adafruit/Adafruit_CircuitPython_HID/blob/9ec404f8b318af5b4f02855311e5a00233ce29b5/adafruit_hid/mouse.py#L39
import usb_hid
import adafruit_hid
# 0xff00 == 65...
So currently my boot.py reads
`import usb_hid
REPORT_DESCRIPTOR = bytes((
0x06, 0x00, 0xFF, # Usage Page (Vendor Defined 0xFF00)
0x09, 0x01, # Usage (0x01)
0xA1, 0x01, # Collection (Application)
0x06, 0x00, 0xFF, # Usage Page (Vendor Defined 0xFF00)
0x09, 0x01, # Usage (0x01)
0x75, 0x10, # Report Size (16)
0x95, 0x01, # Report Count (1)
0x91, 0x02, # Output (Data,Var,Abs,No Wrap,Linear,Preferred ...
Ok, so apparently boot.py is working because HID Trace can read the device with proper size. But Sending the data is still failing.
A few notes:
The report descriptor you have above has 232 bytes total of "input" report and 232 bytes of "output" report. ((IN and OUT are with respect to the host.) Your screenshot in the previous post shows that. The usage-page and usage values used in find_device() refer to the top-level device, and don't selectively choose what is inside the Collection. But your IN report length is given as 230, not 232, and the OUT report length is given as 0, not 232.
My understanding is that fo...
Okay. I am very confused, to be honest. I am trying to emulate Baltech Card Reader Gen 2. https://www.baltech.de/wp-content/uploads/ss_kofax-id-card-reader_071822-SR.pdf
How did you get the report descriptor? I'm assuming you used some tool for that. Is there documentation for it from the manufacturer? I don't have an explanation for why it seems to be 232 bytes and normally would be restricted to 64 bytes, since the PDF you linked says it's a Full Speed device.
Do you have an understanding of the device protocol, or are you trying to reverse-engineer it?
I do note that the datasheet says:
USB HID (works with native drivers included in Windows, Mac, ...
With support for ESP32 and M5Stack devices added, I'd love to see the M5Paper (and its v1.1 and COMM variants) getting some love as well.
Info:
https://docs.m5stack.com/en/core/m5paper
https://docs.m5stack.com/en/core/m5paper_v1.1
https://docs.m5stack.com/en/core/m5paper_comm
The three variants have slight differences in the build (mainly the display being used), but that doesn't make a difference in code.
The base seems to be that of the M5Stack Fire, with some key differences:...
@onyx hinge sorry for the ping, iirc you are working/about to start doing so, on a driver for 24-line screens, let me know if you need some testers, i would also offer help with writing it, but im probably under qualified
I have a waveshare display, and a couple of dev boards (not sure how many have 24 pins tho π¬π)
Adafruit-funded folks don't have these boards so we rely on the community to add and support them. Instructions to add them are here: https://learn.adafruit.com/how-to-add-a-new-board-to-circuitpython
@spare jacinth I have been doing some preliminary work on that, if I understand what a "24-line screen" is. Nothing's usable about it yet, though. You can keep an eye out for a PR when it gets ot the stage where I think it's worth others' time to test it. no ETA π
Aight π
I meant those "non smart" displays which are controlled over 24 (well, some more control signals too) parallel lines
I recently bought one hoping to write a driver myself, using STM's LTDC peripheral
I will also try and PR support for STM32H750, but i probably wont get too far π
HID report descriptor info, [from discord](#general-chat message):
seems like synth.release() isn't working for me
@Dan: it turns out it was a hardware issue with the device which amplifies the outgoing pulse. The charge time increased from milliseconds to minutes! Once fixed, the behavior was not observed. Cheers, -Lee
Glad it's figured out!
I suspected so - this FR is more for tracking necessities :) I've already pushed a branch on my fork which covers most of the baseline hardware, however since the environment is still somewhat alien to me (not to mention my C-fu being weak AF), I'd love to have some oversight and recommendations. I'll be opening a draft PR soon - would you mind to take a look and point out any obvious issues @tannewt?
Me too! Any fix would have been very time consumming.
Ah, I'm still passing in the midi number to press but releasing with the note object
Raises NotImplementedError on all other ports with I2S implementations.
oh that would do it. I wish I'd removed note numbers from the API, but for some simple purposes it can be quite OK
ya, it is nice for simple testing
and yeah it's not an error to release a note that's not playing, so it would silently do something if the object isn't the same one that was initially pressed
it holds all the notes creating a huge mish mash
I'm not super familiar with mclk. Does its frequency need to be set, or can it be automatically derived? Wikipedia (not the best source I know) says "Master clock [is] typically 256 x LRCLK" while one random datasheet I found shows it varying over specific values from 128fs to 1152fs (https://www.digikey.com/htmldatasheets/production/755129/0/0/1/ak4430.html)
Optional[microcontroller.Pin]
does this need to be conditional on if(self->mclk)? Otherwise it might affect a bit in GPR1 that it sholdn't
I'm not super familiar with mclk. Does its frequency need to be set, or can it be automatically derived? Wikipedia (not the best source I know) says "Master clock [is] typically 256 x LRCLK" while one random datasheet I found shows it varying over specific values from 128fs to 1152fs (https://www.digikey.com/htmldatasheets/production/755129/0/0/1/ak4430.html)
In the iMX case, the audio code derives a reasonable value to generate the bitclock that the WM8960 is ok with. I think it should ...
@onyx hinge just fyi, still debugging the asyncio test failures. I updated the library but I am still getting different results (internal confusion still between generators and coroutines).
not stymied yet, just have to figure it out
@lone axle so there is a game jam tomorrow?
I'll be streaming during the lineup tomorrow and working on my game. I'll be continuing work on it during stream(s) over the weekend. I'd be stoked if anyone else wants to work along and share a jam game that they make.
I have a game I wanted to finish
Current status:
- Brought over initial state from M5Stack-Fire (which is the same approach used by M5Stack in their sources published for the M5Paper)
- Assigned pins manually, without any A/D/GPIO pin naming assignment, purely just functions (this will most likely need to be expanded)
- Named and grouped pins based on function, and (mostly) in incremental order, except for where the grouping didn't make it possible (PORT A and PORT B definitions)
- Added (commented out) display i...
Thanks for addressing my review questions!
From discord:
... the one highlighted in red is one packet. The next one in blue. I am using Device Monitoring studio

CircuitPython version
Adafruit CircuitPython 8.2.3 on 2023-08-11; Adafruit MatrixPortal S3 with ESP32S3
Board ID:adafruit_matrixportal_s3
Library Bundle: adafruit-circuitpython-bundle-8.x-mpy-20230815
Code/REPL
import displayio
import board
import rgbmatrix
import framebufferio
bit_depth = 1
base_width = 64
base_height = 32
chain_across = 2
tile_down = 0
serpentine = True
width = base_width * chain_across
height = base_height * tile_down
...
Not sure what's going on with the pygamer target - I didn't really touch any code that could affect it, with the localisation POT being the main exception.
pygamer ja translation is 44 bytes too large. Your message addition should have been localized to your board, hmm.
MicroPython added the .value and .errno attributes to all exceptions, to save time and space, via https://github.com/micropython/micropython/commit/3c4bfd1dec28ffbefc6379dedeaa24feaa2ef373. We did not pick this up. asyncio Python code was depending on pervasive .value.
root@d235fe3c2fdb:/circuitpython/ports/broadcom# make BOARD=raspberrypi_zero
firmware/bootcode.bin: No such file or directory
how do i trigger a shallow clone, or let it reuse my existing .git like worktrees?
ah wait, there is a shallow in .gitmodules ...
Receiving objects: 20% (359882/1799407), 2.72 GiB | 62.68 MiB/s
ah, found the magic flag, --depth 1
I noticed hard faulting as well while working on my message board project, but not as bad as described above. I thought I'd add some details from my experience in case that helps. It happens after about every few resets and really has been an issue since the board definition was added. If code is left running for me, there are no issues.
and i now have circuitpy running on a pi-zero, without an uSD card!
root@d235fe3c2fdb:/circuitpython/ports/broadcom# make BOARD=raspberrypi_zero rpiboot
[clever@amd-nixos:~/apps/rpi/usbboot]$ sudo ./rpiboot -d ../circuitpython/ports/broadcom/build-raspberrypi_zero/rpiboot/
with a minor change the makefiles, i can boot it over usb, from another host
https://gist.github.com/cleverca22/c27b8bc3b2ad07191c5c3ac902d85815 if anybody wants to reproduce it
Nice!
this will work on the zeros, pi4, and pi400
pi4/pi400 has some special differences
make fetch-all-submodules at the top level will limit what it pulls down too
[clever@amd-nixos:~/apps/rpi/usbboot]$ sudo ./rpiboot -l -d ../circuitpython/ports/broadcom/build-raspberrypi_zero/rpiboot/
if you run rpiboot with -l, it will loop (not exit when done)
slap a button on the RUN header, and whack reset every time you compile
and you have the perfect dev cycle
[Fri Aug 18 12:17:38 2023] usb 1-9: new full-speed USB device number 34 using xhci_hcd
[Fri Aug 18 12:17:38 2023] usb 1-9: New USB device found, idVendor=0a5c, idProduct=2763, bcdDevice= 0.00
[Fri Aug 18 12:17:38 2023] usb 1-9: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[Fri Aug 18 12:17:38 2023] usb 1-9: Product: BCM2708 Boot
[Fri Aug 18 12:17:38 2023] usb 1-9: Manufacturer: Broadcom
[Fri Aug 18 12:17:40 2023] usb 1-9: USB disconnect, device number 34
when you connect a zero to your usb port, it will show up as this
rpiboot then sends all of the files over, and lets it boot
@slender iron so, if i wanted to properly integrate 2d sprite accel into this, where would i edit circuitpython?
probably shared-modules/displayio
and how would i bake some python into it, to run on boot:
CIRCUITPY drive could not be found or created
without a uSD card, it has nowhere to store the .py files
we've never really done that
this might still work, if the card is present, but missing bootcode.bin ....
ya, I think so
you may want to replace shared-modules/displayio with a ports/broadcom/common-hal/displayio
we have a couple cases where we do that. have a generic version and a port specific one
makes sense
2 .c files, with a shared .h
and then just call whichever implementation knows how the board works
same as HCD's in tinyusb
ya, the .h for the api is usually in shared-bindings
it still boots, but it fails to find CIRCUITPY drive
how should it be partitioned?
supervisor/shared/safe_mode.c ...
// Check whether CIRCUITPY is available. No need to reset to get safe mode
// since we haven't run user code yet.
if (!filesystem_init(get_safe_mode() == SAFE_MODE_NONE, false)) {
set_safe_mode(SAFE_MODE_NO_CIRCUITPY);
}
reading
ok, i see the SD interface pins
i see it parsing and modifying the MBR
@slender iron but its not clear what partition its expecting things to be on
I don't remember
at a glance, i think its expecting the fat to be 256mb? and then it uses "unused" space after that partition!!
// If the second partition exists, then use it (possibly after reformatting it.)
if (i == 1 && part_sector_count > 0 && part_first_lba > 0) {
sector_count = part_sector_count;
first_lba = part_first_lba;
} else if (i > 1 && part_sector_count > 0) {
sector_count = 0;
}
ah, thats better
are any of you using os.chdir() in your programs? it seems that the current dir seems to be surviving at least some time after a reload, because if you chdir to a directory that contains a code.py file, and do a reload, it will run that file, instead of the one in /
I'm trying to figure out if this is a bug or intentional behavior?
i changed part 2 to 128mb, type c, and formatted it fat
circuitpy is now happy
@onyx hinge do you remember where this commit partly by jimmo came from? https://github.com/adafruit/circuitpython/pull/7059/commits/55169e0b4db968c037fdd2ef6a359fa3a485a7dd, part of #7059 (by you). It is not appearing upstream that I can see (!). I just made an equivalent task.py change to fix something and then discovered it was also fixed here (but not in our separate library). If you are watching streams, no problem.
[Fri Aug 18 12:42:19 2023] scsi 8:0:0:0: Direct-Access Raspberr Zero 1.0 PQ: 0 ANSI: 2
[Fri Aug 18 12:42:19 2023] sd 8:0:0:0: [sdc] 1 512-byte logical blocks: (512 B/512 B)
[Fri Aug 18 12:42:19 2023] sd 8:0:0:0: [sdc] Write Protect is off
[Fri Aug 18 12:42:19 2023] sd 8:0:0:0: [sdc] Mode Sense: 03 00 00 00
[Fri Aug 18 12:42:19 2023] sd 8:0:0:0: [sdc] No Caching mode page found
[Fri Aug 18 12:42:19 2023] sd 8:0:0:0: [sdc] Assuming drive cache: write through
[Fri Aug 18 12:42:19 2023] sdc:
[Fri Aug 18 12:42:19 2023] sd 8:0:0:0: [sdc] Attached SCSI removable disk
[root@amd-nixos:~]#
[root@amd-nixos:~]# mount -v /dev/sdc /mnt/
mount: /mnt: mount(2) system call failed: Cannot allocate memory.
dmesg(1) may have more information after failed mount system call.
[Fri Aug 18 12:45:01 2023] EXT4-fs (sdc): unable to read superblock
@slender iron circuitpy does advertise itself as MSD after booting, but i cant mount it, and it lacks a partition table
@onyx hinge I was confused that the uasyncio_task_exception.py test did not exist upstream.
weird, i tried to eval board in the REPL, and the screen just blanked, and its not responding
import board does the same
help as well
makes it hard to try to do anything, when everything hangs the system
it's been a while since I used the broadcom port. it could be broken
where could i add more print statements to try and debug it?
the CDC uart is at least working
if i run anything in the repl (over the cdc uart), the screen clears (but the top line stays)
in the uart, it also clears, and doesnt print anything or respond to anything
opened the wrong minicom and accidentally discovered, the hw uart also works
ok, so it seems to be running pyexec_friendly_repl()
to print to cdc do mp_printf(&mp_plat_print, <format string>, <args>)
mp_hal_stdout_tx_str("parsing and compiling\r\n");
ret = parse_compile_execute(&line, parse_input_kind, EXEC_FLAG_ALLOW_DEBUGGING | EXEC_FLAG_IS_REPL | EXEC_FLAG_SOURCE_IS_VSTR, NULL);
if (ret & PYEXEC_FORCED_EXIT) {
return ret;
}
this does print that msg out, and then hangs
0000cbe0 20 0a 3e 3e 3e 20 66 6f 6f 0a 70 61 72 73 69 6e | .>>> foo.parsin|
0000cbf0 67 20 61 6e 64 20 63 6f 6d 70 69 6c 69 6e 67 0a |g and compiling.|
0000cc00 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a |................|
*
0000e090 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 30 3b f0 |.............0;.|
0000e0a0 9f 90 8d 44 6f 6e 65 20 7c 20 38 2e 32 2e 30 2d |...Done | 8.2.0-|
ah, its not clearing the screen
its printing over 5kb worth of \n's
See the targets for make fetch-all-submodules and make fetch-port-submodules. They try to do a partial blobless clone if the feature is available (it's recent in git), or do a shallow clone instead. partial is better because it's transparent to the user.
i have gotten past the submodule part
just filling in for next time
i'm now at the point where it just spams \n's if i try to run anything in the REPL
mp_hal_stdout_tx_str("g\r\n");
if (exec_flags & EXEC_FLAG_SOURCE_IS_ATEXIT) {
mp_hal_stdout_tx_str("c\r\n");
atexit_callback_t *callback = (atexit_callback_t *)source;
mp_call_function_n_kw(callback->func, callback->n_pos, callback->n_kw, callback->args);
} else
#endif
{
mp_hal_stdout_tx_str("e\r\n");
mp_call_function_0(module_fun);
}
mp_hal_stdout_tx_str("f\r\n");
only prings g, and e
https://github.com/micropython/micropython/pull/8929 it appears to be in a non-merged PR
CircuitPython version
Adafruit CircuitPython 8.2.3 on 2023-08-11; Fluff M0 with samd21e18
Code/REPL
# /code.py
import supervisor
import os
print("changing directory to /test")
os.chdir('/test')
supervisor.reload()
```python
# /test/code.py
import supervisor
import os
print("inside /test")
print("__file__=", __file__)
print("cwd=", os.getcwd())
### Behavior
Auto-reload is on. Simply save files over USB to run them or ...
Note that changing the directory back to / before doing the reload doesn't seem to work for some reason.
As a workaround in the short term, are you already using https://docs.circuitpython.org/en/latest/shared-bindings/supervisor/index.html#supervisor.set_next_code_file ?
As a workaround in the short term, are you already using https://docs.circuitpython.org/en/latest/shared-bindings/supervisor/index.html#supervisor.set_next_code_file ?
Doesn't change anything. This code has the same problem:
import supervisor
import os
print("changing directory to /test")
os.chdir('/test')
supervisor.set_next_code('/main.py')
supervisor.reload()
@makermelissa Yes same, during the process it would hard fault occasionally and reset would help. At some point hard reset happened more and more frequently until it hard faults every single time and cannot be used... at least not with matrix panel related code. I have not tried to go back and do a basic hello world or non-matrix panel related code.
I think Windows itself was detecting the continual hard resets and at some point refused to allow CIRCUITPY to even connect. No Com port in...
@onyx hinge I pushed asyncio fixes. I have a draft PR to the library, and that PR's latest commit is checked out as the submodule. we might leave it that way until the v1.20 merge before updating the library, though anyone using the build would need the PR branch. would need to test the asyncio library against 8.2.3 before merging.
Remaining failing tests are: extra_coverage import_mpy_invalid import_mpy_native import_mpy_native_gc. I think this is all the ones you fixed already but are awaiting my latest push before you rebase?
@tulip sleet OK, I'll rebase my local code and see what's left.
and I need to remember to have lunch before we stream again. hangry streaming == nono
yeah, I just ate
locally I have this from make test: ```894 tests performed (37612 individual testcases)
894 tests passed
41 tests skipped: atexit_test btree1 btree_error btree_gc ffi_callback ffi_float ffi_float2 framebuf1 framebuf16 framebuf2 framebuf4 framebuf8 framebuf_palette framebuf_subclass import_mpy_native_gc nanbox_smallint nvm_not_present nvm_present sys_settrace_features sys_settrace_generator sys_settrace_loop uasyncio_micropython uasyncio_threadsafeflag ucryptolib_aes128_cbc ucryptolib_aes128_ctr ucryptolib_aes128_ecb ucryptolib_aes128_ecb_enc ucryptolib_aes128_ecb_inpl ucryptolib_aes128_ecb_into ucryptolib_aes256_cbc ucryptolib_aes256_ecb uctypes_sizeof_od uhashlib_md5 uhashlib_sha1 umsgpack_pack uselect_poll_basic uselect_poll_udp usocket_tcp_basic usocket_udp_nonblock ussl_basic ussl_keycert
these are expected skips? uasyncio_micropython uasyncio_threadsafeflag
i don't have those at all. I removed framebuf completely, etc
OK, wonder why I'm not picking that up. I'll run a git clean in tests/
I put back uasyncio_threadsafeflag,
i'm having this pre-commit skew again. uncrustify wants to add a space after a comma in a file whose changes I don't have locally. (Kattni added SD_CS pin to Metro ESP32-S3). I don't know why pre-commit in her PR didn't catch that before.
i could merge again from upstream, hmm
"pre-commit run --all" picked up changes in a number of files for me, not just one.
+ LL_GPIO_SetPinPull(pin_port(self->pin->port), pin_mask(self->pin->number), LL_GPIO_PULL_UP);
I agree that space should be there!
OK I'm holding off pushing anything
π΅βπ« was dealing with four different versions of asyncio Python code
@onyx hinge many fewer tests are being skipped locally than in CI, hmm...
uasyncio are not being skipped locally
for example
i cleared the CI caches, faintly possible it was the submodule caches??
re-running pre-commit and build
I was wondering if the frozen submodule was populated
that would do it too: asyncio import failed
so it would SKIP
since asyncio commit is on a branch, maybe it's not pulling the branch??
will wait for test runs again
Just realized it might help if I specify I'm using it with 4x 64x32 5mm pitch panels with a 5v 18A meanwell PSU.
https://github.com/adafruit/circuitpython/actions/runs/5884577704/job/15959570420
56 tests skipped: ... uasyncio_await_return uasyncio_basic uasyncio_basic2 uasyncio_cancel_fair uasyncio_cancel_fair2 ...
This was frommainbranch so maybe it's a pre-existing condition
Run python tools/ci_fetch_deps.py tests
Target: tests
Submodule tags[Y]: []
Submodule tags[N]: ['extmod/ulab', 'lib/', 'tools/']
ci_fetch_deps for tests needs to include some additional submodules
ehhh
so ticks and asyncio
yes that may be the minimum set to let the async tests run
go ahead if you feel so inclined
OK, pushed. There will probably still be failures with "native" module tests, we'll need to decide whether to fix or punt but I want to see what happens in CI first
there is definitely unsupported native stuff. objgenerator is not complete w/r/t native
I think I need help compiling CircuitPython for the Rotary Trinkey, with analogio included (and maybe excluding rotaryio). I've compiled before for the QT Py RP2040, but that was around a year ago, and I've forgotten...most of it... I've got the most recent CircuitPython off Github.
So questions:
- What are my options for controlling what modules are built in?
- How do I compile for a specific platform (the Rotary Trinkey specifically) and then find the uf2 file for it?
@serene token this file specifies how the rotary trinkey's built in modules differ from the "standard" based on the microcontroller type: https://github.com/adafruit/circuitpython/blob/70ce576390c7b21007b1f75f16e6fc591c0f61d7/ports/atmel-samd/boards/adafruit_rotary_trinkey_m0/mpconfigboard.mk#L13
if you're building locally then the uf2 file is in build-<boardname>/firmware.uf2
Make sure we only look for the files in the root directory.
Fixes #8295
Awesome! Do I just need to make or do I need to specify which board to build for?
you specify the board. There's a guide about it https://learn.adafruit.com/building-circuitpython but feel free to ask if it doesn't get you where you need to be!
That helps. I think that covers everything I need. Do you know if the board will have room for analogio if I remove rotaryio, or will I need to exclude more?
I don't know, I'd have to find out by trial and error