#circuitpython-dev
1 messages ยท Page 387 of 1
a very small amount
Any idea if I can wire a 2-wire speaker to the breadboard pins and have it work?
For SKU 3678? You cannot wire a bare speaker up to that. It's just got a preamp out for headphones or line out to an amplified speaker. I use a little cheapie Bluetooth speaker with line in for such stuff
Ok. That's what I thought based on what little info I could find. I will have to place an order. To either get the I2S amp breakout, or a set of cheapie speakers.
As a comparison, this product has a built-in power amp (but only single-channel) https://www.adafruit.com/product/3006
Exactly what I was about to link.
I have this at my other office in the US. But not here in Canada with me.
So I'll need to order it here.
Thanks so much for the confirmation!
Huh I did not know this. I thought it would just be really quiet. Good to know!
Want to try a Pull Request? The change is in this file:
https://github.com/adafruit/circuitpython/blob/main/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/pins.c
Until it's fixed, you can access this pin with microcontroller.pin.GPIO9
can someone review https://github.com/adafruit/circuitpython/pull/5272 please?
@gilded cradle are you able to do the review above?
I can take a quick look, just give me a minute not as familiar with the watchdog code
Looks good to me. Less familiar with the qstr parts.
No problem, I vaguely recalled they were going to be away. Feel free to ping me if you need reviews I can do my best to look
thanks!
thanks again. got the build for https://github.com/adafruit/circuitpython/pull/5268 going. now I can go run ๐
Thanks for doing the review
No problem!
I was dealing with a flooding issue in the building here.
ouch that doesn't sound like fun
No, it could have been worse. Just ruined a stack of paper, but carpeting needs drying.
yea at least you were there to notice, its when you're out and it happens things go real bad
Yeah
This is good. Of course let's document the UUID somewhere.
Done here: https://github.com/adafruit/bluetooth-low-energy/pull/3
Added IO9 / VBAT_SENSE pin to lilygo_t8_s2_st7789 board
Tested with
import board
import analogio
vbat_voltage = analogio.AnalogIn(board.VBAT_SENSE)
def get_voltage(pin):
return (pin.value * 3.3) / 65536 * 2
while True:
battery_voltage = get_voltage(vbat_voltage)
print("VBat voltage: {:.2f}".format(battery_voltage))
time.sleep(1)
````
I believe that was the problem. Inspecting the file showed it to be 320kbit/s and 44.1khz, so basically .wav like. I used xcfa to move it to 64kbit/s and the pops are gone. It sounds kind of muted and scratchy, but that has probably to do more with manipulating the file too much. I'll play around with ripping at the correct rates and try again.
Thanks for looking at it!
In order to use displayio.Shape you must pass it to a TileGrid as the first parameter. This updates the docstrings to include Shape as one of the valid types for that parameter so that usages will not generate a warning from the IDE when you have circuitpython-stubs installed.
Makes sense, but if there are any more places where this is the case then we may want to put a shortcut for this Union[] in _types.pyi.
You're on a roll!
Id say you're at the bottom of the barrel, but well, you've not started reducing by bits yet...
I am not aware of any other places where both Bitmap and Shape are valid argument types. I'm glad you mentioned this though, I didn't know that file existed.
Thanks for the PR! One request
I think VOLTAGE_MONITOR or BATTERY are the standard names for this. How about renaming this BATTERY?
Sure, I copied the name from another board. But BATTERY it is, or will be soon. Thanks for the quick review. I'll make the change ASAP.
Convert _eve, _pew, aesio, alarm, audiopwmio, bitops, camera, canio, dualbank, gnss, i2cperipheral, imagecapture, ipaddress, memorymonitor, sdioio, socketpool, ssl, uheap, ustack, watchdog, and wifi modules to use MP_REGISTER_MODULE.
Related to #5183.
I think that I've now converted all modules in shared bindings that have a *_MODULE defined in py/circuitpy_mpconfig.h. I didn't see a module listed in MICROPY_PORT_BUILTIN_MODULES_STRONG_LINKS for the following modules in shared bindings, so didn't use MP_REGISTER_MODULE:
- multiterminal
- paralleldisplay
- nvm (submodule of microcontroller)
- os (listed in
MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKSand alt name listed inMICROPY_PORT_BUILTIN_MODULE_ALT_NAMESand I don't quite...
@PracticalMetal We want add a __name__ attribute and assign it a q-string value of 'board', since that's the name of the module. So that, at the serial terminal, instead of getting a blank name for the module:
>>> import board
>>> board
<module ''>
we would get 'board' instead:
>>> import board
>>> board # the next line prints 'board' instead of a blank string
<module 'board'>
Inside the pins.c file for each board (`ports//boards//pins...
@capellini I'm "out of the office" so I can't look into it in detail right now. If you want to try to PR just one of those changes, perhaps someone else can review it and give useful feedback.
@tannewt do you know why those modules are different, or if we need to handle the situation differently?
thank @tannewt for helping with the ci (I am a bit clueless), though somehow the new linker cause nrf52 not boot up any more (I have tried an clean and rebuild). I am not familiar enough to spot any issue.
Late to the party on this one, should the Union also include OnDiskBitmap ?
@lesamouraipourpre good catch, yes it should include OnDiskBitmap as well, that currently yields a similar warning in the IDE from stubs.
thank @tannewt for helping with the ci (I am a bit clueless), though somehow the new linker cause nrf52 not boot up any more (I have tried an clean and rebuild). I am not familiar enough to spot any issue.
Thanks for testing. Sorting .data and .bss breaks it. Feels like a memory bounds issue.
espidf, rp2pio and samd are port specific modules so I'd do those as a group.
The other four are micropython modules that we reorganized into shared-bindings. os and time are in this group too. I think they can be made strong links. MicroPython has uos and utime too which is why they have strong and weak links.
I'm not sure multiterminal is used anywhere. We used to use it on ESP8266 for webrepl but I'm not sure we'd go that route when we support ESP32 again.
`paralle...
I'm attempting to use the AppleMediaService advertisement, per the example here. I've run into the same problem as @Kimpehzor in adafruit/Adafruit_CircuitPython_BLE#130, so per @tannewt's direction I'm trying the "Absolute Newest" CircuitPython build and bundle:
- `adafruit-circuitpython-feather_nrf52840_express-en_US-20210901-2c45f94.u...
Merging so we can get this into absolute newest.
USB PID updated to match Espressif's allocation.
So I have this UDA1334A hooked up to a Pico. First thing I tried was the tone code from the guide. It "works"... but it doesn't seem to actually play the tone. As in, there is clearly an attempt at transmitting audio, there is a sort of static silence being played to the headphones at the appropriate interval, but it isn't a tone. Tried MP3 code, and it worked fine. So I'm a little confused. It's standard tone code, though it has a "volume" variable, but I increased that and it did not resolve the issue.
I remember the tone volume being included because the audio coming from this board if you don't have external volume control was painfully loud.
(I included a warning on that guide page to let the code run before putting the headphones on so you knew how loud it would be before having them in/on your ears.)
Tweaking things isn't fixing it, and frankly, I have no idea what I'm doing with it so I'm simply changing values to see what happens. Really, I've been comparing it to the Circuit Playground library tone code, and altering things that differ. It's not helping.
@idle owl is this unique to pico?
Valid question. I have not hooked it up to anything else this time around.
I can try another board.
I'm trying to think why the MP3 would play but the tone wouldn't. What wouldn't be getting set that lets one work but not the other
That's what was baffling me.
Grabbing some other board.
can you post (or have a link?) to the tone code?
I do, it's in a guide. One moment.
The major change I made was increasing the volume variable.
hmmm. looks like have the max98357a amp, but not the uda1334. so can't help test. sry.
That's the one I don't have, heh. Thanks though.
Oooh good call. So it works on Metro M4.
I'm wondering if not all pins are created equal on Pico.
the audio code is different on the two as well. As far as I know basically all the pico pins do everything
I have a script that returns valid pin combos. In theory if they're invalid, it errors (it did that initially on the Metro). It did not error on the Pico.
Yeah, that's what I thought too.
Oi...........
The pin combo script runs forever. Yeah, I don't think pin combo matters on Pico.
This is the combo I used, it is returned by the script Bit clock pin: board.GP0 Word select pin: board.GP1 Data pin: board.GP2
Hmph.
ยฏ_(ใ)_/ยฏ
I'm out of ideas.
Last ditch, I'll try it on Feather RP2040, see if it's a Pico or RP2040 issue?
If I have a soldered one anyway.
Hmm so exact code runs just replacing the sine wave part playing the MP3. I'm not really an I2S expert and trying to recall when I worked on some RP2040 audio stuff
Do not have a soldered one. ๐
Kinda like them not being soldered because STEMMA, but I guess it's time to sacrifice one of them.
I am finding I end up soldering them and if I want them someplace where I don't need it buying another one. Didn't say it was an economical plan
I already added one to my cart ๐
I don't have the I2S decoder so can't help there sorry
I'll at least solder up a Feather and test it.
@tidal kiln It still might help to hook that MAX up to a Pico and see if it plays a tone over the speaker. Would at least determine if it's I2S or the UDA.
already wiring...
yah. it'll take me a few.
@idle owl generally working. getting good tone. but it's not consistent. goes randomly loud/quiet on different loops.
import time
import array
import math
import audiocore
import board
import audiobusio
I2S_CLK = board.GP0
I2S_WS = board.GP1
I2S_DATA = board.GP2
audio = audiobusio.I2SOut(I2S_CLK, I2S_WS, I2S_DATA)
tone_volume = 0.1 # Increase this to increase the volume of the tone.
frequency = 440 # Set this to the Hz of the tone you want to generate.
length = 8000 // frequency
sine_wave = array.array("h", [0] * length)
for i in range(length):
sine_wave[i] = int((math.sin(math.pi * 2 * i / length)) * tone_volume * (2 ** 15 -1))
sine_wave_sample = audiocore.RawSample(sine_wave)
while True:
audio.play(sine_wave_sample, loop=True)
time.sleep(1)
audio.stop()
time.sleep(1)
Well what the what.....
Let me try on this Feather.
This is a new one. ValueError: Bit clock and word select must be sequential pins
swaps pins around
oh i wonder if its using PIO
No tone.
@idle owl also:
Adafruit CircuitPython 6.3.0 on 2021-06-01; Raspberry Pi Pico with rp2040
>>>
The PIO to write some stuff it has to be sequential pins
Ohhh
Let me try 6.
Been running 7.
Hah!
Tone!
does the bug filing time dance
Wow that was a frustrating one.
I don't even know what I'm supposed to be filing here. ๐
Good call.
@blissful pollen Do you have an idea of what I should be reporting here?
"Tone playback broken on 7x on RP2040" seems vague.
Or maybe it isn't.
I don't think it is that vague. I'd mention the sequential pin error message and that MP3s work
@idle owl which 7.x? let me see if i can recreate same failure.
Beta 0
Nothing special. The latest release on circuitpython.org
Oh good call. Thanks. Had already forgotten about MP3s.
If I have a chance later I can take a look at the code reading this while in a meeting that's just going on and on ๐
Let me load 6 on the Pico and see if I get tones.
@idle owl silence on 7.x. can got back to 6.3.0 and it works again.
is that problem still present on the absolute latest build? I feel like a couple of timing related changes were just merged for the pico last week
Checking.
Yeah ๐ฆ
I'm not ok with the fact that I can't get a tone on 6x though
And cater could.
I mean, I've hard reset the board between because you have to unplug it to get back into the bootloader.
I could nuke it I guess and try again.
The fact you had a weird issue on the Feather RP2040 is there too. May be something in the RP2040 I2S code
audio.show()?
Probably.
I2S on the RP2040 is a PIO program
That clarifies very little for me ๐
I don't have a huge grasp on RP2040 interworkings.
Which is to say... no grasp.
lol sorry. the PIO is their cool assembly like language to rapidly write input/output basically as fast as the processor clock speed
From quickly looking at the PIO program the timing pins are both "sideset" pins, and while the name isn't important the way they are written two means they have to be sequential. I believe that is for BCLK and WSEL
But this is where I know very little about I2S ๐
That's what the error said.
Incidental that I made them that way.
I didn't know ahead of time, I simply wanted the pins to be in order in the constructor.
CircuitPython version
Adafruit CircuitPython 7.0.0-beta.0-183-gb80ffee10 on 2021-09-01; Raspberry Pi Pico with rp2040
(but also the 7.0.0-beta.0 release)
Code/REPL
import time
import array
import math
import audiocore
import board
import audiobusio
I2S_CLK = board.GP0
I2S_WS = board.GP1
I2S_DATA = board.GP2
audio = audiobusio.I2SOut(I2S_CLK, I2S_WS, I2S_DATA)
tone_volume = 0.1 # Increase this to increase the volume of the tone.
frequency ...
@tidal kiln @blissful pollen ^^
BLE workflow had an incorrect list size for characteristics
Linking didn't advance . link it should have without extra ().
On the MAX i2s chip I get bad results if I leave the Gain pin floating. Volume fluctuates randomly.
The UDA doesn't appear to have gain.
I have one UDA plugged into the breadboard just waiting for me to wire it up.
@main furnace If you have a Pico and you're up for testing, I wouldn't mind a sanity check on the tone code. Carter was testing with the MAX I2S chip, not the UDA. It's also absolutely fine to decline.
@tidal kiln @blissful pollen WAV file playback doesn't work either on Pico running 7 absolute latest. Getting silence. ๐ฆ So could it also be audiocore-related?
works on 6.3.0?
Checking.
@tidal kiln Not for me.
But I couldn't get tone working on Pico for me either. ๐
oh. you didn't get 6.3.0 tone to work? you haven't been able to get anything i2s audio?
I'd bet something audiocore related for the RP2040. I don't think I have any I2S devices around though to test it though
Feather RP2040 did tone. Pico did MP3
over I2S.
but no tone on pico using 6.3.0?
Correct.
weird. that worked for me.
so dunno if it's a UDA vs. MAX thing? or something else?
That is accurate. But it also might be a red herring. If audiocore is borked for RP2040.
I will update the bug.
yah. given we aren't 100% same hardware. it could be (insert answer here).
So, update. WAV file playback is also resulting in silence on Pico running both 6.3.0 and 7.0.0-beta.0-183-gb80ffee10 using the UDA1334A.
I now suspect the issue may lie with audiocore.
Please let me know if you need any further information, or have builds to test.
Testing Pi Pico with UDA1334A.
With CP6 I hear the tone. Adafruit CircuitPython 6.3.0 on 2021-06-01; Raspberry Pi Pico with rp2040
With CP7 I hear static and some clicking. Adafruit CircuitPython 7.0.0-alpha.6-72-g162954a1a on 2021-08-17; Raspberry Pi Pico with rp2040
The static seems to be between the tones, or silence on CP7.
I can play 44100 sample/sec .wav files on CP7.
another PR needing review: https://github.com/adafruit/circuitpython/pull/5284
I had taken a quick look earlier give me 5
thank you!
Fascinating, I did a print when it was supposed to be playing, I thought it was doing the static during the playback. Blergh.
@main furnace That's you?
On CP6 the .wav files would eventually stop producing sound.
Taking a quick look at the code I am wondering if it is something with setting the frequency, it has to change the PIO playback frequency. It could explain why some clips seem to play
yeah, I'm 'rsbohn' on github.
haha I didn't realize that that song was StreetChicken.
It and its name is a John Park special. ๐
๐ I have this 'drama.wav' 22050 samples/sec.
I think I downloaded it from this channel, actually.
Drama was a JP special as well!
I got so tired of the coin sound and the laugh.wav, that I begged for something new. So he put together a few clips for me.
Hmph. Ok I'll try with yours.
I'm starting to suspect my Pico. ๐
I will thank you for giving me the incentive to wire up the UDA breakout. Thanks!
You're entirely welcome! I greatly appreciate you testing it and giving me a sanity check. It's not the results I was hoping for (failure would match mine ๐ ), but it's better to know.
If you have an analog amp (TPA2012, etc., or try on the MacroPad), does PWMAudioOut work?
It appears there are conflicting test results of RawSample vs WaveFile.
I had trouble with I2SOut due to miswiring sometimes.
I did WaveFile testing with the test program in #5196, adapted to the SAMD or RP2040 board I was testing on (I2SOut vs PWMAudioOut, and whether or not there was SPEAKER_ENABLE).
@dhalbert I just did MP3 playback using PWM with the PAM8302 on the Pico and MacroPad - and tone playback definitely works on the MacroPad, it's built into the library.
Should I try something else?
SAMD51 worked with I2S and tone playback.
I'm concerned about my Pico because Carter and rsbohn are getting similar results to each other, but my results are odd.
Triple-check the wiring is all I could suggest. The I2S amp I was using did not have the pins in the same order as the order on the board. I was testing with a Feather RP2040 because it has a reset button.
I think I was using the MAX98357A I2S amp.
LRC is WS, BCLK is CLK, DIN is DATA, I think that's what I did on MAX98357A.
Correct on the different order of pins from CircuitPython to the breakout - the UDA is clearer on pin names. I triple checked my wiring, and it appears to be right. Remember, it works with MP3 playback over I2S.
I ordered the MAX, I don't have it yet, I won't have it until Monday.
@idle owl try making the length longer (multply the length by say, 8, at least), and also take out the loop=True
But if that code works on the MacroPad with PWMAudioOut, I am confused (see how similar it is to the library code)
Ok, that doesn't explain WAV playback also not working though.
Tried both of these suggestions and I'm still getting staticky silence.
With a pop.
Can you do PWMAudioOut on the RP2040 to an analog amp?
Which I think is the click.
@tulip sleet Like this? ```py
import board
import audiomp3
import audiopwmio
audio = audiopwmio.PWMAudioOut(board.GP0)
decoder = audiomp3.MP3Decoder(open("slow.mp3", "rb"))
audio.play(decoder)
while audio.playing:
pass
print("Done playing!")```
to the PAM8302?
the low-level code doesn't know it's from Wave or Raw or PWM vs I2s.
try a wav file, not MP3
try it both with Wave and tone
Oi, WAV is just making a quiet squeal.
checking wiring.
Wiring verified.
Checking tone.
does the same wav file play on the macropad?
the squeal is due to the amplifier amplifying noise, I think
you have ground connected to the - input and GP0 to + input?
Yes.
Sorry, trying to get this wav file onto the MacroPad, copying is taking forever.
Yes it plays.
Save wav file.
macropad uses GP16 to the speaker amp; try GP16 on the Pico.
same program? or you are using the macropad library?
Same program
Not MacroPad lib
GP16 is still squeal.
For tone.
Let me try wav.
Same.
I only quickly glanced at the I2S code but any chance Dan that something is not being set in the PIO program frequency correctly for tones? could explain why mp3s work or anything "standard"
I2SOut was working for me earlier, so I don't understand why it isn't now. I didn't change that part, I was changing the DMA
I tried wav files with many different sampling frequencies
alpha.6 I think had the fix
yes, alpha.6 has #5097
yeah, it had multiple problems
Right.
But proof of concept.
going back to latest.
(โฏยฐโกยฐ๏ผโฏ๏ธต โปโโป
IT'S WORKING.
Trying tone.
power cycle in between if not working
but is a tone on MacroPad?
Trying one more time
No.
It's a click and a fshhhh silence.
Without the MacroPad lib.
Running beta.0
not the tip of main.
alright, I will try this Monday or Tuesday
unless Scott or someone else wants to step in; we will fix it
I'm planning on doing an rc with it as a known issue
Scott was going to take a look during AaE. It was blocking me on a guide, but Limor unblocked me with other stuff.
Also that.
I'll create the I2S template as though it's all working, and then we'll add it to the guide with Pico once it's fixed, basically. In the meantime, I will do other things.
@tulip sleet Thanks for the help. I'm still not above blaming my Pico.
Limor figured you'd take a look when you got back.
sure; it's broken on beta.0? or is it rc.0 that you are testing, or alpha.6?
beta.0, and the latest build off of S3, which is a built of beta.0 with a number after it.
Tried with both.
ok, that's helpful; something is weird, but I won't stew about it
it's not urgent ๐
๐ See to it that you don't! You can sort it soon enough.
bye!
Later!
Automated website update for release 7.0.0-rc.0 by Blinka.
New boards:
- espressif_hmi_devkit_1
- lolin_s2_mini
- adafruit_led_glasses_nrf52840
- warmbit_bluepixel
- jpconstantineau_encoderpad_rp2040
When I load the latest build (from S3) the Pi Pico stops showing up as the E: drive (no drive at all). When I go back to a build from 8/17 it works again.
Same result with ItsyBitsy RP2040 (older 8/30 build works as expected).
tries it
@main furnace I don't get a drive either. ๐ฆ
I should have tested it before making an RC
oops
On #5280 @lesamouraipourpre correctly pointed out that OnDiskBitmap is also a valid type for the first argument of the TileGrid constructor.
This addes OnDiskBitmap in the docstrings for TileGrid so that IDEs will not report an error when circuitpython-stubs are installed. Tested by running make stubs and installing them locally.
FYI, this breaks mass storage on the RP2040.
but only on windows apparently ?
I think Scott is on linux and mentioned that he doesn't see the drive either.
ah, I see it on my mac, not on windows
Note releasing this on the website because mass storage is broken on the RP2040.
oh fascinating that's an actual file name: /media/CIRCUITPY/.TemporaryItems/folders.501/TemporaryItems/(A Document Being Saved By BBEdit)
ah no it's a directory name
working pico build
I need make some projects with my pico's. I haven't used them much except for testing a few things and it throws me off every time that there is no reset button
updated tinyusb to even newer ๐
thach has been fixing bugs found with the usb compliance test
fwiw I do get a CIRCUITPY drive with Adafruit CircuitPython 7.0.0-rc.0 on 2021-09-02; Raspberry Pi Pico with rp2040
huh, interesting
could be flaky
I saw it once after linux reset the device
popped right up with the build I just posted
The improvements are based on the USB compliance tests.
firmware.uf2 -- now the drive appears
awesome! Just made a PR for that update
will need to test other ports tomorrow
before I do rc.1
Ah, yeah I ran microcontroller.reset() and something does seem to be off the drive eventually showed up but took like 20-30 seconds when normally it's only a few seconds max.
I will check that firmware you posted real quick as well.
it updates tinyusb further. thach made fixes for samd and rp2040 since the previous update
Yep no issues with that one. Drive re-appears within a few seconds like normal.
great!
Fixes the missing CIRCUITPYTHON drive issue from earlier builds on RPi Pico RP2040.
oh yeah I put a captain risetti on one of mine, and... just shoved a 2-pins tactile button into another. I'll pretend it's a press fit.
Very much improved if you add a reset button.
Ah, I was wondering how pairing information persists without being explicitly stored! That's really good to know.
Clearing the bonding information worked!
@tannewt right, i plan to push the update for rp2040 and samd, it will fix by then. was about to push the update as well, but pushed back due to issue testing with nrf52, will make another PR.
ESP-NOW is a great remote control protocol. It can achieve much longer range (with much lower bandwidth) than WiFi and needs no network access, making it resistant to many issues that affect portable control systems, such as security.
I would use this protocol today if it were available to write a wireless multi-servo control, using an M5 for the UI/HID and an ESP32-S2 as the receiver/controller.
I am doing compliance verification test for samd and rp2040, will report result in a few minutes.
STM32F4 seems fine with CIRCUITPY drive visibility on rc0 FWIW
Both SAM51 and Rp2040 passed all the Compliance Test (chapter 9, HID, MSC) as expected :+1: .
However, SAMD21 (tested on M0 metro) has issue with following chapter9 test cases:
- TD 9.16 Enumeration Test where the host repeatedly issue bus reset + enumeration for 150 times and
- sometime TD9.9 Halt Endpoint Test.
Note: SAMD21 pass that same tests on my simple example, it is rather similar to a previous issue where setup packet is missed on samd21 as mentioned in this note https:...
As per the title, here are the files for my FeatherS2 Neo board.
Does anyone know how to get the frozen modules updated to the latest commit hashes? Specifically the Neopixel library?
It's pointing to b2f21e6 but the latest is 0f4661c that has a fix in it that prevents me from using 7.0 with my boards.
Can I just checkout the newer commit hash in my local repo and then do a PR against that to get it updated?
Or does someone "official" have to do that?
To include the try/catch on the power pin to not have it fail if the user already has control of the pin
Well I did it... let's see if I get in trouble ๐
I found out that the circuitpython stm32 port doesn't support C++ which is a problem but I think it can be worked around.
Would it be possible to intake this micropython commit to add c++ support to stm32?
https://github.com/micropython/micropython/commit/97960dc7deb7a0e691fca5944402cd03386b744b
The other option is to build the c++ parts externally and link them into the firmware. I'm already doing this for the tensorflow bits but it could be expanded to also include the micropython...
Adding Radomir's STAGE (C side) on my TinyS2 so it can be using on my new Explorer Shield without seeing custom firmware.
Update the documentation for Display.refresh() which had two paragraphs starting 'When auto refresh is off,'
Why are you using this PID? I see it allocated to something else internally. Maybe request one from Espressif instead?
For next time, at the top level you can do make update-frozen-libraries to update them all.
Looks like you did get the PID from Espressif. The PID is correct but the VID is wrong. It should be 0x303a for Espressif.
Great! I'll close this. I think the new bonding code will invalidate any existing identities when a new copy is written. So, it shouldn't happen going forwards.
@tidal kiln for the sgp40--would you like me to add an example for lower memory use loosely following the example I outlined, or would that cause more confusion with the sensor usage overall?
@ember iris this one?
https://github.com/adafruit/Adafruit_CircuitPython_SGP40/pull/9#issuecomment-911841050
based on that yes, it'll look different because it'll require two 'controllers', one just to run and log the sensor, and a second one with more memory to convert it to a voc index, but the example would be based on that
i think existing example is ok
as you mention, the sensor is sort of meaningless without the VOC algorithm
but if someone wanted to be simple/low memory, they'd just never call measure_index and only use raw
since you only import/create an instance if measure_index is called
I'd be happy to see C++ support integrated into our build files. I've not used C++ for embedded though so I'm not sure what exactly would need to change.
Why are you planning on linking to the prebuilt .a files? I'd prefer to build it directly into the binary if we can. That way we can tweak the compilation options and maybe use LTO.
you'd want something like your other example if things were kept separate
if VOCAlgorithm weren't part of the SGP40 class
That makes sense. Thanks for helping with the pull request and being a second set of eyes. I had been dug deep in the sgp40 docs and just missed a lot because of it
since you'd need an example showing how to bring both in, create, and use together
yah. np on the review. wasn't able to actually vet the algorithm itself. but it seems like it's working and providing useful results for your use case. so you were the tester for that ๐
The algorithm is nuts. It's basically two phases (one for the heating element being turned on and one for the heating element fully heated) that pipe into a 24 hour table of, 'Right I'm seeing this much of a change, I'm not use to it, and I only respond to VOCs so lets bump the score' with 'Ok I've gotten use to this, lets go to a score of 100'
To understand if that's a smart approach I'd need to understand the physics of their metal oxide layer, which I might one day look up, but for now I'll trust sensirion
Should I be testing the release candidate, or should I be testing the absolute newest?
for CP firmware?
Yup! I'm updating most of my boards and am curious what's the most useful build to use right now
sort of depends
in general, use latest release, and if you find any issues, bring them up
absolute newest if you are helping test fixes for such issues
Good to know! Thank you!
"latest release" could either be stable (like 6.3.0) or alpha/beta for next version (like 7.0.0 beta 0)
"absolute newest" is whatever latest commit is. very much a moving target.
so there can be like 3 flavors
- stable
- unstable
- absolute newest
there can be cases, with newer hardware, where unstable is the only option. shouldn't be that way forever. just until a stable release is made.
macropad is like that right now
That makes sense. So for the process of moving a release candidate to a stable release--do the absolute newest changes get omitted unless one of the changes solves a major bug that was present in the release candidate? And in the absence of a major bug, is the release candidate the version that gets rolled into the stable release?
that's generally it. but scott/dan would better know those details.
ok I think I get it. Thank you for the explanation, I appreciate it!
Rc.0 had a pretty serious bug for rp2040 so that may influence your choice too
Oh good to know! I'll use the nightly on those in that case.
Since I'm getting more comfortable with circuit python, I'm starting to be more willing to use unstable versions in hopes that I'll get better at bug hunting
And the projects are just small senor arrays for around the home, so stability isn't that critical
Automated website update for release 7.0.0-rc.1 by Blinka.
New boards:
- unexpectedmaker_feathers2_neo
- lolin_s2_mini
- espressif_hmi_devkit_1
- warmbit_bluepixel
- adafruit_led_glasses_nrf52840
- jpconstantineau_encoderpad_rp2040
That's a lot of new boards.. all since rc 0?
they tend to cluster
Scott stopped the auto update for rc 0 because of the issue with rp2040
so it's the new boards since the beta
Super sorry! I totally forgot I got the FS2 PID from Adafruit, so only updated the PID, not the VID.
Thanks for taking care of this @tannewt !
For next time, at the top level you can do
make update-frozen-librariesto update them all.
Oh, that's what I was looking for when I asked on Discord, but everyone was asleep :(
Thanks!
Thanks everyone for rc.1! I did bring the hmi board so I may even try it out on vacation
Haha, I just spent 6 hours re-flashing all of my FeatherS2Neo stock with rc0! Oh well... everyone can update their own boards when they get them!
Thank you everyone! I just ran into this exact problem playing around with my new macro keyboard. I'm new to circuit python and of course chose Cura as the application I would use as a test! disabled USB printing in marketplace and solved the problem. So it's not me writing bad code after all!
Probably the issue that led to rc1 is not a problem on the ESP32S2.
Oh, sure, not saying there is an issue with rc0 on my boards - just that I could have waited a day and put rc1 on instead ๐
Sure... but I should have realised that Scott's gonna push to get 7 released, so another rc was close. It's all fine ๐
Just saw that the list of Unknown boards is pretty long.
Getting mine in to help out.
I love linters. A linter is a program that looks for problems in code without running it. There is something gratifying about running a linter on a codebase and seeing a big list of warnings and errors. Sometimes it can even be fun to fix them!
if I understand correctly .. any use of while will be flagged by a future pylint? that'll be, umm, controversial.
Using the static library was a shortcut which worked on esp32 so I didn't have to know how it all worked on the tensorflow side.
In getting to the answer on how to link it I built most of such an approach to build everything from the micropython side.
I will continue and incorporate into my eventual pull request.
it looks like it's off by default, the other one is just as bad if you ask me, the ternary expression in python is visual garbage (if you allow me to be "opinionated" as they say)
oh phew won't be enabled by default
they call that "extensions" or plugins ?
I hope there's enough value in having a more consistent style in circuitpython code, vs just mindlessly changing code until it causes the linter to stop complaining. it's a trade-off
based on past experience I have about a 25% chance of breaking code I'm authoring by fixing pylint diagnostics, which is frustrating.
that's a real danger yeah, especially when they add new stuff and like me you accidentally update pylint in your venv
Some questions regarding the new board definition for Lolin S2 Mini: Since the board has no factory-installed NeoPixel, I'm guessing that NeoPixel should be removed from mpconfigboard.h & pins.c? Unexpected Maker creates pin assignments (e.g. An, Dn, DACn) for his boards for py code compatibility. The Lolin S2 Mini has labels only for SoC GPIO numbers. How to handle this?
GPIO only is also pretty normal. Since the silkscreen and the supplied decals only list the GPIO numbers I'd suggest leaving them at that.
In addition, with regard to the neopixel assignments, they're not on optimal pins even if you wanted them to remain. A lot of folks will only be using the outer rows to plug them into D1 devices I suspect.
I'm leaning in this direction too. It's nice to see I2C, SPI, etc. enumerated at dir(board, but people would need to look up the GPIO labels in that case. Probably best to be minimally specific; its normal to change pin assignments in code when changing boards.
Given the lack of silkscreen guidance or even one of those fancy infographics, having to look up the pins is probably inevitable.
I agree about the NeoPixel too, simply reused UM's pin assignments. E.g. these common little WS2812 breakouts could work nicely directly on header pins. Does anyone know if a NeoPixel can be assigned as CP's status indicator at runtime?
Smarter Shopping, Better Living! Aliexpress.com
no it can't
It might be worthwhile to look at the Micropython pins.h for that board to see what they've done there. Its somewhere to be found on the wemos github.
the board doesn't have dedicated SPI or I2C pins on the silkscreen, neopixel or neopixel power pins, all that should be removed
(from mpconfig.h too)
The maker does define specific pins for SPI/I2C in their micropython port though
(first-party-written)
okay, found that at https://github.com/wemos/micropython/blob/master/ports/esp32/boards/LOLIN_S2_MINI/mpconfigboard.h - different from UM's
is that information available in doc ?
Those are more sensible pins too, consistent with the D1-mini-subset of the header
They match the D1 mini's pins for those functions
Probably justification to leave the pin definitions in, since there's already an established ecosystem of add-on boards using those pins.
esp32-s2 datasheet says I2C & SPI2/3 on any GPIO pins. D1 mini 'D' pins could be labeled, but shields are inconsistent for their use, at least with I2C often overlapping with other uses (some shields have pin use pads).
IMO, they should be left in, but changed to the micropython assignments.
And ditch the neopixel or make it a -Doption on the build
But choose a pair of pins that are more accessible, possibly the one that their one-neopixel shield uses.
Oh never mind that last, that uses the same one as the micropython-assigned SDA...
CIRCUITPY_STATUS_LED_POWER and NOPIXEL_POWER should be removed anyway
Yar
Oh, the new neopixel shield uses D4, which corresponds to gpio 16 on the S2
that would be a potential candidate for board.NEOPIXEL
I was just looking at that "RGB LED Shield V1.0.0". First pin assignment changes (mostly removals) at https://github.com/durapensa/circuitpython/commit/762c15535f72a7beaafeff8fb426fbf895b585e5
That's not their first neopixel shield, there was an earlier one hardwired to D2 which is not very useful.
Note, CP build fails when using the latest esp-idf pulled with esp-idf/install.sh
Yes, their original NeoPixel shield appears EOL (only clones still exist)
are you sure? I just updated and built a couple hours ago.
I'm gonna probably order a few more boards, gonna take a look through shields too and at least order a couple of the neopixel ones.
tried again with adafruit/circuitpython main, using esp-2021r1-8.4.0 from .espressif/tools/xtensa-esp32s2-elf (not the older esp-2020r3-8.4.0)
Why remove CIRCUITPY_STATUS_LED_POWER? That's the S2 Mini onboard LED on GPIO15.
no, that's the pin that turns on the power to the neopixel
okay, clear now thanks.
I'm trying to figure out how espressif's parallel lcd library pin names map onto circuitpython ... espressif has "cs", "wr" and "rs" pins. circuitpython has "chip_select", "write", "read", and "reset" pins. "read" never seems to be used (or is just always driven high / true)
hum there are already two versions of the HMI DevKit ... mine is silkscreened "V1.1" and the versions are ??? and 2. The only schematic in the repo is for "1.1".
๐ค
huh my HMI devkit does NOT power on with the USB C-C cable that I use on my phone... it's fine with an A-C cable I also had around.
I verified the C-C cable works between computer & phone. so hm.
I hooked up a logic analyzer: under USB power using SPIM3 (default) it airs and looks normal:

under battery power, it fails and there is no activity on the SPI lines!

If I then created the "dummy" SPI device to bypass SPIM3 both USB and Batter power...
Wemos/Lolin's MicroPython pin assignments for this board, plus pin assignments from Wemos D1 Mini board (S2 Mini is supposed to retain some shield compatibility with D1 Mini). Also, ESP32-S2 has hardware LED_PWM.
It's possible the devkit asks for a current the phone can't deliver so while the usb c negotiation is taking place it says if you can't supply the minimum level current don't send any?
There is no usb pd negotiation ic but I assumed you could get 5v 500ma regardless. Anywayi have a working cable and that's what counts
huh. No idea. Chalk it up to phones are weird I suppose?
I just tested this on another SPI device (BMP390) to see if this is a general issue.
I used the following bit of code:
import time
import board
import adafruit_bmp3xx
import digitalio
spi = board.SPI()
cs = digitalio.DigitalInOut(board.RX)
bmp = adafruit_bmp3xx.BMP3XX_SPI(spi, cs)
while True:
print(bmp.pressure)
time.sleep(0.5)
It works fine on USB power, but on battery it also fails:
>>> supervisor.get_previous_traceback()
'Traceback (most recen...
@mrdalgaard Thanks -- That was next on my todo list!
I also reproduced the same behavior using a Particle ARGON board (nrf52840)
Something very odd about SPIM3
Googling nrf52840 spim3 produced some interesting discussions but none that seemed relevant...yet.
?serverinfo
Thanks for these updates. Just added suggestions to delete the things you commented out. No need to have them since they'll never be added.
There may be several reasons why we might want to remove the logo form
the REPL: a fork of CircuitPython that doesn't have the right to use the
logo, an especially small display that needs all the room it has to be
useful, displays that are especially vulnerable to burn-in, maybe even
the smaller chips where we want to save as much flash memory as
possible.
I have a problem with pylint here: https://github.com/adafruit/Adafruit_CircuitPython_ImageLoad/pull/55/checks?check_run_id=3508903158
it looks like the failures are due to earlier commits, that somehow slipped past
what should be done in such case?
is the pylint version used set to a fixed version ?
I think the pylint that runs on the library code is fixed version 2.7.1 currently, from here: https://github.com/adafruit/Adafruit_CircuitPython_ImageLoad/blob/071d6e8f7d2c17ff5bcc18d0160d7e6b8074aa5d/.pre-commit-config.yaml#L21 but when it gets run on the examples from here: https://github.com/adafruit/Adafruit_CircuitPython_ImageLoad/blob/071d6e8f7d2c17ff5bcc18d0160d7e6b8074aa5d/.pre-commit-config.yaml#L33 it's executing just pylint in the shell which is using the one installed from here: https://github.com/adafruit/Adafruit_CircuitPython_ImageLoad/blob/071d6e8f7d2c17ff5bcc18d0160d7e6b8074aa5d/.github/workflows/build.yml#L47 without specifying version and thus taking the newest current release.
I just went ahead and fixed all the warnings and failing tests
@lone axle I would greatly appreciate if you could take a look at it
Will do after I finish up with work for the day. about another hour and a half or so.
weekend soon!
This changes all pins.c to:
- use board_module_globals_table for the dictionary (not that important, but makes it consistent).
- add a CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS macro as the first element to make it more monolithic.
- put
board.board_idand__name__in it from the board init header. - add this for 4 boards that were missing it.
Later we can move the standard i2c and spi buses to this macro
Instead of specifying them in multiple places (mpcofgig and pins)
yeah, I'm looking into doing that, but that will wait after 7.0.0
This issue might be related:
https://devzone.nordicsemi.com/f/nordic-q-a/74754/nrf52840-application-won-t-completely-run-without-power-applied-to-vbus
Since the nRF chip has VBUS directly connected to it, it might actually change behaviour based on whether USB power is connected.
This could also be related, but have not tested with a capacitor yet:
https://devzone.nordicsemi.com/f/nordic-q-a/65475/spim-3-mosi-must-be-tied-to-ground-via-capacitor-to-work/268076#268076
SPIM3 does look ...
@onyx hinge would this be a reasonable way to do it ? (and add the same for SPI, UART, etc.) - BOARD_I2C is true if there are default I2C pins in mpconfigboard.h
#if BOARD_I2C
#define BOARD_MODULE_DICT_DEFAULT_I2C \
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(DEFAULT_I2C_BUS_SDA) }, \
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(DEFAULT_I2C_BUS_SCL) }, \
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
#endif
#define CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS \
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_board) }, \
{ MP_ROM_QSTR(MP_QSTR_board_id), MP_ROM_PTR(&board_module_id_obj) }, \
BOARD_MODULE_DICT_DEFAULT_I2C
Where can I find some code examples of CIRCUIT Python for the NeoTrinkey? I have reported that I get a 404 error when I try to follow the link on the learning page.
@jaunty juniper close, I think.. you need a #else from #if BOARD_I2C that defines BOARD_MODULE_DICT_DEFAULT_I2C as expanding to nothing. Other than that, I think the above is on the right track.
you have to delete the lines from the individual pins files too of course, and I don't know if BOARD_I2C is a define that exists already
it is, I noticed that when I looked into implementing a second I2C singleton on the QT PY 2040 a long time ago
that's ugly but I think it compiles
@jaunty juniper I think that's on the right track, yup
next_code_allocation and prev_traceback_allocation are in the IMMOVABLE group. See: https://github.com/adafruit/circuitpython/blob/7ce3f256509ba64b63ea926922d22854f8fb8ac7/supervisor/shared/memory.c#L39. However, calls to the allocate_memory() function are with the argument movable = true. This causes an assert: https://github.com/adafruit/circuitpython/blob/7ce3f256509ba64b63ea926922d22854f8fb8ac7/supervisor/shared/memory.c#L168
Interesting -- the first link does appear to be the same issue
amaul
amaul 4 months ago
SPI signals are obviously coming through with VBUS powered. With VBUS disconnected the only signal that I have a heartbeat on is Chip Select. MISO, MOSI and CLK are low and do not even trip a trigger acquisition. Signal frequency doesn't really match the working configuration, but I supposed that would be expected. Logic level and voltage level looks correct. I'll need to check with the BSP on...
An additional observation -- If I power it up via USB, then disconnect the USB and leave it on battery power, it continues to operate normally. The issue only occurs if it is powered up or RESET when in battery power.
An additional observation -- If I power it up via USB, then disconnect the USB and leave it on battery power, it continues to operate normally. The issue only occurs if it is powered up or RESET when in battery power.
Yes, and since the person in the first link does not seem to be using CircuitPython, it would seem to be a problem with the hardware, or the bootloader, which is in common.
Reverted a commit adding board_id, since it is now set using a macro.
SPIM3 has a number of errata. We have implemented a RAM workaround to get it to work reliably. But I had not heard of this VBUS issue until now. I will look at this further in a few days and probably ask Nordic about it.
Are there specific examples that you're looking for? This page has an example for how to work with the Neopixels: https://learn.adafruit.com/adafruit-neo-trinkey/neopixel-blink and this page the capaticitive touch input: https://learn.adafruit.com/adafruit-neo-trinkey/capacitive-touch-neopixel-brightness For most intents and purposes this device is just a standard CircuitPython device so anything from https://learn.adafruit.com/circuitpython-essentials would be relavent as well, although some things would be difficult to hook up to that device in particular since it doesn't have broken out IO pins available.
@lone axle Great. Thanks for the pointers. I also asked on help-with-circuit-python and received a pointer.
you're welcome, one more that might be helpful: https://learn.adafruit.com/products/4870/guides this page has an overview of the device and a link to all of the learn projects that use the device so you can find other project ideas from here.
@lone axle I had not seen that page nor seen it when I was looking. Are there similar pages for other products and if so where are they located. This would be very useful information that could be published on some of the other pages. Thanks again.
There are similar pages for other products. For example this one is for the CircuitPlayground express: https://learn.adafruit.com/products/3333/guides Some of them are linked on the download page for that device on https://circuitpython.org/ On the left side under the Tutorials header:
but I don't think every product has the link on that downloads page. I usually use this trick to find them. Load up one of the products that does have the page and then edit the URL in the address bar. You can change out the 4 digit numerical product code to be whatever product you want. If you search up a product on the main adafruit site and then check in the URL you can see it's product code.
https://learn.adafruit.com/products/3333/guides
https://learn.adafruit.com/products/[put product code here]/guides
@lone axle I am not sure how I missed the "New Guides" heading on the Learn page. Sometimes I get tooo focused and run into the forest/trees problem. Again, your insight into how to find things should be more prominently identified. Perhaps it would be useful for Phil or Lady to occasionally mention this during Show and Tell.
@lone axleI have often wished for a "Guide for the Impatient". When I am focused on getting something up and running, I would like to have the bare bones steps to show how to boot the device, download the UF2, pointer to the code, pointer to the Guide, subgraph of code projects. I hate to get bogged down in text and I would really like to have a MindManager type diagram for each product with visual clues. Perhaps someone on the team already has some Python GUI building expertise and code that could lay the groundwork for this capability to use more visual navigation. Users could chose to use the textual, visual or combination for navigation. I would be glad to test and perhaps contribute.
That would be pretty neat for sure. The main guide for each device should contain all of that information but it does tend to be a bit heavier on the text than it sounds like you're looking for
Essentially it would be like Device "Quick Start" pages
or "Cheat Sheet" for the device, though I try not to use that term when possible since it implies breaking the rules sort of.
Probably this PR should remain on hold until tinyuf2-lolin_s2_mini-...zip with combined.bin is available at https://github.com/adafruit/tinyuf2/releases. For review in any case.
PyCubed users:
- Note pin changes between mainboardv04 to mainboardv05!
- Remember that pycubed's low-level boot counter is not present on the circuitpython main branch. This is because a truly low-level boot counter implementation requires modifications to circuitpython's main.c file.
- To implement the PyCubed boot counter for yourself, add the following to
/main.cPri...#include "shared-bindings/nvm/ByteArray.h" // PYCUBED BOOT COUNTER
- To implement the PyCubed boot counter for yourself, add the following to
https://github.com/orhun/git-cliff looks interesting but I don't know that we want to force people to learn a new "markup" that they have to write in commit messages ..
hi CircuitPython wizards, I have a native library question: is there a way to have a native module called in the background regularly by the supervisor without modifying supervisor/shared/tick.c? I notice this is how keypad does it, but I also see supervisor/shared/background_callback.c being used by a few other modules. What is the differences between the two approaches?
in rc.1, is there a meaning to NeoPixels (violet) and LED flashing once per second after startup? The Blinka shows up in the REPL on FunHouse, for example, then it goes into this pattern. Was running beta.0 fine.
(same behavior on all esp32-s2, PyPortal was fine with the upgrade)
rc.0 is the same behavior as rc.1
hmmm I see the normal green blink every 5s after code has done running, or solid white (a little blinding still on Funhouse !) when in the REPL
@tannewt would there be many changes for the micro:bit v1 to run CircuitPython or is the slightly lower spec hardware not capable?
This is a good comparison of both the new features and the processor/memory differences.
https://kitronik.co.uk/blogs/resources/explore-micro-bit-v1-microbit-v2-differences
@spoelstraethan I doubt CircuitPython can be squeezed into 16 KB RAM; even 32 KB boards are a very tight fit.
the rc.1 issue seems to be in my boot.py, probably something to do with alarm.sleep_memory
yo, anyone know of a circuitpython repo on github that runs Circuitpython tests (e.g., on push)?
I have CPython but seems like it would be really nice to test with even the linux build of circuitpython.
just looking for an example to follow. I spose I can check out circuitpython, build the linux port and run tests but seems like a hassle someone else would have figured out already ๐
I haven't seen something like that at all
I really want to code coverage and unit test my CirPy project(s) but I don't see the capacity without a "fake"/"soft" board
I say this without any insult but I don't think these kinds of testing are on a feature map (yet)
I'd like them to be but I don't think (aka this is my opinion and not a fact) this kind of feature will be in any time soon
Personally I donโt really care about coverage as a quality indicator. Just interested in turning a PR red when it makes circuitpython not work ๐
Will have to spend a little time and see if thereโs a relatively straightforward path. Probably have to implement some subset of pytest, thinking about it a little more ๐คฆ
coverage is pretty useful not for quality but making sure the quantity of code is "correct"
It can be used for a number of different stats, quality isn't a great one
With pytest, if you run into pexpect, let me know, I'm one of the maintainers over there :)
(pytest uses pexpect for self testing, etc)
@low sentinel But what does "not work" mean here? Not build or break functionality/bugs that people might have been using previously?
Something for Jepler when they're back, https://github.com/Red-M/PymKeeb/blob/master/Firmware/boot.py#L46-L53
I found that since their blog's example of NKRO USB HID didn't work on the latest beta so I had to fix the call up.
The TinyUSB update fixes the USB MSC. The wrong variable was used in the if loop condition which caused the issue.
@hollow token thereโs theory about what coverage does but I have regularly seen it (1) reduce velocity, (2) increase hacks to reduce lines of code, (3) cause false tests that execute branches but assert nothing (I.e., it definitely does not indicate correctness from my perspective). Itโs all anecdotal but yeah, not a fan & itโs okay that others like it!
โNot workโ was chosen intentionally as vague. I want to test a circuitpython/native interface that might behave differently in major revisions of circuitpython. Maybe Idk what youโre asking about, I want to test my code on the target runtime. Seems like a normal thing to want to do? ๐
Thanks, Iโll ping you if I run into troubles when/if I get a little time to do this.
So you want actual tests and testing that CirPy builds isn't going to cut it, aka unit tests
and yes, unit tests are pretty normal and coverage is a tool that can be used as with any tool, incorrectly
@kamtom480 hmm, I take this back, seem like i really meant to use total_bytes according to comment there. Please give me time to pull out Spresense to test.
I ported the MicroBit 5x5 font over and write a font/scrolling text class - I need to work on the font kerning because the font doesn't include any width data, so going to need to parse the font and add some extra meta data, but I'm pretty happy with this!
Don't merge this yet, I am trying to find a better solution since this will cause the MSC compliance test suite to fail. For reason please checkout my comment here https://github.com/hathach/tinyusb/pull/1070#issuecomment-913543607
Fixes #4672
Tested with the following:
(.venv) ~/Dev/circuitpython/tools:$> python
Python 3.8.2 (default, May 20 2020, 16:07:42)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import json
>>> import pathlib
>>> from build_board_info import get_board_mapping
>>> fpath = pathlib.Path().home()
>>> with open(fpath / "Dev" / "frozen_board_mapping.txt", "w") as f:
... json.dump(get_board_mapping(), f, indent=2)
...
>>>
...
@low sentinel and @hollow token. I'm not sure either of these are exactly what you're looking for but perhaps a starting point or something to reference if you do dive into it. Kevin Thomas set up a unittest module for CircuitPython: https://github.com/mytechnotalent/CircuitPython_Unittest and ntoll has done some work on testing as well and wrote a blog post about their experience: https://ntoll.org/article/circuitpython-tests/
There is also rosie-ci https://github.com/adafruit/rosie-ci which is a way to run tests on physical devices that are connected to a PC running a webserver.
there's the simulator in the making, maybe that can help test things in the future https://github.com/adafruit/circuitpython/issues/5212
@lone axle thanks these are great resources! Between this and redm Iโll be squared away.
[deleted and reposted - previous post had several errors]
The UDA1334A breakout cannot drive a speaker: it is line-level output meant to drive an amp. I tried a UDA1334A into a TPA2012 analog amp, playing WAV files and I am hearing output. Are you testing the UDA1334A directly to a speaker, or with an amp in between?
I am not hearing the sine wave test at the top, though; I'm working on that.
BTW, I am hearing more scratchiness on I2SOut than PWMAudioOut, but that is a different issue.
@Neradoc pointed out on Discord that a UF2 bootloader download section exists conditionally in board.html based on data in bootloaders.json
I'd need some guidance to update both, particularly considering that ESP32-S2 boards would be new to both.
why would boot.py execution behavior be affected by the content of code.py?
fiesystem corruption?
I started with a fresh storage.erase_filesystem()
what's the issue ?
I can get it to happen consistently, but no minimal example (yet?)
if I have a boot.py (content of boot.py doesn't seem to matter?) in the release candidate (doesn't happen in beta), AND I have my normal code.py on device, The device, FunHouse in this case, will start up, I'll see the Blinka icon on the display, nothing else prints, then it goes into flashing purple and the LED every second. Needs safe mode and deletion or renaming boot.py to recover.
But a trivial code.py doesn't seem to trigger the behavior.
My code runs fine in the release candidate, only if there is no boot.py
as far as I can tell, it should never be getting to my code.py, since boot.py doesn't even execute (e.g., a boot.py with just a print statement
just the Blinka icon and black screen
but then it goes black totally (no Blinka) when it starts the lighting pattern
any esp32-s2 that I've tested does this, on rc only, not beta
PyPortal does not have this behavior
you might not see anything on the screen because it happens before the screen is refreshed
I'll try a delay
with this boot.py, same bahavior:py print("hello from boot.py") while True: print(".", end="")
yeah I just tried and the presence of a boot.py causes a boot loop
(on a funhouse in this case)
but not always, certain trivial boot.py + certain trivial code.py run just fine
ah, interesting ...empty+empty
I am too lazy to test with an install without tinyuf2
haha
but it's always a good test to do
it goes to boot_out.txt
only built-in displays
trying it w/o TinyUF2...
empty code.py + empty boot.py is fine without TinyUF2, I'll file an issue
thanks for the help in narrowing it down
CircuitPython version
Adafruit CircuitPython 7.0.0-rc.1 on 2021-09-02; Adafruit FunHouse with ESP32S2
Code/REPL
None
Behavior
On an ESP32-S2 device (Fun House in this case) without TinyUF2, device behaves as expected.
On the same device with TinyUF2, starting clean from a fresh storage.erase_filesystem(), with either empty boot.py + empty code.py, or some (but not all) combinations of trivial and non-trivial boot.py + code.py, the ...
CircuitPython version
Adafruit CircuitPython 6.1.0 on 2021-01-21; Adafruit QT Py M0 with samd21e18 also
Adafruit CircuitPython 7.0.0-beta.0-161-g65753a1c2 on 2021-09-01; with samd51j19
Code/REPL
# 09/03/2021
# looses both least significant bits
# tested on QT Py and Metro_M4_Express
import board
import digitalio
import adafruit_bitbangio as bitbangio
nEN = digitalio.DigitalInOut(board.A1)
nEN.direction = digitalio.Direction.OUTPUT
spi =...
CircuitPython version
7.0rc1 for RPi Pico
Code/REPL
# not related to code
Behavior
In MicroPython up to latest release and in CircuitPython up to (at least) 6.3.0, entering the raw REPL gives fixed "greeting": raw REPL; CTRL-B to exit>'. In CP 7.0 rc1 for Raspbery Pi Pico, this greeting is lost and Thonny IDE can't read the confirmation about entering raw REPL anymore.
I haven't tested, but I suspect all tools depending on pyboard.py (eg. rs...
It's possible something's buggy at 4a9ad8a9424bfdc16d58d69ce19bf4425296ff6d and this got lost?
- mp_hal_stdout_tx_str("raw REPL; CTRL-B to exit\r\n");
+ serial_write_compressed(translate("raw REPL; CTRL-B to exit\n"));
in addition, this would only work in English, not in other languages once they've localized this message.
in addition, this would only work in English, not in other languages once they've localized this message.
I haven't checked it in 6.3.0, but in an older CP release this was not localized (and I hope it won't be, because raw repl is not meant for the users)
Right, the ability to localize this string was added between 6.3.0 and now. Perhaps the impacts of doing so were not fully analyzed and it'll need to be reverted. But that message looks a LOT like it's intended for a human to read and understand, which is one of the reasons I made it so that it could be localized.
Can you test with that commit reverted and see if it fixes the problem you initially reported?
I caved this morning and converted the font glyphs to column data, and now I have auto font kerning by ignoring columns with data of 0 and enforcing a single column space between all characters - looks great!
Nice!
Now I plan to ship some cool demo code on the board, including using the ntp stuff from @jaunty juniper as well as adding some extra glyphs and maybe some digital signal displays based on a pin state...
I might actually work on this on my stream tomorrow - hacking code realtime in CPY is super sweet!!!
It really is ๐
I'm seeing this problem, too. I know this was not an issue during the alpha releases for 7.0.0.
@kamtom480 I made an PR with special walkaround for cxd56 due to the reason that nuttx stack does not forward clear/set feature(endpoint) request to dcd. IMO, It is an better fix. Please check it out https://github.com/hathach/tinyusb/pull/1075
@jepler, reverting 4a9ad8a9424bfdc16d58d69ce19bf4425296ff6d makes CP usable in Thonny again.
I hope you agree to not localize "raw REPL; CTRL-B to exit\n". The other strings in this commit are not relevant for Thonny and I agree that localizing Paste mode greeting makes sense.
@kamtom480 would you mind to bump up the tinyusb update for the hathach/tinyusb#1075
The update that fixes MSC on Spresense. Thank you @hathach.
Will merge when ci passes
I see why localizing it is a problem for these other pieces of software right now, but a user can accidentally press the key combination to enter this mode.
We'll revert this change or a portion of it soon to avoid breaking other software, but can you help us plan how to make our possible to localize it in the future such as in circuit python 8?
Thanks for the report. A couple of questions:
- Does your device require
phase=1? Is it misbehaving? - Did you set the Saleae Logic SPI analyzer to CPHA=1? Screenshot below is from Logic 2.3.36:

The operative code is here, and looks OK to me on first glance:
https://github.com/adafruit/circuitpython/blob/d29a12cd81c12b76ce94317074c6396755ccde6c/shared-module/bitbangi...
can you help us plan how to make our possible to localize it in the future such as in circuit python 8?
The best I can think of is prefixing the standard marker with translated explanation, so that Ctrl+A would produce something like this:
NB! You have entered the mode which is meant for automatic tools, not for human users. Press Ctrl+B to get back to friendly shell
raw REPL; CTRL-B to exit
>
Current Thonny version would then output the first line as if it was regular ...
I have a fix that restores I2S output, by not trying to reuse the buffer supplied by RawSample as an output buffer. However, it is intermittently buzzy, which can sometimes only be fixed by a power-cycle. I hear this same buzziness in 6.3.0, so I think that was an existing problem.
The current RP2040 code does not do anything special to expand mono samples to stereo. I2S output is always stereo. By contrast, the SAMD implementation sets a special "mono" mode of the SAMD peripheral, which...
I think it's more complicated... if I start clean, empty boot & code will work repeatedly. It seems like there's some unexpected state being retained in some cases, and once the error triggers, it will keep triggering across hard resets until boot.py is removed. It would almost have to be something in flash.
I think it's more complicated... if I start clean, empty boot & code will work repeatedly. It seems like there's some unexpected state being retained in some cases, and once the error triggers, it will keep triggering across hard resets until boot.py is removed. It would almost have to be something in flash?
Another behavior I hadn't seen before: Some non-trivial boot.py and non-trivial code.py combinations will not trigger the looping, but the code.py will not run. boot.py output:...
Hi, not sure if I'm being dumb or not. I have a feather S2 with a oled shield. When I plug into my macbook via usb-c the feather seems to randomly reboot and the drive disappears and then re-appears (as if I unplugged it and re-plugged it). Is this something that is happening for a reason? The screen says "Code stopped by auto-reload. soft reboot output:".
I'm new to micropython but a very experienced python dev.
ah, this might actually be a watchdog running in the code.
circuitpython does a soft reboot when it detects a write to the drive, but that shouldn't make the drive disappear
What is the "Code stopped by auto-reload" bit? Is that part of the bootloader?
Actually, the drive seems stable now. No idea why.
and as I say that, it drops. I'm going to remove the watchdog code and see if that stops the drive disappearing.
that's the soft-reboot after writing to the disk
Thanks for the help @stuck elbow
https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting#prevent-and-remove-macos-hidden-files-2978468-49 <-- My mac was being smart and writing stuff to the drive.
Hi Dan,
I first noticed this as I was driving a DDS chip. Using busio the DDS did not set to quite the right frequency. The LSBit is generally not a big impact but for the DDS it was the LSbit in the msb of the frequency set and set the frequency about 10% low over what it should have been. I was using the equivalent of the metro_m4_express. I then did a Busio version which worked OK with the same polarity/phase settings. I then tried the bitbang version on the QT PY which is the waveform th...
Thanks, your inline image did not come through. Could you post directly in GitHub?
Which DDS chip is it?
[I edited your reply to remove the repetition of my post.]
Hi Dan,
I am not well versed in Github unfortunately. One more thing to master. I posted the waveforms and programs on the Adafruit Forum under 'SPI Busio vs Bitbangio' on sept 3. It is under gingle in Adafruit Circuitpython and Micropython. The DDS was an AD9832.
Could you send any replies to @.@.>? I am doing most of my work at home and have my files on my home computer.
Thanks,
Glen
From: Dan Halbert @.***>
Sent: Tuesday, September 7, 2021 9:36 AM
To: adafruit/c...
@tulip sleet free now
Skipping the meeting without notes... ๐ฆ
<@&356864093652516868> Meeting is starting in 5 minutes or so. (Was delayed 24 hours for Labor Day holiday here in the US.)
Link to the doc?
Going to lurk/afk through the meeting
@turbid radish you can ctrl-Z the expansion of your name to undo it
i have to do that all the time
I hit escape before moving on from my name.
Thanks
that is better! I have to retype my name if i ctrl-z, but it does not expand the second time
Definitely, thanks Scott
๐ missing the meeting due to being a tourist
Go keep being a tourist!
You enjoy yourself ๐ Have a lovely time.
@crimson ferry Are you on mic today?
sorry
No worries ๐
Oh yeah massive hug report to Justin for all the help
Probably saved me 30 hours of work at this point
A group anti-hug for weed whackers and leaf blowers
And construction equipment.
Sounds good.
there's the circuitpython.org repo for the valid values for board ids (in the latest release) https://github.com/adafruit/circuitpython-org/blob/master/_data/files.json
Awesome! thank you.
@jaunty juniper That sounds really useful.
where does the board_id come from? it doesn't seem to be in the ports/*/boards files, but it seems to match the binary/UF2 filename?
it's the folder name
oh ๐คฆ
Thanks!
Thanks everyone.
thanks everyone 
@dhalbert Here are the MP3s from my example.
single-code.txt
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/1FFbgAbScOMYtfsaJNmNGlxLPucVKkRWj6YuQ2r4KEdk/edit?usp=sharing
CircuitPython Weekly for September 13th, 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 partici...
FYI, the RP2040 memory system will expand narrow writes to 32 bits. This is how the 16 bit mono sample becomes a 32 bit stereo sample, the RP2040 mirrors the 16bits to the second position. See the pico example for details.
Are there control characters that we could use instead of reverting this? I don't like prioritizing interfacing with a machine over a human. (Will follow up on the issue too. Thanks for the quick PR.)
Are there ASCII or UTF-8 control characters we can use instead? I don't like prioritizing machine interoperability over human interop. Serial messages are NOT a stable API for software to work against.
CircuitPython version
Adafruit CircuitPython github (2021-09-08), with ItsyBitsy M4 Express / Mini SAM M4.
Code/REPL
make BOARD=itsybitsy_m4_express
or
make BOARD=mini_sam_m4
Behavior
audio_dma.c: In function 'audio_evsys_handler':
audio_dma.c:420:31: error: implicit declaration of function 'dma_write_back_descriptor' [-Werror=implicit-function-declaration]
420 | (DmacDescriptor *)dma_write_back_descriptor(dma->dma_channel)->DES...
Make RP2040 I2S work again.
- Don't attempt to use the sample buffer as the DMA buffer if no conversion is needed. Instead, always copy the sample buffer into the output buffer.
- Move the I2S PIO restart slightly to avoid starting before an error check.
- Add explanatory comment about getting mono->stereo conversion for free.
The quality of the I2S audio is not great: there are buzzes and noise, which happen erratically. A power cycle or reset can improve things temporarily. However,...
The samd-peripherals submodule has been updated. You'll need to get the new version:
git submodule sync --quiet --recursive && git submodule update --init
Also note that the esp-idf submodule has been updated, and is now in a different repo.
How about making a new board def for the new revision? That way the old one will still work. You can add the boot counter behind a flag and then merge it in if you want to be on main.
@tulip sleet Can I please get builds for the Pico and the Feather RP2040 from you? Or I can wait until tomorrow when the checks have completed. Up to you.
Builds from #5310.
@idle owl Feather RP2040
Thanks for the PR! One rename/rework suggestion that will hopefully be straightforward. (Let me know if it isn't.)
Please switch these to reading the value and then putting the default in py/circuitpy_mpconfig.h. I also inverted the name since positive flags are easier to reason about.
#if CIRCUITPY_REPL_LOGO
pico
Cheers!
Thanks for the updates! Looks good to me.
@tannewt
I am tinkering with parts from an old AdaBox -- a Circuit Playground Express and Mini Remote Control [Product ID: 389].
I installed CircuitPython 6.3.0 on the Circuit Playground Express. I also created a lib folder on the CPE and dropped the adafruit_irremote.mpy from Bundle for Version 6.x in it.
I then placed this code into a code.py file on it:
import board
import pulseio
import adafruit_irremote
pulseIn = pulseio.PulseIn(board.IR_RX, maxlen=120, idle_state=...
@tulip sleet Tried Pico since that was first available. WAV playback worked immediately. I'm still getting silence for tones. ๐ Going to try the other Pico I brought with me just to try it, but .. eh.
@idle owl this is the test program I used for a sine sample. I separated the cycle size and the length so I could vary one without affecting the other.
@tannewt would there be many changes for the micro:bit v1 to run CircuitPython or is the slightly lower spec hardware not capable?
No, I don't plan on supporting the v1. As tyomitch points out, the change from 128k ram to 16k ram is a huge downgrade. We regularly have folks frustrated with the 32k ram on the SAMD21.
I hear a tone!
With UDA and headphones.
Hmph.
Ok. I haven't heard crunchy yet. But I believe you on that one.
@tulip sleet Do you want me to test on Feather as well?
I tested almost exclusively on Feather, so no reason to, I think. I heard crunchy on both.
Ok. Sounds good.
what is the diff between your tone program and mine??
I'll send you mine.
give me a sec, it's in a bunch of other commented out programs because I was going back and forth so quickly testing things the other day.
i have a zillion small programs: they are all in the .zip in the PR
@tulip sleet ^^
The I2S pins are obvs different.
But that's all I changed in yours.
And yours works.
one is loop=True and one isn't. I will try in a few minutes: just about to eat a quick meal
Ok. Take your time!
since the sample you created is not looping, it is quite short. Try changing the * 8 to * 80. It makes a short audible blip tone for me
Ok checking.
at the same time, you may need to change the length in the for loop to 8000 // frequency, to generate just one cycle that's repeated over and over
There's a faint something, and if I change the frequency, that faint something changes pitch. But it's not a tone.
I"m not sure why the * 8 was added in the first place
Ok trying the second thing you suggested.
anyway, my test program is essentially the same thing. cycle is 8000 / frequency (I used float division for better accuracy).
There it is.
Take out the * xx and it plays a tone.
Weird though
If I simply take it out of the length variable, it is still silence.
the original tone code in, say, the CPy lib, does not have the *8, and it has loop=True, right?
If I change length inside the for loop to (8000 // frequency), it plays a tone.
They're the same thing!
right, because otherwise that value is wrong, and will not generate a sine wave of the corret frequency
This uses a step output from the test job to set the build matrix
for the board build jobs. The built boards depends on which files
were changed.
- Changes contained within ports/*/boards/ will build each board.
- Changes contained within ports/* will build all boards from the
port. - All other file changes will build all boards.
All boards will be build for pushes in adafruit/circuitpython as
well.
A side-effect is that we no longer need to explicitly list the
boards to b...
that's why mine separates the two. cycle is the length of a single sine wave cycle, up and down and up to zero again. length is how long the whole thing is
IF you don't have loop=True
it is playing the whole sample, just once, without loop=True. So the longer length is, the longer it will play
e.g. from CPy library: self._sample.play(self._sine_wave_sample, loop=True)
Right.
I don't know why my code ended up this way. It's gone through so many iterations, and I'm not even sure where I got it from.
Odd about the clickiness tho.
Maybe more time for it to happen.
Or my perception of it is wrong.
the i2s quality is still not good, though. if you let it play many times it may turn rough
Fair enough.
We tout it as higher quality! ๐
I guess I'll leave that bit out of the template for now.
(Which means forever because I can't imagine remembering to go back and change that if we resolve that.)
it's higher quality except on RP2040
it should be pretty fine on the other boards
So it says that for other boards but not RP2040.
Fair enough.
Now I kind of want the CircuitPython version numbers to include -grungy instead of -dirty when altered. ๐
Can this simulator be run headless? I'd love to use it for library CI to track memory use.
Yes, I made a small demo repo for you it runs the simulator from the command line inside a Node.js progress:
https://github.com/wokwi/rp2040js-circuitpython
It's just the bare minimum that you need to get the Pi Pico CircuitPython build running in your terminal - if you need any help customizing it to run on the CI, I'd love to help!
@tulip sleet Ok, I'll reply to the PR.
thanks for the testing; we do have to figure out what's wrong with the RP2040 I2S. The way it's implemented is very different from other ports.
Thank you for the fix! WAV playback and tone playback are now functional on Pico. The tone playback took some tweaking but it's consistent now. WAV playback worked immediately.
Tested on Raspberry Pi Pico RP2040 with UDA1334A.
@tulip sleet Merge it?
@slender iron do you want to review #5310?
RP2040 I2SOut can have many clicks and buzzes, and other artifacts. The quality can vary between successive plays of the identical audio. A power cycle or reset can make it sound better, but only for a while.
The PIO I2S implementation is free-running, at the same clock rate as the DMA writing. But it appears to get out of sync or bad data is introduced somehow.
See #5283 and #5310 for further comments and test programs.
Just left for a walk. Iโm ok if you want to merge. Otherwise I can look when I get back. Must have come in after I got through my email
tnks, I think we'll go ahead for now, since it's a quick fix for RC
@idle owl I am updating the frozen libraries to catch up for 7.0.0 final, but are there any upcoming library changes I should wait for?
Um.... I don't think so. I think we did all the major things already. And we'll have other releases to catch up with.
great, thanks!
@tulip sleet looks good
Starred! Thank you!
My main use for it would be measuring import sizes of libraries so we'd need a way to dump memory state at a certain point. Something similar to the memory analysis I did a while back.
Can you replicate this with a DEBUG build when it is outputting to the debug UART?
I haven't watch the whole thing, but from skimming it seems like you use GDB to take the memory dump. There's a GDB Interface built into the simulator, so I can change the demo repo to expose that on a certain port. Would that do the trick, or do prefer a different method for dumping the memory?
I haven't done a DEBUG build since it became too big to generate, but I'll ask around to see how to make it fit.
This has probably been asked and answered somewhere, but what do you do to make the (esp32s2) CP image smaller so that a DEBUG build will make successfully?
@tulip sleet I'd like to get the fix for thonny in 7.0.0, I'll work on it tomorrow while I'm at adafruit
If it's not too late
not too late by any means. Perhaps some marker could be negotiated with Thonny.
I haven't done a DEBUG build since it became too big to generate, but I'll ask around to see how to make it fit.
Paulsk cut the wifi buffers in half and made it fit: #help-with-circuitpython message
I suspect that the REPL marker is partially to blame with some of the problems I'm having with the Lolin S2 Mini. (After Thonny fails to connect to it, it goes into crash mode and I can only reproduce this with Thonny, I can connect to repl just fine with screen, putty, etc. without crashing it)
How about making a new board def for the new revision? That way the old one will still work. You can add the boot counter behind a flag and then merge it in if you want to be on main.
@tannewt are seperate board defs your preferred method of handling major board revisions? Part of me yearns for a cleaner solution than that, especially since folks are wanting firmware for multiple D51 flash sizes (J19 and J20, for example). Maybe solution is discrete board defs but easily managed ...
Looks like microdev already did it
he did a revert, but Scott would like something better in the long run, yes. But that doesn't have to be for 7.0.0
Looks good, and the build worked. Now we should see the artifacts uploading on the merge.
I wouldn't mind testing for fixed control characters in CircuitPython (and for the original marker in MicroPython), but I like my suggestion more, as pyboard.py would be happy with this and IMO it wouldn't hurt human interoperability at all.
Neat! That should be enough.
Done! If you need any help with automating it, I'm at your service.
I ended up disabling modules that I wasn't using.
thanks, I set up to try that, and will, after I find and catch the chipmunk that got into my house
thanks!
I did further testing, and I don't believe this is a software problem. It was some kind of electrical issue with the MAX98357A and how I wired it. When I connected a Saleae up the problem went away. When I removed the Saleae ground return, the problem came back. I connected Vin and GND more directly, and that fixed the problem. Reducing the MAX98357A gain might also help.
๐ฟ๏ธ issue: Closed.
DEBUG=1 make issue: โ
but , ๐คฆ , got the funhouse all set up to test and realized it doesn't have the debug pins exposed, so I have to test this on a device without a built-in display
Howdy! I searched, and didnt find what I needed, so perhaps I'm looking for the wrong thing, or using the wrong terms
I'm currently working with a MatrixPortal M4 w/ the 32x64 matrix display. I'm having a hard time finding a way to display simple symbols, even common unicode, for like arrows. I'm assuming this is due to the bdf and/or the terminalio.FONT font not having these characters in them.
So, are there any symbol / glyph bdf fonts? Or do I need to figure out tilegrids?
Reducing wifi buffers was another suggestion to workaround this, but I couldn't find where / how to do that, so turned off modules so that it built. Just as a stake in the sand, I was able to build DEBUG=1 on esp32-s2 7.0.0-rc.1 with the following changes:
CIRCUITPY_AUDIOCORE ?= 0
CIRCUITPY_AUDIOBUSIO ?= 0
CIRCUITPY_AUDIOBUSIO_I2SOUT ?= 0
CIRCUITPY_AUDIOMIXER ?= 0
CIRCUITPY_CANIO ?= 0
CIRCUITPY_DUALBANK ?= 0
CIRCUITPY_IMAGECAPTURE ?= 0
CIRCUITPY_ROTARYIO ?= 0
CIRCUITPY_PS2IO...
Switched to Cucumber RIS since Funhouse doesn't have debug pins exposed.
- erased flash
- installed TinyUF2 combined
- installed CP
rc.1
Initial test with no boot.py and default code.py gives this in the debug console on startup:
# ...
I (904) cpu_start: Pro cpu up.
I (1318) spiram: SPI SRAM memory test OK
Creating an empty boot.py gave an ambiguous result on hard reset, repeatedly. No "Hello World!, but it's possible that tio didn't reconnect in time. It ...
I think you are correct in your assumption that the default font does not include many of the special character symbols (I think only the ones available on a standard keyboard using only default keys and shift).
I don't know specifically about unicode symbols but Jeff did port a copy of an early version of font awesome for use with circuitpython. Here is an example that shows how to use it: https://github.com/adafruit/Adafruit_CircuitPython_Bitmap_Font/blob/main/examples/bitmap_font_label_forkawesome.py perhaps there are symbols within that font that will suit your needs.
Here is the blog post talking about making it work with CircuitPython if that part is of interest to you: https://emergent.unpythonic.net/01606790241
Oh, interesting. Lemme give this a try. Thanks
Ya, separate board defs are preferred. Board revisions in my book don't change pinouts. Revisions would only change layout or compatible parts.
We have lots of infrastructure to handle many boards. (I just added a tweak to CI to only build changed boards for PRs.) Adding another level like revision or configuration will just add complexity to the tooling.
That has lead me to here which has more info: https://learn.adafruit.com/custom-fonts-for-pyportal-circuitpython-display?view=all
@tulip sleet is this the non-updated version of USB descriptors? bitmap_keyboard = usb_hid.Device( report_descriptor = bitmap_keyboard_descriptor, usage_page = 0x1, usage = 0x6, in_report_length = 16, out_report_length = 1, report_id_index = BITMAP_KEYBOARD_DESCRIPTOR_REPORT_ID, )
Is the fix report_ids = [BITMAP_KEYBOARD_DESCRIPTOR_REPORT_ID] and remove report_id_index?
If I put a larger code.py on it, it will go into a boot loop, but the debug console in this particular case looks more normal on each iteration (no gibberish):
# ...
I (915) cpu_start: Pro cpu up.
I (1329) spiram: SPI SRAM memory test OK
ESP-ROM:esp32s2-rc4-20191025
Yes, and change to in_report_lengths and out_report_lengths as parallel sequences to report_ids.
@tulip sleet thanks, looks like my page in that usb hid device (at least) didn't get updated
i did update my HID page in the guide
the only device I have with me will probably run into trouble with this esp32s2 boot.py bug that has been reported so I don't want to experiment right now
and also some stuff on my personal blog, which someone mentioned here on discord the other day I think
This allows tools to look for invisible characters rather than
human readable phrases that may be translated.
This includes a GCC flag fix for nRF with GCC 11.2. See
https://github.com/adafruit/Adafruit_nRF52_Bootloader/pull/221
for background on the flag.
Fixes #5307
In #5315 I have CircuitPython echo back the sent control codes to confirm what mode it is in. So, here is what it does:
\x01(Ctrl-A) for raw repl. Sent after friendly message.\x02(Ctrl-B) for regular repl. Sent before friendly message when exiting paste or raw modes.\x05(Ctrl-E) for paste mode. Sent after friendly message.
This character is defined as "enquiry". Some terminal programs respond to it, for instance the rxvt terminal on Linux will respond with the binary string \033[1?2c, explained as
"ESC [ ? 1 ; 2 c" (``I am a VT100 with Advanced Video Option'')
The other characters you used have some kind of meaning in ASCII (and, by inheritance, as unicode/utf-8) but ^E is the one that I think may cause a problem with "real, in the world" terminals.
did anybody get a handle on this esp32-s2 problem yet? I wonder if scott & I didn't fully get that gc bug fixed or something.
I'd vote for leaving #5315 for 8.0 and reverting to old behavior in 7.0.
I'd vote for leaving #5315 for 8.0 and reverting to old behavior in 7.0.
This would also leave more time to discuss it with MicroPython people. It would be nice if tool interface worked the same on both platforms.
No, I have not looked at this. I think a bisect might be in order.
This doesn't completely resolve #5307.
While working on this issue I noticed that the raw repl marker was missing because pyexec wasn't included in the qstr sources and thus translate() returned NULL.
Initially, #5308 contained a fix for this issue by adding pexec to qstr source but later I changed the PR to reverting localization when the concern about localization affecting the use of the message as a marker was raised.
I agree it is late in the 7.0.0 cycle to change this, though we don't have to wait for 8.0.0: as soon as MicroPython and we agree, we can add it for some 7.x version.
@tannewt If you would like to provide a translatable message, for now we could print the English message and print the translate() message if TRANSLATION is not English.
aha that explains why the strings didn't appear, I guess. I would have told you I tested it but clearly that would have been a lie.
If it can be described in a general way for all ESP32-S2 boards, then yes, that would be great, thanks! We would certainly entertain a PR.
for now we could print the English message and print the
translate()message ifTRANSLATIONis not English.
Please note, that tools currently look for b"raw REPL; CTRL-B to exit\r\n>", so English after the translation would be better for tools.
what's the generic way to print to some serial from within core code for debugging purposes?
mp_printf(&mp_plat_print, "x: %d\n", x);
but on ESP32-S2 you can use the ESP_LOGI() macro
I tried the esp-idf logging, but it didn't seem to work in main.c (I could have easily put it in a bad spot)
It looks like this should work for me .. Thanks for your help!
Follow up from #5307. CP 7 broke Thonny and other serial based tools because it relies on certain messages. Translating these messages breaks the tools. Instead, we should add invisible characters that these tools can used to determine serial link state (human repl, raw repl vs paste mode). These characters will remove the dependence of these tools on the messages that may change from version to version.
cc @aivarannamaa
@slender iron from here I could just feel your pain at being practical, but given time we'll be able to get to the better place you're aiming for ๐
you know me too well
nah, but i know you a good amount
Ok, I merged in @microDev1's revert and filed #5317 to track the work. Tools shouldn't be relying on message content so I'd rather put our efforts into determining invisible characters that serve the same purpose.
CircuitPython version
Adafruit CircuitPython 7.0.0-rc.1 on 2021-09-02; Adafruit Feather nRF52840 Express with nRF52840
Code/REPL
import time, alarm
time.sleep(15)
time_alarm = alarm.time.TimeAlarm(monotonic_time=time.monotonic() + 30)
alarm.exit_and_deep_sleep_until_alarms(time_alarm)
Behavior
After startup my cheap multimeter measures around 0.5mA for the first 15 seconds, and over twice that for the last 15 seconds (in deep sleep)
Light sle...
See adafruit/Adafruit_nRF52_Bootloader#221
for background on the flag.
"bisect" means something like: black-box testing the 106 S3 UF2s between the most recent known good-build and the oldest known issue-build, binary-search-like, to find which merge introduced the issue?
git has a builtin "bisect", you can use the builds, but you can also do it by building
you could use the S3 UF2's if you have a known good one, but I clean them up every month or two
beta.0 was fine, rc.0 was not ...I'll do it manually since the builds are already there and I have to load & run each anyway to see if boot.py works
I tested the last script on CP 7.0.0-rc.1 and it worked correctly - no errors.
BLE central debugging
to be fair, you only need to test approximately log2(106) builds though
right, the range of 106 ...actually only 53, I was also counting the .bin files ...actually picked the first bad one on the first round, but had to run 5 more to confirm
Manual bisect shows earliest S3 artifact with this issue is:
2021-08-27T22:59:12.000Z 2.6 MB adafruit-circuitpython-gravitech_cucumber_rs-en_US-20210827-31b9dd4.uf2
If I read the tea leaves right, I think that correlates to:
https://github.com/adafruit/circuitpython/pull/5245
I just realized you are using the https://github.com/adafruit/Adafruit_CircuitPython_BitbangIO Python-based library, not the built-in bitbangiomodule. Do you see the same problem when using native import bitbangio?
Could you send any replies to @.@.>? I am doing most of my work at home and have my files on my home computer.
We use GitHub so everyone can see the replies. When you get an email from GitHub, don't reply via mail, but instead click the "View it on GitHub" link in the email:

That will bring you directly here so you can reply.
(โฏยฐโกยฐ๏ผโฏ๏ธต โปโโป
@tulip sleet So I switched back to my way original tone code. Which loops. But I didn't need to make any other changes, including to the volume variable, and I have tone playback.
So I guess you fixed it, is my point, but you fixed it more than I think we thought you did. Or maybe you ended up dragging my bastardised code back to this original version in the end anyway.
Good to know. Thanks. I'll give it a try and try creating a Raspberry pi build.
Hmm. Where is this I2S error coming from? ```ValueError: Bit clock and word select must be sequential pins
I made a start on this and found that many boards are named differently in the respective ports/esp32s2/boards directories:
TINYUF2 CIRCUITPYTHON
adafruit_feather_esp32s2 adafruit_feather_esp32s2_nopsram
adafruit_feather_esp32s2_tft adafruit_feather_esp32s2_tftback_nopsram
adafruit_funhouse_esp32s2 adafruit_funhouse
adafruit_magtag_29gray adafruit_magtag_2.9_grayscale ...
I think it is RP2040 only, due to using the PIO for I2S
Ok, that's what I'm testing on, and I changed the pins to force the error. But wasn't sure if it was RP2040-specific.
Thanks.
Just double checked and yeah it is in the RP2040 port and not in the samd port when i checked
Oh good. Thank you so much for checking!
Have to include an extra section in the template to add a warning for RP2040 for pin selection.
Figured it was to add to a guide so wanted to double check myself for my own sanity too ๐
Fair enough! Appreciate the thoroughness. The templates are even worse than simply adding it to a guide because they're going to go in every board guide eventually. So tweaky stuff like this makes them vaguely more frustrating/complicated. But the end result of a tailored page for each board is going to be really nice to have.
ha now i'm really glad I double checked! But I can imagine when it varies just slightly its frustrating at times
Yeah, some of these templates have a bunch of sections like "If this is for a SAMD51 board, include the following, otherwise.." etc. Some templates are quick and smooth. Others, I'm finding, not so much.
@blissful pollen Clear enough? The bit clock and word select pins must be on consecutive pins! They can be on any pins you like, but they must be in consecutive order, for example, A0 for bit clock and A1 for word select.
The way that section works is by reading this file referenced as site.data.bootloaders in the template.
https://github.com/adafruit/circuitpython-org/blob/master/_data/bootloaders.json
It contains the information on which port has a bootloader, and the conversion between the circuitpython board ID and the bootloader board ID (bootloader_id in the template). As far as I know it's entirely manually made (including the version number). But note that it currently contains 0 information on t...
Reads clear to me
Thanks!
Ahh, thank you. I edited that file for lolin_s2_mini, also adding esp32s2 to bootloaders, for testing but overlooked the possibility of bootloader_id being different from the board's key in boards.
In that case, these boards should be an easy add:
adafruit_feather_esp32s2 adafruit_feather_esp32s2_nopsram
adafruit_feather_esp32s2_tft adafruit_feather_esp32s2_tftback_nopsram
adafruit_funhouse_esp32s2 adafruit_funhouse ...
Backing out just the additions on line 133 and 142 from that PR does indeed seem to fix the boot.py issue and allow rc.1 to run successfully.
Wait, can you write code in CircuitPython, that expects input in the serial console? Like pausing a WAV file until you press enter in the serial output..? Or is that a Python thing.
Do you try to keep a n-day history when you clean? If not, it might be helpful for future debuggers.
I keep 2-4 week's worth, depending on how far down the old builds are pushing a named build
there's no pattern - it's not automatic
e.g. aws s3 rm --recursive s3://adafruit-circuit-python/bin --exclude '*' --include '*20210822*
oh the mpy-cross S3 might need a cleanup too
i'll do that, definitely, thanks
@idle owl ```py
input("<<<")
<<<xyz
'xyz'```
I just managed to find an example I did using input() ๐
lol, I had never done it before, but have had it in the back of my mind