#circuitpython-dev

1 messages ยท Page 400 of 1

idle owl
#

Hmm. Then have to add the README or not too....

lone axle
#

the README inside of factory-reset will get created by default but deleted by that post_gen along with the directory if not needed.

idle owl
#

Oh ok

#

I think I get it.

#

@lone axle Wait I think I did it

lone axle
#

Your bash scripting is sharper than mine if so

idle owl
#

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?

lone axle
#

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.

idle owl
#

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!

lone axle
#

Yep you're welcome

lone axle
turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Category Channels

8

Text Channels

61

Voice Channels

6

Members

31992

Roles

36

turbid radish
#

Only 8 more users needed!

manic glacierBOT
idle owl
#

I caught that too

lone axle
#

nice.

lone axle
#

Huzzah!

idle owl
#

Thanks for your help ๐Ÿ˜Š

lone axle
#

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.

idle owl
slender iron
#

@tulip sleet are we ready to do the idf 4.4 merge?

#

@onyx hinge too

tulip sleet
#

I did not make a 7.x branch yet. It is incompatible with 7.x, right?

onyx hinge
#

at least not 7.1

slender iron
#

it doesn't break apis but does turn off rgbmatrix temporarily

#

(last I checked)

onyx hinge
#

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

tulip sleet
#

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)

manic glacierBOT
slender iron
#

๐Ÿ‘

manic glacierBOT
#
[adafruit/circuitpython] New branch created: 7\.1\.x
slender iron
#

@tulip sleet want to merge #5615 after and also tag it as 7.2.0-alpha.0?

turbid radish
#

!serverinfo

#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Category Channels

8

Text Channels

61

Voice Channels

6

Members

31992

Roles

36

tulip sleet
tulip sleet
#

or you mean just tag?

slender iron
#

don't release it, just push a tag

#

ya, so the S3 builds have 7.2.0 as their version

tulip sleet
#

Do you want to review #5615? I have not looked at it at all.

slender iron
#

I had looked it over already. Just made it official

orchid basinBOT
manic glacierBOT
#
[adafruit/circuitpython] New branch created: tannewt\-patch\-1
manic glacierBOT
lone sandalBOT
turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Category Channels

8

Text Channels

61

Voice Channels

6

Members

31994

Roles

36

manic glacierBOT
lone sandalBOT
onyx hinge
#

@slender iron do you care whether a "nopsram" version of the esp32s3 devkit is added to CP?

slender iron
#

seems like there should be

#

๐ŸŒฎ

manic glacierBOT
crimson ferry
#

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?

onyx hinge
#

@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

manic glacierBOT
idle owl
#

@onyx hinge Blinky NeoPixel? Who needs more!

manic glacierBOT
#

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...

manic glacierBOT
lone sandalBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

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...

orchid basinBOT
manic glacierBOT
tulip sleet
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Category Channels

8

Text Channels

61

Voice Channels

6

Members

31998

Roles

36

manic glacierBOT
tulip sleet
#

@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.

manic glacierBOT
#

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)

manic glacierBOT
manic glacierBOT
#

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...
manic glacierBOT
onyx hinge
#

@crimson ferry hey if you see this can you tack the "box" onto your pull request with espressif? https://www.adafruit.com/product/5290

crimson ferry
#

@onyx hinge Done.

manic glacierBOT
lone axle
#

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.
onyx hinge
#

@lone axle try running in the top -level instead of in ports?

lone axle
#

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

blissful pollen
#

did you rebase your local to adafruit/main?

lone axle
#

yep. Was on wrong branch that wasn't tracking a remote.

blissful pollen
#

(I may have made that mistake myself ๐Ÿ™‚ )

lone axle
manic glacierBOT
blissful pollen
#

I'm far from a git expert but my usual is:

git checkout main
git rebase adafruit/main
git checkout -b newbranch
lone axle
#

Extending Native Classes

onyx hinge
#

@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.

manic glacierBOT
#

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...
onyx hinge
#

@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

manic glacierBOT
onyx hinge
#

the display of the esp32-s3-box still doesn't configure. oh well.

#

time to set this aside for a bit

dusk mauve
#

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 ๐Ÿค“

onyx hinge
#

@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.

dusk mauve
#

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 ๐Ÿ˜‚

manic glacierBOT
#

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".

onyx hinge
#
#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)

woven kite
#

I don't suppose you've had any luck with wifi on the esp32s3 devkitc boards @onyx hinge?

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

