#circuitpython-dev
1 messages · Page 38 of 1
👍 thanks!
What exactly is the format of your MP3 files? CircuitPython can really only do low-bitrate MP3s. For RP2040, I'd stick with mono 64kbps data rate at and 22050 sample rate.
heyya, a big cause of stack usage is the NLR buffers
you might be interested in https://github.com/micropython/micropython/pull/11445 (just merged this week) which was added specifically to reduce stack (and let us implement https://github.com/micropython/micropython/pull/11421 without using even more stack). there's some commentary there about the savings
NLR buffers are usually quite large (use lots of C stack) and expensive to push and pop. Some of the time they are only needed to perform clean up if an exception happens, and then they re-raise t...
@makermelissa this now works without crashing for me on my test setup, including when I exit the REPL.
Part of testing this PR will need to be going back and testing all the other micros that have rgbmatrix because they may be affected by the protomatter update or my re-org of what happens during interpreter reset to preserve the display.
This change is taken from the pico-sdk: https://github.com/pimoroni/pimoroni-pico/blob/main/drivers/uc8151_legacy/uc8151_legacy.cpp#L67-L120 and increases the contrast of pictures sent dramatically. It comes with the expense of using way more time when updating though.
Thanks @vale spire I was seeing the nlr struct as 52 bytes a piece. We were up to 216 for the full frame due to inlining.
Wow, thank you so much, that was really fast. ❤️
You timed it well to hit when I was doing my e-mail/GitHub rounds. :-) :rocket:
requested change done -- thanks!
One suggestion. Otherwise good. Thanks!
That would definitely make sense. Thanks for doing a bisect too! I did one but forgot to update submodules along the way and use a newer compiler.
@slender iron @onyx hinge I have an 8.2.0 beta 1 prepared and will do it as soon as some pending builds complete correctly. It has all the synthio changes, the stack-frame slimming, and other rather minor stuff.
nothing else I see in the PR's is urgent
very nice!
minor problem in github right now: closed PR's are all marked as "Review Required". I have opened an issue with GitHub about this.
Automated website update for release 8.2.0-beta.1 by Blinka.
I'm still seeing this issue with recent NRF52840 boards using the Adafruit core. Could someone give me an example of Arduino code that would implement the workaround, or is there a better workaround at this point? Thanks!
yay i will test on hardware once there are artifacts
Hello, please can somebody give me some information about this? Many thanks
https://discordapp.com/channels/327254708534116352/537365702651150357/1115414147748855900
The adafruit requests library works on the Pico W, so it's not mandatory to only use an ESP chip
@tulip sleet any idea what's up with this PR build? It's failed a couple times on the scheduler "set up submodules" step with no useful info visible. https://github.com/adafruit/circuitpython/actions/runs/5216407307/jobs/9428497119
subprocess.CalledProcessError: Command '['git', 'submodule', 'update', '--init', '--depth=1', 'extmod/ulab', 'lib/', 'tools/']' returned non-zero exit status 128.
Error: Process completed with exit code 1.```
oh it's probably due to not finding the ref in protomatter, because it's the subject of an active PR .. but due to the lack of visible output that's just a guess
The CI actions don't use my new script or make targets, so I think it's what you said. I haven't yet looked at updating the CI to use a newer git and use partial clones
Anybody tried an nrf board lately? I have a CPB that starts fine with 8.1.0 but not with 8.2.0-beta.1. I'll take a bit of time to bisect it before filing an issue.
there don't seem to be any recent nrf-specific changes so that's weird
could it be a bootloader issue ?
Adafruit CircuitPython 8.2.0-beta.0 on 2023-05-24; Adafruit Circuit Playground Bluefruit with nRF52840
Board ID:circuitplayground_bluefruit
UID:0A629303D56807CF
boot.py output:
@tulip sleet do I have to use nrfutil to update this uf2 bootloader? ```UF2 Bootloader 0.2.11-8-g2c13fd5-dirty lib/nrfx (v1.1.0-1-g096e770) lib/tinyusb (legacy-755-g55874813) s140 6.1.1
Model: Adafruit Circuit Playground nRF52840
Board-ID: nRF52840-CircuitPlayground-revD
Date: Jul 13 2019
@jaunty juniper what's your tinyuf2 version at?
yeah absolutely, the old bootloader can't install UF2 with a payload over 512kB, which CP8 has gone over, I'm actually surprised it installs 8.1.0 at all
I think the issue I'm having is actually https://github.com/adafruit/Adafruit_nRF52_Bootloader/issues/213
yeah, we mentioned it a few weeks ago
Yes, carter was investigating this and was able to upgrade that way
I prefer using the arduino IDE to install the bootloader (it installs 0.6.2)
That sounds a lot easier. Is that in the guide ?
yes, I did a point by point summary here too:
https://forums.adafruit.com/viewtopic.php?p=967988#p967988
I was looking on circuitpython.org and was trying to follow instructions there fwiw. Updating the bootloader on nRF52840 boards is an involved process right now. Follow the instructions in this README. (https://github.com/adafruit/Adafruit_nRF52_Bootloader/blob/master/README.md)
yeah I also mentioned last time that those pages should be added to the CPB guide:
https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather/update-bootloader
https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather/update-bootloader-use-arduino-ide
right, it's not in the CPB guide, but it's in A guide
we should clean all this up: make a uniform guide page that could be mirrored (if possible), and update the circuitpython.org instructions to point to the guide
@jaunty juniper is the guide page in good shape, or should it be updated per your forum post?
thanks both of you, I now have 8.2.0-beta.1 booting on my bluefruit.
it still requires installing support for the Adafruit boards, which is in a different guide/page, and is not mentioned in the bootloader page. It's just copying a URL in the right place, so maybe it could be repeated in the bootloader page rather than linking to a different guide
also, can I task you guys with trying to convince the boss to update the NRF52 boards testers with a more recent bootloader version ? It would be nice if new boards sold were not unable to install CP without installing some toolchain first
I have pointed that out, and I think it will be happening. But there's a large stock.
I recently acquired fresh Trinket M0 (that was for some AT project before Feather RP2040 USB Host board), and they came with CP 3.1 (or something very very old.
It was a bit bizarre to get something so old in 2023. But this is not blocking, it is easy to update.
Also, I think I never updated the bootloader for my NRF board... every time it did seems complex/long, and since there was no need, I skipped that step.
and it's not required unless you have a UF2 over 512 kB in payload (wich means a 1MB UF2 file), which the CP8 build for CPB has gone over recently
In my testing, the feather bluefruit can do 12 voices at 48kHz! This is a simple case (no LFOs, no ring modulation) so other situations might require a lower sample rate, fewer voices, or both.
The sound is a little artifacty & low-fi but I think that's down to the speaker & use of PWM instead of I2S.
However, and this is what made me think this wasn't working adequately back at pycon, touchio.TouchIn seems to wait for such a long time that it can cause audio crackles & drop-outs, so it...
@onyx hinge @tulip sleet This conversation is timely. I am embarking on a project using an nRF board, and will probably run into this. Thank you all for running into it before I do. 😄
I put this in my to-do's so I wouldn't forget, but not sure when I will get to fixing the guides. I hope really soon.
Nice, thanks. I'll use the existing list of links from Neradoc for now.
@tulip sleet Is something = ((a, b), (c, d)) a list? List of tuples. Or is it something else....?
tuple of tuples
Ok, thanks.
I'll update my comments.
What about this one? ```py
SEND_ON_PRESS = (
Keycode.B,
Keycode.THREE,
)
a tuple
anything like (... , ...) is a tuple (sometimes the parens can be skipped), anything like [... , ...] is a list, anything like {... : ..., ... : ...} is a dict, and anything like {... , ...} is a set, and you can nest them all inside each other in arbitrary ways
I have the same problem with a simple sd-card reader and a spi-display. I can use both individually, but once I loaded the storage/adafruit_sdcard stuff, the display won't work. I confirmed that the cs-pin of the sd-card reader is high before trying to use the display.
@tulip sleet is my spelling wrong or something? ```h = digitalio.DigitalInOut(wake_hi)
h.switch_to_output(True)
l = alarm.pin.PinAlarm(wake_lo, value=False, pull=True)
input("hit enter to sleep")
alarm.exit_and_deep_sleep_until_alarms(l), perserve_dios=(h,))
I get "TypeError: extra keyword arguments given".
perserve_dios -> preserve_dios
NotImplementedError: preserve_dios
yup it was me, thank you
happen to have any idea how implementable it would be on nRF?
you can have a pin skip the gpio setup which maybe leaves a pin's output state alone? i dunno. bool nrfx_gpiote_in_config_t::skip_gpio_setup
It's a feature that is particular to the hardware on Espressif -- not sure if it is possible at all on nRF
or it may be trivial, if pin state is always maintained
i just haven't looked; would need to spend a few minutes with the datasheet. Is h a power control pin?
the idea is that this is to make one key in a key matrix be the wake up key
it's not meant for alarm pin control, it's meant for other pin control
so you set the column high and use the row as the wake pin
got it
oh good, I was becoming concerned the idea didn't make sense
i'll look now ...
so it's possible, just need to avoid resetting the pins
the datasheet is not clear on this
oh, cool!
there is a lot of worry in the nRF forums about whether pin states are retained across reset, but that is not the issue here
@onyx hinge note edit: the datasheet is not clear on this, as far as my skimming could determine, but the reponse in the forums is probably correct
@tannewt
I think this should be reopened.
With recursion it's still exhibited.
anyone using the scd4x co2 sensor? Specifically the adafruit scd4x circuitpython driver. I'm getting data_ready=false most of the time I try to check it (about every 30secs), but if I check in a loop (with 0.1s delay) then it reaches ready after 0.5-3.5s (varies). This seems like unexpected behaviour, and I've changed the default i2c frquency (its an es32s2), but still needs to be called in a loop rather than being ready after each new reading dataset is ready for pulling or has been updated (there is no pull method, only property accessors for co2/temp/hum). This is the repo of my code: https://github.com/good-enough-technology/Good-Enough_Air-Quality-Device_CO2-SCD4x_PM-SEN5x_CircuitPython
@jaunty juniper you got a minute to talk keyboard layouts?
yes ?
so I'm working on usb host and I think I'm to the point where I want to convert hid reports back to a serial stream into cp
I want to support setting a custom mapping
(I use colemak myself which shouldn't be default)
so you need to convert keycodes to keys then to composite keys to get the matching characters
so, a HID keyboard typically sends keycodes, unless you use a n-rollover type that instead sets bits, the bit position telling you which keycode is sent
right, this is 8 byte reports with a bitmask for modifiers + 6 slots for keycode
yeah that's the standard one byte per keycode, unless all FF I think ? (or 7F ?)
the n-key uses a bitmap instead
merging in steps
the layouts and keycode libraries that we have convert from letter to combinations of keys, they can be reversed to make it easier to index into
ya, so I think I want a library that will take a standard definition and bitpack it into what we need
right now I use the xml files from https://kbdlayout.info/ to generate the layout files for windows, and I don't have a good source for mac
I’ve been playing with the Waveshare rp2040 1.28 inch round LCD board with touch support. There is already a CircuitPython build for the non-touch version of this board. Since this board has slightly different pin definitions (plus a touch sensor on I2C) would it be worth creating a second build? Alternatively could the build auto detect the board variant and adjust the pin defs?
The correspondence between named pins and the actual pins is fixed at compile time, in the pins.c file. So another board definition would be needed.
Hello all,
I've very interested in i2s input, which we're using for https://opendeved.net/ilce, a project in Tanzanian schools.
Is there any way this integration could be accelerated? We'd be happy to offer a bounty.
Does anyone leave circuitpython device connected via USB to computers that get shut down over night and booted back up daily? I've started noticing that if I leave certain devices plugged in that my computer will refuse to boot. The power in the computer turns on and powers the USB devices including the microcontroller, but then the computer never goes into post boot, grub or the OS login. If I unplug the microcontroller, then the computer will instantly start going on and finish the boot process normally. In my case it's a desktop running Ubuntu, but considering how early in the process it happens I'm guessing the OS isn't really a factor. Has anyone else experienced a similar issue where a computer will not complete the boot process while a microcontroller is plugged in, but then does move on instantly if the microcontroller is unplugged?
I've never had that exactly issue (and have left devices plugged in). I wonder if something in the BIOS is looking for drives to decide if one is a boot drive or just inventory of drives, and gets confused somehow with the CP drive
I had same issue with certain usb peripherals and certain devices (laptops/SBCs). Seemed to be specific brands of laptop bios that were the worst but my memory fails me. I just learned to remove all usb devices except mouse/keyboard. (Some HID radio dongles for wireless keyboard/mouse also caused boot problems)
Thank you both. The storage drive is an angle I hadn't considered. I could try testing with one that has storage disabled. My best guess so far was that maybe the connected devices are pushing it over some limit of how much current it's happy to deliver to the USB while it boots up. In my case it's got a hub with a few things other than the microcontroller as well, but it does boot up fine with all of that stuff plugged in.
Try to update computer bios firmware, you might get lucky
I tested and it's working great for the most part. The changes I made to the MatrixPortal library were successful. I did have 1 hard crash and it may not have been related to this PR. Basically, I was:
- I had a slots demo running
- renamed it to slots.py
- copied over a different code.py
- pressed Ctrl+D to soft reset the board
I tried the same thing a second time, but it just stopped doing anything once I renamed code.py. Anyway, it's pretty minor and unlikely to happen most of t...
Tested successfully using the following:
ESP32-S3 using the MatrixPortal S3
SAMD51 using the MatrixPortal M4
RP2040 using the Interstate 75
ESP32-S2 using the Adafruit Feather ESP32-S2 + Matrix FeatherWing
thank you so much for the extensive testing @makermelissa ! :heart:
I will mark this PR out of draft mode once the related PR in protomatter is merged: https://github.com/adafruit/Adafruit_Protomatter/pull/60
Working with the Blues Wireless Swan card and would love to have imagecapture available.
I may help with this port, as I am an experienced C programmer, but very new to the microcontroller world, so any guidance would be highly appreciated.
Oh btw if anyone wants it, I had to write a usb device descriptor and associated code to get my pico to show up as a joystick (since the adafruit gamepad in HID is pretty limited) to add a few more axis and buttons etc
@lone axle sounds like BIOS boot priority order if it has a mass storage device. i haven't encountered that with windows at all. definitely worth looking into because i have encountered it in the past with USB mass storage devices that are attached during boot just not adafruit products in particular. you can disable USB as a boot device in BIOS until you explicitly need it for that purpose.
the only time i ever enable usb as a boot device in bios is for updating the bios. i use it, update the bios, then disable it again because of issues like this which can happen.
@bjohas -- I'm on travel this summer and don't have the hardware I would need to work on this, unfortunately :( I think the soonest I could get around to helping here will be in August.
Akun Wso Slot Resmi 2023 merupakan permainan yang tengah populer saat ini terlebih di indonesia, permainan slot gacor online makin digandrungi oleh beberapa pemain slot online jp terbesar. Kenapa begitu? Hal ini dikarenakan Akun Wso Slot Resmi 2023 sebagai salah satu dari slot online gampang menang menyediakan permainan slot terlengkap nan tidak membos...
^ spam.
Hi @shulltronics - I've connected with you on LinkedIn. Let's exchange details, and then we can see where we are in August?
Not got around to creating a clean starter template yet, but this now has all the features I was looking for (except forwarding previously unforwarded errors to MQTT feed - TODO).
- Logs errors at boot / safemode, plus Reason + traceback + timestamp.
- Traps errors in code.py and saves to NVM before rebooting to save to flash filesystem in appropriate json file
- Configurable error/boot/safemode log lengths, with free disk space checking and file rollover (If not enough space to add entry,...
Sorry I missed the weekly meeting, but I listened today to the "in the weed".
I was wondering what was wrong with keeping the current status quo where each major release has corresponding "mpy" zip file for the library. A few time there was no change in mpy format, but there was a new zip, just because the documentation say you must download matching library zip.
I like the idea of an advanced example. I could certainly find it useful especially when beta testing and running into random hard faults or exceptions. A quick way to log errors to help myself and/or developers could be handy. It depends on the board though, some boards like an M0 just won't have much if any room for that kind of thing. I like the general idea.
Added support for my new ESP32-S3 based NanoS3 module.
@slender iron @idle owl @gilded cradle will you folks be able to read the "state of" subsections you customiarily do?
CircuitPython version
Adafruit CircuitPython 8.2.0-beta.1-1-g24a58c3f5 on 2023-06-09; Adafruit QT Py ESP32S2 with ESP32S2
Code/REPL
import os
import ipaddress
import wifi
import socketpool
print("ESP32-S2 WebClient Test")
print("My MAC addr:", [hex(i) for i in wifi.radio.mac_address])
print("Available WiFi networks:")
for network in wifi.radio.start_scanning_networks():
print("\t%s\t\tRSSI: %d\tChannel: %d" % (str(network.ssid, "utf-8"),
...
Yes.
Do you have a 2nd qtpy esp32-s2 to test on to determine if it's hardware? do you by some accident have the version designed for an external antenna? (https://www.adafruit.com/product/5348 vs https://www.adafruit.com/product/5325)
Yup, I'm around
@jepler whoops yes a 2nd qt py esp32-s2 worked just fine with absolute newest and the wifi scan. the one i was originally testing with is my go-to prototyping board since they came out so that's why i did not test an additional board.
good morning my fellow <@&356864093652516868> -- we'll have the weekly meeting here and in the circuitpython voice channel in about 70 minutes. Please take the time to add your notes to the notes document! https://docs.google.com/document/d/1GiH22DPaCVQ8D4cjhq2yJR73_bm3sTRZ35IE_L2bFBc/edit?usp=sharing
CircuitPython Weekly Meeting for June 12th, 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 ...
Help is welcome! The first step is getting CP building. There is a guide on how to do that here: https://learn.adafruit.com/building-circuitpython
The best place to get help and guidance for development is #circuitpython-dev on https://adafru.it/discord
this is new, something (maybe discord streamer mode?) is ellipsizing a bunch of folks names in user lists... but not all. There's a related option which I hadn't noticed before. Turned off, because I think we usually want to see folks names in the video.
i'll be back in a few minutes to go through the pre-meeting items and let folks do mic checks
that's probably the folks who have the new number-less usernames
nope!
🎉
In September 2021, Patently Apple posted a report titled "Apple is Reportedly Designing Various Embedded Subsystems across all Operating Systems using RISC-V." Today we're learning that there could be a major tectonic shift in the industry away from the Arm architecture to RISC-V by major players such as Qualcomm, Samsung, Nvidia and others that...
Do you want to get started with RISC-V quickly, without using an FPGA or a logic simulator? Then get my RV32I RISC-V emulator, run 1.19 MicroPython on it, and analyze the emulator to understand RISC-V. Download it here
https://t.co/UawdzboSun
@risc_v #rv32i #riscv #micropython
175
Anne is an Engineer for Adafruit Industries in Manhattan which is a small company that engineers electronics for hobbyists and open source software. In this episode, Anne takes us through her amazing journey from working in the State Department and traveling the world to utilizing her electrical engineering skills at Adafruit Industries.
00:00...
Colorful?!?
I found these guide pages here:
i think we need to mirror that in a few other places
Thanks everyone
Thanks for hosting Jeff. Have a great week everyone!
thanks for hosting jepler!
8.2.0-beta1 seems to crash at the end of download to a feather nrf52840, reloading 8.1.0 works.
Tried downloading 8.2.0-beta1 several times and flash-nuked the board, same result.
@languid whale yes this is affecting several people. the fix is to upgrade the uf2 bootloader. the gist of it should be the same as in this guide: https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather/update-bootloader-use-command-line
after upgrading the uf2 bootloader then reinstall 8.2 via uf2
thanks for hosting @onyx hinge!
Of course let us know if updating the bootloader does not fix the problem
Here is the notes document for next TUESDAY'S CircuitPython Weekly meeting. It is a day later than usual due to the US holiday of Juneteenth. It'll be at the normal hour 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/1EHTaN12CCR8flRsp8fqL9uBP5Nw6PXX6mwCpdu_o5TU/edit?usp=sharing
CircuitPython Weekly Meeting for May 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 particip...
Do you have anything in other files (like settings.toml)? I am not able to reproduce this on my odroid go.
I can't reproduce this on 8.2.0-beta.0.
btw, I highly recommend those little cheapie PCM5102 I2S line-out DACs (that also work with headphones!) until adafruit gets a non-amp I2S solution back in stock. Much easier to hear weirdness when you're going to a known-good set of headphones https://todbot.com/blog/2023/05/16/cheap-stereo-line-out-i2s-dac-for-circuitpython-arduino-synths/
Hi @IrregularShed have you tried the "Where's My I2S?" script in the Learn Guide? It's pretty helpful.
For the Xiao RP2040, using the above script, I've found that this works:
audio=audiobusio.I2SOut(bit_clock=board.SCK, word_select=board.MOSI, data=board.MISO)
this is equivalent to:
audio=audiobusio.I2SOut(bit_clock=board.D8, word_select=board.D10, data...
Thanks, Dan. That did the trick.
Now, however, Windows 11 complains a bit saying that it cannot copy the last bit of the uf2. Probably because the device exits the bootloader before the windows transfer is finished. I can see the drive change from FTHR840BOOT to CIRCUITPY as windows throws up the error. The board works fine, but probably a little alarming.
that is interesting, someone else saw something that sounds similar to that; I'll keep an eye out; thanks!
While testing, I realized BUTTON_UP and BUTTON_DOWN are missing from board.
Closing due to no reponse. Maybe file a more detailed issue here? https://github.com/adafruit/Adafruit_CircuitPython_Requests
I'm not sure if it's necessary, but ACCELEROMETER_INTERRUPT (IO15 on the S3) is also not defined.
@tulip sleet The HTTPServer library raises this exception when I attempt to use it:
Traceback (most recent call last):
File "code.py", line 46, in <module>
File "adafruit_httpserver/server.py", line 151, in serve_forever
File "adafruit_httpserver/server.py", line 178, in start
AttributeError: 'socket' object has no attribute 'bind'
I'm not certain if I have set up the socket correctly, I tried to match how it's done for requests. My code was essentially:
import adafruit_esp32spi.adafruit_esp32spi_socket as socket
# ...
socket.set_interface(esp)
server = Server(socket, "/static", debug=True)
Do you think it is possible to add bind() inside of here? https://github.com/dhalbert/Adafruit_CircuitPython_ESP32SPI/blob/compatible-socket/adafruit_esp32spi/adafruit_esp32spi_socket.py I could try to head down that road, but I'm not sure what the implementation would look like.
It looks like HTTPServer also makes use of accept(), listen(), and setblocking() as well in addition to bind()
anecdata says bind() is not possible: https://github.com/anecdata/Socket (see footnotes). So this is a dead end not worth pursuing
that's how I got it working with my universal socket:
https://github.com/Neradoc/Circuitpython_Universal_Sockets/blob/main/universal_socket.py#L146-L147
basically
esp.start_server(port, self._socket.socknum)
at least I think ?
I think it's a trick actually, not a real bind
i don't know whether it's worth adding to http_server?We need to detect the implementer. Seemds like bind() can't be implemented by itself
@lone axle in any case, I wouldn't worry about it now, since it already doesn't work, right? merging the PR's is not going to break the possibility of server, since it's not possible in straightforward way already
Yeah, I think it may be best left outside of HTTPServer. Since those functions aren't supported "for real" in the nina firmware. That UniversalSocket that Neradoc linked is a nice workaround that allows it to do something similar and I think having that "layer" in the code makes sense for folks doing it that way since the underlying sockets are still different with regards to those functions that are used in this use-case.
And yep, it doesn't work today, so nothing that works now is breaking. Just a possible new thing that won't actually work (without some layer inbetween like that UniversalSocket).
Since this was stopping me from continuing to test, I added these to my local source and built it successfully. Let me know if you'd like me to push a commit.
@todbot Yep, I've used that in the past with a Pi Pico and ESP32-S2 board. I can't believe I didn't think about using it this time...
Funnily enough my build uses the exact same pins as you mentioned (not that there's many to choose from on a Xiao!) and it works wonderfully. I used some code that you wrote as a basis and ran with it; I've fallen into the Eurorack universe so it's ended up with a pair of CV inputs, a pair of pots and a rotary encoder. It's in the middle here, and I apologis...
Hey folks 🙂 I remember seeing a board pin definition file that setup 2x I2C objects ( 2 different buses) but I cant seem to find it now.
I'm about to update my FeatherS3 pin definitions (finally) as I made the vertical STEMMA QT connector have seperate IO in my P7 (current) and P8 and U8 boards, and I want to expose that as an I2C object.
Any ideas which board might still have 2 defined that i can look over to ensure I do it right ?
ports/raspberrypi/adafruit_qtpy_rp2040/* has both board.I2C() and a different board.STEMMA_I2C(). I think that helps?
Looking now, thanks Dan.
See mpconfigboard.h and pins.c
I was only looking in the Espressif ports dir as I though there was an Adafruit ESP32 one from memory, but might have ben the rp2040!
No, that looks like they both use the same pins?
the ESP32 QT PYs do it too
oh, lookin at the wrong board 😦
Ok, got it. I wasn't configuring it right - glad I asked !
Thanks @tulip sleet & @jaunty juniper 🙂
Hmm, so where does board_stemma_i2c_obj get defined?
Or more importantly, how does board_stemma_i2c_obj get associated with the second I2C array pins element?
I'm clearly missing something obvious
See the macro invocation CIRCUITPY_BOARD_BUS_SINGLETON() at the top of pins.c, and see its definition in shared-bindings/board/__init__.h
##-style concatenations happening
Oh, doh, the instance number - So sorry 😦
np 🙂
Seems like WolfSSL Python should be pretty easy to add?
Seems like WolfSSL Python should be pretty easy to add?
The WolfSSL library is GPL2 and commercial. We don't put GPL code in CircuitPython so as not to GPL-ize the whole thing, and the commercial restrictions are also an issue.
I wrote up all of my DisplayIO performance research work on my blog. I'm sure none of this is news to you, but I haven't seen any other blogs discussing performance so I figured I'd share it. https://joshondesign.com/2023/06/12/display_io_perf
Question: would there be interest in adding anti-aliased versions of the vectorio shapes?
I maintain a pure JS implementation of HTML Canvas. I think adding AA polygons and lines would be pretty straightforward.
You could consider adding a property to vectorio shapes to set them to anti-alias when drawing. It would be pretty nice to be able to choose which shapes paid the tax.
I put some performance ifdefs in vectorio and displayio to dump pixel fill rate to serial log. If you get into it, you might take a look at some of those and see how your changes impact the simple circle/square draw routines' fill rates. Have fun 😄
I’ll have to take a look. I’ve partly looked at it myself but haven’t had the time to really dive into it.
Ugh it's the long lived allocator
that was fast!
I'm guessing
We'll I saw something similar and ignored it but had a fear
There is a lot of objects referring to other objects in there by pointer and that tends to be trouble
CircuitPython version
8.2.0-beta.1
Code/REPL
# see forum thread
Behavior
when some synthio objects (particularly the Synthesizer itself?) are imported, synthio breaks.
these objects refer to each other in complicated ways, e.g., AudioOut -> Synthesizer -> Note -> LFO
If one of these objects is moved (made long-lived) it would break the relationships.
At the same time, Notes in particular are not conceptually "long lived", so the usual th...
that said, this user's code isn't creating the objects in what I thought was the problematic way so maybe it's something else
(at the top level of the imported file)
we have had problems across imports: https://github.com/adafruit/circuitpython/issues/2687. If you can reproduce this, but not the equivalent thing in one file, maybe it could be that
that reminds me, I had someone having an issue with what seemed to be a display bus not being released when inited at the top of an imported module (so I suspected long lived) but I couldn't repro (they solved it by initing in code.py) so 🤷
I think it's still relatively feasible to compile with the long-lived allocator disabled, that would be an easy way to confirm it was related or even a cause
just make gc_make_long_lived(void*old_ptr){ return old_ptr; }
Good write up. One thing I just thought I'd mention if you are trying to only display the animated gif there is a way to just blit the whole GIF to the display, by passing displayio. That is much faster. It should be in the docs but if not let me know and I'll send you sample code.
Hiya - I'm trying to build/test my FeatherS3 changes off a brand new fork and setup of CP on my machine, but I'm unable to build due to this error...
from ../../shared-module/displayio/Bitmap.h:33,
from ../../shared-bindings/displayio/Bitmap.h:30,
from build-unexpectedmaker_feathers3/autogen_display_resources-en_US.c:2:
esp-idf/components/newlib/platform_include/assert.h:20:10: fatal error: sdkconfig.h: No such file or directory
#include <sdkconfig.h>
^~~~~~~~~~~~~
compilation terminated.```
I've triple checked I've installed everything correctly - but I did see this when running ./install.sh and . ./export.sh
fatal: No tags can describe '630c2724fc8c69eeaaa1bb025de52b99c5cb11aa'.
Try --always, or create some tags.
WARNING: Git describe was unsuccessful: b''```
I'm using python 3.9.17 for CP building.
But the rest of the install script ran and it seems it installed everything, but I've never seen that error before (not that I've noticed).
Possibly - I don't think the 2 issues are related - but I'm unable to build and I cant see what else could be causing this.
I know there has been a change to how you checkout the git submodules, did you do it the new way?
Yeah, I did a port specific fetch - and then when it built is grabbed the esp-idf submodules like expected
trying a make fetch-port-submodules again
That didn't help. Tomorrow I'll try to revert back to an earlier CP tag and see if that fixes the issue.
you could also try falling back to the global make fetch
What version of git are you using?
I did the following, successfully:
git clone https://github.com/adafruit/circuitpython test
cd test
cd ports/espressif/
make fetch-port-submodules
esp-idf/install.sh
. esp-idf/export.sh
make BOARD=unexpectedmaker_tinys3
Ubuntu 22.04
git version 2.40.1 (using git ppa for latest stable version)
Python 3.10.6
Note that I am using adafruit/circuitpython, not my fork. But you said it was a brand new fork (or brand new clone)? Perhaps your fork has some version skew in it.
The PR within protomatter has been merged, so this is hopefully also ready @makermelissa
oops, your comments crossed with mine. Please do add those buttons to this PR if github will let you!
Is it probably needing git fetch --tags https://github.com/adafruit/circuitpython?
or make fetch-tags at the top level
this was not necessary for the trial I did above. There is tag fetching in make fetch-...-submodules
@tulip sleet that's not how it looks in my testing, if I take care that no tags are available in the initial clone. [output snipped except for last command]
$ git clone --no-tags https://github.com/adafruit/circuitpython test
$ cd test
$ make -C ports/raspberrypi/ fetch-port-submodules
$ tools/describe
fatal: No names found, cannot describe anything.
this machine is also on an old git, git version 2.30.2
Last time I compiled for S3, I had to make sure to fetch the tags right after I cloned the forked repo:
% git clone <fork url>
% cd circuitpython
% git fetch --tags --recurse-submodules=no --shallow-since="2021-07-01" https://github.com/adafruit/circuitpython HEAD
% make fetch-submodules```
I see.. I thought it was.
i mean the example of cloning adafruit/circuitpython (which is a fork of micropython). But I was not cloning my personal fork.
Sorry, yeah... jepler's example is not a fork. I think UnexpectedMaker's is though.
My example is not a fork but I simulated one aspect of some github forks -- no tags, or tags that lag compared to "official" -- by using git clone --no-tags.
Let's wait until I finish testing the remaining guides before merging this in case I find something else.
Also, I also noticed while copying files it does this seizure-inducing flickering on the panel. I figure that it is due to whatever you needed to do to get CircuitPython not to crash.
On devices where the code & CIRCUITPY reside on the same flash chip, the erase cycle (esp_partition_erase_range in this case) prevents other code from running unless it's been specially placed in RAM. I suspect this probably hasn't been done. (I didn't do it!)
Are there any Arduino examples that combine protomatter & USB mass storage? If so, how do they behave when writing to mass storage?
for a fork you only really need to add the git fetch --all to get the tags
A newly created fork with the defaulted "Copy the main branch only" checkbox has no tags, so git fetch --all if it implicitly refers to your fork will not get the tags. git fetch --tags https://github.com/adafruit/circuitpython will. If you have an older fork without that setting, or you turn off the setting when forking, then you get a snapshot of the official tags that will not be updated without explicit action on your part, so for instance your build would still describe itself relative to 8.2.0-beta.1 even after 8.2.0-rc.0 is released.
After a quick search, it looks like this example may qualify: https://github.com/adafruit/Adafruit_Protomatter/tree/master/examples/animated_gif
I haven't run it yet, so I'm not sure about the behavior, but I'll let you know after I get to it.
I did some more thinking about anti-aliasing over night. I don't think it is possible to add AA to the retained scenegraph nodes like vectorio shapes. My understanding is that DisplayIO doesn't use a backbuffer. Pixels in the dirty area are sent directly to the display, which does have an internal framebuffer but usually can't be read back to main memory. That means there is nothing to composite the partial pixels against. It would be possible to draw AA lines within a bitmap because then we have both the source and destination pixels. Bitmaptools has a function to do this. The other challenge is bitmaps use indexed palette, not full color, but I think there could be ways around that. General AA probably is impossible with current displayio, but for certain cases like drawing a chart with lines it should be possible.
Thats my thinking too. displayio as-is doesn't handle mixing pixels. The first opaque pixel wins.
would be interested in how you'd change/improve displayio
@pallid creek I wanted to utilize the native scroll but it is often not the direction that would be helpful
Fundamentally I think DisplayIO is perfect for the constraints of drawing over a serial bus from a slow CPU with very little RAM, which has historically been the case for most things that CP runs on. Now with the Pico having a full in RAM framebuffer is possible and we have compute to spare. I'd suggest creating something like a CanvasBitmap class. You put that as your only object in the scene and then draw to it using fillCircle, drawLine type code. So you'd only get AA by opting in by using this new class.
We do have framebuffer classes already for this
Meaning only on a device with the memory to support it.
Which class is that?
framebufferio.FramebufferDisplay is the displayio -> framebuffer
I see Bitmap. Do you mean framebufferio? I thought that was for LED matrixes
it is used for led matrixes, picodvi and broadcom (raspberry pi sbcs)
It isn't used for spi displays atm
oh, interesting. Hmm. That opens some new possiblities. I need to write up some experiments.
🙂
I created displayio so I'm happy to chat about it. mark, jepler and foamyguy have dug into displayio too
some displays do have a sync line that could help with tearing
get a pyportal if you want to got down this rabbit hole because it has parallel display connection and the tear line (iirc)
I have a Matrix Portal on a 64x32 LED matrix. Is that the same chip underneath?
I've been doing desktop graphics since my Apple IIc as a kid, and I worked on the Java Swing toolkit and it's research predecessor. Modern GPU stacks are so complex. I like getting to mess with pixels and bits directly again. 😉
It is the same MCU but different display completely
oh, so not a parallel display connection?
awesome! That's where we're at with these embedded graphics. Another very popular alternative is lvgl.
rgb matrices are driven directly using fancy bit patterns. That's why they have a framebuffer. We share the "protomatter" library with arduino to do it
ah, okay. because the matrix doesn't have an internal framebuffer so we have to do it in RAM. How fast is the actual protocol? Can it do full refreshes 30fps?
I'm not sure how fast it runs. @onyx hinge has done most of that work
it is literally PWMing RGB leds for you afaik
the heavy lifting of doing that is done by the protomatter library. updating the special internal format used for clocking data out to the display takes a negligible amount of time, but I don't have a specific number handy. the displayio "fill" routines are still the displayio fill routines, though you can choose not to use displayio and just directly access the framebuffer as an array of 16-bit unsigned values (RGB565)
@IrregularShed that's very cool! Is this issue closeable for you?
I'm not sure how rp2040 audiobusio error message could give a more actionable message to the user, since there's such a disintermediation between microcontroller.pin.* and board.*
ValueError: Bit clock and word select must be sequential pins
If this said
ValueError: Bit clock and word select must be sequential GPIO pins
would that have been clearer?
@dhalbert I think that would make it clearer, yeah. Just adding GPIO would've given me a hint where to look a bit earlier.
Is it possible to change a string somewhere inside of the core to make a custom build that has a different default drive name other than "CIRCUITPY" ? I can rename it from a PC and it seems to stick, but I have a case where it'd be nice to have a different name as part of the built itself.
yeah as you see it's CIRCUITPY_DRIVE_LABELwhich can be set in mpconfigboard.mk
won't work on upgrades
or on the make command line
the name is set when the filesystem is created
you can actually change it from circuitpython code
yeah it won't change the name on an existing drive
That's okay, I can use storage.erase_filesystem() if needbe to get it to re-init. Or in some cases I may loading circuitpython for the first time so maybe it won't have created the filesystem at all yet, but I think micropython is pre-loaded, I'm not sure how that factors in.
Thank you. Honestly I was too fixated on the line with the "CIRCUITPY" and didn't notice the one inside the if above that allows easier setting from a variable.
Is there some 'trick' to using it? I added in mpconfigboard.mk
CIRCUITPY_DRIVE_LABEL = "CUSTOMNAME"
made a build loaded it on a device and then did storage.erase_filesystem() from REPL, but the drive came back as CIRCUITPY still when it re-connected.
@brazen hatch any issues with the stack changes?
Nope, all that code runs under the million execs.
👍
I noticed this device has NeoPixel library frozen in: https://github.com/adafruit/circuitpython/blob/a5e3c6ee825f67c5e935b8d6c7c2ed8842394c5d/ports/raspberrypi/boards/pimoroni_inky_frame_5_7/mpconfigboard.mk#L26 but I don't think there is a builtin neopixel on the device. Is that one included by default on any devices with space available? Or is there a chance it may have been copy/pasted from another device when the definition was created?
If the device doesn't have one it shouldn't be frozen in, as far as I know..
In one specific script, I had to do double
try:
try:
code
except KeyboardInterrupt:
raise KeyboardInterrupt
except KeyboardInterrupt:
pass
To catch a single ctrl c.
If I used raise, it was caught. But a real one was not caught unless I did the double.
However I was like, "This is under 20 other functions. I cannot open an issue for that."
I did go back all the way to 8.0.0 and was reproducible.
But, nobody gonna find the root cause.
It would be a waste of time debugging it.
Heap and stack issues really are a pain.
weird!
Yea, it was only under a very specific script.
If it was on C3 I would just blame it there. But it was on S3.
The flickering happens with that example as well, so it should be fine.
At this point with what I've tested, I think it should be good fine to add.
Thanks everyone for your feedback re the tags stuff - though I wasn't able to solve that tag error - I was able to get CP to build after @supple gale pointed me to the macOS brew gmake learn guide!
added the Bee Data Logger board.
@slender iron comments above re InkyFrame and frozen NeoPixel. I think you made this board def?
Run wget https://developer.nordicsemi.com/.pc-tools/nrfutil/x64-linux/nrfutil
--2023-06-14 02:14:28--
Resolving developer.nordicsemi.com (developer.nordicsemi.com)... 104.20.252.111, 104.20.251.111, 2606:4700:10::6814:fc6f, ...
Connecting to developer.nordicsemi.com (developer.nordicsemi.com)|104.20.252.111|:443... connected.
HTTP request sent, awaiting response... 526
2023-06-14 02:14:28 ERROR 526: (no description).```looks like something's gone wrong on nrf's site, or maybe they've intentionally removed the old nrfutil.
oh it's a cloudflare error due to nordic having a wrong certificate, possibly. https://http.dev/526
@lone axle I’d assume it is copy pasta
the "526" problem may have resolved, I've tried restarting those last failed builds again this morning.
@onyx hinge I found tools/merge_micropython.py a few days ago. Thanks for that. I had done some of that by hand, but it pointed out some other things. I ran each stage one at a time to check for errors.
still have to review a couple hundred files
That's Scott's script but yes it is helpful!
Depending where you're at I'd be around before the CE meeting to talk through any vexing parts
I figured out how to get the drive label going. It turns out this is a #define setting in mpconfigboard.h instead of a variable in mpconfigboard.mk
ooh right I missed your other messages, some makefile defines are picked up in py/circuitpy_mpconfig.mk some are not
I got the wrong file 😉
Yep, I definitely owe it to you and then finding those pycubed devices when I grepped for the name that you pointed out to me. Those seem to be the only ones with the custom name in the repo
Looks like the issue noted in the forum post has been resolved so I think this issue could be closed?
I'd like to leave it for now. I was wrong about it being the cause of the user's problem, but there's a real problem here which can arise when you do something like
# go_audio.py
speaker = I2SAudioOut(...)
synth = Synthio(...)
speaker.play(synth)
``
```py
# code.py
from go_audio import synth
synth.press(...)
which I believe is because of long-lived objects; the "synth" that is played on "speaker" is not the same "synth" that is imported from code.py, and so things don'...
I hit this one on multiple devices every time I plug something new into USB on windows. It does a keyboard interrupt on every device... so I have go around resetting every device. Didn't realize there was a way to bypass it. I need this in my life and didn't realize it.
If I have an itsybitsy, s2, s3, and another s3 all plugged in via USB it'll do a keyboard interrupt on all of them. It's frustrating to deal with.
It happens when I open Mu too. REPL will attempt to connect to all of them and do a keyboard interrupt on all of them.
yeah I think it's a Mu issue that I have seen on Mac too, when there are multiple devices
at least I think I have seen Mu send ctrl-C when you open the serial panel sometimes
and that doesn't seem intentional to me
maybe that's why because i usually have Mu open 24/7, possible just a Mu issue.
I can't remember if MacOS pokes all boards when doing things. I think it might. It will definitely poke one board during unrelated events from time to time.
Which seems likely to affect multiples.
there's software that can ping the drive and cause a reload
usually on mac the only issue I have is a reload within seconds after the board starts, but not always
(and the bug of opening a file on the wrong board with the Finder that was solved by setting a random device ID when formatting the CIRCUITPY drive)
Hmm fair enough
in windows if i open a CIRCUITPY drive sometimes it will soft reboot all CIRCUITPY devices too which isn't an issue as most of my scripts will just run again. i think it has to do with USB waking or touching somehow.
I know some software like to ping drives when you do certain things, I think photoshop does or did that for example, some might do that when you want to save, like they are checking the drives before giving you the dialog or something
yes it feels something like along those lines
opening a file too tends to update the files "acess time" on macos (causing a reload) but I usually keep the files open during a dev session so it's not a big deal for me
so yeah manually managing reloads can be a good solution to avoid those
with multiple devices and projects i ping pong back and forth between them sometimes and if one of them hasn't been touched in a while it's like it sends a "soft reboot all the things" message to all the others.
that's so weird, could it be the text editor going like "hey let's save all" with multiple files open ?
or I guess yeah windows going "let's refresh all those drives"
for the soft reboot i think it's windows touching usbs
for the keyboard interrupt error probably mu
the keyboard interrupt error might as well be a hard fault because it stops anything in its tracks.
didn't know there was a way to catch and pass it, will be trying that when i have time.
yeah, I have autoreload disabled in my standard boot.py to avoid all those spurious reloads
does this mean we don't have to only use the file open from the services menu at the bottom?
that has been fixed in the course of 8.0.0 (as far as I know from my tests), but you have to erase the file system on boards used before that so that the FAT volume ID is no longer the single one that was accidentally used before
as far as I know, I haven't seen it come back
cool, yeah I've been erasing file system when I upgrade to get the proper uuid
I have too many problems with multiple devices plugged into USB without doing that
very cool open pin mux data repo from ST: https://github.com/STMicroelectronics/STM32_open_pin_data/blob/master/mcu/STM32L4A6ZGTx.xml
Are the changes outside of the board directory intentional? It looks like it could be a git mistake.
on specific SCK/MOSI/MISO pins, the common_hal_busio_spi_construct method always skips some miso pins which will lead to a invalid pin exception when SPI initialized
So the problem is on second loop of searching for mosi pins:
` for (uint i = 0; i < sck_count; i++) {
if (mcu_spi_sck_list[i].pin != clock) {
continue;
}
// if both MOSI and MISO exist, loop search normally
if ((mosi != NULL) && (miso != NULL)) {
for (uint j...
Are the changes outside of the board directory intentional? It looks like it could be a git mistake.
i don't know what caused that. i think i was able to delete most of the offending changes.
CircuitPython version
Adafruit CircuitPython 8.1.0 on 2023-05-22; Adafruit Feather Bluefruit Sense with nRF52840
Board ID:feather_bluefruit_sense
UID:EA475CB29F814523
Code/REPL
import gc
import time
from adafruit_ble import BLERadio
from adafruit_ble.uuid import StandardUUID
from config import cfg
# For the wind speed and direction measurement
wind_device_name = "ULTRASONIC"
wind_service_uuid = StandardUUID(0x180d) # New: UUID of the service in ...
<img width="644" alt="b8caf9fccf836ff5b1423b63abe1060" src="https://github.com/adafruit/circuitpython/assets/114934309/e2388171-f34a-4e79-a966-6c5d795e67cc">
After connected cannot get the data from this wind sensor.
CircuitPython version
8.1.0
Code/REPL
import time
import ssl
import socketpool
import wifi
import microcontroller
# wifi.radio.connected
network = {"SPARK-YK3MAZ": "2XSGVxdwd9JDF"}
networkName = list(network)[0]#first network
networkPassword = network.get(list(network)[0])
print("connecting to "+ networkName)
connectionAttemptCounter = 0
while True: # connect to wifi
try:
wifi.radio.connect(networkName, networkPassword, time...
Which board are you using?
Hey all, not sure if im in the right place but im having trouble adding frozen modules to a new board build im trying. i get the following error. what am i missing?
make: *** No rule to make target '../../frozen/Adafruit_CircuitPython_LSM6DS/frozen_cpx', needed by 'build-raspberry_breadstick/frozen_mpy'. Stop.
hard to say without knowing what you did
just added
# Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LSM6DS/frozen_cpx
to the boards/raspberry_breadstick/mpconfigboard.mk file
it builds fine without this line
take away the /frozen_cpx. That is a special case for another library.
OH, yup. that will do it. make sense as per insturctions to. i just misread and took the first line and modified it
Thank you!
You'll want to make a subclass of Service and then get it from the connection. Here is an example: https://github.com/adafruit/Adafruit_CircuitPython_BLE/blob/main/examples/ble_json_central.py#L26 The service definition is here: https://github.com/adafruit/Adafruit_CircuitPython_BLE/blob/main/examples/ble_json_service.py
Greetings @tulip sleet , you were right about the size of the CPython asyncio library. Because I didn't realize that mpy files are inflated into RAM at runtime, the library uses too much RAM even for my tastes. 😳
So then...🥁 I've written code do to runtime freezing of loaded modules. Basically you boot, load all your modules into RAM, and then freeze them to flash. Now it is effectively the same as if all the modules were compile-time frozen and you have nearly 100% heap free to start running your program.
I've written the code for Micropython, but it could work for CircuitPython too. Let me know if you think this would be useful for CircuitPython.
Is that the flash filesystem or another region?
I use the filesystem.
nice!
MP was doing something similar but it needed a custom filesystem
please make an issue or PR with more details
Well I needed to add an optional "mmap" method to the block device interface in order to get the flash address of files.
And I only plumbed mmap up through FAT FS. Idk how Little FS works, but if it is one of those flash filesystems that relocates blocks internally, then that would be problematic for implementing mmap.
CP uses FAT only at the moment. Not all ports will have flash in memory space though
not all of them are XIP
Making long-term. Will revisit when USB host is working.
Yeah, I'm only using RP2. You don't need XIP, but you do need flash in memory space. But if you don't have flash in memory space, does compile-time freezing even work?
there may be internal and external flash
where internal is in the memory map but external isn't
I claim it has feature parity with compile-time freezing. Do you think there is case where compile-time works but run-time does not?
It doesn't have to use the filesystem if the internal flash is not a filesystem. The linker could allocate it space statically.
will it work with files larger than one block?
Yes.
even if they are in non-consecutive blocks?
I mean, I will do tmpfs soon?
a vfs class object that stores stuff in ram.
Or are you talking about mmap?
Does it catch the exception repeatedly, then reset? ...or does it eventually connect? Failure 15 is WIFI_RADIO_ERROR_4WAY_HANDSHAKE_TIMEOUT. I recall it has occurred before if signal strength is poor, or also if there are more than one AP device with the same SSID (but different password). There are probably other triggers for that exception. Can you give more detail on the network environment (distances, number of APs, channels used, signal strengths if known from other connections, etc.)?
It depends what we're talking about. The original mpy files don't matter. They get loaded into RAM as usual and then they could be thrown away. Then the freezing code freezes data structures from RAM into a file on flash. Conveniently the oofatfs library has a function for creating contiguous files on disk, and that is what I use. So the frozen file which the RAM contents is dumped to is contiguous, which is nice. Technically the whole file does not need to be contiguous, it only needs to be contiguous to the granularity of heap allocations, but I wouldn't worry about optimizing for that.
The purpose of this feature is to remove data structures from RAM. So moving them to tmpfs would defeat the purpose.
So you are effectively making swap space for data structures huh..
Well sign me up.
Conveniently the oofatfs library has a function for creating contiguous files on disk, and that is what I use
🤯
i put a invalid wifi password and its not throwing a error
Isn't Unknown failure 15 a ConnectionError that's caught by the try / except? Can you post whatever (if anything) gets printed to the serial console when this happens?
Before this PR, a call to start an AP with an invalid channel (not 1-13) would succeed, but the channel would be set to 1, and on espressif, the supplied SSID would be superceded by the default naming, ESP_XXYYZZ.
This PR borrows from the Monitor code and adds the check that the supplied channel is 1-13:
>>> wifi.radio.start_ap(ssid="ssid", password="password", authmode=[wifi.AuthMode.WPA2, wifi.AuthMode.PSK], channel=14)
Traceback (most recent call last):
File "", line 1...
@timid bolt Neat! If you are writing to CIRCUITPY, then the filesystem needs to be read-only to the host, which is not the usual case. So we need to think about that. Perhaps it should be another chunk of flash, and not necessarily even a filesystem. Also, we don’t want to write to flash on every restart and import, so it would be good to remember a signature or something and treat it as a cache or similar so an identical import does not cause a rewrite.
While writing some code yesterday i found out that we cant define functions with positional-only arguments - or did i do something wrong. Which arent a extremely useful feature but....
def foo(var, /)
How hard would it be to add support for them? I dont mind writing some C, at all, but im not familiar with how the interpreter works and dont want to try and do something that is way above my knowledge
After a little thinking i feel like it would need:
- add positional-only argument "type" (new entry on an enum?)
- recognize the
/in definitions to mark previous arguments as positional-only and next ones as keyword-only - enforce that positional-only cant be used with their names (perhaps just mangle their names?)
But i have no idea how hard these would be
Maybe it's not related to this issue, but let me share an observation:
I'm using an Wemos D1 R32 with the CircuitPython firmware 8.1.0 for doit_esp32_devkit_v1.
This was working fine for two days with code with utilizes a SS1306 on I2C to show its IP address.
In addition the on-board LED is used for blinking each 0.5sec.
The complete code section for I2C, display and wifi IP address is enclosed by try/catch. So even if it fails because of an I2C issue or no IP address it would start bli...
@spare jacinth I didn't immediately find whether upstream has discussed the implementation of this. If they had it'd probably be in https://github.com/micropython/micropython/issues/7899 or an issue referencing it.
Thx, will take a look later
Since this is FAT, I set the System, Hidden, Read-only attributes on the file which should discourage the host OS from messing with it.
What is your concern about writing to flash every restart? Is it wearing out the flash? What is your experience with that in practice?
I wanted to make the frozen files durable (re-usable across reboots) however the qstr table is a large obstacle for achieving that. The freezing could be durable without freezing the qstr data structures, and this would add maybe ~15% of the module size back into RAM. So it depends on what tradeoff you want to make.
found this, but i can understand close to 0% of it 🤣 https://github.com/micropython/micropython/pull/8480/files#diff-2c6df16e5bd7a045c2cbb7537a310a5642534b72af2bc5d768d1c1c08947a355
i mean, i definitely get the idea of adding a new type of arg, and the extra parameter/argument/field and its logic where needed, but how that's implemented is way above my understanding
I can echo that sentiment.
It looks like what has stalled the acceptance in micropython is the request to split it into two PRs (just syntactically accepting "/" is the first part, and actually treating positional-only arguments properly is the second part, if I understand it right). In CircuitPython we're on the verge of changing our "mpy format" for CircuitPython 9 so it's a good time for us to take such a change. If you're familiar with using git, you could see what happens if you try cherry-picking that patch series onto circuitpython; it might be trivial or it might be difficult, because we carry various other changes to the core code.
im only familiar with basic git commands. would it be something like git cherry-pick <hash>? guess i would also need the remote (and branch?) somewhere...
for now i simply named the "positional-only" argument of my mini-library (which almost nobody will ever use :p) with a dunder prefix, probably good enough for my use case
but the syntax seems like a useful feature to add, and if my limited knowledge can help, will sure do!
I tried starting the cherry-pick and there are quite a few merge conflicts. It looks like it would make sense to try this again later after dan's work to merge micropython 1.19 into circuitpython has been done.
I am just guessing that the conflicts are in areas where micropython changed since our last merge
The problem is that the host is assuming it has exclusive control of the FAT filesystem metadata. So if you add files, grow files,etc., even if they're hidden, you are causing changes in the FAT that the host is not expecting. MicroPython does not guard against this; we do, by making either the host or CircuitPython have read-only access.
@slender iron elf and objdump scripts
Okay. I guess you won't be able to freeze when a MSC host is attached. Having a a dedicated "swap" partition is still an option.
yep, a separate part of flash would be fine, and it wouldn't even need to be a file system
but then we have to decide how much to dedicate
BTW, how does this work in CircuitPython: I have a bunch of files open for write and I plug-in a MSC host. How do you stop CircuitPython from using those files?
i don't know what we do if you plug it in when running, but I think we probably prevent the host from getting r/w access if CircuitPython already has it.
i'm not even sure we run USB enumeration if you plug in when running.
Have you seen the LittleFS MicroPython direct execute of MPY from the filesystem? I think we talked about that already.
I've seen the LittleFS code, but I haven't seen that. Where is the code?
Interesting. That PR is changes to mpy files to faciliate freezing, but it is not freezing itself.
for boot_out.txt, there'a "pre USB enumeration" phase where the filesystem can be written without worry about interfering with the host. could this new mpy "optimization" step be done there?
@timid bolt can you explain again why it's important that the FAT files be contiguous? many devices directly map CIRCUITPY's storage into the regular data address space but not all (M4 Express, for instance)
and I'm not seeing why, without counting on flash being linearly mapped in the microcontroller's address space, FAT being contiguous matters
The whole file doesn't need to be contiguous, but it does simplify the implementation.
What needs to be contiguous are individual heap allocations when frozen. So if your flash block size is 4 kB, and you have a 5 kB array that you want to freeze, then you would need 2 contiguous blocks to do that. This situation is uncommon but not improbable in practice.
arg on erase_filesystem?
@timid bolt cached .mpy is interesting, but this is also a rabbit-hole. For asyncio, we have an existence proof that a small functional library is possible, from the MicroPython version. So I would rather head in that direction than work on ameliorations for large code size.
We can always freeze asyncio(EDIT: if necessary) (whatever version) on boards that have the firmware space, which is most. It is not code that changes very often.
Imagine having ljinux which is 80kb cached. The boot time would be nothing.
have you tried freezing ljinux?
of course!
Actually I will do the complete toolset just to see.
jcurses, ljinux, cptoml, telnet_console and their deps.
What borb should I try it on?
I have too many now can't choose.
Sure, I didn't do code freezing specifically for asyncio. It is meant to be generally useful.
if anyone is up for a total mystery:
https://forums.adafruit.com/viewtopic.php?t=202140
Cool, it looks like code freezing is in the pipeline for MicroPython then. It is probably better to wait for that.
got it 🙂 I agree it would be useful, and we can take inspiration and code from MicroPython. Your discovery about must-be-contiguous allocation in FAT gets over a stumbling block we saw with the MicroPython freezing. We thought we couldn't adapt it for FAT
I can't help you with that 🙂 I suggest rolling a die, being disappointed with the choice, and then choosing.
Well I am freezing onto yd-s3 which has 16mb of storage.
maybe they upgraded the bootloader with the wrong bootloader?? I am really confused. CIRCUITPY disappearing: could be corrupted: storage.erase_filesystem(), or nuke it and reload the right .UF2
yes. maybe? i have no idea.
I would go for the nuke.
I have seen some weird stuff (I blame c3), and always do a nuke when I see inexplicable weirdness.
If there are no files on the board, there is no reason not to.
this is nRF, so pretty diff. UF2 is protected and in flash
Yea, I have barely touched nRF. Didn't know.
I haven't updated my bootloader ever.
Wait, is there no way to freeze .mpy's directly? It has to be a folder? Or am I missing something?
the path is the top level of a library repo, etc., there's a script that figures out what to mpy-cross.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID
there is some latent support for single files, but it's inherited from MicroPython.
I saw that, and did the other modules I would normally use.
Well I will just try things till it works. Thanks.
in py/circuitpy_mpconfig.mk:
PREPROCESS_FROZEN_MODULES = PYTHONPATH=$(TOP)/tools/python-semver $(TOP)/tools/preprocess_frozen_modules.py
ifneq ($(FROZEN_MPY_DIRS),)
$(BUILD)/frozen_mpy: $(FROZEN_MPY_DIRS)
$(ECHO) FREEZE $(FROZEN_MPY_DIRS)
$(Q)$(MKDIR) -p $@
$(Q)$(PREPROCESS_FROZEN_MODULES) -o $@ $(FROZEN_MPY_DIRS)
$(BUILD)/manifest.py: $(BUILD)/frozen_mpy | $(TOP)/py/circuitpy_mpconfig.mk mpconfigport.mk boards/$(BOARD)/mpconfigboard.mk
$(ECHO) MKMANIFEST $(FROZEN_MPY_DIRS)
(cd $(BUILD)/frozen_mpy && find * -name \*.py -exec printf 'freeze_as_mpy("frozen_mpy", "%s")\n' {} \; )> $@.tmp && mv -f $@.tmp $@
FROZEN_MANIFEST=$(BUILD)/manifest.py
endif
It's really not ready for .mpy.
I should eventually fix this. It wouldnt even take that long.
I really like the Adafruit Grand Central M4 Express by using CircuitPython on it. Its ATSAMD51 has got an integrated CAN controller and related pins are exposed. So is there a chance to support canio (comparable to an ESP32)?
SAM E series has CAN, but I don't think SAM D does
Looks good. Also nice branch name.
Having #error all around the code is a +1 from me.
Linking can take 20s on x64 (-j12) and 4 minutes on my jacked (16% overclock) pi400.
Any obvious reason why an ESP32-S2 with watch.timeout set to 300 (seconds) would reset with reason microcontroller.ResetReason.WATCHDOG with no apparent long timeout happening?
that reset reason I thought was for alarm watchdog timeouts
should go 5 minutes, but it's happening quickly
it resetting, no safemode
Before I added alarm watchdog, it would crash but not reset itself. But adding the alarm watchdog makes it reset itself, just without the expectd timeout.
Sounds like broken watchdog logic to me..
Like, it setting up the internal timer, then crashing, and then acting as if it was a user-set timeout instead of a crash.
But it's 4 am.. So eh idk..
I think that's an error from some combined SAM D/E document. The product page for that processor says
Number of CAN Modules 0
https://www.microchip.com/en-us/product/ATSAMD51P20A
The two Adafruit MCP2515 boards (FeatherWing and Pico PiCowbell) are designed for 3.3v microcontrollers, but the CAN L and H are:
5V as required by the CAN Bus transceiver
I'd be a little surprised if the SPI speed is a bottleneck in an application. But true, the CAN-FD transceivers can oper...
Thank you very much for the clarification.
Meanwhile I understood the trouble: Adafruit's pinout was misleading me (this one might have been the better option for me). You are correct, the data sheet shows the difference between SMD51 and SME51. The hint about a feather shield is good, maybe I will be able to get hands on Adafruit CAN Bus FeatherWing - MCP2515.
Even if this is an older issue, is there any chance to get the M5Stack ESP32 GRAY working with new CPy releases?
https://shop.m5stack.com/products/grey-development-core?variant=16804796006490
The issue with mine is that it only has got 4MB flash because it's the "old" version. So I guess releases for 16MB like fitting to its "new" version wouldn't work, right?
@srolf Well, making a custom board definition and building it locally is always an option.
From there, you could try to make a PR to have it included onto the main repo.
@bill88t I will give it a try, just being little afraid starting it only after my 5th day with CPy ;-)
I suggest you take a read at https://learn.adafruit.com/building-circuitpython/build-circuitpython.
If you need any help I suggest hopping on the Adafruit discord (https://adafru.it/discord) in #circuitpython-dev.
Micropython just released support for Bluetooth on the Raspberry Pi Pico W. Here is the commit: https://github.com/micropython/micropython/commit/856e08b1931b88271816a2f60648f6ff332235b2. Maybe you can add Bluetooth support now.
Hello, I tried to compile circuitpython but got an error
CMake Error at esp-idf/tools/cmake/build.cmake:287 (message):
Some Python dependencies must be installed. Check above message for
details.
Call Stack (most recent call first):
esp-idf/tools/cmake/build.cmake:416 (__build_check_python)
esp-idf/tools/cmake/project.cmake:384 (idf_build_process)
CMakeLists.txt:19 (project)
Im using Fedora Linux
Never compiled it myself, but the "python dependencies must he installed" sounds like you need to install some package with pip that will get used during compilation
And probably the error message told you which package(s) you are missing
Did you run pip3 install -r requirements-dev.txt?
Also, the log you sent is incomplete. The package that it error'ed with should be listed above.
light sleep currently uses about 3-90 uA on nRF (depending on board). However, if you create a busio.UART and then deinit it, the light sleep uses about 1 mA.
This change fixes that by as per this post.
It works by using an undocumented register to power cycle the UART peripheral.
Similar behaviour ~24h later.
Meanwhile I modified the code in a way that no longer a sleep in my implementation's while-loop is used, but a check with time.monotonic(). The idea was that maybe the WiFi handling is blocked and D1 R32 and the router get in trouble (because of an expired lease). But this idea seems to be incorrect.
Next step was to restart the router by its web interface.
Remarkable
In the moment the restart sequence starts, the D1 RS32 get unblocked from "UID: ..."...
@slender iron You around for a question?
(I saw you messaged in help-with not that long ago, so I thought it worth seeing if you were still around.)
I have a Feather nRF52840, freshly loaded with 8.2.0-beta.1. Copy the UF2 over, CIRCUITPY never shows up and the LED is solid yellow. This isn't in the Troubleshooting page that I saw, it only references safe mode regarding the LED being yellow. And this is not one of the states, especially not for 7.x+.
Trying to test wiring on a personal project, and not even sure where to start with this.
There was some problem discussed a few days ago about the nRF bootloader needed up be updated as the UF2 size got too large
Wow.
So I loaded stable, and got safe mode and here's why. You are in safe mode because: CIRCUITPY drive could not be found or created. Press reset to exit safe mode.
Hmm.
This is running CP 8.1.0. Well, "running". Is the UF2 size thing a beta issue?
I'm not 100% sure, let me see if I can find the messages. I just happened to read it as the discussion was ongoing
I'll update the bootloader anyway.
It, um.... copied the UF2 file to the BOOT drive, and did nothing.
There was discussion then and before relating to this issue: https://github.com/adafruit/Adafruit_nRF52_Bootloader/issues/213
Not 100% sure if that is the issue you are experiencing but sounds similar
UF2 won't work and I can't figure out how to get into DFU mode. Says ground DFU pin and reset pin at the same time
I don't see a DFU pin/button
wait is it part of the JLink header?
CIRCUITPY showed up eventually.
But I think the bootloader on this thing is ancient.
these are the recovery instructions: https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather/update-bootloader-use-command-line
if circuitpy shows up eventually then uf2 should still be working
I tried it again, and it copies the bootloader UF2 file to the BOOT drive as a file, and nothing happens.
I redownloaded the file to try again there too.
Where are those files? Maybe the guide is out of date.
Wait, edited the guide page and clicked the button.
I have a link.
what version does the boot drive say it is?
Model: Adafruit Feather nRF52840 Express
Board-ID: NRF52-Bluefruit-v0
Bootloader: s140 6.1.1
Date: Dec 21 2018```
Downloaded straight from GitHub, still copies over as a file.
that's too old to update via uf2
I've done that 🙂
Trying the beta again
after the bootloader update?
Worked. Thanks, folks.
💤 for me. ✈️ tomorrow morning
Update Spresense SDK to version 3.0.1
"💤 for me. ✈️ tomorrow morning" <= Sleeping before going to the city that never sleeps... seems very much appropriate. (no tag to avoid waking you up)
🙂 flying home.
<@&356864093652516868> Just a reminder that the meeting is tomorrow (24 hours later then normal) due to the US holiday Juneteenth today. Thanks!
I am primarily looking at:
cyw43_arch_disable_sta_mode()
cyw43_arch_disable_ap_mode()
Just note, I have yet to test it.
I will let you know once I have tested everything.
@tulip sleet in the esp32spi socket, do you think it would make sense to raise TimeoutError from here in recv_into instead of break: https://github.com/dhalbert/Adafruit_CircuitPython_ESP32SPI/blob/743afe6ae442efcc20bf79dd5c878677b7f85998/adafruit_esp32spi/adafruit_esp32spi_socket.py#L129-L130 In testing MiniMQTT more thoroughly I think that I am understanding that CPython and builtin wifi sockets do raise this exception when they reach their timeout if they haven't gotten any data. (I have a very simple CPython test script that does)
The behavior is used here: https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT/blob/40b90968fb744ebaffce6b09ca27b5a7e747bbff/adafruit_minimqtt/adafruit_minimqtt.py#L1028-L1032 for "standard" sockets. If I am understanding correctly we could implement that behavior in esp32spi socket, and then not have the need for the logic here that is treating them differently.
I wanted to hopefully confirm whether any of this makes sense before I go too far down the road on attempting that change and testing the results though.
We should make them act like CPython. Of course if our client libraries (e.g. MQTT) don't know about this, we will have to make them know about it, but I would hope since we think those libraries would work on CPython as well, they should not need changes. (Or else they were not handling it properly to begin with.)
Regardless of the branch set. (It doesn't change it later)
This is misleading.
Spent 2 hours testing picow stability thinking I was on the new pico-sdk.
CircuitPython version
8.1.0-beta.1-44
(Running on a Seeed XIAO nrf52840 Sense)
Code/REPL
import board
import busio
import time
from adafruit_lsm6ds.lsm6ds3 import LSM6DS3
import digitalio
# board.IMU_PWR provides the power to both the LSM6DS3 chip and also the pullups to the I2C bus
pwr = digitalio.DigitalInOut(board.IMU_PWR)
pwr.switch_to_output(True)
print("Starting")
time.sleep(5)
print("Connecting to IMU")
with busio.I2C(scl=board.IMU_SCL,...
This adds a check to make sure that SDA and SCL are in a sane condition before starting any I2C operation. If they are not it tries to rectify it, and then returns an error code if unable to do so.
Pico-sdk update blocked by -Wundef of py/circuitpy_defns.mk.
Do I remove the flag, or do I duplicate the file and include it for use only on pico-sdk?
Most certainly this ain't gonna change from the pico sdk side.
For a 1 am pr, it's fine.
https://github.com/raspberrypi/pico-sdk/pull/1435
Could this be related to the warning about not using one of the SPI periphs while on battery power detailed here? I know that's SPI and your issue is I2C but seems similar enough to bring up.
what is CTX mode in aesio?
This is the plain version, not the Sense:
https://wiki.seeedstudio.com/xiao_esp32s3_getting_started/
Needs Seeed VID / PID
(anyone know a process or contact for that?)
Tested loading UF2, operating REPL, toggling user LED, connecting to a wifi AP.
why does adafruit_feather_esp32s3_nopsram board.c have (no never reset debug uart)```c
void board_init(void) {
reset_board();
}
void reset_board(void) {
// Turn on I2C power by default.
gpio_set_direction(7, GPIO_MODE_DEF_OUTPUT);
gpio_set_level(7, true);
}
but `adafruit_qtpy_esp32s3_nopsram` `board.c` hasc
void board_init(void) {
// Debug UART
#ifdef DEBUG
common_hal_never_reset_pin(&pin_GPIO43);
common_hal_never_reset_pin(&pin_GPIO44);
#endif
}
maybe we need a canonical board def for each chip, boards defs maybe vary based on what other board(s) were used as a template
Also need to figure out why u = board.UART() gets a hard fault on this board but not other S3 boards. Haven't spotted a difference in board defs from boards that work.
Another difference: adafruit_feather_esp32s3_nopsram mpconfigboard.h has the standard busses like this:c #define DEFAULT_UART_BUS_RX (&pin_GPIO38) #define DEFAULT_UART_BUS_TX (&pin_GPIO39) but adafruit_qtpy_esp32s3_nopsram mpconfigboard.h has:```c
#define CIRCUITPY_BOARD_UART (1)
#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO5, .rx = &pin_GPIO16}}
hi @timid bolt (I'm from MicroPython project) I'm not sure if you saw it linked from the PR that @tulip sleet already linked to, but the real PR of interest (IMO) is https://github.com/micropython/micropython/pull/8381
so to clarify a point from the discussion above, our plan wasn't to have contiguous files on littlefs, rather to have a dedicated mmap'able filesystem for .mpy files. this could in theory be written to by the device, but our plan (as implemented in that PR) was just to have a way to have mpremote send the filesystem image over to the device. (it's really fast, because you're just writing whole contiguous sectors... i.e. 8-64kiB at a time)
see https://github.com/micropython/micropython/issues/8426#issuecomment-1276997914 where i have some performance stats for MSC vs mpremote vs mpremote-mappable-filesystem
(it's basically fast enough that for most projects you can just deploy the entire filesystem in your regular dev cycle -- copying a whole directory tree of .mpy files is basically as fast as copying a single .py file in other ways, i.e. mpremote/ampy/msc)
I'm not quite following your discussion about FAT and contiguous files with respect to freezing (freezing is completely unrelated to the filesystem), but happy to answer any questions. I've talked to Scott about this a fair bit -- we spent some time exploring the possibility of the .mpy format being broken up into (say) 512 byte chunks which would allow .mpy files to be mmaped from any filesystem, but this comes at a huge cost and i don't think worth pursuing
Hi Everyone, I'm Ron from WIZnet HK.
After viewing these issue, I wanted to try to modify our socket section that allows the SSL function could work on our PICO board in circuitpython.
Will there be anyone could help me to give some guideline to work on this development?
Also, I had join the discord chat as well. Which hastag section that I bring up this topic?
@DJDevon3 I don't think so. This issue only occurs when the I2C bus pull-ups are unpowered - this leaves both SDA and SCL low (which is an invalid state for I2C). It also affects both TWIM peripherals, whereas the one you reference only affects SPIM3
Thanks for figuring this out! Some refactoring suggestions.
Since these all return MP_EIO, you could just remove them and have them be under default:.
Could you also call this in common_hal_busio_i2c_construct() instead of having mostly duplicate code here and there?
Thanks for correcting my misremembering from one of get-together meetings about this.
@ruby pilot @timid bolt You may also be interested in Greg's thoughts and work on asyncio (or really its underpinnings). See https://docs.google.com/document/d/1xlzTEdP8ovTtz5Sx8voP8R9M8fY88LuyiWBYu0muiRc/edit#heading=h.e5q2xniyfysc, which maybe you have already seen, and is reflected in https://github.com/adafruit/circuitpython/pull/7711. Greg and I discussed this and think it is going in a different direction than what MicroPython has done for asyncio and is thinking about for the future, but you may still be interested. Greg has been experimenting with sample code (not yet published) that uses what the PR and the asyncio library rewrite provide.
Lightweight Asyncio Support for CircuitPython Goals Allow drivers to schedule a callback from an ISR into the main async loop in a way that is composable with other drivers/libraries and does not depend on a specific asyncio module implementation. Allow native libraries to define Python-callable ...
On my i5-1235U laptop this speeds LTO "partition=balanced" builds substantially, because each "partition" can be run on a separate CPU thread. I used "pygamer" as my test build with a parallelism of -j4, and took the best elapsed time reported over 4 builds.
The improvement was from 34.6s to 24.0s (-30%).
A link-only build (rm build-pygamer/firmware.elf; make -j...) improved from1 17.4s to 5.1s (-70%)
The size of the resulting firmware is unchanged.
Boards that are nearly full u...
Ha! I would have thought this was the default. Thanks for investigating.
CTR mode is mistakenly called CTX mode in a couple of places in the documentation. Noticed by @Fridgeman in discord.
Is support for settings.toml with os.getenv written in C or Python?
I would like to open a PR adding support for booleans on it, as (dis)abling stuff from it seems like a common scenario.
And asking is faster than digging the codebase 😬
It's written in C. But @brazen hatch has been working on a Python library to access settings.toml.
My keyboard is dying. It's got bools
And strings and math stuff.
I just need to do more advanced types at some point.
I also made a very basic parser a week(ish) ago, will try and PR your repo with some stuff
But that will be in, at least, a few hours 🙃
Well, if you need me, I am here.
The DevZone post you link to says:
Just adding that the UARTE TX has to be stopped explicitly when it's finished. If you just close the UART without stopping the transactions the UART will continue to keep the clocks running, as described above.
This can be done through the nrfx_uarte_tx/rx_abort() functions, or the TASKS_STOPRX/TX registers directly.
If you do this before disabling the UART the above workaround is not needed.
Could we do the _abort or use the TASKS_ST...
<@&356864093652516868> Just a quick reminder that the meeting is in 20 minutes.
My audio output is borked. I can't hear anything yet.
k, we'll wait
i usually play a youtube video in the background when swapping between audio sources to know when i'm on the right one
FYI: I sometimes have to rejoin the channel for audio to fix
I rewired a bunch of things last night and apparently the audio is borked.
I completely reloaded Discord. 🙂
make sure audio/mic is selected in discord. it's possible for the computer audio/mic is set independently of what's set in discord. i've done that a few times.
This was entirely my rewire. I had music playing, and it wasn't coming through either.
So I switched everything to my Scarlett monitor, which works fine, and put on headphones instead.
Hi @vale spire, I looked at PR 8381 and it seems like it is only going to access from flash the bytecode and string constants stored in the mpy file. I initially did something like that but was disappointed in the results because it didn't free up enough RAM. The bulk of RAM usage came from the globals/locals maps of the modules and their types. Just freezing the strings and bytecode didn't put a big dent in RAM usage, so I ended up taking a different approach. This approach works like a relocating garbage collector that relocates module-related data structures into a 2nd gen flash heap.
CircuitPython version
Adafruit CircuitPython 8.0.5 on 2023-03-31; Adafruit Feather RP2040 with rp2040
Code/REPL
message = bytearray()
print("CHECKING PACKET")
message.append(FRAMESTART) # 0xC5
len_high = (PACKET_LEN >> 8) & 0xFF
len_low = PACKET_LEN & 0xFF
len_packed = struct.pack("B",int(105))
#message.extend(len_packed)
print(len_packed)
message.append(105...
ooh cool about the swirl grid
pushing developer mode to production, reseting every 5 seconds is fine. 😛
USB and simple file editing FTW!
You're welcome!
awesome story
I've never heard of LLD or LLVM, short explanation please?
thank you
ah ok
LLVM is a set of compiler and toolchain technologies that can be used to develop a frontend for any programming language and a backend for any instruction set architecture. LLVM is designed around a language-independent intermediate representation (IR) that serves as a portable, high-level assembly language that can be optimized with a variety o...
ok now
@midnight ember maybe check out what scott did with json streaming, it sounds like it could be useful here.
Didnt read convo, but LLD is likely Low Level Driver
with most of our dev boards, sensors and feathers now sporting plug-and-play stemma QT ports (https://learn.adafruit.com/search?q=stemma%2520qt) it can be very fast to put together projects with half a dozen boards snapped together. But now you don't have a breadboard as a mechanical substrate... which is why jepler and scott collaborated on thi...
The lld subproject is an attempt to develop a built-in, platform-independent linker for LLVM.[49] lld aims to remove dependence on a third-party linker. As of May 2017, lld supports ELF, PE/COFF, Mach-O, and WebAssembly[50] in descending order of completeness. lld is faster than both flavors of GNU ld.[citation needed]
I think it's "l" for llvm + "ld" as the standard name of the unix linker
i'm used to only using the requests library, is it the chunked stuff? that could be helpful sure. i have no experience with it. have a link i could check out for a stream example?
ESP32SPI is AirLift. It has its own library, which was not quite standard stocket API, and also had some extra stuff.
Here's an example of a geographic area. too much data for an m0 for example.
did you ever figure out how to play the enterprise game Jepler?
the grid mounting thing i'm definitely getting some
@midnight ember I didn't play trek on runcpm, no. I did on my real xerox 820 🙂
TRRS guide, hence the audio issues getting back to discord? Usually happens when playing with audio projects.
Very nice Melissa, great updates.
@midnight ember https://github.com/adafruit/Adafruit_CircuitPython_JSON_Stream
thank you
https://github.com/raspberrypi/pico-sdk/pull/1435 is needed. Otherwise we would have to remove our -Wundef.
1 whole version (8.0) is enough of a transition period I feel like.
Changing PortalBase will affect quite a few guides: https://github.com/adafruit/Adafruit_CircuitPython_PortalBase/blob/main/adafruit_portalbase/network.py#L36-L43
cptoml could be feature complete (with lists and dates) in like 2 days of work..
need to make sure we educate users on what the key fields in settings.toml do, web workflow or not, WiFi credentials without enabling web worklfow, etc.
...resolve the question of whether auto-connect is made distinct from web workflow
maybe start with just a very small number though?
yeah, wifi being the key thing (oh, sorry, that was about guides probably)
We have an existing line of code that sets different flags for SDK files (including -Wno-undef) but it evidently is not being applied to this file. It may be because it is a ".S" file or for another reason I'm not aware of:
SRC_SDK := $(addprefix sdk/, $(SRC_SDK))
$(patsubst %.c,$(BUILD)/%.o,$(SRC_SDK) $(SRC_CYW43)): CFLAGS += -Wno-missing-prototypes -Wno-undef -Wno-unused-function -Wno-nested-externs -Wno-strict-prototypes -Wno-double-promotion -Wno-sign-compare -Wno-unused-variab...
secrets.py access tend to be in the high-level device helper libraries
about 125 bundle examples seem to use secrets.py; about 106 learn files (just looking for the string "import secrets"). fwiw.
libraries/helpers/portalbase/adafruit_portalbase/network.py:37:18: from secrets import secrets
I think the way this will affect guides the most is instead of telling users to add some API key to secrets.py to instead add them to settings.toml.
yes
@crimson ferry I didn't find it in a super quick search, is ther an issue proposing the enhancement of "connect based on settings.toml but do not start web workflow"?
can do 👍
I'll check, Neradoc would know
Also at some point, we should also try to make it store multiple wifi credentials for portable boards.
Because with software implementations it means no web-workflow.
yes that would be preferable to be able to separate them and disable web workflow if possible for a requests only project
sounds like a plan
Yea that code still needs work, to be able to handle it from software.
Cause those interfaces cannot be stopped, disabled of handled like a console object.
unlike usb_cdc
does neradocs keyboard layouts have capability for different keyboards like azerty? could use some of that?
me waiting for them to find out arrow keys
It's 3. 3 bytes.
And some function keys also have similar keycodes.
⬆️ ⬇️ ⬅️ ➡️
Alt + 91 + 65
Alt + 91 + 66
Alt + 91 + 68
Alt + 91 + 67
das nicht keyboard uber funct nein!
Yea, I have my own full curses implementation.
lol
if there's a problem the translators will likely be the first to let you know
I just shoved everything terminal related there.
Happy to help.
i've been using unicode in repl lately for status connections
they stand out and are very helpful
I do ansi escapes for terminal detection and size too.
°F I hope
F
Ah. Good.
converts to Murica units
Thanks all!
Thanks
ttyl
Behaves the same in CPython```py
x = b'\x69'
x
b'i'y = bytearray(b'\xc5\x69\x00')
y
bytearray(b'\xc5i\x00')
Also something I forgot to bring up. Perhaps it would be worth it having a persistent list of consoles in circuitpy so that we can have persistent custom REPL inputs.
And to mirror output to all of them like how micropy does.
This would be really hard to implement though, cause all the objects in there, regardless of their contents would have to be persistent across reloads.
So something like replio.consoles[]. Where you can just append or remove any as long there is at least one.
There could be a replio.active where you just put one by index, or None to mirror to all.
To do it under my stuff it would be trivial now, but doing it on the core could unlock so many more possibilities.
Like actual telnet workflow. Or even ssh workflow if someone is daring enough to make it.
Audio update: The plug into the speaker wasn't in completely. Fixed.
Just dropped an issue with some initial thoughts, dont take any of that too serious as it is just what crossed my mind right now 😛
Will try and make a PR at some point, but some discussion on what/how to do should precede it
Python, even in bytestrings, prints the regular printing character if possible. Otherwise it prints an \x... escape. Note that b\x69 and bi are exactly the same thing, just printed out differently. They are both one byte long, and contain a single byte whose integer value is 0x69.
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/1VFqasfzcuR1nmpfB-IxASRSf9isPpRWfG1O3ZAUnp8Y/edit?usp=sharing
CircuitPython Weekly Meeting for June 27th, 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 part...
Do we want to wait until after 8.2 to do this?
@onyx hinge @tulip sleet when do we want to triage 8.x.x so that we can get 8.2 stable?
I can't wait for this to happen. It would enable KMK firmware to use bluetooth, thus enabling simple building of wireless keyboards using the Pico W...
We've put a lot of work into BLE on the nRF52840 and recommend folks using it. Supporting the Pico W isn't a high priority for us (but we're happy to guide and review if someone else wants to take it on.)
Will there be anyone could help me to give some guideline to work on this development?
I don't know a lot about SSL but can help guide you in CP. @victorallume's comment seems on the right track. The goal would to to have the native ssl module wrap a non-ssl, Python-only socket object.
Also, I had join the discord chat as well. Which hastag section that I bring up this topic?
#circuitpython-dev is the best place to discuss modifying the C core of CircuitPython. Note that most o...
@microdev1 Added this and would know what to fix.
Please ping me when this is ready for another look. Thanks!
I am out walking and shopping. But pretty much any time.
Ugh, compiling Arduino. Starting my entire journey into this with CircuitPython seriously spoiled me for a lot of other languages.
@slender iron yeah todbot has experienced the same thing. for me it's better if I scope the I2SOut / PWMAudioOut object using a with statement.
It appears that during flash writes background callbacks don't run (expected) but instead of audio DMA stalling or re-cycling old samples, it gets noise instead.
I looked around but couldn't figure out why.
On reflection today, I guess that when a DMA descriptor gets chain-to'd doesn't wrap or get reset to its initial address, but keeps DMA'ing on into higher addresses. The fix would be to place the buffers so that they could be "ring"'d? which would make old samples get looped when this happens. https://www.raspberrypi.com/documentation//pico-sdk/hardware.html#rpipede9f09e5034a1bdad43
this user is reporting it when only printing to the console, hm.... that's different than what I've encountered.
If that is the case, stop_ap for picow is gonna be only on 9.0 since no 8.3. Your choice.
I will complete the PR asap.
I just listened to today's meeting. I'm really looking forward to the possibility of native keyboard support for the REPL 😁. In terms of a lightweight editor, I've been using an edlin (dos line editor) clone that I Frankenstein'ed together but I wonder if something like @slender iron's basicpython.py interface would work. Some work needs to be done to optimize the save/load functions but the simple line number editing model used by Basic is something that most people would be familar with and if not it's easy to learn.
@candid sun sorry to ping you directly. I saw the newsletter mentioned you're writing a guide and playing with the ikea air quality module (SEN54). I sorted the library if you haven't done that bit yet, it's ported from the official sensirion one (plus the base i2c driver). https://github.com/good-enough-technology/CircuitPython_sensirion_i2c_sen5x
Cool, thanks! I’ll take a look
I did wonder about this but wanted to touch the pre-existing code as little as possible. Have made the changes
I think I'd disagree here. I'd quite like having the expected errors made explicit, so we already know that e.g. NRFX_ERROR_DRV_TWI_ERR_DNACK should deliberately be interpreted as MP_EIO. This means that in future if someone does something that will generate that error message, they know that is the correct translation. I would expect gcc to optimize this out in any event
That is fine with me. I wasn't sure whether all possible errors were handled here.
@furbrain Before I approve, I just want to check that you have tried this on hardware after the latest round of changes.
It now builds, but I saw some instability in wifi connection code (I once got a ConnectionError: Unknown failure 1 right after boot). It will need some testing. It works a good bit though.
added the Bee Data Logger to my other family of Bee Esp32 boards.
re-submitted this pull request as the first one was all sorts of messed up somehow.
very generous to include the kicad script too, nice work. Wish I had bought some nylock stuff one of those many times I got tempted. Assume you making a whole wall of it for JP., aka the largest circuitboard ever produced by adafruit..
Good point, yes, I have tested it using the code provided in #8093, and the
second print statement now produces an OSError - which is what I would
have expected.
Phil
On Tue, 20 Jun 2023 at 23:39, Dan Halbert @.***> wrote:
@furbrain https://github.com/furbrain Before I approve, I just want to
check that you have tried this on hardware after the latest round of
changes.—
Reply to this email directly, view it on GitHub
<https://github.com/adafruit/circu...
I absolutely agree and also feel uncomfortable using undocumented registers. However:
I did add the _abort calls but these don't seem to actually reduce current consumption on my chip - only the peripheral reset code seemed to work. I've therefore included both strategies in the PR. The RADIO peripheral on nRF52840 does also use a (documented) register at offset 0xffc for power cycling the device, so I would hope that this is in fact a general architecture decision.
Thanks for the feedback about the change. You've included a pointer to the undocumented fix, so that's the best we can do for now.
@tannewt Thank you. I think it's ready for a look, though I hadn't made it back to write out a comment with my current thoughts yet.
The current version resolves the original issue of spending time to render hidden objects by introducing a new boolean field that gets set to true once the hidden object have been rendered the first time. It still takes the same amount of time when it does initially render after becoming hidden, but then on subsequent refreshes it gets skipped.
With the c...
Imagine wishing you could use circuitpython at work instead of C and C++
It’s me every day lol
Sadface.
Unfortunately the gubment doesn’t like open source
Are you setting the branch using the Use workflow from dropdown? The intended way is to use the Version input box.
Yea I did use the Use workflow from..
I though that for branches that is what I should be using.
Oh well..
kattni...
when you're around... what needs to be done to deprecate a library module (one of several files in a library)? there's active consideration of deprecating the NTP within WIZnet5K https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k/issues/118 in favor of adafruit_circuitpython_ntp
@tulip sleet @slender iron sorry, I was "out" yesterday afternoon. I'd be happy to meet sometime today, maybe in the hour before the other meeting tonight?
any time today is fine
At my desk now and anytime works for me too. So, I'll assume the hour before our normal meeting is best
We usually try to eat dinner sometime 5-6pm ET, so maybe 2 hours before instead? 4pm ET/ 3pm CT / 1pm PT ?
that'd work for me too
This I know. My bestie-co-home-owner was gubmint for decades. Civilian gubmint-adjacent for probably at least a decade. He would be trying to write some code, look into whether someone else already had, and find out, of course, but it's open source. Hah.
One file within a library of several. I don't think we've ever done that.
I have an idea though.
we would just delete the code (or make it raise NotImplementedError), and do a major version bump
I don't think we should delete the code. I'd say comment the entire file out, raise the Error, and print that it's no longer supported. Then major version bump.
We don't delete deprecated libs, we make them read-only.
So...
This is kinda that?
the previous version would always be in the repo
I know.
The library is fine. I wouldn't comment out the code, just delete it, it's in the git history.
NTP library already had a complete switcheroo from esp32spi to native wifi
OK, sounds like a good plan, thank you
of course we will note the deletion in the release notes
Please tag Dan and I on the PR so we can verify wording and all of that.
This looks right! Thanks!
This works for me now because it is an improvement. Thanks! I'm sure there are plenty of optimizations/bugs to fix in displayio and this is another.
Okay
@tulip sleet @slender iron I am available anytime to start this meeting
i can start now, finished that build
me too
Are there any guidelines / tasklists of what is required to do that?
This may have to do with the powerful pull up on an I2C bus...
I've got experience in embedding Nimble in Micropython on the Micro:bit v1. It's transferable skills to this use case, would it be possible for it to be sponsored for me todo it for CIrcuitPython?
Triage notes:
- Input array is unsigned, but check whether I2S is expecting signed data.
- if
left_justifieddoesn't work, either fix or throw an error.
@tekktrik are you planning to work on this? Otherwise, we'll just move it to long term.
i read somewhere that at initializing the lib tries to measure a base value for non-touch state.
maybe this times out in some way because of the pullup? (some sort of out of range / overflow thing?)
Once we've updated esp-idf in CP 9 we should revisit this and see whether anything's improved. If not, we have options from a "1s sleep workaround" to implementing our own ping using LWIP API calls.
Retest after updating to ESP-IDF 5.
Hi, I'm on macOS Monterey with Sphinx installed via Brew. When I try to build docs I'm getting an exception:
(venv-adafruit) ?127 Adafruit_CircuitPython_Wiznet5k/docs % sphinx-build -E -W -b html . _build/html
Running Sphinx v5.3.0
Extension error:
Could not import extension sphinxcontrib.jquery (exception: No module named 'sphinxcontrib.jquery')
The extension is listed in conf.py which is all the help that Google gets me. Any help greatly appreciated!
@markbarna Did you get any further on this?
It sounds like there may still be an underlying issue causing the board to enter safe mode (e.g., hard fault, assertion failure, etc) that can be entered as its own issue. However, the misunderstanding about what "on next reset" means has been cleared up, and safemode.py has provided an adequate way to recover, so closing this one.
I pip installed the extension. Still got the same result as you did. So I commented out the "sphinxcontrib.jquery", line under extensions in conf.py, and it ran enough to tell me it can't find things.
🤷🏻♀️
I'm sure it's going to fail later when it gets to the part that uses it. But...
Actually, that worked. Checking to see if it really built.
Sure looks like it did.
I exited the virtualenv, and it still runs with that line commented out.
So apparently no need to pip anything.
might be worth re-checking after we update esp-idf
This seems like a terrible workaround.
Thanks, that's working for me too. Now I get an error because Sphinx cannot find the deleted NTP module. How do I tell Sphinx to stop looking for it?
I imagine something in the code is looking for it.
Possibly anyway.
re-test after esp-idf update in 9
Usually you toss things into the autodoc_mock_imports to get Sphinx to stop trying to use them.
There's going to be some resource limit. If this is causing a problem with a specific use-case then it may be worth discussing it further.
Please re-test after idf 5 upgrade
Yes, the implementation of deep_sleep_... is to raise a DeepSleepRequest exception. It may be that printing this exception causes a problem, or something else is weird.
You should probably either change this to catch Exception or (Exception, KeyboardInterrupt), rather than BaseException, since even if it "worked" it would erroneously turn a DeepSleepRequest into a 10s delay & supervisor reload.
The only place I can find it (BBEdit searched everywhere in the folder) is in api.rst. Can I delete it from there?
You need to or it includes it in the docs.
So yes 🙂
Yay. Thx
Please re-test once we've merged IDF 5 support into CircuitPython 9.
api.rst ? where ?
ah in a library yeah
that is managed manually, sometimes a library is actually missing docs for a submodule because of that 😅
closing as it looks like it's probably an issue in lwip's mdns implementation, and there are workarounds.
It wouldn't hurt to re-test this after idf5 but it's probably our bug.
I'm looking for clarification on my question above, but otherwise happy to complete it!
I've got experience in embedding Nimble in Micropython on the Micro:bit v1. It's transferable skills to this use case, would it be possible for it to be sponsored for me todo it for CIrcuitPython?
Maybe! Email pt@adafruit.com and he'll chat with you more about it.
It looks like this one (and others in this section) are could be moved over to the Core Modules section, but I'm not sure I could put it in order alphabetically. Would it be work combining the "MicroPython libraries" section entirely into the "Core Modules" section?
I think this would be OK, perhaps adding a warning at the top that though they appear to be in alphabetical order, some modules are at the bottom. Note that help() is already at the bottom. Could also add a link to the Modu...
added the next board in my Bee ESP32 product family.
Hi @dhalbert , unfortunately no. I was a little wary of trying to use an Arduino library to set adjust overclock settings on a MatrixPortal for fear of damaging it. But also I got swamped with work so this is sadly been sitting on my work table waiting for me to have a minute to pick it up again. If you have any other suggestions that might be a little more straightforward, happy to try them. Otherwise, I should hopefully get a chance to dig back in and try messing with the Ardiuno library th...
I don't know if this will be of any possible use as in my case I was only using a single 64x32 Panel but fwiw, when I started filling up my panel with lots of pixels I would see similar distortions as you've displayed. Since it seemed to be related to how many pixels I lit, I guessed that it was a power issue and in my case I was able to boost the voltage on my supply by a volt or so which eliminated the distortion issues. My power supply should have been able to provide more than enough curr...
Scratch that... I just went back and re-tested on my panel and noticed that my power supply had a current limit set for about an amp so when I lit all the pixels up the supply went into current limiting mode. Turning up the voltage reduced the current needed which is why that solved my problem but I just increased the current limit at 5V and that also solved the issue, so increasing the voltage probably isn't they way to go.
the things to make a library available for circuitpython in C are C macros right ?
Where are they defined like MP_DEFINE_CONST_FUN_OBJ ?
If I google I fall upon https://micropython-usermod.readthedocs.io/en/latest/usermods_05.html but that is for micropython. I couldnt find where they are defined in circuitpython code (or maybe github is confused with the fork stuff)
what do you want to do? Do you mean you have an existing C library you want to include in CircuitPython, or are you talking about Python libraries?
the MP_ macros are nearly all defined in various files in py/
we use ag or similar search programs rather than GitHub search (which is getting better0.
Id like to see the definition of the macros so I can understand how it works since it seems three of them are used to make a C library for use in the circuitpython libraries
Mostlly want to make a library for https://wiki.dfrobot.com/TCS3200_Color_Sensor__SKU_SEN0101_
wiki:This is a RGB Color Sensor breakout uses TCS3200 RGB sensor chip and 4 white LEDs. The TCS3200 can detect and measure a nearly limitless range of visible colors.
Like here: https://cdn-learn.adafruit.com/downloads/pdf/extending-circuitpython.pdf it says to uses: MP_OBJ_NEW_QSTR which sounds like a C macro
Seems like it's in py/runtime.h but I cant find it
Ah found it: #define MP_OBJ_QSTR_VALUE(o) ((((uint32_t)(o)) >> 1) & 0xffffffff)
#define MP_OBJ_NEW_QSTR(qst) ((mp_obj_t)(((uint64_t)(((uint32_t)(qst)) << 1)) | 0x0002000000000001))
yes that macro is in py/ somewhere. But for a sensor like this, it would be easier to write the interface code in CircuitPython, rather than port the C library. Looking at the datasheet, this is a pretty low-level sensor, which outputs pulse trians at various frequencies. This would require real-time reading of the pulse trains, it appears. But CircuitPython needs to do other things in the background that will interfere. You may want to use pulseio.PulseIn, or frequencyio.FrequencyIn to read the frequencies.
Or, rather than using this sensor, choose another color sensor that is easier to use: https://www.adafruit.com/search?q=light+color+sensor
hmm, here is a simple example already: https://www.cytron.io/tutorial/color-rgb-detector-using-circuitpython-on-raspberry-pi-pico
I already paid 40$ for 2 of them 😦
Ok I'll do that. I know im missing a third macro(?) I dont understand what they do yet but I see it in every circuitpython libraries definition (like displayio) so you can call them in circuitpython after compiling them after the circuitpython core/sdk . And the circuitpython guide says you have to use all 3 or it wont work (Im missing the third one)
there are many details needed to adding a C library. Far easier to code in Python if you can
we don't call the built-in modules "libraries"; we call them modules, to distinguish them from the libraries written in Pytnon
the "extending circuitpython" guide is out of date, unfortunately
I see. So if I understand in doubt I should ask here and I will probably be told this can be done with user code. Otherwise Id be given some hints as out to make a module for it because the guide is out of date ?
we'd like to update the guide but haven't had time, and it's a bit of a moving target. And yes, we have native modules like PulseIn that will help solve your problem without C code.
The best way to add a native module is to take an existing one that's similar to what you want to add, copy it, and replace the insides.
Then you get all the boilerplate initially.
@timid bolt is this relevant to your async goals? https://github.com/micropython/micropython/pull/6125 I think we already discussed this.
_Background: the aim is to make events in MicroPython more generic and efficient, rather than having busy polling (based on POSIX poll) and being restricted to stream IO. _
I was reminded of this because of the recent discussion in https://github.com/micropython/micropython/issues/11837
Restating this without use of id:
Put the following in nested.py:
# content of nested.py
l = [[]]
l0 = l[0]
and the following in code.py:
# runtime
import nested
nested.l0.append("test")
print(nested.l)
With python3, it prints [['test']], while with circuitpython it prints [[]]``, because in circuitpython nested.l0andnested.l[0]` are not the same object due to the implementation of "long lived" being unable to move objects.
@tulip sleet @slender iron fwiw I started looking at making long-lived optional and I noticed that gc_alloc has changed radically in micropython (code size optimization & "split heap" support) so in terms of sequencing our work it doesn't make sense to do until the micropython merges are complete.
there are also now "tracked allocations" which don't get gc-d, for long-lived buffers. Not sure if this would be a substitute for our non-heap allocations before the VM starts.
or maybe that is what you meant by "split heap".
#if MICROPY_GC_SPLIT_HEAP
area = MP_STATE_MEM(gc_last_free_area);
#else
area = &MP_STATE_MEM(area);
#endif
I don't exactly know what it is, I just saw these lines in gc.c..
MP has the ability to have the GC heap split between multiple allocations instead of just in one big allocation.
That PR is 3 years old. What should I take away from that?
it is old but they still want to go in that direction, as mentioned in zephyr issue I linked
it is just that they are also talking about not spin-polling in that PR and the zephyr isuse
i was wondering if the approach in 6125 is at all related to your ideas
It certainly has similar goals, thanks for pointing it out, but I haven't dug into the PR though. And the zephyr issue says, "might be a while until it's finalised".
yeah, I'm not expecting to wait until it's done, just whether the approach is interesting and whether we might end up on convergent tracks with them
or whether that PR is more restricted in what it can support than your approach
There's still more code in gc_alloc that could be simplified, but this will wait until after the micropython merges because there's also upstream churn.
I tested this on the unix port (only) with LL both enabled and disabled. The mpconfig.mk has to be edited to change the setting, so CI will only test one way.
It's not quite fair to say this "closes" #2687 but it does allow someone who is affected by the difference in identity semantics to turn it off in a custom build.
In practice...
The maximum GIF width is 320 pixels, because there's a statically allocated buffer that's a single line of the image. The height is not limited, but on Pyportal Titano, if I increase the mag height to 480, 480x320 images run out of RAM. Shorter images can display, but they're pretty uncommon (I tested with 480x150, etc.).
GIFs that are too large for the display get cropped to the right and bottom.
In the long run there will be boards with more RAM that could handle larger images, so we ...
@TheKitty (or anyone): What are the exact restrictions on what kind of GIF can be used? I am not familiar with what palette, color, etc. options are possible vs what is supported. I'm just looking for a specific "your GIF has to be ...". I will add that to the doc.
@gamblor21 see previous post - you have best info about what GIF format is needed. Thanks.
I wrapped my findings into the guide to help folks. I think there should be some error handling on passing args that break things but that's just me.
@TheKitty I have a not-yet-submitted PR that will explicitly report the image width is too wide instead of just saying "Invalid file".
I edited the guide a bit to say 320 is max width instead of 480 and to discuss height.
Fixes #7685.
- Expcitly check error code from gif animation library for image too wide.
- Add more info to
OnDiskGifdoc.
Due to a statically allocated buffer in the underlying code, OnDiskGif is limited to a maximum fixed image width., currently 320 pixels. This could probably be made dynamic.
- Fixes #7379.
Documentation update only.
-
Fixes #7680.
-
Documentation corrections and improvement.
-
Use
authmodeinstead ofauthmodesinternally. Originally I thought I would rename thestart_ap()keyword argfromauthmodetoauthmodes. But the plural usage is not consistent with the naming used internally in Espressif and Pico W, and elsewhere. An "authmode" can be a combination like WPA/WPA2/PSK.
Hi,
I am hoping to get a port of this https://github.com/vrialland/micropython-ht1632c library for circuitpython.
Thank you to anyone who can assist!
should we require usb host init in boot.py and skirt the issue of deinit and re-initing it?
probably a separate issue / PR, but I believe WPA3 is supported now in esp-idf release/v5.1 ...not sure how that maps to CircuitPython releases
@crimson ferry we'll update to idf 5.x for CP 9.0
sounds fine to me
probably a separate issue / PR, but I believe WPA3 is supported now in esp-idf release/v5.1 ...not sure how that maps to CircuitPython releases
We can add that in 9.0.0; I'll update the doc as necessary.
CircuitPython version
8.2.0-beta.1-12-g0da62416a-dirty
Code/REPL
N/A
Behavior
Per @ladyada:
Mounted filesystems don't appear - i have a microSD on /sd but does not show up over wifi.
Checked via /fs/ folder on the device and it wasn't there either.
Description
No response
Additional information
No response
Per @ladyada:
this screen should show disk space used/available
Change looks good to me. For reference the 320 limitation can be changed but is a compile time setting. Increasing it increases the memory required to decode any size GIF.
I tested on an S3 Box Lite using the code above, with CircuitPython 8.1.0. I let the terminal program sit without input as described above for 15 minutes and did not fall into safe mode. When I entered a blank line, the program exited as expected.
Have you been able to reproduce this on any other Espressif boards? I also tried a Metro ESP32-S2, and could not reproduce.
CircuitPython version
8.2.0-beta.1-12-g0da62416a-dirty
Code/REPL
N/A
Behavior
per @ladyada:
i don't think anyone tried uploading a file that is 'too large' - the board hardfaults
Description
No response
Additional information
No response
For reference the 320 limitation can be changed but is a compile time setting.
I did try increasing this to 480 but then when various 480x320 gifs I got exceptions that i ran out of RAM when it tried to create a large buffer. So 320 appears to be the sweet spot, as chosen. On a board with much more RAM, such as an Espressif chip with large PSRAM, larger would be better, hence #8103.
Reads and looks fine to me and matches the issue.
8.2.0-beta.1-12-g0da62416a-dirty is the same as #8100, so tip of main at the moment.
CircuitPython version
8.2.0-beta.1-12-g0da62416a-dirty
Code/REPL
N/A
Behavior
Per @ladyada:
i did pick a shorter file - but the upload progress bar never advances?
also would be good to have the onboard neopixel blink just like it does when we upload files via usb (the file does upload tho!)
doc improvement) - addressing or deferral of https://github.com/adafruit/circuitpython/issues/8068 (Odroid Go
import wifi)
I wasn't able to repro the odroid problem
close and offer to re-open with more info?
are there multiple versions?
certainly won't hold up 8.2.0
I'll start the release build
ah, found one more PR to approve.
@tulip sleet just closed it
Reverts adafruit/circuitpython#8094.
@furbrain: I merged #8094 but have reverted if after considering that it's going to cause a minimum 13 us delay on any I2C transaction. That is quite significant, considering that 100 kHz is 10 us.
Well, maybe not incredibly significant, since that's bit time, not transaction rate, but still would like to rethink this now a bit.
@furbrain Sorry for the on-again off-again approval/revert of your #8094 PR. I realized this is another manifestation of an old issue, #2253. Rather than look for good initial conditions (which might change out from under us), I think adding a timeout, as suggested in #2253, would be a better solution, since a bad I2C device can hang the bus while a transaction is in progress.
Automated website update for release 8.2.0-rc.0 by Blinka.
New boards:
- adafruit_matrixportal_s3
- smartbeedesigns_bee_data_logger
- unexpectedmaker_nanos3
Yes, I think that could work, but would need to change to a callback related method. I disagree with the comment about the timeout not getting called in #2253 - could have the callback set a flag and then poll for this flag while checking the time and abort if the time increases by a certain amount before the flag is set.
I'd be happy to look at this, though I have found a different route around this problem in my use case in any event.
My main issue in doing this would be working out a good way to test that I haven't broken any I2C functionality.
@furbrain Moving discussion from #8093 here:
My idea above was to modify nrfx/drivers/src/nrfx_twim.c to include a timeout in the synchronous transaction busy-wait loops like you see in the original post. I never got around to this, but it's not such a big deal: we already have our own patches in our fork of that library. I could put this on the list for 9.0.0. I would also check whether Nordic has already done something about this, because I think there were other people with the same i...
Ah ok, I was going to try and avoid modifying the nrfx library as it was
third party.
On Fri, 23 Jun 2023 at 20:26, Dan Halbert @.***> wrote:
@furbrain https://github.com/furbrain Moving discussion from #8093
https://github.com/adafruit/circuitpython/issues/8093 here:My idea above was to modify nrfx/drivers/src/nrfx_twim.c to include a
timeout in the synchronous transaction busy-wait loops like you see in the
original post. I never got around to this, but it...
Dan, 8.2.0-rc.0 works great, but still having the error at the end of the uf2 transfer.
Win11, boot-volume disappears - CIRCUITPY appears, Win11 throws up error msg, CIRCUITPY functions correctly.
This is normal. Windows thinks it has more to transfer but the bootloader knows it got everything it needs.
Hmm, and how do you differentiate between this behavior and a real transfer error?
I noticed a failed action run this morning on the task that generates images of learn guide repo projects: https://github.com/FoamyGuy/Adafruit_Learning_System_Guides/actions/runs/5363751471/jobs/9731528043 looking further into that it appears that the bundle metadata that ordinarily would exist here: https://adafruit-circuit-python.s3.amazonaws.com/bundles/adafruit/adafruit-circuitpython-bundle-20230624.json doesn't for some reason. Instead we get an XML error which the json parser does not like.
Perhaps the root cause of those was this one failing: https://github.com/adafruit/Adafruit_CircuitPython_Bundle/actions/runs/5362692157
oh it's missing most assets too https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/tag/20230624
