#circuitpython-dev

1 messages · Page 14 of 1

glad mantle
#

so for example, if I'm writing this for a keyboard, I could have GP5 or COL2

#

for the same pin

jaunty juniper
#

yeah it's up to you

crimson ferry
#

by convention, the first in the list would match the silk, if that's appropriate

glad mantle
#

that sounds reasonable

#

can you include other code as part of the uf2?

jaunty juniper
glad mantle
#

so when they load that it's already set up as a keyboard with a basic keymap?

#

or do I just have to provide those files separately for them to load after flashing

#

you mean ^that stuff needs to be in there for the qwiic/stemma connector to work?

jaunty juniper
jaunty juniper
#

(it would still work setting it with busio and the pin names)

glad mantle
#

that picotool command, where would I run that from?

#

in the pico itself?

jaunty juniper
#

on your PC while the board is in RPI-RP2 mode

glad mantle
#

great, thanks

tulip sleet
#

@idle owl I moved the stuff we talked about to the Welcome to CircuitPython FAQ page. I also reorganized the FAQs and put subject headings on groups of related questions. The BLE info fit with the Internet question and i added a q re RFM. Still to do is to put the port-specific-stuff into the RTD doc.

tulip sleet
#

also I forgot to say I added blue info boxes to the ESP32-S3 and -C3 product guides on the Overview pages to warn about the BLE restrictions on those boards.

jaunty juniper
#

nice

#

@tulip sleet do you know if there's a reason not to use CIRCUITPY_STATUS_LED on the pico ?

tulip sleet
#

there is no simple LED

#

only the neopixel

jaunty juniper
#

the raspberry pico

tulip sleet
#

oh sorry, i read qt py, i don't know why

#

eh, maybe no reason

manic glacierBOT
#

Not sure if it helps any, but I figured out the specific build where this started happening, at least for the Seeed XIAO ESP32C3. The error does not occur on 8d34445 and it does occur on de95463. That would point toward the issue being from #7023 , which had a big update to esp-idf included. I'm way too much of a newb on this to track down the error from there, but hopefully this can help narrow it down some.

tulip sleet
#

if the user uses, it, it should take over

manic glacierBOT
#

Not sure if it helps any, but I figured out the specific build where this started happening, at least for the Seeed XIAO ESP32C3. The error does not occur on 8d34445 and it does occur on de95463. That would point toward the issue being from #7023 , which had a big update to esp-idf included. I'm way too much of a newb on this to track down the error from there, but hopefully this can help narrow it down some.

I did a bisect inside esp-idf to narrow it down further inside the esp-id...

thorny jay
#

I am reading the newsletter and in particular the release notes of beta.2 . I wonder if for the sentence Added WiFi workflow with browser-based device discovery, filesystem browsing, upload, download, file editing, serial/REPL connection. if true, you could add (available only on Espressif for now) I mean, where is the wifi workflow available? Does it work with build-in AirLift? Any other MCU with wifi (knowing the PicoW does not have the wifi workflow).

manic glacierBOT
manic glacierBOT
#

I thought the safe mode blink was not enabled when coming out of deep sleep. That would make sense, after all if you need safe mode after deep sleep you can just press reset then enter safe mode.

Hmm, it does appear that way.wait_for_safe_mode_reset() in supervisor/shared/safe_mode.c determines whether to wait or not for the safe mode reset. It returns immediately in these circumstances:
https://github.com/adafruit/circuitpython/blob/b56d5d97d2ecdd11adb270770beabd0ed96c9c15/supervis...

thorny jay
# tulip sleet I wlll do that.

I think it is one of the place where expectation can be managed. And there are a lot of useful such information, like "only on RP2040 for now".
Not like if everyone is reading the release notes. 😉

tulip sleet
#

@jaunty juniper if you feel like adding and testing the status LED for the pico (trickier on Pico W), go ahead -- that would be nice!

manic glacierBOT
#

Getting the following error on set_ipv4_address line:
TypeError: extra positional arguments given

Code is below. Creating ipaddress objects as specified in the documentation for the wifi module. ipaddress objects are created correctly.