woven kite
#

Yeah same experience here

onyx hinge
#

I have some additional information from the debug port so if you'd like I can file the issue

woven kite
#

This is actually my first dip into circuitpython and hardware in general, so that would be great ๐Ÿ™‚

manic glacierBOT
#

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...
onyx hinge
#

@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!

woven kite
#

Great stuff ๐Ÿ™‚ Thanks!

manic glacierBOT
manic glacierBOT
analog bridge
#

@onyx hinge I haven't done much testing beyond blinky leds and a working repl on the esp32s3.

lone axle
manic glacierBOT
tulip sleet
manic glacierBOT
#

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.

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

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...
#

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...
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

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...

manic glacierBOT
#

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...

manic glacierBOT
#

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? ...

manic glacierBOT
#

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 ...

manic glacierBOT
#

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...

manic glacierBOT
#

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...

#
[adafruit/circuitpython] New tag created: v1\.11
#
[adafruit/circuitpython] New tag created: v1\.10
#

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...
lone axle
#

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":

crimson ferry
#

that seems like a problematic thing for Sphinx to do since it has no idea what the referenced function does

lone axle
formal summit
manic glacierBOT
#

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...
lone axle
manic glacierBOT
manic glacierBOT
ornate breach
#

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..

manic glacierBOT
ornate breach
#

only 1000 more pull requests and we'll be at 6666

manic glacierBOT
#
  • 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...

crimson ferry
tulip sleet
#

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

crimson ferry
#

I've only asked for UF2 Bootloader and CircuitPython, no Arduino.

manic glacierBOT
crimson ferry
#

@tulip sleet, do we need the build check for unique PID on each board build?

tulip sleet
spiral elk
#

mu I think used to use that for checking what board was connected but not so any more.

tulip sleet
#

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

crimson ferry
#

board_id?

tulip sleet
#

by the USB interface name presented to the host

#

"CircuitPython USB CDC"

#

we can discuss this tomorrow in the meeting

crimson ferry
#

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.

manic glacierBOT
lone sandalBOT
manic glacierBOT
#

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...

manic glacierBOT
turbid radish
#

serverinfo

#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Category Channels

8

Text Channels

61

Voice Channels

6

Members

32041

Roles

36

manic glacierBOT
onyx hinge
#

yay I figured out why the display on the esp32s3 box wasn't working, I'd forgotten to specify the display reset pin

analog bridge
#

@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?

tulip sleet
#

Would you mind re-revewing #5670 and also reviewing #5672? There were some uncrustify changes worth including as well Thanks.

analog bridge
#

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

tulip sleet
#

sure, I will just close it

onyx hinge
#

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?

tulip sleet
#

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

onyx hinge
#

I suppose it could be somehow related ...

tulip sleet
#

particularly the later comments

onyx hinge
#

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...!

tulip sleet
#

is that display long-lived

#

it disappears on ctrl-D, right? it's like some pin ownership problem

onyx hinge
#

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();
tulip sleet
#

that positioning makes more sense. The reset_ lines do a lot of cleanup including resetting all the PWM stuff

onyx hinge
#

it would be a bit of a pain to change that for all boards though ยฏ_(ใƒ„)_/ยฏ

tulip sleet
#

I was just looking at this yesterday when debugging #5665

onyx hinge
#

I wonder why it appears/appeared to work for others.

tulip sleet
#

is that pin never reset on the other boards?

#

but not on the fishy one?

onyx hinge
#

I looked at pygamer, there's not an explicit 'never reset' for its backlight pin

tulip sleet
#

maybe it's worth putting in some print statements to track when the PWM is initialized, etc.

onyx hinge
#

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

tulip sleet
#

I'd say open a clear issue, and maybe you will feel inclined ๐Ÿ™‚

manic glacierBOT
idle owl
#

@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)

lone axle
idle owl
#

Keen.

manic glacierBOT
#

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,...

orchid basinBOT
#

@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?

idle owl
#

@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.

tidal kiln
#

hmm. let me look at schem.

idle owl
#

Ok

tidal kiln
#

they have pullups

idle owl
#

Oh does that bork it?

#

I guess it would

tidal kiln
#

yah, i think so

idle owl
#

Ok. Makes sense.

#

Thanks!

tidal kiln
#

having those pullups on the board isn't typical

#

typically they're on the breakouts

onyx hinge
#

@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

tulip sleet
#

