#circuitpython-dev
1 messages Β· Page 428 of 1
ooops, forgot to clone the repo before I left... this is going to take a while
I'm not sure if this is relevant, but I noticed a sequence of operations that makes the webserial repl get wedged up... still using the Feather ESP32 V2.
- load the /cp/serial page in the browser
- Hit the Ctrl-C button
- Use the browser's reload button
This hangs waiting to load /cp/serial/. The only thing that seems to make it continue is pressing ctrl-d in a terminal connected to the USB serial port.
@tannewt - Looks like there's still an issue with WiFi on this port. Just tried a fresh build on a freshly reinstalled dev environment on my ESP-BOX (original flavor, not lite) and its still crashing when attempting wifi.connect().
The behavior is a bit different now though. No stack dump at all this time, just a hard reboot that results in a WDT error on subqeuent boots, causing CircuitPython to load in safe mode on all subsequent boots.
Auto-reload is off.
Running in safe mode...
CircuitPython version
Adafruit CircuitPython 8.0.0-alpha.1-54-g8b30f0120-dirty on 2022-07-14; Adafruit Feather ESP32 V2 with ESP32
Code/REPL
import alarm
import time
while True:
now = time.monotonic()
target = now + 5
print(f"Doing work from {now=} until {target=}")
while time.monotonic() < target: sum(range(100))
target = now + 20
print(f"Light sleeping from {now=} until {target=}")
time_alarm = alarm.time.TimeA...
CircuitPython version
Adafruit CircuitPython 8.0.0-alpha.1-54-g8b30f0120-dirty on 2022-07-14; Adafruit Feather ESP32 V2 with ESP32
Code/REPL
# SPDX-FileCopyrightText: 2020 Jeff Epler for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import struct
import time
import board
import canio
import digitalio
# If the CAN transceiver has a standby pin, bring it out of standby mode
if hasattr(board, 'CAN_STANDBY'):
standby = digitalio.Digit...
Error 259 is ESP_ERR_INVALID_STATE
@fivesixzero Thanks for the retest! I wish it was fixed. :-)
Last time I had a TG1 issue, I had to put in prints to find where it was hanging.
CircuitPython version
Adafruit CircuitPython 8.0.0-alpha.1-54-g8b30f0120-dirty on 2022-07-14; Adafruit Feather ESP32 V2 with ESP32
Code/REPL
>>> i = touchio.TouchIn(board.D27)
>>> i.raw_value
65535
Behavior
I ran the code above while not touching the pin or the board. The board has male pins soldered to it and is plugged into a solderless breadboard.
Description
No response
Additional information
No response
ARe you trying to build CircuitPython or install Blinka? There are more up to date build instructions on the Learn system: https://learn.adafruit.com/building-circuitpython
How can I do that?
What I'm currently doing is that I have a UART client/server that sends text.
A problem I'm facing is that my central (rpi4) is sometime taking a long time to get the advertisement sent by my Circuit Playground bluefruit BLEβ’ (peripheral). Sometime it get the advertisement right away, sometime it can take up to a minute.
What I want to know is if there's a way for a central device to connect to the peripheral device without needing to scan? like by MAC address for example.
The main reason for this is that I want to connect and disconnect often, to not keep the connection alive for hours doing nothing
I looked everywhere in the doc and in this discord, and only your comment seems to infer what I want to do. Is it possible?
Thanks
calling connect will do a scan internally I believe
so you don't need to do it beforehand
What kind of quirk for example? How can this be fixed? Note that using pins C14 and C15 in
keypad.KeyMatrix()stopskeypadfrom working for other pins as well. So maybekeypaduses some variables/constants that are associated with pins C14 and C15 while setting up some global settings. What variables/constants are associated with pins?
I was thinking maybe IOMUX changes for those pins since they also host a crystal. I wouldn't know specifics without looking into it. Generally there...
Yes, but is it possible to connect to the Bluefruit directly by MAC address without needing to scan for example.
The problem I'm facing is that the scan is unreliable. And the code I use it for depends on a fast response time.
However, keeping the connection active, and the do my code there works. But I don't like having the connection alive for hours doing nothing.
Is keeping a connection alive for a long time bad practice? If so, how long should a connection stay connected to avoid problems?
What is line 380 and causing the memory error? It'd be much easier to debug a simpler example.
Its the method call,
update clockAgain, you can see the full file here: https://codefile.io/f/xj94CjuuCy9k1V0FjQee
That only has 376 lines of code. It must be a slightly different version from the traceback.
It'd be much easier to debug a simpler example.
You tell me which part of the file is causing the error, and I will take out the rest of the code :-D .
...
@gentle frigate I'd probably keep it alive if scanning is an issue. There is a connection_interval property of a BLE connection that can dictate how often the devices talk
What is meant by "reset pin number" (reset from what value to what value and why?) and "claim pin" (claim in the sense that the user can't use that pin?) in those function names?
reset and claim are there to ensure one object is using a pin at a time. claim takes control of a pin and res...
Thanks for the feedback! Please file issues. I'm out next week so I'm going to try and get this passing CI and merged in. We can fix these issues later.
I tried to do both actually.
This issue is from me trying to build CircuitPython on the Beaglebone Black (BBB). I was following those instructions (learn.adafruit.com/building-circuitpython).
I honestly got a little confused, I started to follow the Linux Setup thinking, I'm on the BBB, it's Linux, I'll follow these. But I think they are for setting up a cross compiler from som...
Ya, I think the instructions are for Ubuntu. What port are you trying to build? You could skip the python install and just install what you need to fix failures when actually building. #circuitpython-dev on the Discord server is a great place to get help with building CP.
Two facts from previous posts:
- From what I tried, USB works only if pin A10 is never reset.
- Resetting means releasing it to the default state (floating or pulled).
Therefore, USB works only if pin A10 is in some non-default state. What is that state and what code causes pin A10 to have that state?
More importantly:
I want pin A10 to have that non-default state at startup, so that USB works at startup. And then I want to be able to use that pin after that. Does that mean that ...
The latest builds of CP for the Itsy Bitsy nrf5280 crash the board to safe mode when Crl-D is pressed. I tried building a debug image but it doesn't start CP when copied onto the device, it just stays in the boot loader mode. I know there was concern about build size recently is it possible the current build is too large for the Itsy Bitsy?
K, I'll look into that, I'm running the bootloader that came on the device
On STM32F411, pin A10 has "USB_FS_ID" as an alternate function. The reference manual suggests that a bit in the hardware register OTG_FS_GUSBCFG can override the logic level present on the pin.


Thanks, I'll file an issue for the specific scenario I saw causing trouble on the Adafruit Feather ESP32 V2. Good to merge when green.
@slender iron Thanks, my debug image is loading now π
a bit in the hardware register OTG_FS_GUSBCFG can override the logic level present on the pin
Do you mean that that might create some logic level that makes USB work, and the aforementioned resetting of pins might mess up that logic level during the first second(s) of bootup, and that's why "never reset" is important for USB to work?
I've never tried to connect a debug terminal to an nRF chip, am I missing something? I'm not seeing any DEBUG output on the DEFAULT_UART_BUS_RX/TX pins and I added CIRCUITPY_DEBUG_UART_TX/RX pins which I'm also not seeing any output on.
okay, was hoping to have more info to include with an issue, It's not happening on the last 8.0.0 release so I'll wait until the current branch get's released and if it's still acting up file an issue then. Maybe by then I'll be able to include a little more info.
np, I'm out next week but dan and jeff will be around
I'm keeping an eye on #6591 .. the failures seem to be network failures, debating whether to re-run the failed parts of the workflow (probably) or merge as is.
typical failure:
E: Failed to fetch http://azure.archive.ubuntu.com/ubuntu/pool/main/g/gettext/gettext_0.19.8.1-10build1_amd64.deb Connection failed [IP: 52.154.174.208 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Error: Process completed with exit code 100.
@onyx hinge I was planning on rerunning the failed parts
I have another PR to make but it'll likely need that one first
all the failures are arm (so nowhere the workflow is enabled) so I'd feel OK either way
and all the several I looked at were the same cause, failure of the ubuntu archive
I kicked off a re-run of the failed jobs
thank you!
afk for dinner
I'm trying to build on the Beaglebone Black for the Beaglebone Black, it's a Sitara AM3358BZCZ100, 1GHZ, processor.
CircuitPython version
Build from current main ESP32-S2 TFT.
Code/REPL
print("hi")
But with arrow keys used to move cursor after the parens.
### Behavior
The left arrow does move the cursor in the input box, but the text getting sent to serial doesn't come out the same, it seems to be missing the left arrow presses that changed the location of the cursor.
### Description
_No response_
### Additional information
https://user-images.githu...
CircuitPython version
Adafruit CircuitPython 8.0.0-alpha.1-51-ge9dd25412-dirty on 2022-07-14; FeatherS2 with ESP32S2
Code/REPL
No code.py
Behavior
Web Workflow sites /, /fs/, /cp/serial are non-responsive after board boots and connects to wifi. A ping to the board is successful.
Description
This has been tested on several ESP32-S2 boards with similar results. Connecting to the serial REPL via USB and pressing alternating enters, CTRL-Ds wil...
replaces: #6592
I tried getting the branch from that PR straightened out, but could not work it out. I started this one from an up-to-date main and didn't run into the same trouble with submodules on it.
One additional tweak in this version is specifying the quote_characters for jsmin in order to get it handle ES6 strings with backticks better. The edit.js file makes use of this string syntax. https://pypi.org/project/jsmin/ mentions that it does not intend to support ES6, but does ...
Webserial working on my C3 board now after #6591 was included. Its finally becoming semi-usable.
# Settings for the Cypress (was Spansion) S25FL128L 16MB SPI flash.
# Datasheet: https://www.infineon.com/dgdl/Infineon-S25FL256L_S25FL128L_256-MB_(32-MB)_128-MB_(16-MB)_3.0_V_FL-L_FLASH_MEMORY-DataSheet-v09_00-EN.pdf?fileId=8ac78c8c7d0d8da4017d0ed40e335224
total_size = 0x800000 # 16MB
start_up_time_us = 300
??? memory_type = 0x40
??? capacity = 0x15
max_clock_speed_mhz = 133
6b_quad_read = true
32_qspi_write = true``` I'm just about to give up. Figured out the startup time but the memory type and capacity values seem arbitrary. the total_size in MiB I just multiplied X8 from the 2MB chip to 16MB. memory_type such as SOIC8 as 0x40 or is it more fine grain than that with spi vs qspi or NOR? I'm in over my head. The stuff with the question marks is what I can't figure out. have no idea where that kind of thing is listed.
and why isn't total_size the same as capacity? aren't they the same thing? :/
When I do never_reset_pins[pin_port] |= 1 << pin_number; without doing claimed_pins[pin_port] |= 1 << pin_number;, then USB does work, but I get ValueError: A10 in use.
If I additionally comment out [claimed_pins[i] = never_reset_pins[i];](https://github.com/adafruit/circuitpyt...
Struggled 3h with this topic and landed here. It's the first disappointing experience with CircuitPython for me and I'm confused this topic still has no software solution.
Things mentioned above I discovered for myself as workarounds, each with no success.
I'm tinkering around with the new PiSquare board form sb.components which has an oled display on board.
It was a pleasure to give the dragino LoRa/GPS HAT a new live.
Now I tried to activate the oled display and I'm failing all the ti...
The idea of BLE is that the devices have agreed in advance when they're going to get in contact. It's normal for the connection to exist in principle for a long time, but the radio is only active at the prearranged appointment times. A shorter interval uses more power. If you're looking for irregular prompt responses over a long time, that's not really what it was meant for.
Still the issue here on Windows!
I installed adafruit-circuitpython-waveshare_rp2040_zero-en_US-7.3.1.uf2 on my pico zero from https://circuitpython.org/board/waveshare_rp2040_zero/ on my pico zero
and after that, thonny reports:
Couldn't find the device automatically.
Check the connection (making sure the device is not in bootloader mode) or choose
"Configure interpreter" in the interpreter menu (bottom-right corner of the window)
to select specific port or another interpreter.
I...
CircuitPython version
adafruit-circuitpython-waveshare_rp2040_zero-en_US-7.3.1
Code/REPL
Installation does not connect
Behavior
Installation does not connect
Description
I just installed adafruit-circuitpython-waveshare_rp2040_zero-en_US-7.3.1.uf2 from https://circuitpython.org/board/waveshare_rp2040_zero/ on my waveshare pico zero
and after that, thonny reports:
_Couldn't find the device automatically.
Check the connection (making sure ...
I'm just wondering how it'll work in practice to do this.
While mdns records can contain a port number, as far as I know this does not override the default port of a http:// URL that doesn't specify a port.
Suppose I have a mix of ":80" and ":8080" devices on my network. Now, depending which device gets the canonical name, one of "http://circuitpython.local/" or "http://circuitpython.local:8080" will work, but not both.
Maybe this is just fine, as this is a feature for advanced use...
It occurs to me that it would be possible to implement _send_print so that you could write mp_plat_print(&_send_print, ":%d", web_api_port) here.
CircuitPython version
Adafruit CircuitPython 8.0.0-alpha.1-54-g8b30f0120-dirty on 2022-07-14; Adafruit Feather ESP32 V2 with ESP32
Code/REPL
# None
Behavior
When you follow a specific set of steps, the circuitpython.local site becomes unresponsive
Description
- load the /cp/serial page in the browser
- Click the Ctrl-C button in the web page, so that it is sitting at the ">>>" REPL
- Use the browser's reload button
This hangs wai...
I'm able to reproduce this issue as well on 7.3.1 and 8.x.
7.3.0 builds of cirpy do not have this issue, but fortunately Neradoc's solution seems to resolve it.
Hi,@FoamyGuy . can u share that build? or is there any guide for build custom circuitpython?
My product still under development, breaking changes is acceptable.
nvm, i found nightly builds in the release page.
I will be making a 7.3.2 pretty soon.
@NathanY3G should this be fixed by #6577 and ok to close now ?
I think theres some issue with the implementation of msgpack-
for example, the following code
b = io.BytesIO(b'\xdc\x00\xc8\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\xcc\x80\xcc\x81\xcc\x82\xcc\x83\xcc\x84\xcc\x85\xcc\x86\xcc\x87\xcc\x88\xcc\x89\xcc\x8a\xcc\x8b\xcc\x8c\xcc\x8d\xcc\x8e\xcc\x8f\xcc\x90\xcc\x91\xcc\x92\xcc\x93\xcc\x94\xcc\x95\xcc\x96\xcc\x97\xcc\x98\xcc\x99\xcc\x9a\xcc\x9b\xcc\x9c\xcc\x9d\xcc\x9e\xcc\x9f\xcc\xa0\xcc\xa1\xcc\xa2\xcc\xa3\xcc\xa4\xcc\xa5\xcc\xa6\xcc\xa7\xcc\xa8\xcc\xa9\xcc\xaa\xcc\xab\xcc\xac\xcc\xad\xcc\xae\xcc\xaf\xcc\xb0\xcc\xb1\xcc\xb2\xcc\xb3\xcc\xb4\xcc\xb5\xcc\xb6\xcc\xb7\xcc\xb8\xcc\xb9\xcc\xba\xcc\xbb\xcc\xbc\xcc\xbd\xcc\xbe\xcc\xbf\xcc\xc0\xcc\xc1\xcc\xc2\xcc\xc3\xcc\xc4\xcc\xc5\xcc\xc6\xcc\xc7')
msgpack.unpack(b)```
results in the following list `[0, 1, 2, 3, 4, 5, 6, 7, ..., 126, 127, -128, -127, -126, -125, -124, -123, -122, -121, -120, -119, -118, -117, -116, -115, -114, -113, -112, -111, -110, -109, ... -60, -59, -58, -57]`
but it should result in (and does with the common cpython msgpack module) `[0, 1, .... 198, 199]`
I note that uint, float, 64-bit-ints are unimplemented but 200 is well under these
Looking at this a bit harder all numbers between 127-256 are negative. So the 8th bit is getting interpreted as the sign bit for lists of numbers that contain both 2-byte and 4-byte numbers for numbers that can be represented in 2 bytes?
I daresay it doesn't make much sense to me that numbers specifically between 127-256 aren't supported
yeah it's not great
also notably the docs specify "uint" isn't supported when uint16 is supported
C Python
>>> st = io.BytesIO()
>>> msgpack.pack([200],st)
>>> st.getvalue()
b'\x91\xcc\xc8'
Circuitpython
>>> st = io.BytesIO()
>>> msgpack.pack([200],st)
>>> st.getvalue()
b'\x91\xd1\x00\xc8'
oh nevermind uint16 isn't supported it just happens to work for specific low values
alright well
what should I do here then
I guess I could just string them and call int but like
I love that I reduced my range to a single value but kept the range syntax
yeah I was wondering lol
I could do something abhorrent like use regex to bump everything to signed int ranges
so if I change this: https://github.com/adafruit/circuitpython/blob/4e6fa55cba8d84e66c73f444c5a137e0c803234d/shared-module/msgpack/__init__.c#L426-L434
with this:
case 0xcc: // uint8
return MP_OBJ_NEW_SMALL_INT((uint8_t)read1(s));
case 0xd0: // int8
return MP_OBJ_NEW_SMALL_INT((int8_t)read1(s));
case 0xcd: // uint16
return MP_OBJ_NEW_SMALL_INT((uint16_t)read2(s));
case 0xd1: // int16
return MP_OBJ_NEW_SMALL_INT((int16_t)read2(s));
case 0xce: // uint32
return MP_OBJ_NEW_SMALL_INT((uint32_t)read4(s));
case 0xd2: // int32
return MP_OBJ_NEW_SMALL_INT((int32_t)read4(s));
it seems to unpack correctly
that seems like
a really small change π€
looking at the source it kind of implies floats would be supported too?
in encodes them, but C python seems to encode them as double, and CP doesn't do double
all of that could be implemented I'm sure, even losing precision on doubles, it's a matter of looking into it (64 bit ints are surely not an issue either on ports supporting longints)
- Based on espressif/nimble's blecent example code. Confirms that the characteristic is not empty before trying to catalogue its descriptors.
- Running ble_gattc_disc_all_dscs on empty (no length) characteristics fails with the (not-very-informative) BLE_HS_EINVAL error if this check is not performed.
I think the problem will be in finding an arm-none-eabi-gcc ross-compiler toolsuite built for the BBB.
The internal pullups on an RP2040 are quite weak (50k-80k) and not very good for I2C. All of the I2C breakouts Adafruit makes have on-board pullups. We don't add pullups to the microcontroller boards.
It looks like (https://cdn.shopify.com/s/files/1/1217/2104/files/Schematic_9f818051-fdfc-43dd-9e5e-0999f1dc1d1c.pdf?v=1657287360) GPIO7 and GPIO6 are used for I2C. Since those pins are available on the 2x20 header, I think you could add some external pullups from those pins to 3.3V without to...
Installed Linux as Windows Subsystem (WSL) today and visual studio code. Running Ubuntu as cmd line subsystem now. Didn't even know you could do that. Seems to work ok. Was trying to avoid jumping in the deep end but seems like a full custom build is the only way.
I missed why you need a custom build
trying to add a 16MB flash chip to bluefruit sense.
oooh
going from 2 to 16. i have a 250GB SD card on the featherwing so storage isn't something i need more of.
i got it before figuring out that i can't upgrade the SRAM with it. no external SRAM. π¦
what i really need is a way to upgrade the sram, i keep hitting memory limits with my project.
so I got a UM Feather S3 with 16MB of flash and 8MB of sram. working with files on flash can sometimes be easier than with sd card, via usb so there's that.
before i get into the feather s3 though i'd still like to use this as practice i guess just to do.
for example, taking screenshots with bitmap saver to the SD card. i have to remove the sd card, put it in a card reader, transfer it to windows folder, then upload it if i wanted to share it. it's an involved process. with bigger flash i can take screenshots without worrying about storage as much.
This is probably a Thonny problem. Thonny doesn't recognize the board as a CircuitPython board. I think it may only do that if the USB VID/PID match a list it keeps. You can click on the mode in the lower right hand corner and switch to CIrcuitPython manually. That should get you going.
we will have multiple LUN support soon (assuming it checks out) so that you can mount the SD card in CircuitPython and have both CircuitPython and the SD card available as mounted drives.
that would be a very welcome upgrade.
isn't fatfs limited to 2mb?
not at all
you can try one of the builds from that PR
maybe i was thinking of cluster or block size?
There is FAT12, FAT16, FAT32, etc., chosen by max number of clusters
are you saying that sketch should make an sd card show up as a USB drive?
i already know how to mount and access sd card files from circuit python. π
YES
scroll down for the build artifacts: pick your board. Mount the SD card and it should appear as a drive. https://github.com/adafruit/circuitpython/actions/runs/2648473489
let me know how it works for you. The latest fixes are to work better on Windows. It was working OK on Mac and Linux
will this work on the bluefruit sense? i don't have my feather s3 soldered up yet.
oh i see actions does stuff that i have no idea about. never seen this before.
it should work on any CPy board that can do mass storage
i think the actions stuff is above my head.
if you say it's coming someday that's good enough for me. lots of neat new stuff happening.
i don't even know what a lun is. you seem happy about multiple luns tho π
https://github.com/adafruit/circuitpython/suites/7300383941/artifacts/294860706 unzip the zip and install the UF2 on the Bluefruit Sense. "LUN" is "Logical Unit", sorry for the jargon
logical unit number as in multiple drives? heard scott and tim were talking about that for supporting multiple plugged in boards at the same time. yes that is something i'm very excited to see.
hmm will that wipe my board? guess i should make a backup.
i can't get to the boot sel button because of the quad stack lol
Double tap reset work? I have the same issue with some embedded projects.
it shouldn't erase CIRCUITPY, but of course make a backup. ... Some FeatherWings have reset buttons that duplicate the reset button on the Feather
double reset worked. yep files are still there
but right, bootsel button is not duplicated
(on RP2040)
you meant just reset, I think
yeah i did take off the top to get to the button first, then it seemed to lock up, hit reset twice got to boot partition.
the BOOT drive is a fake drive, a simulation done by the bootloader
mu giving an error cannot save to disk
i have 742kb free
can access circuitpy np, can't save to it.
i put the UF2 on the featherboot, restarted, circuitpy not working right.
is the SD appearing, or is it not connected or mounted?
I will test this when I test the PR. Put back the old UF2 and see if the drive is OK (might have gotten corrupted).
but if OK with the old UF2, then we still have work to do on this
i have a backup, np. π
yep Mu works fine back on 7.3.0
actually i think the sd did mount, 3 times
i thought it was sd card reader but that's unplugged
my sd card reader shows up as like 5 drives. multi-card reader.
i couldn't access it though.
hold up, the circuitpy is the flash, yes i could access it. couldn't save.
it does show up as multiple drives, but they are not accessible unless mounted in CircuitPython.
It's possible Mu is trying the wrong drive?
ugh i meant i couldn't access the sd card as a usb drive. i think it showed up in windows greyed out. couldn't access it.
you still have to mount it in your code
yeah couldn't do that with mu not saving.
cool test though, it's going to be an awesome feature.
I've already made a little shim:

This is working. But I don't get the point why there is no option in CircuitPython to activate the internal pullups for I2C.
With MircoPython I can use the onboard display without the external pullups.
This still appears to be an issue in 8.0.0alpha1 on an Adafruit Feather ESP32-S3 TFT. alarm.wake_alarm consistently has the correct value when powered by USB but is consistently None when on battery power.
@thymjan This PR was for compile-time support. There was some other work for run-time specification of using internal pullups: #5718 and #5724. That work stopped because the user's need became moot.
There are several considerations about doing which have not pushed it over the threshold of inclusion.
- We'd want to make it available for all ports. So it's a noticeable amount of work.
- It takes extra code space, which is in very short supply on the small SAMD21 builds.
- Its use case...
were you going to PR this or should I just locally fork?
I would prefer to look more into it, test on different ports, look at 64 bit ints and some level of doubles support, but you can PR it if you want
π
I've only got rp2040s and esp32s free right now so I'll hold off on that... I do need floats though so I'll give that a try
"Never reset" means that the pin is not reset when the CircuitPython VM restarts, such as when you type ctrl-D. This is usually for pins whose state must be maintained across VM instantiations, such as display control pins, USB, SPI flash pins, etc. So if you disable part of the "never reset" mechanism, things may break.
Given the special USB use of A10, we might have been better off omitting it from board (that goes for C14 and C15 too). As I mentioned in a related issue, PR #2361, th...
I think this float thing is somewhat beyond me right now
but I did make the error more descriptive
default:
mp_raise_NotImplementedError_varg(translate("Unsupported type in data: 0x%.2x"), code);
note that new error messages take more space in the firmware
wait so every variation of the possible codes would be a whole new thing?
just the string
er, yeah, whole new string
either way that's pretty unfortunate!
it's only 240 bytes if I reduced the message length (I think? Didn't include overhead...) so I'm not worried personally but I can see how that might be a concern for the project as a whole
I'm trying to adapt from the FFT Learn Guide, but I'm using a 64x32 matrix panel instead. Here's my code: https://gist.github.com/prcutler/4b69ecc5239067115ca78b517bb4b2e9 - I'm getting the error: Traceback (most recent call last): File "code.py", line 69, in <module> TypeError: unsupported bitmap type - from what little I know of displayio, it looks like the Bitmap code should be right, I think.
why RollingGraph(3, pixel_shader=palette) ? what is 3 ?
lol, I was just staring at that, too. It's the default in the guide, and I'm not sure: https://learn.adafruit.com/ulab-crunch-numbers-fast-with-circuitpython/fft-example-waterfall-spectrum-analyzer
This is pre-displayio code, so it may not be adaptable
but you commented out the init(), so now you are using the init of the TileGrid class
which takes a bitmap as argument
This PR Adds basic functionality for the DFRobot ESP32-C3 (pins, I2C, etc..)
NOTE:
- Additional work will be needed to add the Display, I'll open another issue for that.
- PR to add DFRobot Creator ID: https://github.com/creationid/creators/pull/11
- PR to add board to CP.org: https://github.com/adafruit/circuitpython-org/pull/991
Thanks - your pointer got me unstuck. It's now drawing something audioreactive on the screen, this is the furthest I've got!
The DFRobot esp32-ce has an 18Pin-FPC, GDI display interface. This needs to be added to the board definition.
Board Docs: https://wiki.dfrobot.com/SKU_DFR0868_Beetle_ESP32_C3
Related: https://github.com/adafruit/circuitpython/pull/6615
This should probably go after https://github.com/adafruit/circuitpython/pull/6615 is merged
Is there a way in digitalio or keypad or other libraries to initialize the pin immediately with a certain direction, pull, and/or value instead of initializing with the default ones as in digitalio.DigitalInOut(board.A10) and changing them after that? Only by modifying DigitalInOut.c myself?
Does digitalio.DigitalInOut(board.A10) (and HAL_GPIO_Init() in stm32f4xx_hal_gpio.c) merely ...
Thanks for updating. See above for specific items to fix.
Is there any existing board which implements board.DISPLAY using i2c not SPI or something else?
Has anyone dealt with compiling circuitpython to WASM?
@spiral elk board.display is for built-in displays, check the store for boards that have small built-in displays (perhaps LCD character displays?) I2C won't drive a large tft so if one does exist it's going to be for a small display.
I2C is half duplex and SPI is full duplex. if SPI's limit is about 480x320 (on the current set of available boards) then can take half of that for half duplex for the upper limit of I2C... approximation.
devon@GARAGE:~/circuitpython/ports/nrf$ make BOARD=feather_bluefruit_sense_16N
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
/bin/sh: 1: arm-none-eabi-gcc: not found
[Errno 2] No such file or directory: 'arm-none-eabi-gcc'
[Errno 2] No such file or directory: 'arm-none-eabi-gcc'
[Errno 2] No such file or directory: 'arm-none-eabi-gcc'
[Errno 2] No such file or directory: 'arm-none-eabi-gcc'
[Errno 2] No such file or directory: 'arm-none-eabi-gcc'
[Errno 2] No such file or directory: 'arm-none-eabi-gcc'
``` Trying to build my first board and can't figure out this error. Wont' let me do sudo apt-get install for it, says it doesn't exist. This is from WSL Ubuntu. I copied the feather_bluefruit_sense, changed a few things, and renamed it 16N.
I did get some errors earlier about home/devon/.local/bin not being added to path for some submodules i think including black. Getting a little overwhelming because i'm also running python and github desktop app on windows, unsure if it's going to conflict.
no I2C, mostly SPI, the pyportal uses parallel
I was going to try to implement the Lolin S2 Pico's built-in SSD1306 128x32 OLED, which was skipped over in the board bringup, but I can find no examples of i2c boards to crib off of.
I think you'd have to adapt from SPI, using common_hal_board_create_i2c, common_hal_displayio_i2cdisplay_construct, and such
Yeah, having never worked directly with the i2c hal code, going in without examples is a bit difficult.
Of the few existing boards that physically have an i2c display there seems to be a conspicuous absence of board.DISPLAY support.
what boards is that ?
Aside from the S2 Pico, there's the board that got a PR that never got approved from some chinese guy, and one other I can't remember.
The circuitpython.org entry for that chinese board got merged briefly somehow but the board PR died on the vine because the guy disappeared with no followups
"the board that never got approved" is my next novel's title
Hey, I want royalties for that
At one point I went looking through all 250 (at the time) boards in circuitpython.org to see if there were any others, which is how that orphaned board popped up on my radar.
The way to manipulate the pins or board-specific setup at hard startup is in board_init(), in board.c for the board. There you could set the register mentioned above so that A10 was not treated specially.
@tulip sleet good morning & welcome back! There was mostly just one bug that was making the PSRAM work wrong (use of the wrong address range), now a lot of stuff works right! We can talk about the meetings about how to move forward together but the basics all seem really solid now.
Thank you for the debugging! I read my mail intermittently over vacation and am caught up.
I remembered from the past that there was a PSRAM "test" that esp-idf performed. It passed, which surprised me, but it led me to the correct way to find the PSRAM address range for ESP32, which is different from the rest. π€― thanks for leaving me a fun puzzle.
Thanks for making those changes. One last little thing...
Looks like it's broken on the Adafruit product page as well: https://www.adafruit.com/product/4864
Morning all π wondering if anyone has attempted compiling circuitpython to WASM ever? Found out about this project yesterday and was interested in trying it using emscrypten
I tested a similar program on an Adafruit Feather STM32F405. I don't have a keyboard matrix with that many rows to try to try, so I wired up ten tactile pusbuttons, using 10 pins for the row and 1 column pin. I was not able to reproduce the problem
Did you try this without A10, C14, or C15 at all?
from board import *
import keypad
key_matrix = keypad.KeyMatrix(
row_pins=(A1, A2, A3, A4, A5, SCK, MOSI, MISO, RX, TX),
column_pins=(D12, ),
)
while True:
event ...
We have not tried this. It has been tried in MicroPython (easily found with a websearch).
Hmm maybe I was just real tired last night cuz I swear I searched for it. Apologies! Will attempt a search again! Thank you!
<< micropython wasm >> is all that I did
Skipping the meeting today, no notes, nothing to report.
Fixes #994. Since the repo was removed, I just linked to the MicroPython page with the firmware.
When I bring up the google docs for the meeting it says that the author is using a pageless format and it won't let me in to add my hug report. I am on firefox version 102. This is the first time that I have encountered this problem.
You need to click "Got it" on the lower right of the pageless format popup. Once I did that I was able to edit the document, even not logged into my Adafruit account.
I was also using Firefox 102 for this test.
Thanks @tulip sleet for the info
I have returned
from vacation? me too
Cool thanks, now I maybe understand: We want "force host mode" regardless of what the level of the OTG_FS_ID pin is (so that we can use that pin, which is the same as A10, without affecting USB host mode). So we want to set bit 29 (FHMOD) of the OTG_FS_GUSBCFG register (address offset: 0x00C) to 1.
I found the USB_OTG_GUSBCFG_FHMOD variable in CircuitPython.
Can I just try doing USB_OTG_GUSBCFG_FHMOD = 1 in board_init() in board.c?
@random junco did you ever get clarity on the FFT learn guide problems? I saw there was a feedback about the code no longer working, which I think is due to a change in 8.0 to add a bitmap property to TileGrid objects. I modified (and, ack, didn't actually test) the code to work around this problem. https://github.com/adafruit/Adafruit_Learning_System_Guides/pull/2222
In 8.0, the TIleGrid adds its own "bitmap" property. This interfered, causing the exception reported in guide feedback:
Traceback (most recent call last):
File "code.py", line 5...
@onyx hinge I'm so new to displayio I don't even know the right questions to ask. :). I have some kind of audioreactive code working on my RGBMatrix, but it's big and blocky, I think I need to learn about scaling
I tried porting the original code to use a palette and tilegrid, but I couldn't quite get it working right
"3" is the scale factor of the bitmap, so you might want to change that down to 1.
I didn't read through the whole conversation but those were the things that caught my eye
it's a rasterized image scaled up 75% so you're going to lose some image quality
Thanks! I'll keep playing with it, I'm learning a ton. I don't even know if it's possible to do what I want yet
I just need to light an LED, there's no quality to worry about (I think) π
it will get more pixelated the more you scale up
will lose some feathering on the edges though with a matrix that comes with the territory a little.
i figured out No such file or directory: 'arm-none-eabi-gcc' was because of a missing arm library. actually fixed it thanks to a nice guide on mynewt website.
there are a lot of little pitfalls in installing linux that the "building your own circuit python" learn guide doesn't cover. been running into a lot of that.
I was thinking you don't need self._bitmap, just a temporary bitmap passed to the super() constructor, and use self.bitmap (provided by the super class) for reading
This is what I have working now: It displays sound reactive blocks: https://gist.github.com/prcutler/555916b673cb881550ac67117f82ce1e
I'm trying to figure out how to make it less blocky. Changing the group scale changes how big the screen is, but it's hard to tell if chahing RollingGraph from 3 to 1 has had an effect
pretty good, we gave out a couple hundred pewpews
awesome, that's great to hear
I took a quick look and I think you want to lower the scale down to 1.
If you still want it less blocky you could try to write code to have a bitmap twice (or more) the size of your display and average pixels down (it was done with the IS31FL3741) but not sure if the processing speed would be sufficient. Basic anti-aliasing
thank you for looking! Lowering it to 1 seems about the same, it looks to be drawing 3x3 squares, which it was doing at scale 3, too. I've got a lot to learn!
I spoke too soon, changing the group to scale 1 and the graph to 1 gets me what I'm looking for
Refresh is an issue, but one thing at a time. Thanks all
Updated after checking the following repos:
https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases (nRF52 Bootloaders)
https://github.com/adafruit/uf2-samdx1/releases (SAMD Bootloaders)
https://github.com/adafruit/tinyuf2/releases (ESPS2 and ESPS3 Bootloaders)
~/circuitpython/ports/nrf$ make BOARD=feather_bluefruit_sense_16N
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
<command-line>: error: 'S25FL128L' undeclared here (not in a function); did you mean 'S25FL216K'?
<command-line>: note: in definition of macro 'EXTERNAL_FLASH_DEVICES'``` where do i declare a new external flash device chip? i've created a new entry in data/nvm.toml/flash/cypress
That directory is a submodule; you can submit a PR to https://github.com/adafruit/nvm.toml
Then circuitpython itself needs to be PR'd to advance the submodule to the latest commit
Thanks for adding. Most of this looks good, but it does not appear to be Arduino Shield Compatible.
<@&356864093652516868> The meeting is coming up in just a few minutes (sorry for the late ping)! Please add your notes to the doc if you haven't. We're looking forward to a chance to catch up & check in!
[happily lurking today!]
Just lurking today as well for as long as I can
Living in Lurkville today.
Thanks Jeff π
The goal of the PyFive project is to create a community-driven, @RISC_V-based microcontroller with the ability to easily support @CircuitPython: https://t.co/N9PyYEByJx
The news from Adafruit in New York. Broadcast July 13, 2022
https://www.adafruit.com/new
These are items or concept products that may/might/could be introduced into the Adafruit store in the future (or not)! It's not out yet, so please don't ask questions or ask when it'll be available....
Check out the Adafruit store for all the great produc...
I am live thanks to my Patreon supporters
www.patreon.com/bobricius
Based on Raspberry Pi PICO
Software written in Circuitpython
Project page:
https://hackaday.io/project/186324-picotouch-hmi
Articles:
https://www.hackster.io/news/bobricius-picotouch-hmi-is-a-raspberry-pi-pico-carrier-for-your-human-machine-interface-projects-794b5957d5d0
Dr Patrick Kavanagh asks audience if itβs ok to show code! Itβs always ok to show code with us, we are a curious lot! πππ»
#EuroPython #EuroPython2022 #Python #JWST https://t.co/wo0pLyaZXc
@TheMagPi I was in awe of the #jwst photos last week and wanted a desktop viewer for NASAβs astronomy picture of the day. I used #circuitpython, hoping to port it to a pico w soon. The irony of using such a small screen is not lost on me π, this is a trigger to look at the big version!
@tulip sleet I can do the 'core' section of state of circuitpython unless you want to
go ahead
Thank you Deshipu, I appreciate it
I know it's a lot of work
Thank you for that!!
@minor plume Are you able to read your status update?
@onyx hinge what was that utility you mentioned for getting files to esp32 boards?
Neat idea to use distance sensors to figure out where a bowling ball is and use it as a training aid! π³
@wraith crow "thonny". https://github.com/thonny/thonny It's a GUI editor, but among the things it can do is install packages from pypi (which is all the things in the circuitpython bundle minus around 20 libraries at the moment)
Right now it works with ESP32 Feather V2, but other boards have trouble due to the recently added status line. (Feather V2 disables the status line for exactly this reason). A future thonny update will fix this, we hope.
Ah okay, mis-heard you, thought there was something else new :), thanks!
I may have mis-spoke or said it in an unexpected way.
Thanks everyone π
Thanks Kattni, all!
thanks
thanks folks! have a great week
Thanks for driving the ship Kattni
Thanks!
There is about 50-100 ms to measure depending upon the bowling speed. Maybe get 5-10 measurement points with the TOF sensor. Now have a lot to learn about processing the measurement signal to get rid of any noise and return just the ball center distance.
@stuck elbow asyncio/event.py:class Event: asyncio/event.py: """Create a new event which can be used to synchronize tasks. Events would let one task set it while the other task can await it. Maybe this covers your use case?
sounds like exactly the thing I need, thanks!
So I've just installed CP 8.0 on my ESP32-S2 that was running WIppersnapper. It still shows up as a "Wipper" drive, not CircuitPy and I have two different boot_out.txt files (one and wipper_boot_out.txt). Mu connects and says I'm running 8.0. I know this is an edge case with someone coming from the Wippersnapper firmware to CircuitPython. Should I file an issue? I just tested 7.3.1, it still shows up as a Wipper drive.
CircuitPython doesn't format the filesystem if it's already formatted
so anything that was there before installing circuitpython will stay there
same if you use the filesystem with Arduino
if you want it reset to circuitpython defaults, do storage.erase_filesystem() on it
OK, so, Sometimes it shows up as CIRCUITPY if you switch from CP to WipperSnapper.
I'm not sure what the fix would be for it, since WS documents it might say "CIRCUITPY".... which is to say they didn't fix it.
I'm wondering if it's the same weirdness as the opposite direction.
Yes, that's exactly it
I can file an issue, it only matters to Mu I think
Oh hmm. Good point.
Um...
File the issue on CircuitPython core repo I guess.
Since the WipperSnapper side doesn't care, only the CP side does in the Mu situation.
Will do, thanks
you can just rename the drive
Yes, that worked. Didn't even think of that!
CircuitPython version
Adafruit CircuitPython 8.0.0-alpha.1 and Adafruit CircuitPython 7.3.1 on an a QTPY-ESP32-S2
WipperSnapper 1.0 beta 38 firmware
Code/REPL
N/A
Behavior
I have a QTPY-ESP32-S2 running Wippersnapper 1.0 beta 38 firmware. I want to reinstall CircuitPython:
After putting the QTPY in boot mode and installing either CIrcuitPython 7.3.1 or 8.0-alpha, the drive name remains "WIPPER" and does not change back to "CIRCUITPY" as expe...
Right, but new folks might not know that, or know to ask. So we should consider sorting out a solution. Or we have to document it somewhere and hope folks find it. Which isn't the best solution.
yep, but I will fight tooth and nails against forcing the drive name to CIRCUITPY
Can you detect the current name?
And change it only if it's WIPPER?
I think that if Mu requires the drive to be called a certain way, it's a bug in Mu
I think that's how it finds it?
no, it scans the USB devices
Mu finds the drive by name only
yep
So close!
maybe it should do the same thing as for serial for the drive
finding the drive by USB devices is what discotool does, and it's not simple
I was just talking with the five Mu developers yesterday, dang it
but I agree
they were all on Europython
actually there is a simpler way, to read all drives and look for boot_out.txt, but that doesn't give you the association serial/device/drive
(and it's a little brute-forcy)
# adafruit-board-toolkit is used to find serial ports and help identify
# CircuitPython boards in the CircuitPython mode.
"adafruit-board-toolkit~=1.1",
yep, that's finding the REPL
it finds serial ports with "Circuitpython CDC " in the name
(and 2 other variants)
I was watching French Twitch Streamer that was fighting against circup confusion when multiple CIRCUITPY driver are present, and saying that if you rename the drive, then it does not get detected or something. And then about the code being the same as in Mu, that also get confused when there are multiple CURCUITPY drive. And there is room for improvement.
What I had in mind is that detection in Mu was not based on USB ID anymore, but on the on the presence of a serial device that has CircuitPython...
(I'd love to know french streamers using CP btw)
It is "CALM".
that is exactly how it works now
titimoby streams live on Twitch! Check out their videos, sign up to chat, and join their community.
It is a bit random streaming time, over EU lunch time most of the time.
Lot of education stuff, so a lot of Circuit Python.
He teach kids also, so any gadget in that area, any new software is in his scope, especially programing games.
sounds cool
He may have been in one Python on Hardware newsletter or another...
I recognise the name, so that's likely.
Despite the powerful suggestion algorithm of YouTube and Twitch, it took some time for me to find him. He also has a "Discord of temptation" where his follower show each other gadgets you feel urged to acquire. Maybe it is best not to recommend it.
haha
I met him!
Extremely nice guy.
You want to force device mode, not host mode (host mode is what the host computer uses).
That is not a variable, it's just a constant you need to use to set the appropriate I/O register. An I/O register is in the address space, but is not regular memory. It controls an on-chip peripheral.
You would do something like this (code taken from https://github.com/hathach/tinyusb/blob/ecb899408bb95c5c0d50ebe2d887cd746104c534/hw/bsp/stm32f7/family.c#L257-L259):
// Force device mode
U...
The only thing about his LIVE stream is that they are extremely "calm" (as in tranquil / peaceful). The slow rate might help if your French is not so good. I can only guess he is like that in real live. The funny part is that CALM, the name of his stream in reality mean "Comme A La Maison", like if invite you home to discuss about his last software/hardware discoveries. π
@tulip sleet this is charlesburnaford , I lost my password to my account. My new name is @royal rover I would like the pythonista role so that I can speak at monday meetings.
I've tried two different QTPy-ESP32-S2s on 8.0-alpha and I can't get the web workflow to work. I have a /.env file created with the example from the docs and I don't see any new devices on the network. What can I troubleshoot?
I guess you mean USB_OTG_FS (USB on-the-go full-speed) rather than ..._HS. At least that's what the screenshot above says. In that case, the code you allude to for focing device mode is wrapped inside #if (BOARD_NO_USB_OTG_ID_SENSE) in https://github.com/adafruit/circuitpython/blob/main/ports/stm/supervisor/usb.c#L46-L49 . And that seems to be the only time that BOARD_NO_USB_OTG_ID_SENSE is read.
So th...
@random junco check out this issue and feel free to post your results. The issue talks about ctrl-d's and I think flash file i/o or other activity may have an impact.
https://github.com/adafruit/circuitpython/issues/6610
CircuitPython version Adafruit CircuitPython 8.0.0-alpha.1-51-ge9dd25412-dirty on 2022-07-14; FeatherS2 with ESP32S2 Code/REPL No code.py Behavior Web Workflow sites /, /fs/, /cp/serial are non-res...
will do, thank you!
did I dream a PR where Scott enabled ticks for the web workflow or was he working on that in his fork still ?
There was a PR merged that addressed the web workflow ticks, Scott basically re-engineered how the web workflow got background attention. It improved things on some boards but the S2 still seems to have an issue and the approach may still need some tweaking
hmm, so maybe try this on my matrixportal instead?
I did notice on the FunHouse that when code.py is running, the web workflow basically stops
(you can see that in my appearance on Show & Tell, it works fine when installing the missing libraries, but once the code starts it stops responding)
Yep testing on different chips is helpful, originally having a display attached made a difference but after the new PR I don't know if that's still a factor
I wonder if it isn't so much that code.py started running as that the flash i/o of installing the missing libraries was triggering the background attention
@jaunty juniper It be interesting to see if adding a file create/delete to the main loop of your FunHouse code.py didn't allow the workflow to operate
for now I'm trying to figure out the CORS preflight issue, because otherwise I had to disable some checks to have it work, and the code is a mess right now π
If I have bricked circuitpython on the Feather M4 Express, do we have a UF2 that erases current circuitpython files?
yeah there should be in the troubleshoot section
i know on the RP2040 we can nuke the flash but I'm unaware of one for SAMD devices
have you tried safe mode ?
safemode, thank goodness
The code above is for F7's or H7's, so sorry, yes, FS, not HS. I didn't realize the register bit was already potentially set in usb.c`.
I don't know why the current code flow is not working properly if you set BOARD_NO_USB_OTG_ID_SENSE to 1. If you put the code in board_init(), it happens really, really early. You could try it there and see if it works.
@gilded cradle in adding the beetle to CP-org, I noticed several boards did not have downloads_display: true in their file. Should they all have this?
Not all of them. Some are hidden using this for various reasons (not enough info available, product being revised, etc.)
yeah hold off on that nvm.toml for now, will let you know if i start a fire on my board tonight.
what are the chances if i got something wrong in nvm.toml i could corrupt the flash chip beyond recovery? is that a thing to worry about?
but I have never seen thatβ¬οΈ being an issue. I don't think mistakes in your toml are going to invoke that. ... Did you start with the settings on a similar Cypress chip?
yes, started with the cypress 4mb S25FL064L toml
looks like they added some idiot proofing to it. that's good news. π
this is silly but i can't find the uf2 in the file system, any pointer where to look?
it's inside the ports/nrf/build-<boardname> directory
oh it's just named firmware.uf2, was expected the boardname.uf2
ok i have obviously made a big mistake
there's no soic8 on the bluefruit sense unless it's under the chip lid :/
ah, yeah it doesn't have external flash
it says in ports/boards/nrf/bluefruit sense the flash is GD25Q16C
on digikey that shows up as an soic8?
oh it does ?
hold on...
I am confused somehow
i'm getting some screen shots...
it's gotta be that 8uson that's sitting right next to the lid :/
my fault, didn't even look at the board first.
i just started looking up part numbers and all the rest of that family are soic8 π¦
still time to order from digikey ? π
lol i have no choice now, i don't think i have another board that actually has an soic8
oh I see
literally leapt before i looked
not like the ESP32xx modules with flash inside
i do have 2 feather s3's that should arrive tomorrow but they already have 16mb chips
do you have the soldering technology (hot plate or hot air) to change it?
does it have internal flash though ?
yes have a hot air gun, never used.
meant for smd reflows
for when i was trying to make my own bluetooth classic ampflier board until i figured out all the parts i used had a 2-3 year backorder.
learning the long and hard way
the nRF chip itself has 1MB of flash
Due to https://github.com/adafruit/circuitpython/blob/main/ports/stm/boards/stm32f411ce_blackpill/board.c#L28-L30 , it seems that mpconfigboard.h (where I originally tried putting #define BOARD_NO_USB_OTG_ID_SENSE (1)) runs even earlier than the contents of board_init(), namely before board_init() is even defined.
Anyway, I tried
void board_init(void) {
USB_OTG_FS->GUSBCFG &= ~USB_OTG_GUSBCFG_FHMOD;
USB_OTG_FS->GUSBCFG |= USB_OTG_GUSBCFG_FDMOD;
}
but I get
...
I was confused because the product page says 1MB and Express boards have mentions like "2 MB of SPI Flash storage"
not worth trying to adapt it, just going to have to return it and find something else, or scrap the idea.
you need to add the right #include files to get the definitions you need. #define is a C preprocessor setting. It is not C code that runs.
the external flash is 16 Mbits, 2MB. The flash mfrs like to quote in bits
I feel like the product page is copy-pasted from a board that doesn't have external flash ?
yeah new chip is 128 Mbits
it's this one right ? https://www.adafruit.com/product/4516
yes, even though the product page says 1mb for some weird reason it's 2mb
The second bullet should be clearer. And it doesn't mention the external flash.
there's really only about 1mb useable since the uf2 takes up about half the space. the combined flash and the product page are a bit confusing.
the 1MB is describing what the chip has, not the board. it should be clearer
yes
the unused interal flash space is exactly that, unused
only took me like 2 seconds after getting to circuitpy to see the reported space and figure out why the product page is like that, but could be confusing when trying to provide support to people thinking it only has 1mb.
we'll see about clarifying the product description and the Learn Guides. Sorry it is incompletely spec'd
supervisor/usb.c, which uses USB_OTG_FS, has the following #includes:
#include "supervisor/usb.h"
#include "shared/runtime/interrupt_char.h"
#include "shared/readline/readline.h"
#include "lib/tinyusb/src/device/usbd.h"
#include "py/mpconfig.h"
#include "common-hal/microcontroller/Pin.h"
Any hints which ones I need for board.c? Otherwise I'll try using all.
there's an 8uson and 8wson variety. how do i figure out which it is?
nvm, 8wson is a square package, 8uson is rectangular
yeah there's no bigger compatible chips available in that package, idea scrapped.
Probably #include "lib/tinyusb/src/device/usbd.h". It includes things from the ST driver directories.
π¦ should we close your PR for now?
yes for good, you can't put an 8soic on a feather sense
would have to be a custom pcb and i'm not going that far
good learning experience though. not a complete waste of time.
I tried all those includes at once, USB works with REPL and CIRCUITPY, but doing digitalio.DigitalInOut(board.A10) disconnects the USB. board.c contains:
#include "supervisor/usb.h"
#include "shared/runtime/interrupt_char.h"
#include "shared/readline/readline.h"
#include "lib/tinyusb/src/device/usbd.h"
#include "py/mpconfig.h"
#include "common-hal/microcontroller/Pin.h"
void board_init(void) {
USB_OTG_FS->GUSBCFG &= ~USB_OTG_GUSBCFG_FHMOD;
USB_OTG_FS->GUSBCFG ...
learning is all about learning from mistakes
At this point I don't understand why it's not working the way the datasheet implies. You mentioned that there is other firmware that allows use of A10, so it's probably worth studying those to see how they get around this problem.
it would be ugly but do you think an soic8 breakout would be possible?
the 8uson and soic-8 are both 8 pins...
possible - you'll need to solder tiny bodge wires. I'd suggest going up a level or two in your problem-solving to think about whether it's worth the effort, or whether switching to another board or changing the requirements (or the code) would help.
yeah i do have the s3 feather coming because i wanted to go up. eh was just thinking of a way around it.
yeah probably time to move onto the next project.
the breakout with the tiny wires would never really be structurally sound enough to move it around without concern.
breakout is for prototyping not a permanent install :/
thank you for your help everyone, much appreciated.
I agree, the behavior seems to contradict the datasheet.
As far as I understand, the FDMOD bit should be 1 while I do digitalio.DigitalInOut(board.A10). Maybe some other code overwrote that bit after we had set it to 1 initially? How can I set it to 1 as late as possible, for example from a CircuitPython script?
You can't set it from CircuitPython, and by code.py time it would be too late. boot.py might work but something might reset it in the interim. It's possible it's being reset somehow.
This kind of hair-pulling frustration is why we are not so fond of this board and its idea of exposing absolutely every pin. The A9 problem mentioned in #2361 was similar. Yes, A10 can be made available, but it's a lot of trouble, and causes a lot of support issues. Better to just hide it on a general-purp...
Looking at the PR to add Beetle esp32 c3 (#6615) I noticed that any microcontroller of this type would require modifying build_board_info, which in turn causes a build of all boards. The same would be true of esp32 boards, of which we hope a large number will be submitted soon.
Instead, create two different ways for an mpconfigboard.mk file to override the default setting by port: For espressif, use the existing IDF_TARGET variable. For the general case, allow the EXTENSIONS variable to be...
@onyx hinge I have a branch I was working on implementing board extensions in mpboardconfig.mk but I put it on the backburner due to too many things (I also want to reorganize the python files to have shared_bindings_matrix and the build_board_info depend on a common file in tools rather than on each other) https://github.com/adafruit/circuitpython/compare/main...Neradoc:circuitpython:board-extensions-in-boards-dir?expand=1
That sounds sensible. I wanted to easily re-use the information gathered from the mk configuration in the support matrix but it wasn't really available
so I shrugged and did something lazy instead
the matrix code runs make for each board to generate the full list of config variables
def get_settings_from_makefile(port_dir, board_name):
""" Invoke make in a mode which prints the database, then parse it for
settings.
This means that the effect of all Makefile directives is taken
into account, without having to re-encode the logic that sets them
in this script, something that has proved error-prone
"""
contents = subprocess.run(
["make", "-C", port_dir, f"BOARD={board_name}", "-qp", "print-CC"],
encoding="utf-8",
errors="replace",
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
# Make signals errors with exit status 2; 0 and 1 are "non-error" statuses
if contents.returncode not in (0, 1):
error_msg = (
f"Invoking '{' '.join(contents.args)}' exited with "
f"{contents.returncode}: {contents.stderr}"
)
raise RuntimeError(error_msg)
settings = {}
for line in contents.stdout.split('\n'):
# Handle both = and := definitions.
m = re.match(r'^([A-Z][A-Z0-9_]*) :?= (.*)$', line)
if m:
settings[m.group(1)] = m.group(2)
return settings
yes
I agree, except I didn't see how to easily structure it so that make would be invoked only once per board, rather than twice
emphasis on easily in that sentence
If you think you would get back to it then by all means note it on my PR so that it doesn't get merged and make your work more difficult.
I can look at it again and PR this week
cool, I hope you don't feel I stepped on your toes. and I appreciate you taking another look at it!
oh you're not stepping on anything, I just needed motivation to get back to it
it was just of immediate interest to me, because Limor was saying she hoped a lot of ESP32 boards would be contributed soon, and she was a bit concerned about the CI time for all of them. When I realised the existing support for building just a new/changed board would fail due to the need to edit this file, I wanted to act right away.
yeah that's gonna be a lot of boards
right now I'm deep into trying to understand when my browser decides to send an Origin of "null" which the web workflow doesn't like
I have a lot of respect for you folk who try to figure out web stuff
because I am utterly adrift
and it's a part I'm not familiar with, I have been doing javascript for a long time, never heard of "CORS preflight" but turns out it's important
(the browser sends an OPTION request before a cross-site request that has additional attributes like Authorization to ask if the server is gonna accept it)
yeah I was just reading https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request and getting the start of a gist of it.
oh so when we request http://circuitpython.local/something and get redirected to http://cpy-******.local, the first request has an Origin, but the redirect has Origin: null for some reason... I can fix that by having the code enquire the real host first and not use circuitpython.local (which I did, but not in a couple of requests)
fun random stuff
educative search results too:
How does setting Origin to null in a redirected CORS request protect against a confused deputy attack?
Setting this to draft as Neradoc mentioned on Discord having a work in progress solution to this which is probably better (cleans up this script and the support matrix script to work better together)
@onyx hinge I threw a simple little file manager over serial REPL together for working with my esp32-c3 boards. It's only a short term issue until the issues with web workflow and Thonny get worked out but I thought you might be able to use it for some of your ESP32 board work as well. https://github.com/RetiredWizard/Serial-File-Manager
I also wanna change the midi device name but it seems like this approach doesn't work anymore. Any tips?
It should still work.
-
Download CircuitPython (Iβm currently using 7.3.1)

-
Open the .UF2 with a HEX editor (I use PSPAD which is a free text editor)
-
Go to line 151100 (or search for βCircuitPython Audioβ):

-
Change the text for example to βMIDI Pe...
Sorry, watching the Weekly Meeting after the fact. So the add-on board for Pico will be "Bells" for Cow Bells. But it also trigger "bells and whistles" for me (non native English speaker). So I wonder what next. It seems that "bells and whistles" is a bit negative as useless additional feature, so maybe whistles should be avoided when thinking about this.
Interesting, I never thought of "bells & whistles" negatively, to me it's just always meant something has all the things or extras.
this turned into a guessing game, it tries to guess which orientation the USB-C cable on the macropad is connected, either A-Side or B-Side
by using MISO and ADC instead of the CC or SBU pins. Half the time it gets it wrong for the same orientation but it's fun to watch it guessing
I also wanna change the midi device name but it seems like this approach doesn't work anymore. Any tips?
I've added some more instructions. Hopefully they should help. Let me know if you get stuck!
Update frozen modules to fix various ESP32SPI and request issues with frozen modules on 7.3.1.
@onyx hinge I discovered that the reason the ru builds are so close to overflowing is that we did not suppress terminalio on SAMD21 for ru. So the ru font was in there. It was not due to an excessively large translation. The font was not in there for ja and ko. I turned off the ru font for SAMD21 (only) as is done for ja and ko, so that should give a lot more breathing room.
Oh that's a good find, thanks!
@lone axle You might be able to help out here. If it's a bonkers-long explanation, maybe point them to some docs, i.e. don't put an hour into replying by detailing all the steps yourself if that's what would end up happening. Because it feels like something that could end up taking ages. https://forums.adafruit.com/viewtopic.php?f=60&t=192845
am away from desk for a bit this afternoon. But I will reply back with the tips that I can later on when I return.
I don't know about the micropython portion (still have yet to try it directly on anything except the original micro:bit long time ago). But generally speaking I think virtual environments are probably the "best practice" solution to what they're wanting.
Sounds good. No rush, I think it's been a bit since they posted. Appreciate your response!
cookiecutter question
Select target_bundle:
1 - Adafruit
2 - Community
3 - CircuitPython Org
4 - test
what is option 3?
When generating a library that will live on the CircuitPython org, which is a separate thing on GitHub for libraries managed by groups, like display stuff.
which one for bundle?
Adafruit.
thanks. it's also hitting an exception.
at the very end (i think). it's after answering yes to sphinx_docs
IsADirectoryError: [Errno 21] Is a directory: "/home/user/temp/{% if cookiecutter.target_bundle != 'CircuitPython Org' %}{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }}_CircuitPython{% else %}CircuitPython{% endif %}_{{ cookiecutter.library_name|replace(' ', '_')}}{% else %}CircuitPython_Org_{{ cookiecutter.library_name|replace(' ', '_')}}{% endif %}/"
looks like template markup isn't getting replaced?
@tidal kiln make sure your cookie cutter is up to date via pip?
yah. that could be it. haven't done a lib in forever. there's cobwebs on everything. lemme try that.
I know I recently changed it so that a new (May 30 release maybe?) cookiecutter is needed
cookiecutter 1.7.3
get up to 2.1.1.
@onyx hinge thanks. that was it. my old steam powered version of cookiecutter couldn't cope.
Good to know! I'm not sure that there's any way to create an alert about the problem π¦
no worries. i should've guessed it was that.
@idle owl also thanks, for clarifying options
You're welcome!
I mean it was a recent update.... but it means you have to update cookiecutter. π
Is it worth pinning an updated version to the repo then?
Oh, I guess that isn't a thing for a cookiecutter repo
Huh. That would be a neat feature.
@ToxicTiger901 Tried again and it worked. Thanks a bunch for the detailed update! Still would love a way to just define a name in the Python code, but I don't know if that is even possible without help from Adafruit. Maybe something worth to consider @ladyada ? Totally understand if it's too hard
I guess you could do it as a prehook??
Actually, on that note, I meant to say @onyx hinge 1) thank you for that update to the cookiecutter, it was always a pain point to have to use MSYS on Windows for that reason and 2) is there a reason the hooks were removed? Were they causing problems for MSYS?
Or were they just not needed anymore?
Afternoon,
Wondering if there's any documentation about where CP code is stored in memory on an SOC? i.e. what memory address my code would be stored at once on the chip?
Is it always the same per SOC, or does it move depending on included modules, etc?
do you mean the firmware? It generally starts at the same place for a particular chip port. It's laid out in a linker script: https://github.com/adafruit/circuitpython/blob/main/ports/nrf/boards/common.template.ld
this script is templatized and has values filled in at build time (because .ld files are hard to parameterize)
Ok. So I could theoretically inject the hex of my application onto the chip if its in the right place and have CP run it?
i was talking about the circuitpython firmware, not the user's Python code. You're talking about the .py files?
Yes. I need to create a version of CP that has USB disabled, but also have my code execute. Seems like a catch 22 that I can't overcome any other way.
If there's a better way, I'm all ears
you can put the code on CIRCUITPY with a UF2 that doesn't have USB disabled, copy over the files, and then replace the firmware with a disabled-USB version. But if you're talking about a board that can't do USB, that is much more work. Even on boards that don't have mass storage USB, there is usually USB serial available. You could set up REPl access over UART, but that's more work.
Rather than attempt to continue using this board, could you use an nRF52 board that does have working USB, and just substitute it for the original right now, to continue your debuggin.
I hear you. I'm trying to use a kind of hybrid solution here: use a feather sense that has my code running properly, take an image of it and push it to my board.
I can do that, but it looks like the check for USB is causing the CP to not execute my code.
Is that right?
if your code depends on USB in some way, maybe that's preventing it
It doesn't
otherwise I'm not sure why it wouldn't work, but maybe turning off USB causes CIRCUITPY to be in a different place in the flash
That's the concern
Ok, so the takeaway is that even if CP has USB support built in, it should still run even if it doesn't find a USB device?
CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR says where the filesystem starts in flash (for an INTERNAL filesystem). You can look in build-yourboardname/common.ld to see it value. You could compare it on both boards.
it should be fine, it would be like it's running off battery or an AC adapter
I could be wrong, but I believe that the things the hooks WERE doing are all handled now just at the template level. It is possible I created a regression by not fully understanding the hooks, so feel free to open an issue and tag me if you do see something.
Fair enough. I'll try running through the process again and see if somehow I missed something.
Much appreciated, Dan - the memory template helps
@proven garnet What are you up to? (Driving probably, now that I think about it. Do not reply if so!) It occurred to me that we should update the README in the I2C address guide repo to have basic instructions as to how to add your own device. Not "here's how to make a PR", we can link to my guide for that, but "here's where to add your device based on address" type thing. https://github.com/adafruit/I2C_Addresses/ Can I talk you into doing that? I'm updating the alert in the guide, but thought we should have some kind of info on how to add a device properly in the repo.
Sounds good! I was mostly just curious.
Haha I was in fact driving. I can definitely take that on this week! Happy to PR my best guess or meet tomorrow evening if you want/have more to discuss about it.
I made some changes to make things fit, and updated some infrastructure things.
@jepler @tannewt I made the unix port use -std=gnu11 instead of gnu99. We don't need to support really old compilers. Also made a change to not include the ru font on SAMD21 builds, and built Feather ESP32-S3 TFT with -Os instead of -O2, rather than starting to disable more modules to make it fit.
@proven garnet PR would be great! I can comment on that if changes are needed.
Tried to do a little bit of debugging today. I am struggling to understand how all the different files and libraries link together.
Does anyone have any recommendations on a good way to navigate the circuit python code base? I am using VS Code. I have used Microchip X IDE in the past, but never for anything as complex and circuit python.
I'm not sure this should go in the board definition. Its actually a add-on proto-board with the GDI interface on it.
Yay for bumping our language -std=.
-std=gnu11 is the default of gcc10 fwiw but xtensa in particular may use an older gcc version
Yes, I updated the initial comment to link this PR to that issue. Thanks!
From my knowledge, to compose a valid address, you need to AND the last byte with 0xC0. For example:
address_bytes = bytearray(b'\x00\x00\x00\x00\x00\x00')
address_bytes[-1] = address_bytes[-1] | 0xC0 # now is b'\x00\x00\x00\x00\x00\xc0'
new_address = _bleio.Address(address_bytes, _bleio.Address.RANDOM_STATIC) # <Address c0:00:00:00:00:00>
_bleio.adapter.address = new_address
It would be nice if one (a person or a tool) could reliably locate device's filesystem mount path when given a serial port and vice versa.
Example situations:
- Thonny users need to select their device by serial port but as serial REPL can't be used for saving files by default, Thonny needs to locate device's filesystem mount. It currently uses
storage.getmount('/')to retrieve volume label and hopes to find single volume with given name. This doesn't work out when there are several C...
Or https://github.com/adafruit/Adafruit_Board_Toolkit, which uses most of the same insides as discotool?
CircuitPython version
7.3.1
Code/REPL
import board
import digitalio
led = digitalio.DigitalInOut(board.LED)
led.switch_to_output(value=1)
while True:
pass
Behavior
The LED comes on after 2.45s from connecting power or pressing RST button.
Description
This seems about twice as long as expected, with the safe mode delay being about 1s, and without an UF2 bootloader on the board.
Additional information
No response
Per @deshipu, this test was done with a UM FeatherS2 Neo.
I had a user test this, and they said they were unable to create new files on CIRCUITPY after the latest commit, using Windows
I tried the artifacts from the the latest commit on PyPortal on Linux with an SD card inserted, and confirmed that. I did this test on the artifact from before and after the latest commit.
$ cat >/media/halbert/CIRCUITPY/foo.txt
abc
[ctrl-D]
$ sync
$ ls /media/halbert/CIRCUITPY
Note that I did not cd /media/halbert/CIRCUITPY, because if the drive ...
CI is now warning us:
[Build CI: .github#L1](https://github.com/adafruit/circuitpython/pull/6619/files#annotation_4061653702)
The macOS-10.15 environment is deprecated, consider switching to macos-11(macos-latest), macos-12 instead. For more details see https://github.com/actions/virtual-environments/issues/5583
Smoke-tested wifi on PyPortal. It connects.
The Adafruit_Board_Toolkit is for serial ports, they only share the fixed pyserial list_ports.
Discotool goes through the USB hierarchy to associate the USB Mass Storage Device and the serial ports for each board, then find the actual mount point(s) for the USB drive. In my research at the time, I found no simple way to do that in a multi-platform way (I also rejected using pyusb due to the dependency to libusb which is outside of pip).
It was rather straightforward with pyudev on linux...
@Neradoc thanks for the clarification.
@aivarannamaa: microcontroller.cpu.uid returns the serial number, so you could access it from the REPL via the Thonny back end. But maybe that doesn't help to distinguish it via volume?
We have had some issues about the nibble and byte order of cpu.uid, and we may need to flip some things around to make them match.
@onyx hinge would you mind reviewing https://github.com/adafruit/circuitpython/pull/6619 (frozen libs update). I can make a 7.3.2 release after that. Thanks.
@tulip sleet actually just got to that e-mail. looking.
hmm I'm seeing something funky. gitk thinks that some commits were removed from the submodules.
oh everything's fine. It's something to do with the fact that the submodules were shallow.
Thanks! I confirmed that these updates look right. Didn't do any testing.
Hi @dhalbert,
Thank you very much for your help! I will have a look to the changes you made to learn about ways to shrink the builds!
Thank you!
How do you unshallow a particular submodule? I did a websearch for this and came up empty.
@Neradoc, thanks for the library and explanations! Somehow it never occurred to me that I could turn to OS for getting the match between serial port and mount point. Your library's deps are rather heavy, though... I'll need to give it some thought.
@dhalbert, I tried your advice on Cytron Maker Pi RP2040, but microcontroller.cpu.uid (bytearray(b'\xe6'\xc0b\x13B\x155')) seems to be very different from its USB serial id ( "E660C06213421535").
Fixed by #6513 (7.3.x) and #6495 (main)
@dhalbert, I tried your advice on Cytron Maker Pi RP2040, but
microcontroller.cpu.uid(bytearray(b'\xe6'\xc0b\x13B\x155')) seems to be very different from its USB serial id ("E660C06213421535").
The bytearray is mixed printing characters and hex-escaped characters. I think you substituted a single quote for a backtick in there. Assuming that, I get:
>>> [hex(b) for b in b'\xe6`\xc0b\x13B\x155']
['0xe6', '0x60', '0xc0', '0x62', '0x13', '0x42', '0x15', '0x35']
whose...
^^ for anybody with a SI1145
@dhalbert, thank you!
I thought E660C06213421535 is just a string of characters, not a hexlified representation of some bytes.
It looks like with this I can really implement the mount point lookup in Thonny. It's not good solution for going from mount point to serial port, though, so I'll think about alternative solutions for pipkin.
Please decide whether to close this issue or leave it open. For pipkin I would still like this extra line in boot_out.txt, but I understand that you h...
New board support for FigPi - a minifigure shaped board based on the RP2040 chip.
Automated website update for release 7.3.2 by Blinka.
Thanks @tulip sleet!
i hope this fixes the various hanging support issues we've been having
Yeah for sure.
is there a logfile for updates/bug fixes? i don't personally have any problems with 7.3 but sometimes i do enjoy reading revision files.
each release has release notes. There is not a combined revisions file.
π
I just submitted a PR for this! π https://github.com/adafruit/cookiecutter-adafruit-circuitpython/pull/189
I know, right? I saw that as well.
Here is the notes document for next Mondayβs CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if youβll be attending the meeting - itβs super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and weβll read them off during the meeting. Hope to see you there! <@&356864093652516868> https://docs.google.com/document/d/174YocaomvHHy4OktyspTOISd3ynNpG6PWtLDBT4hd2c/edit?usp=sharing
CircuitPython Weekly Meeting for July 25, 2022 Here is the notes document for next Mondayβs CircuitPython Weekly meeting. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if youβll be at...
It looks like with this I can really implement the mount point lookup in Thonny.
Oops, I just realized I got my thinking messed up. By learning the USB serial ID via MicroPython code I can easily find only the right serial port, which I already know. If I understood @Neradoc correctly, then the hard part is finding the mount point by serial port information. Having the serial ID explicitly written out at the mount point should make it easy.
found it. it was under the thing I'd already looked under twice
Thanks for catching the (embarrassingly) faulty logic on that PR, @onyx hinge! It looks like pkg_resources has the capability to compare versions, which makes sense since it's part of setuptools. They do discourage it in favor of other libraries (though not for any given reason), but it seems perfectly suitable, and since it's part of setuptools we can rely on it to be there.
oh because someone doing a library will have to have setuptools anyway.. oh that could be
I have most of the M5Stack devices and I've been playing around with the circuitpython source tree to see if it will run on one of them.
I'm using ports/espressif/boards/adafruit_feather_esp32_v2 (a regular esp32, which #6613 suggests can at least run to some extent) as a starting point, however I'm not sure what the development workflow for these non-usb devices would be, is circuitpython-firmware.bin intended to be written to a particular flash offset using esptool.py?
Yes, the firmware is to be loaded at 0. Typical esptool commandline:
esptool.py --chip esp32 -p /dev/serial/by-id/usb-1a86_USB_Single_Serial_5479024009-if00 -b 921600 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 8MB 0x0000 build-adafruit_feather_esp32_v2/firmware.bin
I don't know the details of the M5Stack. Right now the Feather ESP32 V2 is the only board we have with the ESP32. It has 2MB PSRAM and 8MB flash. I was trying t...
@idle owl I2C Address fix submitted as a PR
Merged! It's perfect, thanks!
First real contribution! Still pretty new to C/C++ as opposed to Python, but looking around, I think this is the fix for #3125, by casting it as a float. If I understand correctly, this will default to using float or double depending on the board's implementation.
But do let me know if that's not correct, honestly just trying to learn, so the recitation is mostly for me :D
how does one push ADC readings into DMA? Is the only way to use C/C++? Can the directives be given using CPy?
The reason not to do this is that single precision floats are only about 5-1/2 digits of accuracy, so we lose resolution if the values are cast to float. Try calling `time.time() multiple times from the REPL: I think you will see the value not change very often.
You're right, and it's probably better to keep the type consistent between ports. Happy to close since I don't have any obvious solution that. Was fun to try anyway!
No problem, and it's great you are seeing how to make changes like this.
@adafruit/circuitpythonlibrarians I think this can potentially be closed
thanks @dhalbert for testing, just want to re-confirm
CircuitPython version
- Adafruit CircuitPython 7.3.2 on 2022-07-20; MakerDiary nRF52840 MDK USB Dongle with nRF52840
- Customized CircuitPython 7.3.1; MakerDiary M60 Keyboard with nRF52840
Code/REPL
"""
Minimum working example adapted from https://github.com/adafruit/Adafruit_CircuitPython_BLE/blob/main/examples/ble_hid_periph.py
"""
# import board
import sys
import time
import microcontroller
from adafruit_hid.keyboard import Keyboard
from ada...
I am testing https://github.com/adafruit/circuitpython/commit/e780461f05b42d821a104638f613225a505e8c29 with a PyPortal with the simpler test code below. I initially only tested on Linux, but here are results for all.
Linux Ubuntu 22.04: as above. Both drvies appear, but when attempting to create a new file on either drive, it never shows up. Sometimes it appears as if the drives are remounting (disappear and appear in the file manager).
Windows 10 (latest version): Both drives appear, ...
I made a first attempt to resolve the issue identified by @FoamyGuy where the screen is not refreshed whenever no changes are drawn to the screen.
I modified this line to force a refresh, even when there are no "dirty" areas:
https://github.com/kmatch98/circuitpython/blob/fcde108d03cf589362f681e7e5acf6677e4d7be0/shared-module/framebufferio/FramebufferDisplay.c#L263
I forced this line to True always. It does refresh the screen and prevent it from graying out, but adds some glitching of ...
@dhalbert thanks, yeah, I confirmed the issue with creating new file. I probably don't test this enough. Will definitely running some disk benchmark this time to make sure everything is OK. Will push the fix if as soon I could
@lone axle just a heads up I marked you as a reviewer for a fix to the RTTTL library since it's about an issue you also addressed/solved, but let me know if you'd rather I just turn it over to Librarians :)
I'll take a look this evenning.
M5 Related: I just today received an M5 Stamp C3 which I plan to do a board definition for next week.
DMA ADC Access Issue: from Help-with-circuitpython:
The platform I am targeting is the RP2040
I am willing to dedicate resources to help make this work.
for how long do you want to do this (how many samples?)
ok, so not so much that you need to use two alternating DMA buffers or sometihng like that? There is some related code that does PDMIn in atmel-samd and nrf
it does a digital filter, which you don't need
I have an incoming signal enveloped over a set of 8 pulses at 40KHZ, each sampled 5 to 10 times per cycle.
nRF also has PDMIn but if I remember right there is a built-in peripheral
everything else we have built is for the RP2040...
we have to think about the Python API: should it be blocking for the duration of the sampling or should it be in the background. The latter is more general for longer intervals
can we use or reuse the interface?
I was just mentioing the other ports as a rough guide to what might be done
Blocking is fine for my app as long as its trigger by the incoming data
oh yes.. more general is better for everyone
in this case, a simple DMA straight to a buffer is probably fine. We don't need to process the samples on the fly and try to keep up. So PDMIn() sets things up and then .record() takes a buffer and a length (<= buffer length)
so we might just say it is restricted to an array.array of a specified width.
could be added to AnalogIn() as a bulk record operation
ok...I'll bone up on DMA everything (immersion). I guess we need a C/C++ lib-to-CPy module, right? A restricted array and array size is a great start and would satisfy me. It would also server as a basis for any possible enhancemnt later.
could also look about how/whether MicroPython does this, though they tend to be lower-level and more chip specific
I did find a reference on how one guys actually did this already...
you wouldn't use an existing library probably. Just find another DMA example in RP2040. busio.SPI uses DMA optionally. The other DMA examples are output
hmm.. ok where do I get the source?
not yet. but very experienced at C/C++ (20+ years at all levels, including assembly).
Gotcha..Cool!
Here are some things to look at:
https://docs.circuitpython.org/en/latest/README.html see left sidebar "DESIGN and PORTING REFERENCE".
https://learn.adafruit.com/building-circuitpython highly recommend you build on a native Linux system, if you're comfortable with that
https://learn.adafruit.com/extending-circuitpython unfortunately out of date in many details but overall shape is correct
we are very happy to provide help on this
Excellent...this will bring me up to the level I want on this device and also with CPy that I want to be. I would enjoy being a contributor when possible.
I'll dive into these documents right away....
Python API is in shared-bindings, and calls a uniform API which is reimplemented in common-hal in all the different ports. Sometimes there is shared code can be used across ports, it's in shared-module
you can try setting up a build environment initially too to experiment
ok. Great. I'll aim to great a small toy extension first, while becoming a virtual parrot on DMA. I already have a virtual-box with Ubuntu image. But I can get a Native Box if needed. This is exciting.
Thanks Dan!
we are excited for your interest as well! ask all the q's you want. Thanks!!
off to the books...Cheers!
https://github.com/adafruit/circuitpython/issues/487 is probably a good place to discuss API. good luck!
Scott's and Tim's deep dives may be of interest, but require a large time investment: https://www.youtube.com/playlist?list=PLjF7R1fz_OOXBHlu9msoXq2jQN4JpCk8A RP2040 audio DMA #68 and 69 in playlist, but that's output. you may get a flavor of the dev work from those in any case
LOL..I'm half-way thru them now... Especially inspirational for my music and audiophiles!
Hey, how about Webdav ?
I don't know much about it, except that it uses http. It would be nice to have some minimal implementation of it, if that doesn't require too many additions. That would allow accessing the files with a file manager application like Cyberduck, and use editors like VSCode, PyCharm, etc. maybe even mount as a drive on the computer (and run circup, why not).
@tulip sleet esp32 feather v1 - I either need to kick this back to you or poll you for ideas. I'm way off in the weeds. Maybe you'd have a chance to chat tomorrow?
I ended up trying to instrument the bootloader to find out why it is boot looping, and once I changed bootloader_console_init to return without doing anything, I could sort of get in to circuitpython, but that fails early during init of the flash filesystem (hangs until WDT reset) and again I went down a whole rabbit-shaped hole. but I haven't actually figured anything out that makes sense.
I can build and run micropython with the same esp-idf (I was starting to wonder if we had a problem in ours for esp32 but that's not it)
I tried adapting micropython's sdkconfig and partition table but it didn't make any difference to the boot looping. so that should have included any debug uart differences, I think. I'm of course in slight doubt that our sdkconfig-merging script is not doing something unexpected, just because I'm unfamiliar with it and sometimes it surprises me what it does.
I'm calling it quits for now because it's been a bit frustrating.
Happy to chat tomw about this. I felt the same way when I passed it to you -- it was bewildering and I felt like i was not making progress.
Out of curiosity, why are some of the board specific libraries getting added to PyPI?
Issue #6558 suggests that maybe Pi Pico W isn't fully supported yet (πΏ) but I wanted to add that even the most basic sample doesn't completely function:
import board
import digitalio
import time
led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT
while True:
print("Hello, CircuitPython!")
led.value = True
time.sleep(1)
led.value = False
time.sleep(1)
prints the string repeatedly but the led on the Pi Pico W doesn...
Hi, the LED on the pico W is not connected to the LED pin, it's connected to the wifi module.
Circuitpython doesn't support the pico W wifi module yet.
HI! I see. Thank you. Somewhat counter intuitive.
Reasonable to assume that the CP abstraction layer will finesse this and map the board.LED to the appropriate wifi module when that is supported?
Reasonable to assume that the CP abstraction layer will finesse this and map the board.LED to the appropriate wifi module when that is supported?
Probably not, actually, because board.LED is supposed to be an actual pin that you can use to create a DigitalInOut, and that would not be possible due to the indirection through the wifi module. The Arduino Nano Connect has similar simulated "pins". We could special case all that but it would be a lot of board-specific code.
The Core 2 works here, took some time to track down the cause of the reset but I just needed to prevent reset_all_pins() from resetting pins 7/8, which are psram data pins 0 and 1 on this device.

Thonny works best with packages that are on pypi, it can download them and put them on the circuitpython drive over the serial connection
The live version says this has an OLED, that's not true. I made minor modifications to Wemos's own description of the board here
I see that the title is "prepare", are we sitting on them for now? I'm in the airport totally about to board my flight crying inside as my flight keeps getting delayed, and I'm happy to review some of them.
Move the list of extensions per board into mpconfigport.mk an mpconfigboard.mk, with CIRCUITPY_BUILD_EXTENSIONS as a list of the exact extensions, eg: bin,uf2. Default port value is set in the port config file, by variant if necessary (like IDF_TARGET).
resolves #6269 and replaces #6618
The list of extensions is retrieved along other configuration data with get_settings_from_makefile which uses a call to make in order to automatically manage defaults per port and overrides per boa...
I didn't spot any concerns. I didn't do any direct testing, though, so leaving unmerged right this second in case someone else wants to do that. Thanks for working on this! The scripts don't have to be perfected today, but it's good to take a look every now and then to see what can be better. Please feel free to ping if nobody else weighs in.
Added WIZnet W5500-EVB-Pico board.