`dic = {}
with open('PCATS_WID_CONFIG.ini') as f:
lines = f.readlines()
for line in lines:
if line[0] is not '#':
line = line.strip()
key = line.split(':')[0].lower()
value = line.split(': ')[1]
...

jaunty juniper
#

I wrote a script to find boards that have board.NEOPIXEL but no status led defined in mpconfig, same with LED if no rgb status, or board.SCL and I2C but no default bus pins in mpconfig (or spi or uart) I'll see if I do a PR with those that it makes sens to add

tidal kiln
#

@tulip sleet thanks. those updates look good. really like how the main sections are broken up.

tulip sleet
crimson ferry
#

Does it ring a bell that there may be a missing timeout somewhere in the requests stack (espressif 7.3.3) ...that would require watchdog to recover from?

manic glacierBOT
#

CircuitPython version

Current main branch. https://github.com/adafruit/circuitpython/commit/b56d5d97d2ecdd11adb270770beabd0ed96c9c15

Code/REPL

# Using adafruit_httpserver.py from https://github.com/adafruit/Adafruit_CircuitPython_HTTPServer/blob/ba2da4352290b880592ae5ab5db83ee50c045244/adafruit_httpserver.py

from secrets import secrets
import socketpool
import wifi
from adafruit_httpserver import HTTPServer, HTTPResponse

ssid = secrets['WIFI_SSID']...
#

Not sure if it helps any, but I figured out the specific build where this started happening, at least for the Seeed XIAO ESP32C3. The error does not occur on 8d34445 and it does occur on de95463. That would point toward the issue being from #7023 , which had a big update to esp-idf included. I'm way too much of a newb on this to track down the error from there, but hopefully this can help narrow it down some.

I did a bisect inside esp-idf to narrow it down further inside the ...

manic glacierBOT
#

I should clarify that when connected to usb it simulates sleep and doesn't actually reset, so the reset reason doesn't get updated. But when I disconnect and run over battery it consistently reports the reason as being SOFTWARE upon being awoken from deep sleep, regardless of the previous reset reason. I'll let y'all decide if that's a bug or not.

I'll poke at using the existing in compile time option, which looks like it should work.

crimson ferry
#

wasn't there something recently about espressif not supporting elliptic TLS algorithms?

#

I've searched github, meeting notes, and discord

onyx hinge
#

@crimson ferry I encountered that TLS 1.3 wasn't supported on Pico W but that is different than TLS algorithm support.

crimson ferry
#

ok, thanks, maybe I dreamed about the elliptic thing o_O

onyx hinge
#

@tulip sleet I was kinda sucked in by that "port doom" thing yesterday, I'll dig out and respond to your messages later today.

tulip sleet
onyx hinge
#

I'll get it sorted. silly me, not bothering to build locally.

tulip sleet
#

I will make a beta.3 today with that as the last change, probably

onyx hinge
#

@tulip sleet foamyguy saw that "large files" weren't sending with the httpserver. I was just running a manual test connecting to a "netcat -l" listener and sending various amounts of data.

tulip sleet
onyx hinge
#

I will

onyx hinge
#

@tulip sleet that PR is updated and I re-tested it; sendall still works after the change.

#

@tulip sleet next I'm figuring out the status of the async stuff. do you care about getting that into beta.3?

tulip sleet
onyx hinge
#

@tulip sleet looks like the updated ticks and asyncio libs are released, so we can update frozen modules?

tulip sleet
onyx hinge
#

The tests get the code from frozen/

#

I don't know if they're actually frozen into something but I guess they must be since the submodules were there

tulip sleet
#

only elecfreaks_picoed; they freeze a ton of stuff, and I already discussed that with them; they really want to

onyx hinge
#

is there a command to update frozen modules or is it a manual process?

tulip sleet
#

make update-frozen-modules at the top level

#

i can do that, but then you need to approve, or vice versa. If you are in there, you can make a PR, and then it's off your plate

onyx hinge
#

OK it's pulling a lot of changes. I should commit them all?

#
    modified:   frozen/Adafruit_CircuitPython_Display_Text
    modified:   frozen/Adafruit_CircuitPython_RFM69
    modified:   frozen/Adafruit_CircuitPython_SD
    modified:   frozen/Adafruit_CircuitPython_Ticks
tulip sleet
#

yes

#

a lot of these changes are inconsequential; not really code changes

#

from library sweeps of various kinds

brazen hatch
#

I will be heavily using the display stuff the next few days, so in case any issues pop up, I will probably catch em.

#

Rewriting ljinux support for ssd1306, as a package

manic glacierBOT
onyx hinge
tulip sleet
#

I want to merge that too, so undraft it if you've tested and feel it's ready

onyx hinge
#

@tulip sleet I took it out of draft 2 hours ago but didn't ping or anything

#

checks are still ongoing 😕

#

some are failing due to network

#

ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/a7/79/86ea5a4c0b80840671cda065d9e037fd6c402ccc9d37e6ad0b1d2e370e57/awscli-1.25.94-py3-none-any.whl (Caused by NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f1bb7461d20>: Failed to establish a new connection: [Errno 101] Network is unreachable'))

tulip sleet
#

lotsa failures these days

onyx hinge
#

yeah

manic glacierBOT
manic glacierBOT
#

I have made changes to the API and have added CoprocMemory which provides access to the shared memory region.

In the following example:

  • 0x500007fc is the address of shared_mem variable.
  • The value of coproc.memory(program)[0] decides the LED blink interval.
  • Here is the pre-compiled binary of the ulp program.

🚨 Blink Example:

# CircuitPython

import coproc

shared_mem = coproc.Copr...
tulip sleet
#

@analog bridge I've been trying for a couple of days to fix the ESP32-C3 boot-loop problem. The only change is the toolchain update from patch3 to patch4 (and eventually to patch5). I built the hello_world program to see what was in the "standard" sdkconfig, and tried changing ours a bit: tried different optimization levels, stack sizes, and disabling/enabling a few things. No luck. It fails in esp-idf's startup.c in most cases; I can turn off some options to make it fail early in our main.c, but there is something fundamental going on. We have our own variation on the build process, with lots of hardwired stuff to avoid their general CMake process, so I will probably start looking at that. I could open an esp-idf issue, but I don't have a test case besides the whole thing, and we're doing enough non-standard that they might not care. I could also ask in esp32.com, but that has generally been fruitless. Do you have any more ideas of things I could try? I'm not going to hold up beta.3 to get the C3's working.

#

it is odd that the firmware size is quite different going from patch3 to patch4. They did change the riscv architecture designation

analog bridge
#

I also suspect our build process, I have tried changing things in sdkconfig but no luck.

tulip sleet
#

i can make it work by rolling back to patch3, even with the tip of main

#

i need to understand cmake better, and maybe rely more on their sdkconfig tooling. Scott put this interesting comment in the Makefile:

    # Newer versions of the idf will have save-defconfig that will only include non-default values.
    # We should use that when available. For now, we sort out everything.
analog bridge
#

the save-defconfig thing is present in idf v5.0

tulip sleet
#

but not in 4.4? oh well

analog bridge
#

since, we are already running custom idf, we can revert the toolchain as a hotfix until the issue is figured out?

tulip sleet
#

the toolchain choice is not flexible per architecture. It is a single version for all chips. I need the esp-idf rolled forward to the current version to get the wifi fixes for the other chips. I would rather keep it on patch5 for the xtensa chips. I certainly could hack up a custom build process for the c3 by copying files around to get patch3 only for those builds. But first I'll study a bit on cleaning up the build process and maybe getting more info automatically instead of wiring choices in the Makefile.

#

i can't find anything like release notes for the patch<n> releases, but maybe I will ask our Espressif contacts

jaunty juniper
#

it seems that esp-idf/tools/tools.json details the toolchain per chip ?

tulip sleet
#

that does, there is also toolchain_versions.mk

#

which is across all. But I wasn't sure how it was being used

#

but good point, it may be easier than I feared

#

my work so far was trying to figure out the cause instead of giving up. But for beta.4 maybe I should just give up, and we can wait for esp-idf v5.0 and clean things up more

idle owl
#

Loaded absolute latest onto my Feather RP2040, and now it's called NO NAME, and there's nothing only a boot_out.txt file on it.

#

Tried again, same.

tulip sleet
#

erase_filesystem, sounds corrupted

idle owl
#

Ok will do thanks

#

Same result.

#

CP is obviously loaded, because I can get to it through serial.

#

But....

tulip sleet
#

try beta.2 and erase_filesystem

idle owl
#

Ok

#

It's storage.erase_filesystem() correct?

tulip sleet
#

i want to know if it's due to latest or something else. If you have another Feather RP2040, try that too

idle owl
#

I definitely have another Feather, lol

random junco
#

I just tried another Feather, mine worked with the latest from S3

tulip sleet
#

another RP2040?

random junco
#

yup, should have mentioned that

idle owl
#

OK, latest works on another Feather

#

So it's this specific Feather? wth.

tulip sleet
#

you could try the nuke but honestly that should not be necessary

analog bridge
tulip sleet
idle owl
#

Beta 2 also does NO NAME on this one.

#

We did a nuke for these?

tulip sleet
#

hmm, could be bad flash, so try the nuke.uf2

idle owl
#

Where is it? I don't see it in the guide.

tulip sleet
#

you can use the pi pico one

#

i think it will work

idle owl
#

worth trying

tulip sleet
#

is this a brand new one? I wonder if the flash chip changed from under us ??

idle owl
#

No it's not brand new. It's pink, but I haven't ordered one of these in a while.

#

I don't see it on the Pico guide either

idle owl
#

Uff, never thought to look there. Thank you

#

🎉 That worked!

#

Thanks Dan.

tulip sleet
#

i don't know why! erase_filesystem should erase everything that nuke does, but I guess it doesn't

idle owl
#

🤷🏻‍♀️

tulip sleet
#

off to take a walk to Trader Joe's for groceries

idle owl
#

Have a good one!

onyx hinge
#

thanks for the merges Dan!

idle owl
#

Ok this LED wired up to this light sensor on the INT pin is not doing what I'm expecting it to do. I am perhaps not understanding how the interrupt functionality works for this sensor.

#

Bleh.

manic glacierBOT
#

I am having a problem too with the same model XIAO. The S1 version you provided actually got it to where I can see the REPL in Thonny. However, it will not fully uploaded to the library. The flash problems were happening before this new issue. I will be interested to see how this is resolved.

@WULFFJ I was running into the same error & was able to get it working through the CircuitPython Web Workflow after following the steps [here](https://learn.adafruit.com/circuitpython-with-esp32-qui...

idle owl
manic glacierBOT
ember iris
idle owl
#

@tulip sleet @onyx hinge I think when we add major changes to CircuitPython, e.g. supporting ESP32, we should drop a note in the discord helpers channel so everyone is aware.

ember iris
idle owl
#

I can merge it if you don't have access.

ember iris
#

The comment should be there by now with approval, should I go ahead and merge or would you like to?

idle owl
#

You're welcome to! Wasn't sure if you had access.

#

Thank you for being thorough! I was going off of my own brain which could absolutely have been wrong.

ember iris
#

I could have still been wrong and gone, "Nah that is spelled right, I don't need to check" in spaces I thought were solid. My brain has been slow mush of late whenever I'm not deep in my current focus project

idle owl
#

I'm still dealing with COVID brain. So.... definitely mush.

ember iris
#

Since it's a breaking change, do you want to handle the release versioning change?

idle owl
#

You can do the release too! Bump it to 3.0.0, and make a note of what I broke, and include the rest of the boiler plate.

ember iris
#

That is a much more reasonable mush brain reason I think
Will do, I'll be asking questions once I get to them

idle owl
#

Tag me so I know!

idle owl
ember iris
idle owl
#

Sure

ember iris
idle owl
#

Docs aren't completely set up. Please do the release assuming they are, and I'll get to the final piece of set up when I get to it. Totally on me.

#

Oh wait

#

You're saying the docs are wrong?

#

the main link in the README?

ember iris
#

The link in the readme is pointing to a dead link

idle owl
#

Ooh, yes please do this release with the correct link, and then submit a PR if you're up for it

ember iris
ember iris
#

(you can also hear the cogs thonking into place as my mind tries to finish a thought)

idle owl
#

I need this release for a guide, so we'll simply do another one when your fix is in.

jaunty juniper
#

you don't need a release for doc fixes too so it's not as big a deal

ember iris
#

Oh I did not know that, that's wonderful

#

@idle owl Am I correct in noting that the only end user breaking change is that ltr303.int_persistance is now ltr303.int_persistence

ember iris
#

Ok because this is only the second release I've done, is this correct:

Fixed spelling errors and increased specificity for some variables and property names. Additionally flipped the polarity in the `ltr303_advanced_test` to `True` to work with attaching an LED to the int pin to see when it is triggered. Thanks @kattni!

Variables changed:
 - `ltr303.int_persistance` is now `ltr303.int_persistence`
 
To use in CircuitPython, simply install the [Adafruit CircuitPython Bundle](https://circuitpython.org/libraries).

To use in CPython, `pip3 install adafruit-circuitpython-ltr329-ltr303`.

Read the [docs](https://docs.circuitpython.org/projects/ltr329-ltr303/en/latest/) for info on how to use it.
#

I think I have all of the rest of the changes correct and @idle owl I forgot to ping on the above

idle owl
#

Congrats on your second release!

ember iris
#

It's published! I'll draft a pr fixing the readme shortly. Let me know if I need to fix/improve something so you can get the learn guide ready to go!

manic glacierBOT
#

I am having a problem too with the same model XIAO. The S1 version you provided actually got it to where I can see the REPL in Thonny. However, it will not fully uploaded to the library. The flash problems were happening before this new issue. I will be interested to see how this is resolved.

@WULFFJ I was running into the same error & was able to get it working through the CircuitPython Web Workflow after following the steps [here](https://learn.adafruit.com/circuitpython-with-esp...

idle owl
ember iris
#

Ok, what originally was going to be a one line change has become a lot more lines across the documentation than I expected. I'm going to come back to this midday tomorrow unless someone wants to take it from me. There's enough points where the ltr303 needs to be added that I want to be more thorough than I can be before I need to head offline for the evening

ember iris
#

Thanks--would a web crawler testing for valid links be useful? I don't know how often this issue comes up and am torn by the programmers urge to automate pointless tasks

idle owl
#

This is a new product/repo, so better to catch all of this sooner rather than later. Point is, not many are likely to be using it yet.

ember iris
idle owl
ember iris
#

ok that's good to know--I'll resist the urge until after I get the pull request finished
Thanks, and I'm stepping away for the evening so have a good rest of the day and get some much needed/earned rest!

stuck elbow
#

perhaps some of those could be stolen for displayio

idle owl
manic glacierBOT
tulip sleet
#

@stuck elbow -- Thanks! I made an issue to track this.

manic glacierBOT
#

Hi! Thanks for your report. This method is actually unimplemented on the Pico W at this time. However, the reason you did not get a NotImplemented error appears to be a simple usage error.

I'll explain the usage error but changing your code will only get you the NotImplemented error, it won't fix the problem.

    def set_ipv4_address(
        self,
        *,
        ipv4: ipaddress.IPv4Address,
        netmask: ipaddress.IPv4Address,
        gateway: ipaddress.IPv4Address,...
manic glacierBOT
#

Hi,

Thank you for the response. Is there a timeline for when this function
might be implented on the Pico W?

Kind regards,
Tal

On Thu, 20 Oct 2022, 12:34 Jeff Epler, @.***> wrote:

Hi! Thanks for your report. This method is actually unimplemented on the
Pico W at this time. However, the reason you did not get a NotImplemented
error appears to be a simple usage error.

I'll explain the usage error but changing your code will only get you the
NotImplemented error, it won't f...

#

I tested this with static configuration on my own (dhcp-managed) network:

wifi.radio.set_ipv4_address(
        ipv4=ip_address("10.0.4.33"),
        netmask=ip_address("255.0.0.0"),
        gateway=ip_address("10.0.2.76"),     
        ipv4_dns=ip_address("10.0.2.76"),
        )
#wifi.radio.start_dhcp()
print("before connect", wifi.radio.ipv4_address, wifi.radio.ipv4_subnet, wifi.radio.ipv4_gateway, wifi.radio.ipv4_dns)
ssid = os.getenv('WIFI_SSID')
print("Connecting to", ssi...
#

You might wonder how this fixes a problem with PulseIn, when the changes aren't to any of those files! PulseIn is implemented in terms of StateMachine, which had some assumptions about the relation between the index of a pin object in mcu_pin_global_dict_table and its "pin number". This was true, until some pins were removed from the microcontroller module on Pico W.

Closes: #7078

manic glacierBOT
warm stump
#

Had a USB quick-disconnect issue on linux with the macropad, it erased all my data...
good thing I had a backup - a snapshot that wasn't irrecoverably far back.
I had another look at the time I had to write a memory driver, I had a factory default memory erase method.

Is it possible that the issue occurred because the default action for a != STATUS_OK memory initialisation
is to return to defaults? (instead of leaving the SPI Flash like it is or attempting journalling repairs? parity could also be useful)
Has this happened to anyone else on any other boards recently? Still on CP7

I should make it a bit clearer, it's normally very good at keeping data intact, it's only linux and only on rapid connect and disconnect from USB

brazen hatch
tulip sleet
#

a quick power cycle might do this either because a write being done due to mounting was interrupted, perhaps after an erase but before the write, or because there is a low-power condition that causes the SPI flash chip to have too-low voltage for a period. We had this problem more frequently with SAMD51 for a while, and had to modify the bootloader to add brownout detection very early.

Re erase before write: a "page" of flash erased to all 1's an then written. This is how this kind of flash works. So there is a period of time when there is a whole chunk of all 1's. If the write is interrupted there will be lot of bad data on that page. Pages vary in size but 256 bytes is typical

manic glacierBOT
#
# CircuitPython

import alarm
import coproc

if alarm.wake_alarm is None:
    with open("sleep.bin", "rb") as f:
        program = coproc.Coproc(buffer=f.read())
    alarm.exit_and_deep_sleep_until_alarms(alarm.coproc.CoprocAlarm(program))
else:
    print(alarm.wake_alarm)

// ULP RISC-V

#include 
#include 
#include 
#include "ulp_riscv/ulp_riscv.h"
#include "ulp_riscv/ulp_riscv_utils.h"
#include "ulp_riscv/ulp_riscv_gpio.h"

int main (void) {
    ...
brazen hatch
#

microcontrollers are considered appliances
not conputers
so your average user unplugs it without concern

#

and its as it should be

manic glacierBOT
warm stump
# tulip sleet a quick power cycle might do this either because a write being done due to mount...

trying to think of a solution which doesn't involve having 2 methods of storage without the same quirks...besides adding a spinning disk mini floppy drive to the macropad...
maybe some flash chips come premade in the same package with double memory that takes care of that redundancy for you so circuitpython doesn't have to worry about it?
so long as that also doesn't have the same problem and it recovers a bit like RAID1, it will be good to use on keyboards etc...RAID1 on a keyboard? ¯\_(ツ)_/¯

tulip sleet
#

if you can come up with a scenario that causes it to happen relatively often, we can consider it a bug. It's not inherent necessarily, but power glitches can be an issue. we might want to add more power-checking logic at various places

onyx hinge
#

Use boot.py to disable mass storage or (is this possible?) set it read-only to the host computer. If no flash writes occur, then no corruption can occur.

#

of course then your keyboard needs a way to enter safe mode, where it would be writable by the host computer, to fix or update the software

tulip sleet
#

normally the host would not write to CIRCUITPY when mounting. But some utility programs might cause this to happen. What OS is this on?

#

what is the exact scenario where this occurred? Did you unplug/replug very quickly, etc.?

warm stump
# tulip sleet if you can come up with a scenario that causes it to happen relatively often, we...

I haven't just come up with it in this case, it actually happens. Raspberry Pi Keyboard with the USB Hub on the back (or similar), swapping out the USB cable between devices within 3s of device boot
or in another scenario using a KVM Switch that doesn't maintain power to the USB Hub with the macropad attached (it's a bit much to say don't use it with a hub as using it with a hub should be ok)
Linux - Raspberry Pi OS Debian Bullseye, hasn't happened as much on Windows as it has on Linux but not ruling it out as it probably has happened on Windows as well in low power conditions
though on Windows I've noticed it will go back to the UF2 loader sometimes if this happens, then when it goes back to CircuitPy it's all integral. On Linux the same thing causes the data loss.

tulip sleet
#

does your code.py write to flash at all?

#

(including microcontroller.nvm)

onyx hinge
#

Some versions of CircuitPython have also had bugs that caused boot_out.txt to always be rewritten at every boot-up

tulip sleet
#

which version of CP7 are you running?

onyx hinge
#

@tulip sleet Linux DOES write to a FAT filesystem when mounting/unmounting it. tud_msc_write10_cb(lun=0 lba=1 offset=0 bufsize=512)

warm stump
#

the one that was loaded doesn't write to flash, the one before that which was unloaded was the rtc test. boot_out.txt was there but it seemed fine.
It reverted to "hello world" code.py on this event and true different OS's write hidden spotlight files to USB flash drives to aid search indexing
I loaded 7.0.0-rc1 afterwards, this is probably not what I had running on it beforehand, I think it was 8.0.0-alpha, then I went backwards to fix it

tulip sleet
#

maybe it is clearing the dirty bit

onyx hinge
#

It appears that Linux is setting the FAT 'dirty' state at mount and clearing it when unmounting. This lets it warn that the filesystem was not unmounted cleanly.

#

an auspicious line number.

tulip sleet
#

i wonder if we should suppress writes to the dirty bit. It has never been useful, really. It's either just scolding or the filesystem is trashed anywya

onyx hinge
#

wishing that Linux or any other operating system did something different is probably fruitless

tulip sleet
#

right, but we could circumvent it

#

I mean, we would notice writes to that block, and see if the only change was the dirty bit. If so, discard the write

onyx hinge
#

yes I was thinking along those lines

#

I don't know if a 'no change' write is already suppressed at a lower level ; if it is then if(lba == 1 && offset == 0) { clear that specific bit } in msc write could do it

tulip sleet
#

there is code to compare and detect no-change writes on various ports, not sure it is on all ports

onyx hinge
warm stump
#

Windows: writes __pycache__ if a cpython310 is run from the macropad
Mac: writes .Spotlight-V100 and VolumeConfiguration.plist for search indexing
Linux: writes .fseventsd (hidden) and a uuid for later quick reference
All 3 seem to be fine, the data loss event is something other than this
and seeing as this happens in a low-power scenario, it probably is setting a colliding disk check flag. Windows was aware of it quite a long time in advance

onyx hinge
#

"linux: writes .fseventsd" must specific to some linux distributions and/or desktop environments because my system doesn't do anything like that

warm stump
#

might also be Apple in that case, so then what linux is doing for search indexing like Mac and Windows maybe isn't working?

onyx hinge
#

but I reject most software written after 1998, I don't dispute that something popular like gnome does that 🙂

#

"Linux" doesn't monolithically do any one thing for filesystem indexing, it depends on the distribution & desktop environment.

warm stump
#

so in this case Raspberry Pi OS

tulip sleet
#

when we create CIRCUITPY, we create some macos-specific files to prevent macos from creating junk in the filesystem

#

it is not due to Linux

#

circuitpython itself does that

onyx hinge
#

I think either setting your computer to not mount CIRCUITPY, or setting CircuitPython so that it does not appear as mass storage, or setting CircuitPython so that it does not offer writable mass storage is what I would do as a practical thing on these devices that you just want to use as devices, not as development platforms.

#

and making sure you have a version not affected by the "writes boot_out.txt everytime" bug

tulip sleet
#

we create these when CIRCUITPY is first created:

        // inhibit file indexing on MacOS
        res = f_mkdir(&vfs_fat->fatfs, "/.fseventsd");
        if (res != FR_OK) {
            return false;
        }
        make_empty_file(&vfs_fat->fatfs, "/.metadata_never_index");
        make_empty_file(&vfs_fat->fatfs, "/.Trashes");
        make_empty_file(&vfs_fat->fatfs, "/.fseventsd/no_log");
        // make a sample code.py file
        make_sample_code_file(&vfs_fat->fatfs);
warm stump
#

that's been there and has been fine, the thing causing the data loss isn't one of these ones
Windows has even logged to it after doing a disk check...wait, are you considering making one partition readable and one partition read-only redundant?

onyx hinge
#

@tulip sleet maybe we should add a writable=True parameter to storage.enable_usb_drive() ? Otherwise, I don't see how to make CIRCUITPY writable by neither CircuitPython nor the host computer.

tulip sleet
#

by neither? Turn off MSC and remount as readonly?

onyx hinge
#

well, for some reason I was thinking "could be mounted readonly by the computer" was a goal but I'm not sure why that'd be. Well, maybe you want to keep something like an encrypted SSH key in your keyboard's read only storage, that'd be cool

#

So, yes, I think it's missing to be able to have CIRCUITPY mountable by the computer, but not writable from Python code and not writable from the computer.

idle owl
#

@ember iris Thank you for the review! I replied 🙂

warm stump
ember iris
idle owl
onyx hinge
#

@idle owl @ember iris pretty sure github protects against double-merging, but you two should coordinate and press the button at as close to the same time as possible and find out

ember iris
tulip sleet
#

if the device presents as read-only on mount, then Linux is not going to try to write the dirty bit, I assume

onyx hinge
#

@warm stump OK, as long as you're aware of some possible workarounds for this problem that is vexing you. It's OK if you discount them as not applicable in your situation, but thanks for hearing what I had to say.

tulip sleet
#

so the simple solutions are to turn off MSC in boot.py so CIRCUITPY doesn't appear at all, or flip it to read-only (by making it r/w to CIrcuitPytyhon) with a remount in boot.py

idle owl
#

@ember iris Cheers! I think that's the last piece I need to complete the guide, as long as the Arduino code works, heh. Appreciate the help!

#

@ember iris Actually (sorry for double-ping), can you do a release? The examples all end up bundled as well so we should do one. It's super minor to 3.0.1 (at least I think we're currently at 3.0.0) will work.

onyx hinge
#

It's probably extremely difficult to make the device bulletproof against power loss during a flash write, and there's no journalling / flash-friendly filesystem (that would be recover from having the in-progress block erased or partially written) that is ALSO widely mountable by host computers, so I'm not confident there's a 100% bulletproof change that doesn't give up important functionality.

warm stump
# onyx hinge <@539881446756843560> OK, as long as you're aware of some possible workarounds f...

That's ok, not a problem for me as I had my backup. Just trying to prevent it in case it happens to someone else, it's an event that occurs more often than not in the space of a few months that gets missed in testing. @tulip sleet I'll have a look at what Raspberry Pi OS is doing on a separate device, I think you're right, it probably is that it isn't trying to disk check in the same way as Windows is.

tulip sleet
#

we would have loved to use something other than MSC FAT. MTP (Media Transfer Protocol) used by MP3 players from way backwould have been great, but Apple refused to support it for marketing reasons -- competed with iPods.

#

MTP is higher level and we could have used a more robust filesystem underneath

onyx hinge
#

mark my words: web workflow over usb networking will be the new wave

#

someone should get cracking

warm stump
#

already got non-standard time protocol on it, otherwise -_(\ (facepalm)

onyx hinge
#

time protocol?

warm stump
idle owl
#

@ember iris Oh hey. You merged my fourth and final PR needed for Hacktoberfest. Thanks! 😄

ember iris
idle owl
#

@tulip sleet Ok, so now I can finally remember which leg is which on an LED. But I still can't remember what a good sized resistor is for including in the wiring. I have one wired up here with a resistor, but I didn't get it out of the bag this time, I had it from before, and don't know what it is. This is for a Fritzing diagram so it doesn't need to match what I have in front of me, only need to be a reasonable resistance.

#

What's a good resistance to choose?

tulip sleet
#

220-1k, depends on the current rating. 1k is safe, but it migh be dim

idle owl
#

So 470 is ok?

#

That's what I picked then second guessed it.

tulip sleet
#

for testing, sure, don't worry

idle owl
#

Ok. This is purely for testing, you wouldn't put this in a project as-is.

#

I guess I am starting to remember what resistor to use.

tulip sleet
#

like, just test it with the 3.3v pin by hand, and if it works

idle owl
#

It works, and the LED hasn't burned out or whatever they do, and it's not too dim. If that's what I chose physically anyway.

#

(I don't know what's sitting in front of me.)

#

I'll use 470 for the diagram and call it good.

#

Thanks!

idle owl
#

Huh.

#

Ok. Bookmarking that.

tulip sleet
idle owl
#

Also bookmarked.

ember iris
#

If you've never done it, (and have the resources) it's absolutely worth while to blow some LEDs up. It's really helpful to get a sense of how sensitive (or resilient) different components are. Run an LED at 3.3v with no resistor, 5v with no resistor, then if it's still alive grab a 9v batter and kill the LED with it. I found approaches like that let me sacrifice one component and gave me a better understanding of what limits I can push something to. An LED can do 5v with no resistor for a short period of time, but can't do that with a 9v, but that also means if you mess something up and put an LED on 5v with no resistor you have a moment to catch yourself without a high chance of harm

idle owl
tulip sleet
#

the driving circuitry may also limit the current. an Arduino pin can put out about 40mA, if I remember. Our typical boards are more like 7-12mA per pin.

ember iris
# idle owl Hmm. I have the resources for sure, I have a whole pile of bags of LEDs. Never t...

That's absolutely true, it also strains the device providing source current because the LED with no resistor will try and draw out all of the current a device is willing to output.
But I found that I learned circuit design best (And I am not good at circuit design) after I had an understanding of how far I could push each component. LEDs are a great and low cost place to start getting an intuitive sense of how sensitive some parts are

idle owl
#

I have (knock on wood) seriously never smoked anything. So I have no concept of what can take what.

ember iris
#

I've never purposefully fried a micro, but I've tried to fry different kinds of capacitors, LEDs, etc. It's helped me debug when I get a bad part or when I was frying something else in a bad circuit I designed (I misunderstood how a transistor worked and it was drawing more current than I thought, and because of that I was thermally shutting down a linear power regulator). It kind of helped me learn a sense of, "Something is going wrong, but it's only going wrong a little amount, so I shouldn't have to bother checking these parts just yet. I should check these ones instead first"

warm stump
#

it's a really obscure one, it is repeatable but it occurs when a usb hub keyboard's power source is disconnected during drive mount. It seems obvious that it occurs to other devices.
the strange thing about it is no actual data loss occurs, it only looks like it does because the drive reports with default contents when in fact it still has the data which is different...
...but if this new state gets written to the drive then yes it will cause data loss. Why is it returning a default contents folder instead of stopping the mounting process onConnectionInterrupted()...?

a brown-out detector will not pick it up as the power line is still fine, the data lines are what is potentially error prone at that point.
If you don't write to code.py when this happens, unplug the board and plug it back in then on occasion your data will still be there because it didn't do an actual write
(but this varies every time, don't rely on that). It did also send the board into an unknown state at which case it did bring up the RP2 drive like it should. Very stable apart from this one USB event.

another folder to add to the list but only on Linux: System Volume Information but it disappeared on Windows (but belongs to Windows)
linux logs it to /var/tmp on the host drive only, it doesn't write to the disk for the purposes of search indexing unless there is a third-party package (which there isn't on this pi)
so the issue occurs not because something is wrong but because "everything is fine" when it maybe isn't on an undetected USB connection error. WiFi probably has more handling for this

proven garnet
#

Well, loud by the standards of "not expecting it".

#

Unfortunately it was the END of my debugging session because I knew what was gonna cause the problem I was looking for from that point forward.

ember iris
#

Oof, after a lot of debugging, if something just dies on me like that I have to walk away. If I keep at it (speaking from experience) I'll just break more and more things

#

It's really a pain when the voice in my head is, "Just a little more and I can be done with this project entirely". But walking away and coming back with a fresh mind is so worth it

manic glacierBOT
#

I am having a problem too with the same model XIAO. The S1 version you provided actually got it to where I can see the REPL in Thonny. However, it will not fully uploaded to the library. The flash problems were happening before this new issue. I will be interested to see how this is resolved.

@WULFFJ I was running into the same error & was able to get it working through the CircuitPython Web Workflow after following the steps [here](https://learn.adafruit.com/circuitpython-with-esp...

#
[adafruit/circuitpython] New tag created: 8\.0\.0\-beta\.3
orchid basinBOT
tulip sleet
idle owl
#

@tulip sleet Which leg on the LED is the anode? + or - ...

tulip sleet
idle owl
#

Thank you! I had it right. For once.

onyx hinge
#

Thanks Dan!

proven garnet
#

Someone here said a mnemonic I still remember: you can chop off part of the longer leg to make a plus sign on that leg, so that one is positive

jaunty juniper
#

I only ever remember the other way around because I originally learned the terms in the context of battery cells, so... I don't use the terms

idle owl
#

So I might have told you that, but Dan is where it came from.

jaunty juniper
#

yeah but that doesn't give you the name, and my way of remembering the name gives the opposite name because batteries

#

(so I don't say it so it doesn't pollute your mind 😉 )

crimson ferry
#

yeah the names are redundant, direction is the important thing

#

wikipedia has the mnemonic "CCD for Cathode Current Departs", which, OK, until you think about the fact that all circuits are really backwards of the way the electrons (or holes) flow

#

and don't get started on Zeners

jaunty juniper
#

heh since I use this analogy, I just thought of one: fau-Cet: C is the output for cathode 😉

manic glacierBOT
#

I intended to roll back the toolchain for ESP32-C3 today for 8.0.0-beta.3. However, when I tested the latest main against this rollback, it did not work on QT Py ESP32-C3 (my main C3 testing board). So I did not include it and released beta.3 with C3 boards still not working.

I was confused because I thought I had demonstrated to myself that the toolchain rollback worked, and yet I could not reproduce. I then did a bisect again, with the toolchain rollback in all my builds, and found that ...

tulip sleet
manic glacierBOT
manic glacierBOT
midnight ember
#

Kattni I put together my sequencer board with 16 3v LEDs in the step switches. I learned it really depends on the forward voltage rating of the led. If you have that spec you can easily figure out a safe resistor value to use. The step switch LED’s have a 20ma forward voltage, common for 3v led. At first I used a 68 ohm and it was so bright I had legitimate concerns of it burning out. 500ohm is actually still on the bright end. Didn’t start getting too dim to see until about 3000 ohm. Anywhere around 500 to 1K is a nice safe distance away from 0 ohm while still being bright enough to be useful during the day. You can higher to 1K-2K if you only intend to use it in the dark.

manic glacierBOT
#

Very interesting addition. I'm trying to decide whether this would be a useful addition for RP2040 or not:
In the ESP32 case it's very neat because there is no other way to bring in native code with a different architecture for the coprocessor, at least without a custom CircuitPython build.

For the RP2040 though, it should already be possible to have native code run on the second core using native modules (.mpy); these are ...

brazen hatch
#

No dhcp just yet

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.2 on 2022-10-14; ESP32-S3-Box-2.5 with ESP32S3

Code/REPL

Contents .env file:

`# To auto-connect to Wi-Fi
CIRCUITPY_WIFI_SSID=YOUR_SSID
CIRCUITPY_WIFI_PASSWORD=YOUR_PASSWORD
# Following are variables used by code.py`