the pre-commit run is done by a script, not with black directly

#

yeah so from requirements-dev.txt, I think

onyx hinge
#

I see. makes sense, slightly unfortunate.

tulip sleet
#

unlike the libraries

idle owl
#

Discord crashed. ๐Ÿ™„

tulip sleet
#

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

idle owl
#

Ooh I think I can do all of the CP Essentials templates without soldering this KB2040. ๐Ÿ˜„

tulip sleet
#

@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?

idle owl
tulip sleet
#

I guess if there was any trading it would be with Scott for 12/27

#

and he is not here today anyway

idle owl
#

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.

tulip sleet
#

ugh

#

i have plenty of time now, already ate lunch

idle owl
#

We have the thing taped over, but it's still super loud.

#

Ok.

tulip sleet
#

wouldn't you have to leave anyway, because it's a drill?

idle owl
#

Apparently not? that's what's weird.

#

They do it to make sure the system and the elevators work I guess.

tulip sleet
#

a "test", not a "drill", i guess

idle owl
#

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.

tulip sleet
#

that makes sense, the firefighters have a special key so they can work the elevator during a fire

idle owl
#

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.

tulip sleet
#

@idle owl could you do a quick recording test with me in CircuitPython?

#

or anyone

idle owl
#

Yeah give me a second.

#

LMK if you need another test!

tulip sleet
idle owl
#

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.

ornate breach
#

This and others in Kattniโ€™s coding adventures!

#

I have similar fun problems at work like forgetting to update a dependency

idle owl
#

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.

crimson ferry
#

@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)

onyx hinge
#

@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

crimson ferry
#

๐Ÿ‘

lone axle
#

I am set up to do a backup recording

onyx hinge
#

regularly scheduled meetings coming up: December 13, 20, 27; January 3.

tulip sleet
lone axle
onyx hinge
#

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)

errant grail
onyx hinge
#

belated hug report for jerryn testing alongside me with the sd cards

solar whale
#

๐Ÿช„

onyx hinge
#

create_and_get_feed ๐Ÿค” ๐Ÿ’ก

idle owl
onyx hinge
#

I think it's great! not questioning the name, either

idle owl
#

๐ŸŽ‰ Hooray for me finding the error. Broke my Feather, fixed it, and immediately verified I could break it again. ๐Ÿ˜„

idle owl
#

IS31FL3741 - LED driver.

#

Yes

blissful pollen
#

yeah IS31FL3741 but I get tired of typing the full thing ๐Ÿ™‚

idle owl
errant grail
#

IS<something, something>41

blissful pollen
#

@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!

thorny jay
#

Not tested yet...

#

Was it during the stream that you fighted python version?

onyx hinge
#

@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

idle owl
onyx hinge
#

I can take the 27th from Scott if it's a problem

idle owl
#

Nope, I'm happy to swap.

#

I'll fix it now.

onyx hinge
#

thanks

idle owl
#

Fixed!

onyx hinge
#

appreciate it, & you

#

thanks all!

errant grail
#

Thanks!

onyx hinge
#

I'm heading out for now. ๐Ÿ‘‹

idle owl
#

I need to head out as well. Later folks!

ember iris
#

Thanks all!

manic glacierBOT
idle owl
#

@lone axle Hey! Do you have a few minutes to chat? If not, no rush. Please ping me if/when you do.

idle owl
#

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. ๐Ÿ™‚

#

Have had that open in a tab since he sent it.

lone axle
#

@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.

idle owl
#

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.

lone axle
#

Yep I know how to do that as well so I can do that on any if they do prevent me from pushing.

idle owl
#

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.

lone axle
#

Yep you're welcome. Happy to help out where I can to catch up!

onyx hinge
#

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

tulip sleet
#

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

orchid basinBOT
manic glacierBOT
tidal kiln
idle owl
tidal kiln
#

cool. thanks.

onyx hinge
#

which I forget every time I do it to myself

idle owl
#

@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.

manic glacierBOT
tulip sleet
idle owl
#

You're simply changing it in a different spot than you should be.

tulip sleet
#

and changed it to "View"

idle owl
#

Hmm, that's not right.

#

I'll look into it

tulip sleet
#

