#circuitpython-dev
1 messages Β· Page 30 of 1
Cool I had never looked at the perf bench before. Thanks
I hadn't much either
someone understands what's happening here ? It looks like the library is trying to override property accessors in a subclass, and it doesn't work that way:
https://forums.adafruit.com/viewtopic.php?t=199790
this library:
https://github.com/adafruit/Adafruit_CircuitPython_EMC2101
test code:
class Thing:
def __init__(self, i2c):
self.i2c_device = i2c
@property
def i2c(self):
print(self)
return self.i2c_device
class Thing_sub(Thing):
def __init__(self, i2c):
super().__init__(i2c)
@property
def i2c(self):
return super().i2c
c = Thing_sub("I2C")
print(c.i2c)
code.py output:
<super: <class 'Thing_sub'>, <Thing_sub object at 0x3fd8c9a0>>
Traceback (most recent call last):
File "code.py", line 17, in <module>
File "code.py", line 14, in i2c
File "code.py", line 7, in i2c
AttributeError: 'super' object has no attribute 'i2c_device'
@jaunty juniper probably super objects just don't work that way in CP/MP. (in MP it erroneously results in a <property> object which also isn't right) You're welcome to file an issue about it but I doubt there's an easy and simple fix.
yeah but that's a bug in the library
then the library will need to be changed to work around the core limitation I suppose
also the super().thing notation doesn't work with normal properties ???
class Thing:
def __init__(self, i2c):
self.i2c_device = i2c
class Thing_sub(Thing):
def __init__(self, i2c):
super().__init__(i2c)
def test(self):
print(self.i2c_device)
print(super().i2c_device)
c = Thing_sub("I2C")
c.test()
I2C
Traceback (most recent call last):
File "/Volumes/FUNHOUSE/code.py", line 13, in <module>
c.test()
File "/Volumes/FUNHOUSE/code.py", line 10, in test
print(super().i2c_device)
^^^^^^^^^^^^^^^^^^
AttributeError: 'super' object has no attribute 'i2c_device'
that's python 3.11
so... it's an accident that it works with @property in C python or what ?
anyway I'll open an issue in the library
so the fix in EMC2101 is to just use self.i2c_device in the subclass, rather than super().i2c?
hey my internet is back !
there is stuff like that:
@property
def fan_speed(self):
"""The current speed in Revolutions per Minute (RPM).
:return: float speed in RPM.
"""
self._check_status()
return super().fan_speed
which is the same case as my test
also I'm not sure that I understand the actual error with EMC2101
the error is when i2c_struct tries to get obj.i2c_device, and somehow obj is super() ? That might be a wrongly reported error, caused by the complex weave that adafruit_register weaves
However, I was hoping that
w.feed()would still work throughout the script even when it is de-inited.
Changed the implementation so it silently does nothing if the watchdog isn't active.
How would I go about including the FreeRTOS and task headers from ports/espressif/esp-idf/components/freertos/include/freertos/ correctly with #include so they work flawlessly with VSCode intelli-sense?
It seems there are multiple FreeRTOS.h and task.h files in the project structure so only specifying the file name results in a confused VSCode while using the entire path also seems to confuse VSCode (types like TaskHandle_t are simply not recognised at all while they should be) and basically makes it unable to compile.
I am currently developing a module for usage with circuit python for use on an esp32s2 / feather s2 that has to use these headers since it does some stuff with FreeRTOS tasks and such.
Scott, I have 2 iMXβs if you need someone to run simple beta tests of builds I can do that. I donβt have access to a debugger though. Can offer to be a simple helper if needed.
https://github.com/adafruit/circuitpython/issues/7706
I hope, thats right how I make a pull request. Thats my first...
CircuitPython version
Adafruit CircuitPython 8.0.4 on 2023-03-15; Adafruit Feather RP2040 with rp2040
Code/REPL
import sdcardio
import storage
import board
spi = board.SPI()
cs = board.D10
sdcard = sdcardio.SDCard(spi, cs)
vfs = storage.VfsFat(sdcard)
vfs.mkfs()
Behavior
vfs.mkfs() throws TypeError: function takes 1 positional arguments but 0 were given.
Description
I want to be able to format my sd-card, but maybe I misunderst...
hopefully this is the correct place - does someone know why canio is available on the QT Py ESP32-C3 but not on the Seed Xiao ESP32-C3?
it is though, where do you see it's not ?
having looked at my clipboard - it would appear "fat finger syndrome" was involved
you are right - it is shown on the canio page
please ignore me (for this once, not every time) π
The documentation is wrong for mkfs(), sorry, and we'll fix. Since there may be no filesystem on the SD card, the mkfs() does not operate on a VfsFat object, but is a static method in VfsFat. To create a new filesystem on an SD card:
import sdcardio
import storage
import board
spi = board.SPI()
cs = board.D10
sdcard = sdcardio.SDCard(spi, cs)
# Create a FAT filesystem on the sdcard device.
storage.VfsFat.mkfs(sdcard)
# Now that the filesystem is created, you can ac...
Hi Dan!
I've tried your code on the rp2040.
the line storage.VfsFat.mkfs(sdcard)
throws: OSError: [Errno 22] Invalid argument
Is that vfs_fat.c in extmod?
Is that vfs_fat.c in extmod?
Yes, it is.
Here is my actual transcript on the PyPortal (removing some typing errors). I will try it on an RP2040 later. Which board and SD breakout (if any) are you using?
>>> import sdcardio,storage,board
>>> spi = board.SPI()
>>> sdcard = sdcardio.SDCard(spi,board.SD_CS)
>>> storage.VfsFat.mkfs(sdcard)
>>> import os
>>> vfs = storage.VfsFat(sdcard)
>>> storage.mount(vfs, "/foo")
>>> os.listdir()
['foo', '.fseventsd', '.metadata_never_in...
Not exactly CircuitPython related, but seems like the relevant audience - but I started converting one of my CPython libraries to a C extension, and boy is it fun (when it works). Is this what core work feels like? π
I think core work is mostly tracking down obscure off by one errors
There are only two problems in CS - cache invalidation, naming things, and off by one errors.
This should be all ready to go. I've tested a lot and made a few small changes along the way to fix any issues I've found, so it's more robust than what is currently in place.
CircuitPython version
Any
Code/REPL
>>> int("1e+11")
Behavior
Traceback (most recent call last):
File "", line 1, in
ValueError: invalid syntax for integer with base 10
Description
Scientific notations seem to work, but cannot be made from str.
Additional information
>>> a = '1e+12'
>>> exec("b = int(" + a + ")")
>>> b
999999930368
works however.
Well, not even desktop python does support it. Nevermind.
I am doing the cptoml module now, it's almost done.
Reading is 100% done, supporting ", ', comments, octal, hex, scientific notations, bool, int (with +/- support).
I have done about 70% of writting new keys.
It's amazing how many edge cases there are.
I don't want to implement dates.. It's such a paaaiiiin.
It's the only thing left to do for reading though.
It's almost 200 lines of code now huh. And I am optimising it as much as possible..
It will be an all-in-one for settings.toml though.
It also applies basic formatting.
Well, since it's an optimisation bug it will be pretty soon fixed. No need for this to go through.
It is a feather rp2040
an adalogger featherwing and an oled wing
Thanks for the offer. This optimization stuff is on the imx evk. Definitely use the imx port when prototyping though. Iβm sure there are still general issues
I donβt think any of us core devs use vscode so we wonβt know how to get it setup well
I don't think that's intended.
Thanks for the note! I saw this too and should fix it before un-drafting this PR.
Is this bitmap referenced by anything else? TileGrid maybe? Otherwise you could do an explicitly free here.
Is this bitmap referenced by anything else? TileGrid maybe? Otherwise you could do an explicitly free here.
It's available as .bitmap, right?, so someone else could have a reference to it.
hmmmm I have an ESP32-S3 boards with builtin I2C oled here, but there doesn't seem to be on-board pull ups π
also the code seems to halt when running board_init trying to setup the display, dunno if it's related, it seems to boot fine without it
Could you check your code again? Here is what I tried from the REPL, with a Feather RP2040 and an AdaLogger FeatherWing:
>>> import sdcardio,storage,board,os
>>> spi = board.SPI()
>>> sdcard = sdcardio.SDCard(spi,board.D10)
>>> storage.VfsFat.mkfs(sdcard)
>>> vfs = storage.VfsFat(sdcard)
>>> storage.mount(vfs, "/foo")
>>> os.listdir("/foo")
[]
I tried this with 8.0.4 and 8.1.0-beta.0, and it worked for both.
CircuitPython version
Adafruit CircuitPython 8.1.0-beta.0 on 2023-03-01; Pimoroni Badger 2040 with rp2040
Code/REPL
na
Behavior
see below
Description
PR https://github.com/adafruit/circuitpython/commit/931c7c1c51fe3b2affa765d94c7178ae3d1be80c (ACEP) changed the interface to the EPaperDisplay class replacing the (single byte) refresh_display_command with a refresh_sequence. Since this PR the Badger2040 flashes during refreshes but the screen...
Fixed this by setting grayscale to True in the constructor. But this seems to be more a workaround than a fix, because the display is monochrome and not a grayscale display. So the switch to a refresh-sequence does not seem to be the root cause after all.
No sorry, got the same error. With 8.1.0 too. Now without the oled featherwing.
paste mode; Ctrl-C to cancel, Ctrl-D to finish
=== import sdcardio,storage,board,os
=== spi = board.SPI()
=== sdcard = sdcardio.SDCard(spi,board.D10)
=== storage.VfsFat.mkfs(sdcard)
=== vfs = storage.VfsFat(sdcard)
=== storage.mount(vfs, "/foo")
=== os.listdir("/foo")
Traceback (most recent call last):
File "<stdin>", line 4, in <module>
OSError: [Errno 22] Invalid argument
I can re...
What is the brand and capacity of the SD card? I am using a 512MB card.
It is Samsung Evo+ 32GB, thats what I had laying around. But I can try 4GB (other brand) in a few days.
I also could try this tomorrow with a new set of boards. Maybe the devil is in the details.
I think it is whether it can create the right kind of FAT. It is too big for regular FAT32.
If you format this card on a host computer, and then just use it, does it work OK?
I tested with 4GB, 8GB, and 16GB cards. Only the 4GB can be formatted by mkfs(). I think this is a limitation of the formatting code. However, these cards can be read if externally formatted. You don't have to format them in CircuitPython.
@jaunty juniper I am fixing up adafruit_hid in a few ways. I'm thinking of adding a longer timeout to the Keyboard() etc constructors, and making the timeout optionally specifiable in the constructor. I think you helped people with this: on some host computers (maybe especially after host sleep?), it may take a while to re-enumerate. Also I can use supervisor.usb_connected to check -- it didn't exist when this library was first written.
Do you have some advice you give people ("insert a time.sleep(2)" or whatever)?
something like that to handle PC reboots and sleeps:
#help-with-circuitpython message
I should write that down somewhere
maybe it should be an example in the library, and it should be in a guide as well
I would think a default timeout waiting for USB would be nice, and I was wondering if we wanted to make the library itself resilient to USB going away, like print() is to the absence of a CDC connection, but I don't know if ignoring the errors is enough
i think there are use cases where ignoring errors is good, and others where the code wants to know
the trouble is that the host and CircuitPython might get out of sync (e.g. caps lock) if there's a temporary disconnection
or the code just wants to flag "hey, your keystrokes are not getting through"
the reboot/sleep issue isn't helped that much by a timeout, because it could be an indefinite period of time. But we have seen cases where it doesn't come back properly. I have a Trinket M0 HID volume control I have to reset sometimes after sleep
yeah if we ignore the errors we need to return a failure flag, which might not be better
we should also document the exceptions that can be raised
If you format this card on a host computer, and then just use it, does it work OK?
Yes it does.
I tested with 4GB, 8GB, and 16GB cards. Only the 4GB can be formatted by
mkfs(). I think this is a limitation of the formatting code. However, these cards can be read if externally formatted. You don't have to format them in CircuitPython.
Sure, but I want to build a little datalogger device where I can delete all contents of the SD card if I need to. To use mkfs was the first idea.
...
Minor Updates to the Fig Pi board definitions.
@tulip sleet with a (ESP32S3) board that has a builtin oled on I2C but no pull ups, can we hack something to support it in board.c with internal pull ups ?
Maybe it is FR_INVALID_PARAMETER as the enum FRESULT[19]. But I don't know what oserror means with errno 22.
I'm going to check oserror and trying to understand what f_mkfs does.
Minor changes to the Fig Pi board definition.
Yes, you can do a build with CIRCUITPY_I2C_ALLOW_INTERNAL_PULL_UP = 1
nice, I'll try that
Fix issue in gifio example code where next_delay is referenced before it is defined.
This library made displaying a gif on my macropad a walk in the park. Thanks for adding it. :smile:
Looks good to me. Thank you for the example fix @ckartchner!
I only did a handful of trials and there is some variance from run to run, but it seems comparable to me.
I used this test code to measure
import displayio
import board
import bitmaptools
import time
display = board.DISPLAY
bg_bmp = displayio.Bitmap(display.width, display.height, 4)
bg_palette = displayio.Palette(4)
bg_palette[0] = 0xffffff
bg_palette[1] = 0x0000ff
bg_palette[2] = 0x00ff00
bg_palette[3] = 0xff0000
bg_tilegrid = displayio.TileGrid(bitmap=bg_bmp, pixel_s...
Does anyone know of a good link that describes how to bring up SD Card support for mkrzero running circuitpython?
CircuitPython version
8.0.4
Code/REPL
import storage
# η¦η¨ USB MSC
storage.disable_usb_drive()
Behavior
The drive is gone.
Description
After I burned the firmware for Raspberry Pi Pico using uf2 for version circuitpython8.0.4, I created boot.py and disabled the drive with storage.disable_usb_drive(). Now I want to redisplay the drive, After I tried to re-install circuitpython by pressing the BOOTSEL button on the motherboard, I found tha...
The filesystem persists on a firmware re-flash. You can re-write boot.py or erase fs using storage.erase_filesystem() from repl.
After I re-copy flash_nuke.uf2, the reset is successful, thank you
LGTM! Thanks, @bwshockley.
My log:
It is FR_INVALID_PARAMETER. I've replaced the 3 occurences of this number with 3 different numbers (1,2,3).
The error occurs here:
if (!(opt & FM_FAT)) LEAVE_MKFS(FR_INVALID_PARAMETER); /* no-FAT? */ (lib/oofatfs/ff.c)
FF_MKFS_FAT32 is 0. Which causes this "bug"
How I get it working:
#ifdef MICROPY_FF_MKFS_FAT32
#define FF_MKFS_FAT32 MICROPY_FF_MKFS_FAT32
#else
-#define FF_MKFS_FAT32 0
+#define FF_MKFS_FAT32 1
#endif
/* This option swi...
Neradoc. let me know if I can contact you by DM. Thanks π
We (I) disabled this across the board to save firmware size for small SAMD boards. Re-enable it everywhere where we have "full build"s.
Closes: #7732
I've entered a PR which should re-enable mkfs for >4GB filesystem on most builds, including ones for rp2040. (Some very resource constrained boards, mostly samd21, would still lack support for this) -- See #7739. Once there are build artifacts, your feedback from testing with them would be helpful.
@onyx hinge I added a commit to your PR to document that mkfs() is a staticmethod.
that was the original "bug" from the issue
This is not fitting on M0 Express boards. Maybe we should just turn it off for all SAMD21 boards, and document it.
The FR_INVALID_PARAMETER error is not very helpful. There is also FR_MKFS_ABORTED, though that's not all that informative either.
@onyx hinge I will try to finish #7739 off unless you want to.
@tulip sleet that would be kind, thank you. I don't have a lot more working time today.
The HTML part of the build is working and is available on RTD, so the PDF failure is not causing the whole build to fail.
well setting CIRCUITPY_I2C_ALLOW_INTERNAL_PULL_UP = 1 didn't work, it still complains about "no pullups", I wonder if there is a setting on ESP32S3 to change the strength of the internal pull up. It came with an Arduino/u8g2 demo, maybe I could look at how Arduino does its thing
you can turn off the check for pullups, and then ALLOW_INTERNAL_PULL)UP will set the pullups
i am trying to remember why allow_internal_pullup was added. let me look
I tried that too, so far I was not able to scan or find the display (scanning takes an eternity)
I vaguely remember somebody needing/wanting it for their NRF board ?
yeah I'll just give up on this board for now, too bad the other two have pullups and it works nicely with board.DISPLAY
I think the "ALLOW" was for a different reason
You could try replaceing this:
#if CIRCUITPY_REQUIRE_I2C_PULLUPS
// Test that the pins are in a high state. (Hopefully indicating they are pulled up.)
gpio_set_direction(sda->number, GPIO_MODE_DEF_INPUT);
gpio_set_direction(scl->number, GPIO_MODE_DEF_INPUT);
gpio_pullup_dis(sda->number);
gpio_pullup_dis(scl->number);
gpio_pulldown_en(sda->number);
gpio_pulldown_en(scl->number);
common_hal_mcu_delay_us(10);
gpio_pulldown_dis(sda->number);
gpio_pulldown_dis(scl->number);
#if CIRCUITPY_I2C_ALLOW_INTERNAL_PULL_UP
gpio_pullup_en(sda->number);
gpio_pullup_en(scl->number);
#endif
// We must pull up within 3us to achieve 400khz.
common_hal_mcu_delay_us((1200000 + frequency - 1) / frequency);
if (gpio_get_level(sda->number) == 0 || gpio_get_level(scl->number) == 0) {
reset_pin_number(sda->number);
reset_pin_number(scl->number);
mp_raise_RuntimeError(translate("No pull up found on SDA or SCL; check your wiring"));
}
#endif
with just:
gpio_pullup_en(sda->number);
gpio_pullup_en(scl->number);
as a test
right, I'll try looking into common hal busio something see what happens if I force the pull ups there, but that's for another day, I'll finish the PRs for the ones that work
like, these don't seem to be actually used
.sda_pullup_en = GPIO_PULLUP_ENABLE,
.scl_pullup_en = GPIO_PULLUP_ENABLE,
we have avoided providing for internal pullups for I2C in general, because the internal pullups are usually out of spec for the required pullup current. For instance, on RP2040 the internal pullups are 60k-80k ohms, which is way out of spec. on nRF they are about 15k, which is still out of spec.
looks like the ESP32ish pullups are like 30k-80k?
in the datsheet they are even called "WPU" (weak pull up)
Hello! I've been exploring the espulp module with a project to read some analog sensors using the ULP and I believe I've hit a wall. As far as I'm able to tell, the ADCs have to be initialized from the main processor before they can be used by the ULP.
RISC-V:
ulp_riscv_adc_cfg_t cfg = {
.channel = EXAMPLE_ADC_CHANNEL,
...
The block device arguments for VfsFat are currently declared as str, which is completely wrong. We should define an abstract class for these in circuitpython_typing. Signatures are as described https://docs.micropython.org/en/latest/library/os.html#os.AbstractBlockDev, though I think the "extended" signatures may not be used by us.
Another bug is that the signature for mkfs() is mkfs(self), which is wrong: it should be a block device.
CircuitPython version
Adafruit Circuitpython 8.1.8 on 2023-03-17; Adafruit Metro ESP32S2 with ESP32S2
Code/REPL
# SPDX-FileCopyrightText: 2017 Limor Fried for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import time
import adafruit_sdcard
import board
import busio
import digitalio
import adafruit_dht
import microcontroller
import storage
import adafruit_pcf8523
# Use any pin that is not taken by SPI
SD_CS = board.IO9
# Initial the ...
Additional information: Adafruit RTC PCF8523 on I2C port of Arduino Ethernet Shield v2
It's finally done
Deletes tables autogically when empty. Applies formatting and can fetch, put, delete.
It's basically an aio for toml.
I have optimised it as much as possible.
I went nuclear with it as I want it to be called very often.
I perhaps shouldn't be talking about it in this channel..
Whatβs wrong with this channel?
Seems relevant?
It's for coredev? I should prolly have used #show-and-tell
Ah, maybe π€·ββοΈ
But I basically live here, so I uncontiously sent it here.
No worries. This is a perfect place for it. π
Hai Kattni π
Hello π
Glad youβre back π
ADC calibration is baked into all but the oldest chips and the same for all channels. It should be possible to configure different channels / pins.
Thanks!
@slender iron can I do a request on pid.codes for using Circuitpython for a RP2040 board that is not open source ? (I asked on the maker's discord, if they would request one from RPF)
ya, closed source is ok as long as its not your closed source design
ok, thanks π
@slender iron What milestone would you file a documentation issue under? It's not an error, it's that a code snippet should be added showing how to use the feature in your code.py file.
Trying to get the labels and milestones on it while filing it to make less work for you folks.
Long-term I'm guessing, but it's a core dev designed system, so I figured it was worth asking.
If you think it's worth updating the doc soon, put it under 8.x.x. I've been putting most new issues under 8.x.x. We can triage them later.
Ah ok.
I'll do that. I do think it's worth updating. Good first issue label is on it too.
The documentation for alarm.time() should include an example that shows what it looks like in use in code.py. I struggled to figure out how to format it, and ultimately asked for help. I believe this would eliminate potential confusion for others moving forward.
The following explanation and example should be fine to include in the alarm.time() documentation.
This code block sets a delay, creates a TimeAlarm to wake up the board after delay seconds have passed, and then deep...
yes, I might be long to answer, depending on the circumstances
Two QTPY-sized boards with tiny screens with oleds (despite having LCD in the name).
The RP2040 0.42 LCD:
https://github.com/01Space/RP2040-0.42LCD
Requested the PID from pid.codes
The ESP32-C3 0.42 LCD:
https://github.com/01Space/ESP32-C3-0.42LCD
Creator/tion ID requested
The S3 version has no pull-ups on the on-board OLED, I'll see if I can do something with `ALLOW_INTE...
Reproduced on a PCA10100 eval board (nrf52833), using SoftDevice 7.2.0, installed by the latest Adafruit_nRF52_Bootloader.
The first SPI assigned is probably SPIM3. By not using the first SPI assigned, I worked around the problem. This code does not hang:
import busio, board, digitalio, time
from adafruit_bus_device.spi_device import SPIDevice
buf = bytes([0x90,0x00,0x00,0x00])
cs = digitalio.DigitalInOut(board.D3)
# comm_portx will get SPIM3
comm_portx = busio.SPI(board.D...
it is possible to avoid assigning SPIM3 at all: change nrfx_config.h to not use it:
-- a/ports/nrf/nrfx_config.h
+++ b/ports/nrf/nrfx_config.h
@@ -44,7 +44,7 @@
#ifndef NRFX_SPIM3_ENABLED
#if defined(NRF52840_XXAA) || defined(NRF52833_XXAA)
#define NRFX_SPIM_EXTENDED_ENABLED 1
- #define NRFX_SPIM3_ENABLED 1
+ #define NRFX_SPIM3_ENABLED 0
#elif CIRCUITPY_NRF_NUM_I2C == 2
#define NRFX_SPIM3_ENABLED 0
#endif
There should be a cleaner way to do this in...
welp, my amazing perf numbers were a lie
that's frustrating
yup
I learned a lot....
perf benchmarks that time themselves aren't a great idea π
Was that with that spall tool?
cool! I've read up on machine code in mpy last night and I think that's probably the by far easier first step compared to going full native internal. Did poke around the build system and was equal parts intimiated + impressed, heh
no, the mp perf bench times itself
and I had messed with what time we return π€¦
say, there are some commits in 8.0.x that have not been backported to main yet
(like the web workflow stability fix)
This is initial support for the Lilygo T-Watch 2020 V3.
There are multiple "t-watch" products with quite different setups and on-board devices, but I only have one !
http://www.lilygo.cn/prod_view.aspx?TypeId=50053&Id=1380&FId=t3:50053:3
It's not super obvious to use at first because the display's backlight is handled by the APX202, which is an I2C Power System Management chip. The side button is also a power button (turns on if pressed 2 seconds, turns off if pressed 6 seconds) and ha...
resolves #7637
Response sizes are in bytes.
Example of response:
{"free": 212992, "block_size": 512, "total": 963072}
Maybe we don't really need block_size in the results? I can remove it if not. I added it initially in order to test how it's looked up, which is needed to find the correct multiplier to get to bytes units.
Tested successfully with Feather ESP32-S2 TFT.
Thank you to: isacben, Neradoc, and anecdata who all helped me in getting this far on implementin...
CircuitPython version
Adafruit CircuitPython 8.1.0-beta.0-33-g9c1d83476 on 2023-03-17; Adafruit Grand Central M4 Express with samd51p20
Code/REPL
import board
import pwmio
a = pwmio.PWMOut(board.D8)
a.deinit()
a = pwmio.PWMOut(board.D8)
a.deinit()
a = pwmio.PWMOut(board.D7,variable_frequency=True)
a.deinit()
a = pwmio.PWMOut(board.D8)
Behavior
>>> import board
>>> import pwmio
>>> a = pwmio.PWMOut(board.D8)
>>> a.deinit()
>...
Two unrelated fixes:
- Rewrite
allocate_pystacklogic:- Saves space, fixes translation string, allow pystack to be set only when
SAFE_MODE_NONEand remove upper size limit.
- Saves space, fixes translation string, allow pystack to be set only when
- Increase auto-reload delay:
- This has been an issue since a long time, closes #3502
- On my
microS2, I logged the time between subsequent calls toautoreload_trigger, most calls are<100msbut the 3rd last call has a difference of~950ms. I suspect this to be something to do with the large fs.
CircuitPython version
CircuitPython 8.0.4
Code/REPL
Not applicable
Behavior
When installing CircuitPython 8.0.4 on a LOLIN S2 Mini board the installer does not adavance.
Description
Debugging the code in the browser terminal the bin file URL with the firmware has a double slash "//" so a 404 error is return and never goes on.
Additional information
I formatted the
CIRCUITPYdrive with windows formatting utility and it fixed double auto-reload.
This issue still exists and the above fix still applies. I used a windows machine to format the drive.
I logged the time between subsequent calls to autoreload_trigger, most calls are within 100ms but the third last call differs by:
- Just
Ctrl+Swith the file open and no changes: ~940ms - Adding new data in the file and then saving: ~1080ms
- Removing everything in the file and t...
Is this bitmap referenced by anything else? TileGrid maybe? Otherwise you could do an explicitly free here.
TileGrid calls _get_pixel so it has no direct access to bitmap's data element. Added in the explicit free.
It's available as .bitmap, right?, so someone else could have a reference to it.
This is only to the Bitmap object in OnDiskGif. For Bitmap the data element is not accessed by any other object. (I searching through all shared-module for data and checked).
...
This PR add codespell to pre-commit to check for typo with following config file
- .codespellrc, .codespell/ignore-words.txt & exclude-file.txt
The rest is lots of typos detected and corrected by codespell. I did manual check/review on each file to make sure it does not affect actual code. There is still more but leaving this on purpose to see when ci-failed https://github.com/hathach/circuitpython/actions/runs/4456023057/jobs/7826197620
...
exclude local since it not English, and lib since it is mostly 3rd party code.
CircuitPython version
Adafruit CircuitPython 8.0.3 on 2023-02-23; Adafruit Feather ESP32S3 4MB Flash 2MB PSRAM with ESP32S3
Code/REPL
import time
import rtc
nowtime = time.struct_time((2023, 3, 18, 13, 47, 28, 5, 77, 1))
rtc.RTC().datetime = nowtime
now = time.localtime()
print("Time sent to RTC:", nowtime)
print("Time from RTC:", now)
nowtime = time.struct_time((2023, 3, 18, 13, 47, 28, 5, 77, 0))
rtc.RTC().datetime = nowtime
now = time.localt...
I guess anyone who is looking for more juice out of an RP2040 running CircuitPython ends up here...
Possible usecase (and perhaps builds upon AdaRoseCannon's comment) - A keyboard with the main core running KMK (keyboard firmware managing the matrix scan and HID services) and displayio animation/management running on the second core to produce fancy procedurally generat...
Would you have the matching BIN file? I don't know how to boot the LILIN S2 Pico into UF2 mode.
Double click does not mork.
Click reset button
Wait until LED is lit
Hold BOOT button
I spent ages playing around and then found the instruction on the CP download page. Doh!
That works on the S2 Mini so might work on the S2 Pico
Let's add `deque here.
deque
extint
Can you run this again locally to remove the lib/ entries that are in changed files?
oh I'll get you the bin too https://www.neradoc.me/builds/lolin_s2_pico-8.1.0-beta.0-23-gbca7d6e99-add-display-lolin-pico-dirty.bin
Thanks.
The good news is that it boot and does not complain about I2C. But the bottom of the screen is random and the top is bizarre.
I would say there is one line out of two, that is why you can guess Wi-Fi but do not see the "-" that is eaten.
Do you have a branch with the code for this, I could have a look and try to compile CP myself.
Let me at least share some python code that work with stock CP.
import busio
import time
import displayio
import adafruit_displayio_ssd1306
displayio.release_displays()
i2c = board.I2C() # uses board.SCL and board.SDA
oled_reset=board.LCD_RST
display_bus = displayio.I2CDisplay(i2c, device_address=0x3C, reset=oled_reset)
display = adafruit_displayio_ssd1306.SSD1306(display_bus, width=128, height=32)```
I hope no one is hurted that I keep the label on the screen... LadyAda style!
Thanks, but so far I had zero success.
It might be some timing issue, but I tried so many time that it should have at least worked once.
I know this info might not belong to circuitpython.org, but the download page is maybe the only place where tips and ticks about non-Adafruit board can be shared. And the update procedure is the one I struggle most of the time.
@jaunty juniper here is your code but without using board.DISPLAY and it does 8x2 "square" pattern.
CircuitPython version
Adafruit CircuitPython 8.0.4 on 2023-03-15; Adafruit Feather ESP32-S2 TFT with ESP32S2
Board ID:adafruit_feather_esp32s2_tft
UID:487F305F7D21
Code/REPL
print(next(iter("test"), None))
# Expected: "t"
print(next(iter("test")))
# Expected: "t"
print(next(iter(""), None))
# Expected: None
print(next(iter("")))
# Expected: StopIteration
Behavior
The behaviour of CP's next() is not the same as Python's, the `next...
Explicitly calling gc_free on data is making the build over size on the few M0 boards that include displayio.
Ideas (in my general order of best idea best to worst):
- Revert back to having the GC free data and my code setting the data pointer to NULL. This original change fit and still fixes the original issue.
#ifdef SAMD21(or similar) around the new code. I'm not sure if using port specific#ifdefin the commonshared-moduleis a good idea.- Try to find something else ...
ok, had to decipher how to change the init sequence based on that https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1306/blob/11a9b9e4a28e60bc23c61ab3451f723c132184db/adafruit_displayio_ssd1306.py#L79-L89
maybe this build will work
https://github.com/Neradoc/circuitpython/tree/add-display-lolin-pico
Don't tell me about that piece of code... I was the last one to change it to support the 64x32 tiny oled I got from LILIGO. I am still unsure if it can be written better, and if it should be tested for "rotation" because I did not...
It works as expected.
That is perfect now. π π₯³
ok I'll PR it then
Maybe we can discuss how the text "wrap" on the prompt line, or how the prompt line does not blank the text that was there before.
But this is I believe a general issue, just exacerbated by the tiny screen.
On the serial I have ```Code done running.
Press any key to enter the REPL. Use CTRL-D to reload.
]0;Wi-Fi: off | REPL | 8.1.0-beta.0-24-gf532318d6-dirty
Adafruit CircuitPython 8.1.0-beta.0-24-gf532318d6-dirty on 2023-03-19; S2Pico with ESP32S2-S2FN4R2
The line on screen display >>> S2-S2FN4R2 with E and that is SP32S2-S2FN4R2 with E so the text with ESP32S2-S2FN4R2 wrapped where the 4 first character are overwritten by the REPL >>> .
If I that point I type spaces I can delete the offending S2-S2FN4R2 with E and get a clear prompt.
@thorny jay do you want to use https://docs.circuitpython.org/en/latest/shared-bindings/supervisor/index.html#supervisor.StatusBar
(also, I print with line endings at the start of lines on small displays so there is no blank line at the bottom wasting space)
When installing another board, the process stops at the same place but in this case the error is a malformed URL.
The URL has a double slash after bin. When the second slash is removed the file downloads successfully. This installer was working flawlessly a couple of days ago.
Connecting...
base_installer.min.js:12 Connected successfully.
base_installer.min.js:12 Try hard reset.
base_installer.min.js:12 Chip type ESP32
base_installer.min.js:12 Connected to ESP32
base_installer...
Does that actually works? I have a white line with the Blinka logo, so the saved space is not used at all.
there is some weird wrapping happening there, isn't there
We only have >>> on top of H*ll.
I forced to have spaces in my print to clear the space if anything is there.
yeah I did notice that when it's a small screen it wraps on itself
would be nice if CIRCUITPY_REPL_LOGO was a boot.py thing
but I don't know what you would show in a REPL that small, the status bar shows the IP when you have one
Anyway, with such a size, seeing the REPL is not really the key function.
the API for the status bar and REPL is still rather wonky
Add builtin display support with shared board.I2C to Lolin S2 Pico.
Like the feather TFT (for SPI), the I2C bus therefore has to be used with board.I2C() unless the display is released first.
Tested and discussed on Discord.
@jaunty juniper @thorny jay I will approve the PR if you think it is good enough.
It is.
Thanks @Neradoc for working through this and thanks @dglaude for testing.
I will look at space savings. We need something more, because anything that is almost about to overflow is going to happen sooner or later. It is a question whether we should include this on the smallest boards. Hallowing M0 is the only one I'm thinking might be worthwhile.
is there any evidence that OnDiskGif is useful within the RAM constraints of the HalloWing M0?
Update on the status of support board.DISPLAY in the "Absolute Newest" version.
Working since https://github.com/adafruit/circuitpython/pull/7754
Hi,
With this PR I am trying to solve #7741 (Define abstract "block device" type for use in VfsFat and elsewhere)
Depends on:
https://github.com/adafruit/Adafruit_CircuitPython_Typing/pull/30
I opened the PR above in the CircuitPython_Typing repository to add the abstract class.
Please let me know if I have all the pieces or if I am missing something.
Thanks!
is there any evidence that OnDiskGif is useful within the RAM constraints of the HalloWing M0?
Quickly checked, with only 32Kb RAM it would not be worthwhile if you ever managed to get it to work. Maybe something added on to go straight from GIF->Display but that would be the only way I see it possible. OnDiskGif is currently turned off on all M0 builds.
The overflowing part is with the changes to displayio.Bitmap
How do I adding typing for a microcontroller.Pin?
try:
from typing import Union
import adafruit_pca9685 as pca9685
import pwmio
import microcontroller
except ImportError:
pass
...
def __init__(
self,
red_pin: Union[microcontroller.Pin, pwmio.PWMOut, pca9685.PWMChannel],
green_pin: Union[microcontroller.Pin, pwmio.PWMOut, pca9685.PWMChannel],
blue_pin: Union[microcontroller.Pin, pwmio.PWMOut, pca9685.PWMChannel],
invert_pwm: bool = False,
) -> None:
...
Works on my laptop, but fails in the Github CI tests:
937 NameError: name 'microcontroller' is not defined
938
939 Error: Process completed with exit code 2.
I'm perplexed!
@dhalbert reverted deque changes, also remove lib from exclude and fix other remaining typos. Please again double check each file changes, there is changes to micropython (py/*) and other 3rd party. Let me know if you want to revert/ignore those files.
π digitalio.DigitalInOut would do
CircuitPython version
Adafruit CircuitPython 8.1.0-beta.0 on 2023-03-01; ESP32-S3-DevKitC-1-N32R8 with ESP32S3
Board ID:espressif_esp32s3_devkitc_1_n32r8
UID:866B3B736F82
boot.py output:
Code/REPL
import microcontroller
microcontroller.on_next_reset(microcontroller.RunMode.NORMAL)
...wifi DHCP lease timeout or similar...
Behavior
always forces a reboot to SAFE_MODE, not NORMAL (or otherwise)
Description
any cause for a reset, whether p...
No, I don't think it would. The __init__() takes a microcontroller.Pin and not a digitalio.DigitalInOut instance, e.g. board.D5 or board.GP20 which are instances of the class that are also passed to digitalio.DigitalInOut
@lavish saffron Exactly what is failing? It is a step of CI? What command is running? Can you link to the full code & log?
adafruit_magtag/magtag.py is an example of a CP library that uses microcontroller.Pin in its type annotations
It's failing on the CI step that builds the Sphinx Docs after I opened a pull request on GitHub (the docs build on my local system):
917 Warning, treated as error:
918 autodoc: failed to import module 'adafruit_rgbled'; the following exception was raised:
919 Traceback (most recent call last):
920 File "/opt/hostedtoolcache/Python/3.11.2/x64/lib/python3.11/site-packages/sphinx/ext/autodoc/importer.py", line 60, in import_module
921 return importlib.import_module(modname)
922 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
923 File "/opt/hostedtoolcache/Python/3.11.2/x64/lib/python3.11/importlib/__init__.py", line 126, in import_module
924 return _bootstrap._gcd_import(name[level:], package, level)
925 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
926 File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
927 File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
928 File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
929 File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
930 File "<frozen importlib._bootstrap_external>", line 940, in exec_module
931 File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
932 File "/home/runner/work/Adafruit_CircuitPython_RGBLED/Adafruit_CircuitPython_RGBLED/adafruit_rgbled.py", line 35, in <module>
933 class RGBLED:
934 File "/home/runner/work/Adafruit_CircuitPython_RGBLED/Adafruit_CircuitPython_RGBLED/adafruit_rgbled.py", line 90, in RGBLED
935 red_pin: Union[microcontroller.Pin, pwmio.PWMOut, pca9685.PWMChannel],
936 ^^^^^^^^^^^^^^^
937 NameError: name 'microcontroller' is not defined
938
939 Error: Process completed with exit code 2.```
the link I was looking for: https://github.com/adafruit/Adafruit_CircuitPython_RGBLED/pull/23
@lavish saffron The true error is
$ python3 -c 'import pwmio'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/_env/lib/python3.9/site-packages/pwmio.py", line 50, in <module>
raise NotImplementedError("pwmio not supported for this board.")
NotImplementedError: pwmio not supported for this board.
this causes the line import microcontroller to not be run
or the true error may be: ModuleNotFoundError: No module named 'adafruit_pca9685'
you can choose to:
from __future__ import annotationsbefore anything else, even before the docstring. this means that the type annotations will not be evaluated as Python expressions at import time- change specific annotations to be strings (e.g.,
red_pin: "Union[microcontroller.Pin...]") - there may be other possibilities
- you can try setting microcontroller, pwmio, and/or adafruit_pca9685 as mocked in sphinx
- you can add adafruit_pca9685 to requirements.txt
pwmio is already mocked in sphinx config so maybe it's adafruit_pca9685 that is the problem during doc build
Thanks. I'll experiment and see which works best. I'd never have figured this out by myself. I don't think adding adafruit_pca9685 to requirements.txt is a good idea, because it's only needed for typing.
-autodoc_mock_imports = ["pwmio"]
+autodoc_mock_imports = ["adafruit_pca9685", "pwmio"]
Yeah try this
If your types are not merely annotations then it is a requirement
They're merely annotations.
try:
import doesnt_exist_ever
except ImportError: pass
x: doesnt_exist_ever.whatever
this won't work, because doesnt_exist_ever.whatever has to be a Python expression that is evaluated at import time. On standard Python.
if you have x: "doesnt_exist_ever.whatever" then it's not evaluated as an expression at import time
or if you have from __future__ import annotations
Just try the mocking of the pca9685 module and that solve the issue, and its building the docs locally
I'm talking about how its treated on desktop Python which is important since pylint and sphinx work on modules with desktop python, even if it's a module like magtag that's only ever "used" on circuitpython
I see, so from __future__ import annotations looks like the best solution.
Perfect! That fixed the issue
[Reopening as I don't think we've taken a fix into the core for this problem]
Would it be appropriate to add the modules that are only used for type checking to optional_requirements.txt instead of requirements.txt?
I don't know what optional_requirements is used for
I usually stick pytest and other testing modules in there if I'm writing unit tests. No idea apart from that. I read in PEP 563 https://peps.python.org/pep-0563/#runtime-annotation-resolution-and-type-checking that imports that are only used for type checking can be ignored at runtime so I think this may be appropriate:
try:
import typing
from typing import Union
if typing.TYPE_CHECKING:
import adafruit_pca9685 as pca9685
import pwmio
import microcontroller
except ImportError:
pass
So that the modules wouldn't need to be installed on systems that are only running the code.
Python Enhancement Proposals (PEPs)
Thanks for filing an issue. It looks like maybe there's an extra slash that may be causing the problem.
It looks like the bootloader id on the first board was incorrect because the board hadn't been updated on the site. It should be remedied shortly.
Fixes #1170. It looks like the QT Py ESP32-S3 hadn't been updated and the bootloader was incorrect. Also an extra slash in the board generation script was causing an incorrect url.
I updated the wording to be a little more clear.
I noticed this on ReadTheDocs .. does anyone know what we need to do to make 8.0.x appear here and be treated as the newest?
(old docs say " You are not reading the most recent version of this documentation. 7.3.x is the latest version available." and the version chooser in the readthedocs sidebar doesn't have an 8.0.x choice)
<@&356864093652516868> we are about 2 hours from the weekly Discord meeting! It's a great time to add your notes to the document: https://docs.google.com/document/d/1y7kZuukcZXC1eiStMaMsI_YlglAAoW_fMbaQysK_CAY/edit?usp=sharing
I look forward to catching up with y'all in the meeting over in the CircuitPython voice channel.
CircuitPython Weekly Meeting for March 20, 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 a...
It's meant for requirements that are functional but not required for primary use of the library. The best example are libraries that allow for use of PIL for some functionality or examples and are "opt in".
So you could do pip install library_name[optional] (I think that's how I have the syntax set)
I'm under the weather from a recent vaccine booster but let me check on this today
that's .. interesting. A square wave is decoded by this logic analyzer as an apparently legal CAN frame
@proven garnet feel better soon .. and no need to push yourself over this, probably
So given the above, they would go in requirements.txt because they are fully required for primary use. A litmus test I use is if they are needed outside of typing. If yes, it's worth putting them in requirements.txt because Blinka will still need them to interop with the code. If it's opt in or only used in examples, its best to put it in optional_requirements.txt and use strings as jepler mentioned.
I think this is a setting on rtd. lemme look
yup. I activated it under the versions tab
@slender iron thank you
I am getting these errors in the console trying to view the docs atm:
@proven garnet @lavish saffron The other thing about rgbled is that maybe it's circuitpython_typing's pwmio.PWMOut that you want, because what's actually important is that there's a duty_cycle property on the object. Then you don't need to refer to that adafruit_pca9685 module at all. However, it checks the object for having a frequency property which isn't in the circuitpython_typing version of the type (not sure why it doesn't check for duty_cycle)
@lone axle and as a practical consequence the module support matrix filter doesn't work https://docs.circuitpython.org/en/latest/shared-bindings/support_matrix.html
I think they removed jquery at some deep level, we'll need to switch away from it or add it back? https://github.com/sphinx-doc/sphinx/issues/10070
Yep, unable to filter. Clicking the version pop-up thing doesn't seem to work on my end either. Poking a bit further: I do not have the same problem if I build the docs locally. Looking at where it's loading loading from I'm seeing a different file. The live page uses this URL: https://docs.circuitpython.org/_/static/vendor/jquery.js and in a local build the file is in _build/html/_static/jquery.js
https://github.com/nextcloud/documentation/commit/1ac225a0a6c1e51058f69ce1a20e2436ff2a8091 some folks have pinned a specific (and non-release!) version of sphinx-rtd-theme
JQuery was removed as of Sphinx 6. The maintainers of our theme already
reacted to this but the release is not final yet.
Ref https://github.com/sphinx-doc/sphinx/issues/10070
Ref https://github.co...
Or maybe depend on sphinxcontrib-jquery? https://github.com/sphinx-contrib/jquery
I will do this -- I forgot when I released 8.0.0. It's various settings in RTD.
There appears to be Some Other Problem: the v:latest button is not sensitive as it should be.
I think it's related to the missing/changed jQuery dependency with some info mentioned and linked above here in a the chat a little.
Happily lurking today π
β οΈ EXPERIMENTAL, DO NOT MERGE β οΈ
This PR exists only to surface an experimental build of Pico W MicroPython including Bluetooth support.
It builds against: https://github.com/peterharperuk/micropyt...
We spoke with Charlyn Gonda about making things glow, dealing with imposter syndrome, and using origami. Charlynβs website is charlyn.codes , the projects we talked about are documented there. You can find her on Instagram ( @chardane ) and Mastodon ( https://leds.social/@charlyn ). Adafruit c
π
π
I'm available
All good.
π
π Thanks!
I missed you too!
Thanks!
Had never heard of distox before and was curious:
DistoX Bluetooth Protocol - mimic the DistoX protocol for communicating with paperless cave surveying tools
The QT Py ESP32-C3 also has problems. The only difference is that this installer never worked. The other two boards were installing just fine for several days. (BTW, all this JavaScript development for browser based esptool and repl tools is very exciting! Chromebooks are what students have to use in many countries.)
Failed to load resource: the server responded with a status of 404 (Not Found) stylesheet:1
base_installer.min.js:12 Connecting...
base_installer.min.js:12 Connected suc...
Thanks everyone!
Thanks
Thanks everyone for an excellent meeting!
Thanks!
Thanks everyone, have a great week!
Thanks for hosting Jeff, have a great day everyone.
thanks all!
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/1l8zP4t9RGURIoeS_foo5jcmmiRLUWkAJ8NpuB6i30cs/edit?usp=sharing
CircuitPython Weekly Meeting for March 27, 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 a...
Pick up #7679. Confusingly, there are more changes shown in this diff than are real.
PR to correct vectorshape lcoation
Testing Code
import vectorio
import displayio
import board
display = board.DISPLAY
palette = displayio.Palette(2)
palette.make_transparent(0)
palette[1] = 0xFFFFFF
reci = vectorio.Rectangle(pixel_shader=palette,width=10, height=50,x=100, y=100, color_index=1)
print(reci.location)
reci.location = (100, 5)
print(reci.location)
Before PR
Adafruit CircuitPython 8.0.4 on 2023-03-15; Adafruit PyPorta...
This will require additional testing on the C3.
The QT Py ESP32-C3 also has problems. The only difference is that this installer never worked. The other two boards were installing just fine for several days. (BTW, all this JavaScript development for browser based esptool and repl tools is very exciting! Chromebooks are what students have to use in many countries.)
I created a new issue for this in #1173
Missed the meeting today. Was really nice to hear @idle owl again. π Welcome back.
Thanks!
in the design guide we have stated that when printing we should use the " ".format() option, as some boards are not capable of using f-strings, have this changed recently?
m0 boards still can't fit f-strings
Thanks (y)
(though counter-intuitively an mpy-compiled module that uses f-strings can be used on even those boards)
oh, right, because it's just a parser hack
if we did, I missed that
yeah since 7.3.0
we tried really hard to get f-strings on for everything, because otherwise we have to write examples that don't use f-strings
oh I forgot about that. yays.
Got it, thanks.
The code considers monochrome to be grayscale (versus having color.) What driver code are you using? It should set grayscale correctly.
As discussed in Discord. Thanks.
Are you using the watchdog to reset? Have you seen safemode.py?
@dhalbert reverted deque changes, also remove lib from exclude and fix other remaining typos. Please again double check each file changes, there is changes to micropython (py/*) and other 3rd party. Let me know if you want to revert/ignore those files.
Add lib back to the exclude list. Let's do check py/. I'd rather spell-check just our code (and MicroPython's), not all this third-party code. Thanks.
Yes, variable_frequency can cause other pins to not find a timer. Timers are only shared when the base frequency is fixed.
A reload should clear any pending state. If it doesn't, then it's a bug.
Since autoreload_suspended is a bitmask, not a bool. Please do comparisons to zero. I can never remember the truthiness of ints. Doing an explicit comparison is clearer.
Looks great! Thank you.
I'd leave block size in case another filesystem is used in the future and has a different size.
Could you bump web api version from 1 to 2? That'll simplify discovery of this endpoint.
This problem seems to have gone away, e.g.: https://readthedocs.org/projects/circuitpython/builds/19833832/ did not fail.
dan or jeff want to review my performance PR?
Hi, thanks for this. I do use the watchdog but this error occurs unexpectedly at as yet unpredictable times and drops me into safe mode before the watchdog times out. Perhaps I am not understanding your query though? Β Thank you for pointing me to safemode.py I will look at whether that can help us in the meantime. Β Do you need more data from me to help diagnose?On 20 Mar 2023, at 21:37, Scott Shawcroft @.***> wrote:ο»Ώ
Are you using the watchdog to reset? Have you seen safemode.py?
βRepl...
Looks great! Thank you.
I'd leave block size in case another filesystem is used in the future and has a different size.
latest commit increases api_version to 2.
@gamblor21 I tested this on a PyPortal (SAMD51) with this test program:
import gifio
import gc
for i in range(1000):
print(i)
odg = gifio.OnDiskGif("/nyan.gif")
odg.deinit()
odg = None
gc.collect()
If any of the last three lines is commented out, then I get a MemoryError. Is this what you would expect? I'd still love to fix the original problem about not gc'ing what is on the stack, but that may not be possible.
Would it be worth writing up s...
hi! we're looking into some fixes for os.dupterm, which I know CircuitPython doesn't use, but you must have solved a similar problem for the various BLE/WiFi workflows?
(i'm spelunking right now, but still figuring out where to look exactly... in particular I'm curious how you handle things like Ctrl-C and whether this works for user streams or is specifically handled for the various workflows)
(actually i'm also not sure whether it does work like dupterm -- if you're using the wifi workflow, does stdout still get mirrored to the UART/VCP?)
speaking of... I guess this also applies to just regular UART/VCP... do you mirror stdout and support input from both between a default UART and the VCP on the tinyusb-capable ports?
@dhalbert reverted deque changes, also remove lib from exclude and fix other remaining typos. Please again double check each file changes, there is changes to micropython (py/*) and other 3rd party. Let me know if you want to revert/ignore those files.
Add
libback to the exclude list. Let's do checkpy/. I'd rather spell-check just our code (and MicroPython's), not all this third-party code. Thanks.
ok, seems like I read your previous review too quickly and totally misunder...
hi - maybe you are looking for this?? https://github.com/adafruit/circuitpython/blob/main/supervisor/shared/serial.c
we don't usually do both UART and USB CDC, but I think it does work. Also we mirror the REPLoutput onto an on-board display if present
If any of the last three lines is commented out, then I get a
MemoryError. Is this what you would expect? I'd still love to fix the original problem about not gc'ing what is on the stack, but that may not be possible.
Yes that is what I would expect with a GIF that takes most of the memory available.
odg.deinit()
This will free the displayio.Bitmap.
odg = None
This will free the OnDiskGif and the memory held by the code that processes the...
.HEX file boots fine now. fwiw, I did a simple stopwatch test on a program that takes 7 seconds to run with the latest build from circuipython.org and this artifact timed out at 5 seconds. The program does a fair amount of file i/o and may not be a typical case but it's the longest running program I normally run. The same program on a Pi Pico takes 43 seconds to run.
yes! thank you!
and to answer my own question Ctrl-C appears to be handled in each of the sources individually (much like we do)
so, just like micropython, writes to stdout are blocking across all destinations, and poll-for-writing on stdout is not implemented. So https://github.com/micropython/micropython/issues/11026 might be of interest to you.
Thanks to you and @proven garnet for all your help and advice. I've gone with putting the types in string quotes and that passes the CI. I'll have a look at duty_cycle v frequency when I get home to a Raspberry Pi, as I plan to try to solve the Raspberry Pi unrecognised pins issue.
Add Deneyap Development Board
Deneyap Kart
Deneyap Mini
Deneyap Kart 1A
Deneyap Kart G
Deneyap Mini v2
Deneyap Kart 1A v2
So, there is a circuitpython port for stm32f411 controllers, specifically the black pill board. There is another variant of this board sold with the f401 chip. Is porting circuitpython to this chip possible or for what reasons it isnβt?
I don't know, but I would start by comparing the flash and ram available on those chips.
From what I can see, the f401 has half as much ram as the f411. In my case (f401cc) it is 64 kb
that answers it
What would be the minimum ram requirement for circuitpython? I canβt seem to find it
I believe there is a micropython port for it
it varies depending on the port
yeah, micropython has looser requirements, it can have many things disabled, so it has more ports
Gemma M0 has 32MB of ram, and it is still supported
the minimum is around 64kB, but the closer you get to that minimum, the more work it takes
my understanding too is that STM chips are tricky, they have different configurations of how the RAM is split between different blocks or whatever, and other odities
you can try porting it, but it will be tricky
What a nice opportunity to get familiar with stm chips!
I had no prior experience working with stm before lol
gotta read that datasheet, I guess
I tried the usb_cdc.data on ESP32-S3 without luck:
boot.py -----------------
import usb_cdc
usb_cdc.enable(console=True, data=True) # Enable console and data
print("boot.py: usb_cdc.data", usb_cdc.data)
- boot_out.txt ----------
Adafruit CircuitPython 7.3.3 on 2022-08-29; ESP32-S3-DevKitC-1-N8R8 with ESP32S3
Board ID:espressif_esp32s3_devkitc_1_n8r8
boot.py output:
boot.py: usb_cdc.data <Serial>
Seems that the usb_cdc.data works while booting ( 'boot.py: usb_cdc.data <Seria...
In this PR:
- Add
espressifspecific modules toSRC_PATTERNS. Closes #7709. - Don't run all jobs if changed files is empty.
how can I clone a branch?
For research I cloned the adafruit repo and want to check something between 7.3.3 and main
if you have cloned the repository then all the branches are in there, you can checkout them as you want
also, there is #help-with-git
oh yes sorry
The Meowbit is an STM32F401 and we have a port for it
@rena2019 The Espressif chips donβt have enough USB endpoints to have both CDC console and data, unless you turn everything else off. See https://learn.adafruit.com/customizing-usb-devices-in-circuitpython?view=all#hardware-limitations-3096627, especially toward the end.
Oh, thanks! Then, it just goes to making a proper board definition
Making one change and re-running: I merged your addition to the circuitpython_typing library.
This is a static method, so there is no self.
//| def mkfs(block_device: BlockDevice) -> None:
Also note that we have a separate CDC for the user to use for cases like this. That way we don't need to worry about them ctrl-cing their code. π
@tulip sleet or @onyx hinge want to review my imx improvements?
@vale spire second CDC channel is described here: https://learn.adafruit.com/customizing-usb-devices-in-circuitpython/circuitpy-midi-serial#usb-serial-console-repl-and-data-3096590
@slender iron I'll dive in right now
thank you!
I'm gonna rework how we integrate the sdk this week
hal should be the same though
gonna spend a little time chasing a crash on samd21
(that perf bench triggers)
One more thing to update.
on_next_reset isn't meant to prevent resetting to safe mode. It's really meant to be used with a user initiated reset.
I don't know what the bug is here. I think your best bet is to use safemode.py to recover.
Another option would be to make OnDiskGif take in the Bitmap to load into. That way you don't need to reallocate a huge chunk of memory each loop. That'll better fragmentation-proof your code.
wow pull request review really needs some keyboard shortcuts, like "mark as viewed", "next/prev file"
have you tried vimium?
0x20007f2c
heh, what's it say about me that my clipboard contents is a memory address?
Why did you remove this bit?
Looks fine. I didn't review every function-marking in detail but assume it was based on good performance data.
we should consider supplying a weak version of this, noting that it should be marked with this macro across all ports as well.
Forgive me @tannewt for not being clear enough. Ignore the watchdog or my code in this discussion as it will only cloud things - I was just trying to reply to your query. Regardless of the code on the device, we see occasional hangs, resulting in a hard reset to safe mode. Based on reading all the open issues related to the esp32-s3 overnight, perhaps what we see is related to the known S3 wifi issues?
I have been able to use the safemode.py approach for now (although I'd be keen to k...
You mean "Guard against the rare time that ticks is 0"?
Do we want to trigger auto reload when ticks is 0? Will there even be such a case?
Yup. ticks will rollover every so often so there is a very small chance it is exactly zero.
It only really needs the macro for ports with ITCM memory. (STM maybe)
@onyx hinge was your think ink rp2040 def for the feather form factor board or something else?
@slender iron I would have said I thought it was, but based on the pins.c file it doesn't look feather-ish at all
yeah it's not, there's a different non-feather-format board that's probably been teased but is certainly not released
(not that the feather is released either)
- Update tinyusb to latest, to pick up changes and also to pick up removal of all submodules (tinyusb submodules are now fetched with a script, so recursive fetch is no longer an issue). I did simple smoke tests on SAMD51, RP2040, STM, and nRF to test the update.
- Removed no-longer-used
tools/usb_descriptorsubmodule. - Change
make fetch-submodulesto usegit submodule update --init --filter=blob:none. This does a partial clone of all submodules: all the tree metadata is fetch, but d...
Want to step it up and do a tree less fetch --filter=tree:0?
Just blobless turns out to be the fastest. I updated the timing results in the original post.
Thanks very much! All set.
Than you very much, Dan!!
@ehagerty you can write to flash(or nvm) from safemode.py (example at https://gist.github.com/anecdata/fe35dc6a94069fc920edf61a64750b53)
mimxrt10xx: implement i2sout
tested on metro m7 (green prototype version) with max98357a i2s amplifier and the following test code:
import board
import time
import digitalio
from audiobusio import I2SOut
from audiocore import RawSample
from microcontroller import pin
from ulab import numpy as np
n = np.array(np.sin(np.linspace(0, np.pi*2, 218, endpoint=False)) * 200, dtype=np.int16)
print(n)
r = RawSample(n, sample_rate=8000, channel_count=2)
def main():
with digit...
hooray! I finally have audio coming out of this little speaker!
@slender iron π’ ```
build-metro_m7_1011/firmware.elf section .itcm' will not fit in region ITCM'
region `ITCM' overflowed by 912 bytes
I'd suggest looking at the map file to see what has been added to that section
do you have debug on?
no.
actually it's before enabling mp3, hmm, I just rebased my i2s work onto main and assumed without checking that it still worked
did we switch compilers for main?
I'm still on gcc-arm-none-eabi-10-2020-q4-major
I don't think so
In #7762, I erroneously removed run_all.
Changing the condition to run all only when not changed_files and not compute_diff provides the desired behavior.
@slender iron I had -UNDEBUG which turns back on assert messages, I think; and it was probably causing the problem
still ITCM is 96.90% full for me, shivers
a lot of that is optional and we can move it out
I've been thinking about the ideal setup for it
theres error handling stuff that should always be in there
I am guessing that mp3 decoding & audio mixing would benefit from having some key part in ITCM but it looks like that's not likely to happen
and then everything else should really be performance guided
ITCM should really only be used for things that are always used
there is an icache for other code
OK mp3 fits now without affecting ITCM use
π
sorry for the false alarm! and thanks for the quick guidance
np, I know its new
llvm/clang has a monthly meeting about making it work for embedded
I think PGO is the way to go for fast memory placement (versus detailed linker scripts)
oops there went my CIRCUITPY drive
You should be able to write to the filesystem after remounting it as well. safemode.py does not do that automatically itself in case there is some problem that might prevent that.
Adafruit CircuitPython 8.1.0-beta.0-49-g06fbd521c5-dirty on 2023-03-21; Metro MIMXRT1011 with IMXRT1011DAE5A
>>> import audiomp3
>>> import audiomp3
>>> r = audiomp3.MP3Decoder(open("/alot-128.mp3", "rb"))
Traceback (most recent call last):
[tio 12:29:28] Disconnected
```next thing to debug, creating an MP3 decoder object fails. boo.
Hi, @ehagerty. If the device is entering safe mode due to a Hard Fault crash then the best way to debug this would be to flash a debug build make BOARD=... DEBUG=1 and monitor the uart output. The board won't enter safe mode but would instead print a backtrace which can be decoded using ports/espressif/tools/decode_backtrace.py.
well, the 64kbit/s encoded version works, so yay?
There seem to be some reliability problems.
- Sometimes, it becomes impossible to stop with ctrl-c or even UART 'break' which was supposed to be the super-ctrl-c. In this condition, data still comes IN from usb cdc.
- sometimes it just crashes/freezes after ctrl-c'ing
- a couple of times it ate the whole CIRCUITPY drive, requiring me to
storage.erase_filesystem()
audiomixer can mix up to ~8 22.05kHz 16-bit mono samples. I mixed a random selection of samples from Glowing_Bottle_Cast...
@slender iron I added new interrupts, do those have to be in ITCM?
namely this is called from interrupt context ```static void i2s_transfer_callback(I2S_Type *base, sai_handle_t *handle, status_t status, void *self_in) {
i2s_t *self = self_in;
if (status == kStatus_SAI_TxIdle) {
// a block has been finished
background_callback_add(&self->callback, i2s_callback_fun, self_in);
}
}
Only if you want them to run during flash writes
OK, so that's effectively "yes"
Iβm not sure how often user code will write flash and playback audio at the same time
Hey, thanks for this work. Am I stepping on anyone's toes if I start on moving analogio to the new apis? (Ultimately working on #7740, but the new and old adc components seem to be mutually exclusive)
it needs the tables of i2s pins written for the other micros
@caseyWebb Not at all. Please go ahead.
@slender iron rewriting CIRCUITPY via USB mass storage is something most folks will do
Are we intentionally still including 7.x on circuitpython.org/libraries? At this point, I don't recall what our thoughts were on this, whether we always keep the current stable and most recent stable, or what the plan was there. I'm currently doing a bit of work on that page, so if that needs to be updated, I can do so. But I also don't want to remove it if it's intended to remain.
right, but why do you need audio running at the same time?
@slender iron what's the alternative? make CIRCUITPY read-only to the host when audio's running?
a write to CIRCUITPY will cause a reload anyway
so why not just stop the audio?
or have the interrupt in flash
right now that's not what it does, though nobody's happy about the skipping audio during CIRCUITPY writes
much of the time you'll be loading more audio from flash anyway
so it doesn't make sense to have the interrupt run while flash is unavailable
there's 2 parts. there's the interrupt, which is small and only registers work to be done from background callback
do you mean just masking the interrupt temporarily, or reaching into running audio objects and stopping them?
hm, SAI_TransferTxHandleIRQ / I2S0_DriverIRQHandler are just in text so maybe this is either a red herring or an incomplete fix. What I'm chasing is, the board just crashing with the new audio code. and no I haven't attached a debug probe to it yet.
but only sometimes, and usually when I have tried to write CIRCUITPY
I don't think the interrupt needs to be in ITCM because it'll be masked during flash erase and write
definitely attach the debugger
yeah tomorrow
it's too bad I believed the ITCM change made it not crash, I must have changed something else in my testing procedure too
you could put it back into the ITCM to see if it fixes it
Another option would be to make OnDiskGif take in the Bitmap to load into. That way you don't need to reallocate a huge chunk of memory each loop. That'll better fragmentation-proof your code.
I think I tried that when I was first writing it. I think it would make most sense to have it optional. The only problem with pre-allocating is your may not know the GIF size.
That said should I leave the deinit code in displayio.Bitmap or back that out? Obviously the gc_free has to come out...
I think there are still cases where we might recommend going backwards in versions if there is a new problem. I think there are some regressions that haven't been fixed yet. I thought we'd leave it for a couple more months, maybe at least until 8.1.0 final is out.
That said should I leave the deinit code in
displayio.Bitmapor back that out? Obviously thegc_freehas to come out due to space.
Are you talking about the overflowing builds? I want to fix that without your having to remove code.
Closing. I confirmed the 1011 enumerates as high speed via lsusb -t.
We now have just over 40k free:
Adafruit CircuitPython 8.1.0-beta.0-45-g461d833c1-dirty on 2023-03-21; Metro MIMXRT1011 with IMXRT1011DAE5A
>>> import gc
>>> gc.mem_free()
42864
I reduced some of the USB memory buffers to make more space. There is still about 4k of USB buffers and 4k for the flash buffer plus other static variables.
When I am building circuitpython with the latest commit https://github.com/adafruit/circuitpython/commit/461d833c1c9ead38542dbbfe665af5c3446035bd for the Pyportal Titano, Circuitpython is crashing and taking me to safe mode. is there any change that we have included since yesterday that could cause this. I build CP in https://github.com/adafruit/circuitpython/commit/08c9eb9f00a4c88d0a81f9b6d5e4298d021ca74c and it works fine without crashing.. I did make clean, and V=2 if anyone is interested in see the output.
I will test this.
Did you do make fetch-submodules?
No I did not, should I test with that?
Yes, I am updating my fork and will try building from that. I built Metro M4 and tested that before I submitted the PR, but I will test PyPortal and PyPortal TItano
ok, will do
Yes, I am seeing it crash into safe mode. I'll debug
Ok Thank you very much, I do not have a powerful machine so I did not bisect π
I have to bisect tinyusb, I think
the other changes should not be making it crash -- they are just git things
got it. thanks again
Thanks @jposada202020 for noting this. I will bisect the tinyusb updates.
The problem is further back. Bisecting main line.
The problem is further back than the latest PR, so I am bisecting. Thanks for giving a good commit.
No worries, thank you
I'm seeing a problem with web workflow on the Pico W and the latest S2 build that also wasn't happening on the 8.0.4 S2 release. As soon as I try and connect via web workflow (serial terminal or file browser) the board crashes. If I'm connected to the REPL an OSError: [Errno 11] EAGAIN is displayed. Do you think it's related to the PyPortal issue you're looking at or should I open an issue?
still bisecting, not sure yet. But I saw that EAGAIN error, and then stopped seeing it after some fix.
I think it was in 8.0.3, fixed in 8.0.4, but not sure I remember right
- Bisected to 5bb8a7a7c68781e6edbd3aebaf7eeeecb310bd86, which is the first commit inside #7724. Tagging @tannewt.
Do I need to update something to get the new make fetch-submodule function to work? I build on Debian and git doesn't seem to like git submodule update --init --filter=blob:none
what do you mean ?
I just cloned a new copy of circuitpython and when I attempt to run the make fetch-submodules, it now runs git submodule update --init --filter=blob:none which the git on my install rejects with a usage error. If I go back to the makefile in 8.0.4 the fetch-submodules function consisted of two different commands so I'm assuming the one that' s failing for me is an updated procedure
I am running the old version now but I assume the new version is the preferred way to go
@tannewt The crash is caused by this change, which adds a const:
https://github.com/adafruit/circuitpython/blob/5bb8a7a7c68781e6edbd3aebaf7eeeecb310bd86/tools/gen_display_resources.py#L167
If I remove the const, the crash does not occur. Why this is true is not at all obvious to me. It does explain why the crash occurred on the PyPortal and not on the Metro M4 (which has no display). The casts added to this file and the other new consts do not make a difference.
(I tried undoing a ...
what version of git are you using?
I tried to find out when --filter was added to git submodule update` but it was not immediately obvious.
You can use the old make fetch-submodules, it is just a little bit slower, and it creates shallow clones, which can be a bit of a nuisance if you want to change commits in the submodule.
git version 2.30.2
Linux 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 GNU/Linux
I'm not sure why my git isn't updated to the latest, but I assume it will make it to my distro eventually. If the shallow clones are causing the issue I think they are then I'm happy the new method is in place, now I just have to dig in and try and figure out how to get 2.40 π
I looked at the .0 release notes for the releases between 2.30.0 and 2.40.0, and I can't see which one added it. But there are many more bugfix releases in between, and the descriptions are such that something obscure might have added this feature.
what is /etc/issue on your system?
suggests using the -backports package for your release
pi@Rohan:~$ cat /etc/issue
Debian GNU/Linux 11 \n \l
i can make the target be more robust
do apt show package-name -a to find out about backports
apt show git -a
Well your link looks promising, I'm a little slow in Linux as the only thing I do on it is build CP. I suspect you've dug up all I need π Thanks!!!
pi@Rohan:~$ apt show package-name -a to find out about backports
N: Unable to locate package package-name
N: Unable to locate package to
N: Unable to locate package find
N: Unable to locate package out
N: Unable to locate package about
N: Unable to locate package backports
E: No packages found
let me know what the backports version is and if it works; that will give us some indication package-name is a metavariable, like "foo". Do apt show git -a
@wraith crow ok, you have to add the backports repository first. Start at the top of that page: https://wiki.debian.org/Backports
add the repo either via synaptic or via the command line
after it is added, then you can do apt show package-name -a
CircuitPython version
Adafruit CircuitPython 8.0.4 on 2023-03-15; Adafruit Feather M0 Express with samd21g18
Code/REPL
import gc
import board
import adafruit_vl53l4cd # TOF
import time
import neopixel
import simpleio
import touchio
from digitalio import DigitalInOut, Direction, Pull
gc.collect() # make some rooooom, WIP, copied from code on M0 Express board
pixel_pin = board.NEOPIXEL
num_pixels = 1
ORDER = neopixel.GRB
pixels = neopixel.N...
Okay the apt show git -a now indicates that 2.39.2 is available, I'll try installing that
It looks like 2.39.2 has the feature the new make fetch-submodules is working now.
I should probably make it do it the old way if the command fails.
Probably, but I'm glad it failed for me first so I could get the new version. If it's possible to throw a message up after the old way completes hinting that there's a better way that might be worth while, unless you think all distros will get the 2.39 or later version relativly soon.
Another nice feature of the new command is that I often have to run the fetch-submodules command more than once because of failed submodule clones, with the old version it was hard to tell when everything was complete, but this version just comes back with nothing if there's nothing to do
That said should I leave the deinit code in
displayio.Bitmapor back that out? Obviously thegc_freehas to come out due to space.Are you talking about the overflowing builds? I want to fix that without your having to remove code.
Sounds good. I will still look at being able to set your own Bitmap object but leave the rest for now.
CircuitPython version
Adafruit CircuitPython 8.1.0-alpha.2-16-g60a9c7e5b on 2023-03-22; Raspberry Pi Pico W with rp2040
Code/REPL
No code executed, tested without a code.py
Behavior
During my testing I first dismounted the CIRCUITPY drive and then attempted to access the web workflow URL. on commit https://github.com/adafruit/circuitpython/commit/60a9c7e5b2570a84c07c6c0c78f73c63322937f0 and newer the Pi Pico W would restart as soon as I clicked ...
CircuitPython version
Adafruit CircuitPython 8.1.0-beta.0-47-gc93560144 on 2023-03-22; Waveshare RP2040-Zero with rp2040
Code/REPL
>>> import struct
>>> struct.pack("2H", 1)
Traceback (most recent call last):
File "", line 1, in
TypeError: can't convert to int
>>> struct.pack("2H", 1, 2)
b'\x01\x00\x02\x00'
>>> struct.pack("2H", 1, 2, 3)
Traceback (most recent call last):
File "", line 1, in
RuntimeError: too many arguments provided with th...
[edited: issues with fetch-submodule, but I'll see if it's a local problem fixed with recloning]
It is an UC8151-chip. I will create a PR which fixes the board.c by setting grayscale to true.
In micropython they do this fwiw:
// If we run out of args then we just finish; CPython would raise struct.error
while (cnt-- && i < n_args) {
mp_binary_set_val(fmt_type, *fmt, args[i++], p_base, &p);
}
(so their behavior, of consistently getting 0-bytes in this case, is intentional)
.. and test our struct module during the build-time tests
Closes #7771
(void)mp_arg_validate_length(n_args, i, MP_QSTR_args);
anybody run into an error like this? ```jepler@eric:~$ pyocd list
Probe/Board Unique ID Target
0 Segger J-Link 50128794 n/a
jepler@eric:~$ pyocd gdbserver -t MIMXRT1010
0000798 I Target type is mimxrt1010 [board]
0000935 C No emulator with serial number 50128794 found. [main]
Traceback (most recent call last):
File "/home/jepler/.local/pipx/venvs/pyocd/lib/python3.9/site-packages/pyocd/probe/jlink_probe.py", line 168, in open
self._link.open(self._serial_number_int)
File "/home/jepler/.local/pipx/venvs/pyocd/lib/python3.9/site-packages/pylink/jlink.py", line 723, in open
raise errors.JLinkException('No emulator with serial number %s found.' % serial_no)
pylink.errors.JLinkException: No emulator with serial number 50128794 found.
"sudo" doesn't help
@anecdata thank you so much, the gist is brilliant! @dhalbert Thank you very much for your explanation, I'm very grateful for your time. @microdev1 thank you I had not yet crossed the 'build completely myself' threshold with CP as I had done with MP - I'm very grateful for your explanation to get me started!
@onyx hinge I haven't seen that. I just use JLink's software though
JLinkGDBServer -if SWD -device MIMXRT1011xxx5A
yeah I did eventually get it working that way
and then couldn't reproduce my crashes π
π
I think I'm going to write a script to generate the pin mappings
so I can fill in the i2s stuff for you
This PR fixes issue https://github.com/adafruit/circuitpython/issues/7734 (regression after ACEP-patch for Badger2040).
thanks, I think I finished the lists for the 3 chips we have now but it was manual so there are errors
I'm planning on adding the rest of the chips so a python script will make it simpler
my sdk update makes it all easier
i haven't yet tried pyocd, sorry
I'm not sure pyocd does flashing with external flashes that well
One "is it intentional" question, otherwise looks OK. I can rebase the i2s branch once this is merged.
is this deletion intentional?
Two questions. Looks good otherwise!
Want to delete all of this?
Don't we allow the user to set the quiescent value? Or is it ok that it is always signed?
@onyx hinge want me to wait to merge the sdk changes? it'll conflict with your i2s PR
π
if it's not, well,
yup, just changing the location of the added source file
don't forget to git submodule sync to pick up the submodule source switch
I should probably add git submodule sync to make fetch-submodules
#7623 introduced a problem that I believe could cause crashes in the web worfklow, but we thought we promptly fixed it in #7632. The ref you are testing at, 60a9c7e5b, is within the range of commits known to be affected. Can you check whether this problem is still affecting current versions?
maybe you saw last night it requires a pretty new git (somewhere past 2.30). bullseye doesn't have it by default, but it's in backports. Not sure if I should add a fallback or just document it. I need to find the minimum version: the release notes are not that helpful
I already have the backports one on my debian bullseye (but I also just directly enter git commands rather than using the makefile for submodules; I should reeducate myself on that)
it SHOULD be an option in .gitmodules, I would say, but this is better than nothing
The serial lines to the ESP32 AirLift processor on the Metro M7 1011 are named on the schematic from the point of view of the ESP32. But pins with the same name on other AirLift boards are named from the point of view of the main microcontroller. Flip the pins. This makes the naming congruent with what is used in the adafruit_airlift library.
Thank you for the PR! I think this is actually a bigger issue and I've tried to fix it in #7777. Can you try the artifact from there?
I think #7777 may fix this more broadly. (I saw a similar issue on the forum.)
The output is always signed 16 bit so the quiescent value should be zero
ok
I am trying to build circuitpython from source
But make says that it has no rule for building peripherals/samd/samd21/adc.c
(i am trying to build it for a circuit playground express as a test)
you need to do make fetch-submodules at the top level to get all the git submodules brought in
what did it print when you did that? It newly requires a recent version of git, and perhaps it just printed an error.
what OS are you doing it on?
endavourOS
what does git --version say?
git version 2.40.0
that should be fine
yes, try it again, and see whether ports/atmel-samd/peripherals exists and has files in it
that isn't good: what does it print when you do make fetch-submodules
nothing? It should take several minutes
is this your fork? Did you update main in it, if it is?
git submodule update --init --filter=blob:none
yes, it is my own fork
and i am on my branch
still nothing
testing it myself...
try a fresh clone of your repo under another name, e.g. git clone https://github.com/yourname/circuitpython 1circuitpython; cd 1circuitpython; make fetch-submodules
it is working for me on a fresh clone
(I'm on arch so its unlikely an OS issue)
is endeavour arch?
arch based
arch with gui installer and dracut
seems to have worked!
thanks!
not sure what is up with your other clone, but great!
@gamblor21 I made it fit. Is there an additional documentation to add, per our discussion above? Besides that I think it's ready to merge.
I am seeing the issue on the latest build from circuitpython.org. I am a bit concerned I'm missing something because the commit that the problem seems to start at doesn't make a lot of sense for this type of issue and I'm surprised that no one else has reported this by now. I did try plugging the pico w into both a Windows 8 PC and a Linux box and got the same result. I also connected the Pico to a usb charger so there was no computer involved and confirmed that web workflow didn't work in th...
Just to eliminate doubt can you show the boot_out.txt from the "latest version" you're using?
Adafruit CircuitPython 8.1.0-beta.0-48-gcfedcd411 on 2023-03-22; Raspberry Pi Pico W with rp2040
Board ID:raspberry_pi_pico_w
UID:E6614103E71F6622
MAC:28:CD:C1:00:43:35
I am also reproducing this on the latest builds (both downloaded and generated locally). The EAGAIN error (Errno 11) is being raised in socketpool_socket_recv_into() due to the change introduced in PR #7623. However, that identical code is working fine in CP 8.0.4.
Trying to see what other CP 8.1 changes may be affecting this.
Just got this product in: https://www.adafruit.com/product/1028
Using it with this product: https://www.adafruit.com/product/5477
Exactly the same as this issue: https://github.com/adafruit/Adafruit_CircuitPython_IL0373/issues/28
CircuitPython Version: Adafruit CircuitPython 8.1.0-beta.0-50-ge1f16472c on 2023-03-22; Adafruit Feather ESP32S3 4MB Flash 2MB PSRAM with ESP32S3

(void)mp_arg_validate_length(n_args, i, MP_QSTR_args);
>>> struct.pack("3H", 1, 4)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: args length must be 3
or is it clear enough ?
it's not the same as function takes x positional arguments but y were given
I guess I answered my question !
I'm open to that being better but also keep in mind (I didn't think about it before now) it could be pack_into which had more arguments than pack...
no, my bad, it makes sense that it's the size of the vararg
or maybe there's another QSTR that could be used, such as MP_QSTR_values
standard documentation uses that word: "Return a bytes object containing the values v1, v2, ... packed" as does our docstring def pack(fmt: str, *values: Any) -> bytes:
it is called values in the docs
matching the documentation of struct.pack, which has def pack(fmt: str, *values: Any) as the signature.
Thanks @jaunty juniper that makes it better
Uff, who wants to help me with an error I'm encountering trying to update my local copy of CircuitPython?
git pull is happy, says up to date. make fetch-submodules on the other hand, got through part of the update, then threw this error. Rerunning it changed nothing except that it doesn't go through any updates, it simply throws the error now. ```
$ make fetch-submodules
git submodule update --init --filter=blob:none
fatal: 'adafruit' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: Fetched in submodule path 'ports/broadcom/peripherals', but it did not contain d3a6b50a21e7dd49ba4bfa0374da3407594caa50. Direct fetching of that commit failed.
make: *** [Makefile:332: fetch-submodules] Error 128```
It ran earlier...
is your clone in a case-sensitive filesystem?
That's the unusual one right? I created a separate DMG for it to do exactly that.
So yes I believe so
ok, good
try doing git submodule sync, and then repeat make fetch-submodules. If that doesn't work, can you just do a fresh clone?
Probably on the fresh clone. Was pretty proud of not having needed to do that in a long time though. π
I'll try that first.
sync did a thing, and then make throws the same error.
I guess it's fresh clone time. Bleh.
Unless anyone else has run into this before and has a suggestion to try.
You could try git clean -ffdd
Ooh, what does that do
I think it might clean out the submodules ... no it didn't
@jaunty juniper did you have any suggestions?
I have one untracked directory that I need to dig out of there, a new board def I think I was working on.
Otherwise, I don't think there's anything else in progress.
no I have been having issues with fetch-submodules but sync solved the last one
it was that:
β― make fetch-submodules
git submodule update --init --filter=blob:none
fatal: remote error: upload-pack: not our ref 2b9354539e6e4f722749e87b0bdc22966dc080d9
fatal: Fetched in submodule path 'ports/mimxrt10xx/sdk', but it did not contain 2b9354539e6e4f722749e87b0bdc22966dc080d9. Direct fetching of that commit failed.
make: *** [fetch-submodules] Error 128
ok, got to go cook but I will do a little more research. I have seen like three unique problems which I haven't duplicated
Hmm.
I'll rename the current clone directory, and keep it around for testing or trying to fix.
I'm kind of blocked on this for something else, so it's fresh clone time.
I had another one in a different working directory, but that one might have been due to weird things on my side, so i recloned, then had weird problems again when switching branches that solved themselves by a checkout
(some submodules had been left in a modified state)
i would like to find a way to "uninit" and remove the submodule fetches
thanks @dhalbert ! just tested the BLE and now it is working with ESP().
I ran the wifi test and am now getting this error though:
code.py output:
ESP32 SPI webclient test
Traceback (most recent call last):
File "code.py", line 27, in <module>
File "adafruit_esp32spi/adafruit_esp32spi.py", line 342, in status
File "adafruit_esp32spi/adafruit_esp32spi.py", line 331, in ...
@tannewt I copied over the ESP32-S3 TFT to my device and its boot-looping.
ESP32-S3 PSRAM (non-TFT) worked with EPD https://www.adafruit.com/product/4778 and EPD
https://www.adafruit.com/product/1028 using: Adafruit CircuitPython 8.1.0-beta.0-52-gfe5e19195 on 2023-03-22; Adafruit Feather ESP32S3 4MB Flash 2MB PSRAM with ESP32S3
Hi everyone! I've been out sick for the past 1+ weeks, but I'm starting to come back now. I'm a little sad that the PRs I sent 2 weeks ago haven't attracted any attention. π₯
Glad to hear you're feeling better and making your way back!
i'm sorry I haven' been able to follow up. I have been thoroughly busy getting releases out. There will be another beta 8.1.0 soon. There's a lot of short-term stuff to fix, and since asyncio does work now, to rework it does not get as much attention, even though in the long run it is important
@jaunty juniper @idle owl Ooh neat git submodule deinit --all (or you can deinit a particular one). That might help.
you could try it on the one you moved aside. adding -f will deinit them even if there are changes inside
Ooh ok
make fetch-submodules ran through a bunch of things, and then threw the same error.
I ran it with -f.
It did a lot of things.
I'll keep this clone around for now though.
@gamblor aah, what did you just add? so many file changes which aren't really changes? Did you merge from upstream?
@blissful pollen21 you just did something which added a huge number of changes. Can you back that out? just pull your branch and you will pick up my single commit change. You can do a git reset --hard 4d09afa to just go back to your doc addition and then do a git push -f
Okay I will in a few. Feel free to stop it. I had tried to rebase to pick up some doc changes before I made others
we could merge the current PR and you could submit a separate doc PR
Okay makes sense I'll revert it back. Sorry about that
i am just worried about reversions to main from such a large PR
With the reset will it set it back before I did the rebase then? I think I can find the original commit for my branch still
ugh sorry I missed that commits went to 132 π¦ now I see clearly why that was bad
I added 4ff586e, and then 4d09afa was the doc change. You could hard reset back to that
okay thanks I'll try that. I know I should just avoid anything crazy in git by now!
i just tested with 8.0.4 release and i got the same TimeoutError with WiFi, so it doesn't seem to have been introduced by this fix for BLE. would you like me to file a separate issue?
i just tested with 8.0.4 release and i got the same TimeoutError with WiFi, so it doesn't seem to have been introduced by this fix for BLE. would you like me to file a separate issue?
Sure
@dhalbert that actually seemed to be a random glitch that was fixed by unplugging/replugging. i got a pyportal to test with, which worked, and then when i plugged back in the metro m7 it was also working as expected with WiFi for both 8.0.4 and this build so no worries there
@BlitzCityDIY I think we have seen this issue before, and have some issues already open. It does seem to be something about the state of the NINA-FW code or its storage.
Since this was tested as fixing the problem for #7734 and #7773, I will approve this. Not sure about #7778, but there can be another PR about that.
Tested on PyPortal. Thanks!
Thanks for this consistency fix.
Fingers crossed I think I fixed it (not perfectly maybe but removed all the commits)
it looks ok, I will do a local diff to make sure, and wait for the builds
Sorry again about that. I hate making more work for you. I just need to remember avoid rebase and realize merges aren't that bad
I am not actually sure why the rebase didn't work. I have done that before. But I have also had rebases go haywire. I once went to a talk where someone was extolling the virtues of rebase, using a very simple example, and managed to totally mess it up. So it made me quite wary of rebase. Don't worry about the work -- it's part of the review process.
Dan just so you know somehow I lost my first commit but I know what was in it / can find it so I'll recommit it hopefully later tonight.
got it - I fixed one thing, a missing curly brace, which was confusing, but I'm guessing there was more. I have your previous branch in another clone, if you can't find it.
I'm not even sure how I lost that brace. It was just the definition of deinit in OnDiskGif so simple enough to put back
what I have
Thanks I have the commit id on my own machine too if i need. Just will be a few till I can get to it. Not sure when you're aiming for the next release if that matters
not for a couple of days at least, I think
Okay I'll get to it before then for sure
reverted changed in lib/ and resolve conflict with main
hmm, weird, on my local machine, pre-commit Formatting make this change and failed otherwise. But ci pre-commit seems to decide the other way around. Probably due to version difference, I have to temporarily uninstall pre-commit to force revert this change.
- Deneyap Kart
- Deneyap Kart 1A
- Deneyap Kart G
Name of flag.
// Enable CTRL_EXTEN, DCDC1, LDO2 and LDO3
Touched up changes; will approve after re-run
# to test arbitrary precision integers
version = tag + ".plus." + additional_commits + "+" + commit_ish
on metro m7 I've been seeing that it's easy to get it into a state where ctrl-c does't work to send KeyboardInterrupt. this tends to happen if I accidentally type something in on the repl but my program is never going to read it. I think maybe @slender iron made the USB CDC buffer really small to reduce RAM footprint? but the newer "serial break" feature, if you can get your terminal program to do it, does succeed in causing a KeyboardInterrupt.
No boot loop on nightly build, but the FeatherWing IL0373 is not working with adafruit_il0373 on Adafruit CircuitPython 8.1.0-beta.0-58-gdb76fbd55 on 2023-03-23; Adafruit Feather ESP32-S3 TFT with ESP32S3
ESP32-S3 PSRAM (non-TFT) working with 2.9 EPD - UC8151D using Adafruit_UC8151D nightly build Adafruit CircuitPython 8.1.0-beta.0-58-gdb76fbd55 on 2023-03-23; Adafruit Feather ESP32S3 4MB Flash 2MB PSRAM with ESP32S3.

Haven't tested the TFT with 8.1.0-beta.0-58-gdb76fbd55 with the UC8151D
Have not tested the ESP32-S3 PSRAM (non-TFT...
@tannewt I switched from using extra gc roots to using the finaliser, and moved the pin change interrupt code to peripherals/ so this is ready for your re-review.
@idle owl Hello, do you think it would be a good Idea to use the picture that they used yesterday in ask an engineer, celebrating the 100th libraries in the community bundle, in the readme of the repo?. I could put it there if the answer is yes π
I like that idea. π
Sure! I can get you a higher resolution copy of it. Give me a moment.
Closing this as stalled, labeled with stalledPR. Please reopen when a VID/PID is available.
Use whichever one you like better!
Thank you !!!\
Look how cute blinka looks in that banner π
I came up with the design, Bruce made it a beautiful reality. π
I like it very much!
Closing this as stalled, labeled with stalledPR. Please reopen when it's ready.
Closing this as stalled, labeled with stalledPR. Please reopen when a VID/PID is available.
Closing this as stalled, labeled with stalledPR. Please reopen when a VID/PID is available.
I thought it was set as 512 bytes still. could be something with the HS path in tinyusb
or something from the upgrade to tinyusb?
I have to actually hook up some speaker or headphones but maybe "mqs" (PQMAudioOut) is starting to work too. top are L/R channels as digital, bottom is as analog with the saleae sampling at just 15kHz. The carrier frequency is about 192kHz so it "should be" un-hearable.
some musical notes
Ok, so the nightly with db76 is still not working with the IL0373 but everything else is ok?
Let me just recheck everything and report back here in a few
Thanks. Now working, and I tested locally with a clone of the branch and pre-commit.
@slender iron ok, we are down to 22 PR's after I closed some stalled ones.
and we finished off some recent ones
thanks @tulip sleet !
The added link text is outside the doc strings. It should go inside the doc strings so it shows up in the generated documentation.
Closing as stalled for now. @tiffdefaria if you would like to continue working on this, you or we can reopen
Closing this as stalled, labeled with stalledPR. Please reopen when a VID/PID is available.
- ESP32-S3 TFT - CP:
Adafruit CircuitPython 8.1.0-beta.0-58-gdb76fbd55 on 2023-03-23; Adafruit Feather ESP32-S3 TFT with ESP32S3- 2.9 Color EPD UC8151D
- β Displays gibberish
- 2.9 Color FeatherWing IL0373
- β Works great
- 2.9 Color EPD UC8151D
- ESP32-S3 PSRAM - CP: `Adafruit CircuitPython 8.1.0-beta.0-58-gdb76fbd55 on 20...
Thanks @jposada202020 @bergdahl @wtuemura !
Thanks - one tiny fix. Also, could you add your Creator ID and board IDS to https://github.com/creationid/creators ?
Missing newline at end of file here.
Needs a re-review. No change besides fixing the merge conflict.
@tulip sleet The CircuitPython install template still has "entering safe mode in 6.x" separate from 7.x, which I assume is the same as 8.x. Should we remove the 6.x at this point?
Either way, I need to explain that 7.x is the same if it is.
There's no mention of 8.
Only the RP2040 install template has it.
I think that's fine. you could say 7.x and later. You could add the 6.x instructions to the FAQ or Troubleshooting, or some Older Versions page if that makes sense. But I don't see any reason to mirror 6.x insturctions everywhere.
Ok.
I saw this in the Lyre guide, seemed a little excessive
.. via a peripheral known as the "MQS" (medium quality sound). It uses an ~192kHz PWM signal to generate audio. It sounds OK on a small speaker with no amplifier. There's a small pop when starting/stopping audio, as is typical.
Fixed.
@onyx hinge @slender iron I am starting on release notes for 8.1.0-beta.1, can wait for #7785 above, etc., not in a big rush
68 PR's already
really helps to give perspective on how much work is going on; I don't mind the review
is it new to have the logos next to the roles?
added this morning
aha
If I use my test program (see below_, and then ctrl-C it, then when I restart it, I get:
``
Traceback (most recent call last):
File "", line 1, in
File "play.py", line 14, in
ValueError: I2SOut in use
This is confusing, because it's not known to the user that I2S is in use, and something is not being reset when the VM starts up (or shuts down).
```py
import array
import board
import os
import time
from audiocore import RawSample, WaveFile
from audiopwmio import P...
This debugging print should be removed.
This is confusing, maybe clarify about how MQS is implemented.
Not sure why you removed this, but left the comment on line 35?
Also the "." debugging printout continued to run after the playing was finished. Maybe that's just how the I2S hw is working, but it seems like the interrupt continues even when play is done:
>>> import play
note: peripheral 3
0 mak11.wav
1 mak12.wav
2 mak14.wav
3 mak15.wav
4 mak16.wav
5 mak17.wav
6 mak22.wav
7 mak22050.wav
8 mak24.wav
9 mak8.wav
play: 0
playing mak11.wav
.............................................................................................
Yes, we keep feeding the peripheral with zeros (only signed 16-bit samples are ever output, so this is the "quiescent value"; the value specified by the user is always ignored) because otherwise the hardware signals FIFO underruns and gets grumpy. There may be a clever way to turn the FIFO off exactly when it empties, but it was easier to just keep giving it zeroed data.
pre-commit excludes the following but it seems OK to have newlines in these files so these can be removed
ports/espressif/esp-idf-config/.*ports/espressif/boards/.*/sdkconfig
@onyx hinge you saw my comment about I2SOut in use after ctrl-D, is that right?
@microdev1 Yeah, I'd agree with that certainly for the sdkconfig files. Do you know if the .csvs in esp-idf-config/ can have blank lines also? I would hope so.
The have newlines now so it is fine I think.
missing newline at end of file
@deneyapkart I tried to fix the missing newlines myself, but you didn't give permission for repo maintainers to push commits to your PR's. So we'll wait for your changes.
@ozgurbostan I tried to fix the missing newlines myself, but you didn't give permission for repo maintainers to push commits to your PR's. So we'll wait for your changes.
@dhalbert I have just fixed the missing new line.
Thank you for your patience with the changes!
Now, two more steps:
- PR to add your Creator ID and board IDS to https://github.com/creationid/creators
- PR to add these boards to https://circuitpython.org. See https://learn.adafruit.com/how-to-add-a-new-board-to-the-circuitpython-org-website.
On 57ac9aa763587221c2bf55dce746bd50e58159dd, which is current Master, I cannot make fetch-submodules.
fatal: remote error: upload-pack: not our ref 2b9354539e6e4f722749e87b0bdc22966dc080d9
fatal: Fetched in submodule path 'ports/mimxrt10xx/sdk', but it did not contain 2b9354539e6e4f722749e87b0bdc22966dc080d9. Direct fetching of that commit failed.
make: *** [Makefile:332: fetch-submodules] Error 128
Running git submodule deinit --all -f doesn't help.
Try removing it from .git directory circuitpython/.git/modules/ports/mimxrt10xx/sdk and then make fetch-submodules.
That worked, thanks, but why was that necessary. Never have I ever had to do this in the past.
That worked, thanks, but why was that necessary. Never have I ever had to do this in the past.
It has to do with the recent change in the submodule fetch strategy https://github.com/adafruit/circuitpython/commit/ae95274b66cb3bf72b5ff14421bd02137abee31c.
The old way of fetching submodules did a shallow fetch, which leaves incomplete info in the .git directory. I would like to find a clean way of doing this but haven't yet.
That is very weird. The code to drive the display should be the same so I'm not sure why it works on one but not the other. I don't think I have a UC8181D display so I'll need to order one and get back to this.
These four cases all work with 8.0.x right?
Spamming exec still crashes with a large enough pystack.
I am inclined to believe heap is at fault somehow.
With stock pystack though it all works fine.
I still have no idea how to decode the cpu crash dumps.
- ESP32-S3 TFT - CP:
Adafruit CircuitPython 8.0.0 on 2023-02-06; Adafruit Feather ESP32-S3 TFT with ESP32S3- 2.9 Color EPD UC8151D - Code
- β Works great
- 2.9 Color FeatherWing IL0373 - [Code](https://github.com/adafruit/Adafruit_CircuitPython_IL037...
- 2.9 Color EPD UC8151D - Code
there is a python script in ports/espressif/tools
you give it the elf file and then copy and paste in the Backtrace: lines
This is better in #help-with-circuitpython . Let's move there.
ok
OK I think I've fixed the problem with the imported version and the peripheral in use but I didn't re-test it. The class (as was i2sout!) was allowed to be relocated to long-lived, with bad consequences. And it had no del so without deinit the i2s peripheral would remain in use. However, I'll re-test locally before re-requesting review from you.
@dhalbert Just letting you know you've been @'ing the wrong Gamblor in some of these messages
@dhalbert Just letting you know you've been @'ing the wrong Gamblor in some of these messages
Thanks, can you point to those? I searched and couldn't find a misattribution, but I might have edited them.
The Windbond chip is the QSPI flash, right? I mean it's the only thing on this board that's the proper size, but I wanted to verify anyway.
yes
Thanks!
Has anything changed with regards to make fetch-submodules I'm getting this error trying to run that on a fresh cloned repo:
β― make fetch-submodules
git submodule update --init --filter=blob:none
usage: git submodule [--quiet] [--cached]
or: git submodule [--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--] <repository> [<path>]
or: git submodule [--quiet] status [--cached] [--recursive] [--] [<path>...]
or: git submodule [--quiet] init [--] [<path>...]
or: git submodule [--quiet] deinit [-f|--force] (--all| [--] <path>...)
or: git submodule [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-shallow] [--reference <repository>] [--recursive] [--[no-]single-branch] [--] [<path>...]
or: git submodule [--quiet] set-branch (--default|--branch <branch>) [--] <path>
or: git submodule [--quiet] set-url [--] <path> <newurl>
or: git submodule [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]
or: git submodule [--quiet] foreach [--recursive] <command>
or: git submodule [--quiet] sync [--recursive] [--] [<path>...]
or: git submodule [--quiet] absorbgitdirs [--] [<path>...]
make: *** [Makefile:332: fetch-submodules] Error 1
yes you need an upd-to-date version of git
This page in the docs mentions Ubuntu 22.04 and shows sudo apt install git which is what have / have done as far as I am aware π«
yeah that change is causing a lot of problems, I don't think we fully know what it does even
Is it completely impossible to do it with the an older version? I feel like I did it very recently. I'm willing to try some workarounds if some are available.
you could use the old fetch-submodules ?
git submodule update --init -N --depth 1 || true
git submodule foreach 'git fetch --tags --depth 1 origin $$sha1 && git checkout -q $$sha1'