To not publish my router's WiFi login details I show the contents here with 'YOUR SSID' and 'YOUR_PASSWORD' placeholders instead.

Behavior

Immediately after copying the ...

manic glacierBOT
onyx hinge
#

@tulip sleet I think toolchain version changes get "baked in" to the environment when you . esp-idf/export.sh, because it calls out adding specific versioned gcc directories to the PATH. This would be one way to get confusing results when trying to switch toolchain versions, if you don't get a fresh shell and re-export each time.

#

Added the following directories to PATH: ... /home/jepler/.espressif/tools/riscv32-esp-elf/esp-2021r2-patch5-8.4.0/riscv32-esp-elf/bin ...

manic glacierBOT
tulip sleet
manic glacierBOT
#

The arch is not rolled back here. The ESP32-C3, C2, H2 and even the ULP Coproc on S2/S3 are based on rv32imc.

I missed your initial debug comment where you pointed out that the CP8-beta.2 build was rv32gc.

As @jepler pointed out in https://github.com/adafruit/circuitpython/issues/7060#issuecomment-1281641332, rv32gc supports floating point arithmetic and rv32imc has to emulate it in software, with rv32gc this led to Illegal Instruction exception.

#

In patch3, gcc was configured "--with-arch=rv32imc", so the default when invoking it without an explicit -march= setting was rv32imc. In patch 5, it was configured "--with-arch=rv32gc", which causes gcc to emit some instructions (which ones?) not present in rv32imc.