(this is from the Dec 13 one, I didn't change it, of course)

idle owl
#

maybe something changed

#

Added to my list

tulip sleet
# idle owl maybe something changed

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

ornate breach
#

Thanks Scott! ๐Ÿ™‚

slender iron
#

np ๐Ÿ™‚

manic glacierBOT
#

@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.

...

mortal mica
#

Getting some odd build failures on the PR I made. Is this a github issue or an action issue or something else?

slender iron
#

I'm looking into it now

#

it's a weird bug that happens if you edit a file on github

idle owl
#

@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.

idle owl
solar whale
#

Sure. Be happy to test it tomorrow.

idle owl
#

Thank you!

lunar gull
#

By the way, I am trying to track down the elusive requests issue with the MagTag Google Calendar now.

idle owl
#

@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!

lone axle
slender iron
#

can't printf debug when printf is broken

orchid basinBOT
slender iron
#

(I spotted the issue in the code. Now printf works)

orchid basinBOT
tulip sleet
slender iron
#

yup, I'm thinking that for CP too potentially

tulip sleet
#

yes, that too. Is it an option in the checkout action, I wonder?

slender iron
#

clone and fetch I think

tulip sleet
#

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

slender iron
#

I bugged the blog author on twitter about adding actions/checkout support

slender iron
#

@solar whale I fixed the pi4 by adding the .dtb files to the sd card I think

solar whale
slender iron
#

in the firmware directory there are a bunch of .dtb files

lunar gull
#

<@&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?

slender iron
#

they need to be on the sd card too

#

though I did fix a build thing too...

#

maybe that was needed too

hoary moat
#

.dtb files are kind of important ๐Ÿ˜‰

solar whale
#

Ah. Ok. Iโ€™ll be patient and wait for a PR

slender iron
#

it's pretty simple

#

(adding quotes)

#

though zero2 doesn't have them

#

zero2 style may be the default

solar whale
#

Ok. Iโ€™ll try that tomorrow. So use โ€œ for now

slender iron
#

I'll have a PR out tonight before I get up

#

very close ๐Ÿ™‚

solar whale
#

Thanks!

#

I wonโ€™t be able to try anything until tomorrow morning

slender iron
#

ok, np. thanks for testing it!

#

the boot process is different between the cm4 and the pi4

solar whale
#

I started reading up. It is complexโ€ฆ

slender iron
solar whale
#

Great. Thanks. I can give it a try in a little while.

slender iron
#

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 ๐Ÿ™‚

solar whale
#

Thanks for pressing ahead with it!

slender iron
#

๐Ÿ˜„

solar whale
#
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
> 
> >>> 
> 
> ```
manic glacierBOT
#

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 ...
manic glacierBOT
#

@makermelissa This issue is just an issue with the example. I have traced through the code and discovered:

  1. There can only be one socket_pool per wifi.radio
  2. Initializing the radio twice isn't helping
  3. 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...

lunar gull
#

and then GitHub dips

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

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...

manic glacierBOT
#

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...

mortal mica
#

@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)

orchid basinBOT
analog bridge
#

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.

proven garnet
#

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

tulip sleet
# proven garnet I know I'm late for the holiday, but I've got a menorah that uses ESP32 to get t...

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.

orchid basinBOT
#

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...

proven garnet
#

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

manic glacierBOT
tulip sleet
#

That sounds like a fine application for that.

proven garnet
#

Sweet! Thanks!

orchid basinBOT
#

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...

gilded cradle
# mortal mica <@!478616919721771019> Are there docs on how to use the new aliasing feature? I...

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.

GitHub

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 bec...

mortal mica
gilded cradle
jaunty juniper
#

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

onyx hinge
#

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...

idle owl
orchid basinBOT
solar whale
idle owl
solar whale
#

It looks good to me!

idle owl
tulip sleet
#

@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.

onyx hinge
#

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

slender iron
#

@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

tulip sleet
#

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

slender iron
#

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

tulip sleet
#

I pushed an empty commit to the PR. Maybe I should push an empty commit to 7.1.x?

slender iron
#

the branch is having trouble? not a pr?

tulip sleet
#

the pr is against 7.1.x

slender iron
#

what pr?

tulip sleet
#

actually maybe the empty commit worked, hold on

#

i forced-pushed an amended commit

slender iron
#

hrm, you did all of those edits from your computer right?

tulip sleet
#

yes

slender iron
#

what commit on that pr had the issue?

#

7e2 looks like it failed for other reasons

slender iron
tulip sleet
#

yeah, it's failing in the next step

slender iron
#

right, because the branch history hasn't been fetched correctly

tulip sleet
#

so the --shallow-since="2021-07-01" may be buggy, Iguess

slender iron
#

ya, that's my thinking

#

I think what we really want is a clone with commit history

#

*partial clone

tulip sleet
#

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.

slender iron
#

right. actions/checkout can only do shallow though

tulip sleet
#

I am trying to see which version of git is being used

slender iron
#

as-is

tulip sleet
#
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

slender iron
#

sounds similar

onyx hinge
#

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?

slender iron
#

the github editing theory feels like a race condition to me

onyx hinge
#

(and why wouldn't the DevKitC be affected by .. whatever)

slender iron
#

it's sounds like floating flickering

tulip sleet
#

does neopixel_write turn the pin back to input when it's done?

slender iron
#

I think it's actually more power efficient for us to pull pins a particular direction when the input buffer is always on

onyx hinge
#

@tulip sleet no, neopixel_write doesn't touch the pin direction. but the supervisor deinitting it sets it to InputIn=0 OutputEn=0 etc

onyx hinge
#
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.
slender iron
#

the led flickers because of floating line I'd assume. The input buffer may change the capacitance and therefore the floating

onyx hinge
#

and any attempt to probe it will also change the conditions under test ๐Ÿ˜•

manic glacierBOT
slender iron
#

It may be best to pull the pin when not in use. I'm off for a walk now.

onyx hinge
#

a lot of adafruit parts don't seem to have pulls on the built in neopixel, indicating it's not typically a problem

tulip sleet
#

I'm also off for a walk

manic glacierBOT
#

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...
orchid basinBOT
manic glacierBOT
#

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.

...

orchid basinBOT
orchid basinBOT
#

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.

crimson ferry
#

@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)?

onyx hinge
#

@crimson ferry I don't know for sure! I had intended to get the other "C".

crimson ferry
#

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

solar whale
#

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

crimson ferry
#

@solar whale I'll D/L from S3 & try it out

solar whale
#

thanks -- I'll create an issue after I'v done more testing.

crimson ferry
#

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)

solar whale
#

Consistent with what I am seeing

crimson ferry
#

boot.py seemed to run fine though, and code.py got a few hundred lines in before it manifested

solar whale
#

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.

crimson ferry
#

From minimal code in REPL, it seems to not like the onboard battery gauge (or I2C in general). I'll can file.

ember iris
manic glacierBOT
#

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...
idle owl
#

@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.

solar whale
#

No problem -- glad to help.

idle owl
#

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. ๐Ÿ™‚

ember iris
crimson ferry
#

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

solar whale
#

It is crashing when I try to initialize an I2C sensor, scan was ok, but init crashed

#

Seems to be I2C in general

ember iris
#

I think mine crashes on this line: i2c = busio.I2C(board.SCL, board.SDA), I don't scan at all

crimson ferry
#

yeah, scan seems fine

solar whale
#

I was able to i2c = board.I2C()

crimson ferry
#

and ```py

import busio
i2c = busio.I2C(board.SCL, board.SDA)

ember iris
#

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.
solar whale
#

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())

