Thanks! Scott noticed this for other types but we missed these.
#circuitpython-dev
1 messages · Page 50 of 1
@slender iron Re Pants: Pants V1 says it supports C/C++ (and many others). But Pants V2 does not say it supports C/C++ (yet)
I was running into a similar issues with failing to boot on my own custom board built on the RP2040. It seemed to be random whether it would fail to boot at all, boot into safe mode, or boot into normal CircuitPython. I think I traced my issue down to an option that gave the crystal oscillator a bit of extra time to start, by adding this line to ports/raspberrypi/boards/<board-name>/pico-sdk-configboard.h:
// Allow extra time for xosc to start.
#define PICO_XOSC_STARTUP_DELAY_MULT...
@tylercrumpton Thanks, yes, this extra crystal oscillator startup time is significant, and we would really recommend setting it as a default for any board.
@tulip sleet I think someone started cc support in v2
It looks pretty extensible from python too which is nice
i will take a closer look 👍
The environments feature looks handy for setting the toolchain
And they have a way of setting defaults for subfolders which is like our port level defaults
bundles are a bit messed up because there is not 9.x-mpy bundle because there was no reason to build one. Also community bundle failed for other reasons (fixed that). Maybe I will force a bundle change somehow with a gratuitous library change or adding the Test library
meanwhile making circup more robust. it is upset at no bundles
so does Pants substitute for all the makefiles, or for the config stuff, or what? you were thinking of ninja a while ago
or it's a substitute for our CI actions and python scripts
There is likely a library that needs a release
All the makefile stuff
Both the building part and the config part
Ninja would only do building. We’d need python on top of it
Maybe something like toml is a better way to do config. But pants has BUILD files that are python but can’t import anything. Not sure if they can do all of Python or not
hmm, you mean they are fake Python or they are just not allowed to import
I think it’s real python but I’m not sure
Definitely says it disallows import
I like that they call it build metadata
why disallow import, for security reasons or to prevent circumventing dependency analysis?
sorry to keep you here -- do you know how to list which libraries need releases? there is a script, but where??
i'm looking there, but not seeing it. Eva had scripts
I did reviews recently for foamyguy
ok, I found display_text needed a release
agh, python 3.12 is preventing the release.
I've thought about presenting a FAT16 filesystem that would appear to be larger than the actual capacity, but with a large number of bad blocks. The File Allocation Table has a mechanism for marking bad blocks. I did some experiments on this, but haven't made it a high priority. It's not so simple.
As @dhalbert noted earlier, whether an OS mounts a FAT volume as FAT12, FAT16, or FAT32 is determined by its total number of clusters. An OS will calculate the total number of clusters from in...
@bill88t notes
Both boards refuse to show up on android, even after I fsck them.
Android may be looking at the fake MBR that CircuitPython presents as the first sector of the flash device, seeing that it's FAT12, and giving up before attempting to mount the filesystem. See flash_read_blocks()
We now error at build time if a language should have been 8 bits but isn't
CircuitPython version
9.0.0 Beta. NA?
Code/REPL
# NA
Behavior
https://circuitpython.org/board/espressif_esp32c6_devkitc_1_n8/ HEADING says it's for ESP32-S3-DevKitC-1-N8.
It shows up in search results(https://circuitpython.org/downloads?q=esp32-s3-devkitc-1-n8) too:

This is probably a typo or misnaming in the files that build the website. Transferring to the circuitpython.org repo.
What version of macOS are you using?
Have you tried to reformat the filesystem (after saving your work, if necessary):
>>> import storage
>>> storage.erase_filesystem()
Then write some files on one or the other. Then, does it work on both Mac and Linux?
I erased the flash, then flashed combined.bin and after a reset I copied the .uf2 to the drive
Since the OS "thinks" that all of the volume's clusters are real, it's possible for it to attempt to read or write non-existent clusters. For example, a dd of the volume will ignore the bad markings in the FAT and plow ahead into non-existent clusters. OS caching and read-ahead might also be a problem.
To solution to this problem is to make flash_read_blocks() and flash_write_blocks() aware of ballooning. Then, on a read from the ballooned area, return a block of zeroes. On a write t...
I wonder if https://github.com/asterics/esp32_mouse_keyboard provides some ideas or inspiration
On a write to the ballooned area, ignore the write.
There should only be such a write if the OS were ignoring the bad cluster bits, such as the dd example, right? I would hope that OS reformatting of the volume (which we don't recommend) would not clear those bits.
If you're running MacOS Sonoma, you may experiencing https://github.com/adafruit/circuitpython/issues/8449
OS reformatting with mkfs or similar will kill ballooning completely and revert to FAT12 with all its original problems. Certainly not recommended. On the other hand, dd of the entire volume to a host OS file and back will work correctly.
CircuitPython version
Adafruit CircuitPython 9.0.0-alpha.2 on 2023-10-27; ProS3 with ESP32S3
Code/REPL
# Test I2C between UM ProS3 and UM TinyPICO RTC shield (MCP7940)
# Circuitpython V 9.0.0.alpha-2
# Testing the function: i2c.write_then_readinto()
# by Paulus Schulinck (Github @PaulskPt)
#
import board
import rtc
import mcp7940
import time
import sys, os
import wifi
import ipaddress
import socketpool
import adafruit_ntp_v2
my_debug = Fa...
[adafruit/circuitpython] New comment on issue #8539: CPY script halts at i2c.writeto_then_readfrom()
The test above is an extract of the code in my repo at: https://github.com/PaulskPt/Circuitpython_MCP7940.
I created this test because of the 'lock-up' that occurred with CPY version: Adafruit CircuitPython 9.0.0-alpha.2 on 2023-10-27; ProS3 with ESP32S3.
See https://support.microsoft.com/en-us/topic/default-cluster-size-for-ntfs-fat-and-exfat-9772e6f1-e31a-00d7-e18f-73169155af95 for Microsoft's take on valid FAT filesystem geometry.
I'm running Ubuntu and wasn't able to reproduce this either by reflashing CP 8.2.7 or by flashing Micropython, filling the file system and then reflashing CP 8.2.7. In both cases the CP file system look normal when mounted as CIRCUITPY from linux.
Is the goal with the circuitpython asyncio implementation to remain as close as possible to micropython's and so PRs to support features like wait and Queue wouldn't be merged?
Was about to spend time cleaning up a Queue implementation PR and a separate refactoring so wait could also be included -- but looking at the various files it feels like that might be the case?
I see reading through some other PRs there's also a want to keep the mpy footprint as small as possible
not necessarily. Internally we already have __await__(), and MicroPython doesn't have that.
See https://github.com/adafruit/circuitpython/pull/7711
https://github.com/adafruit/Adafruit_CircuitPython_asyncio/pull/40 for some initial work to make things more like CPython. Sounds like you might have already seen them.
We are trying to keep the footprint small, but not necessarily as small as MicroPython.
Gotcha. Yeah, I did see that PR. Not a hundo percent sure why it was closed or if there was more about it. I'll open a few PRs and we'll see how they feel. :)
Was there recently any change to CI build system for libs for CircuitPython?
I see that it fails importing a module:
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
which suggests there was an update to Python 3.12.
It is not limited to CircuitPython: https://github.com/pypa/pip/issues/12179#issuecomment-1649148523
There are a lot of problems breaking many builds because the 3.x Python on GitHub CI is now 3.12.
We are fixing them one after another.
I assume it is not possible to select previous Python version? That is not a very well thought move from GitHub side.
it is possible, but some of our yaml files had "3.x" instead of a specific version.
we are pinning them to 3.11 for now.
Ok, I see. Thank you 
Also circup is broken, and I have a fix for that so it will not give up so quickly.
With the community bundle?
I would love to see a CircuitPython build for Elite-PI from keeb.io (here)[https://keeb.io/products/elite-pi-usb-c-pro-micro-replacement-rp2040]
The Elite-Pi is strikingly similar to the 42. keebs Frood, with just a couple of pins different in layout.
Hopefully not to difficult to port, I'm going to try to implement it myself and put together a PR
As per #8540
I have tested this locally and successfully compiled and intsalled Circuitpython v9.0.0 alpha and v8.2.7 on my Elite-Pi MCU
Can anyone officially confirm if native modules (aka Micropython native modules) works in CP?
Also, are ESP32 native emitters (aka Viper) supported? I can't seem to find anything official on googley about either. Thanks in advance!
viper worked in the past, but we haven't tested it for a long time. theacodes used it. I think there may be some stumbling blocks to native modules -- also not tested.
Ok, that's better news rthat I expected - atleats it's not specifically being excluded. Gives me some hope I might be able to get something going for my BlizzardS3 "3D" project. Thanks Dan!
I did get some native code (AHRS calculation) running I think for the SAMD51. I eventually got it going (with some help from Jeff) but it isn't well document even for micropython (that I found). I can probably find my old examples if they weren't accidently removed if you ever want to see.
Ok, it seems that @micropython.native is supported, but when I try to use viper I get...
SyntaxError: invalid micropython decorator```
Michael is about to try to get native modules going - I'll report back on this success/failures later.
@tannewt @dhalbert sorry for the delay since your last feedback. I finally worked out a memory management issue leading to a crash. Now this seems quite happy and I'm able to publish TXT records along with announcing an mDNS service. (Which for me is the basis of HomeKit Application Protocol support over HTTP)
Ok, looks like native code in CP is not supported
ValueError: native code in .mpy unsupported
actually @micropython.native is not enabled in CP 9.x - but is in 8.2.x
SyntaxError: invalid micropython decorator in CP built from master.
I'm not really sure what's involved with enabled it all again, but if I find some spare time, I'll take a look.
// compiled, it just passes through the function unmodified.```
macOS Ventura, v13.6
Ubuntu 22.04.3 LTS, kernel 5.15.0-87-generic
This may or may not be relevant, but when flashing circuitpython yesterday, I found that I couldn't simply drop the file into the RPI-... mount via nautilus. It complained of permissions issues, which factually there were none. I went into the terminal to copy the uf2 file onto the pico w, without needing sudo. Not sure what to make of that.
OK, let's see if I can recreate this. I'm starting from having a working files...
Most bits automatically generated by
git grep -l -F 'translate(' -- "**/*.[ch]" | xargs sed -i 's/\<translate(/MP_ERROR_TEXT(/g'
This also allows dropping differences in ulab for circuitpython (added to existing circuitpython 9 pull request at https://github.com/v923z/micropython-ulab/pull/647)
[adafruit/circuitpython] New comment on issue #8539: CPY script halts at i2c.writeto_then_readfrom()
Today I re-flashed the UM ProS3 with the latest stable CPY: V8.2.7. Same problem. I added an i2._scan(). That reported:
i2c device address: 0x3d
i2c device address: 0x6f
The 0x3d is an Adafruit 1.12in 128x128 mono OLED display (SH1107)
The 0x6f is the UM TinyPICO RTC shield (MCP7940)
[adafruit/circuitpython] New comment on issue #8539: CPY script halts at i2c.writeto_then_readfrom()
Next I re-flashed the UM ProS3 with CPY V8.2.6. Same result. I am afraid that the problem is on my side. I close this issue.
[adafruit/circuitpython] New comment on issue #8539: CPY script halts at i2c.writeto_then_readfrom()
I was thinking this was showing an I2C bug in 9.0.0-alpha.2. Why do you think the problem is on your side if it works in 8.2.x but not in 9.0.0-alpha.2? If you can generate simple test program, that would be great. Maybe open a new issue. Thanks.
Happy Monday and Group hug all! I'm still out for a couple of weeks.
There is some inconsistency in the Lolin S2 Mini plate.
The chip itself may have freely configured pins as i2c, sleep, uart, and the tile itself has no descriptions, only numbers.
Some of the pins were defined as compatible with the Lolin D1 Mini.
Similarly with S3 Mini, where there are only numbers directly on the tile, but in Pinout there are descriptions: https://www.wewos.cc/en/latest/s3/s3_mini.html
SCL, SDA, SCK, Miso, Mosi, but not RX and TX (SS - I suggest skipping) were...
Are you interested in doing a pull request yourself? That would be great. Most of us don't have a board to test.
In Espressif chips there are usually 2 DAC pins available. In the uC of the ESP32-S2, ESP32-S3 family, the majority of the pins can be used freely as SPI, UART, but this does not apply to DAC.
The DAC examples uses A0 labels (from M0), but this is not true for S2: DAC1 = IO17, DAC2 = IO18 (A0 = IO3).
By the way: What do you think about the 'TOUCH' labels? It would be a nice option so that you can see ava...
[adafruit/circuitpython] New comment on issue #8539: CPY script halts at i2c.writeto_then_readfrom()
Thank you Dan. As I wrote (maybe not clear enough), the problem also appeared this morning using V8.2.7 and V8.2.6. I am checking my script and then start a new issue if necessary.
[adafruit/circuitpython] New comment on issue #8539: CPY script halts at i2c.writeto_then_readfrom()
Ah, sorry, I mistakenly thought that the I2C scans were indicating it was working in 8.x.x. No problem.
The boot loader doesn't erase the entire flash unless the size of Circuit Python changes. Performing an ESPTOOL flash_erase before flashing can be a good idea when encountering file system problems.
This one is the ESP32-C6-DevKitC-1-N8. I'm submitting a PR to fix the name.
Fixes #1271. Espressif and their confusing names...
might be worth checking if this is any different after the idf upgrade.
My opinion is that we shouldn't support native code in mpy because it'll be a support burden because it increases the API surface of CP including caring about cpu architecture.
The native emitter would be ok to turn on. It is off by default but a couple of boards do enable it.
<@&356864093652516868> We'll have our weekly meeting in about 90 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/1Pz4-FdEH1Du5bWghjJ7dUheGoq61ijuFpowd5qFlIFI/edit -- I look forward to everyone's updates!
Google Docs
CircuitPython Weekly Meeting for October 30, 2023 <> Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates early. During the meeting, we go through them as a round robin sorted by username. If you can’t make the meeting and would still like to ...
I think the reason this 'grew' some builds is that before this strings marked with MP_ERROR_TEXT weren't actually translated due to the regular expression in makeqstrdefs.py.
Ran some experiments and found that Android does support FAT12, it just doesn't like partition type x01 (FAT12). By changing the partition type to x0e (FAT16 LBA), Android successfully mounts a FAT12 filesystem. Tested by modifying the fake MBR returned by CircuitPython.
A useful way to view the diff is to check out the PR branch locally and
git diff -I'(translate|MP_ERROR_TEXT)\("' origin/main HEAD
this suppresses any before/after line which is like translate(" or MP_ERROR_TEXT(".
diff --git a/Makefile b/Makefile
index 88f8c54ad2..c834e413b1 100644
--- a/Makefile
+++ b/Makefile
@@ -227,7 +227,7 @@ pseudoxml:
all-source:
locale/circuitpython.pot: all-source
- find $(TRANSLATE_SOURCES) -type d \( $(TRANSLATE_SOURCES_EXC) ...
Looks good but it looks like you'll need to merge main into this. (Maybe the 8.2.x versions of these boards were merged in with 8.2.7)
issue 8533 is an easy core PR if folks want to make one
I'm trying to build CP on my new mac for the first time. When building a port I get an error about arm-none-eabi-gcc not found. I went make to the Mac instructions. They reference going to the Linux instructions and looking for the right mac build. Thinking there had to be a better way, I found someone had made a MacOS Homebrew cask for gcc-arm-embedded. Does anyone know if this method would work?
Had you recently copied the file over? Sometimes the host OS caches writes. Running sync on Mac or Linux can help.
I think I use that on my mac
It seems to get further with this gcc installed, but then failed on a type error in the shared-module/warnings/__init__.h file. line 29.
29 | void warnings_warn(const mp_obj_type_t *category, const compressed_string_t *message, ...);
I can't tell if the issue is from my gcc or just a bug in the port and I should try to compile an older version from a branch (like the latest 8.x)
just now? ... yep, that fixed it! thanks.
Since this works, do you think we could update the MacOS instructions page to say to use homebrew if you are using the standard arm boards?
@tulip sleet probably has an opinion about it
generally the arm sourced gcc is what we "officially" build with
That is good, if you can choose the version
board names pins based on the silkscreen of the board. So, this naming is up to the folks who design the board. You can also use microcontroller.pin to access the espressif names of the pins. That'll be consistent across boards.
One question about the USB VID and PID
Where did you get this USB PID? Most RP2040 PIDs come from raspberry pi: https://github.com/raspberrypi/usb-pid
I will not participate as I have no notes, and had no CP activities since... weeks.
I just want to highlight that Europe just had their Daylight Saving switch, so all Adafruit streaming and meeting will be one hour ealier for a few weeks... until USA does it's own time change.
Maybe I will be able to join Show and Tell. 😉
Thanks for following up. Are you willing to have this in 9.0.0/main instead of 8.2.x? It's an additional feature, so 9.0 would be better. 8.2.x is really only new boards and bug fixes atm.
brew info gcc-arm-embedded shows all of the files that are part of the toolchain. Currently 12.3.rel1. It looks like there aren't previous versions because this particular formula migrated from a different filename.
i can revise the build guide so for gcc12 and up, it says to use brew
Is that doc built out of the github repo? If so I could make a PR for it.
no, it's a CMS system. You could use the "Feedback" link in the left sidebar to make a suggestion
ah. okay. thx.
we'll get started in about 2-3 minutes
@inland tusk I think you put yourself in the wrong channel
Hi @idle owl !!!
GitHub
This is CircuitPython 9.0.0-alpha.2, an alpha release for 9.0.0. It has significant known bugs, and will have further additions and fixes before the final release of 9.0.0.
WARNING for nRF52 boards...
A portable, combination scanner/printer for converting QR code menus into physical copies.
Ultimately a very simple build! tl;dr:
- Runs on a rechargeable 12V battery.
- Uses a Tiny Code Reader (from Useful Sensors) for QR scanning.
- Uses a Seeed Studio XIAO Esp-32 S3 to read from the scanner, communicate with the backend, and drive the therma...
now is green! mark out of draft when ready
macOS Sonoma acts differently than previous versions: it delays writes, sometimes significantly. This is a new and significant problem: see #8449. As @tannewt says, sync can help.
how are we fixing the 3.12 issues in libraries? re: https://github.com/adafruit/Adafruit_CircuitPython_PCF8575/pull/3
Would someone be able to summarize for me the CircuitPython Hacktoberfest results?
We pinned it to 3.11, so it should work if it's re-run.
😼
classic off by one error
Not hearing anything
I can hear deshipu now. You might need to try reconnecting Charles
still Not hearing anything
I can hear eightycc
NINA 1.2.2?
yes
1.2.3 (if we have it), does not work
at least in the Arduino version of NINA-FW. I'm looking at what changed to cause it to stop working
@idle owl - I completely dog-eared the fifth edition of this reference: https://www.amazon.com/Master-Handbook-Acoustics-Seventh-Everest-dp-1260473597/dp/1260473597/ref=dp_ob_title_bk
Doesn't sound like a lot (sound pun)
😊 👋🏻
I think there may potentially a few variations that all report version 1.2.2 as well. So some can work, but others raise the error.
Ooooh, nice! Thank you!
The description makes it seem like a lot of it is how to build things right in the first place. How much does it cover dealing with existing structures etc?
I used it to characterize studio spaces to retrofit diffusers and absorbers based on the analysis
yeah, the versioning was fuzzy before 1.4.0. NINA_W102_Feb_17_2018.bin == 1.2.2 I believe (and I think devices still ship with that). I don't seem to have any of the files between 1.2.2 and 1.4.0 on devices or in my filesystem, though there may be some in the wayback on Discord (...1.3.0 was WPA Enterprise; some very early devices I think shipped with 1.2.1, but it had an SSL issue that was quickly fixed)
Got it. Thanks!
Understanding the resonance of the space is critical when selecting the retrofit devices. I ended up primarily using diffusers instead of absorbers except when a couple of bass traps were needed.
unless the size of Circuit Python changes
How is that defined? I re-flashed 8.2.2, as it is literally a different size than 8.2.7, but I have the same filesystem.
Performing an ESPTOOL flash_erase before flashing can be a good idea when encountering file system problems.
I have bounced back and forth between micropython and circuitpython, with no erasing of storage. This bug seems like circuitpython was trying to make a filesystem out of old micropython data. But without a way ...
Fascinating. I put up those high density felt acoustic panels, and two types of weather stripping. The two types is because one is better than the other, but the better one is too thick for part of my very-apparently-not-straight door. The change is significant. I'm going to panel my housemate's office door as well, but not weather strip it because it's typically open, and we have cats. That said, my wife's office is directly below me and we still haven't resolved that. This reference could help!
Yes, weatherstripping and sealing any seemingly small holes will really help. It's surprising how much sound can come through.
[adafruit/circuitpython] New comment on issue #8539: CPY script halts at i2c.writeto_then_readfrom()
Further investigation revealed that: yes, it was a bug in my mcp7940.py file.
I walked the line between fully sealed versus being able to close without a significant amount of effort. I'm happy with the results.
Thanks for hosting, Liz! Thanks everyone!
Thanks
Thanks!
Thanks for hosting Liz, Have a great week everyone!
thanks folks!
@errant grail Thanks again for the recommendation!
You're welcome!
esptool is for Espressif boards, not RP2040, which I think is what @epeay is using.
For RP2040, use the nuke UF2 to erase all of flash: https://cdn-learn.adafruit.com/assets/assets/000/099/419/original/flash_nuke.uf2
How is that defined? I re-flashed 8.2.2, as it is literally a different size than 8.2.7, but I have the same filesystem.
I'm really not the best source but my understanding was that Circuit Python reserves an area of flash for the CP code, as long as that area doesn't change size the reset of flash isn't reformatted. The reserved space doesn't appear to change very often.
Yes but I am pretty sure I had reset the board a few times in my testing. On Oct 30, 2023, at 11:10, Dan Halbert @.***> wrote:
macOS Sonoma acts differently than previous versions: it delays writes, sometimes significantly. This is a new and significant problem: see #8449. As @tannewt says, sync can help.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
Linux does not care for the partition type/filesystem mismatch, so simply changing the partition type is not a viable fix. We do now know the reason for Android refusing to mount the CP filesystem, but will need ballooning or something similar for a fully compatible fix.
<@&356864093652516868> 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/1DPmDRY-Tt5awLeP4GrmR6ofnTgVacjJYlBTbvBeHYoM/edit
Google Docs
CircuitPython Weekly Meeting for November 6, 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...
I got it from here:
though I'm now beginning to realize that this might be a mistake. Although i compiled this board in QMK targeting the Elite-Pi, i don't think this board was actually designed for the Elite-Pi... I think that might be the USB VID for the pro micro...
What should I do in this circumstance? I don't see the Elite-Pi listed in the usb-pid repo you linked to
The pre-existing board most similar to the Elite-Pi is the 42. keebs Frood, whose USB PID also isn't listed in the the usb-pid repo
thoughts?
[adafruit/circuitpython] New comment on issue #8539: CPY script halts at i2c.writeto_then_readfrom()
Latest test using: Adafruit CircuitPython 9.0.0-alpha.2-5-g6b62df4054 on 2023-10-29; ProS3 with ESP32S3
runs OK
This looks absolutely fine, and will open up more things to translate. Thanks for finishing off the differences from upstream.
@lone axle I am trying make a release on the CircuitPython_Org_Bundle. I have a PR to update its use of Python. But the PR runs build.yml to test, and it was complaining about a gawk error: \; is not a regexp escape. I fixed that, but build.yml is virtually the same as the one in the community bundle repo, which is not currently failing. After I fixed that but now it thinks some library in the bundle has no tag: see https://github.com/dhalbert/CircuitPython_Org_Bundle/actions/runs/6698769554/job/18201550163.
I am not sure if both of these bundles' .yml's are messed up or this is barking up the wrong tree. Their yml's are pretty different than the ones for the main adafruit bundle.
I have to go buy some Halloween candy. Will be back in a while.
arm released gcc 13 today!
(and I'm fighting code size issues on CI but not locally)
well ,we could try ti
I think that warning does get printed when building the community bundle too: https://github.com/adafruit/CircuitPython_Community_Bundle/issues/187 it's come up a few times as a "red herring" when looking for other problems.
I was just doing some builds of the community bundle locally as well and I do see that warning output. But my builds suceed inspite of it.
I believe it originates in one of these lines: https://github.com/adafruit/CircuitPython_Community_Bundle/blob/bbb29f432cd1383f387101fe11e4da06de48ccc7/build.sh#L31-L32 but I do not understand them at all.
if you change \: to : it goes awy, so that's a minor fix.
yeah, exactly.
so maybe there is just something wrong with the commit chosen for displayio_annotations now, though I thought it would update. Maybe this is irrelevant and we should just merge my PR anyway, and then make a new release, which will update the libraries? There are are couple of libraries that actually will update -- a new bundle was never built after they were updated.
When we went to 8.x, I kicked the can down the road hacked this bundle by just copying the 7.x bundle to 8.x, but I can't do that anymore.
I'll review and merge that PR.
I'll let you do the release if you'd like. I see there is a new tag created. I usually create the tag on the release page, I'm not sure I know the right way to do it if the tag is created ahead of time and don't want to do it wrong and throw further wrenches into it.
If a fork branch and/or entire fork is deleted out from under a closed but unmerged PR, will the code changes still be available in the PR?
(once it's merged, they stick and GitHub suggests deleting the branch)
I don't think so but aren't sure
I'll ask in #help-with-git , maybe someone has experience with it
@lone axle the release did not build the bundles. I'll see if the nightly job does anything.
thanks, sounds like it would be a new PR for changes, and that's fine
Are you willing to have this in 9.0.0/main instead of 8.2.x?
@tannewt I'll give it a shot.
I remember that i2ctarget wasn't completely implemented and the PR was merged as is.
@tannewt looks like the rebase on main was quite simple. Should be good for your review now.
In fact, when I think about it deeper now, I think it was a stupid proposition.
On one hand, it would be nice to know about the functions of the tile - with labels like in internet pinouts.
However, even if I use board.DAC, I would still have to check the GPIO corresponding to him.
However, I will use the entry:
dac1 = AnalogOut(board.IO17)
This code will still remain legible, and I will have fewer problems to verify the correctness of connecting the elements to the t...
Is there any procedure for them to accept the code? (Some confirmation of license acceptance or something similar?)
And direct me to what tests should be performed, because the instructions are probably this: https://learn.adafruit.com/building-circuitpython/espressif-build
Looks like no luck on the automated build either. I briefly looked into the dispalyio_annotations repo. I think the cause of build failures there is a very old actions configuration attempting to use container versions or dependencies that aren't available any more.
Later on I can update the actions yml files in the circuitpython org repos to the latest version from other libraries and see if that gets it building or dig further if needed.
Thanks!
@slender iron https://forums.adafruit.com/viewtopic.php?p=991181 User wanted to use the Adafruit_USB_Host_MIDI library. Is it working yet? It hasn't been released and isn't in the bundle. Thanks.
thunderpack_v12 is overflow on some languages. That's the only build issue.
https://github.com/adafruit/circuitpython/actions/runs/6701701119/job/18209634951?pr=8546
Hi, I am trying to upgrade a little project from 8.2.7 to 9-a-2 but I am running into discotool/circup and mpy compatibility issue. I was wondering if the "infrastructure" problem have been solved, like generating the bundle or that kind of things?
I can totally move from mpy to .py file and fix that manually, well, I hope I still can do that.
en_US builds:
atmel-samd (uses LTO): Trinket M0 is 1228 bytes smaller with gcc13.2; Metro M4 is 1960 bytes smaller.
stm (does not use LTO): thunderpack_v12 is 7444 bytes larger, hence the overflow. It appears that some ulab functions have grown a lot. Maybe we need to check the optimization flags for ulab?
Size growth (positive) or shrink (negative) from gcc 12 to gcc 13: (a few unique names discarded):
diffs.txt...
I fixed the blocker by moving all my library to .py (circup install --py module after circup uninstall module is the trick... to be done manually one by one).
I fixed the loss of display.show(x) by changing it to display.root_group=x (thanks to hint on the REPL).
I gave up on preparing for the future and hided the FutureWarning by doing import warnings and warnings.simplefilter('ignore') thanks to some hint I saw in show and tell.
Now I am fine and my code work... but I really think some learn guide on migrating to CP 9.0 will be much needed, to deal with depreciation, and explaining the new things.
Well, new release are usually announced by a blogpost, but maybe it deserve more, documentation and guidance? Now that the cat (9.x) is out of the box, there might be a surge in support need, well I guess I should go to #help-with-circuitpython 🙂
which library are you using that is not installable via circup? Or is it just that the library is not updated yet?
All of them.
We have not made a pass through the libraries to get rid of .show(), etc. Or maybe we did, come to think of tit.
The .show() was in my code.
Did you update circup to 1.4.0? pip3 install --upgrade circup
Yes I am in 1.4.0, but it fail to detect my device, so I have to use --path D:\ ... or use discotool that does that for me.
I can update the release notes to include updating circupt
It seems to fail to download the bundle at all.
And it is not in not in https://circuitpython.org/libraries either.
could you post the output of a circup failure?
I have to update the circuitpython.org libraries page.
we were interrupted in updating to the 9.x bundle by a cascade of failures due to GitHub updating the default Python to 3.12, which broke some things for us
9.0.0-alpha.2 is very, very alpha. We appreciate your testing -- there's a lot to fix in CircuitPython itself and in the infrastructure
C:\Project>circup update
Could not find a connected CircuitPython device.
C:\Project>circup --path D:\ update
Found device at D:\, running CircuitPython 9.0.0-alpha.2.
Downloading latest bundles for circuitpython/CircuitPython_Org_Bundle (20231029).
py:
There was a problem downloading that platform bundle. Skipping and using existing download if available.
None of the modules found on the device need an update.
C:\Project>discotool update
- Running circup on QT2040 Trinkey
> circup --path D:\ update
Found device at D:\, running CircuitPython 9.0.0-alpha.2.
Downloading latest bundles for circuitpython/CircuitPython_Org_Bundle (20231029).
py:
There was a problem downloading that platform bundle. Skipping and using existing download if available.
None of the modules found on the device need an update.
So Circup fail to detect, but discotool find my device. 🙂
And Circup cannot download the bundle.
those errors are only due to the CircuitPython_Org_Bundle, which is not used very much, though maybe you are using. libraries from there.
I am fine, I solved most of my problem, I just feel it need reporting.
the regular bundle already got downloaded, and was not reported.
I think it was looking for d:\CIRCUITPY. Is your drive visible as that?
Oh, I was wondering why there where 3 bundles, but I did not dig more than that.
It is visible, it is D:\
Nice try: C:\Project>circup bundle-remove circuitpython/CircuitPython_Org_Bundle Cannot remove built-in module: circuitpython/CircuitPython_Org_Bundle
Adafruit_CircuitPython_bundle is all the adafruit-supported libraries, CircuitPython_Community_Bundle is contributed libraries supported by individuals, and CircuitPython_Org_Bundle is other contributed libraries that are supported by the CircuitPython community. The last one is little used, and we're not sure we should keep it.
I think it's failing because it didn't downlaod properly
I have never tried the bundle-remove command
Could you file an issue in the circup repo about the remove?
I tried today for the first time. 🙂
thanks!
Do you see this in an Explorer Window?
I just installed circup 1.4.0 on a Windows 10 box, and it found the board as D:\
Wait, it does not say CIRCUITPY ... I need to figure why:
if you do storage.erase_filesystem(), (backup first!) I think you may get CIRCUITPY back
you may be able to rename the volume from Windows, but I'm not sure that will work
I erased and that fixed the thing, D:\ is not visible with label CIRCUITPY and is detected by circup.
I am not totally sure if I manually changed the label in the past, or if it is a result of my upgrade to 9.0.0-a-2.
I think it should work. I got lazy finishing the code though
so release as 1.0.0 or 0.9.0 and add to the bundle? Or does it need testing?
I asked the forum user if they tested it.
Does it pass ci? I think it worked for me but not Jeff
I’m at the vet now and haven’t gotten my laptop out
It does pass CI. No hurry at all. The forum user can test it.
CircuitPython version
Adafruit CircuitPython 9.0.0-alpha.2 on 2023-10-27; ESP32-S3-DevKitC-1-N8 with ESP32S3
Code/REPL
print("ESP32-S3 here")
import board
import keypad
keys = keypad.Keys([board.IO6,], value_when_pressed=False, pull=True)
while True:
print(dir(keys))
event = keys.events.get()
# event will be None if nothing has happened.
if event:
print(event)
Behavior
soft reboot
Auto-reload is on. ...
@deshipu Thx a lot. Had been struggling with this for days thinking it was issue in my code. Guess I just need to wait for next alpha(9.0.0-alpha.3) now.
@tulip sleet at my desk now
Guess I just need to wait for next alpha(9.0.0-alpha.3) now.
The latest "Absolute Newest" builds off of S3 will have the fix. No need to wait.
No license acceptance. The license that applies is in the file headers.
Test the build on your board to make sure it works. After you PR is proposed, further tests will be run automatically.
More details here: https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github
It is possible, but not our policy. Typically in Arduino board designs, A0 and maybe A1 have a DAC. It is up to the board designer to label the board that way if it is possible. It isn't up to CircuitPython.
We could add a section similar to this though: https://learn.adafruit.com/circuitpython-essentials/circuitpython-i2c#wheres-my-i2c-2985160
The RP2040 has a bootloader in ROM. It isn't in flash and is never loaded.
The UF2 file format specifies the location of each block to write and erases happen as needed, at the smallest unit.
CP has linker scripts and code that define the maximum size of the binary and then place the user file system after that. CP does that here with 1020k as default. Boards can override it. [Pico W sets it to 1532k](h...
It looks like the PCA9554 has special command bytes for configuring the port and having its own CP driver would probably be the best approach.
Thanks for the rebase! Do you have an example that works with homekit? That'd be neat to write up and share!
Modifying tags to reflect that a new library is needed
I'll update this if I find it continues to refuse to work, but I don't think it will be an issue.
Ok, I have something functioning. New lib was definitely the way to go.
Eyo, I was trying to see yalls history with circuitpython and waveshare 7.5 inch.
I got the screen working on my pi 4 and python scripts with pillow library and such and it was great. But i wanted to see if i could do it with a pico and so super low battery usage
It looks like this repo never had it's default branch changed to main instead of master https://github.com/adafruit/actions-ci-circuitpython-libs
I think part of the issue with the CircuitPython_Org bundle is Adabot was never updated to do the automated check for updates on submodules and make releases. So no bundles are not generated when updates are made to the libraries within it.
Adding the functionality for that will require some tweaking inside adabot because there are spots where it's got hardcoded URLs of https://github.com/adafruit/
I'm trying to work out how to manually update submodules and commit to the bundle to see if I can get a good build that way
Success! 🎉 https://github.com/circuitpython/CircuitPython_Org_Bundle/releases/tag/20231031.2
It appears that's got circup back to successfully downloading this bundle as well.
Fantastic - thanks!
Thanks for the rebase! Do you have an example that works with homekit? That'd be neat to write up and share!
I'm still working on the minimal HTTP implementation necessary to actually make it work, but with this POC, it's enough to allow the Home.app on iOS locate the accessory and prepare for pairing.
CircuitPython version
Adafruit CircuitPython 9.0.0-alpha.2-8-g7715ff09cc on 2023-10-31; Adafruit PyPortal Titano with samd51j20
>>>
Code/REPL
# SPDX-FileCopyrightText: 2020 Dan Halbert, written for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense
# pylint: disable=unused-import
import board
import busio
from digitalio import DigitalInOut
from adafruit_ble import BLERadio
from adafruit_ble.advertising.standard import ProvideServicesAdver...
It's porting time!
I saw the devkits making it in, so it will be a good chance for me to test c6
Let's hope it ain't possesed like c3
@lone axle what do you want to do with https://github.com/adafruit/actions-ci-circuitpython-libs/pull/21 ? Should we leave it as is, as Melissa suggested?
I am on board with leaving it as-is. I definitely was mistaken about it being related to my issue, I was fooled by an unrelated mention of setuptools in the error that I had.
I'll close it.
Any thoughts re: Zigbee support?
I was wondering if the PDF support matrix was every turned back on?
I think they are pretty similar so don't get your hopes up.
We don't plan on turning it back on. You can build it locally. IMO the html version is much more usable
we could have it upload to s3 I think
Oh, I'm not a home automation guy, but it's a cool protocol.
Once I get a few more devices with it, I will try using it.
Why did it exist originally? It is useful for people making books and PDF courses?
originally it was all one pdf but the displayio split made the pdf too big to render. to fix it, I split it out into a separate pdf. readthedocs errors when two pdfs are generated
so we disabled the support matrix pdf
Ah has anybody other than me tested C6?
Cuz like.. the wifi is broken for mine..
It scans but all connections fail with Error 15.
It could be the bug where the network securities are mixed, but I still haven't gathered the time to propely document what is going on on that
I tested it on the espressif board when I added it
Hmm, it could then be the network securities being messed up.
I have 3 open, 1 enterprise and a bunch of hidden ap's around me.
So that bug is greatly exadurated here.
It may be a great opportunity for me to try to fix it here.
Let's just give two different creation ids for these. We have plenty of numbers. Maybe the last digit could be flash size?
Alright, changed, as specified in the Creators ID pr. This entry in the script was removed.
I don't think you should add labels for RX and TX; the board doesn't expose those pins on its headers.
I've used the Lolin S2 mini in a few designs. It's a nice board and its footprint compatibility with the D1 mini is helpful. I was very frustrated by the lack of access to RX and TX when I had crashes and couldn't get the exception information over USB CDC and had no access to TX.
You can confirm this in [ESP32-S2 data sheet](https://www.espressif.com/sites/default/files/documentation/...
I disabled AESIO and BUSDEVICE on thunderpack and it fits now.
Thanks! Eventually we want to figure out why certain ulab functions grew so much with gcc 13.2
I'm going to merge this because I think the CI is confused. The two failing boards are on the 8.2.x branch afaik.
I don't think you should add labels for RX and TX; the board doesn't expose those pins on its headers.
I've used the Lolin S2 mini in a few designs. It's a nice board and its footprint compatibility with the D1 mini is helpful. I was very frustrated by the lack of access to RX and TX when I had crashes and couldn't get the exception information over USB CDC and had no access to TX.
I think there is some confusion here. The ESP32-S2 and ESP32-S3 chips have real USB support, and the...
I understand that.
On an ESP32 series chip, I think that board.RX and board.TX should reflect UART0's RX and TX pins, and on the Lolin S2 mini those pins aren't exposed on the headers, which is why I don't think they should be added to the pin definitions (and why they aren't there currently).
They are just the default UART. It doesn't matter which one. It's just a convenience.
There's nothing on the silk or in the docs indicating default RX and TX pins. Some D1-form-factor boards have default (silk + docs) RX and TX in the upper right (USB-connector side, connector at the bottom), but not all.
To be clear here, it sounds like GPIO43 and GPIO44 are not exposed at all on the Lolin S3 Mini, and would not be available except via bodge wiring to the chip pins. In that case, there should not be board.RX and board.TX pins
@deshipu I don't understand if the pins are not accessible why they would be listed. Maybe you meant something else?
Why would you define board.RX and board.TX when you can't actually wire anything up to the module's default UART pins on that board? Why would you define the "default UART" pins to be something other than what the data sheet specifies? What pins would you propose that board.RX and board.TX be in that case?
@dhalbert they're not exposed on the S2 mini - they are exposed on the S3 mini. But I think this issue was about the S2 mini.
I just flashed the an ESP32-C6-DevKitC-1-N8 with CircuitPython 9.0.0-alpha.2 and I can confirm, attempting to connect to wifi gets an error:
import wifi wifi.radio.connect("NOPE", "ALSO NOPE") Traceback (most recent call last): File "<stdin>", line 1, in <module> ConnectionError: Unknown failure 15
@dhalbert they're not exposed on the S2 mini - they are exposed on the S3 mini. But I think this issue was about the S2 mini.
There is a link in the OP to the S3 mini. Maybe @deshipu was referring to the S3 instead of the S2. That was my mistake as well.
@dhalbert yeah I think there may be some conflating going on :) I had to triple check to make sure of what the issue was about ;)
where are the docs for https://docs.circuitpython.org/en/latest/README.html#differences-from-micropython? should this also mention web workflow:
Supports native USB on most boards and BLE otherwise, allowing file editing without special tools.
(at the top of that page too, where USB and BLE are discussed)
It is in the toplevel README.rst
To be clear, my understanding is that @bato3 was saying "the Lolin S2 mini board object doesn't define RX and TX and the Lolin S3 mini does, so we should update the Lolin S2 mini pin definitions to as well".
I was pointing out that the Lolin S2 mini doesn't expose those pins and therefore the board object shouldn't define them. Datasheet and board spec links in my original comment to back that up. The ...
@tulip sleet want to chat memory allocation debugging in an hour?
ok sure
gonna eat lunch and take a short walk
i should take a walk too, then
I debugged https://github.com/adafruit/circuitpython/issues/2885 and it is a pathological case
a bunch of those kevin walters nrf52 bugs went back up on my radar a bit after going through all the isuses
we can talk about it
ya, that's fine
👍
I used it as an excuse to learn more about the split heap stuff
@tulip sleet I'm back from my walk
now I"m back too
@slender iron are you occupied?
What I was trying to say is that it doesn't have to be the same GPIO numbers as on the S3, just the same positions on the physical development board. The justification for this is that if there is any kind of shield or project PCB that uses the TX and RX pins on the D1 Mini, it will work by default on the S2 and S3 as well. It's the physical positions of the pins that matter, not their internal numbers.
back now. just chatted with my sister
any time or we can wait till later if you want
I've debugged this. It is a pathological case where the .magnetic code takes a couple allocations and then creates the tuple that is stored in a. This leaves short gaps between each tuple that is held for longer.
Below is the output of gc_dump_alloc_table() for the last memory pool when the memory allocation fails. Each character is a block. T is tuple, = continues the object and . is free. It is severely fragmented.
I think this only happens from the REPL because the compil...
CircuitPython version
Debug build, removed stuff for flash size, (almost) current master (commit 7715ff09cc663b80403f8907fe90c00fd89c9706)
Adafruit CircuitPython 9.0.0-alpha.2-12-g4eb82fea0d-dirty on 2023-11-01; WEACT-ESP32-C6 with ESP32-C6N4
CIRCUITPY_BLEIO = 0
CIRCUITPY_ESPCAMERA = 0
CIRCUITPY_ANALOGBUFIO = 0
CIRCUITPY_AUDIOBUSIO = 0
CIRCUITPY_AUDIOBUSIO_PDMIN = 0
CIRCUITPY_AUDIOIO = 0
CIRCUITPY_AUDIOMP3 = 0
CIRCUITPY_BLEIO_HCI = 0
CIRCUITPY_CANIO = 0
CIRCUIT...
We collect after import now. Compacting is really hard to do because it involves updating references. So, let's not do it.
Also, from usercode, connecting to any of my access points I get:
>>> wifi.radio.connect(...)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ConnectionError: Unknown failure 15
I did test it throughtly, it's a totally unrelated bug to anything else.
I am home now, where everything is standard across the boards (pun intended).
This simplifies allocating outside of the VM because the VM doesn't take up all remaining memory by default.
On ESP we delegate to the IDF for allocations. For all other ports, we use TLSF to manage an outer "port" heap. The IDF uses TLSF internally and we use their fork for the other ports.
This also removes the dynamic C stack sizing. It wasn't often used and is not possible with a fixed outer heap.
Fixes #8512. Fixes #7334.
C6 stuff is a low priority for me now so don't expect any adafruit 👀 on it soon
It's to be expected, ESP32-CX is pretty annoying to work with.
I will try to figure it out, since I have an example to work from.
This is an example of ESP-IDF console component.
Type 'help' to get the list of commands.
Use UP/DOWN arrows to navigate through command history.
Press TAB when typing command name to auto-complete.
Press Enter or Ctrl+C will terminate the console environment.
esp32c6> join --timeout=5000 KeyFalse [Redacted]
I (11507) connect: Connecting to 'KeyFalse'
I (11517) pp: pp rom version: 5b8dcfa
I (11517) net80211: net80211 rom version: 5b8dcfa
I (11527) wifi_init: rx ba win: 6
I (11527) wifi_init: tcpip mbox: 32
I (11527) wifi_init: udp mbox: 6
I (11537) wifi_init: tcp mbox: 6
I (11537) wifi_init: tcp tx win: 5744
I (11537) wifi_init: tcp rx win: 5744
I (11547) wifi_init: tcp mss: 1440
I (11547) wifi_init: WiFi IRAM OP enabled
I (11547) wifi_init: WiFi RX IRAM OP enabled
I (11557) phy_init: phy_version 202,b4b3263,May 17 2023,20:14:14
W (11577) wifi:(bf)761:0x600a7cac:0x01b4b4b0
W (11577) wifi:(agc)0x600a7128:0xd21c0800, min.avgNF:0xce->0xd2(dB), RCalCount:0x1c0, min.RRssi:0x800(-128.00)
W (11587) wifi:(TB)WDEV_PWR_TB_MCS0:19
W (11587) wifi:(TB)WDEV_PWR_TB_MCS1:19
W (11587) wifi:(TB)WDEV_PWR_TB_MCS2:19
W (11587) wifi:(TB)WDEV_PWR_TB_MCS3:19
W (11597) wifi:(TB)WDEV_PWR_TB_MCS4:19
W (11597) wifi:(TB)WDEV_PWR_TB_MCS5:19
W (11597) wifi:(TB)WDEV_PWR_TB_MCS6:18
W (11607) wifi:(TB)WDEV_PWR_TB_MCS7:18
W (11617) wifi:(TB)WDEV_PWR_TB_MCS8:17
W (11617) wifi:(TB)WDEV_PWR_TB_MCS9:15
W (11627) wifi:(TB)WDEV_PWR_TB_MCS10:15
W (11627) wifi:(TB)WDEV_PWR_TB_MCS11:15
I (13967) esp_netif_handlers: sta ip: 10.42.0.228, mask: 255.255.255.0, gw: 10.42.0.1
I (13967) connect: Connected
This has the potential to fix a lot more issues than just these two.
For those as eager as me to test it, make fetch-port-submodules before compiling.
The first round of testing is however not so pleasant. MemoryErrors.
A simple way to reproduce it would be:
>>> a = bytearray(60000)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
MemoryError: memory allocation failed, allocating 60000 bytes
>>> import gc
>>> gc.mem_free()
4130048
Big bulky m...
Resetting the board (even with the microcontroller module) without ejecting will leave the files unwritten and perhaps even corrupt the filesystem. Those writes will not be performed after a remount.
If your code resets the board, make sure to eject before running.
I tried loading the UM Tinypico artifact (hoping #7288 might be affected). Some moderately large programs that exhibited the memory variable corruption before now run fine, but the largest programs that exhibited the issue now simply don't load and immediate display the following message:
Adafruit CircuitPython 9.0.0-alpha.2-12-g151e38eefe on 2023-11-01; TinyPICO with ESP32-PICO-D4
>>> import PyDOS
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
MemoryError...
In the github actions for libraries, I'm guessing there's no way to get the circuitpython async/await behavior working, right?
(Context: Trying to add tests for Adafruit_CircuitPython_asyncio and python 3 async/await is not havin' any of my shenanigans.)
CircuitPython version
Adafruit CircuitPython 9.0.0-alpha.2-8-g7715ff09cc on 2023-10-31; Adafruit PyPortal Titano with samd51j20
>>> [D
...
>>>
Code/REPL
# SPDX-FileCopyrightText: 2020 Richard Albritton for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import time
import board
import microcontroller
import displayio
import busio
from analogio import AnalogIn
import neopixel
import adafruit_adt7410
from adafruit_bitmap_font import bitm...
This is not a bug, but a deprecation introduced in 8.x.x, and finalized in 9.0.0.
Change
board.DISPLAY.show(splash)
to
board.DISPLAY.root_group = splash
The user code needs the fix referenced by Dan above, but the library also needs the fix. I'll go ahead and submit a PR on that.
@wraith crow Note that I opened issues for all the bundle libraries that have .show()
In the library bundle? I guess I should take a look before I go much further 😄
it was a lot more than I thought when I started 🙂
no, in each repo there's a new issue, so you can link that issue.
Ah okey thanks!
I found them by ag-ing in the bundle
I'm working of a grep of the bundle
same difference 😆 I just thought I'd mark them all as a kind of to-do list
They all have the same title
55 still open, so don't stay up late 🙂
They're actually pretty quick, of course I almost immediately stumbled on the LEDs still using .show and realized I needed to slow down a bit 😁
yes, that was confusing
and there are some framebuffer non-displayio ones with .show() also, but usally self.show()
Do you really want an issue for this:
CircuitPython core code crashed hard. Whoops!
Hard fault: memory access or instruction error.
Please file an issue with your program at github.com/adafruit/circuitpython/issues.
Press reset to exit safe mode.
Press any key to enter the REPL. Use CTRL-D to reload.
]0;🐍REPL | 9.0.0-alpha.2\
Adafruit CircuitPython 9.0.0-alpha.2 on 2023-10-27; Adafruit Feather RP2040 USB Host with rp2040```
I am just more or less running the learn guide code for read QR code with tiny code reader: https://learn.adafruit.com/reading-qr-codes-with-the-tiny-code-reader/code
I cannot go to 8.x as I need some 9.x feature.
My plan is to roll forward to the latest version 9 I can find.
@lone axle re .show() I have not been making major or minor version releases, just bug fixes (x.y.z+1), since the user API did not change. watcha think?
I see you bumpd layout to 2.0.0
i could re-release what i released so far
Hi @That-Canadian,
I'd love to see official support for The Elite-Pi in CircuitPython, I think it's an awesome board :)
I notice you expressed interest in helping last year in #7141, but the conversation kinda stalled out.
Would you be willing to fill out an application for a USB PID from the raspberry Pi org?
Do you want help with any of the PRs to update to use root_group?
Thanks! Feel free to do some. The issues are meant as a to-do list. It will be a while before this is critical.
Sounds good, think I can handle changing one line. 🙂
check for root group being set to None when it should be CIRCUITPYTHON_TERMINAL (if you want to show the terminal).
Sorry, it seems I never fired up discord this morning. I'm good with either way. In the moment I chose it I went with 2.0.0 since there are contexts where the new code won't run (albeit quite old versions of circuitpython at this point.)
But a person who does have one of those older versions installed would update the library and then have it "stop working"
they'd have to be running 7.x.x or earlier, yes
so maybe I'll do a minor version bump on future releases. Major version usually implies API incompatibilities
I'll do minor number for any others that I release. It'll be a while before I am back to any of them though. I just took a quick stroll through github notifications before getting started with other work.
in most of the libraries, fortunately there is not actually a .show() in the library -- it's only in the examples
True
The first PR I did to update with root_group is failing the CI at https://github.com/adafruit/Adafruit_CircuitPython_SPD1656/actions/runs/6734034840/job/18304005944?pr=7 with error /home/runner/work/Adafruit_CircuitPython_SPD1656/Adafruit_CircuitPython_SPD1656/adafruit_spd1656.py:docstring of adafruit_spd1656.SPD1656:15:'any' reference target not found: displayio.FourWire - is this related to the displayio splitting Scott has been doing? I didn't touch that file when editing, so not sure
@danh Continuing my deep dive into oofatfs I've found that FAT32 and EXFAT support is turned on just for the Broadcom ports. This means that any other boards with an SDCard slot will have a hard size limit of 4G (largest FAT16 filesystem supported by oofatfs). Also, an SDCard formatted on a PC and inserted in a board running CP is likely to either not mount or if it does it may become corrupted.
I believe it is related to the displayio split, Fourwire is now in it's own module I think https://docs.circuitpython.org/en/latest/shared-bindings/fourwire/index.html
displayio.Fourwire -> fourwire.Fourwire might fix it, but I haven't actually tried in any code so I'm not positive.
I've looked at https://github.com/adafruit/circuitpython/issues/5706 but it may not be this problem.
GitHub
I am able to build and load CP to a raspberry pi4b but very often when I disconnect the USB port (and power) the next time I try to power it up, the SDCard is corrupted . The Green LED blinks 4 tim...
I'll give it a try, thanks!
I am not sure that 4GB is the limit, because I've used 16GB cards and larger on PyPortal
without reformatting
The limit is in the oofatfs formatting code.
intersphinx in the doc build is using < https://docs.circuitpython.org/en/latest/>, so maybe yes
but referencing parts of a preformatted card outside the 4GB limit is going to fail?
Not sure, but it could result in some unexpected weirdness.
the FAT32 file size limit is 4GB, but I don't think the volume size limit is 4GB?
FAT32 can support 32GB volumes
Right, FAT32 can get up into the TB range on volume size.
I'm not even sure the formatting code is available to use?
the intention was only to turn it off for small builds
the formatting code, that is
Yeah, just gonna go there. As it is FAT32 and EXFAT are off for all ports except Broadcom.
Pertinent flags are MICROPY_FF_MKFS_FAT32 and MICROPY_FATFS_EXFAT
so i see the flag is MICROPY_FATFS_MKFS_FAT32, which is on for most:
py/circuitpy_mpconfig.h
267:#ifndef MICROPY_FATFS_MKFS_FAT32
268:#define MICROPY_FATFS_MKFS_FAT32 (CIRCUITPY_FULL_BUILD)
ffconf.h:76:#define FF_MKFS_FAT32 MICROPY_FATFS_MKFS_FAT32
Ouch! Missed that.
np - that's a relief
@gilded cradle Do you have an opinion about how we should bump the version numbers of libraries where we remove show()? In many cases the changes are only in the examples. Should it be x+1.0.0, x.y+1.0, or x.y.z+1? I.e. is it just a bug fix, or a minor or major bump? See my discussion with foamyguy not quite two hours ago above
I would just do a minor bump since the interface of the lib is likely not changed, but it's bigger than just a bug fix.
@lone axle ☝️
@danh So what do you think remove the root_group=None's or leave em?
@tulip sleet My tag didn't take 😆
I have started to hit tab after typing an @ tag
go ahead and leave them in. The code will still work. We are just trying to fix code that will break
thanks for thinking about it
approved
Thanks for the linking tip Dan
Oh.. Oh no...
Even the scan example is broken..
I think idf5.1 is at fault
Guess it's upstream bug time.
Here we go I guess.
https://github.com/espressif/esp-idf/issues/12517
Is the 8.2.6 output correct?
From a small amount of testing yes. I did not test 8.x in many places.
The number and authmodes of nearby networks affects it.
This is an upstream bug, I filed a bug.
https://github.com/espressif/esp-idf/issues/12517
For what it's worth when I reverted to 8.2 I didn't encounter this issue anymore, whereas on 9 it was seriously inhibiting my ability to work.
hey im trying to build circuitpython but im stuck on ‘makefile fetch-all-submodules’
makefile is not recognizing
Change to make fetch-all-submodules
sorry i meant to write ‘make’ not ‘makefile’
I sometimes forget to change to the circuitpython folder before trying to run the fetch-all-submodules
You can also reduce the time significantly by changing to the ports/whicheverport folder and running make fetch-port-submodules
In the github actions for libraries, is there any way to get the circuitpython async/await behavior working?
(Context: Trying to add tests for Adafruit_CircuitPython_asyncio and python 3 async/await is not havin' any of my shenanigans.)
My assumption is no - I asked a few days ago, thought I'd ping it again juuust in case it catches someone that knows a way around it.
I'm not real familar with async/await but you may have better luck in #help-with-circuitpython the folks hanging out in this channel are generally focused more on circuitpython development
Ah, okay - I was thinking since it was a library to do with circuitpython & the build system designed by the same folks this'd be the right place. I'll ask there, too.
That is a very thorough response. Thank you. That clears things up quite a bit.
I don't think there's much else to do with this ticket, if the issue can't be recreated. I appreciate your help!
We can and do test this during the main circuitpython build. Look in tests, there are existing asyncio tests. But the test is done with whatever is the submodule ref not latest or what's in a PR.
@wraith crow @random junco thanks for all the .show() fixes!
That's really helpful, thank you!
So if any new features make it into the asyncio library these tests would be the next place to update.
In particular if it's something new, since it looks like that'd fail the uasyncio compat test.
I'll dig into how that's used as part of CI. Maybe I can bring a similar binary into the other repos for running tests in an actual environment instead of cpython..
@lone axle @slender iron @gilded cradle @random junco @wraith crow One thing about all these updates to fourwire.FourWire, etc., for the displayio examples in the library repos is that the displayio refactor is only in 9.0.0 builds. Normally we would defer these changes until 9.0.0 final was released. But because the library doc builds look at http://circuitpython.readthedocs.io/en/latest/, they require this change. I went ahead and merged in those changes, but it will be a support burden to to tell people "no, for 8.x.x, you have to use displayio.fourwire if you copy the examples".
I'm not sure this is a big deal, because it's only for examples in libraries for certain display boards. We could not depend on latest, but instead the current released doc for the cross-references. (And is that already factored out into a separate place, or is it in each library repo?) On the other hand, then the library docs can't refer to new features.
@crude blaze hihi
Is github having an issue or was this repo moved? https://github.com/adafruit/Adafruit_CircuitPython_asyncio 
oh wait, discord sees it? I see a 404. Weird..
Oh, github status says it's havin a bad time
Nevermind! :) I'll wait for github to resolve their problems.
Commit 4e2ab71dfe2b1869ec41a3db1fe79387ff46a0fe reverts micropython/micropython@5cf71b55960651fc506df0ac41490f12dd1d63fd which solved micropython/micropython#6046, which I'm seeing again on my gentoo system with D_FORTIFY_HARDENED enabled by default.
Unfortunately we can't just revert the revertion because circuitpython enforces prototypes for defined functions, which is why 4e2ab71d was implemented initially. Micropython doesn't suffer from this issue.
The implemented fix is to just ci...
Could you give more background on this? Which toolchain are you compiling with? We don't see this issue ourselves. Is it specific on gentoo? Is it is just when you compile ports/unix? If it's across all ports that use a cross-compiler you supply, if you used the ARM gcc 13.2 download, would you see this problem?
Could you give more background on this? Which toolchain are you compiling with?
I'm using gentoo's crossdev arm-none-eabi-gcc:
$ arm-none-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/arm-none-eabi/12/lto-wrapper
Target: arm-none-eabi
Configured with: /var/tmp/portage/cross-arm-none-eabi/gcc-12.3.1_p20230526/work/gcc-12-20230526/configure --host=x86_64-pc-linux-gnu --target=arm-none-eabi --build=x86_64-pc-linux-gnu --...
The reason I'm asking is that in the past few merges from MicroPython sources, we've trying to reduce the differences between the files we share with MicroPython. So this change is an increase in skew. Could you fix this in both MicroPython and CircuitPython by guarding the definition of __memcpy_chk() with an #ifdef _FORTIFY_SOURCE instead of just removing it? If that is possible,could you also PR it upstream?
We are also labeling differences from upstream with // CIRCUITPY-CHANGE a...
@tulip sleet I'm at my desk for a little while. need anything from me?
Should we remove this warning about CircuitPython version? It's quite outdated at this point
sure!
The reason I'm asking is that in the past few merges from MicroPython sources, we've trying to reduce the differences between the files we share with MicroPython.
Okay, that makes a lot of sense.
Would a better approach then be to provide a string.h file to pull in locally with the prototype signatures required to define functions & then remove the string.h import? This will bring this file closer to micropython. The differentiating factor here is that circuitpython is requiring a...
I'm facing this problem as well, trying to let a circuitpython device communicate to an rpi over USB, to send image data to the device.
It's almost impossible to process a big image buffer in circuitpython on devices like an RP2040 because of the limited memory. I can't think of any workaround to this (under the limitations).
Implementing something similar to micropython.kbd_intr(char) shouldn't be too hard, but resolves this super annoying limitation.
I've seen more than a few learn guides with warnings with CP 6 or CP7. I've used that guide by Jepler a lot when constructing the 12-panel matrix and didn't find anything wrong with the code, examples, information. It's an excellent excellent guide that got me up and running much faster than I could have done on my own that's 💯
For your particular case, can you leave our prototype declaration in and conditionalize the __memcpy_chk() definition and/or declaration as necessary? That would preserve the upstream definition but remove it for your compiles (if I understand right, that is the issue). This file already has changes from upstream.
Commit https://github.com/adafruit/circuitpython/commit/4e2ab71dfe2b1869ec41a3db1fe79387ff46a0fe reverts https://github.com/micropython/micropython/commit/5cf71b55960651fc506...
if you see these CP6 or CP7 warnings that are kind of obsolete, feel free to mention them here or use the "Feedback" link in the left sidebar of the guide to note it
What toolchain do I neet for RT1011?
just the ARM gcc, note that we just upgraded to gcc 13 on main.
Cool, thanks for the tip.
i will add some new info to the Building guide
I am little confused by this, because it don't see 4e2ab71 as a full revert, but just adding the declaration and changing the include. But I may be misunderstanding something.
Sorry for the confusion, thanks for bearing with me.
The issue I'm seeing was introduced with the string.h include which has macros that break compilation when FORTIFY_SOURCE is defined. micropython avoids this by no...
another possible alternative (only compile-tested, for adafruit feather rp2040, with -D_FORTIFY_SOURCE=1 manually added to CFLAGS)
commit 1650ce6d42e3106e2e60d0e2984dfcd0829d8162
Author: Jeff Epler <jepler@gmail.com>
Date: Sat Nov 4 21:07:21 2023 +0100
string0: Undo any definition of these to macros
.. which can occur in <string.h>, particularly when -D_FORTIFY_SOURCE,
which we otherwise rely on to provide a prototype.
diff --git a/shared/libc/string0....
yet another possibilty
diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk
index 5f0af02a6e..701156cd1a 100644
--- a/py/circuitpy_defns.mk
+++ b/py/circuitpy_defns.mk
@@ -52,7 +52,8 @@ BASE_CFLAGS = \
-DCIRCUITPY_CANARY_WORD=0xADAF00 \
-DCIRCUITPY_SAFE_RESTART_WORD=0xDEADBEEF \
-DCIRCUITPY_BOARD_ID="\"$(BOARD)\"" \
- --param max-inline-insns-single=500
+ --param max-inline-insns-single=500 \
+ -U_FORTIFY_SOURCE
# Use these flags to debug build time...
Yeah @jepler, disabling that flag everywhere might be preferred even if the issue has only exposed itself to me for this file (there could definitely be others, though)
both those solutions seem to work for me, thanks for acknowledging the intention behind the chk versions
@jepler I just updated my board and put an equivalent code (refreshing a lot the pixels while staying connected to the wifi). The issue is still here.
From memory the glitch is not exactly the same, so I guess the interrupt occurring during the px.show() might have a different timing...
tested on a lolin s2 board, with 8.2.7
I'll be trying to figure this out myself, but if someone knows the answer to these things it saves me some time:
- Is the unix port of circuitpython well maintained?
- Is there a reason beyond time constraints as to why it isn't being used in CI for testing libraries? I'm in particular looking at
Adafruit_CircuitPython_asyncio. - Is there a build of it uploaded anywhere that CI could access?
fix second place I2C is defined >.<
LILYGO T-Deck

Specifications
CPU: ESP32-S3
Flash: 16MB
PSRAM: 8MB
Display: 2.8" ST7789 (320x240)
Radio: 2.4Ghz WiFi, Bluetooth 5, and LoRa (optional)
I'll be using this issue to document my attempt to port CircuitPython to the LILYGO T-Deck.
It is maintained only well enough to run the tests
many libraries require external hardware to function. There are asyncio tests already, inherited from MicroPython.
We don't publish a build. We just run the "coverage" build: make -C ports/unix VARIANT=coverage
to run the tests
it is somewhat more important in the MicroPython world
It is maintained only well enough to run the tests
Got it, thank you!
many libraries require external hardware to function.
That's true.. and making them testable by breaking them into smaller pieces kind of run into the pystack limitations.
Yeah, there's asyncio tests that are part of the circuitpython build but it means changes to asyncio the library is slightly more roundabout, hence me digging into it a little.
There are tests that test the asyncio library and tests that test _asyncio. asyncio the Python library is in the MicroPython repo. We factored it out, and try to keep it roughly up to date by updating it from the repo. Maybe you know this already
I know some of it. It's somewhat different at this point from what I can tell vs uasyncio from the micropython library. I was looking into adding tests to verify additional aspects of it that weren't part of the micropython pieces. As long as the intent is to keep it in line with micropython's featureset instead of getting it closer to CPython's then that path seems reasonable.
My thinking was that the tests in the circuitpython repo were to ensure that circuitpython behaved as expected - especially with changes to the async/await behacior - towards asyncio. However, pull requests towards the adafruit/Adafruit_CircuitPython_asyncio repo don't get validated that they don't incur regressions or otherwise have glaring problems.
I was poking at maybe being able to support some tests via CPython & pytest but the async/await behavior from circuitpython seems a bit different from CPython's - at least, under the hood. And most of the asyncio features rely on those differences.
For any other libraries that's really not that much of a concern - as all those internal differences are encapsulated, so pytest and cpython should technically work? 🤷 Maybe a bad return on investment going down this path, since like you said it was factored out from micropython and heavily reliant on internal features. Not many other libraries would need this to run tests.
So what I am saying is that https://github.com/adafruit/Adafruit_CircuitPython_asyncio is derived almost exactly from https://github.com/micropython/micropython/tree/master/extmod/asyncio. During our recent merges from MicroPython we tried to update our separate library with the upstream changes from extmod/asyncio. _asyncio is optional C-language helper functions, but the library can work without it.
uasyncio and _uasyncio dropped the u in the latest version of MicroPython.
Our async/await impl is slightly different from MPy's. We have __await__() implemented separately, and we distinguish between coroutines and generators; MPy does not. We would like to discuss with the MPy folks PR'ing that change back.
Did I already point you at geneverov's experimental work redoing some things in the C implementation and also trying to take the CPython asyncio library and strip it down? The resulting library is still about 4x larger than the MicroPython version.
MPy/CPy also don't have Exception groups, and that I don't think is on the short term list for MPy
I did see the changes to the C implementation
I agree we should add testing to the asyncio CPy library to exercise the tests that are in the circuitpython repo. Right now that only happens when we update the submodule in circuitpython
the person who did await/async in CircuitPython did it separately from the MPy implementation. That was way before we added the asyncio library: https://github.com/adafruit/circuitpython/pulls?q=is%3Apr++async+author%3Akvc0+
we originally thought asyncio was too big, too complicated, and too confusing. This was before asyncio task groups, and before a lot of simplification of asyncio had happened. I had read about curio and trio .
CircuitPython version
Adafruit CircuitPython 9.0.0-alpha.2-13-gdc5845fa41 on 2023-11-04; Adafruit Camera with ESP32S3
Code/REPL
import sdcardio
import board
import storage
sdcard = sdcardio.SDCard(board.SPI(), board.CARD_CS)
vfs = storage.VfsFat(sdcard)
storage.mount(vfs, "/sd")
Behavior
Traceback (most recent call last):
File "code.py", line 12, in
OSError: [Errno 19] No such device
Description
the SD card is definitely 'star...
assignin' dan/scott because this is possibly related to the 9x merge
After @jepler and @tannewt fixed a bunch of these, I looked for further existing MP_TYPE_FLAG_NONE uses that should be MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS. I did this by looking to see if those types were also using properties. Found a couple more.
As an accidental side effect, I found a bunch of files which were doing #include "py/objproperty.h unnecessarily, and removed that include.
Pin-out based on the schematic provided by LILYGO.
| PIN | Description |
|---|---|
| 0 | Trackball Button Press |
| 1 | Trackball Left |
| 2 | Trackball Up |
| 3 | Trackball Down |
| 4 | Battery |
| 5 | Speaker LRCLK |
| 6 | Speaker DIN |
| 7 | Speaker BCLK |
| 8 | Keyboard SCL |
| 9 | LoRa CS |
| 10 | Power On |
| 11 | Display DC |
| 12 | Display CS |
| 13 | ... |
CircuitPython version
Adafruit CircuitPython 9.0.0-alpha.2 on 2023-10-27; Adafruit Feather RP2040 with rp2040
Code/REPL
# import
import alarm
import board
import pwmio
#import simpleio
import time
# Time values set by user
seconds = 10 #testing
minutes = 0
hours = 0
days = 0
# math
minute = minutes * 60
hour = hours * 3600
day = days * 86400
val = minute + hour + day
# power on tone
# simpleio
#simpleio.tone(board.A0, 1000, duratio...
CircuitPython 9.x is now running on the device with display output.
The rest of the hardware needs to be tested to ensure the assigned pins under board are accurate.
I've also run into this issue trying to port CircuitPython 9.x to LILYGO T-Deck which is based on the ESP32-S3. The timeout value doesn't seem to have any effect either. It will attempt to connect and then soft-lock until reloaded.
WiFi
WiFi works in the sense that networks can be scanned for, however I am having issues connecting to any access points. The timeout doesn't work either, as it effectively soft-locks until reloaded.
This is likely due to a regression in CircuitPython 9.x. It seems that other ESP32 devices have issues as well: #8552
Example Code
settings.toml
WIFI_SSID = "MyNetwork"
WIFI_PASSWORD = "MyPassword"
WIFI_CHANNEL = 3
import os
impor...
Error 15 is WIFI_RADIO_ERROR_4WAY_HANDSHAKE_TIMEOUT, which could have separate causes on ESP32-S3.
https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-reference/bluetooth/esp_gatts.html
Just posting for reference.
Maybe we can list down what is missing, so work on IDF's side can start.
Wait, the error codes between esp_wifi and CP are kinda different..
In ports/espressif/common-hal/wifi/Radio.c, line 340:
if ((bits & WIFI_DISCONNECTED_BIT) != 0) {
if (self->last_disconnect_reason == WIFI_REASON_AUTH_FAIL) {
return WIFI_RADIO_ERROR_AUTH_FAIL;
} else if (self->last_disconnect_reason == WIFI_REASON_NO_AP_FOUND) {
return WIFI_RADIO_ERROR_NO_AP_FOUND;
}
return self->last_disconnect_reason;
the last_disconnect_reason is u...
tested on a lolin s2 board, with 8.2.7
The IDF rebase landed as part of the the 9.x release so it won't be in 8.2.7
@jessyjones Vous avez changez array" à ¨matrice¨. Dans la documentation officielle de Python, le mot « tableau » est utilisé à la place du mot « array » https://docs.python.org/fr/3/library/array.html?highlight=array#module-array le mot.
"Matrice" est pour numpy, bien sur, maybe peut être pas pour "array"?
Hello @dhalbert , if I understand correctly you're referring to the use of "matrice" instead of "tableau" in the translations I submitted ?
If that's the case, I chose to use matrice since it appeared to be used in numerous other locations in the french translation, and I thought it'd be more consistent for the user. I'd be happy to change it to "tableau" if you think it's better to stick with the official Python term, but then I would have to change it in the translations strings that were...
@jessyjones Is it "matrice" in other places? I'd prefer to use the term that the documentation prefers, which seems to be "tableau", if you think that makes sense. On the other hand, the French translation of the official documentation is pretty incomplete, and I know that often there is not consistency about how to translate various terms
"Matrix" in Python usually means something with >1 dimension. The French examples I could find went along with that. If you have some French Python text...
Yes, it is, I believe the oldest translation using the word "matrice" is this one : https://hosted.weblate.org/translate/circuitpython/main/fr/?checksum=924279b02128dd8f
@hugodahl I believe this was a choice of yours (based on the translation history), do you mind sharing your reasons ? I'd be happy to discuss it further if you think "tableau" is not appropriate :-) !
"bytearray" is not translated, but "array" is. In this case the reference is usually to the specific Python module (array, used as array.array, etc.), so perhaps array doesn't need to be translated at all?
E.g., there is this inconsistency from before this PR. Given the mention of bytearray here, I would stick with array, and change the "matrice" to "array" here and similar places, where we mean an object of type array.
#: shared-bindings/analogbufio/BufferedIn.c
msgid "...
Alright, I've gone ahead and modified the strings I had translated and I believe I removed all mentions of "matrice".
Most of the time I used "array" except when it was obvious that the original message was referencing array as a word and definitely not the module: I figured if someone's using these librairies, they're most likely to know what we mean by array, so that'd be the safest option.
Let me know if there's anything else !
On a slightly unrelated note, there's this string where I wasn't sure what the message was referring to : https://hosted.weblate.org/translate/circuitpython/main/fr/?checksum=fb0963ba87e05c38
My understanding of the code is that show was never meant to be used and the message is suggesting the coder uses ".root_group =" instead.
Would that be correct ?
.show() was available previously, but was deprecated in 8.x.x; users were told to use .root_group = instead. In 9.0.0, .show() has been removed completely, but we are printing this warning to help users make the transition.
So .show() is obsolete and was removed.
(.show() was misleading, because it didn't actually cause something to be shown immediately. Instead it was used to set the base displayio Group that should be displayed, hence .root_group =.)
Thanks for the clarification, I've just updated the translation !
I retested with CircuitPython 9.0.0-alpha.2, which is upgraded to ESP-IDF v5.1. lc709203f_simpletest.py now works much better. I am closing this as fixed in 9.0.0, but we can reopen or make a new issue as needed.
I retested after we upgraded to ESP-IDF v5.1 in CircuitPython 9.0.0-alpha.2. BNO055 still does not work. This is not so surprising. I added warnings to the appropriate BNO guides a while ago.
Is there any progress on fixing/updating ESPs to allow HTTPS? I would like to make an update to adafruit_httpserver that allows HTTPS, but currently for all I know only RPi Pico W supports what is needed for it to work.
Keyboard
The keyboard is an ESP32-C3 chip running its own firmware and communicating via I2C. A keyboard backlight is present, it can be turned on by pressing Alt+B. There is no way to enable that via I2C, but the keyboard can be updated to support it.
There is a separate UART interface (2 of 6 pins) on the main board that can be used to re-fla...
ESP32-S3 based device with attached peripherals. Built-in display is working as is the SPI and I2C interfaces.
I've revised pins.c a few times, but on the final version I settled on using whatever the Arduino project called them. Hopefully making porting a bit easier. I also made sure to add the SPI and I2C interfaces to the board definition.
My plan is to continue testing the hardware and providing examples while the PR (#8563) is reviewed.
When using a control voltage (CV) -like object in synthio such as Envelope and LFO to modulate a Note's amplitude, only positive control values are used with the resultant output value placed above the baseline. For example, a sine-wave LFO created to span negative and positive values to modulate a note's frequency is rectified if used to modulate a note's amplitude. This becomes important when an analog output of just the Envelope or LFO is needed (rather than the modulated sound of th...
To be clear, my understanding is that @bato3 was saying "the Lolin S2 mini
boardobject doesn't defineRXandTXand the Lolin S3 mini does, so we should update the Lolin S2 mini pin definitions to as well".
Eh... My original intention was to draw attention to the fact that there is board.SPI() and not board.I2C().
Additionally, while looking for information on where the SPI pins are located, I read that all boards from the Wemos mini series are pin-compatible. (or at leas...
Thanks for looking into that.
I think this started because I wanted to see what rate I could read at and how close I could get to the sensor's maximum rate. I think there are some other recent efforts afoot for bulk sampling or continuous sampling of sensors perhaps via DMA where the hardware permits? Had to look this up, I'm thinking of analogbufio. Is there anything afoot for something similar with an inte...
Is it OK to submit just a pull request or should it have a corresponding issue?
it's fine
[adafruit/circuitpython] Pull request opened: #8565 Fix off-by-one in flash block read with fake MBR
When reading multiple blocks starting at block 0 from the raw flash filesystem incorrect blocks are returned. For example:
root@ub2004:/home/rabeles/Development/circuitpython-fakembr/ports/raspberrypi# dd if=/dev/sdd bs=512 count=2 | hexdump -C
2+0 records in
2+0 records out
1024 bytes (1.0 kB, 1.0 KiB) copied, 4.0062e-05 s, 25.6 MB/s
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff |.........
Besides some of the SAMD-based boards, does anyone know of others with small flash drives?
You mean separate flash chip? The RP2040 Feather & possibly others with the RP.
Flash in the SoC or separate. I'm looking for very small, like the M0 Trinket that exposes 64KB of its flash as a filesystem.
Context: This is for an optimization to filesystem overhead on very small devices.
@dhalbert Requesting a review.
Feather M0 Basic, Gemma M0, Trinket M0, QT Py (SAMD21), many of the Trinkey boards, Arduino Zerodon't have an external flash chip. Anything in ports/atmel-samd/boards with INTERNAL_FLASH_FILESYSTEM = 1 in mpconfigboard.mk. You can install Feather M0 basic on Feather M0 Express
sorry, missed the "besides", there are also nRF boards with internal-only CIRCUITPY
some are fairly small
Thanks! Any thoughts on whether scaling down the FAT12/FAT16 root directory size from 512 entries to something more reasonable for extremely small filesystems should be a #define based on board or an inline test based on filesystem size? I've tested using the latter, and it frees up 25% of the flash filesystem on the Trinket M0.
I didn't know you could make it smaller. I'd do it based on filesystem size. what size improves things by 25% on 64kB?
Going to 32 entries from 512. After overhead for reserved sector and FAT it leaves about (working from my memory here) 60 512-byte clusters free for the data area.
32 is probably a little small, 64 or 128 might be better for libraries and data files
Keep in mind it's the root directory. Libraries and other sub-directories allocate out of the data area.
ah ok
would it be flexible enough to read current format, and only drop size on a reformat?
do all OS's handle this?
Yes, works with existing filesystems, so nothing changes until a reformat. I've tested Linux, Windows, and MacOS.
Our goal with CP is to be more like CPython than MicroPython. So if you have behavior differences, then it'd be good to make CP match CPython.
Welcome to Discord's home for real-time and historical data on system performance.
ahh that explains why my discord is loading slowly
Hi @idle owl !!
Congrats!
(I'm happy to read too if you need a break)
That's good to know! The biggest issue with that today that I've seen has to do with a balance of features to package weight.
Looking at IDF changes since 5.1 there are a WHOLE lot of C6 fixes.
I did merge v5.1.1 onto my local submodule and try with that, unfortunately it didn't fix it.
Something that works though is the arduino wifi example with the esp32 plugin version 3.0.0-alpha2.
So I am looking into how that does it.
I also plan on testing idf master but I am quite busy with sbcs right now.
Sorry to hear about your mother, Scott.
Ya, we definitely target being a subset of CPython
we want code to be portable from CP to CPython but not necessarily the reverse
Thanks all!
Thanks, all!
Thanks!
Thanks all!
Thanks everyone! Hope everyone has a good week!
thanks for hosting Tim!
This bug has been confirmed in:
- CiruitPython
- Arduino beta esp plugin 3.0.0-alpha2
- ESP-IDF wifi example scan
On all esp32 chip variants.
If we are to ship idf5, we need to disable all authmode checks.
Discord finally just let me online. Guess the meeting is over now.
It would be nice if we had a link to the doc outside of discord in case we can't get on discord, we can at least add notes.
I see them listed if I go to drive.google.com and click "shared with me" on the left. I'm not sure if that's the same for everyone or not though.
I do not see them there. :/
Nevermind, I had to switch user accounts. I see them now.
Thanks @lone axle
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/1GChyaFlm9dC-TNY4DgkKVXk51ZxJCHfd42bJOstZmIg/edit?usp=sharing
Google Docs
CircuitPython Weekly Meeting for November 13, 2023 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates early. During the meeting, we go through them as a round robin sorted by username. If you can’t make the meeting and would still like to pa...
Two small creator id updates to match the creators repo.
CIRCUITPY_CREATOR_ID = 0x10111011
CIRCUITPY_CREATOR_ID = 0x10111011
Whoops. Thanks for catching that!
Co-commited the suggested changes.
https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-reference/bluetooth/esp_gatts.html
Just posting for reference.
Maybe we can list down what is missing, so work on IDF's side can start.
That doc is referring to the bluedroid BLE stack. It does look like it can do dynamic services. Unfortunately, we started the existing BLE impl based on Nimble with the hope of standardizing ports to it for BLE host. So, switching to bluedroid could make this work. It isn't a...
Don't just randomly change this. Get a PID assigned from Espressif. The vendor id 0x303A is theirs and they administer it here: https://github.com/espressif/usb-pids
Please get a proper USB PID.
Is there anything afoot for something similar with an interrupt driving approach for i2c with nRF52 for my scenario?
Not yet. But I could see us adding something like that to "read X register N times over i2c".
On the metro M7 SD with a version of 9.x I was able to list stuff until I ran out of memory. I had to increase the pystack too.
Reduce the size of the root directory for a FAT12 filesystem on a tiny (<=128KB) flash device.
When oofatfs creates a filesystem it uses a default root directory size of 512. For most flash devices this is a reasonable choice, but for tiny flash devices this can consume a large portion of the flash. For example, a Trinket M0 has a 64KB filesystem of which 16KB is consumed by the FAT12 root directory.
This pull causes f_mkfs() to automatically reduce the FAT12 root directory from 512...
CI is failing due to tests vfs_blockdev.py and vfs_fat_ramdisk mismatching on .stat() showing increased available filesystem space.
I tried on an S3 devkit c + sdcard breakout but I'm not seeing CS toggle. I have no idea why. Blink works on an S3 feather from the same source.
Hi there - can anyone point me a library for detecting a variety of hardware button press patterns - short hold, long hold, double click, triple click, etc?
You might try asking in #help-with-circuitpython but it looks like the debounce library might do some of what you're looking for https://docs.circuitpython.org/projects/debouncer/en/latest/
I dreamt about this last night (exciting, huh?). It would a huge quality of life improvement for non-native USB devices. This led me to ponder FUSE on Linux/Mac and WinFsp on Windows, but the much more native WebDAV would be preferable for portability between systems.
The metro-m0-express for zh_Latn_pinyin is overflowing flash by 4 bytes. Investigating the explorerkit_xg24_brd2703a for en_US, suspect it's something similar.
@dhalbert I can see where dropping FAT32 support for external flash on very small devices can claw back a few bytes. I can't think of any use cases for it. What do you think?
I think we would keep FAT32 support for SD card use, even on small boards, which might want to do logging to an external card.
How about rebasing this on main instead of 8.2.x? It's a significant change and we are pretty much confining 8.2.x changes to bug fixes and new boards. That would probably solve the build overflow problems.
Good idea! I'm closing this pull request and will create a new one against main.
The explorerkit_xg24_brd2703a CI failure remains a mystery. I can't reproduce it locally and it's not a flash overflow.
@tulip sleet I'm curious re: reduced flash usage on 9.0.0, how was that achieved?
we swapped our set of changes for reducing the size of type objects for MicroPython's. That was probably a wash. Going to gcc13 made the biggest difference.
Also we removed long-lived storage allocation, thought that probably was not a lot of code.
gcc13 gained >1200 bytes on small builds: https://github.com/adafruit/circuitpython/pull/8546#issuecomment-1787472714
Fascinating. I'll want to update my local chains from 12.3 to 13. BTW, I did a deep dive into oofatfs differences between upstream, MicroPython, and CircuitPython. I've got notes, where would be a good place to put them?
You can just make an issue. The object of it would be "update oofatfs" or something like that.
@crude blaze hihi
Closing because I think this has been resolved.
Closing as fixed upstream.
Closing because i think this has been addressed upstream.
I will close this, since it's fixed in 9.0.0. We could backport the fix to 8.2.x but having the workaround in the library is good for anyone running a slightly older version, so no need to backport.
Reduce the size of the root directory for a FAT12 filesystem on a tiny (<=128KB) flash device.
When oofatfs creates a filesystem it uses a default root directory size of 512. For most flash devices this is a reasonable choice, but for tiny flash devices this can consume a large portion of the flash. For example, a Trinket M0 has a 64KB filesystem of which 16KB is consumed by the FAT12 root directory.
This pull causes f_mkfs() to automatically reduce the FAT12 root directory from 512...
I will close this because it seems the problem is fundamentally missing level-shifting. @phantomsixthplayer thanks for all your testing.
@tulip sleet I'm having the same failure for explorerkit_xg24_brd2703a for en_US during CI of PR 8567 on main that I was hitting on 9.2.x. From the log, it looks like it may be related to the GitHub Python update.
i'll take a look
https://stackoverflow.com/questions/73742774/gcc-arm-none-eabi-11-3-is-not-implemented-and-will-always-fail but I don't know why it's only that board
and why it just started showing up
Mysterious. Anything I can do to help?
I was seeing the same warnings building locally with gcc 12.3.
but only on that board, is that right?
Can't say, it was the only one I tried.
the differences in the port/silabs/boards files don't seem consequential
I looked at those too, agree, nothing consequential. I wonder if SiLabs changed something in their SDK that's board specific? Are we picking a specific checkin or taking top-of-tree?
The reason I thought is was Python related was because of these messages:
if (not build_all) and (language is LANGUAGE_FIRST) and (exit_status is 0):
/home/runner/work/circuitpython/circuitpython/tools/../docs/shared_bindings_matrix.py:194: SyntaxWarning: invalid escape sequence '\d'
for m in re.findall('-D([A-Z][A-Z0-9_]*)=(\d+)', line):
/home/runner/work/circuitpython/circuitpython/tools/../docs/shared_bindings_matrix.py:218: SyntaxWarning: invalid escape sequence '\s'
"\s+:target:\s+(http\S+(docs.circuitpython|readthedocs)\S+)\s*",
Note: Not building languages {'cs', 'hi', 'el', 'ko'}
building boards with parallelism 4
That is a problem, but not a big one. non-raw strings now complain about undefined escape sequences. I can do a PR for that along with some miscellaneous things. I don't think it is related.
I am re-running the one failed job to see if it's intermittent (maybe build order). I think will ping the silabs person about this, assuming it still fails, to see if they have some idea. I am not too averse to merging 9.0.0PR's if only one board is not working
No problem for me to wait. Just concerned this will hit any subsequent pulls.
Watching that step run again. That's some amazing CI foo you've got there.
ok, it worked the second time 🤷
there is some reason why it happens, but I have no idea
How much space is saved if the limit is 64 entries rather than 32?
It takes two entries per file or sub-directory, so I set it to 64 entries in the pull giving 32 files or sub-directories in the root directory. Each entry is 32 bytes, so every additional 16 entries takes another 512 byte sector.
Fixes #8533.
Fixes some warnings in Python scripts that will appear due to Python 3.12.
// CIRCUITPY-CHANGE: For fewer than 256 clusters (128kB filesystem),
// shrink the root directory size from 512 entries to 128 entries. Note that
// long filenames will use two entries. This change affects only the root directory,
// not subdirectories
n_rootdir = (sz_vol <= 256) ? 128 : n_rootdir;
Here I've annotated the changes more, and also increased the number of entries to 128, since we have use cases for more files in the root directory.
Will these change given my change from 64 to 128 above?
// CIRCUITPY-CHANGE: Make number of root directory entries changeable. See below.
UINT n_rootdir = 512; /* Default number of root directory entries for FAT volume */
probably shouldn't overthink this, but modifying
oofatfs/ff.cdoesn't leave me completely comfortable. It's fragile code, so any changes are a risk. Also, changes complicate incorporating upstream fixes at a future date. On the other hand, this isn't the first CircuitPython mod tooofatfs.
As long as the changes are clearly annotated as // CIRCUITPY-CHANGE (as I did in the review), I think it's OK. The main thing is to make it easy to spot and understand the changes from upstream.
@tannewt I want to run this by you too.
@forem1 I could not reproduce this problem on a Pi Pico with your exact test program, and with CircuitPython 7.3.3, 8.2.7, and 9.0.0-alpha.2. For all of these, I saw both input and output on the data CDC port. I tested on Windows 10 Pro and Windows 11, Pro mostly with the Tera Term program, but also tested 9.0.0-alpha.2 with Termite and the Google Chrome terminal app. I opened both COM ports in Tera Term, and with Termite, I opened the data port in Termite, and the console port in Tera Term.
@deshipu Of course I totally agree with you about maintaining footprint compatibility. Unfortunately Wemos already broke footprint compatibility by not exposing U0RXD and U0TXD. Any confusion stems from their design decision. I don't think that CircuitPython should double down on that confusion by defining pins that the manufacturer did not.
Consider the case of users who have already used those pins for something else in their design. Or users who expect exception and first stage ROM boot...
@tulip sleet need anything from me? at my desk for a little while now
there are a few PR reviews, not a big deal
@bato3 It would be nice if "Wemos mini series are pin-compatible" were true, but due to Wemos' design decision on the S2 mini board, it's not. And yes, you can map UART signals to any GPIO pin - while your application is running. On this particular board there simply are no default UART pins even though there should be, which is why I believe that board.RX and board.TX shouldn't be defined. I'm only advocating not to make that change; I'm not offering an opinion on any other issues you ...
don't have to do them now
Hi, when I download a project bundle from a learn guide, there is a README.txt that start with
This bundle contains two folders, one each for CircuitPython 7.x and CircuitPython 8.x. You must use the files that match the version of CircuitPython you're using, e.g. if you are using CircuitPython 7, you will copy the files from the CircuitPython 7.x folder to your CIRCUITPY drive.
However, since a few days, the folder are CircuitPython 8.x and CircuitPython 9.x.
That file is likely dynamically generated as it say what is the download URL and download date... not sure where in Adafruit this is generated.
Maybe you should change the text, or find a version agnostic wording?
Thanks, I will check with the Learn Guide folks about this.
@tulip sleet split heap PR is ready for review too when you have a chance
I expect it'll need tuning before the stable release
what do you think of the "large stuff doesn't load" issues?
we can adjust the split size?
I wasn't sure if you wanted to tune before merging?
ya, we may need to tune it
I think it'd be better to get multiple examples and then look at it
maybe start an issue to collect examples, especially learn guide code that fails
one way to fix might be making more static allocations dynamic
I made the starting size a toml setting
and allocations will double after that I think
but we may need to tune how it works when running out of outer heap
kk, I merged your PR and approved another that is waiting on CI. feel free to ping me when you need to be unblocked
I can hop on my laptop as-needed
now time for daycare pickup
will do -- I'll review and merge, and I can release an alpha with big caveats
BTW the CircuitPython download page for the Lolin S2 mini doesn't promise footprint compatibility and mentions there's only a "high chance" of compatibility.
Perhaps to help stem confusion it might help to note "Because the board has no default RX and TX pins, CircuitPython does not define board.RX or board.TX"?
@dhalbert CI fail moved to another SiLabs board. It looks like timing:
Slcp parse warnings for /home/runner/work/circuitpython/circuitpython/ports/silabs/circuitpython_efr32.slcp
Referenced SDK Extension 'cp_efr32:1.0.0' could not be found.
Warnings loading project:
- Referenced SDK Extension 'cp_efr32:1.0.0' could not be found.
This warning appears only for the failing targets.
Perhaps the silabs/cp_efr32_extension path isn't getting signed in time for another parallel...
I apologize for continuing to post about this :) I have one of these boards and just remembered this.
There's an existing product called "Lumostick" which runs CircuitPython and embeds a Lolin S2 mini in its hardware, driving an LED matrix.
The Lolin S2 mini exposes GPIO37 and GPIO39 where RX and TX traditionally are on its footprint. Because these ar...
Is it possible to add larger PackSize to the lc709203f library or is the chip limited to a maximum size of 3000mah?
If it is limited can a code comment be added that 3000 is the absolute maximum size? I'm using it with a 10000mah battery and while it does work with a PackSize of 3000 I'm a little concerned it won't have an optimal lifespan using the wrong PackSize.
I'm using it with an older Adafruit ESP32-S3 Feather that has the lc709203f battery monitor chip.
https://www.adafruit.com/product/5035 there are also larger 4400 & 6600 mah batteries too
Looking at the datasheet (https://www.mouser.com/datasheet/2/308/ENA2237-D-321387.pdf) there doesn't seem to a limit. The values in the library are written to a register that says "Compensate for total impedance between the Battery and Fuel Gauge". So I think you could add more values but you would have to know what value to set. Or measure the impedance.
The only limit seems to be that is measures 1 cell batteries.
hmm I'm going to guess the double and triple 18650 packs have a BMS chip built in to act as a single cell. maybe it would work if I modified the library? will look into it and maybe do a PR if it works.
Speaker
When configured through an audiobusio.I2SOut interface, the speaker works as expected. Volume is louder than anticipated.
Example
Took this from the audiobusio example and modified the pins.
import audiobusio
import audiocore
import board
import array
import time
import math
# Generate one period of sine wave.
length = 8000 // 440
sine_wave = array.array("H", [0] * length)
for i in range(length):
sine_wave[i] = int(math.sin(math.pi * 2 * i / l...
3 of 5 pin labels for the trackball were incorrect, which has been addressed. I also took the opportunity to provide more user-friendly pin labels for the Speaker, Microphone, and LoRa modules.
This should be my final change for this PR. Thanks for your patience!
Trackball
Functional, but hard to know if it's working as designed. Fine input seems to be an issue with both the Sample Code (that comes with the T-Deck) and CircuitPython. However, when using countio, input resolution is improved.
Examples
Using keypad library, this treats each input as a keypress. The primary issue is that one unit of movement on on the trackball is one event transition. Meaning, it takes two units of movement to equate 1 full (press and release) event.
...
@romkey I still don't see how that is a problem. CircuitPython will not output anything on the default uart pins until you actually call board.UART() and create the uart object. Until you do that, you can use those pins for anything you want, including driving neopixels.
I'm also encountering this issue with D32 specifically, and the same board. All other pins marked as ADC1 (per above diagram) seem to work fine.
Using Wi-Fi as well, so I can't jump to ADC2 :<
This is really wonderful. It's so much simpler and more straightforward. I added a couple of CIRCUITPY-CHANGE annotations and will just add those in myself and the approve and merge.
// CIRCUITPY-CHANGE
bool gc_ptr_on_heap(void *ptr) {
// CIRCUITPY-CHANGE
// True if the pointer is on the MP heap. Doesn't require that it is the start
@bill88t @RetiredWizard
@tannewt and I discussed this. We will merge as is and then work on tuning to fix MemoryErrors.
Hmm, I've been doing some testing with this. It seems that a possible trigger for this is trying to use the ADC on D32 and D33 at the same time, but I can't reproduce this consistently.
I did some more testing on the Unexpected Maker TinyPico and this does seem to fix #7288. The memory error I was getting on loading my largest program also goes away if I don't include the wifi parameters in settings.toml. It's probably not surprising that enabling the web workflow stresses the available memory, but perhaps some additional garbage collecting around the web workflow could help?
Hey @alextremblay! Thanks for the ping, yeah I got caught up with life between that conversation and now haha. I'll take a look at it again this week when I have some time and try to get the PID stuff sorted out. I'll be sure to post updates to this thread =)
Update (quick I know ;) ) : Filled out the application w/ the Raspberry Pi org for a PID, once I hear back will update here and update the VID/PID in the PR.
@deshipu The assertion is that the Lolin S2 mini is footprint compatible with the original D1 mini and therefore should have the same pins made available through board.
It is not. The manufacturer's own technical documentation shows that it is not. I've been sharing examples of how it is not, including an existing product built using it that runs CircuitPython that would not even work if it were footprint compatible.
This is a problem that the manufacturer created when they designed...
I think that if someone designs their product based solely on how pins for a part are defined in a third party product like CircuitPython, then they have bigger problems than whether there is a default uart defined. It seems like you are arguing for the sake of winning the argument by now, not for any practical reason.
If we add a default UART object to the S2 Mini, it will work perfectly fine, and it will save some code and checking pin numbers for anyone using a shield that uses an UART....
CircuitPython doesn't exist in a vacuum. If it were irrelevant what happened before CircuitPython booted then footprints wouldn't matter outside of power and CPU control pins, and on CPUs that could accommodate it, CircuitPython could just declare that pin 1 was always RX because wouldn't that be nice for everyone? Having different pin definitions inside and outside of CircuitPython seems a sure recipe for more confusion.
I actually really like the manufacturer; I've used the D1 mini and t...
I would like to cool this down. I think different people have different definitions of the word "default".
On Adafruit CircuitPython Espressif boards, we are generally careful not to assign TXD0 and RDX0 to board.TX and board.RX, because they are special and can send data during boot, etc. We are also careful not to label those pins as just "TX" and "RX" on the silkscreen: we use "TX0" or "TXD0" and "RX0" or "RXD0".
However, we have many third-party boards (see the list below) th...
Would adding exception() / result() to _asyncio's Task class count as a breaking feature? I'd assume not. Just curious before I dig in.
no, it's upward compatible
Wicked.
you could consider proposing it for MicroPython and submit it upstream as well
we'd put it in 9.x in any case
I'll take a peek
Can't be too much harder to add them there. Not like it'll actually do anything yet, either. Needs support via the asyncio lib for that.
I'm poking around Scott's split heap PR trying to figure out (without much luck) where the mechanism is that doubles the heap allocation size. Have you looked at it close enough yet to get me pointed in the right area?
I had a pretty contrived example of another bad thing that can happen that I totally won't post now :)
I know that my advocacy here has been frustrating. I'm not trying to be a troll, just trying to fight entropy and I'm sorry for being annoying. There are going to be confused and frustrated users no matter how this matter goes.
this behavior is inherited from MicroPython. See gc_try_add_heap() in py/gc.c. Scott has switched us over to using this.
Thanks that's close to where I was, just wanted to make sure I wasn't wasting my time trying to figure out exactly what's going on in there 😄
There are going to be confused and frustrated users no matter how this matter goes.
Yes, it's about reducing the support burden, and often there's no good choice. As another example, we didn't provide board.I2C(), etc. on the Pi Pico. This was not so much because there weren't silkscreen markings, but because there were different "default" I2C pins defined by different language implementations and also different educational material. See #4121. "That's the great thing about standards: ...
I'd remove the SPI_ and I2C_ prefixes because that's how the other boards name these pins.
Edit: Just realizing web workflow is C based, garbage collecting probably doesn't apply 🤷
I have also caused the memory error upon load without web workflow enabled by attempting to load an even larger program.
Ya, it doesn't do garbage collecting. With the split heap work, IDF allocations will be intermingled with CP heaps rather than leaving the PSRAM exclusively for CP. It won't work for ever larger programs unfortunately.
@dhalbert CI fail moved to another SiLabs board.
I just reran the test and it worked ok. Makefile race condition seems likely.
CircuitPython version
CircuitPython 9.0.0-alpha.2 on Adafruit Feather ESP32-S3 4MB Flash 2MB PSRAM (and I guess everything on the espressif port
Code/REPL
import audiobusio
with audiobusio.I2SOut(bit_clock=board.A0,
word_select=board.A1,
data=board.A2,
main_clock=board.A3
) as audio:
pass
Behavior
I'm get NotImplementedError: main_clock
Des...
That was me
Moving here the chat we had in the general chat
I use CP 9/ESP32-S3 and I'm getting NotImplementedError: main_clock when I try to use the I2SOut class. Is full mclock support in the roadmap? Can I pair with someone to help implement that? I attempt to use ESP32-S3 with SGTL5000.
Note that for the SGTL5000 the MCLK has a PLL that allows you to use any convenient clock signal that is 8-27 MHz. So for now maybe you could hook up the MCLK input to a PWM output, assuming it will run that high for Espressif.
CLOCKING
Clocking for the SGTL5000 is provided by a system
master clock input (SYS_MCLK). SYS_MCLK should be
synchronous to the sampling rate (Fs) of the I2S port.
Alternatively any clock between 8.0 and 27 MHz can be
provided on SYS_MCLK and the SG...
Great idea! I used a signal generator to give it 12MHz and SGTL5000 "woke up" and started to respond in I2C, but I2S wasn't working. Turning the PLL on and doing lots of configuration is a nice interim solution.
Looks like PWM will do 12MHz:
import pwmio
p = pwmio.PWMOut(board.IO6, duty_cycle=32768, frequency=12000000)
A couple of other datapoints:
CircuitPython 9.0.0-alpha.2 on a plain old ESP32 is able to connect to wifi
The ESP-IDF wifi example worked on a C6 when I built it with ESP-IDF 5.1.1. Haven't tried it with other versions of ESP-IDF yet. So that and Arduino 3.0.0-alpha2 are two instances of wifi working on the C6.
I'm happy to try out other test builds for you if that would help.
well, that looked easy! did you test your PR and does it work?
That's great! If only it was in sync with SCLK and LRCLK, it would save us from the extra configuration and the power consumption of the PLL.
"That's the great thing about standards: there are so many."
Also, "No plan survives contact with end users" ;)
Yes, it looks kind of straightforward since the functionality is already there in Espressif API.
did you test your PR
Not really. I will have to setup the toolchain (...) Do you have a label to flag the PR "on hold" for test?
when it finishes building you can download a build artifact and try it. Artifacts will show up below the "graph thing" on this page when it has finished
I'm also thinking about making a clone of AudioControlSGTL5000 from Teensy as a device. It has some interesting utilities in there.
just add a comment about your testing results
Quick question - what's the easiest way to build in an AWS machine e.g. Ubuntu? Is there any kind-of oneliner script?
yep, you're on the right track, and if the artifact works for you, we can merge, and then there will be a build after that finishes in https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin
lol - esp-idf prerequisites is like everything... golang, java... I hope I'm wrong and it's just yum doing housekeeping
there are lots but not those 🙂
LoRa
There doesn't seem to be a CircuitPython-specific library for the SX1262 series of LoRa modules, but the one for MicroPython should work. However, the library tries to build the SPI interface rather than accepting a SPI object. Since the CircuitPython build initializes the SPI on start-up, when the library tries to initialize it, the pin in already in use.
Traceback (most recent call last):
File "code.py", line 6, in <module>
...
Looking a bit at the issues for micropython I'm less inclined to start with their repo for trying to bring asyncio closer in line with CPython's implementation of task.
It looks like it has been discouraged a number of times for the (not so incorrect) belief that the way CPython does things for asyncio is more complex and doesn't offer value over what exists and works. I'll stay on the optimistic side that these were comments relating to prioritization efforts - and if they were offered a pull request they'd be thankful.
As far as code goes, the modasyncio implementations are near-identical, so the same changes could probably be applied to both pretty easily.
But with all that in mind I'll code it first against CircuitPython & then port it usptream to micropython. 🤷 Just to optimize my efforts.
But onto a bit of a question -- if I'm implementing some python methods in C and need it to throw an error - in this case CancelledError - do I need that error available at runtime or compile time? In other words, do I need to pull that out of the asyncio external module and implement an error in _asyncio?
I think during compile time so I'd have to define it as part of the modasyncio.c but I'm not the most familiar with circuitpython internals.
Beeps nicely! It even plays MIDI :D
with audiobusio.I2SOut(bit_clock=board.A0, word_select=board.A1, data=board.A2, main_clock=board.A3) as audio:
init_sgtl5000()
melody = synthio.MidiTrack(b"\0\x90H\0*\x80H\0\6\x90J\0*\x80J\0\6\x90L\0*\x80L\0\6\x90J\0" +
b"*\x80J\0\6\x90H\0*\x80H\0\6\x90J\0*\x80J\0\6\x90L\0T\x80L\0" +
b"\x0c\x90H\0T\x80H\0\x0c\x90H\0T\x80H\0", tempo=640)
audio.play(melody)
![53ABC13D-DB99-4F2C-A60...
When you said "finish building", I thought on my own build system. So I spend an hour to make it build in a linux VM from scratch. The instructions were quite up-to-date. With some tweaking I got it to start building. Then I got some errors like .espressif/espidf.constraints.v5.1.txt doesn't exist and later /../esp-idf/components/newlib/reent_init.c:29:6: error: 'struct _reent' has no member named '__sdidinit'.
At that point I realized that likely you didn't mean that. So I found the artifact on the build system and set it up and after some debugging of my test code, it worked pretty great.
Regarding that - micropython-sgtl5000 looks pretty ok.
@deshipu you stuck to this UART, and the problem is that the SCK, MISO, MOSI lines are defined, but there is no board.i2c().
Problem:
As everyone knows, there are only numbers on the Lolin s2 mini board.
The problem is what you get when you type "Lolin s2 mini pinout" into Google. This is either an official pinout from Wemos, without I2C/SPI, or an "independent" work, not as defi...
I'm assuming you did esp-idf/install.sh, and then source esp-idf/export.sh before you did the build. Is that right? Also you mentioned yum so you were using redhat or Centos or Fedora? We've never tried building on those platforms, so we're not sure how they would work out.
yes, it looks easy to modify
I suggest this to start:
- Make the S2 mini and S3 mini as consistent as possible, given that there are add-on boards (an "ecosystem") that expect I2C, etc. to be in certain positions.
- Remove all the
Dnpin aliases, because they don't seem to be consistent, and are not on the original Wemos diagrams. There are several third-party diagrams, but they are not official, as you point out. - Maybe remove the
Anpins also, because their numbers correspond to analog peripherals, not GPIO n...
Or we can just add the missing UART, I2C and SPI, in a way compatible with the D1 Mini footprint, and let people decide if they want to use it or not.
Note that this is not the first time this is being discussed. You can refer to:
- #5297
- #5467
- #8014
Do the add-on boards all (or nearly all) use the same pins for I2C? If so, add board.I2C() as appropriate.
Yes, there is a great number of various sensor boards that use I2C, and following a trend set back in the ESP8266 days by Arduino, they all use D1 Mini pins 4 and 5. A lot of other boards that are not compatible with D1 Mini also use pins 4 and 5 for I2C, I have even seen that on Pi Pico shields.
I also made a number of shields for the D1 Mini myself, and even sold a couple hundr...
@tulip sleet I've been successfully debugging with PicoProbe and OpenOCD and have some hints that I'd like to share. It looks like the place for them to go is BUILDING.md. Are there any special steps I need to take for this kind of doc pull request?
We tend to write up that sort of thing in Learn Guides instead of in the repo. For instance, https://learn.adafruit.com/building-circuitpython is more authoritative, complete, and up to date than what is in the repo.
Consider using the new Adafruit Playground system: https://adafruit-playground.com/
i could add a link to your playground writeup from the Building guide
Got it. Playground looks, well, fun. Another quick Q: I'm close to a proof-of-concept pull for your "bad blocks" idea to get to FAT16. Is there anything special I need to do to make a "pull for discussion but don't merge"?
you can open it as a draft PR
re README-type files: I know there is this tendency to say "everything you need to know is in the repo", but different communication modalities can work better for different purposes.
the problem is always keeping things up to date
Agreed.
If you run into Playground bugs (and there are definitely bugs), report them here and we'll pass them on or send to support@adafruit.com.
Thanks for the tips!
Anyone tried macOS 14.2 beta 1 and 2? Any glimmer of hope for a usb resolution?
i could update to these and try. I only use macOS for testing, so no problem to upgrade.
Thanks Dan.
Awesome! From one Canadian to another, Thank you!
I think I am not going to update the frozen modules in the next 8.2.x release, because it's a lot of churn that could cause breakage in what is supposed to be a stable release.
If anyone has a specific frozen module they think should be updated in 8.2.x, could you open an issue for that? I will update frozen modules in main, though.
@romkey I tried your disk image test on Sonoma 14.1.1 and could not generate errors. However, I was still seeing delayed writes when using Mu with a Pi Pico. What should I do to provoke errors?
I made the image on Linux as described above, and scp'd it over to the Mac
halbert@Mac-mini ~ % diskutil image attach EIGHT_MB.img
/dev/disk4 /Volumes/NO NAME
halbert@Mac-mini ~ % cat >foo.txt
abc
halbert@Mac-mini ~ % cp foo.txt /Volumes/NO\ NAME
halbert@Mac-mini ~ % cp foo.txt /Vo...
ESP32-WROVER_B based device with attached peripherals.
Yes, it was even more wild. It was the amazon operating system for AWS EC2. I did run those commands, yes. There's also a shortcut get_idf they suggest on their guide since you don't know the exact installation path/directories in every case. https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/get-started/linux-macos-setup.html#step-4-set-up-the-environment-variables . What OS do you use with your github build workflow? I think I see ubuntu-22.04. Ok, I will also try that just to make sure I have a nice build environment around.
I use Ubuntu 22.04, and most others do. Scott uses Arch, which gets new compilers faster. Some people use WSL with Ubuntu under Windows, but it has pretty slow disk I/O, or at least it used to.
Ubuntu 22.04 here, too. I also use the latest gcc 13.2 toolchain from Arm: https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads
Arm Developer
Download the Arm GNU Toolchain, an open-source suite of tools for C, C++, and Assembly programming for the Arm architecture.
hmm, looks like asyncio is broken in 9, is that expected? it seems to stay in the main loop and never runs any tasks
we didn't know that it's broken, but it's expected there are bugs
it passes the tests.
did you update to the latest asyncio library version?
There doesn't seem to be a CircuitPython-specific library for the SX1262 series of LoRa modules
https://github.com/adafruit/Adafruit_CircuitPython_RFM9x is for a module with a SX1276 inside.
I updated to the latest Developer Beta (I am in the developer program, for testing reasons). No luck, seeing delayed writes, and sometimes I/O errors
I did not
I will try tomorrow
Bummer. Thanks for testing, Dan
Broken how?
I've been looking at it a lot lately, would be happy to help with debugging / work through problems.
I was able to run it (though not as mpy) without too much issue today with a simple example.
I may be jumping the gun on this a bit, but I've had a little time and started playing with the memory allocation values for the Espressif port and thought this would be a good place to follow the progress.
Ahh, bummer 😦 Thanks for trying though.
I've been focusing on running large python scripts that churn through lots of memory. Setting the memory allocation up so that it always grabbed 512 bytes (256 or less didn't appear to work at all), vastly increased the length of time my largest test programs would run. I'm thinking for the test category I'm looking at (which I know is not a common use case), a non increasing small allocation is the best edge case but based on the comments in py/gc.c -> gc_try_add_heap() will lead to frag...
@slender iron I am working on a 8.2.x -> main merge, and I will update the frozen modules. Maybe after that is a good time to do an alpha.3
This is fine with me! Thanks for the investigation!
@tulip sleet sounds good. Looks like some qualia code doesn’t run with split heap
A couple reports of it on the forums
I asked them to file an issue because I’m not sure when I’ll have time to get to it
i have a qualia board and can take a look when the issue comes up
@dhalbert Thanks for trying to confirm this. I'm a lot more comfortable if other people are able to confirm it.
Are you on an Intel or Apple Silicon Mac? I think someone had previously suggested it might only be a problem on Apple Silicon.
I'm using an M2 15" MacBook Air. Still running Sonoma 14.1, I oddly haven't updated yet.
It sounds like we're doing the same thing, I'm not sure what might be different.
I just re-ran the test and am still seeing the problem.
On Ubuntu 22.04....
@atomic summit I am merging 8.2.x into main and I have to redo some aspects of board defs. You have two new boards, the bling and the tinywatch. a few q's and I'll have more maybe as I proceed?
Does either board have PSRAM? If so, what size, mode (dio/qio, etc.) and frequency?
CONFIG_LWIP_LOCAL_HOSTNAME="UMTinyS3" on the bling, is that right?
All have PSRAM - Bling & TinyWATCH have 2MB, QIO.
That should be CONFIG_LWIP_LOCAL_HOSTNAME="UMTinyWATCHS3"
Sorry 😦
@romkey I updated my M1 Mac Mini to 14.2 Beta (23C5041e). This is the latest developer beta. I don't get the errors you are seeing when copying files to the disk image. But I do still get errors when copying to an 8MB CIRCUITPY drive. Copying to a 16MB CIRCUITPY drive is ok. I also get err
I double-checked the disk image and it is 8MB and FAT12. I created it with exactly the same commands you did. Only the name is different.
and UMBling for the BLing!?
CircuitPython version
Adafruit CircuitPython 9.0.0-alpha.2-18-gb7b62873f8 on 2023-11-08; Adafruit-Qualia-S3-RGB666 with ESP32S3
Code/REPL
import adafruit_qualia
Behavior
Traceback (most recent call last):
File "", line 1, in
File "adafruit_qualia/__init__.py", line 32, in
File "adafruit_qualia/network.py", line 31, in
File "adafruit_portalbase/network.py", line 28, in
File "adafruit_io/adafruit_io.py", line 30, in
...
@dhalbert I just ran the test again with exactly the commands you used, and I don't see the error either.
I tried individual cp commands with longer filenames and didn't get the error. I also tried larger files and manually copying didn't get the error.
I do still see the errors while trying to copy that batch of Python files, though.
It appears to be timing-related. I created a shell script to copy the files one at a time with individual cp commands. It caused the errors. I modifi...
If you have a chance would you mind trying that, copying a bunch of files quickly like with a wildcard or in a shell script with no delays between the copies?
Besides the simple copying of tiny foo.txt, I also copied a substantial batch of .py files, and could not get the error. But they are all pretty small files, I think. So I'm not worried we are getting different results. Since it's still reproducible on real boards, unfortunately, we'll just have to keep trying the betas.
@romkey I think your test is valuable to submit to Apple, because it requires external components. If you could reliably reproduce it with a canonical set of files, then the whole thing could be submitted to Apple Feedback. I thought someone gave a Feedback report number to cross-reference, but I can't find it right now
This is the same behavior that led me to open #8573.
@UnexpectedMaker could you look over the revised files for your boards? Thanks.
I found the "breaking version". This version allows me to import adafruit_qualia without error:
Adafruit CircuitPython 9.0.0-alpha.2-16-gccd667d97a on 2023-11-06; Adafruit-Qualia-S3-RGB666 with ESP32S3
This subsequent version does not:
Adafruit CircuitPython 9.0.0-alpha.2-17-g01be5f402e on 2023-11-08; Adafruit-Qualia-S3-RGB666 with ESP32S3
I saved the Feedback report number and referenced it when I filed a feedback: Feedback FB13226668
@dhalbert Thanks, I submitted the USB stick test as feedback to them quite a while back and referenced the other feedback number as well. I'll try to package it up and update the feedback with the current info. Maybe we should try to drum up some popular, polite feedback to them on the issue to help get them to pay attention.
@dhalbert That aligns with my philosophy on these kinds of issues. Thank you for weighing in, I'm sorry this is consuming any of your time.
@jacobmarble Try placing CIRCUITPY_HEAP_START_SIZE=1024000 in your settings.toml file.
I tried CIRCUITPY_HEAP_START_SIZE=1024000 with adafruit-circuitpython-adafruit_qualia_s3_rgb666-en_US-20231109-3ca9802.uf2 and it still gave pystack exhausted.
I tried adafruit-circuitpython-adafruit_qualia_s3_rgb666-en_US-20231106-ccd667d.uf2 and this worked for me.
This updates the way that Task is handled in the C module for asyncio which implements tasks & task queues. This adds the following methods to Task:
get_coro()- how CPython exposes the coroutine backing the taskresult()- a helper method from CPython for returning the successful responseexception()- a helper method from CPython for returning the raised valuescancelled()helper for true / false if the task has been cancelled
Moves CancelledError & creates `In...
I'm sorry if you got the impression that I was rude. I could have been carried away by emotions. (I use Google Translate for this - my English is too poor).
I'm looking for someone with whom I could repair at least a small part of the world. If this does not agree with the rules adopted by the Circuitpython maintainers - then I accept it. (Not that I like it, but I don't have enough energy to discuss politics.)
OT: I looked through the Wemos github, and it looks abandoned.
Cu...
@tulip sleet Do you think there will ever be a use case for an internal flash drive in excess of 32GB? I'm trying to decide whether to support ExFat for the internal filesystem in some virtual MBR improvements that are part of FAT16 proof of concept I'm working on.
I think this is a future-proofing issue? Supporting ExFat is certainly do-able, so now might be the time to take it on. I can fence it with FF_FS_EXFAT so it doesn't bloat tiny ports.
to be honest, I don't see you ever wanting to juggle that much data with a poor little tiny microcontroller
Yeah, it's a lot of data. The trouble is that CP kinda supports ExFat for its internal filesystem already, albeit with a misreported virtual MBR.
would it save space to remove that support? ;3
Now that I think about it, you could hit the case where CP makes an internal ExFat filesystem on a Broadcom port with a large SDCard.
Only at the expense of losing ExFat for SDCards.
I found some small mistakes in the French (fr) translations.
boo
Yes, I was going to mention that. Note that overall control for CircuitPython is via MICROPY_FATFS_EXFAT
Build is failing due to \s in non-raw re strings in some Python scripts, caused by Python 3.12 upgrade. Merging #8575 will fix that so this can proceed.
OK, ExFat it is. As it stands, the "fake", i.e. virtual MBR always reports a FAT12 partition for the internal flash filesystem. For bigger flash, like the 16M device on the RP2040 Metro, the virtual MBR returned by USB MSC is wrong and might cause problems with the host OS. I can split my new virtual MBR code into a separate pull if you like.
I think the only reason we have a virtual MBR is to save flash on the tiniest systems. Is it worth conditionalizing that so you can use real MBR when there's room?
are we saving just 512 bytes, or how much, with the virtual?
given your space-saving improvements on tiny filesystems, maybe the virtual is more trouble than it's worth. I don't remember if that's our change or it comes from MicroPython.
@supcik Are you willing to make the changes through weblate? See https://github.com/adafruit/circuitpython/issues/1098. That helps us manage this better, automatically. THanks.
You should try both the CIRCUITPY_PYSTACK_SIZE and the CIRCUITPY_HEAP_START_SIZE parameters. I tested the adafruit_qualia library and setting those two parameters allowed the library to load.
Interesting thought. I'd wondered why we were making a virtual MBR to begin with. Getting rid of it would cost one 512B sector, but would save some code space plus simplify flash.c. oofatfs has code that constructs a perfectly usable MBR which we currently throw into the bit bucket.
Yes, with the big improvement on 64kB flash systems, I'd just as soon get rid of that code. It might be something that is provoking issues with various third-party disk utilities, especially on Windows (though maybe not, who knows). And gaining back more code space on tiny systems is very good.
We really appreciate your work on all this!
The down side is the transition. Let me think about how that would work.
ah, yes, you mean the old filesystems are not compatible. hmmm.
Any history of forcing a filesystem reformat with a new major release?
OK. I'll do that. Thank you for your reply.
@supcik Given how many changes you already made, I'm happy to merge this as is, so you don't have to redo the work, and then if you use weblate in the future, it will submit PR's automatically.
we have changed the sizes of filesystems on certain boards, yes, with warning. In https://github.com/adafruit/circuitpython/releases/tag/8.0.0
Warning
The flash partitioning for 2MB and 4MB flash ESP32 and ESP32-C3 boards has changed since 8.0.0-beta.2.
When you load 8.0.0-beta.3 or later over beta.2 (or vice versa), on these boards, CIRCUITPY will be erased and reformatted.Warning
The flash partitioning for the Raspberry Pi Pico W has changed since 8.0.0-beta.1.
When you load 8.0.0-beta.2 or later over beta.1 (or vice versa), on the Pico W, CIRCUITPY will be erased and reformatted.
this was from beta to final for new boards. I'm not sure we have done it for existing boards.
maybe there could be some heuristic about not seeing what looks like an MBR in the zeroth cluster and using a fake one instead. On storage.erase_filesystem(), a real MBR would be added. But switching versions back and forth over the boundary would be painful.
This is something to discuss with @slender iron, and we'll discuss it internally as well.
Good deal. In the meantime, I'll think about your heuristic idea.
learned about CIRCUITPY_HEAP_START_SIZE in a PR, maybe there are more new ones... are new "standard" environment variables going to be documented at https://docs.circuitpython.org/en/latest/docs/environment.html? (settings.toml file)
@tulip sleet Here's a weird, possibly bad idea. The data structures in a "standard" MBR don't overlap anything but the boot code area of a VBR. That includes an ExFat VBR. So, how about putting an MBR into the VBR of an existing filesystem? The "overlaying" MBR's first partition would point to block 0, so a host OS would find the existing VBR and the existing filesystem. Maybe. A reformat would wipe this kludge and put the filesystem's VBR at block 1. Interestingly, that the MBR and VBR boot signatures are the same and that they don't overlap leads me to think this might have been designed in, although I can't find any doc that says this explicitly.
I don't know enough about this to understand if it would work. Are our filesystems partitioned? What I read says that an unpartitioned filesystem (e.g. a floppy) has just a VBR. Do we already have an MBR followed by a VBR?
Yes, we present a fake MBR for all internal flash filesystems for all ports (including the Broadcom port).
and that MBR lists one partitiion, and points to a VBR?
I should just look at the code...
Any external filesystem gets a real MBR courtesy of oofatfs. Yes, the fake MBR points to the VBR.
supervisor/shared/flash.c flash_read_blocks(). hmm, the MBR always says the first partition is FAT12. Why does this even work for larger CIRCUITPY's >32MB?
Good question. By the way, that's the root cause of failure to mount on Android.
just because Android doesn't support FAT12 at all?
Weirdly it supports FAT12. It just doesn't like the FAT12 partition type.
so, from https://en.wikipedia.org/wiki/Partition_type, it does support part type 04 and up?
I did try other partition types, and yes it does. The rub is that if I put a FAT12 in another partition type it works on MacOS and Windows. My Ubuntu 22.04 blows chunks though, to the extent that a reboot is necessary to get automount working again.
OK, it now occurs to me that the answer could be to simply elide the MBR on ports so small they can only support FAT12.
Here's my current code for determining the correct partition type:
// Determine filesystem's partition type
// Note: Expects only FAT12, FAT16, or FAT32. No EXFAT support.
uint8_t fs_fat_bits = (fs_clusters < 4085)? 12 : (fs_clusters < 65525)? 16 : 32;
if (fs_heads_per_cylinder > 255 || fs_sectors_per_track > 63 || fs_sectors >= 65536) {
if (fs_fat_bits != 32) {
part_type = 0x0E; // FAT16 (LBA, >=32MB)
} else {
part_type = 0x0C; // FAT32 (LBA)
}
} else if (fs_fat_bits == 12 && fs_sectors < 65536) {
part_type = 0x01; // FAT12 (CHS)
} else if (fs_fat_bits == 16 && fs_sectors < 65536) {
part_type = 0x04; // FAT16 (CHS, <32MB)
} else if (fs_fat_bits != 32 && fs_sectors < fs_sectors_per_track * fs_heads_per_cylinder * 1024) {
part_type = 0x06; // Big FAT16 or FAT12 (CHS)
} else if (fs_fat_bits != 32) {
part_type = 0x0E; // Big FAT16 (LBA, >=32MB)
} else {
part_type = 0x0C; // FAT32 (LBA)
}
There doesn't seem to be a CircuitPython-specific library for the SX1262 series of LoRa modules
https://github.com/adafruit/Adafruit_CircuitPython_RFM9x is for a module with a SX1276 inside.
There's a pinout difference between the two chips the SX126x and the SX127x that leads me to believe that the RFM9x library is incompatible. The biggest being the presence of the BUSY pin on the SX126x.
As soon as I can get a receiving device to ...
i have to go out, sorry. Do you mean elide the MBR in favor of the VBR? Is this forward-compatible -- I'm just considering if you flip back and forth between 8.x.x and 9.x.x, with or without reformatting in 9.x.x with the new format.
No problem, get back to me when you can. If we elide the MBR is would be both forward and backward compatible. Pre-9 would continue to fake the MBR, 9 would elide it without altering the underlying filesystem. For filesystems larger than FAT12, we'd continue to present a fake MBR using logic similar to above for 9 and above.
that would be really interesting to test on all these platforms
so the fake MBR would not use partition type 01h, but something appropraite, is that right?
eventually we could drop the fake MBR, but break backward compatibility
I'm tooled up here to test the various host OSs. Elision is any easy change, let me try that first and get back to you.
we may be willing to have a break at 9.0.0 in any case. there are plenty of other things that are changing. The cleanest thing to do is to present a proper real MBR, I guess, though 01h still breaks Android, so making small filesystems work on both Android and Linux does not seem possible, unless we always do the fake FAT16
maybe fake vs real is not such a big deal, it's more making it more accurate. It does reduce the code size a bit, but only a bit
I can't help thinking (hoping) that there's a magic combination of MBR partition type or MBR elision and FAT12 that will work for everything, call it the "unified field theory of partition IDs".
unfortunately programming is more like law than physics
They don't call some of us "language lawyers" for nothing.
@tulip sleet Eliding the MBR didn't work out, but I found a partition type that does! When I initially tested alternative partition types, I didn't try 0x06 (Big FAT12/16 CHS). Gave it a try, and it is the magic number that works on Android, MacOS, Linux, and Windows.
Changing the partition type code reported in the fake MBR for the CIRCUITPY filesystem from 0x01 to 0x06 allows CIRCUITPY to mount on an Android system. Resolves #2751 without switching to FAT16.
Tested on Android, MacOS, Windows and Linux.
Change does not affect existing CIRCUITPY filesystem on device.
Are you able to test on iOS also?
Great! If you can test on iOS that would be great, else I can.
I lack a USB adapter for my iPhone, so please do.
I'm going to put the virtual FAT16 work aside and go back to my RP2 bluetooth work. Funny how sometimes a tiny fix can resolve a big issue.
Tested on an iPad running OS 17. Seems fine, works same before and after. On a Samsung Android 11 tablet, both a Trinket M0 (64kB) and a CIrcuit Playground Bluefruit work fine with the fix. They identify as "USB Storage 1", not CIRCUITPY, in the Files app.
This is a great advance. Thanks so much!
tested on an iPad running OS 17. Seems fine, works same before and after. On a Samsung Android 11 tablet, both a Trinket M0 (64kB) and a CIrcuit Playground Bluefruit work fine with the fix. They identify as "USB Storage 1", not CIRCUITPY, in the Files app.
Shows up as CIRCUITPY on Android 10. I don't think it's an issue.
may be some peculiarity of the Files app in Samsung Android
I wonder if this improves the Sonoma situation, or it's still an "8MB and under" issue
Tried it, no joy. Sonoma that is.
That's the only reason I can see to keep on with the fake FAT16. But even if that did work, it's not a complete fix. All the loaders would need to be reworked, too.
It's really an Apple bug that needs fixing, we shouldn't have to work around. ... Did you ever get anyone's attention there?
Tried through an old contact in Dev support, but no reply. All my old droogs in CoreOS have left.
thanks for trying, in any case. They did eventually fix the Ventura UF2 problem. RPi was banging the drum on that case, so it was more public. Not sure how much this affects their general Pi Pico user population. The RPI-RP2 fake drive appears as a much larger drive, so it's not incredibly affected, but it might still do some write delays on that. I haven't looked carefully.
I've been checking up on the feedback issue I opened. Still ignored, and still showing no similar reports despite others cross referencing it.
How about direct action? I could load up the car with some 5 gallon plastic pails and some past-their-pull-date hippies to drum them and stage a protest outside their new HQ.
tell them to fix MTP once you are at it, that would solve all filesystem problems once and for all
and we could use something a bit more modern than fat then
The Sonoma bug also affects more than just CircuitPython devices; I'd hope that other communities might also try to push back on them.