jepler@bert:~/.espressif/tools$ ./riscv32-esp-elf/esp-2021r2-patch3-8.4.0/riscv32-esp-elf/bin/riscv32-esp-elf-gcc -v 2>&1 | grep -o -e '--with-arch=[^ ]*'
--with-arch=rv32imc
jepler@bert:~/.espressif/tools$ ./riscv32-es...
tulip sleet
#

@analog bridge @onyx hinge next thing I think I will do is to pull in some more recent release/v4.4 commits, some of which might fix some of the remaining wifi instabilities.

onyx hinge
#

I'm glad together we figured out what caused the problem! Thanks Dan, microdev!

manic glacierBOT
#

I believe this is an issue with wifi connection.
Instead of .env, connect to wifi from code.py, I have the board reboot into safe mode.
Since safe mode does not disable wifi autoconnect from .env, that would cause a boot loop, but it's really a reboot caused by the wifi connection.

import wifi
from secrets import secrets
print("Connecting")
wifi.radio.connect(ssid=secrets["ssid"], password=secrets["password"])
socket_pool = socketpool.SocketPool(wifi.radio)
code.p...
#

@Neradoc I ran your example. Here is it and the REPL output:

import wifi
from secrets import secrets
print("Connecting")
wifi.radio.connect(ssid=secrets["ssid"], password=secrets["password"])
socket_pool = socketpool.SocketPool(wifi.radio)

REPL output:

Auto-reload is off.
Running in safe mode! Not running saved code.

You are in safe mode because:
Internal watchdog timer expired.

Press any key to enter the REPL. Use CTRL-D to reload.

#

Next I copied a part that I recently successfully used with an UM PROS3:
But it crashed also into safe mode with the 'internal watchdog' error:

import time
import wifi
import socketpool
import ipaddress
from secrets import secrets

use_ping = True 

print("Connecting")

try:
    wifi.radio.connect(ssid=secrets["ssid"], password=secrets["password"])
except ConnectionError as e:
    print("WiFi connection Error: \'{}\'".format(e))

ip = wifi.radio.ipv4_address

pool = ...
manic glacierBOT
manic glacierBOT
#

Just throwing my 2 cents in, I have tried two STEMMA-QT boards on my new Feather ESP32-S3 and both report the same issue as well (output for my BNO055 9DoF)

import board
import adafruit_bno055

i2c = board.STEMMA_I2C()
sensor = adafruit_bno055.BNO055_I2C(i2c)