ember iris
#

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

solar whale
#

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

manic glacierBOT
solar whale
#

wierd -- bme280 works but si7021 does not ....

ember iris
#

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?

manic glacierBOT
solar whale
ember iris
solar whale
#

What I2C sensor are you using?

ember iris
#

a bme280, pm2.5, and sgp40

solar whale
#

bme280 works OK for me

#

so it's not all I2C

ember iris
manic glacierBOT
solar whale
#

I have to go offline -- enough fun for today -- thanks @crimson ferry and @ember iris

crimson ferry
#

it was consistent earlier, but now I can't get it to crash, and I2C works even if the control pin is high

ember iris
#

I wonder if we hit three different i2c issues at about the same time

orchid basinBOT
crimson ferry
#

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?

ember iris
crimson ferry
#

yeah, what all seemed clear upfront became... murky

ember iris
#

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

idle owl
#

@gilded cradle Am I missing something, or can you not do wav playback on MagTag? I feel like I'm missing something.

gilded cradle
idle owl
gilded cradle
idle owl
#

@onyx hinge ^^ ?

onyx hinge
idle owl
onyx hinge
#

but that needs an i2s thingy

idle owl
#

Right

#

I meant using the built in speaker.

onyx hinge
#

maybe it's not there

idle owl
#

Ok

onyx hinge
#

no audiopwmio, no audioio

winter mortar
#

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...?

orchid basinBOT
#

