#circuitpython-dev
1 messages ยท Page 400 of 1
the README inside of factory-reset will get created by default but deleted by that post_gen along with the directory if not needed.
Your bash scripting is sharper than mine if so
I doubt it
here's all I did
I added the factory-reset folder to the cookicutter.directory_name directory.
Then added this to the post_gen_project.sh
{% if cookiecutter.dev_board in ['n', 'no'] %}rm -rf factory-reset{% endif %}```
It never occurred to me to bash script it. I used the cookiecutter ifs.
Is that wrong?
or if it works, it works?
Ahhhhh yep that seems like it would work to me. And Doh! it didn't occur to me to use the template statements to write the if statement. I was trying to figure out how to make Ifs in bash.
We both went with what we knew ๐
Ok, great. now to test the other changes I added a few minutes ago
They work after a little tweaking! Turns out there was already a thing in there to automatically add the board files, but I had no idea what it was. It wasn't going to work the way it was in there, so I tweaked it a bit, and made it so you have to type in the name of the board file as it is in the repo because they're never consistent, they're what Limor types out when she designs them which can be anything.... ๐
Ok. I'll update the README, and then have Dylan test it without explaining anything.
@lone axle Thanks so much!
Yep you're welcome
One thing that may be worth another small tweak. I'm not sure whether the cookie cutter variables and/or the in check in the if statement is case sensitive. If the default is uppercase "N" and it is case sensitive it's probably worth adding "N" and maybe "No" to the list that it checks.
?serverinfo
Only 8 more users needed!
You're welcome! The Tiny2040 board definition (and other Pimoroni boards) were supplied by someone working with Pimoroni -- we did not make the pin choices, but they do go with our general philosophy. We rely on the manufacturers to document their pin names in their equivalent to a board's Learn Guide.
Closing this for now.
I made it n ๐
I caught that too
nice.
Huzzah!
Thanks for your help ๐
Before this I didn't even know there was a pcb cookie cutter. It's neat the way it does some of the git repo setup in the post gen. I may end up taking some inspiration from that for some other projects.
Yep you're welcome.
We only really use it intermally ๐
I did not make a 7.x branch yet. It is incompatible with 7.x, right?
at least not 7.1
there are sure to be problems to shake out, as well as the rgbmatrix thing
so it's fine by me as long as branches are used 'somehow' to keep it from being in 7.1.0
which scott's plan sounded sensible, and just affects people who need to PR bugfixes into 7.1.0
I will make a 7.1.x branch off main. That is what we did in the past for 6.1.x, 6.2.x, and 6.3.x.
(well maybe 6.2.x and 6.3.x were not off main)
@t-ikegami that'd struct facility would be awesome! Could we autogenerate them from SVD files?
I'd be happy to see ctypes enabled after we do a pass to ensure what we have matches CPython.
๐
@tulip sleet want to merge #5615 after and also tag it as 7.2.0-alpha.0?
Keep an eye on joins in #bot-mods
If I tag that, I think it will eclipse the 7.1.0-beta.n releases in circuitpython.org
or you mean just tag?
Do you want to review #5615? I have not looked at it at all.
I had looked it over already. Just made it official
This is good -- I wonder if it should be made bold or otherwise called out.
Images automagically compressed by Calibre's image-actions โจ
Compression reduced images by <strong>64.9%</strong>, saving <strong>28.02 MB</strong>.
| Filename | Before | After | Improvement | Visual comparison |
|---|---|---|---|---|
| <code>assets/images/boards/large/adafruit_proxlight_trinkey_m0.jpg</code> | 370.36 KB | 133.03 KB | -64.1% | [View diff](/adafruit/cir... |
This is good -- I wonder if it should be made bold or otherwise called out.
Update image-actions per instructions in https://github.com/calibreapp/image-actions#usage
Damnit now I need to go get an ESP32-S3 board before the rush! Great Hanukkah present, thanks y'all,
This note is visible on https://github.com/adafruit/circuitpython-org/pull/802, and is what provoked this PR:

?serverinfo
I testedwith the above airlift setup all these cards, still using sdcardio. (see my full program listing above)

- kingston 32gb micro sdhc class 10
- no-name 128MB card (https://www.adafruit.com/product/5250)
- g.skill micro sd hc 32GB class 10
- sandisk edge 16GB micro sd HC class 10 (possibly https://www.adafruit.com/product/2820)
- 2GB micro sd "S...
@slender iron do you care whether a "nopsram" version of the esp32s3 devkit is added to CP?
@tannewt Many thanks!
I was about to load up an S3 build, but realized there were no boards yet. @onyx hinge are you adding the three extant variations of S3 DevKit boards?
@crimson ferry I'm close to making a PR for the devkitc (psram & no-psram versions), just doing final verifications...
they come up to CIRCUITPY and can flash their neopixel
I also have the "box", but it did not successfully boot into CIRCUITPY yet
These both mount CIRCUITPY & blink the RGB LED. That's about all the testing I did.
@onyx hinge Blinky NeoPixel? Who needs more!
I didn't try it where I fully power off and unplug the USB to see if I can make the WiFi work with a mounted SD card. I will try once I'm back home.
But aside from that, what's the next step? It seems from @jerryneedell that his PyGamer rejected several SD cards as well, and I've tried 4 or 5 as well, all cause the WiFi to fail. Is there a way to raise this to the dev team that worked on PyGamer? I do not have any other device like the adalogger to compare...
I did some experimenting with delays, but to no avail. So I just went and made the Stage code for PyBadge and PyGamer manage the backlight pin with digitalio, independently from displayio.
I received my board yesterday and it runs this PR fine. Interestingly, the pi pico build also works fine.
@prplz Thanks for the update. I am still waiting for mine.
@tannewt Removing the WIP from the title. Will press the "Ready for review button" shortly...
thanks for making both versions!
Perhaps you should include the neopixel library?
ATTiny-based seesaw devices were not working well with RP2040 I2C. RP2040 I2C uses bitbangio.I2C internally for zero-byte I2C writes, because the RP2040 peripheral does not allow zero-byte writes. The clock stretch timeout was slightly too short (255us, need at least 278 or so).
This lengthens the the hidden bitbangio clock stretching timeout to the same timeout used for RP2040 busio.I2C(), which right now is 1 second (excessively long, but that is a separate thing to fix).
Tested...
@prplz Does it have a neopixel on board? (Guess so: GPIO12) That's something we can add easily. However, it is normal for including it in the frozen libraries?
I'm unsure, I see some with onboard neopixel that include it, but also some that don't.
?serverinfo
@deshipu we branched 7.1.x, so if you want this in 7.1, you may want to resubmit and merge against that branch instead.
@stuck elbow @analog bridge @onyx hinge @idle owl @slender iron Note that we branched 7.1.x a few hours ago so we could do some incompatible stuff inmain for 7.2 or later, so fixes for 7.1.0 are better PR'd against that branch instead of main, so we don't have to backport. It is a bit easier to merge from 7.1.x than cherry-pick from main. Thanks.
Submitted (but not yet merged) PR to Espressif to resolve the duplicate PID check: can use 0x7005 for the nopsram variant...
Existing PIDs, changed name to distinguish psram vs. nopsram:
0x7002 | ESP32-S3-DevKitC-1-N8R2 - UF2 Bootloader
0x7003 | ESP32-S3-DevKitC-1-N8R2 - CircuitPython
New PIDs:
0x7004 | ESP32-S3-DevKitC-1-N8 - UF2 Bootloader
0x7005 | ESP32-S3-DevKitC-1-N8 - CircuitPython
(I tried to do a patch PR to this file, but got a 404)
Adafruit CircuitPython 7.2.0-alpha.0-2-g23e0a25aa on 2021-12-03; ESP32-S3-DevKitC-1-nopsram with ESP32S3
From the REPL importing the wifi module causes a reset
Just checked to be sure, and the flash command RDID returns 85 60 15 as the datasheet says it should.
CircuitPython version
Adafruit 7.0.0; issue present both on Pimoroni Keybow 2040 and Raspberry Pi Pico (with Pimoroni RGB Keypad).
Code/REPL
import time
from keybow2040 import Keybow2040
#from keybow_hardware.pim56x import PIM56X as Hardware # for Keybow 2040
from keybow_hardware.pim551 import PIM551 as Hardware # for Pico RGB Keypad Base
import usb_midi
import adafruit_midi
from adafruit_midi.note_off import NoteOff
from adafruit_midi.note_on impo...
I have not been able to reproduce your finding on mine. It still fails to detect the cards even after power cycle when using sdcardio.
Also on my pygamer, I have not been able to reproduce the wifi issue reported by @nuwaveit
If there is a difference in how the SDCards mount after power cycle vs soft reboot, should consider this a "bug".
@crimson ferry hey if you see this can you tack the "box" onto your pull request with espressif? https://www.adafruit.com/product/5290
@onyx hinge Done.
I only saw a problem when hot-plugging the SD card. If the SD card is inserted, it is fine no matter how many times I re-run the code.
Is it intended to pass a BOARD argument for make fetch-submodules?
I am getting this:
โฏ make fetch-submodules
Makefile:27: *** You must provide a BOARD parameter. Stop.
@lone axle try running in the top -level instead of in ports?
Ah, yeah I do think that is the issue. In the top level I get this:
โฏ make fetch-submodules
make: *** No rule to make target 'fetch-submodules'. Stop.
I'm guessing I have not updated my local repo properly
did you rebase your local to adafruit/main?
yep. Was on wrong branch that wasn't tracking a remote.
(I may have made that mistake myself ๐ )
I didn't. I tend to stay away from rebase because I don't fully understand it yet and am a bit scared of rewriting things accidentally.
Ah -- that sounds better. It's hard to see why the pygamer should be different that any other SDCard reader. I have not seen this issue that I recall with other boards with SDCards. I'll try a few more configurations.
I'm far from a git expert but my usual is:
git checkout main
git rebase adafruit/main
git checkout -b newbranch
Extending Native Classes
@analog bridge hey did you happen to test spi with the esp32-s3? It's not working for me (always raises an exception that says 'invalid pins', though I'm not sure that's accurate because there are a lot of reasons the function can return ESP_ERR_INVALID_ARG.
I have reproduced the SDCard issue with a Feather M4 express and an adalogger featherwing
using sdcardio
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 7.0.0-629-g102af55e0 on 2021-11-05; Adafruit Feather M4 Express with samd51j19
>>> import sdd10
Attempting to mount sd card
no sd card: no SD card
continuing
>>>
soft reboot
using adafruit_sdcard
P...
@analog bridge in fact ... a debug build sez E (27970) spi: spi_bus_initialize(762): invalid dma channel, chip only support spi dma channel auto-alloc
ah -- upgrading to latest CP now works with sdcardio on the feather m4 express.
Tested successfully with PyGamer and vacuum invaders game from the ugame learn guide.
OK -- I give up -- I rebuild CP for the Pygamer and now it is working with sdcardio on cards that had been failing.....
@nuwaveit Can you try with the lates build of CP from https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/pygamer/en_US/
use the 7.2.0 build
the display of the esp32-s3-box still doesn't configure. oh well.
time to set this aside for a bit
I got an S3-box but havenโt tried it out yet. Should have time on Monday if you want some testing/collaboration assistance @onyx hinge
Was looking at the schematic and saw some interesting devices on board that may need new drivers ๐ค
@dusk mauve nice! I hope to have a pull request put in soon that will add basic support.
haven't gotten the display to work yet, and the audio features for sure need work to support.
What kind of display IC/interface does it use? I was saving that for last during my schematic dive but fell asleep before I got to it ๐
All 3 micros we care about (S2, S3, C3) state in the documentation that DMA channel can be specified as SPI_DMA_CH_AUTO.
Specifying a specific DMA channel explicitly doesn't ever work on ESP32-S3, so no SPI bus could be used.
Testing performed: On the ESP32-S3-DevKitC, used neopixel_spi to turn the onboard neopixel red, green, and blue. However, I didn't test any S2 boards even though it "should just work".
The basics work, but the LCD doesn't work yet. Even with #5660 I didn't get the built-in display to initialize as an st7789. The audio features are expected to require more work.
@dusk mauve their BSP seems to have it as an ST7789 -- https://github.com/espressif/esp-box/blob/8fd70711a9f08d9803c807733ba46bf41af41e42/components/bsp/boards/esp32_s3_box.h#L31
#elif LCD_DISP_IC_ST
ESP_ERROR_CHECK(esp_lcd_new_panel_st7789(io_handle, &panel_config, &panel_handle));```
2.4" 320x240 ST7789 should be well-supported by CircuitPython but I got no display (all white if I turn on backlight)
I don't suppose you've had any luck with wifi on the esp32s3 devkitc boards @onyx hinge?
@woven kite I didn't actually try it yet
did you try it and have it not work? If so, please file a github issue. we need to track things that are broken so they can get fixed.
hmmm ```Adafruit CircuitPython 7.2.0-alpha.0-5-g73ee59881-dirty on 2021-12-04; ESP32-S3-DevKitC-1 with ESP32S3
import wifi
[tio 09:23:28] Disconnected
Yeah same experience here
I have some additional information from the debug port so if you'd like I can file the issue
This is actually my first dip into circuitpython and hardware in general, so that would be great ๐
CircuitPython version
Adafruit CircuitPython 7.2.0-alpha.0-5-g73ee59881-dirty on 2021-12-04; ESP32-S3-DevKitC-1 with ESP32S3
Code/REPL
import wifi
Behavior
On the REPL:
Adafruit CircuitPython 7.2.0-alpha.0-5-g73ee59881-dirty on 2021-12-04; ESP32-S3-DevKitC-1 with ESP32S3
>>> import wifi
[tio 09:24:44] Disconnected
On the serial debug console (build with DEBUG=1):
I (9913) pp: pp rom version: e7ae62f
I (9923) net80211: net...
@woven kite ^^ if you have a github account you can subscribe to the bug using the icon in the right hand column
I'm going to head out, happy I made some progress with the S3 boards but there's a lot more to do!
Great stuff ๐ Thanks!
Adafruit CircuitPython 7.2.0-alpha.0-2-g23e0a25aa on 2021-12-03; ESP32-S3-DevKitC-1-nopsram with ESP32S3
From the REPL importing the wifi module causes a reset
This is tracked under https://github.com/adafruit/circuitpython/issues/5662
I didn't know about SVD files, and I wrote my SAMD51p19.py with my eyes squared on the data sheet. Yes, I think it's possible to write a tool to generate peripheral definitions from SVD files.
As for the naming, "memoryio" may be more adequate than "ctypes", as uctypes has almost nothing in common with ctypes of CPython.
No, I erred in using the wrong VID, it should be the Espressif one if we're using a PID from Espressif. (And we should use a PID from Espressif for all new devkits they make)
@onyx hinge I haven't done much testing beyond blinky leds and a working repl on the esp32s3.
I think I may have found a fix for https://github.com/adafruit/circuitpython/issues/4867 . Do I understand you correctly that it would make sense for me to make my PR branch from 7.1.x instead of main. Or is that meant to be used in some other circumstance?
Thanks for confirming @jpconstantineau.
I agree that it would be nice to simply drag and drop the UF2 onto an SOC, or even the nrf52833, but if I'm understanding the issue properly this is being curbed by available physical memory that the default bootloader is allowed.
Thoughts?
Yes, then the fix will immediately be in the 7.1.x branch and be there when we make the next beta. Also it's probably easy to merge from 7.1.x to main, because merging the other way will bring in things we don't want in 7.1.x, so we'd have to cherry-pick. Thanks.
Will do later tonight and report back. @jerryneedell
resolves: #4867
This seems to resolve the issue. Since making this change I have succeeded with several NVM writes with both multi-byte array splices and single byte. I have not had the device hang at all since making this change.
Tested on Raspberry Pi Pico. But I believe fix applies to all RP2040 based devices.
When I ran pre-commit I noticed locally that it made some changes in ports/broadcom/qstrdefsport.h and ports/esspresif/boards/adafruit_feather_esp32s2/board.c which wer...
The actual erasing and writing is done in erase_and_write_sector(), lines 64 and 65 above. I would suggest moving the disable/enable interrupts to wrap those two lines instead, since that's at the lowest level and will work for any use of that routine. You can see similar disable/enable code in ports/raspberrypi/supervisor/internal_flash.c, which does that wrapping around.
implemented this change in the latest commit. Also had to add the disable / re-enable to write_page() since that gets called in the case where nvm was previously filled with 1s before writing. I confirmed that it could still hang when it had all 1s in nvm before writing.
I tested the newest version successfully on Pimoroni PicoSystem
Disable interrupts only as long as necessary.
common_hal_mcu_disable_interrupts();
flash_range_erase(RMV_OFFSET(CIRCUITPY_INTERNAL_NVM_START_ADDR), FLASH_SECTOR_SIZE);
Sorry to be nitpicky: let's protect only those lines that really need to have interrupts disabled, by doing it for the minimum amount of time.
common_hal_mcu_disable_interrupts();
flash_range_program(RMV_OFFSET(page_addr), buffer, FLASH_PAGE_SIZE);
common_hal_mcu_enable_interrupts();
Can move this down to turn off interrupts only on the actual flash operation. The memcpy() doesn't need to be protected.
No worries. Thank you for the review. Updated with latest commit to wrap only the flash related calls.
OK, using the 7.2.0 alpha build didn't make any difference. I have 1 old SD that consistently won't read, but that's OK. All my other SDs read. The Wifi does not work no matter which card is in there, and no matter which SD library is used. But I did get slightly different errors at one point when testing with my SD cards out of my raspberry pis:
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
ESP32 SPI webclient test
Attempti...
Looks great, thanks for the fix and for your patience!
Happening for me also on Metro M4 Airlift lite using 7.1.0-beta.1. Exact same error as previous comment. It's using the code from: https://learn.adafruit.com/adafruit-metro-m4-express-airlift-wifi/circuitpython-ble I did a direct copy/paste into MU.
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
File "code.py", line 50, in <module>
File "adafruit_airlift/esp32.py", line 193, in start_blu...
Reproduced on ESP32-S3 Box as well.
Smoke-tested on an S3 box. Also smoke-tested Metro ESP32-S2 build, still works.
Is it desirable to go back and change the Adafruit VIDs to Espressif VIDs in prior Espressif boards (any harm in changing them after the fact)? If so, I can track them down and do a PR.
I don't think so but maybe @dhalbert has an opinion about changing to an Espressif VID/PID for older espressif devkit.
hmm i will try to disable clock stretching on the attiny too (if i can!)
Saola and Kaluga are self-consistent: Adafruit VID and PID), so probably no strong reason for change.
I did notice checking just now though that the Kaluga 1 and Kaluga 1.3 have the same USB_PID = 0x80C8
and USB_PRODUCT = "Kaluga 1", though they have different firmware. I don't think this would pass the current build check.
Another possible quirk: there are two version of no-PSRAM ESP32-S3 in the store:
โข PRODUCT ID: 5311 ESP32-S3-DevKitM-1-N8 - ESP32-S3-MINI-1 Dev Board - 8 MB Fl...
Been working on this one for a while.
USB PID/VID from OpenMoko.
https://github.com/openmoko/openmoko-usb-oui/pull/34
The new IS31 module gave me a headache but with some git disect, I was able to find the CIRCUITPY_IS31FL3741 define needed to make it build.
Tested Neopixel and it works fine in CP but the board_init and board_deinit code doesn't seen to turn on the Neopixel power and I don't see the expected blinky behaviour when booting up. I would appreciate a second set of eyes on t...
I just got my new custom board to compile and get flashed to my custom hardware (just did a PR for my BlueMicro833). It appears that CP doesnt need the second command to get CP running on the board. The first one (make V=1 BOARD=pca10100 sd) seems to flash to the board and it loads fine. With the exception that the bootloader seems to be gone and I can't enter in it anymore (doing the double-reset dance).
Looking at the nrfprog docs, do we need nrfjprog --eraseall -f nrf52 at all? ...
I've tried with a Lenovo T410 Notebook. Sadly a keypress from the device completly locks up the BIOS. Even the normal keyboard is not working anymore. This happens at the time where the first keypress is send from the CP-device. Just connecting the CP-device does not trigger this issue.
Every following keypress then gives an "error" sound from the bios, no matter if its from the CP-device or from the notebooks own keyboard. In normal mode this sound is played if you press a key which has no ...
I think that right now the Adafruit PIDs are only documented internally.
I used a duplicate PID for the newer Kaluga board in this PR, perhaps it did not receive sufficient review: https://github.com/adafruit/circuitpython/pull/4870
I don't think so but maybe @dhalbert has an opinion about changing to an Espressif VID/PID for older espressif devkit.
I don't think it's much of an issue. Mu no longer depends on VID/PIDs to identify boards. The new VID/PID will cause Windows 10 to install a new device, but that's fine.
I've tried creating a boot.py file that delays running code.py, disables USB_HID and enables usb_midi, but this had no effect. I have also tried plugging it in to an old Intel iMac running El Capitan, and it doesn't mount on that either.
Delay in boot.py won't really change USB startup, because the device doesn't present as USB until boot.py has finished running. Have you tried just inserting a several-second sleep at the beginning of code.py?
Try a really minimal example that just ...
I tried a build with picolibc on my itsybitsy_m4_express. It doesn't boot.
(I am also building with INTERNAL_LIBM = 0 instead of editing libm files)
The picolibc build doesn't have the exception table @ 0x4000 (tinyuf2 doesn't exit the programming session at all)
- created a .bin file that was waaaayy too big (related to the above item?)
Adding the ENTRY(Reset_Handler) fixed this, I have seen this before when the linker assumed my code started @ 0x0 but some things were explic...
Fixed by #5663. Please try, and let us know. Note this fix is not in "Absolute Newest", because of git branches. Try the artifacts from https://github.com/adafruit/circuitpython/actions/runs/1540091742#artifacts.
Auto-reload should not be triggered if the board is not connected to a host, so this is odd. What kind of battery arrangement were you using? What behavior did you see that it was auto-reloading on battery?
As I mentioned, this should not happen at all, if you are not connected to a host.
A usb "power pack" can require a certain amount of power to be drawn to stay on. Testing with a simple 5V AC adapter or charger would remove that possible issue.
Closing this for now, because I th...
Some other interesting info in the map file (picolibc.ld)
Memory Configuration
Name Origin Length Attributes
flash 0x0000000010000000 0x0000000000010000 axrl !w
ram 0x0000000020000000 0x0000000000008000 axw !rl
*default* 0x0000000000000000 0xffffffffffffffff
FLASH_BOOTLOADER 0x0000000000000000 0x0000000000004000 xr
FLASH_FIRMWARE ...
hello. i'm a relatively new user of circuitpython, recently crossing over from my long, long time with arduinos. i would enthusiastically appreciate this feature!
This appears to be some kind of initialization problem. It works the first time:
Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit Feather M4 Express with samd51j19
>>>
>>> import board,frequencyio
>>> frequency = frequencyio.FrequencyIn(board.D11)
>>> frequency.value
529
>>>
soft reboot
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Hello World!
Code done running.
Press any key to enter the REPL. Use CTRL-D t...
I suspect the workflow on this PR is essentially stuck forever: https://github.com/adafruit/Adafruit_CircuitPython_PyBadger/pull/54 should it be cancelled instead of waiting for github actions to notice and I assume stop it eventually?
part of the code that was added with that PR is a while loop to try_lock() the i2c bus here: https://github.com/FoamyGuy/Adafruit_CircuitPython_PyBadger/blob/346e8d35428cdbb07cc314c118cb622ffcf0410d/adafruit_pybadger/pybadge.py#L67-L68
while not i2c.try_lock():
pass
It seems like sphinx is trying to execute the code and getting stuck in an infinitely loop because try_lock() is never returning true. If I comment those lines out the sphinx build does run normally locally.
I took that code from the I2C scan example in the essentials guide. Is there a different way that libraries should be coded to attempt the i2c lock? Perhaps only try a few times instead of infinitely with the while loop? Or alternatively is there some way to tell sphinx that it needs to ignore those lines or something like that?
when running locally it gets stuck on "reading sources":
that seems like a problematic thing for Sphinx to do since it has no idea what the referenced function does
I think this post is describing similar root issue https://stackoverflow.com/questions/37818923/running-sphinx-html-make-gets-stuck-after-reading-sources
Hello, Is this https://learn.adafruit.com/ulab-crunch-numbers-fast-with-circuitpython/a-simple-benchmark a good benchmark for testing different c libraries?
I got it working, with this. No other changes needed. (-T instead of -Wl,-T)
--- a/ports/atmel-samd/Makefile
+++ b/ports/atmel-samd/Makefile
@@ -199,7 +199,8 @@ endif
-LDFLAGS = $(CFLAGS) -nostartfiles -Wl,-nostdlib -Wl,-T,$(GENERATED_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs
+LDFLAGS = $(CFLAGS) -nostartfiles -Wl,-nostdlib -T$(GENERATED_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections --specs=picolibc.specs
LDFLAGS += -flto=$(shell $...
Some additional information:
I hooked up my JLink and configureg openocd using the raspberrypi_pi4.cfg file
It connects, but The code just does not appear to be running
Are you sure you want to change the file? (y or n) y
Reading symbols from kernel8.elf...
(gdb) cont
Continuing.
^Cbcm2711.a72.1 halted in AArch64 state due to debug-request, current mode: EL3H
cpsr: 0x000003cd pc: 0x200
MMU: disabled, D-Cache: disabled, I-Cache: disabled
bcm2711.a72.2 halted in AArch64 state du...
This is the only example of bench-marking things in circuitpython that I am aware of so I'd say it is probably as good as anything at this time. To some extent it may depend a bit on what the c libraries are actually doing though. The benchmarking could probably be tailored to some extent for differen types of c libraries.
Fixes #5643.
FrequencyIn was assuming it was started cleanly. But in the case of a VM restart (e.g. soft boot), some resetting needed to be done.
Hmm, non-debug version does not work... Continuing on this.
I'm curious what i'm missing?
make: *** No rule to make target `py/emitcommon.c', needed by `build-odt_cast_away_rp2040/genhdr/qstr.split'. Stop.
wait... i see what it is...
for some reason when I made a new branch it deleted it...
i have... no idea why the branch deleted a bunch of files.. so strange..
This PR is to add the Oak Development Technologies Cast-Away RP2040. All should be in order.
PID.Codes PR for VID/PID Here
Ran precommit locally and it checks. I think everything else is in order.
only 1000 more pull requests and we'll be at 6666
- Fixes #5556. May also fix some mysterious other PWM problems.
In RP2040 PWM, the term channel is overloaded. Sometimes it means one of two channels (A or B) in a slice, sometimes it means one of 16 PWM output channels, and sometimes it is another name for slice (of which there are 8).
It appears we used an AB channel number when we meant to use a slice number. This caused #5556.
I renamed some uses of the word channel, when it meant an A or B slice channel. I renamed those ch...
Dan, can you look at this reply to our PID request and see what you think? I'm not exactly sure how to articulate the threshold for re-using vs. new. We have a build check for each unique board. https://github.com/espressif/usb-pids/pull/29#issuecomment-986378221
I think CircuitPython cares less. Arduino does use the VID/PID to distinguish the boards for setting purposes.
I asked Limor about this but our internal Slack made it disappear: it was more than two weeks ago - grumble, so I can't remember her exact reply. Something like: "they are free"
but if Espressif is worried, we can scale back
I've only asked for UF2 Bootloader and CircuitPython, no Arduino.
black just got updated, and I had to fix the formatting on a couple of test .py files.
@tulip sleet, do we need the build check for unique PID on each board build?
hmm, good point, that will catch this
mu I think used to use that for checking what board was connected but not so any more.
yes, we changed that, because it was a lot of work to keep the list up to date
and we could ID the boards by the Interface name instead
board_id?
by the USB interface name presented to the host
"CircuitPython USB CDC"
we can discuss this tomorrow in the meeting
OK, sounds good, thanks.
0x7*** still allows for 4096 PIDs. They use 0x8*** for 3rd-party boards. I'd assume the other 14 PID first-digits on their VID are RFU.
Hi, can you please help to add this new board?
https://www.cytron.io/maker-nano-rp2040-simplifying-projects-with-raspberry-pi-rp2040
Thanks.
May I know what's wrong with my PR causing the test to fail?
It seems like the files that causing the fail is not from my PR.
May I know what's wrong with my PR causing the test to fail? It seems like the files that causing the fail is not from my PR.
The failures are due to a new version of black being used to check the formatting of .py files in the source tree. There are some minor spacing changes it wants. I added these changes in #5667 but if that is not going to be accepted right away I can make a new PR that is just the spacing changes, and that should get approved quickly. I will check with the othe...
Your PR is otherwise fine, so I don't see why the formatting issues should hold it up.
Note that this PR is against main. We have now made a branch, 7.1.x, so this will not get into 7.1.0, but will be in the 7.2.x series and later. If you want it in 7.1.x, could you make a PR against 7.1.x? It could just be a cherry-pick of the commits here.
An update to blacken caused some .py scripts to fail precommit due to extra blank lines.
An update to blacken caused some .py scripts to fail precommit due to extra blank lines.
Note that this PR is against
main. We have now made a branch,7.1.x, so this will not get into7.1.0, but will be in the 7.2.x series and later. If you want it in 7.1.x, could you make a PR against7.1.x? It could just be a cherry-pick of the commits here.
Ok noted. Will do.
Thanks a lot.
Hi, I would like to add this board to v7.1.x.
https://www.cytron.io/maker-nano-rp2040-simplifying-projects-with-raspberry-pi-rp2040
It's already merged to the main in PR #5668
Thanks.
I'm sorry, it should be base on v7.1.x branch instead of main.
yay I figured out why the display on the esp32s3 box wasn't working, I'd forgotten to specify the display reset pin
@tulip sleet If I understand correctly... any bug fixes should go in 7.1.x and will later on get merged into main or separate PRs need to be made for the two branches?
Yes, it's much easier to merge from 7.1.x to main. But if you are fixing things due to the ESP-IDF upgrade, then we will just do that on main. We won't backport the IDF upgrade to 7.1.x. We tagged 7.2.0-beta.0 (but will not release) in prep for the next series of betas after 7.1 final
Would you mind re-revewing #5670 and also reviewing #5672? There were some uncrustify changes worth including as well Thanks.
okay... regarding #5672, instead of merging it into main, can we include that fix with the 7.1.x merge since the uncrustify fix isn't causing pre-commit to fail
sure, I will just close it
Closing, will wait for merge of #5670.
Hi, I would like to add this board to v7.1.x.
https://www.cytron.io/maker-nano-rp2040-simplifying-projects-with-raspberry-pi-rp2040
It's already merged to the main in PR #5668
Thanks.
this is odd .. I have in board.c: common_hal_displayio_display_construct(display, ..., /* backlight_pin /* &pin_GPIO45, ...); but CircuitPython doesn't activate the backlight. In the repl, I can activate it with PWM or as DigitalIO. Assigning board.DISPLAY.brightness does nothing. So after startup, doing this at the REPL turns the LCD backlight on and it operates until I hit ctrl-d: ```>>> microcontroller.pin.GPIO45
board.LCD_CTRL
p = pwmio.PWMOut(board.LCD_CTRL)
p.duty_cycle = 65535
this is the esp32s3-box
shouldn't constructing the display "take over" the passed in pin?
is this related to the issue deshipu was having as well with backlight? Interesting it's on the ESP32-S3, I think deshipu's problem was on atmel-samd. Maybe it's a general problem with displayio
I suppose it could be somehow related ...
particularly the later comments
If I initialize the display via python display = ST7789(bus, width=320, height=240, backlight_pin=board.LCD_CTRL) the backlight works including when I ctrl-d...!
is that display long-lived
it disappears on ctrl-D, right? it's like some pin ownership problem
no, if I initialize it from code.py it continues working including the backlight
.. after ctrl-c'ing to the repl or whatever
sooo if I put the display init in a different function and run it a bit later, it's OK. in main.c: ```c
// displays init after filesystem, since they could share the flash SPI
board_init();
// Reset everything and prep MicroPython to run boot.py.
reset_port();
// Port-independent devices, like CIRCUITPY_BLEIO_HCI.
reset_devices();
reset_board();
- board_display_init();
that positioning makes more sense. The reset_ lines do a lot of cleanup including resetting all the PWM stuff
it would be a bit of a pain to change that for all boards though ยฏ_(ใ)_/ยฏ
I was just looking at this yesterday when debugging #5665
I wonder why it appears/appeared to work for others.
I looked at pygamer, there's not an explicit 'never reset' for its backlight pin
maybe it's worth putting in some print statements to track when the PWM is initialized, etc.
the pin is still not properly 'claimed'. If I try to put PWM & digitalio on the same pin from the repl, it balks as expected:```python
p = pwmio.PWMOut(board.G11)
d = digitalio.Di
DigitalInOut Direction
d = digitalio.DigitalInOut(board.G11)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: MOSI in use
but I can 'take over' the display's backlight pin, which messes it up until hard-reset:python
board.DISPLAY.brightness = .25 # makes display dim
d = digitalio.DigitalInOut(board.LCD_CTRL) # makes display go black
d.switch_to_output(True) # display goes on again
there's clearly something wrong with managing the state of these things
I'd say open a clear issue, and maybe you will feel inclined ๐
Should I be concerned about the test that failed?
@lone axle Do you need the cell anchor point PR tested? Or are you pretty confident about it. (I will test the PyBadger PR on an LC)
I am pretty confident with the cell anchor point one. Thank you
Keen.
Hi,
Please help to add this new board.
https://www.cytron.io/maker-nano-rp2040-simplifying-projects-with-raspberry-pi-rp2040
Thanks.
This involves also fixing some problems with pin & pwm busy & never-reset tracking.
Before these changes, the PWM created during board_init() was lost, making the display not appear (backlight turned full off).
Now, the display is initialized at boot time and all the related pins remain allocated as far as attempts to construct a DigitalInOut using them are concerned.
@dhalbert wondered whether this could be related to #5476 but as the fixes I found were entirely within the port,...
Note that trying to use this LCD with adafruit_st7789 yields a reversed display. :shrug: there's an inversion control register setting made in the library's setup string that I simply deleted.
@tannewt I agree, I think our best bet is to switch the getting started link to a page on circuitpython.org that then links out to pages like this and the learn guide. I'll work on a mockup and share here. Maybe you could start putting together a page including all of the things you think we should include on the getting started page to help me make sure I don't miss anything?
@tidal kiln Opinion time. On the KB2040, would you include SCL/SDA as touch pins, even though they're only on the STEMMA QT connector? You could easily attach a cable to it to use the pins, and there's not a dedicated I2C device on the board.
I feel like yes, but you always have excellent counter opinions.
hmm. let me look at schem.
Ok
they have pullups
yah, i think so
@tulip sleet do you understand how black changed? I thought pre-commit was supposed to ensure that the dependencies stayed at the same version.
or is it the version of black from requirements-dev.txt, which we didn't pin
the pre-commit run is done by a script, not with black directly
yeah so from requirements-dev.txt, I think
I see. makes sense, slightly unfortunate.
unlike the libraries
Right that's what I thought.
Discord crashed. ๐
when I ran pre-commit locally, it also had uncrustify complaints. I don't understand why those are not showing up in the CI runs, though
Ooh I think I can do all of the CP Essentials templates without soldering this KB2040. ๐
@idle owl oops, just realized now I am doing the meeting. Not a problem, but was I maybe going to trade for later in the month, or is that separate?
Hah, been there. That was me last time I ran it. Completely forgot until a half hour before. Jeff asked for a trade, but I was already going to ask for a trade for that exact day, so I took it.
I guess if there was any trading it would be with Scott for 12/27
and he is not here today anyway
I would actually offer to trade you for the 20th, but today is apparently the quarterly fire drill for the building. Sometime between 9am and 5pm. Sigh.
So I don't want to have a fire alarm going in the background of the meeting.
wouldn't you have to leave anyway, because it's a drill?
Apparently not? that's what's weird.
They do it to make sure the system and the elevators work I guess.
a "test", not a "drill", i guess
Yeah they named it badly.
They do a lot badly here.
The elevators go to ground and stop working during an actual fire, apparently.
They test the alarm monthly.
But this is bigger.
But they did not say "evacuate when drill happens" so I'm not leaving.
that makes sense, the firefighters have a special key so they can work the elevator during a fire
Right.
@tulip sleet To that end, if it's going off during one of my things (i.e. Libraries section, my hug reports or status updates), I'll let you know to read it off. You don't have to remember my whole spiel for Libraries. You can simply read what's there. ๐
@tidal kiln Sigh.... thwarted.
I thought I fixed the script to report that.
Apparently not.
Oh, my original did. My updated version did not.
I was going to merge them and never did.
worked! thanks
I was like, why isn't this code working right? Oof...... Adafruit CircuitPython 5.3.0-1-gdd53e9a2b on 2020-07-10; Adafruit Circuit Playground Bluefruit with nRF52840
Maybe that's why, Kattni.
Yeah update fixed it.
This and others in Kattniโs coding adventures!
I have similar fun problems at work like forgetting to update a dependency
In other news, nope. I have to add pulldowns to the touch pins, which means soldering it up. ๐ฆ
I mean I could fake it badly for testing, but I have to include an image in the guide so..... yeah. Kinda need it to look proper.
@tulip sleet @onyx hinge I was going to make an In The Weeds topic for USB PID, but looks like we can handle it in the GitHub PR comments? (I also think there's a broader design discussion at a later time about the purposes and degrees of uniqueness for various board identifiers.... user-facing, build-facing, code-facing, host-facing)
Sure
@crimson ferry whatever way works best for you. fwiw I have one of the nopsram variant boards on the way, I am also interested in finding out whether we can dynamically figure out if psram is present and then reduce the number of builds..
I think with some small rework I just did it may "just work" but I don't have a way to test
๐
I am set up to do a backup recording
regularly scheduled meetings coming up: December 13, 20, 27; January 3.
Putting it In the Weeds.
CircuitPython Weekly for December 6th, 2021 Welcome to the CircuitPython Weekly meeting notes! Feel free to add your Hug Reports and Status Updates early. During the meeting, we go through them as a round robin sorted by username. If you canโt make the meeting and would still like to participa...
To my knowledge, we support two "chips" with risc-v: fomu (which is an fpga with a soft risc-v cpu loaded on it); and, just recently the espressif esp32-c3 (boards by name: ai_thinker_esp32-c3s and microdev_micro_c3)
belated hug report for jerryn testing alongside me with the sd cards
๐ช
create_and_get_feed ๐ค ๐ก
Might not be called that, but that's the idea.
I think it's great! not questioning the name, either
๐ Hooray for me finding the error. Broke my Feather, fixed it, and immediately verified I could break it again. ๐
Fair enough! Thanks. ๐
IS31FL3741 - LED driver.
Yes
yeah IS31FL3741 but I get tired of typing the full thing ๐
I wrote the guide. I agree entirely. ๐
IS<something, something>41
@idle owl Forgot to ping you as I got it going yesterday - the IS31 pixelbuf thing seems to work perfect with the LED animations as is!
That's good to hear!
I verified that the aarch64 toolchain from arm.com [https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads] uses python2 in its gdb. I wonder if scott is using the one from his Linux distro, which is based on python3 [https://aur.archlinux.org/packages/aarch64-none-elf-gdb/]
@idle owl my calendar's not showing that we were swapping the 13th & 20th .. were you waiting for me to change it, or was I confused? I think you had agreed to take the 13th from me
I just hadn't gotten to it. Yeah we swapped.
I can take the 27th from Scott if it's a problem
thanks
Fixed!
Thanks!
I'm heading out for now. ๐
I need to head out as well. Later folks!
Thanks all!
Tried disabling CIRCUITPYTHON_USB_MSC in mpconfigport.mk but it did not change the behavior :-(
@lone axle Hey! Do you have a few minutes to chat? If not, no rush. Please ping me if/when you do.
Yep I do.
Great. So here's my idea. Part of the issue with the existing PRs across the libraries is someone to actually test them. A TON of them are super old, and will need a lot of work. Some of them simply need to be closed. I'm wondering if you're interested in going through the list of library PRs on circuitpython.org/libraries and seeing what's what. Jose David went through it not that long ago, but he doesn't have the permissions you do to deal with fixing things where needed or closing PRs if it makes sense. You don't have to make that decision on your own, obviously, we can make those decisions together. But! You are now in a position to get the hardware where necessary, and can make changes to PRs if that makes sense.
You also don't need to do this all at once.
A one or two a week even would be a good start.
@lone axle What do you think? You're welcome to decline as well. ๐
I even have a list from Jose David of where things were at when he created the list. And his thoughts on what was needed. There have been changes since, but it might be worth a look still. https://github.com/jposada202020/PR_CP/blob/main/list.md
Have had that open in a tab since he sent it.
@idle owl Sounds good to me, I am up for doing that. I was actually just looking through some the other day and found some in need of pre-commit run. On ones like that, if the original user allowed maintainers to push to their branch. And they haven't responded in a little while since being asked about it, should I go ahead and run pre-commit and add a commit to the PR branch so that it can move along to getting a full review.
Yes, that's a great idea. That's exactly what I'm thinking. I feel like you can push to a PR regardless of that allow maintainers thing. Or you can at least pull changes into a new PR, and the commits are still attributed to the original user (Tekktrik has done this multiple times).
You can let me know when you find one you think should be considered for closure, or if you have any questions along the way.
Yep I know how to do that as well so I can do that on any if they do prevent me from pushing.
Excellent.
@lone axle Thanks so much! This should be good. I would like to see us catch up. 68 isn't a ton, but there are some that are ancient, and I hope we can get caught up with that and then try to stay on top of things better.
Whatever cadence works for you is fine with me.
Yep you're welcome. Happy to help out where I can to catch up!
crumbs, updating my kaluga has left me with the camera not working. this was with the idf4.4 version, trying going back to 7.1.x..
it hardfaults during initialization of the camera
the 'watchdog reset' that doesn't make it enter safe mode
not strictly speaking a hardfault
Here is the notes document for Mondayโs CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if youโll be attending the meeting - itโs super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and weโll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/1Bwnt-pbFcrfo1gn_tH4L0HXkMXZbcqG5eoAOfPK1xco/edit
CircuitPython Weekly for December 13, 2021 Here is the notes document for Mondayโs CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if youโll be attending ...
I don't suggest freezing in libraries unless you need to save RAM later. The RP2040 has plenty, so I'd leave the neopixel library out.
Thank you! This will be in 7.2.0
Thank you! Agreed that the term "channel" is overloaded.
I think @kattni would have good ideas about what to put on a "getting started" launch pad page too. I certainly think the "Getting started with circuitpython" and "circuitpython essentials" guides should be linked.
We could probably have the class load the SVD itself rather than needing to generate an intermediary. This repo is a great collection of svd files: https://github.com/posborne/cmsis-svd
@idle owl hey. i think it's been many months since i've done a CP lib release. anything new to it? just wanna/merge release this:
https://github.com/adafruit/Adafruit_CircuitPython_LTR390/pull/13
Nothing new. Merge PR. Click on releases. Increment the tag, put the boilerplate in there, release. Done.
cool. thanks.
no, more likely it's the good old "enabled jtag, so turning on the camera [which shares pins with jtag] scrambles the microcontroller state but good"
which I forget every time I do it to myself
@tulip sleet I usually turn off public editing, and leave editing available to the four of us on the old notes doc, BTW. I guess it really doesn't matter.
I'm also experiencing this issue with the MagTag and Google Calendar. Both on 7.0 and 7.1.
Thanks for trying! I think it'll require some printf debugging to see if it makes it into circuitpython at all (it should.)
Thanks for getting this going!
Twice now I tried to turn off "edit with the link", and it turned off my access too. So I couldn't change it back, since it's owned by someone else.
OK, I'll get a screenshot next week if I remember of where to change it.
You're simply changing it in a different spot than you should be.
I hit "Change" here:
and changed it to "View"
(this is from the Dec 13 one, I didn't change it, of course)
I think it is because I was not listed explicitly on the template, so whenever the template was copied by someone other than me, I did not get person access, just link access. I just added myself as an editor on the template.
so that should fix it
Fair enough. We'll find out!
This build error is a bug in our tooling. I'll try and rerun your build. That may fix it.
Thanks Scott! ๐
np ๐
@DaftVagabond Thanks for the info. What is the base frequency of the PWM? Do you need to measure individual pulses or could you use a different technique to measure the average? You could filter the signal and read it as an analog value. If the pulse frequency changes you could use countio to measure how many pulses happened.
I think filtering and reading as an analog value would be a good option. The list never gets any longer than index zero with the default code for reading pulses.
...
Getting some odd build failures on the PR I made. Is this a github issue or an action issue or something else?
I'm looking into it now
it's a weird bug that happens if you edit a file on github
@solar whale Eliminates all of the feed setup lines, and the send_io_data helper I wrote. py io.send_data(io.create_and_get_feed("test-feed")["key"], temperature)
Creates the feed if it doesn't exist, sends to it once does, or sends if it already exists.
Excellent! Thank you!
I'll PR it tomorrow and tag CPLibians. I'd appreciate having it tested. ๐
Sure. Be happy to test it tomorrow.
Thank you!
By the way, I am trying to track down the elusive requests issue with the MagTag Google Calendar now.
@lone axle While I'm remembering it, the mag_tag.py file in PyBadger should have been named magtag.py. I'm not sure how much it will break to rename it but it's worth considering. I didn't see it go by to begin with. Sorry about that.
Heading out for the night. Have a good one, all!
I can work on changing it and finding usages in examples and learn. I don't think are too many.
Ah right. Sounds good. Thanks!
can't printf debug when printf is broken
This brings the board count from 254 to 256 by adding variants such as the Pink Feather RP2040, which was accomplished by adding an alias feature. It also brings the blinka boards from 77 to 86 because of the U2IF support.
mm im a little unsure about the pink feather rp2040 separate - especially as soon we will only have pink (switching out black)
(I spotted the issue in the code. Now printf works)
I figured since we had variations already (such as https://circuitpython.org/downloads?q=Circuit+Playground) and it's a different PID, I would stick with the theme. I can remove it though.
Blobless clones look very interesting. Maybe that is the solution for the big broadcom repo??
yup, I'm thinking that for CP too potentially
might be able to combine it with shallow too: https://github.com/adafruit/circuitpython/pull/5653/commits/d7822879ea0f89843491f22a105c37fa253cf131
yes, that too. Is it an option in the checkout action, I wonder?
clone and fetch I think
the article seems to recommend blobless over treeless for what we need, since we may need to find a certain tag?
also there's that submodule fetch warning, though it sounds like we just need to not recurse; fetch the submodules separately
I bugged the blog author on twitter about adding actions/checkout support
yah plz remove - thank u ๐
@solar whale I fixed the pi4 by adding the .dtb files to the sd card I think
Sounds great. I donโt know exactly what that entails but it sounds encouraging!
in the firmware directory there are a bunch of .dtb files
<@&356864093652516868> I figured out what the issue is with the MagTag examples. It's the combination of Google Auth having its own request object with sessions that create sockets that will be "locked" to that session, and then MagTag/PortalBase trying to clean sessions but failing because there's still sessions in the pool. I am not sure if I can submit a PR for this, but maybe Melissa sees this?
they need to be on the sd card too
though I did fix a build thing too...
maybe that was needed too
.dtb files are kind of important ๐
Ah. Ok. Iโll be patient and wait for a PR
it's pretty simple
CHIP_VARIANT = "bcm2711" in mpconfigboard.mk
(adding quotes)
though zero2 doesn't have them
zero2 style may be the default
Ok. Iโll try that tomorrow. So use โ for now
ok, np. thanks for testing it!
the boot process is different between the cm4 and the pi4
I started reading up. It is complexโฆ
this works for my pi4
Great. Thanks. I can give it a try in a little while.
no rush. will have a PR with this fix and full uart support before I call it a night
figured I should look at this before finishing the learn guide ๐
Thanks for pressing ahead with it!
๐
Woohoo! It works!!
no fb
Adafruit CircuitPython 7.1.0-beta.1-27-g19211390d-dirty on 2021-12-06; Raspberry Pi 4B with bcm2711
Board ID:raspberrypi_pi4b
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Code done running.
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 7.1.0-beta.1-27-g19211390d-dirty on 2021-12-06; Raspberry Pi 4B with bcm2711
>
> >>>
>
> ```
This adds PL011 UART support which is more plentiful.
It also:
- Fixes PI4 build by including .dtb files on the SD card.
- Enables the activity LED as the status LED on PI4 and CM4 I/O.
- Adds that LED as board.LED.
Fixes #5650 and progress on #5629
Built locally and tested on RPi 4B -- Boots to REPL!!
Thanks to @jerryneedell for testing. The logic looks good to me, but I did not test.
Good grief, 13k file changes everytime they change something?!

FYI -- here is a dmesg output --- not seeing CIRCUTPY drive... not sure if it is expected ...
[Mon Dec 6 21:55:58 2021] usb 3-3.4.3: new full-speed USB device number 38 using xhci_hcd
[Mon Dec 6 21:55:58 2021] usb 3-3.4.3: New USB device found, idVendor=2e8a, idProduct=f001, bcdDevice= 1.00
[Mon Dec 6 21:55:58 2021] usb 3-3.4.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Mon Dec 6 21:55:58 2021] usb 3-3.4.3: Product: Raspberry Pi 4B
[Mon Dec 6 21:55:58 2021] usb ...
@makermelissa This issue is just an issue with the example. I have traced through the code and discovered:
- There can only be one
socket_poolperwifi.radio - Initializing the radio twice isn't helping
- The fix can be done entirely in the code using these libraries
My only minor gripe is that I have to load secrets inside my code. It would be great if there was a public accessor or a way to pass the secrets through MagTag into PortalBase and NetworkBase. That way they...
and then GitHub dips
WooHoo! I can even blink the LED
The logic for SAMx5 boards without crystals was not complete, and the setting logic was mixed up a bit with the crystal case. Redid reference oscillator setup. Tested on Metro M4 (has crystal) and ItsyBitsy M4 (no crystal).
Hi, I am having pstack exhausted error. I want to increase pystack size. Can you please add pystack_size for pico? (This is my first PR, I don't know if it is the right place.) adafruitforum
Hi Dan,
Thank you for your help. I had a play around yesterday evening and I have narrowed down the problem.
I tried with and without a dock, with different cables, and then I started playing round with the code. The Keybow midi example from their GitHub worked fine, and mounted without issue. So that ruled out it being a general library issue as my code uses the same libraries and builds on that example.
So I started adding more bits from my code until it stopped working.
If I...
Parsing SVD files may be a bit harder for MCU, I think. (The size of ATSAMD51P19A.svd is 1.7 MB.) I have just finished a crude version of the SVD converter:
https://github.com/t-ikegami/WioTerminal-CircuitPython/tree/main/ATSAMD51P19A
Many thanks for the information about SVD files.
I first tried the python tool on the link you have pointed out, but it didn't work for ATSAMD51P19A. It seems unable to handle arrays in a cluster correctly, namely the PORT peripheral. The tool above use...
@gilded cradle Are there docs on how to use the new aliasing feature? I have several hardware boards that use the exact same CP build and would rather alias them to a single build with docs on each board compared to having a common download page that documents all permutations. (keyboards with 18, 44, 61 and 87 keys - all mapped out to Pykey60)
This is a support issue. Please open a thread in https://forums.adafruit.com/viewforum.php?f=60 or ask for help in #help-with-circuitpython in discord: https://adafru.it/discord. As noted in the forums: "Please be positive and constructive with your questions and comments."
The ESP32-C3 datasheet lists GPIO8=0 and GPIO9=0 combination as invalid but I consistently get the following result with this boot combination:
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x1 (POWERON),boot:0x0 (USB_BOOT)
wait usb download
If anyone has an ESP32-C3, can you check for this behavior.
I know I'm late for the holiday, but I've got a menorah that uses ESP32 to get time as well as use an API to figure out candle lighting times. More pertinently, @tulip sleet I'm going to use asyncio to have it flash the lights while connecting to the network. It's still WIP but didn't know if you were looking for examples of asyncio implementations. Excited to test it out once I wire everything on the breadboard!
Debating using asyncio for making the lights flicker at varying rates but may just stick to on/off
Very intereresting. We don't have a non-synchrous version of the network fetching, so it may stall when fetching the data. But if it's only on startup, it doesn't matter too much. In the long run we want to provide something like aiohttp. There is a low-level stream impl for networking in the asyncio library but I haven't tested it.
I am not sure you really need asyncio here, because the fetch does not need to be interleaved with the lights.
Will the aliasing feature be documented? I have been trying to figure out how it works and see if it matches my case.
Pykey60 is a keyboard with 61 keys that runs a RP2040. Other keyboards I created uses the exact same CP build and pin definition but uses a subset of the rows/columns for the keyboard. As such, I was planning to have a single build but for multiple keyboards.
Will the aliasing feature of cp.org allow multiple pages to document the board but all point to the same CP build...
Got it. I have it set for multitasking flashing the lights while it connects to wifi and then connects to an NTP server so I'm curious if either of those will cause it to stall.
The asyncio is for doing a loading-like animation with the lights, kinda like a loading bar, if that makes sense? So I'd like to manipulate lights while other things are happening, but let me know if that's not intended use.
I can share the repo if you'd like to take a look
Hi, you are merging 7.1.x into main, which caused the extra commits. Could you make a separate branch and submit a PR either against 7.1.x or against main? This guide gives you help about how to submit PR's to CircuitPython: https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github
The asyncio is for doing a loading-like animation with the lights, kinda like a loading bar, if that makes sense? So I'd like to manipulate lights while other things are happening, but let me know if that's not intended use.
That sounds like a fine application for that.
Sweet! Thanks!
Will the aliasing feature be documented? I have been trying to figure out how it works and see if it matches my case. Pykey60 is a keyboard with 61 keys that runs a RP2040. Other keyboards I created uses the exact same CP build and pin definition but uses a subset of the rows/columns for the keyboard. As such, I was planning to have a single build but for multiple keyboards.
Will the aliasing feature of cp.org allow multiple pages to document the different boards but all point to the...
See https://github.com/adafruit/circuitpython-org/pull/805/files#diff-e1b6f641479fad99434e07f34f60e7ab692ab7078f4d5c1b9e710cc0f5c4c257R4. I just created a line with board_alias that links to the board_id of the cp build I'm trying to link use.
Thanks That's an easy way of doing it!
๐ That's what I was going for.
it does mean that the downloaded file will not have as specific a name as for other boards (if I understand the PR correctly), but that shouldn't be an issue, and it beats tinkering with that one list lost somewhere in the core
darn, autodetecting SPI RAM size doesn't mean the build will also work on a no-spiram module ๐ I had hoped. let me try a few more things...
@solar whale I tagged you for review as well, but here's a link to the Adafruit IO PR: https://github.com/adafruit/Adafruit_CircuitPython_AdafruitIO/pull/81
Generally, I'd just have different builds. It'll be clearer what build someone has if board only has the relevant pins.
Thanks -- I won't be able to try it until later this afternoon.
No rush. Brent needs to take a look at it and I don't think he's even around today.
It looks good to me!
Thanks, Jerry!
@slender iron did one of your CI changes fix this kind of error:
Run git describe --dirty --tags || git log --parents HEAD~4..
fatal: No tags can describe '4cdbc0d86067c706d9569786b60c27ff4f17d588'.
Try --always, or create some tags.
fatal: ambiguous argument 'HEAD~4..': unknown revision or path not in the working tree.
i can push an empty commit on that failed PR (maybe there are others) if it will fix this.
curious. the RGB LED (neopixel) on esp32-s3-devkitm-1 (no psram) doesn't work reliably, it flickers random colors.
the first yellow blinks are right but then it just starts showing random colors
@tulip sleet I was experimenting in my pending PR for issue label notifications
I haven't figured out a good fix
I kinda think it's a github bug
I feel like we want to move away for actions/checkout
in favor of a partial checkout
this says it is due to a shallow clone: https://stackoverflow.com/questions/6445148/git-fatalno-tags-can-describe-sha1-number
you were trying this only on main, so maybe we should push one of your changes to 7.1.x, which is where the PR is
ya, I know that. the python script is supposed to deepen it back to july 2021 though
it does deepen it when the change is pushed from a computer
I believe the issue is only after a github.com edit
I pushed an empty commit to the PR. Maybe I should push an empty commit to 7.1.x?
the branch is having trouble? not a pr?
the pr is against 7.1.x
what pr?
hrm, you did all of those edits from your computer right?
yes
Failure is here: https://github.com/adafruit/circuitpython/actions/runs/1547752964
more precisely
that was last night's push
this bit should fetch the branch history: https://github.com/adafruit/circuitpython/runs/4439291431?check_suite_focus=true#step:5:208
yeah, it's failing in the next step
right, because the branch history hasn't been fetched correctly
so the --shallow-since="2021-07-01" may be buggy, Iguess
ya, that's my thinking
I think what we really want is a clone with commit history
*partial clone
we need the tree, but not all the blobs, like the blog post you suggested this morning. Then it will fetch the blobs it needs on demand.
right. actions/checkout can only do shallow though
I am trying to see which version of git is being used
as-is
Getting Git version info
Working directory is '/home/runner/work/circuitpython/circuitpython'
/usr/bin/git version
git version 2.34.1
that's the latest
hunh interesting: https://github.com/actions/checkout/issues/646
sounds similar
The ESP32S3-DevKitM-1 and ESP32S3-DevKitC-1 have very similar schematics, with the neopixel connected to the microcontroller via a zero-ohm resistor. no pull resistor is shown. On the DevKitC, the neopixel works fine. On the DevKitM, the neopixel flashes random colors, especially while the CPU is running. If I create a DigitalInOut of the pin, even if its direction is 'input', the flashing stops. Deinitting the pin makes the neopixel flicker again. So at the low level switching it between InputEn=0 and InputEn=1 makes a difference .. but why? And what should CircuitPython do about it?
the github editing theory feels like a race condition to me
(and why wouldn't the DevKitC be affected by .. whatever)
it's sounds like floating flickering
does neopixel_write turn the pin back to input when it's done?
I think it's actually more power efficient for us to pull pins a particular direction when the input buffer is always on
@tulip sleet no, neopixel_write doesn't touch the pin direction. but the supervisor deinitting it sets it to InputIn=0 OutputEn=0 etc
I (395503) gpio: GPIO[48]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
``` these sorts of messages are logged on the debug console by esp-idf when changing pin modes. If it's in the first state, the LED will flicker; if it's in the second state, the last set color stays.
the led flickers because of floating line I'd assume. The input buffer may change the capacitance and therefore the floating
and any attempt to probe it will also change the conditions under test ๐
Ah, very true! They are giant. Splitting the peripherals could help.
It may be best to pull the pin when not in use. I'm off for a walk now.
a lot of adafruit parts don't seem to have pulls on the built in neopixel, indicating it's not typically a problem
I'm also off for a walk
By setting CONFIG_SPIRAM_TYPE_AUTO=y and CONFIG_SPIRAM_IGNORE_NOTFOUND=y, the boot code will adapt to whatever PSRAM is present, or fall back to running without it if no psram is present. This means we don't need two (or more, for the 'M' version(s)) artifacts for the variants of the ESP32-S3 DevKit family
On a psram board (DevKitC-1-N8R2):
Adafruit CircuitPython 7.2.0-alpha.0-38-g121b22b0c-dirty on 2021-12-07; ESP32-S3-DevKitC-1 with ES...
What's needed to move this forward?
CircuitPython version
Adafruit CircuitPython 7.2.0-alpha.0-38-g121b22b0c-dirty on 2021-12-07; ESP32-S3-DevKitC-1 with ESP32S3
Code/REPL
# none
Behavior
The initial 3 flashes of the onboard neopixel work, but then after that the LED sometimes blinks random colors.
Description
No response
Additional information
This problem affects the 1 ESP32-S3-DevKitM-1 I have, but neither of the ESP32S3-DevKitC-1 (both with PSRAM) that I have.
...
As of the PR release, I think we just needed to check that any bots pushing to this repo were using main instead of master? I'm not really sure. The changes in this PR should still be OK, but we'll need to update any newly added board files still referencing master.
I've just synced it up with master and updated any new files. This PR is now back up to date.
@makermelissa @tannewt is there anything else we need to do to get this one in? Any adabot changes?
On the Blinka devices there is a link near the bottom of their MD files:

The URL for that link appears to have the master branch coded into it. So that would need to get updated to main in each md file I think. i.e.
There are a few places in...
@FoamyGuy those should all be synced up now as well.
Ah, that is right, I see them in the changes now. @jwcooper thank you.
Updating the accompanying example file references on these pages: https://learn.adafruit.com/how-to-add-a-new-board-to-the-circuitpython-org-website/adding-to-downloads
https://learn.adafruit.com/how-to-add-a-new-board-to-the-circuitpython-org-website/adding-to-blinka
were the only two places I found in Learn Guides that may need updated to match when the time comes.
@onyx hinge is the module difference irrelevant from a build perspective between the
ESP32-S3-DevKitM-1-N8 - ESP32-S3-MINI-1 Dev Board - 8 MB Flash (5311) and the
ESP32-S3-DevKitC-1-N8 - ESP32-S3-WROOM-1 Dev Board - 8MB Flash (5312)?
@crimson ferry I don't know for sure! I had intended to get the other "C".
I didn't see anything different in the datasheets
other than I think flash being inside the chip or can or not maybe, don't know if that affects flash speed or anything
Is there a known issue with the adafruit feather esp32s2 and the latest tip of main -- Mine keeps crashing into HardFault -- OK with 7.1 beta
@solar whale I'll D/L from S3 & try it out
thanks -- I'll create an issue after I'v done more testing.
I can't get it into bootloader with stacking headers without two hands and a tool, my finger is too big to squish the BOOT button between the Stemma QT and the stacking header o_O
20211207-45caaa8.uf2 crashes, seems maybe while scanning I2C (or something earlier in my code corrupts something accessed later)
Consistent with what I am seeing
boot.py seemed to run fine though, and code.py got a few hundred lines in before it manifested
same
I am finishing up another test -- I can create an issue after I'm done-- or feel free to go ahead and create one.
From minimal code in REPL, it seems to not like the onboard battery gauge (or I2C in general). I'll can file.
I might be hitting that error! I've been trying to narrow it down for a while, thank you!
CircuitPython version
Adafruit CircuitPython 7.2.0-alpha.0-43-g45caaa8e2 on 2021-12-07; Adafruit Feather ESP32S2
Code/REPL
Adafruit CircuitPython 7.2.0-alpha.0-43-g45caaa8e2 on 2021-12-07; Adafruit Feather ESP32S2 with ESP32S2
>>> import board
>>> i2c = board.I2C()
>>> while not i2c.try_lock():
... pass
>>> dev_addrs = i2c.scan()
>>> i2c.unlock()
>>> for dev_addr in dev_addrs:
... print(f'{dev_addr:02X}', end=' ')
... from adafruit_lc70...
@solar whale Thanks for testing!
I'll leave it for Brent to take a look at since he knows that lib better than I do.
No problem -- glad to help.
I don't think it could have been done any other way, but he said he'd take a look, and I appreciate that offer. ๐
I have extreme difficulty getting it to crash when reloading code from the computer. I hit the problem frequently from no power to power on, and it crashes when it gets to the i2c portion of the code, is this similar behavior? I am not powering by battery at any point
I had to power cycle after each safe mode to get it to happen again, but it crashes even if I reload from REPL (after interrupting it before it hits the I2C code)
there could be some complicating factor
It is crashing when I try to initialize an I2C sensor, scan was ok, but init crashed
Seems to be I2C in general
I think mine crashes on this line: i2c = busio.I2C(board.SCL, board.SDA), I don't scan at all
yeah, scan seems fine
oh, hmmm
I was able to i2c = board.I2C()
and ```py
import busio
i2c = busio.I2C(board.SCL, board.SDA)
I think*, grain of salt, otherwise I'd be commenting in the github issue. I made an outdoor weather station and fought to get the parts fit into the enclosure, so I just assumed I messed something up physically. Give me a bit and I'll bring it in and edit the code to test
Ok I might be hitting a different error:
i2c = busio.I2C(board.SCL, board.SDA)
Traceback (most recent call last):
File "code.py", line 389, in <module>
RuntimeError: No pull up found on SDA or SCL; check your wiring
Code done running.
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
this hangs ```Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 7.2.0-alpha.0-43-g45caaa8e2 on 2021-12-07; Adafruit Feather ESP32S2 with ESP32S2
import board
import adafruit_si7021
si = adafruit_si7021.SI7021(board.I2C())
Apparently wrapping mine up in
# Start i2c and UART bus and ADC and connect to sensors
for i in range(5):
try:
i2c = busio.I2C(board.SCL, board.SDA)
break
except RuntimeError as e:
print(e)
solves my issue
oops -- I forgot to turn on the I2C Power in when I got the hang -- may be misleading -- I did turn it on for the first crash when trying ot init the SI7021
I also caused a crash with another I2C sensor - si7021
hmmm
import board
import digitalio
import adafruit_si7021
ip = digitalio.DigitalInOut(board.I2C_POWER_INVERTED)
ip.switch_to_output()
ip.value = False
si = adafruit_si7021.SI7021(board.I2C())
print(si.temperature)
but this runs
wierd -- bme280 works but si7021 does not ....
Hmm. this is a weird set of issues. Does just trying again get around the issue, or is it a hard enough fault you can't event catch it with an except?
Looks like something in this PR breaks the zero2w build...
Thanks to @jerryneedell for testing. The logic looks good to me, but I did not test.
Good grief, 13k file changes everytime they change something?!

I tried ```import board
import digitalio
import adafruit_si7021
ip = digitalio.DigitalInOut(board.I2C_POWER_INVERTED)
ip.switch_to_output()
ip.value = False
try:
si = adafruit_si7021.SI7021(board.I2C())
except Exception as e:
print(e)
print(si.temperature)
Hmm than unfortunately I'm probably not hitting the same issue. I might just have stressed my hardware/a wire too much when building it's enclosure
What I2C sensor are you using?
a bme280, pm2.5, and sgp40
For the power on the pin, I doubt this will be different but this is how I setup the i2c pin level:
x = DigitalInOut( board.D7)
x.direction = digitalio.Direction.OUTPUT
x.value = False
it should be functionally identical, but it's the only difference I see. And since the bme280 works for both of us I doubt this'll change anything
zero2w builds now -- thanks!
I have to go offline -- enough fun for today -- thanks @crimson ferry and @ember iris
it was consistent earlier, but now I can't get it to crash, and I2C works even if the control pin is high
I wonder if we hit three different i2c issues at about the same time
Looks good to me! I want to see the alias used very sparingly. Builds will all have the same board id even if the boards are different.
there could be multiple issues. it does seem to require a read now, not just init
this is the point in debugging where my mind wanders to things like: is the board heating a factor?
haha Oh yes, I imagine there's a root cause, or a family of root causes. It was just a unique moment of "We have this problem and this is what it does" followed by "Huh mine is different than yours" that I really enjoyed
yeah, what all seemed clear upfront became... murky
Honestly that murkiness is one of the reasons this kind of work/project is enjoyable. Even if I have a mountain of other area's to address first
@gilded cradle Am I missing something, or can you not do wav playback on MagTag? I feel like I'm missing something.
As far as I know you can't.
Oh bummer. Ok. I need to reply to a forum issue then. Thanks
Unless Jeff added it and I didn't hear.
@onyx hinge ^^ ?
audiobusio should be on magtag https://circuitpython.readthedocs.io/en/latest/shared-bindings/audiobusio/index.html
How do you do it with audiobusio? I can't figure it out...
but that needs an i2s thingy
maybe it's not there
Ok
no audiopwmio, no audioio
I'm experimenting with asyncio, and keep getting a traceback ending at core.py line 283, a call to sys.print_exception, which doesn't exist (in 7.1.0-beta.0 on pybadge). Should I update to beta.1, file an issue, something else...?
@tannewt Agreed on the occasional use of this. I guess it's a matter of keeping a fine balance between having lots of VID/PID requests to projects that allocate USB Product ID for Free Software / Open Hardware plus different CP builds vs different pages in CP.Org.
These projects do push back when requests of multiple PIDs are made; especially when it's all for the same firmware. After all, these "open" PIDs are in finite supply...
Openmoko commented the following in this [...
Yeah that's what I ran into.
looks like we tried and it was heckin glitchy
Alright, thanks for the info. Reporting back to the forums.
at least it's consistent
yeah very sus
fix it in software ;-)
have a lookup table of where the glitches happen and how much to correct fot them ;-)
Hah!
(please don't actually do that)
Oh, now you tell me. I already started! ๐
@tannewt Agreed on the occasional use of this. I guess it's a matter of keeping a fine balance between having lots of VID/PID requests to projects that allocate USB Product ID for Free Software / Open Hardware plus different CP builds vs different pages in CP.Org.
These projects do push back when requests of multiple PIDs are made; especially when it's all for the same firmware. After all, these "open" PIDs are in finite supply...
Openmoko commented the following i...
But how does it sound? You might be able to start a new genre
glitchwav
I can actually imagine how it sounds from that graph, and it makes my teeth hurt
@makermelissa Thanks for the link. I'll need to look into this a whole lot more... I suspect the docs on this would be relatively thin... I will probably need to ask for more...
@tannewt Any guidance on why one would prefer aliases here (CP.ORG) vs there (CP build)?
@jerryneedell did you intend to close this?
It's mostly a convenience thing here either for boards that are electrically identical or if we wanted an alias and didn't want to wait for a new release of CP.
but if someone did want to look at it [audioout on esp32s2] here was my branch from the time: https://github.com/jepler/circuitpython/tree/esp32s2-dac-dma
still another conflict :-/
okay! does it need to be done in the 7.1.x branch too?
I changed the name to raspberry_pi_cm4io to reflect the fact that we have multiple carrier boards that can run the compute module 4.
The remote ref may be out of date and not get the right branch
history in some cases. actions/checkout also fetches based on sha:
https://github.com/adafruit/circuitpython/runs/4449960809?check_suite_focus=true#step:3:40
has anyone reported sdcardio issues for 7.1 or 7.2 SAMD builds?
(on my pycubed boards) I'll have a board that happily mounts and operates an SD card for hours. However, if the card is ever written to from a PC (properly removed and reinserted from the unpowered board,) the board will **forever ** fail to find the SD card until 7.0 is flashed. At which point it can successfully mount the SD -> UF2 update to 7.2 -> can successfully mount SD again. I don't have any SD-capable feathers to test on
this is interesting. There have been SD card issues mentioned here which have been hard to reproduce: https://github.com/adafruit/circuitpython/issues/5600 and https://github.com/adafruit/circuitpython/issues/5644
#5600 could be related to what I'm seeing. My current theory is something to do with removing power to a 7.2 board (regardless if it's been ejected properly). I'll investigate more and let you know
following up: board with CP7.2 can successfully operate an SD card immediately after flashing until power is removed from the board (unplug usb) for the first time. Any attempt thereafter (tried 20 various unplugs/replugs/waiting) will be unsuccessfully until 7.0 is flashed. Then it works immediately and consistently between unplugs. If 7.2 is flashed, the behavior cycle is repeated (it'll find the SD until unplug, etc...)
Any thoughts?? tried multiple sd cards
This build error is a bug in our tooling. I'll try and rerun your build. That may fix it.
Thanks. But looks like it's still failing.
CircuitPython version
CircuitPython 7.1.0 beta1, on Feather RP2040
Code/REPL
See attached zip. Haven't been able to find a more minimal example.
Behavior
When powering up the board with no serial monitor attached (was using TeraTerm), it will more often than not proceed normally for a few seconds, then throw an exception. Inside the exception handler, referring to the exception fields would throw another exception (in 7.0.0) - in 7.1.0b1, str(err...
Fixes #5462.
BLEIO HCI uses a background task to monitor communications with the co-processor. The background task was inadvertently deleted when the BLE workflow code was added and merged.
Also renamed the background routine to be clearer it is HCI only.
Question about development of the circuitpython audio library. It doesn't seem that there had been much development on it recently. Does it still not work?
Let's start this PR over again. What are the changes you want to make? I don't see any commits or changes you made?
@waiweng83 Could you try pushing an empty commit?
git commit --allow-empty -m "empty commit"
git push
That will reset the commit to merge against to the latest.
Is this is still in process, or does it await a review?
I need to incorporate @DavePutz 's suggestion
@jpconstantineau I honestly don't know - I'm really new to hardware development.
Have you had any luck using NRFConnect? (https://www.nordicsemi.com/Products/Development-tools/nRF-Connect-for-desktop/Download#infotabs)
That has been even easier than using nrfjprog.
My process with that app is to select the DK from the top left dropdown, Add the SD hex, Add the Firmware hex, then click "erase and write".
Not sure if this helps answer your question. At this point I'm not sure if y...
Nrfconnect: never used it to flash. I have stayed away from the SDK and
since the Arduino nRF52 bootloader works great with the Arduino IDE, I kept
to that. I use nrfconnect on my phone to diagnose connections/BLE
services.
Working vs flashing: it's actually both.
I sell boards with the bootloader so that people can flash whatever they
want. The original 840 works great with the Arduino framework, ZMK as well
as CircuitPython. One can switch between any of these without the need of a
jlink...
ninja: error: unknown target 'esp-idf/esp_system/__ldgen_output_sections.ld' ...is this something to do with moving to idf 4.4?
that is related to idf 4.4
is your esp-idf submodule updated?
not sure, I did make without -j and and got a different error: supervisor/port.c:81:10: fatal error: esp32/spiram.h: No such file or directory
I re-installed: esp-idf/install.sh
the submodule should be at ddc44956bf commit, what do you get with git status in the esp-idf folder
HEAD detached at e493a4c30e
it is not updated, you need to re-init it
git submodule deinit -f esp-idf
git submodule sync && git submodule update --init esp-idf
run the above in circuitpython/ports/espressif forlder
lots of downloading, but this looks promising... thanks!
it's got other problems now, but it's after 1am, so... another time.
@waiweng83 Could you try pushing an empty commit?
git commit --allow-empty -m "empty commit" git pushThat will reset the commit to merge against to the latest.
Thanks.
Nice! Thanks @jepler. This sdkconfig should work for every board, would you like to modify the common skdconfig.defaults?
This sounds like it could be a power problem. Can you replicate it with the neopixel string disconnected?
Looks like all checks have passed. Thanks for the CI fix.
@microDev1 I thought about that. I can do it if there's agreement. Two possible reasons not to:
- it's a change that would affect all espressif builds, not just this one (so more testing would be needed)
- on a board where we "know" there's psram, do we want to continue without it?
one more wrinkle .. I noticed on the esp32s3-box that the 8MB PSRAM was also an octal chip, so swapping out different modules with different psram within the can ACTUALLY requires a different set of never-reset pins.
We fixed a bunch of audio problems on various ports: I'm not sure what you mean.
hrm. Not only could I not reproduce it with the neopixels disconnected, I can no longer reproduce WITH them connected. I'll keep trying.
I just don't see any relevant sdcard changes, for this problem that exists in "7.2" (I assume tip of main) but not in "7.0"... behavior different after power cycling points to problems getting the SD card to enter SPI mode, which sticks until power is cycled, but 7.0 and current tip of main both do exactly the same thing, code hasn't been touched...
and as usual I can't reproduce this; the role of a computer writing to the SD card is also puzzling
do you think this has anything to do with the space-saving done in oofatfs? Was that post 7.0.0?
no, for a couple of reasons ..
I am assuming that the error is "no SD card", which is way before FAT comes into play
with this most recent report I don't think the person actually said
but second, the space savings was only in mkfs (format) so we don't even use that code on SD cards
that's what I thought. I was wondering if it had to do with checking the dirty bit or where it was formatted
the very first thing the SDCard constructor does is try to put the card into SPI mode and get a response that indicates it's entered SPI mode. If this fails, the exception says "no SD card"
there was a PR about fixing SPI mode never reset or something. If only you could reproduce in any way, I would say do a bisect
Also, updated the display name of the current Tiny 2040 to clarify it is 8MB.
the change that there has been in SD cards is the 'CMD25' stuff but that only comes into play after you've gotten to the point of writing a card
Also updated current Tiny 2040 page to clarify it is the 8MB version.
CircuitPython PR has only just been raised (see: https://github.com/adafruit/circuitpython/pull/5684) but getting this in now due to time zones.
I wonder if a card reset mid-CMD25 could be in a weird state .. but that's not what users are reporting
@onyx hinge I have not followed this all that closely. What is the simplest setup and test program to try to reproduce? I have lotsa cards.
@tulip sleet pygamer is probably one of the easiest pieces of HW
i have one
import board
import busio
import sdcardio
import storage
spi = busio.SPI(board.SD_SCK, MOSI=board.SD_MOSI, MISO=board.SD_MISO)
cs = board.SD_CS
sdcard = sdcardio.SDCard(spi, cs)
vfs = storage.VfsFat(sdcard)
storage.mount(vfs, "/sd")```
leaving the airlift case aside, what users seem to be encountering is that the SDCard constructor throws 'no SD card'
I've seen 'no SD card' when attempting to hot plug SD cards; in that case it goes away when I hard reset. with a card inserted at power on, the above program can initialize the sd card as often as desired over soft resets
i will try on GC first because it has full SWD connector
I appreciate you taking a look!
at what version did these problems seem to start?
https://github.com/adafruit/circuitpython/issues/5600 says after 7.0.0
reported against CircuitPython 7.1.0-beta.0 and later says "Given that it worked fine with identical hardware with 7.0 I don't think it was an issue with the SDCard. Downgrading made it work again."
the airlift problem is reported as affecting 6.3 as well, so it's not a new problem whatever is going on there
this reports that the problem is between 7.0 and "7.2".
airlift problem is https://github.com/adafruit/circuitpython/issues/5644
I will test with tip of main and if I can reproduce, will try bisect
(i did a bisect yesterday between some 7.0.0 alphas. That was a bit painful due to the MPy merges. Lots of git bisect skip.
hmm indeed
@onyx hinge OK, I have a bunch of MicroCenter cards: I have 32GB's that aren't found; one 16GB that is found and one that isn't. I also have a SanDisk 16GB that works.
So I will try 7.0.0 and see what happens, and then bisect if there's a difference
yes 7.0.0 works; great, will start a bisect
@tidal kiln Please ping when you're around, I'd like you to proof something for me. (At least I think you'd be good to proof it. I could be wrong.)
Thank you! If both the 8mb and 2mb are winbond chips, the builds may work across versions because the rp2 port detects the flash size.
@idle owl yo
I wrote a template for setting up the IDE for RP2040 Arduino. Do you mind checking it? I'll DM you the URL since it's not a real preview URL.
sure
Template previews look a bit odd.
Also just noticed the "SOME OTHER TEXT HERE" I forgot about at the beginning ๐
I'm ok with having a board for each variant. It can make it easier to debug if the board id matches an exact board.
@tidal kiln Fixed the intro.
I feel like the plan is for a second template showing how to load Blink. But Limor is busy, and I forgot to ask until today, so that will wait.
One suggestion.
How are your git skills? If you are comfortable, would you mind rebasing this to one commit?
I think you'll want to "never_reset" the pin here because CircuitPython will try to reset pins after a VM run otherwise.
Thanks Scott! They are both Winbond chips, but the codes are different so I thought that meant they were incompatible so went for a separate entry. 2MB has the code W25Q16JVxQ (same as the Pi Pico) whereas the 8MB has W25Q64JVxQ. Should the designation be changed to something like W25QxJVxQ going forward?
CircuitPython version
Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit ItsyBitsy RP2040 with rp2040
Code/REPL
# SPDX-FileCopyrightText: 2021 Jeff Epler, written for Adafruit Industries
#
# SPDX-License-Identifier: MIT
#
# Adapted from the example https://github.com/raspberrypi/pico-exa ... /hello_pio
import time
import board
import rp2pio
import adafruit_pioasm
fh_clock_cycle = adafruit_pioasm.assemble(
"""
set pins, 0
set pins, 1
"""
...
@onyx hinge bisect done: It was [f22299d2b374a8150ec63d9338175aa51b593dd6] sdcardio: Use CMD25 across multiple writeblocks() calls. Sometimes power-cycling the board (as opposed to just resetting) made a difference, so I tested with power-cycling.
I think a separate entry will still be clearer.
We'll want to keep the designation the same because some ports do need the size. Instead, EXTERNAL_FLASH_DEVICES can be a comma separated list of flashes and the stage2 script should determine a compatible config for both. See https://github.com/adafruit/circuitpython/blob/main/ports/raspberrypi/boards/arduino_nano_rp2040_connect/mpconfigboard.mk#L10
Sorry about that! I didn't think bleio needed it because the ble interrupt queued a background task for it.
I didn't think bleio needed it because the ble interrupt queued a background task for it.
There may be a more "on-demand" way to do it, but I didn't look at that right now. There can be bytes coming from the HCI interface at any time, I think.
@tulip sleet that change can result in "no SD card" exception?
yes, I used your test program above. It either threw an exception or didn't
(I added a print("mounted") at the end.)
I think I saw cases where I didn't power-cycle the board and it worked, so I made sure to power-cycle
that's wild, that code shouldn't even execute until well after "no SD card" can occur. obviously I'm overlooking something. and have no cards here that repro the problem.
we can revert CMD25 in the short term, if it helps 7.1.0 be releaseable. We do want the speed sometime soon though, it's a big speed increase when writing jpegs or gifs from camera
init_card calls cmd which can now return early / fail for some new reasons
if exit_cmd25 fails, or if wait_for_ready fails. the first shouldn't happen (can't be in_cmd25) but the second could, in which case it doesn't actually write the needed command...
yes, confirmed that's the commit
can I turn on some logging for you to see when it fails?
I will turn on the DEBUG_PRINT for now
@jpconstantineau I think having different board ids is valuable. Aliases circumvent that. So, in general, create separate boards for things. We already need to optimize for many boards so having more is fine. To reuse a PID you can add to the whitelist here: https://github.com/adafruit/circuitpython/blob/main/tools/ci_check_duplicate_usb_vid_pid.py#L32
If you are selling your boards, you should really consider purchasing a VID. It'll give you 65k PIDs and you won't burden the open source p...
here's a somewhat speculative fix change ```patch
diff --git a/shared-module/sdcardio/SDCard.c b/shared-module/sdcardio/SDCard.c
index 9eb32d926..649858fcb 100644
--- a/shared-module/sdcardio/SDCard.c
+++ b/shared-module/sdcardio/SDCard.c
@@ -230,11 +230,18 @@ STATIC const compressed_string_t *init_card(sdcardio_sdcard_obj_t *self) {
common_hal_digitalio_digitalinout_set_value(&self->cs, false);
- assert(!self->in_cmd25);
- self->in_cmd25 = false; // should be false already
- // CMD0: init card: should return _R1_IDLE_STATE (allow 5 attempts)
{
bool reached_idle_state = false;
for (int i = 0; i < 5; i++) {
-
if (cmd(self, 0, 0, NULL, 0, true, true) == R1_IDLE_STATE) {
-
// do not call cmd with wait=true, because that will return -
// prematurely if the idle state is not reached. we can't depend on -
// this when the card is not yet in SPI mode -
(void) wait_for_ready(self); -
if (cmd(self, 0, 0, NULL, 0, true, false) == R1_IDLE_STATE) { reached_idle_state = true; break; }
Was having some issues with GPS timekeeping, and thought it was an issue in the adafruit_gps module.. Turns out it was related to int() rounding. Can someone else confirm that this is an issue, or is it just a float inaccuracy?:
Adafruit CircuitPython 7.1.0-beta.0-75-g932131b4f on 2021-11-18; Adafruit Feather Bluefruit Sense with nRF52840
int(184105.000)
184104
it is a float issue: there are only about 5 1/2 digits of precision
do you want round() instead of int() ?
Well the adafruit_gps module does int()
is that really an HHMMSS or something
with .000 numbers
Yeah, the GPS featherwing returns time as HHMMSS.000
so the 3 .000 seems to put off the seconds
it should be parsed as a string, not as a number
or int("184105.000".split(".", 1)[0]) awfulness
or just slices to pick out the digits
Actually through it would strip off the irrelevant decimals on its own, but int(184105.000) and int(184105.00) produce two different results
>>> float(184105) - float("184105.000")
0.0625
>>> float(184105) - float("184105")
0.0
``` well that's interesting! float parsing code is ad-hoc and doesn't always parse to the nearest floating point number
there are issues about this in the MPy repo
it's a deliberate trade off because fully accurate parsing is slow and requires a lot of code
@timber mango If the GPS parsing code could be improved, please file an issue, thanks, maybe even a PR, if it's clear how to fix it
yeah, not to me, with code space an issue.
I'm a bit unsure why the int() is actually in the code.. time_struct seems to handle float ok..?
it may have been transcribed from some Arduino code
Will do some experimenting
ah if you have long ints you can do better, but this is not true on all our boards by far
https://github.com/micropython/micropython/pull/5832 is probably what dan was thinking of
the parsing code really shouldn't use float as an intermediary
the GPS parsing code, you mean? I agree completely
yup
given the limitations of floats, if this little bit can be done in the world of ints you're almost certain to be better off.
NMEA specification seems to always use HHMMSS.sss .. So if the format can be assumed to be the same for all chips, the . could just be stripped out, and math done on resulting int
@onyx hinge sd test program with the debug prints on:
>>> import sd
cmd 0 [00] arg= 0 [00000000] len=0 data wait
cmd 0 [00] arg= 0 [00000000] len=0 data wait
cmd 0 [00] arg= 0 [00000000] len=0 data wait
cmd 0 [00] arg= 0 [00000000] len=0 data wait
cmd 0 [00] arg= 0 [00000000] len=0 data wait
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "sd.py", line 9, in <module>
OSError: no SD card
seems to me that _parse_data should parse into time.struct directly
does it need to be broken down to HH MM SS and sss anyway?
then do int on each of those
using ints makes sense in Arduino, with poor string handling, but in Python, string handling is easy
Probably better then trying to do math on it all
run time for me. CI is catching up on all my merges
chiming back in about observed sd card issues. See my message here #circuitpython-dev message
๐ Has something to do with power cycling a 7.2 build. Everything will work upon flashing until power is removed. Maybe pin states are being handled differently upon POR?
or the card itself is in a somewhat different state
@onyx hinge I can get you some SPI traces, but I need to wire up another board with an SD breakout, I guess, to make the lines accessible
Maybe I should mail you one of these "bad" cards
@tulip sleet have you tried flashing 7.0 and then talking to one of your "bad" cards?
never reset? do you mean that board_init/deinit gets called every time the board is reloaded and when the code is done?
How do I make sure that the pin is ON to enable the neopixel and leave it on until the user decides to turn it off explicitely?
yes, it works, iI bisected between 7.0.0 and tip and main. The hinge commit is one that adds CMD25 functionality
ah ha, ok progress ๐
which supposedly should not matter, but there it is. Oh yes, this is definitely progress. I can also imagine that other cards may act slightly differently, and give yet other symptoms, such as yours, for exmaple
read back up a ways
yeah, the commit history isn't clean is it... I am getting better with GIT but rebases are not a common thing I do. I'll see if I can clean it up into a single commit.
What doesn't help is the fact that github "sync" also posts commit comments...
ah I see. man sd cards over spi can be tedious. too many variables
I don't think they test it extensively, because SDIO is used mostly for speed reasons
I found some cards that do work with both 7.0.0 and 7.2.0-something, and some that don't. I did a bisect, and the commit that introduces the problem is, f22299d2b374a8150ec63d9338175aa51b593dd6, part of #5510.
Let me re find the library. You're right there's a ton of audio stuff
Here is the guideline the way I understand it:
1 - if a user of your board might have the need to be able to differentiate the board variant using print(board.board_id) then use CP Build alias
2 - (else) if the variant of your board is sufficiently different that it needs separate documentation and a separate CP.ORG download page but not sufficiently different to have it's own build/board_id, then use the CP.ORG alias feature.
Most cases would fall under the first group...
Replicated on SAMD51, so not just RP2040.
Using this test program (on Grand Central, use dedicated SD card pins instead):
import board
import busio
import sdcardio
import storage
spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
cs = board.A0
sdcard = sdcardio.SDCard(spi, cs)
vfs = storage.VfsFat(sdcard)
storage.mount(vfs, "/sd")
print("mounted")
On a Grand Central M4, I have some cards that work, and three that fail this way (DEBUG_PRINT is on in ...
if you still have some time to spare on this, can you try with this speculative fix? I think the change I introduced during card init is that a failed 'wait for ready' causes the whole 'cmd' operation to fail... that's not how it used to be.
https://github.com/adafruit/Adafruit_CircuitPython_VS1053 Here's the library. My goal is to have audio output from a headphone jack with similar quality to the audio from a pi
I'm not liking the random jitters and stops that I can't control when using the pi
@tulip sleet Tried my first at this, and will really appreciate feedback: https://github.com/adafruit/Adafruit_CircuitPython_GPS/pull/76
I do see that the CMD25 work could have changed how card init functions, by making a failure to "reach the idle state" stop a command from being issued (and an error instead). I think that in normal operation it should be an error if the card fails to reach an idle state when expected, but this is apparently an unfair expectation when switching the card to SPI mode. This patch aims to fix it, but I don't have any affected hardware to test...
Not sure how I missed them.
@onyx hinge somehow i missed your speculative early this afternoon. I will try it
Thanks! I didn't @ you the first time.
Should I be in #help-with-circuitpython? This seemed more dev related
are complaining about the pops and clicks?
No thats not CPs fault. I'm just trying to discern if there's a way to replicate what I'm doing with a pi, with any cp mcu libs
are you complaining about VS1053 or about native audio
I'm just trying to understand if it's possible currently to use a CP lib on a CP mcu to output audio from a headphone jack. Not intending to complain at all, just wanting to know the lay of the land
I can always use arduino I just love cp
you can play wav files and mp3 files (not all boards support mp3). The audio will be output as PWM audio (lower quality), as DAC audio (high quality), or as I2S audio (digital output)
this is without a VS1053, right?
in all cases you need some kind of amplifier (except for a very few boards that have a headphone jack)
Yeah I think since the lib is giving folks trouble trying to get audio to work with Python I'd have to go without that chip. So I'd need some kind of amplifier IC that feeds into a headphone plug?
My plan was to buy a circuitbrains m4 board which I believe from my reading can handle mp3s and also include a sd card reader for the music. The VS1053 was attractive because it has all the hardware I need.
I can bodge in an SD card reader by cribbing off of adafruit boards though
yes, you don't need the VS1053 board. There are several boards with SD cards. Then you connect an external amplifier. Or the PyGamer has both
do you want to drive speakers or headphones?
Speakers but the line goes to an external amp
then you could use the DAC output directly, because it is 3.3V max
as a line output to the external amp
Ooh ok. What can I google to make sure the Amp is sufficient? And can the DAC be connected to a headphone plug?
Thanks!
what is the amp/
i have used a little battery-powered Radio Shack amp with a speaker, and I have used breakout amps from the Adafruit store to drive a speaker, both with good results
Let me get the model.
@onyx hinge your patch works on the GC4 with the "bad" cards. I am still having trouble with the sd breakout on the MM4. I wonder if there is a marginal timing problem there
i still see couldn't determine SD card version on the MM4
@tulip sleet that first is good news. you might try lowering the SPI clock rate, it defaults to 8MHz while the old adafruit_sdcard defaulted to 1_320_000 or something
It is a "70V/25V PA Amplifier"
and it has a line-level input? Does it have a mic input too?
the specs are talking about the output
The MM4 with breakout seems quite flaky. I can't even get 7.0.0 to work with some cards
but the fix seems good for on-board sockets. I could try it on something else like a pygamer as well
i have to do something non-work for a bit
thank you so much for testing!
I tried lowering the clock rate to 1MHz and even 100kHz, unsucessfully with the breakout
It does, 2 of them