0;🐍Wi-Fi: off | code.py | 8.0.0-beta.1Traceback (most recent call last):
File "code.py", line 4, in <module>
RuntimeError: No pull up found on SDA or SCL; check your wiring

Occasionally, after a reset of the Feather, it ...

analog bridge
#

Proposal to run Build-CI based on file changes specific to a commit instead of diff between base branch and PR branch.
This will likely reduce number of builds run on each commit. Does this approach have any pitfalls?

onyx hinge
#

yes, it does!

#

suppose commit 1 breaks everything and commit 2 fixes 50% of the thing

analog bridge
#

oh... yes, silly me. 🤦‍♂️
how about it runs all the failed jobs from previous run and also schedules new jobs based on diff between current commit and last commit with a ci run?
this just makes it even more complicated

manic glacierBOT
idle owl
#

@tulip sleet Do you remember which issue is tracking ESP32-S3 and the LC709? I'm having trouble finding it.

idle owl
#

Cheers.

manic glacierBOT
jaunty juniper
idle owl
#

Thanks for taking a look!

manic glacierBOT
manic glacierBOT
jaunty juniper
#

with the MP_WEAK thing, is an empty board.c ok if there's no change ?

tulip sleet
#

do you mean completely empty?

#

I'd prefer an "empty" one like ports/atmel-samd/boards/trinket_m0/board.c' which has the copyright and license boilerplate, etc.

jaunty juniper
#

that's perfect

#

I see the QT PY pico has:

void board_init(void) {
    reset_board();
}
#

the M5Stamp has a CH9102F and also has the JTAG/USB pins broken out, how do I handle the jtag pins in the board definition ? ignore ? can they be used as GPIO ?

tulip sleet
idle owl
#

@tulip sleet I'm watching the PR I approved, and I'll merge it when it passes.

#

56 in progress checks left.

#

Queued for ages though.

tulip sleet
#

same here; for some reason it was put at the back of the line even though there were some merges I thought I had done afterward

idle owl
#

Odd.

idle owl
#

@tulip sleet Merged!

tulip sleet
#

thank you!

idle owl
#

Quick like a bunny.

#

You're welcome!

#

Thanks for putting it together.

tulip sleet
#

I will delete that draft page in the guide now. all the info is spread about elsewhere

tulip sleet
#

I am just starting to work on your sleep pin issue

idle owl
#

Ooh nice

manic glacierBOT
manic glacierBOT
#

@hathach It looks like this is hitting a TU_ASSERT on nRF.

0x0006e40c in usbd_edpt_xfer (rhport=0 '\000', ep_addr=0 '\000', buffer=buffer@entry=0x0, total_bytes=total_bytes@entry=0) at ../../lib/tinyusb/src/device/usbd.c:1304
1304      TU_ASSERT(_usbd_dev.ep_status[epnum][dir].busy == 0);
(gdb) bt
#0  0x0006e40c in usbd_edpt_xfer (rhport=0 '\000', ep_addr=0 '\000', buffer=buffer@entry=0x0, total_bytes=total_bytes@entry=0) at ../../lib/tinyusb/src/device/usbd.c:1304
#1  0x00073cb4 ...
manic glacierBOT
#

In the following example:

0x500007fc is the address of shared_mem variable.

In a CircuitPython program, how do I determine a permissible address for a shared memory variable? What happens if I specify an address that is in use for some other purpose, such as one used by the CircuitPython or ESP-IDF heaps? Is this function safe to call with 'bad' inputs -- do they lead to exceptions, or do they continue and corrupt memory in use for another purpose?

manic glacierBOT
#

how do I determine a permissible address for a shared memory variable?

That can be grabbed from the build files ld, map or sym.

What happens if I specify an address that is in use for some other...and corrupt memory in use for another purpose?

This is direct access! We can do some sanitization like in the case ULP:

RTC_SLOW_MEM = 0x50000000
RTC_SLOW_MEM_LEN = RTC_SLOW_MEM + 8192
lower_limit = RTC_SLOW_MEM + loaded_program_len
upper_limit = RTC_SLOW_MEM_LEN
manic glacierBOT
manic glacierBOT
manic glacierBOT
brazen hatch
#

Keeping as a draft till I get ap disconnection working

onyx hinge
#

Thanks for tackling it @brazen hatch !

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.1 on 2022-10-01; Adafruit CircuitPlayground Express with samd21g18
Board ID:circuitplayground_express

UF2 Bootloader v3.14.0 SFHWRO
Model: CPlay Express
Board-ID: SAMD21G18A-CPlay-v0

Code/REPL

while True:
    mic.record(samples, len(samples))
    magnitude = normalized_rms(samples)
    # You might want to print this to see the values.
    # print(magnitude)

    # Compute scaled logarithmic...
manic glacierBOT
#