@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 [...

idle owl
onyx hinge
#

looks like we tried and it was heckin glitchy

idle owl
#

Alright, thanks for the info. Reporting back to the forums.

stuck elbow
#

at least it's consistent

onyx hinge
stuck elbow
#

fix it in software ;-)

#

have a lookup table of where the glitches happen and how much to correct fot them ;-)

idle owl
#

Hah!

stuck elbow
#

(please don't actually do that)

idle owl
#

Oh, now you tell me. I already started! ๐Ÿ˜„

orchid basinBOT
#

@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...

winter mortar
#

But how does it sound? You might be able to start a new genre

idle owl
#

glitchwav

stuck elbow
#

I can actually imagine how it sounds from that graph, and it makes my teeth hurt

orchid basinBOT
manic glacierBOT
orchid basinBOT
onyx hinge
orchid basinBOT
slender iron
#

@tulip sleet looks like using the sha to ci_fetch_deps worked

#

will make a pr now

tulip sleet
#

okay! does it need to be done in the 7.1.x branch too?

slender iron
#

ya, I'll do it there to be safe

#

will make the pr now

orchid basinBOT
manic glacierBOT
lime trellis
#

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

tulip sleet
lime trellis
lime trellis
# tulip sleet this is interesting. There have been SD card issues mentioned here which have be...

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

manic glacierBOT
#

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...

manic glacierBOT
sharp jacinth
#

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?

manic glacierBOT
manic glacierBOT
#

@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...

manic glacierBOT
#

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...

crimson ferry
#

ninja: error: unknown target 'esp-idf/esp_system/__ldgen_output_sections.ld' ...is this something to do with moving to idf 4.4?

analog bridge
#

is your esp-idf submodule updated?

crimson ferry
#

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

analog bridge
#

the submodule should be at ddc44956bf commit, what do you get with git status in the esp-idf folder

crimson ferry
#

HEAD detached at e493a4c30e

analog bridge
#

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

crimson ferry
#

lots of downloading, but this looks promising... thanks!

lone sandalBOT
crimson ferry
#

it's got other problems now, but it's after 1am, so... another time.

manic glacierBOT
lone sandalBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
tulip sleet
manic glacierBOT
onyx hinge
#

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

tulip sleet
#

do you think this has anything to do with the space-saving done in oofatfs? Was that post 7.0.0?

onyx hinge
#

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

tulip sleet
#

that's what I thought. I was wondering if it had to do with checking the dirty bit or where it was formatted

onyx hinge
#

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"

tulip sleet
#

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

manic glacierBOT
onyx hinge
#

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

orchid basinBOT
onyx hinge
#

I wonder if a card reset mid-CMD25 could be in a weird state .. but that's not what users are reporting

tulip sleet
#

@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.

onyx hinge
#

@tulip sleet pygamer is probably one of the easiest pieces of HW

tulip sleet
#

i have one

onyx hinge
#

grand central too

onyx hinge
#
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

tulip sleet
#

i will try on GC first because it has full SWD connector

onyx hinge
#

I appreciate you taking a look!

tulip sleet
#

at what version did these problems seem to start?

onyx hinge
#

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

onyx hinge
tulip sleet
#

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.

onyx hinge
#

hmm indeed

tulip sleet
#

@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

idle owl
#

@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.)

tidal kiln
#

@idle owl yo

idle owl
#

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.

tidal kiln
#

sure

idle owl
#

Template previews look a bit odd.

#

Also just noticed the "SOME OTHER TEXT HERE" I forgot about at the beginning ๐Ÿ˜†

manic glacierBOT
idle owl
#

@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.

manic glacierBOT
#

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
"""
...
tulip sleet
#

@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.

manic glacierBOT
#

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

onyx hinge
tulip sleet
#

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

onyx hinge
#

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.

tulip sleet
#

I can look at the PR in a few minutes

#

moving back one commit to verify

onyx hinge
#

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...

tulip sleet
#

yes, confirmed that's the commit

#

can I turn on some logging for you to see when it fails?

onyx hinge
#

there's not much logging

#

a saleae capture of the spi bus might show something

tulip sleet
#

I will turn on the DEBUG_PRINT for now

orchid basinBOT
#

@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...

onyx hinge
#

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;
           }
    
timber mango
#

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

tulip sleet
onyx hinge
#

do you want round() instead of int() ?

timber mango
#

Well the adafruit_gps module does int()

tulip sleet
#

is that really an HHMMSS or something

timber mango
#

with .000 numbers

#

Yeah, the GPS featherwing returns time as HHMMSS.000

#

so the 3 .000 seems to put off the seconds

tulip sleet
#

it should be parsed as a string, not as a number

onyx hinge
#

or int("184105.000".split(".", 1)[0]) awfulness

slender iron
#

or just slices to pick out the digits

timber mango
#

Actually through it would strip off the irrelevant decimals on its own, but int(184105.000) and int(184105.00) produce two different results

onyx hinge
#
>>> 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
tulip sleet
#

there are issues about this in the MPy repo

onyx hinge
#

it's a deliberate trade off because fully accurate parsing is slow and requires a lot of code

tulip sleet
#

@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

onyx hinge
#

yeah, not to me, with code space an issue.

timber mango
#

I'm a bit unsure why the int() is actually in the code.. time_struct seems to handle float ok..?

tulip sleet
#

it may have been transcribed from some Arduino code

timber mango
#

Will do some experimenting

onyx hinge
#

ah if you have long ints you can do better, but this is not true on all our boards by far

slender iron
#

the parsing code really shouldn't use float as an intermediary

tulip sleet
slender iron
#

yup

onyx hinge
#

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.

timber mango
#

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

tulip sleet
#

@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
slender iron
#

seems to me that _parse_data should parse into time.struct directly

tulip sleet
#

then do int on each of those

#

using ints makes sense in Arduino, with poor string handling, but in Python, string handling is easy

timber mango
slender iron
#

run time for me. CI is catching up on all my merges

lime trellis
tulip sleet
#

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

lime trellis
#

@tulip sleet have you tried flashing 7.0 and then talking to one of your "bad" cards?

manic glacierBOT
tulip sleet
#

yes, it works, iI bisected between 7.0.0 and tip and main. The hinge commit is one that adds CMD25 functionality

tulip sleet
#

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

manic glacierBOT
lime trellis
tulip sleet
#

I don't think they test it extensively, because SDIO is used mostly for speed reasons

manic glacierBOT
sharp jacinth
orchid basinBOT
#

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...

manic glacierBOT
#

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 ...

onyx hinge
sharp jacinth
# sharp jacinth Let me re find the library. You're right there's a ton of audio stuff

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

GitHub

CircuitPython module for interacting with the VS1053 audio codec. - GitHub - adafruit/Adafruit_CircuitPython_VS1053: CircuitPython module for interacting with the VS1053 audio codec.

#

I'm not liking the random jitters and stops that I can't control when using the pi

timber mango
# tulip sleet <@456226577798135808> If the GPS parsing code could be improved, please file an ...

@tulip sleet Tried my first at this, and will really appreciate feedback: https://github.com/adafruit/Adafruit_CircuitPython_GPS/pull/76

GitHub

Closes #75
Uses string parsing instead of math for generating timestamp_utc.
Avoids imprecise usage of float.
Sorry if i messed this up, its my first pull request.
Tested on Adafruit Feather Bluefr...

manic glacierBOT
#

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...

https://gist.github.com/jepler/8e5c829cfad6b2e...

tulip sleet
#

@onyx hinge somehow i missed your speculative early this afternoon. I will try it

onyx hinge
#

Thanks! I didn't @ you the first time.

sharp jacinth
tulip sleet
sharp jacinth
#

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

tulip sleet
#

are you complaining about VS1053 or about native audio

sharp jacinth
#

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

tulip sleet
#

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)

sharp jacinth
# tulip sleet this is without a VS1053, right?

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

tulip sleet
#

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?

sharp jacinth
#

Speakers but the line goes to an external amp

tulip sleet
#

then you could use the DAC output directly, because it is 3.3V max

#

as a line output to the external amp

sharp jacinth
#

Ooh ok. What can I google to make sure the Amp is sufficient? And can the DAC be connected to a headphone plug?

#

Thanks!

tulip sleet
#

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

sharp jacinth
#

Let me get the model.

tulip sleet
#

@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

onyx hinge
#

@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

sharp jacinth
#

It is a "70V/25V PA Amplifier"

tulip sleet
#

and it has a line-level input? Does it have a mic input too?

#

the specs are talking about the output

tulip sleet
#

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

onyx hinge
#

thank you so much for testing!

tulip sleet
#

I tried lowering the clock rate to 1MHz and even 100kHz, unsucessfully with the breakout

sharp jacinth
#

It does, 2 of them