A few minutes ago I re-flashed the esp-box with tinyuf2 combined.bin (I discovered that I flashed b4 using SPI mode 'DIO' and this afternoon I discovered that the serial output of the MCU says the SPI mode is 'QIO'. I also took the chance to copy the latest CPY version dated today. Unfortunately a script to test the WiFi connection with the AP here in the room resulted in 'WDT expired'. See images below.

![IMG_7061](https://user-images.githubusercontent.com/9107950/197353258-903be9f5-4...

#

`Saturday 2022-10-22 18h57 utc+1

Adafruit CircuitPython 8.0.0-beta.3-6-g5a6fffca4 on 2022-10-22; ESP32-S3-Box-2.5 with ESP32S3
Board ID:espressif_esp32s3_box
UID:C7FD1A1E7C45

Serial output:

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x8 (TG1WDT_SYS_RST),boot:0xa (SPI_FAST_FLASH_BOOT)
Saved PC:0x40378f28
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd0108,len:0x15e8
load:0x403b6000,len:0xbf8
load:0x403ba000,len:0x31c8
entry 0x403b621c
I (29) boot: ESP-IDF v4.4.2-378-g9269...

brazen hatch
#

Are there any resources for coproc testing available?
I would like to begin testing it

blissful pollen
#

I think MicroDev had a basic example in the PR if you look there. The ESP32-xx datasheets do have some info about the coprocessor and building for it too if I recall

brazen hatch
#

Nice, thank you!

manic glacierBOT
#

While this PR says it checks the memory address range, it's trivial to HardFauilt CircuitPython using CoprocMemory. Here, the type pointer of a list object is nuked (since the id of an object is its location in memory)

Would it be possible to simply move the address range checking from the Coproc construction to the CoprocMemory construction?

Adafruit CircuitPython 8.0.0-beta.3-10-g773bb99c96-dirty on 2022-10-22; ESP32-S3-EYE with ESP32S3
>>> import coproc
>>> l = []
>>> c = cop...
manic glacierBOT
brazen hatch
#

Oh it will be so much fun crashing my boards with coproc tomorrow!

manic glacierBOT
#

I'm getting that with a DEBUG=1 build, it doesn't look like it gives any useful info to me, it just... stops when connecting.

>>> import wifi
D (28309) esp_netif_lwip: LwIP stack has been initialized
D (28309) esp_netif_lwip: esp-netif has been successfully initialized
D (28309) event: created task for loop 0x3fcebd90
D (28309) event: running task for loop 0x3fcebd90
D (28309) event: created event loop 0x3fcebd90
D (28319) esp_netif_objects: esp_netif_add_to_list 0x3fc...
manic glacierBOT
manic glacierBOT
#

@Neradoc thank you for your investigation.
@danh. I soldered the pin-strips to my new UM ProS3. Initial tests OK. Then I re-flashed it with tthe tinyuf2 bootloader for CPY. Loaded the really latest (from 2022-10-22) CPY V8. Wrote a similar script to connect to the same WiFi AP in the room here. It works great. I copied output of it to the dropbox folder.

I just copied also an .env file to the CIRCUITPY disk of the UM ProS3. I see that it works. After boot the statusbar shows an IP-addres...

#

Here REPL output in mu-editor from the WiFi test with the new UM ProS3.
Btw: it's programmed to request date & time string from AIO Time Service every 2 minutes.

WiFi test for UM ProS3
Waiting for mu-editor etc. getting ready
wifi.radio.hostname= 'UMProS3'
wifi.radio.mac_address= f4:12:fa:42:4:ec
pr_scanned_ap(): 
Available WiFi networks (sorted on: 'rssi')
	AP nr 15	SSID: Vodafone-287778_EXT             	RSSI: -52	Channel:  9
	AP nr 12	SSID: MEO-AFM_EXT                     	R...
onyx hinge
#

but I didn't actually build or load any code yet 🤣

onyx hinge
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.3.3 on 2022-08-29; Seeeduino XIAO RP2040 with rp2040
Board ID:seeeduino_xiao_rp2040

Code/REPL

BROKEN:


#code.py

import gc
from AxDisp import *
print(gc.mem_free())
from AxInput import *
print(gc.mem_free())
last_text_top='test'
text_top(last_text_top)
import time
while True:
    print(gc.mem_free())
    if Ax1Check():
        last_text_mid='True'
        text_mid(last_text_mid)
    else:
 ...
midnight ember
#

Submitted all my social media API examples to the adafruit_requests library. Does that count for hacktoberfest or only bug fixes?

manic glacierBOT
onyx hinge
#

@midnight ember each PR should count equally

midnight ember
#

Well they're new additions, not really PR's, or did I do it wrong? Can I make a PR for a file that doesn't currently exist? Github is so confusing sometimes.

onyx hinge
#

it might say something like this ... "Waiting [length of time]" with a link to "view on github". If it doesn't appear there, then either hacktoberfest is out of date (it doesn't stay 100% up to date) or your activity was the wrong kind of activity to qualify.

#

it does need to be a pull request, that's just the rules of hacktoberfest.

#

so .. based on snooping at https://github.com/DJDevon3/Adafruit_CircuitPython_Requests -- in git/github parlance, you have made a fork, and you've made changes within that fork. but you haven't offered those changes back to adafruit/Adafruit_CircuitPython_Requests, which is called creating a pull request.

GitHub

Requests-like interface for web interfacing. Contribute to DJDevon3/Adafruit_CircuitPython_Requests development by creating an account on GitHub.

#

you've made 5 distinct commits as github calls them, but if you create a pull request with those 5 distinct commits in them, it will count as 1 pull request towards the hacktoberfest goal of 4 pull requests.

midnight ember
#

Ohhh

onyx hinge
#

to create a pull request, you have to 'do things' within the github website. https://github.com/adafruit/Adafruit_CircuitPython_Requests/compare/main...DJDevon3:Adafruit_CircuitPython_Requests:main would start creating 1 pull request with all 5 of your individual changes in it.

GitHub

Requests-like interface for web interfacing. Contribute to adafruit/Adafruit_CircuitPython_Requests development by creating an account on GitHub.

midnight ember
#

Sorry still kinda new to working in others repos.

onyx hinge
#

no need to apologize, we were all new at one time or another

#

and the terminology and the technology is often extremely non-obvious

midnight ember
#

Could I…. create 1 pull request for each file? 😁

onyx hinge
#

there would be nothing wrong with doing it that way, and some maintainers would even request that you do so. Frequently, people view it as a good idea for each PR to address just one independent thing.

#

I take it you are doing things strictly by working from the github website, not running the "git" program on your computer? Let me think about how you would split your work into 5 separate PRs that way, it's not how I customarily work.

midnight ember
#

How to uncommit the other files I’ve added to commit.

#

Yes for years.

onyx hinge
#

OK, again, no worries 🙂 I get to learn how to do something on the web, which I simply don't know offhand

midnight ember
#

Seems more trouble than it’s worth. I could just submit the pr and then keep tweaking my new files?

#

For additional prs

onyx hinge
#

Is there one of the examples that you're more confident is complete and correct, vs all the others?

midnight ember
#

Because they could use some cleaning up and the copyright header confused me unsure what to put there.

#

Probably the YouTube api.

onyx hinge
#

OK let me walk you through the steps you can do in the github website to create a PR with just the YouTube code in it ..

midnight ember
#

They all work, I checked and double checked they work.

onyx hinge
#

go to your fork and click where it says "1 branch"

#

now poke the "new branch" button and make the settings look something like this -- the branch name can be what you want but it's important that the branch source be "adafruit/Adafruit_CircuitPython_Requests" and "main"

#

now you can make github look at this branch which has an independent version of all the files and folders compared to your main branch

#

now you'll "add file" by upload or editing, as you're familiar with

#

once you've done that, go back to the page for that branch and it'll say you're "1 commit ahead" and that you can "contribute" your code by creating a pull request

#

fill the next page out and "create pull request"

#

once the adafruit gnomes (they're not actually gnomes) look at it, either they'll request further changes from you or merge it.

#

It's prime time for taking a walk here so i'll be back later -- feel free to mention me here on discord if you get stuck or have any q's about the process

midnight ember
#

what should i name the new branch?

#

ok i'll figure it out, thank you!

random junco
midnight ember
#

oops, lol named it branchy branch

random junco
#

heh - it shouldn't matter too much

#

you can add details in the PR itself that is probably more important anyway

midnight ember
#

i must have done something wrong. now my files are gone in my github examples folder 😦

#

maybe it synced?

random junco
#

what's the repo link?

midnight ember
#

too confusing just going to do the PR on the main commit with all of them.

#

only thing i can think of to save all that work too because i was live editing those files in my github/folder. when it sync'd it deleted them all.

#

rather not have to do all that work again.

#

i did not have a backup in another folder

random junco
#

they're in the main branch

#

do a git checkout main

#

and they should magically reappear

midnight ember
#

ohhhh wow

#

that's pretty magical

#

all checks failed on the pr, how nice.

random junco
#

re-order your imports and it should be ok

midnight ember
#

i named the files with api because they require developer tokens to use, seems like a logical idea to differentiate them from some of the other web scraping examples.

#

ah i see the errors now thank you

#

ok made the changes, will it run again on its own or do i need to do something to make it run again?

manic glacierBOT
random junco
midnight ember
#

using github desktop?

#

thought that was built in kind of thing

#

or should i do it via command line first before using github desktop?

random junco
#

yeah, I thought it was part of pre-commit, but I'd try it via the command line, it can't hurt to format them to what pre-commit wants

midnight ember
#

gonna have to look that one up. been about a month or two since i used it and have since ripped out WSL and ubuntu

random junco
#

pip install black should do it, then black filename.py

midnight ember
#

i can't find the guide about doing black in adafruit's learn guide on github

#

maybe that one is only in the guide for making your own board

#

error: cannot format requests_adafruit_discord_active_online.py: Cannot parse: 1:0: // SPDX-FileCopyrightText: 2022 DJDevon3 for Adafruit Industries

#

oh it's using // derp

onyx hinge
#

by the way, you should only write "for Adafruit Industries" if Adafruit was compensating you for your work.

midnight ember
#

oh dear god i was using headers for arduino 🤦‍♂️

manic glacierBOT
midnight ember
#

all checks passed this time 😁

midnight ember
#

already wrote my hug report for paul and jeff in the meeting notes. 🙂

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.3-11-gedce717cfc-dirty on 2022-10-23; ESP32-S3-EYE with ESP32S3

Code/REPL

# Full code at https://github.com/jepler/ulp-circuitpython
import time
import struct
from coproc import *
from minidump import e, h, en

def storele32(cm, off, x):
    print(off, ":=", x)
    cm[off:off+4] = struct.pack("<l", x)
def storele16(cm, off, x):
    print(off, ":=", x)
    cm[off:off+2] = struct.pack(">> impo...
manic glacierBOT
#

Anything that gets rid of the user constructing a CoprocMemory instance that can be used to hose the general RAM of the machine is good, as long as it doesn't remove capabilities.

Why can't it be allowed before run? For instance, in the LED blink example, you might want to pre-load the first blink interval before calling run.

By the way, I'm not sure about limiting the region to be read/written via CoprocMemory. For instance, in the LED blink example a compile-time default could be set ...

proven garnet
#

I want an extension for VS Code that screams at you when you use // instead of # in a Python file.

#

More critically, I need the opposite for an Arduino sketch file.

onyx hinge
#

can we also petition so that "else if:" is universally highlighted as an error?

jaunty juniper
#

can we add elif to C, javascript and friends ?

crimson ferry
#

can we petition that else if is legit in Python?

onyx hinge
#

it is, you just have to indent it right

#
else:
    if:
        ...```
thorny dove
#

Question: in CPY V8 if in boot.py import supervisor supervisor.status_bar.console = False then, in a running CPY script, a KeyboardInterrupt by presing the key-combo 'Ctrtl+c' doesn't work is my experience. Is this behavior correct ?

jaunty juniper
#

that would be a bug

brazen hatch
thorny dove
thorny dove
proven garnet
#

My inclination is to support changing the encoding, but keep ASCII as the default

jaunty juniper
#

UTF8

proven garnet
#

That's the only one?

jaunty juniper
#

yup as far as I know the argument is actually ignored

#

encodings take much flash I believe

proven garnet
#

Ahhh, that would make a lot of sense

#

In that case, I'm tempted to comment what I said before, since MC-based users would expect an unsupported encoding as the default.

onyx hinge
#
b'\xef\xac\x80'
>>> "ff".encode("cp437")
b'\xef\xac\x80'
``` yeah the encoding argument is ignored, giving an incorrect result
manic glacierBOT
#

I'm trying to implement something similar in micropython (on ESP32, or wherever); namely getting SSL working on the pure-python wiznet driver (which was backported from circuitpython). Findings so far:

  • On an ESP32, the SSL library is MBedTLS running on the ESP-IDF. There are micropython and circuitpython bindings to that library, but that have diverged (though there will likely be an SSL context manager coming to micropython soon, so might re-converge at some stage)
  • The socket clas...
orchid basinBOT
manic glacierBOT
#

I, from my end, restarted my investigation. For what it is worth:
The file: mpconfigboard.mk is the file most recently modified: 18 days ago. In this file the flash mode is defined as 'dio' however a serial output at boot of the esp32-s3-box states flash mode 'QIO'. See composite screenshot below:

![2022-10-24_12h09_Github_Adafruit_CPY_ports_espressif_boards_esp32s3_b...

manic glacierBOT
#

As a comparison: the board that is similar: Unexpected Maler esp32s3 pros3, which does not go into a boot-loop when trying to connect to a WiFi-Access Point, has in the mpconfigboard.mk the flash mode as 'qio', the same as in its serial output during boot. See the composite screenshot below:

![2022-10-24_12h38_Github_Adafruit_CPY_ports_espressif_boards_unexpected_maker_pros3_file_mpconfigboard mk_](https://user-images.githubusercontent.com/9107950/197517893-4e30b753-76b2-4cf2-b246-cb7b7920...

manic glacierBOT
#

Since Seon Rozenblum (Expected Maker) recently sent me updated replacement for the three models of his esp32s3 series of boards, I am able to compare the serial output at boot time with the flash definitions in the respective mpconfigboard.mk files of the latest edition of CPY V8. Here is the comparison for the board UM tinys3. As you can see: the same difference as with the esp32s3_box: dio in mpconfigboard.mk versus qio in the serial output at boot time.

![2022-10-24_13h00_for_comparison...

lavish saffron
#

I'm thinking of adding typing to some libraries to close out some open issues. What version of Python should I refer to for typing, 3.7?

onyx hinge
proven garnet
#

Yup! 3.7 is the baseline.

manic glacierBOT
#

Just flasthed the UM FeatherS3 with CPY V8 latest. Here is the serial output at boot time while running the first WiFi test on this board:

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd0108,len:0x1644
load:0x403b6000,len:0xf1c
load:0x403ba000,len:0x31c8
entry 0x403b634c
I (25) boot: ESP-IDF v4.4.2-378-g9269a536ac 2nd stage bootloader
I (25) boot: compile time 11:37:31
I (25) boot: chip...
manic glacierBOT
#

To make it complete: just flashed also the new UM TinyS3 with CPY latest:
Adafruit CircuitPython 8.0.0-beta.3-11-gedce717cf on 2022-10-23; TinyS3 with ESP32S3
Then I ran the same WiFi test. Result: successfull. Received an IP-address. Also a positive ping on 'google.com'.
Below the serial output at boot:


ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd0108,len:0x1644
load:0x403b600...
#

Regarding the CPY port definitions for the board 'esp32s3_box', the file: mpconfigboard.mk is the file most recently modified: 18 days ago. In this file the flash mode is defined as dio however a serial output at boot of the esp32-s3-box states flash (SPI) mode qio.

Those three CIRCUITPY_ESP_FLASH_* constants are only used to construct the flags to pass to esptool.py...

#

I'm not sure we want to do this, it trades memory for no new functionality except more exceptions.

Tests cases are changed because "ignore" and "replace" were never supported and because the utf-8 encoding should always be specified by name, rather than depending on the empty string.

(However, the empty string is accepted as a valid encoding name for compatibility with previous versions of CircuitPython)

Because Python3 checks late for the validity of an 'errors' value, this is a n...

onyx hinge
#

today I'm the one having trouble measuring flash size changes, it seemed like this change saved 8 bytes which is nonsense.

manic glacierBOT
onyx hinge
#

It took me a bit to parse paul's comment on that PR. I think he's repeating that the value does not match the hardware, but he accepts the analysis that it doesn't affect the content of the circuitpython binary.

tulip sleet
#

my understanding also - I will make a sweep of those settings at some point

onyx hinge
#

would it cause problems, if paul is loading the code with esptool?

#

as opposed to uf2

jaunty juniper
#

I can test the ESP box with the bin

tulip sleet
#

and it's only if you use the Makefile target to do the loading. If you just use esptool on the command line without spec-ing the args, it should figure it out

#

we could probably just take away that qio/dio arg

#

since I think esptool can figure it out?

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.3-11-gedce717cf on 2022-10-23; FeatherS3 with ESP32S3

Code/REPL

# SPDX-FileCopyrightText: 2022 Paulus Schulinck
#
# SPDX-License-Identifier: MIT
##############################

"""
    This CircuitPython script is created to show how I managed to
    sort received WiFi Access Points in one of the following sorting orders:
    1) on ssid;
    2) on channel;
    3) on rssi.
    See function 'p...
onyx hinge
#

shakes fist at status bar

vagrant wind
#

How do I obtain CIRCUITPY_CREATOR_ID & CIRCUITPY_CREATION_ID for a Wifi only board (ESP32) ?

onyx hinge
#

I am the person who is acting on PRs in that repo at the moment so I'll try to help you if I can.

vagrant wind
#

Thx

jaunty juniper
onyx hinge
#

I'm a little unsure how it's supposed to work honestly -- It's something tannewt set up and left in my hands while on leave

#

If you are designing PCBs yourself, I think you want to allocate an entire "creator ID" for yourself and administer your own database of "creation IDs" following the style used in the main repo (as a public github repo)

#

if you're putting CircuitPython onto a board from another maker who is already listed, then you'd put it under their creator id

manic glacierBOT
#

I think I discovered the origin of this 'behavior':
as soon as I added a file .env containing the WiFi credentials of the WiFi AP to be connected,
the unwanted CPY statusbar lines in between the REPL output of the running script disappeared. See below:

soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
]0;🐍192-168.x.yyy | code.py | 8.0.0-beta.3-11-gedce717cf\
WiFi test for board: 'unexpectedmaker_feathers3'
w...
jaunty juniper
#

ah ! So yeah the Espressif file is for Espressif boards, not all ESP boards

onyx hinge
#

I am making my best guesses at what tannewt intended and if some allocations are wrong we will live with the consequences..

jaunty juniper
#

yeah you're right, it's mimicking USB VID/PID

onyx hinge
jaunty juniper
#

with more flexibility, so you can create a creator ID as a community managed list for a vendor who doesn't care (or know) about the thing

onyx hinge
#

if I ran the world there would be a UUID instead, since those need no central allocation, but /shrug

#

it's nice to have a sort of database, even though it can only be looked up by hand

vagrant wind
#

I have just created my first pull request on creation/creators repository

#

Hopefully I haven't done anything wrong 🤞

vagrant wind
#

I have a second question. This is the board that I'm going to add to CircuitPython: https://docs.m5stack.com/en/core/fire

#

It has a power management IC (IP5306) that can control the battery charge and it talks with the MCU via I2C

#

Do you suggest to add this library as a frozen module inside the firmware, because is an IC already on the board, or to leave the user free to pick up library from the CircuitPython Bundle?

lone sandalBOT
jaunty juniper
#

(in particular frozen libraries take priority over libs in /lib, so an update has to be put in the drive root)

#

but it's totally possible

#

libraries get usually frozen on boards where flash or RAM are limited

vagrant wind
#

Thank you for the explanation

manic glacierBOT
#

I'm getting the same problem on an QT PY ESP32-S2, after upgrading from CircuitPython 7.3.3 to 8.0.0-beta.3.
My program subscribes to a topic on Adafruit IO. It's been very reliable in CircuitPython 7 but is unusable in 8.
I tried hard coding a 1 second timeout in the _wait_for_msg() method, and it fixed the MMQTTException during subscribing. However, the loop() method then fails with:

  File "/lib/adafruit_minimqtt/adafruit_minimqtt.py", line 864, in loop
  File "/lib/adafruit_min...
#

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.3 on 2022-10-20; Raspberry Pi Pico W with rp2040

Code/REPL

import time
import board
import digitalio

led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT

while True:
    print("test")
    led.value = not led.value
    time.sleep(1)

Behavior

Board is not always detected as disk in windows 10.

Description

  • Boot works always fine, and circuit pyt...
digital shoreBOT
#
adafruit
Owner

adafruit#3230

Category Channels

8

Text Channels

61

Voice Channels

7

Members

35756

Roles

36

random junco
tulip sleet
#

thanks Paul - I am hosting today but forgot the reminder

random junco
#

sorry to steal your thunder. 🙂

tulip sleet
#

not at all

thorny jay
# tulip sleet thanks Paul - I am hosting today but forgot the reminder

No notes contribution today, I am too lazy and did too little, here is what I remember:

  • I tested beta3 on a few devices especially picow (hug to Dan and Jepler)
  • Did some FlipClock test and PR (hug to foamyguy, tekktrik, maybe other)
  • acquired: 2 trinket M0, 2 QT Py RP2040 and 2 Xiao RP2040 for future AT(maker) use, USB host trick.
tulip sleet
thorny jay
tulip sleet
#

i can handle it 🙂

onyx hinge
#

https://hackaday.io/project/187169-esp32-s3-boy ah the real esp32-s3-boy does have a few more buttons than that.

I am making a small game machine using the ESP32-S3 module.
The LCD is 1.54 inches and has a resolution of 240x240.
We plan to port emulators such as the Game Boy or make our own games.

lone axle
idle owl
#

I knew about it ahead of time. No idea how I knew. Didn't realise it wasn't generally known. I would have mentioned it.

modern wing
onyx hinge
#

Almost any accepted pull request in CircuitPython repos will count towards your hacktoberfest goal

#

I think "supported board" counts Linux boards, the number of Micropython boards is not included. so it's quite a bit more than 100 by another measure.

turbid radish
#

Thank you

midnight ember
turbid radish
#

Awesome!

midnight ember
turbid radish
#

The alligator eyes are awesome

midnight ember
#

thank you, i did the graphics for them too 🙂

thorny jay
# midnight ember

Oh, now I can match your discord nickname to your Show&Tell appearance!!!

midnight ember
#

lady ada and phil just call me DJ but yeah same person 😉

#

the physical industrial controller for factorio is really cool looking.

onyx hinge
#

@lone axle was the industrial controller on one of your streams or what?

#

I just wanna see what this looks like

lone axle
#

Yes, I streamed a bit yesterday working on it. I'll get a photo.

modern wing
#

🐮 🔔 ....we always need more of it.

lone axle
#

This is the controller:

midnight ember
#

this weeks bootloader was informative as always, enjoyed the different topics

onyx hinge
#

kinda want but what would I do with it

onyx hinge
midnight ember
#

ok which house is handing those out, because i want one.

thorny jay
#

At least to help me understand the English from time to time, I love the notes.

onyx hinge
#

here's what it might look like but I'm with kattni on the utility

onyx hinge
#

it may be a haunted meeting though

thorny jay
#

Thank you.

idle owl
lone axle
#

I think I would have trouble keeping it scrolled to the right spot as the meeting goes on. And I am definitely one of those habitual "point click and highlight" type people, I imagine it could get distracting.

thorny jay
modern wing
#

Thanks!

midnight ember
#

👋

modern wing
#

bzzzzzzzzzzz

onyx hinge
turbid radish
#

😂

modern wing
#

I don't hear anything, so the noise gate is great

proven garnet
#

Discord's Krisp is also fantastic

#

If you have it on

modern wing
#

Discord's built in noise suppression is pretty on point

thorny jay
#

Wish me luck, I will measure "main" with a potentiometer...

idle owl
#

I don't use Discord's because I kept being concerned it will block me too. But good to nkow.

onyx hinge
#

I'm surprised there's not a "don't show other people in document" preference in github docs

#

er google docs

onyx hinge
#

👋

modern wing
#

thanks Dan and everyone 🙂

proven garnet
#

Thanks y'all!

idle owl
#

@tulip sleet @onyx hinge What is this? All the normal pull and make fetch-submodules does not make it go away. Untracked files: (use "git add <file>..." to include in what will be committed) ports/espressif/certificates/

onyx hinge
#

that's because I moved/renamed espressif/certificates so it could be shared with pico w

tulip sleet
onyx hinge
#

it should be safe to remove the whole certificates folder with your file manager

idle owl
#

Ok, thank you very much.

#

Huzzah! nothing to commit, working tree clean

idle owl
#

@tulip sleet @onyx hinge Ok, so, I'm looking at another board. Is this the only thing needed in pins.c? { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, or do I also need to add something like this to mpconfigboard.h? #define DEFAULT_I2C_BUS_SCL (&pin_GPIO3) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO2)

onyx hinge
#

@idle owl Is this an alternate i2c port, or an alternate name for the same i2c port?

idle owl
onyx hinge
#

Is this about having 2 names for one thing (like LED and D13 on many boards)?

idle owl
#

Ok, so on the Pico, there's no defined I2C anything. Because it wasn't on the silk, so we didn't add it. Now Limor wants STEMMA_I2C() added to the Pico for the PiCowbells STEMMA QT connectors.

#

So, it's only one name for 2 pins.

onyx hinge
#

ok, I think I glossed over the discussion

idle owl
#

No worries.

#

Does that make sense now? Or do you need more info.

onyx hinge
#

so yes you will need to add DEFAULT_I2C_BUS_SDA and SCL

idle owl
#

Ok, keen. Got it.

onyx hinge
#

as well as the other thing

idle owl
#

Right.

#

Ok!

manic glacierBOT
#

This has survived dozen of iterations of

import time
import struct
from coproc import *
from coproc_manager import Program

print("waiting 15s")
time.sleep(15)

while True:
    program = Program("/a.out-stripped")
    shared_mem = program.get_symbol('shared_mem').entry.st_value
    print(f"{shared_mem=}")
    cm = CoprocMemory(0x50000000, 8176)
    c = Coproc(program.code)
    print(f"{shared_mem=}")


    try:
        run(c)

        for _ in range(2):
            ...
jaunty juniper
#

do we have (or want to have) a policy on using DEFAULT_I2C_BUS_SCL versus moving to ?

#define CIRCUITPY_BOARD_I2C         (1)
#define CIRCUITPY_BOARD_I2C_PIN     {{.scl = &pin_GPIO25, .sda = &pin_GPIO24}}
idle owl
#

@onyx hinge So I gave my PiCow to Brian a while back, and have no idea where it is. The two I ordered Friday aren't here yet. If I make a build, can you test to make sure you can connect an I2C breakout to these two pins and use board.STEMMA_I2C() in code to get to it? Means breadboarding the PiCow, I don't know if you've already done that.

idle owl
jaunty juniper
#

the second way has been added to allow more than one default port

idle owl
#

Ohhhh. Right ok.

jaunty juniper
#

they are totally equivalent otherwise

idle owl
#

That was obvious. 🤦🏻‍♀️

jaunty juniper
#

(the old style is now defined as in terms of the new one)

idle owl
#

I think on Pico, it might be worth using that one, since there are so many options, and some thing in the future might specify something other than what the PiCowbell uses.

#

What is the (1)? Which I2C port its defining? Why wouldn't you start with (0)?

jaunty juniper
#

the number of ports

idle owl
#

Ohhhh

#

So that changes if you add another one.

#

Ok

#

I assumed that line was needed for each one.

jaunty juniper
#

CIRCUITPY_BOARD_I2C_PIN is a list of ports

idle owl
#

I guess I can pose this to whomever: Does anyone have a Pico W with header pins on it? Would you be willing to test a CP build for me? It involves hooking up an I2C breakout (STEMMA QT or otherwise), and verifying that a particular piece of code works. I need to write the code first, and maybe test it on Pico to make sure it works there. But then after that, is anyone able to test?

onyx hinge
#

I am doing it 🙂

#

with a W

idle owl
#

@jaunty juniper I included this in both mpconfigboard.h files#define CIRCUITPY_BOARD_I2C (1) #define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO5, .sda = &pin_GPIO4}}

onyx hinge
#

which color goes to which pin?

idle owl
#

SCL is yellow, SDA is blue

#

Oh you made the changes locally?

#

And are testing it?

onyx hinge
#

blue to 4 and yellow to 5?

idle owl
#

Blue 4, yellow 5 yes.

onyx hinge
#

hold on I have to find the pinout card too

#

these boards 🤣

idle owl
#

Uff, yeah

onyx hinge
#

it'll take me minutes and minutes at this rate, be patient with me

idle owl
#

No worries. I'm only now setting up to test Pico.

#

This Pico is doing nothing.

#

Uff.

#

Not fighting with this right now. Where's another one.

onyx hinge
#

first things first, this did work for me with whatever build I had on there: ```>>> b = busio.I2C(board.GP5, board.GP4)

b.try_lock()
True
b.scan()
[40]

#

@idle owl OK I'm ready for your uf2 or whatever

idle owl
#

ok two shakes

onyx hinge
#

or you can send me your changes; if they're funky and not working we might want to talk about the changes anyway

idle owl
#

Valid. Let me try this over here first.

#

Oof. The breakout is causing the Pico not to mount. Plug it in, and it fails.

#

Unmounts CIRCUITPY, and if I unplug power or ground, CIRCUITPY shows up again.

onyx hinge
#

do you have it the right way 'round? There are at least 3 wrong ways.

idle owl
#

I'm using STEMMA cable to male headers.... I'm at least relatively sure I have them plugged into the right place....

onyx hinge
#

I mean the whole cowbell

#

or is this not using the cowbell?

idle owl
#

I don't have a Cowbell yet.

onyx hinge
#

oh

idle owl
#

I'm directly into the Pico

#

Totally different breakout, same issue

#

something's not right here.

#

wait maybe I got it

#

I did!

#

OK, the singleton works.

#

Let me get you a build.

onyx hinge
#

Here's what I have for wiring

idle owl
#

I accidentally plugged in the STEMMA power pin to the 3V3_EN pin instead of 3V3.

onyx hinge
#

oops

#

EN is for English, right?

#

it makes the 3.3v spin

#

so your pico got dizzy

idle owl
#

haha ENable.

#

So uh.... I think I'm missing something for building for Pico W. That output looks way different.

#

And there is no uf2.

onyx hinge
#

you may need to install "cmake" somehow, just guessing

#

but that's just guessing without seeing the messages

idle owl
#

Oki.

#

This looks like where it failed? ../../py/qstr.h:42:14: fatal error: genhdr/qstrdefs.enum.h: No such file or directory 42 | #include "genhdr/qstrdefs.enum.h"

onyx hinge
#

OK that's not what I expected then

#

do a clean then get the full output of make and I'll squint at it with you

idle owl
#

Oki.

#

I checked, I do have cmake installed. Maybe it's old?

onyx hinge
#

not sure what's going on there

idle owl
#

Hmm.

onyx hinge
#

the problem isn't with cmake, that part seems to have gone OK

idle owl
#

I updated it anyway, if it needed it.

onyx hinge
#

can you "git stash" or otherwise save your changes, and see if before your changes it built for you?

idle owl
#

Sure

#

Same error.

onyx hinge
#

wild

#

but you successfully built the non-"w" version?

#

just PR what you have and I'll test from the Actions build

idle owl
#

Yes. I can build non-W.

onyx hinge
#

I told you to clean but I didn't tell you a specific commandline. Can you : make BOARD=raspberry_pi_pico_w clean ?

idle owl
#

That's what I did. But I'll try it again.

onyx hinge
#

is that what you did?

idle owl
#

Trying it without -j

#

🤷🏻‍♀️

#

Wow that's slow. Didn't realise how much of a difference that made.

#

If this fails, I'll PR it.

#

@onyx hinge I did a smart!!!

#

It worked!

onyx hinge
#

scowl

#

now you've discovered a bug in our Makefiles or something

idle owl
idle owl
onyx hinge
#

but let's move on with testing your uf2

#
>>> import board
>>> b = board.STEMMA_I2C()
>>> b.try_lock()
True
>>> b.scan()
[40]
idle owl
#

wtf? 7.2.0-alpha.2-543-gedce717cf-dirty

#

Ooof mine is the same

#

What did I do wrong? I branched off of main!

onyx hinge
#

"git fetch --tags origin"

#

assuming origin is adafruit/circuitpython

#

do you call it upstream? anyway

idle owl
#

adafruit is what I call it

#

Always for remotes, it's the username for the remote

#

Ok, so how did this happen?

#

I did git pull adafruit main from main and then did make fetch-submodules. Then branched.

#

This is the commit I'm on edce717cf which is latest according to GitHub.

#

Also oof, I do have a Proto Cowbell, heh.

onyx hinge
#

"git fetch --tags adafruit"

idle owl
#

Did that

onyx hinge
#

The version number comes from the "tags" which don't come by default from "fetch" or "pull"

idle owl
#

Hmm

onyx hinge
#

I thought seeing "7.2.0-..." was what we were trying to solve, no?

idle owl
#

Um... no?

#

Wait

onyx hinge
#

you might have to clean after that too

idle owl
#

yes

#

ok so rebuild and see what happens?

#

I'm going to do Pico because I can do it faster

onyx hinge
#

OK

idle owl
#

Oh come on.

#

The same error just happened for Pico as well.

#

Guess it'll be slow after all. Bleh.

onyx hinge
#

that's odd, very odd

idle owl
#

Worked the first time. 🤷🏻‍♀️

#

waits impatiently

#

There it is.

#

There we go.

#

Adafruit CircuitPython 8.0.0-beta.3-11-gedce717cf-dirty on 2022-10-24; Raspberry Pi Pico with rp2040

#

OK, I think this is good to PR.

onyx hinge
#

I've tried my usual tricks to make a rare parallel build error into a repeatable one (the trick of being kattni and having her computer is not available to me) and I still don't get it here. makes it hard to work on.

idle owl
#

Uff.

#

😕

#

So wait.

#

Before I hit go on this.

#

Should we add board.I2C() too at this point?

onyx hinge
#

@tulip sleet Thoughts? ^ I don't know

idle owl
#

I can ping Limor on this if needed, but I'm wondering if we're doing this, should we do it.

#

We avoided it because lack of specifics on silk.

tulip sleet
#

The board itself doesn't have designated I2C pins. When a STEMMA picowbell is attached, the adapter has STEMMA I2C pins

idle owl
#

Ok.

#

Yeah that follows.

tulip sleet
#

i would say no, beacuse the bare board has nothing to indicate default I2C pions

idle owl
#

All PiCowbells will have STEMMA on those pins. That's why she asked for this.

#

Ok, thanks for input

manic glacierBOT
idle owl
#

Wheeee

onyx hinge
#

@idle owl ```jepler@bert:~/src/circuitpython/ports/raspberrypi$ make -f Makefile BOARD=raspberry_pi_pico_w clean; make -f Makefile BOARD=raspberry_pi_pico_w -j12 build-raspberry_pi_pico_w/autogen_display_resources-en_US.o V=1
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
rm -rf build-raspberry_pi_pico_w
mkdir -p build-raspberry_pi_pico_w/genhdr
GEN build-raspberry_pi_pico_w/autogen_display_resources-en_US.c
GEN build-raspberry_pi_pico_w/genhdr/mpversion.h
GEN build-raspberry_pi_pico_w/genhdr/moduledefs.h
GEN build-raspberry_pi_pico_w/genhdr/qstr.split
GEN build-raspberry_pi_pico_w/genhdr/qstrdefs.collected.h
QSTR updated
GEN build-raspberry_pi_pico_w/genhdr/qstrdefs.preprocessed.h
GEN build-raspberry_pi_pico_w/genhdr/qstrdefs.enum.h
GEN build-raspberry_pi_pico_w/genhdr/qstrdefs.generated.h
CC build-raspberry_pi_pico_w/autogen_display_resources-en_US.c

idle owl
onyx hinge
#

yes

idle owl
#

Yes, same failure

onyx hinge
#

not quite

#

but OK

#

make -f Makefile BOARD=raspberry_pi_pico_w clean; make -f Makefile BOARD=raspberry_pi_pico_w -j12 build-raspberry_pi_pico_w/autogen_display_resources-en_US.o V=1 was the intended command

idle owl
#

oh

#

ok hold on I'll run that.

onyx hinge
#

also what's make --version for you?

idle owl
#

Same failure with the extra bits in the command.

#

Checking

#

3.81

onyx hinge
#

do you have gmake --version?

idle owl
#

Not found.

onyx hinge
idle owl
#

Where does make even come from?

#

Yeah I'll try brew installing it

#

It's not currently brew installed

jaunty juniper
#

I use gmake for tinuUF2 because it requires 4.2+

onyx hinge
#

Apple installs some very old versions of unix software like make but they don't update it

idle owl
#

Fair enough

onyx hinge
#

I think after that brew install you should have gmake --version at 4.3. Then you would gmake BOARD=... and see if the outcome is any different for you

jaunty juniper
#

I did switch my CP build to gmake too

onyx hinge
#

I have no proof or even a solid indication that it's the old version of make, but it's something to try.

idle owl
#

I think it worked. It's not done yet but it's past that point.

#

Waiting for completion before I say for sure, obvs.

#

🎉

#

@onyx hinge It worked!

onyx hinge
#

interesting to know! mind trying it 2x more just to see if it was first timer luck? with a clean each time?

idle owl
#

Sure

onyx hinge
#

if so we'll need to add to documentation that a current version of make is required due to 🤷 gremlins

#

we don't deliberately use any newer features of gmake but it's what's on the github actions, and on my desk and dan's desk so it is what gets tested

idle owl
#

Ah.

#

Ok, worked x2, going for 3.

#

Worked x3!

#

SO MUCH FIRMWARE OVER HERE.

jaunty juniper
#

in tinyuf2 it's because it uses $(file < ...) which is 4.2

idle owl
#

Woah. PR already passed.

#

I guess it only affected 2 boards.

onyx hinge
#

OK I built make 3.81 and can confirm I get this error building

onyx hinge
#

I'll file an issue about documenting it

idle owl
#

No idea how to update that manually. And this terminal window anyway, is still using 3.81. I think I have to change something somewhere to make it use the brew version of it.

#

But gmake works fine.

idle owl