#circuitpython-dev

1 messages · Page 27 of 1

brazen hatch
#

To ensure the pins are correct, you can always just plop some leds (with resistors) in whichever you suspect to be wrong.

jaunty juniper
#

a comment in the PR yeah

brazen hatch
#

Yea wspico seems to be in spec for psram 120MHz speed and works perfectly fine with ljinux on 2 samples here.
Pr incoming.

#

This is a much needed speedup.

manic glacierBOT
#

Chip schematic here.
This is the chip on the board.

The datasheet says "133MHz for 32 Bytes Wrapped Burst operation at VDD=3.0V+/-10%".
The board 3v3 line is precisely on that (since it has a pretty good regulator), so within +/- 10% of 3.0V. So it would be within spec to run it at 133Mhz.
However there is no such option, so running it at 120Mhz. (Which may be for the best)

This pr also explic...

#

I've been poking and prodding this for the last 2 weeks and I've come to the conclusion that there is something going on with the VCMAILBOX_TAG_GET_CLOCK_RATE_MEASURED function with the CORE clock specified on the VideoCore that is hanging the mailbox registers. Once you send the CLOCK_RATE_MEASURED request to the VC I've been seeing something like an 80% chance the registers will hang and from then on, no mailbox requests of any type can be processed. Perhaps the CORE clock can be in a state...

slender iron
#

anyone have ideas to shrink M0 builds? my 7-color eink code doesn't have room anymore

ornate breach
#

😬

brazen hatch
#

At some point, it just ain't gonna fit.

manic glacierBOT
tulip sleet
manic glacierBOT
#

Hey, sorry for the late reply, the CI stuff took precedence.

I like this over adding separate properties in ESPNow, it keeps the communication part isolated the same way in which the peers management part is isolated and maintains hierarchy in the module.

Also, the stats are an important part for making the communication work effectively with minimal packet drops so a no to tuples which as you mentioned earlier aren't self documenting.

Lastly, I don't find it weird to have proper...

manic glacierBOT
slender iron
#

@tulip sleet it isn’t now and isn’t clearly separated out. One idea I have is to reorg the local and global tables to compact the qstr keys together

#

Each entry wastes two bytes

manic glacierBOT
#

When sending requests to the video core to return the "measured" CORE clock rate the mailbox registers frequently hang preventing any further access to the video core. This PR replaces the "measured" CORE clock rate checks with an unmeasured request. Fixes #5887 & fixes #5913.

A separate pull request to adafruit/broadcom-peripherals is being submitted to add the additional mailbox call routine.

This will also resolve the deinit issue noted in #5887

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

INSECURE means plaintext MQTT. If you want TLS, you need to set is_ssl to True.

On Wed, Feb 22, 2023, at 09:15, KLL wrote:

use 'logging' again

image https://user-images.githubusercontent.com/19226581/220561096-fe6878a3-f814-4a16-afc3-fb47a4db2934.png

why it say INSECURE

INFO - Establishing an INSECURE connection to <xxx>.hivemq.cloud:8883


Reply to this email directly, view it on GitHub <https://github.com/adafruit/circuitpython/issues/7606#issuecomment-14...

#

I think that's because default loop() timeout is 0. See issue 142 in the Adafruit MQTT project.

On Wed, Feb 22, 2023, at 09:38, KLL wrote:

1615.053: DEBUG - waiting for messages for 0 seconds 1615.560: DEBUG - waiting for messages for 0 seconds 1616.066: DEBUG - waiting for messages for 0 seconds 1616.572: DEBUG - waiting for messages for 0 seconds
is meant to say 0.5 sec ?


Reply to this email directly, view it on GitHub <https://github.com/adafruit/circuitpyth...

manic glacierBOT
manic glacierBOT
#

@milindmovasha If I understand correctly, you are allowing one-byte arrays or two-byte arrays to be passed in, but you always write two bytes. Is that correct?

Normally if a result is 16-bit words, we would design an API to require an array.array('H', ...) (or maybe larger), instead of spreading the result over two bytes. That is why I was asking for further checking of the allowed type of the passed-buffer.

If the previous analogbufio implementation is doing something similar, we s...

onyx hinge
#

@tulip sleet I'm not sure the 7623 fix is right, or if that API has to be non throwing for the needs of web workflow.

tulip sleet
#

@slender iron (he/him) @onyx hinge (he/they) Ideally I would like to make an 8.0.3 release very soon (like today) with https://github.com/adafruit/circuitpython/pull/7616 and https://github.com/adafruit/circuitpython/pull/7624 in it. We were awaiting stonehippo's test pf RTS/CTS for 7616, but right now there is a really significant regression on normal UART use on many boards, and I would like to get 7616 in imminently because of that. I think the RTS/CTS will be OK, based on my changes, an the user base for that is small.
7624 is a backport of a socketpool fix that will help mqtt. @slender iron (he/him) Are you willing to go ahead and approve 7616, and could someone approve 7624? Thanks!

tulip sleet
onyx hinge
#

In the same function? Ok then

tulip sleet
#

let me check

#

no, not in the same function. this is a lower-level function called by the common-hal function.

#

I'll look who calls it

onyx hinge
#

Thank you. I'm sorry I didn't get to looking at it in depth earlier, I saw it go by yesterday but was in the midst of other stuff

#

I'll be at my computer in an hour or so and can look then if it's still inconvenient

#

Inconclusive that is

tulip sleet
onyx hinge
#

Are these secure or regular sockets? There's so much discussion on that issue!

tulip sleet
#

it's when TLS is in use, so maybe something else is not checking the return value for negative, and that is passing back the negative value.

onyx hinge
#

Yes that is what I'd check into anyway

tulip sleet
manic glacierBOT
#
[adafruit/circuitpython] New branch created: revert\-7623\-issue\_7606
still zephyr
#

is there anyway that a library will stay in disk after an storage.erase_filesystem() command, I am having this problem.. not sure why?

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Hello World!

Code done running.

Adafruit CircuitPython 8.0.2 on 2023-02-14; Adafruit PyPortal Titano with samd51j20
>>> import storage
>>> storage.erase_filesystem()

[08:37:25.698] Disconnected
[08:37:26.699] Warning: Could not open tty device (No such file or directory)
[08:37:26.699] Waiting for tty device..
[08:37:31.706] Connected
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

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

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Hello World!

Code done running.

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

Adafruit CircuitPython 8.0.2 on 2023-02-14; Adafruit PyPortal Titano with samd51j20
>>> import adafruit_display_text
>>> 
onyx hinge
#

@tulip sleet is there some failure in the chain of calls involving _mbedtls_ssl_recv? (is this failure one that should match mp_is_nonblocking_error()?)

tulip sleet
#

i have no idea -- it would be great if you could pursue this further -- you are much more familiar with the code.

onyx hinge
#

thanks, I think. 🙂

tulip sleet
#

i know it's not your mainline assignment 🙂

manic glacierBOT
#

Reverts adafruit/circuitpython#7623.

@DavePutz: @jepler brought up that the mp_raise is being done in the internal routine socketpool_socket_recv_into(). There is already a throw in coimmon_halsocket_pool_socket_recv_into() In general these routines below common_hal...() do not throw, because they are called from other places that don't expect them to throw, like the web workflow implementation.

So I think we need to revert this, and figure out what routine is leaking the -116 r...

tulip sleet
manic glacierBOT
still zephyr
willow totem
#

when defining a board, is it okay to define pins with extra names, purely for convenience and/or conforming to old examples, like IO12 and D12 and BUTTON_1?

manic glacierBOT
#

There is one more use case for IR receiver. That’s possible to detect IR codes on RPI Pico using CircuitPython but that’s impossible to do something more, see for example https://learn.adafruit.com/ir-sensor/circuitpython for IR receiver only (CircuitPython code) and https://learn.adafruit.com/remote-controlled-led-candelabra/code for IR receiver plus LEDs (C code). Even block code language for MicroBit allows to use IR receiver and neopixels together via interrupts but CircuitPython doesn’...

tulip sleet
#

if you have a pin that's connected to a button, sure name it for the button. Put the "primary" name first in the list in pins.c

willow totem
tulip sleet
#

take a look at some existing pin.c files: the Feathers or Metros are good examples. Note how pin aliases are grouped together, with blank lines around them, for clarity

#

if you don't care about Dmm vs IOnn don't both with D12 -- it's for back-compatibility with Arduino in certain cases.

willow totem
#

I was kind of using the adafruit boards, because of display attempt, so this is roughly where I'm at, please forgive extra separators for now, but I found the D prefix for digitalIO and A for analog very useful and everywhere in example code, so to make it beginner friendly I'd rather include those too (ADC on esp32s3 will be interesting and probably have ADC2P1 plus A1 names).

tulip sleet
#

put all the GPIO14's together, in order, with the primary one first, etc.

willow totem
#

gotcha

willow totem
onyx hinge
#

@tulip sleet I'm not sure there aren't two problems. The first problem is a return of 116 when trying to read 1 byte and; the next problem is the return of 4294967285 when no data is available. I have a correct (I think) fix for the 2nd thing but the first thing is still baffling me.

#

of course I'm using a standalone program and not mqtt, let alone the specific mqtt broker the OP reported a problem with

manic glacierBOT
#

<details>
<summary>OP's testing code</summary>

# ______________________________________________________ TEST CODE for LOCAL REMOTE broker TLS problem

import time
import microcontroller
#import micropython
#import gc # micropython garbage collection # use gc.mem_free() # use gc.collect

import os # ____________________________________________ expect file: settings.toml with:
THIS_REVISION = os.getenv('THIS_REVISION')
THIS_OS = os.getenv('THIS_OS')

WIFI_SSID = os.get...
crimson ferry
#

I routinely get OSError: [Errno 116] ETIMEDOUT in Requests in recv_into, possibly same issue

#

(but it usually succeeds on retry)

onyx hinge
#

my interpretation of #7606 so far is that it's returning the integer 116, not raising an oserror with an errno of 116. (and I'm also confused because the source code says that MP_ETIMEDOUT is 110 not 116)

crimson ferry
#

yeah, the number threw me

onyx hinge
#

this is when running adafruit_requests on a pico w?

crimson ferry
#

espressif, hmm, I can't run that code on Pico W (too big)

onyx hinge
#

oh mostly that list of errno numbers isn't used, py/mpconfig.h:909:#define MICROPY_USE_INTERNAL_ERRNO (0)

#

so some system dependent list of errno values is used instead

#

oh I wish all users were magically able to distill their programs down to the simplest reproducing form. because I sure don't enjoy doing it 😛

stuck elbow
#

sounds like a feature request for copilot

onyx hinge
#

🤔

manic glacierBOT
#

@milindmovasha If I understand correctly, you are allowing one-byte arrays or two-byte arrays to be passed in, but you always write two bytes. Is that correct?

Normally if a result is 16-bit words, we would design an API to require an array.array('H', ...) (or maybe larger), instead of spreading the result over two bytes. That is why I was asking for further checking of the allowed type of the passed-buffer.

If the previous analogbufio implementation is doing something sim...

manic glacierBOT
#

This PR contains the following changes:

  • Split atmel-samd instead of raspberrypi: This more evenly distributes the number boards across matrix jobs.
  • Refactor and simplify fetching port deps: Now port specific stuff can be placed in .github/actions/deps/ports/....
  • Fix for empty exclude commit: Use github.event.pull_request.head.sha instead of github.event.after which can be empty.
analog bridge
tulip sleet
#

i am not saying no, but saying we have an internal workflow for this kind of thing

onyx hinge
#

hah, just bitten by the bug gneverov fixed (mdns lwip locking), time to rebase this branch

manic glacierBOT
#

Rather than returning the negative error value.

This is intended to close #7606, though I did not test with mqtt. Instead, I created a simple standalone test program:

import wifi, socketpool, ssl, time
#wifi.radio.connect()
import socketpool
socket = socketpool.SocketPool(wifi.radio)
ctx = ssl.create_default_context()

b = bytearray(8)

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sss = ctx.wrap_socket(s, server_hostname='example.com')
sss.connect(('example.c...
#

I also tested with mqtt on hivemq.cloud with the following program adapted from the original test program on #7606.

# ______________________________________________________ TEST CODE for LOCAL REMOTE broker TLS problem

import os
import time
import microcontroller
import adafruit_minimqtt.adafruit_minimqtt as MQTT
import ssl
import adafruit_logging as logging

# NOTE: relies on web workflow being configured in settings.toml!

MQTT_broker = os.getenv('MQTT_BROKER')
MQ...
#

common_hal_socketpool_socket_recv_into() returns an int, and similar for other return values in that file.

But common_hal_ssl_sslsocket_recv_into() returns an mp_uint_t, and similarly for ...send(). I think it is inconsistent that the SSL versions return unsigned ints. Either all the common_hal routines like this should never return ints (which might be negative error values), and always throw, or they should all return ints. This is how we got into trouble.

#

On Wed, Feb 22, 2023 at 6:13 AM Adrie @.***> wrote:

In my humble opinion the community would really benefit from
microcontroller features that are (becoming) standard.

Then move on to Micropython. It is quite a lot ahead of Circuitpython.
There is no down side to switching.

Let me repeat: I do appreciate all the hard work

The work would be much more appreciated if it were not wasted on this
Circuitpython fork, but rather put into advancing Micropython. We'd all be
furth...

onyx hinge
#

I think that code is inherited from the espressif port, so scott might know if there's a reason

tulip sleet
#

@onyx hinge thanks for taking the time on that -- your understanding is much fresher than mine. Now I can still consider an 8.0.3 very soon

onyx hinge
#

Of course!

slender iron
#

@tulip sleet I'm ok merging in the uart fix

#

I think I approved it already

tulip sleet
#

yes, you did, tnx, I will go ahead

timid bolt
#

some background observations around the socket OSError issue:

  • It would be nice to have greater clarity around the split between "bindings" and "common-hal". Clearly "bindings" is the C glue code to expose a Python module. But is "common-hal" just the port specific part of this glue, or is "common-hal" meant to stand on its own as a C API. I think it maybe started off as the former but then slid into the latter because of the supervisor. The distinction is important because C callers don't want to deal with Python exceptions, maybe don't want to use Python types, and in some cases don't expect allocations.
  • So having rules about how "common-hal" works and establishing best practices would be useful, especially around error handling. In any case, returning an errno as a negative integer is not a good practice. The global errno variable exists so that we can return errnos independently of the function return value.
  • Error messages take up a lot of space. It might be a good idea to consolidate error reporting into a standard set of error codes (errno codes or something else). This way every exception raising site doesn't invent its own message string (taking up space). There is a single standard message for an error code. The API documentation can contain more information about what each error code means for a specific function call. Here you have a lot of space to explain in detail what the error means, instead of trying to cram it into an exception message string.
slender iron
#

I agree that common-hal definition is fuzzy

#

It only needs to stand on its own as a C API when it is used by code outside of the VM

#

which is why we don't have a strict line

#

I wouldn't spend my time getting it strictly separated though

timid bolt
#

another use case of common-hal as a C API is when other common-hal modules use it as an implementation detail. E.g., audiopwm using pwm for implementation, or audioi2s using rp2pio for implementation.
It is a little nerve racking in these cases when every common-hal call can potentially throw.

slender iron
#

in most cases that's fine because the VM is running

#

I do usually omit the common_hal_ prefix on versions that are used outside the VM

#

@wraith crow looks like svdconv was moved by arm and the broadcom-peripherals library is broken

timid bolt
#

a common bug pattern is:
allocate some hardware resource
call someone else's common-hal function which throws
now my hardware resource has leaked

Obviously the fix is to use nlr_push(), but that's quite cumbersome and no one wants to do that all the time.

slender iron
#

I'm not sure I'd call it common because I don't hear folks hit it that often. It is definitely a gotcha

wraith crow
#

I assumed it was your folder (adafruit/broadcom-peripherals)

#

since there was no link indication in github

manic glacierBOT
wraith crow
#

Ahh, I'm catching up with you slowly 😁 let me poke around and see if I can figure things out.

manic glacierBOT
slender iron
#

np, thanks for looking into it @wraith crow. I think you are the only person using the broadcom port 😕

wraith crow
#

Ah well, the 4's may be a bit overkill but once the next generation of zero's come out I think the zero, zero2 and zero2w may make very attractive CP boards

manic glacierBOT
slender iron
#

@wraith crow totally. I still want to get back to usb host at some point too

manic glacierBOT
wraith crow
#

Okay so I found the workflow link to the old location, which I can easily update to the new location you suggested but I don't know what the "commit one" is and if that would be a better choice.

manic glacierBOT
slender iron
manic glacierBOT
#

In ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/sdkconfig we can see:
CONFIG_SPIRAM_MODE_QUAD=y and CONFIG_SPIRAM_TYPE_AUTO=y
CONFIG_SPIRAM_MODE_QUAD is for qspi, so shouldn't we define the rest of the data pins?
Currently only:

CONFIG_DEFAULT_PSRAM_CLK_IO=30
CONFIG_DEFAULT_PSRAM_CS_IO=26

are defined. So the board would run in normal spi?
Shouldn't there be something like:

CONFIG_DEFAULT_PSRAM_CS_IO1=26
CONFIG_DEFAULT_PSRAM_CS_IO2=26
CONFI...
#

Sorry for the slow response. It was a three day weekend here in the US and I didn't have the brain power yesterday to context switch to this.

Unfortunately, I don't think the existing API is good enough for audio input. I'd suggest following my original suggestion to do init/deinit for reading here. Then, follow up with a new AudioIn API. It'll need to take a buffer in the constructor, return samples read without blocking and detect overflows. It'll be pretty different than this API.

manic glacierBOT
#

Thanks for your response! I hope you enjoyed your long weekend. Coming back to thread, even if I follow your original suggestion of init/deinit we wont' be able to support second bufferedIn on second pin because mask for ADC units will get overwritten and previous bufferedIn samples would be stopped if second bufferedIn is configured. Even if we remember the mask (read/modify/write) and configure second BufferedIn appropriately, the samples collected via adc_digi_read_bytes would be interleav...

#

It now handles deinit, never_reset and sharing tracking. PWM now runs in the WAIT state as well during a time.sleep().

_reset_ok() was removed because it was called in one spot right before deinit().

Some PWMOut were also switched to a bitmap for use instead of reference count. That way init and deinit are idempotent.

Fixes #6589. Fixes #4841. Fixes #4541.

slender iron
#

So I think I could save 1548 bytes by changing the QSTR -> obj tables

#

I think they take 6192 bytes now. each entry is 8 bytes and could be 6 bytes a piece

manic glacierBOT
#

Would you mind just splitting out every port?

I took a look at the nrfutil changes and this pr simplifies it.

The port specific configuration steps/dependencies for nrf can go in:

# .github/actions/deps/ports/nrf/action.yml

name: Fetch nrf port deps

runs:
  using: composite
  steps:
    - name: Get nrfutil 7+
      run: |
        wget https://developer.nordicsemi.com/.pc-tools/nrfutil/x64-linux/nrfutil
        chmod +x nrfutil
        ./nrfutil install nrf5sdk-...
manic glacierBOT
wraith crow
#

@slender iron Looks like the broadcom-peripherals finally passed the checks 😁

manic glacierBOT
orchid basinBOT
manic glacierBOT
wraith crow
#

Is there a way to kick off the workflow checks of a PR without sending a new commit?

wraith crow
#

Yep, that's the one

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.2 on 2023-02-14; Adafruit Metro ESP32S2 with ESP32S2
Board ID:adafruit_metro_esp32s2
UID:C7FD1AA13E86

Code/REPL

# SPDX-FileCopyrightText: 2020 Brent Rubell for Adafruit Industries
#
# SPDX-License-Identifier: MIT

import ipaddress
import ssl
import wifi
import socketpool
import adafruit_requests

# URLs to fetch from
TEXT_URL = "http://wifitest.adafruit.com/testwifi/index.html"
JSON_QUOTES_URL =...
still zephyr
#

done, normally it would appear re-run all-jobs on the screen right hand side

wraith crow
#

lol, okay I'll look at the screen closer next time. Thanks!

still zephyr
#

🙂 yw

wraith crow
#

Looks like I missed a step, does the CircuitPython link to adafruilt/broadcom-peripherals need to be updated?

manic glacierBOT
#

CircuitPython version

CircuitPython 8.0.2 on Adafruit Feather ESP32 V2

Code/REPL

N/A

Behavior

N/A

Description

In CircuitPython 8.0.2 with ESP32 V2, whenever a file is uploaded (PUT) or deleted (DELETE) the web workflow gets broken because the board no longer listens for TCP connections on port 80.

Downgrading to 8.0.0 beta 4 fixes the problem. https://github.com/adafruit/circuitpython/commit/f8ac1d9261c087d1f65886036289c2121c32cc0f#diff-...

slender iron
#

@tulip sleet @onyx hinge got time to chat about my table size optimization idea?

tulip sleet
#

yup, I am just back from being out

onyx hinge
slender iron
#

kk, I'm in the Amelia room

blissful pollen
#

Does anyone know of / if a Blinka animated GIF exists?

manic glacierBOT
onyx hinge
#

I sometimes forget how good @slender iron is with creating tooling .. but it's hard to even know to look for whether someone's already created a relevant tool, you have to stumble across it or say something at the right time to jog someone's memory

slender iron
#

what tool of mine are you thinking of?

#

it crossed my mind to use SWO for the memory captures

#

@vale spire any thoughts around reorganizing qstr-only tables to save flash space?

onyx hinge
#

the call graph one

#

but just generally

vale spire
#

ohh wait, yes

slender iron
#

🙂

vale spire
#

i looked into this with @onyx hinge ... the idea being that many locals dicts have qstr-only keys which means only 16-bits per entry
so for 4-byte alignment this means you need to split keys and values into separate tables (instead of a single table of elements)
but then you have two huge problems:

  • writing the tables is annoying (and working around this is beyond what is probably considered healthy use of preprocessing... and you know how low my standards are here)
  • any code that iterates a map now needs to know which structure it is (and most code that iterates maps does so by directly using the table of elems)
slender iron
#

yup yup, that's the thinking

#

If we're willing to number the entries we could use initilizers to mix the two

#

or we could pack two entries together k1, k2, v1, v2

vale spire
#

i wrote a script to rewrite all the affected const maps and conpute the savings and it was... not amazing

slender iron
#

I calculated 1500 bytes in savings or so

#

(for us)

vale spire
#

yep sounds about right

#

1500 is great, but i couldn't see a way to avoid likely a lot of extra code in handling it

#

i also wondered that many of these maps are qstr to rom pointer

slender iron
vale spire
#

and so perhaps we could do silly things to make the rom pointer 16-bit (i.e. an offset)

slender iron
#

that could help us mix the definition of two arrays

#

yup, I thought about that too

#

we could use a python script and then sort the keys to speed up search

vale spire
#

have you seen tools/cc1 in the main repo 🙂

#

i think the map caching we added last year mostly gets the same win

slender iron
#

haha, nice

#

ya, I'd believe it

#

and most of the tables are pretty short

#

is tools/cc1 actually used?

vale spire
#

no, was just an experiment (untouched for many years now)

wraith crow
#

So it turns out adafruit/broadcom-peripherals has two branches main and main-build. CP uses the main-build as a submodule but I pushed my PR against the main branch.
Should I change the link in .gitmodules to the main branch or resubmit my pull against the main-build branch?

slender iron
#

kk, ya. 2015

#

@wraith crow the -build branch should be autoupdated

vale spire
#

there are so many things in this category of "what if we wrote a real C preprocessor for MPy"

slender iron
#

🪱

#

(can of worms)

vale spire
#

exactly

wraith crow
#

oh yea 😊

slender iron
#

so packing two entries at a time could be one way to do it

#

but splitting it into two arrays would likely lead to simpler searching code

#

because you'd just change the element size

lone axle
blissful pollen
#

Oh thanks I hadn't seen the second one

onyx hinge
#

@tulip sleet @slender iron maybe we should re-triage the imx bugs in view of the upcoming metro

slender iron
#

I did a bit already

#

moved some of the long term things to 9.0

#

I also wanted to update to the newer sdk that they have on github

tulip sleet
#

good idea, maybe tomw?

slender iron
#

but was going to wait until after 8.1

tulip sleet
#

that's fine too

slender iron
#

I'm also happy to chat it over tomorrow

storm minnow
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
cosmic turret
#

Hi, Can I check if there is a good reference code(for both send and receiving side) that is able to send a csv file from mac to circuitpython board (ESP#@ S3 TFT). Thanks

lone sandalBOT
manic glacierBOT
#

no news, just for info:

  • nuke
  • adafruit-circuitpython-raspberry_pi_pico_w-en_US-20230222-c2c7b93.uf2
  • adafruit-circuitpython-bundle-8.x-mpy-20230223.zip

works with is_ssl=True,
HANGS without

___ Connecting to router kll-wlan_2.4G OR CHECK THE 'settings.toml' FILE
___ Connected to kll-wlan_2.4G
___ Listening on http://192.168.1.214:80 
___+++ setup MQTT
___+++ setup MQTTclient
___++++ use TLS
___ Attempting to <xxx>.hivemq.cloud

after several minutes wait see
...

manic glacierBOT
manic glacierBOT
#

While looking into #7606 @dhalbert noted that there were irregularities in our socket-like APIs that may have contributed to the bug existing in the first place.

We should consider rationalizing the code so that:

  • the common-hal APIs consistently return either positive counts or negative errno values, in signed types (mp_int_t)
  • the shared-bindings have the responsibility of transforming negative errno values into OSError exceptions
  • noting, at least in comments, common-hal APIs t...
manic glacierBOT
#

We don't support any microcontrollers that have sub-8-bit SPI peripherals. In general, 8-bit is standard, a few support 9-bit or 16-bit.

Despite the fact that the datasheet says the device "is compatible with the SPI protocol", it is so only in a loose sense.

If you use 8-bit SPI and have your setting bits in the lower 6 bits, does that work? Maybe it will accept 8 clocks and just discard the top two bits.

You could also simulate 6-bit SPI by bitbanging the data and clock lines yours...

orchid basinBOT
manic glacierBOT
wraith crow
#

I thought I'd see if 7636 showed up on the Huzzah32 but the 8.0.2 and the latest build seem to cause a boot loop. I'll see if I can find where it started

hidden rain
#

The rp2pio SM has great timing capability. Well beyond that of CPy. If one could get triggers or read state from peripherals like the ADC or DMA, it would easy to measure the timing for various IO apps to a microsecond (instead of a millisecond). Is this a viable feature request? Do I open an issue in GitHub?

slender iron
#

@hidden rain sounds like what PulseIn does

#

what exactly are you trying to measure?

hidden rain
# slender iron what exactly are you trying to measure?

My app uses an rp2pio sm to generate 8 sq wave pulses at 40KHZ after a calculated NOP delay. This is sent to a transducer. The receiving transducer reads from the ADC0 using analogbufio. However, the CPy overhead from the call to my pulse routine and analogbufio makes it hard to get microsecond timing.

tulip sleet
slender iron
wraith crow
#

okay :), I was coming to the conclusion it was on my end since I know I've run beta6 on the board and it's not running now. I had Micropython on it last and didn't erase it first :/

tulip sleet
#

@slender iron since I can't reproduce 7636 I am going to proceed with 8.0.3, as it does not seem to be a pervasive issue

hidden rain
slender iron
slender iron
#

(I know nothing about transducers)

hidden rain
slender iron
#

sounds like you may need something native

hidden rain
timid bolt
manic glacierBOT
slender iron
hidden rain
hidden rain
#

Will do. Thanks!

slender iron
hidden rain
manic glacierBOT
tulip sleet
#

@slender iron is the case-insensitive space saving change imminent? The 8.0.x->main merge is failing on a few boards due to space.

slender iron
#

I haven't made the changes yet. I'm still trying to determine exactly what is pulling in those tables

tulip sleet
#

i may merge that anyway, or do some temp shrinking in that case, since we want those changes in main

slender iron
#

what do you mean by temp shrinking?

#

why is it urgent on main?

tulip sleet
#

there are pico w fixes and other regression fixes from 8.0.x we should have in main

#

temp shrinking would be like turning off rainbowio or something

slender iron
#

give me today to get something together. I'd rather not have anything temporary in main

tulip sleet
#

sure, np

manic glacierBOT
#

I've been doing a little testing on the Huzzah32 (thanks for the kickstart @dhalbert :blush:). I didn't reproduce exactly what it sounds like @vladak is describing but I did find something that maybe they are running into.

On the Huzzah32 with the default code.py file when the board boots it sits at the Press any key to enter the REPL prompt. Web workflow works fine and you can access the serial terminal. However if you are at that initial "Press any key" prompt and you use the web workflo...

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 8\.0\.3
tulip sleet
slender iron
#

it looks fine to me but also wanted you to look

#

you can remove me

#

and approve when you are ready

tulip sleet
#

sure, all set, I will merge to main

#

thanks!

slender iron
#

👍

orchid basinBOT
manic glacierBOT
#

This feature would enable many amateurs and professionals to leverage the power of processor peripherals for precise microsecond level timing applications, such as measurement, where Circuitpython's inherent time resolution of near 1 millisecond is insufficient.

Use of IRQs would not be needed (to the best of my knowledge). The trigger would merely be a state change of a register or more specifically, particular bits of a register.

Example Need:
A current project, a precise ultrasonic ...

wraith crow
#

Should the latest S3 build show Adafruit CircuitPython 8.1.0-alpha.2-15-gd5e936ce7 on 2023-02-23; Adafruit Feather HUZZAH32 with ESP32 as the version?

#

I guess that's right, just not used to seeing the alpha 🙂

tulip sleet
analog bridge
#

@slender iron Can you merge #7631 as is, it contains some fixes for changes per commit.
I agree with you on making matrix by port rather than architecture but I might not be able to get to it until next week.

slender iron
#

ya, sure

orchid basinBOT
manic glacierBOT
#

Thanks @latkinso42 for writing up your use case.

FWIW, I've been exploring a new approach for doing I/O. In this approach everything is a "stream" which serves as a common abstraction for connecting independent IO modules, like analogbufio and rp2pio. In this imaginary world, analogbufio would expose a stream of the ADC samples, which you'd connect to a PIO State Machine. When streams are "connected" they automatically transfer data without any interaction from the main program. When your ...

onyx hinge
#

@slender iron @vale spire I have terribleness for you. using "order_pp" and "chaos_pp", a pair of very painful macros that can declare the weird mixed tables you'd need for packing qstr-keys dicts closer ...

given

TABLE((1,a) (2,b) (3,c) (4,d));
TABLE((1,a) (2,b) (3,c) (4,d) (5,e) );

the macro can produce

{ {1,a},{2,b},{3,c},{4,d} };
{ {1,a},{2,b},{3,c},{4,d},{5,e} };
``` (traditional interleaved table) or using the TABLE2 macro ```c
{ {.a=1,.b=2},{.a=3,.b=4}, {.obj=a},{.obj=b},{.obj=c},{.obj=d} };
{ {.a=1,.b=2},{.a=3,.b=4},{.a=5}, {.obj=a},{.obj=b},{.obj=c},{.obj=d},{.obj=e} }

```(hypothetical packed table in which the elements are a union of `qstr a, b` or an `mp_obj_t obj`)

Based on awful awful horrible "boost preprocessor wasn't ~~bad~~ ~~*good*~~ **bad** enough" https://github.com/rofl0r/chaos-pp and https://github.com/rofl0r/order-pp which I chose after a survey of general terribleness at https://jadlevesque.github.io/PPMP-Iceberg/

https://gist.github.com/55d51d1b9186194917f6387ef448a052
manic glacierBOT
#

Excellent idea and very exciting. I have to admit, I'm not the EE or HW guy I need to be to make any of this happen. I barely suffice to understand the genius that has come before me. However, it can be manifested SW-wise, precise timeing for peripherals would make for powerful control with ease of programming. I suppose it would not need to add data 'streams' but merely use the PIO as a trigger. In the case of analogbufio, the DMA starts running, but effectively does nothing until the first ...

onyx hinge
#

I don't think we SHOULD do it but I just wanted to see if it could be done within the C preprocessor.

vale spire
#

ok now I'm very interested 🙂

but yeah I don't think we should do it because i just can't see the cost of using it being worth it... we can't have every site that iterates a dict have two different versions (i think??)

manic glacierBOT
slender iron
onyx hinge
#

order-pp seems very powerful and very nearly undocumented so it was a bit of a slog to create this blob of macro

slender iron
#

@onyx hinge are you tempted to do it?

vale spire
#

@onyx hinge did you see a way to do it as split tables? i.e. array of keys and array of values?

#

one advantage of that is that can also be the layout for all maps

onyx hinge
#

The macro could declare two variables, one an array of qstr and the other an array of mp_obj_t, I thnk

#

does that help?

vale spire
#

i wondered if this might improve performance for lookup because you look at less memory (i.e. less cache filling)

#

yes

onyx hinge
#

looks like ~55 distinct sites refer to the table field of mp_map_t

manic glacierBOT
vale spire
onyx hinge
#

if only! but I think Adafruit's probably going to send me to only one python conference this year.

manic glacierBOT
onyx hinge
slender iron
#

puts it in his back pocket

manic glacierBOT
slender iron
#
python find_reverse_deps.py cvt Cvt                                                 367ms  Thu 23 Feb 2023 01:06:49 PM PST
/home/tannewt/repos/circuitpython/ports/mimxrt10xx/build-metro_m7_1011/lib/oofatfs/ff.o:ExCvt
        /home/tannewt/repos/circuitpython/ports/mimxrt10xx/build-metro_m7_1011/lib/oofatfs/ff.o:follow_path
                f_stat
                f_utime
                f_chdir
                f_opendir
                f_unlink
                f_rename
                f_mkdir
                f_open

/home/tannewt/repos/circuitpython/ports/mimxrt10xx/build-metro_m7_1011/lib/oofatfs/ffunicode.o:cvt1.1
        ff_wtoupper
                f_mkfs
                f_setlabel
                /home/tannewt/repos/circuitpython/ports/mimxrt10xx/build-metro_m7_1011/lib/oofatfs/ff.o:xname_sum
                /home/tannewt/repos/circuitpython/ports/mimxrt10xx/build-metro_m7_1011/lib/oofatfs/ff.o:dir_find

/home/tannewt/repos/circuitpython/ports/mimxrt10xx/build-metro_m7_1011/lib/oofatfs/ffunicode.o:cvt2.0
        ff_wtoupper
                f_mkfs
                f_setlabel
                /home/tannewt/repos/circuitpython/ports/mimxrt10xx/build-metro_m7_1011/lib/oofatfs/ff.o:xname_sum
                /home/tannewt/repos/circuitpython/ports/mimxrt10xx/build-metro_m7_1011/lib/oofatfs/ff.o:dir_find
manic glacierBOT
#

After doing

esptool.py --port /dev/ttyACM0 erase_flash
esptool.py --port /dev/ttyACM0 write_flash -z 0x0 \
    ~/Downloads/adafruit-circuitpython-adafruit_feather_esp32_v2-en_US-8.0.2.bin

I created the settings.toml file using the guide on https://learn.adafruit.com/circuitpython-with-esp32-quick-start/setting-up-web-workflow , verified it is reachable via ping and TCP on port 80 and retried. It fails in the same way as before.

jaunty juniper
#

oooh that's weird, I have the Feather ESP32 V2 stop responding to its IP after uploading a file from the web UI, but still working via my app as long as I don't close the window (changing the code, seing the LED change color), while curl says "Failed to connect"
and if I look in the dev console I see "fetch failed loading etc." but the color changes...

manic glacierBOT
#

For the serial terminal issue I was seeing, I tracked it down to https://github.com/adafruit/circuitpython/commit/40534da92a8e385b9a04b8d0ff14f8365b2e1f5a and in particular this change:

  uint64_t start_ticks = supervisor_ticks_ms64();

     // Allow timeouts and interrupts
-    while (newsoc == -1 && !timed_out) {
+    while (newsoc == -1 &&
+           !timed_out &&
+          !mp_hal_is_interrupted()) {
         if (self->timeout_ms != (uint)-1 && self->timeout_ms != 0) {
   ...
slender iron
#

@tulip sleet ☝️

tulip sleet
slender iron
#

I think they will print as the saved case because it only converts incoming path strings afaict

#

the name made sense to me an hour ago. not so much now 🙂

#

it will change the uppercase table of formatted exfat too

tulip sleet
#

and FF_CODE_PAGE is usually 437, it looks like?

slender iron
#

yup, think so

tulip sleet
#

looked that way to me too

#

did you test with some extended char filenames? I think you could write a port/unix test for this??

slender iron
#

no I didn't. let me look

tulip sleet
#

well, maybe not, not sure whether you can use VfsFAT in unix

slender iron
#

looks like there are tests in extmod for it

#

do we run them....

manic glacierBOT
slender iron
#

looks like it does run them

manic glacierBOT
tulip sleet
#

i'll be afk for a while

manic glacierBOT
slender iron
#

I'm done once Ari wakes

crimson ferry
#

Should the 8.0.0 warnings be repeated in each point release notes? I imagine lots of people will go from older firmware to some point release.

slender iron
#

ya, maybe until 8.1

manic glacierBOT
#

I get the issue on a FunHouse too, when I try to upload a file, it fails as it should because the drive is mounted, but still auto-reloads, and after that the web workflow stops responding.
The issue also happens when creating a directory but ONLY if the directory is really created, not if it already exists, or if the drive is mounted. Which is also the only case where it triggers an auto-reload.

tulip sleet
tulip sleet
crimson ferry
#

sorry, I think it was my confusion. Pico W certainly didn't exist. I think what happened to me was ESP32-S2 that had filesystem expanded, then put 7.3.3 back on it, then 8 again

#

I saw files I thought I had lost

#

I'll have to see if I can replicate that ,,,nope, that wasn't the sequence with the odd file behavior

clever hawk
#

I'm trying to get going on the adafruit macropad. I took the code from the example of the numpad script and put it into the code to file. I've restarted the board and the top left bottom blinks green every 5 seconds and the screen says code done running. But none of the keys work.

tulip sleet
#

is it in code.py, or something else? code.py out of the box just prints "Hello, World", and stops.

clever hawk
#

Sure, it's the numpad.py script in the .zip file that the website provides.

#

Oh gosh that's so big

tulip sleet
#

did you install all the libraries too?

#

you can delete, I can see what it is now

clever hawk
#

Yes all the ones that came with the zip file
Yes

tulip sleet
#

you want to see what errors are being printed, if any, so you want to connect to the board's serial connection. You can use Mu or a terminal program.

clever hawk
#

I have used mu but it says the same as the little screen, "code done running"

tulip sleet
#

you need a code.py that should be in that bundle. Where did you put the code.py? It should replace the code.py at the top level

#

it should not be in lib

#

does it say anything before "Code done running"?

clever hawk
#

The code.py file is in the circuitpy root directory

#

Yes I took the code out of the numpad file pasted it into the code.py file in root directory. I can run print statements in the same script and those will be put on the screen so I think I'm using the correct file.

tulip sleet
#

The code on this page should be the code in code.py. numpad.py is a separate definition

#

just leave numpad.py where it is, and use the knob to select it

clever hawk
#

Nothing at all. this is my file explorer

tulip sleet
#

your code.py is too small, it should be 8.5kB

#

use the original code.py that came in the bundle. That is the program in charge, which reads all the definitions in macros/.

#

in your file explorer, turn on showing file extensions (under View), it will make things much easier

clever hawk
#

ahhhhh

#

IT WORKS!

#

Thank you so much!

tulip sleet
#

you're welcome, np

clever hawk
#

Now to start customizing it for SQL server!

manic glacierBOT
#

@tannewt I'm using a Teensy 4.1.

@dhalbert thanks for this! I had considered that I might have to do some bit banging, but to be honest I rarely do much work with micros. When I looked at the source for busio, I saw it was doing what looked like a simple check for the bits argument and wondered if it might be as easy as adjusting that check.

I'll get a chance to look at the device tomorrow and was going to try an 8-bit word like you mentioned and hope it discarded the unnecessary bits. If ...

crimson ferry
#

interesting... taking a post-8.0.0-beta.1 PicoW back to beta.1 then back to post-8.0.0-beta.1 exposes the files that were on it originally

#

also I was (pleasantly) surprised that reverting an expanded ESP32-S2 to 7.3.3 didn't un- expand the filesystem

tulip sleet
#

the UF2 only writes the blocks that are actually used

jaunty juniper
crimson ferry
#

yeah, there wasn't a lot on that one

#

I managed to brick / kill a Pico W somehow though 😦

#

I don't have an exponent of 2 Picows anymore 😦

jaunty juniper
#

well you can't brick it unless you use a hammer

#

or 5V

crimson ferry
#

I'm assuming something bad happened to it electrically

jaunty juniper
#

and I discovered that my websockets code that works on ESP32 doesn't work on a picow

#

so that's a fun thing to debug

crimson ferry
#

I thought websockets was just some high-level protocol on top of HTTP

#

oh, it is different

jaunty juniper
#

you tell the http server to switch to websockets for that connection, which makes it persistent

#

and then there's a protocol with bytes and stuff

crimson ferry
#

those pesky bytes

jaunty juniper
#

right now after sending the headers, reading times out

#

at the point where the server should send "HTTP/1.1 101 etc"

#

(except on SSL where it just freezes at sock.connect)

wraith crow
#

I haven't done a lot with sockets but I did find that depending on the server I was connecting to, if I didn't send the header variables it wanted the connections would timeout or freeze.
But, as you're working with code that worked on the ESP32 that's probably not relevant.

jaunty juniper
#

I'll try to get more debug done tomorrow, look at what is really going through the network

#

for now it looks like the pico only actually sends the headers after I ctrl-C rather than when send() is called if the server debug logs are to be believed

manic glacierBOT
#

While working on the SPI issues I noticed that when the PI4B would corrupt my SD card, I would often get directory entries that looked similar to this one:

Adafruit CircuitPython 7.2.0-alpha.0-120-gaee80d67b on 2021-12-14; Raspberry Pi 4B with bcm2711
>>> import os
>>> os.listdir()
['AdafruitCi', 'ha.0-120.-ga', '4;Raspb.err', '\nBoardI.d:r', '~1.MET', '.Trashes', 'code.py', 'lib', 'boot_out.txt', 'System Volume Information']

![corrupted broadcom flash2](https://user-i...

south creek
#

what code would I use on my nrf52840 feather to see if its plugged into a usb host?

wraith crow
#

Why did you pull your answer?

import supervisor
supervisor.runtime.usb_connected

looks like it works to me.

crimson ferry
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0-alpha.2-17-g00a03c323 on 2023-02-23; Adafruit Feather ESP32S3 4MB Flash 2MB PSRAM with ESP32S3
Adafruit CircuitPython 8.1.0-alpha.2-17-g00a03c323 on 2023-02-23; BPI-PicoW-S3 with ESP32S3

Code/REPL

No code.py file is executed.

Behavior

On esp32s3 boards setting CIRCUITPY_PYSTACK_SIZE=4000 causes a crash into safe mode.

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

...
manic glacierBOT
#

@vladak , This probably isn't the fix but I'd be curious if the attached adafruit_feather_esp32_v2 firmware resolves the issues you are seeing.

firmware.zip

The code that identifies as 8.1.0-alpha.2-17-g00a03c323-dirty indeed resolves the issue. Using my version of circup that supports web workflow I can install and uninstall libraries consisting of multiple files without issue. The code.py uploader abo...

manic glacierBOT
#

On S2 I could go up to a megabyte before I added checks. I assumed I hit some interger limit there.

The effective upper limit is 3700 for S2, 7000 for rp2.

Currently I have covid and I am pretty much unable to fix this. However can please find the exact value it fails on?

The fix would pretty much be defining an upper limit for every mcu. If the value set is higher than that, lower it to the maximum.

manic glacierBOT
#

I'm very interested in this. We have some esp32s2 boards we use in schools to teach students.

The problem we have is EAP-TTLS with PAP enterprise wifi. We managed to hack something together in Radio.h and Radio.c to use other enterprise authentication methods and it is our understanding that for EAP-TTLS and PAP we need esp-idf 5.0 due to espressif/esp-idf/issues/7011.

Can we help somehow? How much work is this?

kind echo
#

PLC and ESP32 IOT

manic glacierBOT
#

It is useful to be able to generate accurate PWM frequencies that are in the 1hz to 100Hz range, (or even slower).

While it has been suggested that these can be generated in a timing loop, that is not a viable solution when reliable timing or a specific duty cycle is required. Real world examples would be generating a square waveform for ringing a telephone bell (20hz or 30hz), pulse dialing a phone in an alarm system, sending tones of precise duration, or for phase-control lighting applic...

manic glacierBOT
#

I'm not sure that it's possible to do substantially better than we currently do with the PWM hardware. If you have a specific idea about how to call functions in the pico_sdk that would achieve your goals, please give more information.

Instead, I'd recommend using the pio peripheral to get cycle-accurate delays and transitions. For instance, this example blinks an LED with a frequency of 5, 8, and 30Hz (and 50% duty cycle): https://learn.adafruit.com/intro-to-rp2040-pio-with-circuitpython/...

crimson ferry
#

jepler, I hope you don't mind, I edited your comment so the link wasn't 404

manic glacierBOT
#

I’ll look into the PIO. My impression has been that Raspberry Pi Foundation created PIO as a way to prove that there can be something more difficult and obscure than assembly language.I don’t know how to make constructive suggestions as I don’t have low-level skills.On Feb 24, 2023, at 20:57, Jeff Epler @.***> wrote:
I'm not sure that it's possible to do substantially better than we currently do with the PWM hardware. If you have a specific idea about how to call functions in the pico_...

midnight sage
#

how can i privately report a potential security issue in a circuitpython library?

onyx hinge
midnight sage
#

ok

manic glacierBOT
#

The link you gave is a 404 error:On Feb 24, 2023, at 20:57, Jeff Epler @.***> wrote:get cycle-accurate delays and transitions. For instance, this example blinks an LED with a frequency of 5, 8, and 30Hz (and 50% duty cycle): https://learn.adafruit.com/intro-to-rp2040-pio-with-circuitpython/using-pio-to-blink-a-led-quickly-or-slowly—the on/off times can be any specific number of CPU cycles.

#

Thanks. By the way, taking your suggestion a little tongue in cheek the logical extension of your argument is that there is no need or use for CircuitPython since anything can be better accomplished in assembly language.My point is that working at a high level with tools that have a minimum of misbehaviors lets end results get accomplished without falling into the infinite learning recursion syndrome.If the PWM just worked at lower frequencies then there would be one less case of “death by a ...

jaunty juniper
manic glacierBOT
#

The RP2040 PWM hardware can support frequencies as low as 7.5 Hz. @SeattleDavid let us know if it is not working at say 10 Hz, as there may be a bug there.

If the frequency is too low for a specific port's PWM hardware, it would be a more seamless developer experience if PWMOut could automatically fall back to a timer interrupt based implementation.

wraith crow
#

@tulip sleet I was poking around the espressif Socket.c and I'm still getting stuck on setting signal to 1. The original version wrote fd (which was the wrong type, only 4 bytes) but fd was passed in as what looks like the socket number. Can the socket number only be 1?

tulip sleet
#

the value passed is added to a counter in the ESP-IDF eventfd code. (I traced it down to that.)

wraith crow
#

I have no idea how to trace where write(socket_change_fd, &signal, sizeof(signal)) is sending the data or how that data is processed so I assumed you wouldn't want the PR to change the data being written. It sounds like you did track it down and incrementing the counter by 1 or by the socket number doesn't matter. Just curious was there an advantage to passing the 1 rather than just setting the new signal variable to fd?

tulip sleet
wraith crow
#

Now I understand why there's a hook stuck in my lip 😆 I always chase those dang herring....

tulip sleet
#

I had to chase it too, in this case 🙂 . I'll see if I can find more info for you -- it's always good to have more eyes on this.

lone sandalBOT
tulip sleet
#

@wraith crow
https://github.com/espressif/esp-idf/blob/4c2afac35502161ce473660c99e17feb013a378d/components/vfs/vfs_eventfd.c#L250 event_write(): makes sure the data size is 8 bytes, may call signal_event_fd_from_isr() with the data value. May add the data value to s_events[fd].value.
https://github.com/espressif/esp-idf/blob/4c2afac35502161ce473660c99e17feb013a378d/components/vfs/vfs_eventfd.c#L225
May add the data value to .value, as above.

eventfd is more general than just for sockets, so there's some use case that's interesting for maintaining .value, but I don't know what it is.

I actually did all this code tracing in emacs with tags, not in GitHub, but any IDE would help.

wraith crow
#

Thanks! I'll have a look over the weekend and see I can pry this hook out

slender iron
#

@tulip sleet @onyx hinge I'm around now if you want to talk imx

tulip sleet
#

i can do it in 1 minute

onyx hinge
#

I'll join in a bit.

tulip sleet
#

I'm back and looking at the mimxrt10xx label list

slender iron
#

I'm in the Amelia room

manic glacierBOT
#

I like that!At, say, <6.5 it would (behind the scenes) switch how it does things. This could make it possible to support under 1hz.On Feb 24, 2023, at 23:28, gneverov @.***> wrote:
The RP2040 PWM hardware can support frequencies as low as 7.5 Hz. @SeattleDavid let us know if it is not working at say 10 Hz, as there may be a bug there.
If the frequency is too low for a specific port's PWM hardware, it would be a more seamless developer experience if PWMOut could automatically fall back ...

#

Not as good as doing it the correct way by switching methods under 7.5, but certainly better than now when it is just wrong.On Feb 24, 2023, at 23:29, Dan Halbert @.***> wrote:
For right now, we could raise an error when the requested frequency is out of range.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

slender iron
#

@tulip sleet I think you meant ASCII instead of UPPERCASE above

tulip sleet
slender iron
#

np

#

changing now

#

turns out unix port wasn't even doing utf-8 filenames right

tulip sleet
#

so you had to fix the tester 🙂

slender iron
#

I did

#

exfat is off on samd21 it looks like already

#

removing mkfs didn't do anything

#

ok, pushed

manic glacierBOT
orchid basinBOT
slender iron
#

any thoughts on how perf tests should measure the time they take?

#

micropython uses utime.ticks_us()

#

I'm not sure we have a microsecond clock running usually

#

trying now with monotonic_ns

manic glacierBOT
cobalt grail
#

OK, I give up. I can't translate this one due to line feeds. WHY is there even linefeeds here?

#

Regardless how many linefeeds I put in it won't accept it.

#

serial_write_compressed(translate("\nInvalid CIRCUITPY_PYSTACK_SIZE\n\n\r"));

jaunty juniper
#

oh that's a weird line

cobalt grail
#

Wut? \r????

#

Yeah, I can't even try to enter that in weblate! Hahahah.

analog bridge
#

We have Invalid %q, not sure if "Invalid %q", MP_QSTR_CIRCUITPY_PYSTACK_SIZE will save space

jaunty juniper
#

the \r has to be a typo 🤷

#

if we take the \n out of all the translated strings, does that have a horrible cost ?

tulip sleet
#

not a typo, it ws to reduce calls to the string writing routine

jaunty juniper
#

how does it do that ?

tulip sleet
#

can you do a multiline message? Just entering newlines? Maybe with ctrl-enter ??

jaunty juniper
#

we can't enter a \r in weblate

tulip sleet
#

never mind the \r's.

jaunty juniper
#

the rest is fine

tulip sleet
#

it has to do with terminal programs that don't do auto CR's

#

on a few terminal programs, just \n will produce something like:

this is one line
                this is another
jaunty juniper
#

oh so instead of "\r\n" it sends just \n then a single \r to reduce bytes ?

#

(aren't \n converted anyway ? or is it higher level ?)

tulip sleet
#

if it is \n\n\r I did not do that deliberately, it's probably a typo. I can fix it later; it will just be in the beta now

jaunty juniper
#

yeah that's what is weird, I didn't see that anywhere else

tulip sleet
#

is it just CIRCUITPY_STACK_SIZE; ok, I think we should have caught that in the review; that was not me. I changed some safe mode printing but I took out the \r's there

orchid basinBOT
manic glacierBOT
manic glacierBOT
glacial haven
#

I've been struggling with supporting animated Gifs through the Gifio library and realized that there are some errors there in the documentation, in the example part. The actual code is:

import board
import gifio
import displayio
import time

splash = displayio.Group()
board.DISPLAY.show(splash)

odg = gifio.OnDiskGif('/sample.gif')
odg.next_frame() # Load the first frame

# THE ABOVE LINE IS WRONG
# face = displayio.TileGrid(odg, pixel_shader=displayio.ColorConverter(input_colorspace=displayio.Colorspace.RGB565))
face = displayio.TileGrid(odg.bitmap, pixel_shader=displayio.ColorConverter(input_colorspace=displayio.Colorspace.RGB565)) 

splash.append(face)
board.DISPLAY.refresh()

# Wait forever
while True:
    # THE ABOVE LINE IS WRONG
    #gif.next_frame()
    odg.next_frame()
    time.sleep(0.1)
blissful pollen
#

I was hoping to write up a quick how-to guide for GIFs but real life has just got in the way the last few days

stuck elbow
#

shouldn't it also be time.sleep(odg.next_frame()) or something similar?

blissful pollen
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

#7644 pointed out the need for better documentation.

To the best of my ability I noted the current behavior. I think that there may be some ports that do not actually read back the 'set' frequency value, but they are ports marked as beta status (mimxrt10xx) or not maintained by us (cxd56).

This isn't to say that we shouldn't improve the implementation, for instance, to make sure that out-of-range values are handled uniformly across ports. I think there's some subtlety to this; for insta...

manic glacierBOT
onyx hinge
#

somebody should make a thing that scans the i2c bus and installs all those packages, circup-style

crimson ferry
#

you don't want to see my heavily-nested i2c address-detection, import, and init attempt code o_O

#

0x77 is particularly nasty

jaunty juniper
#

based on address ? different attempts at getting identification bytes ?

crimson ferry
#

me? just trying to init and seeing what happens, no low-level i2c code currently

#

the thought was that the code could auto-configure and I could plug in anything I own ...mostly it works but there are a few sticky bits

jaunty juniper
#

no, how would you scan I2C and find what's on it without the library and prior knowledge [of a restricted list of hardware], unless Jeff meant the Raspberry Pi hats with EEPROM

crimson ferry
#

yeah, address-only could mean installing half dozen libs or more, and then it still might not be right. yikes, all the configurable address boards with ranges of possible addresses...

#

I've lamented the fact the I2C devices don't easily ID themselves, but SPI is worse, especially dispays w/o miso

#

there was a set of displays with miso that I could ID by the time it took for the init to run O_o ... oops, faulty recollection from 2017 arduino days, it was... checks notes... 0x70-0x77 i2c featherwings (toyed with gpio as spi ID, but clearly unsustainable)

still zephyr
jaunty juniper
#

Wippersnapper does scan and list candidates based on the address

still zephyr
#

That is nice

jaunty juniper
onyx hinge
#

I love it when my bad ideas prompt discussion. 🙂

stuck elbow
#

you can do better, you could develop a magic-like database that not only has the addresses, but also a register to check and the expected value, for the cases where there are multiple devices for the same address

crimson ferry
#

spi displays are 🤷 though, I briefly played with using gpio pins as an identifier for which was wired up (clearly not sustainable) before going with a downloadable config file

stuck elbow
#

spi is generally not suitable for this

#

not enough of a protocol

#

Raspberry Pi had this idea of adding an i2c memory on every official shield, with identifying data and config on it

#

you can use a cheap EPROM chip for this

jaunty juniper
#

yeah not all devices would have some identifiable bytes, but some drivers definitely look for those, I am worried that trying to read it could have an unintended side effect on a device that is not intended for it

spiral elk
#

Being able to distinguish between chips with different address modes (1-byte vs 2-byte) would be fun.

stuck elbow
jaunty juniper
#

if we can assume it's an Adafruit stemma QT breakout, there's probably many cases where we can find exactly what it is

manic glacierBOT
tulip sleet
manic glacierBOT
blissful pollen
manic glacierBOT
#

Inserting a mp_hal_delay_us(1); between asserting the row to its resting value, and turning on the pull resistor, also solves the problem for me.

I'm not really sure where to go from here. Pretty much anything solves the issue on my keyboard. It's a matter of finding a solution that's good enough to upstream for all keyboards, and hopefully puts the issue to bed once and for all. Any ideas?

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.1.0-alpha.2-14-gc2c7b9345 on 2023-02-22; Seeeduino XIAO RP2040 with rp2040
Board ID:seeeduino_xiao_rp2040

Code/REPL

# I am posting the code for Gifio test, but the same problem happens with any use of TFT Display and I2C call at same time...

import board
import busio
import gifio
import displayio
import time
import adafruit_ili9341

dc=board.D5
rst=board.D4
cs=board.D2 #My display does not have it....
manic glacierBOT
manic glacierBOT
#

I hadn't even considered compiler optimizations. I gave your compiler fence a try to no avail -- it ghosts just like a stock CircuitPython build.

I don't know much about ARM but I for good measure I also tried a hardware fence __atomic_thread_fence(__ATOMIC_SEQ_CST); which compiles to a dmb instruction. This also behaves exactly the same.

Man, sleeps/delays feel dirty to me. I was really hoping to come up with a better solution.

jaunty juniper
#

does the Hallowing M0 need paralleldisplay ? Can it even really use it ? The builtin display is SPI.
It has adafruit_lis3dh frozen into but no BusDevice which is kind of weird to have a frozen library require an external library. I was thinking of adding it. There's space for it, though I don't know for all languages...

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I have this problem too, w5500-evb-pico use http_server , not response after 1 minute not have income request. CircuitPython Bundle 8.0.3

Can you provide some code example? How are you accessing your HTTP server? curl? Chrome? Firefox? This error was preety much only visible when using Chrome.

I want to check whether we are talking about precisely the same error.

orchid basinBOT
proven garnet
#

Got rp2040js working with reading RAM usage by imports! I'll bring it up tomorrow, but the question now is HOW to use it (and of course if we want to).

#

The first question is how to check (e.g., should a package be checked for each importable module, or the sum of all it's modules?) and what to do (a PR comment? only if certain thresholds are met?).

#

I think there are other questions but those are easier to answer (e.g., how not to run it for thinks the rp2040 can't run like adafruit_esp32spi).

#

@lone axle you might be interested in this since it builds on your outstanding PR to the cookiecutter regarding mpy filesizes.

#

Apologies in advance if anyone looks - I haven't updated the README yet, but the test workflow shows example usage.

manic glacierBOT
#

The logic of the main loop was changed between version 7 and 8 (Commit). Something is wrong with the existing version 8 logic so the serial write of "soft reboot" is never executed when the user does a soft reboot.
A consequence of this is that tools like tools/pyboard.py, ampy and mpremote are not able to activate the raw REPL since they execute a soft reboot and wait for this to be printed to...

crimson ferry
#

rp2040 can't run like adafruit_esp32spi

#

@proven garnet that should work

manic glacierBOT
proven garnet
crimson ferry
#

with an Airlift wing or similar (really, any ESP32 as a co-processor)

#

M0 is about the only thing that can't run ESP32SPI, due to small RAM

proven garnet
#

Ah, thanks for the clarification!

#

And that's right, I've definitely done the same with an airlift.

manic glacierBOT
manic glacierBOT
#

You are right that doing it with simulate_reset is better. However, just initializing it to false is not correct I think, since it would also print soft reboot at first power up.

I looked a little deeper into the code and I think I have the right understanding of the behavior now. The basic problem was that simulate_reset was initialized to true (correctly), but it never was set to false anywhere. Inside run_code_py, it only ever gets set to true as well (to make a sleep...

jaunty juniper
#

hey my first accidental push to an Adafruit repo \o/

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 8.0.2 on 2023-02-14; Adafruit Feather M4 Express with samd51j19

Code/REPL

# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries
#
# SPDX-License-Identifier: MIT

"""CircuitPython Essentials: PWM with Fixed Frequency example."""
import time
import board
import pwmio

# LED setup for most CircuitPython boards:
led = pwmio.PWMOut(board.LED, frequency=5000, duty_cycle=0)

while True:
    t...
solar whale
#

Just to add some confusion to the day... I wanted to try something on a feather_esp32s3_nopsram so I updated my clone of the repo and build it then flashde it via make BOARD=feather_esps2s3_nopsram flash PORT=/dev/tty.usbmodem<etc>'it flashed OK, but did not boot. I then used the WEB tool to flash the 8.0.3 release downloaded from circuitpython.org and it worked fine... after some head-scratching, I loaded a UF2 bootloader to it (via Arduino) and then loaded my local built .uf2 of the latest repo and it also worked fine. I noted that the Web tool loads circuitpython-firmware.bin while the make loads firmware.bin...is this a problem? Should I be using some other parameters with the make command?

#

I am wrong about the Web tool using circuitpython-firmware.bin ignore that

tulip sleet
solar whale
tulip sleet
#

do an erase first

solar whale
#

ah -- good idea.

#

hmmm -- did erase them reload and it does not boot.

tulip sleet
#

you are resetting, right? It stays in the bootloader until you reset

solar whale
#

yes -- connecting to the board I see ```ESP-ROM:esp32s3-20210327
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x7 (TG0WDT_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x400454d5
SPIWP:0xee
mode:QIO, clock div:1
load:0x3fce3808,len:0x68
ets_loader.c 78
jerryneedell@Mac-mini ~ %

proven garnet
#

I was digging through the core but didn't explicitly see it - but I assume function argument names are stored as qstr right? Also, are variable names within functions stored like that, or just globals?

#

Thinking of tools to track stored strings like these to maybe help optimize

solar whale
#

I reloaded the UF2 bootloader and the firmware.uf2 works fine....

tulip sleet
#

i have no explanation for the .bin not working

#

but glad it's working in some wy

solar whale
#

Thanks -- me too!

manic glacierBOT
tulip sleet
proven garnet
#

Gotcha, I basically want to build a Python tool that will analyze the AST and estimate the size. It came up when talking about const() usage. Hoping to pair it with that RAM analysis check I'm working on.

#

So are local variables stored as interned strings as well?

manic glacierBOT
tulip sleet
proven garnet
#

Ah, thank you! That's also a good page, I forgot it's there but will come in handy for this project.

timid bolt
#

So I've been playing around with the MP3 decoder on my trusty rp2040. Maybe I'm crazy but it seems like the time to decode an mp3 frame varies from build to build. (I.e., it's constant for a single build, but if I change some code and rebuild it can be different.) It varies from 20 to 40 ms. This is significant because the audio length of a frame is 26 ms, so if it takes longer than that to decode, playback effectively doesn't work. Has anyone else experienced this?

tulip sleet
#

especially since the RP2040 uses external flash for everything. I assume you are decoding the same mp3 over and over

#

since I don't think the decode time per frame is constant, it depends on the data

#

you can change the compile flags for just one file. It would be interesting to move it away from -Os for the mp3 decoding file

timid bolt
#

Yes, code layout is what I'd suspect too, but that's really hard to fix 😭 , so I hoping there was another explanation, and/or to confirm other people at least experience non-real-time mp3 decoding.

#

It seems like the decode time is approximately constant time since most of the time is spend doing the inverse DCT, which is same time independent of content. At least that's my working hypothesis.

#

The optimization flags don't seem to have an effect other than altering code layout. Sometimes a -O1 is faster than a -O3 build.

#

Sadly the 64-bit multiply/add instruction isn't available on Cortex-M0+, which seems to be the critical instruction for mp3 decoding.

lethal abyss
#

Hi everyone.
I'm currently working on a port for the Lilygo T-Embed.
So far, I'm able to compile and I started to add specific pins names for example for the screen.
I have many questions of course but the current in my mind is the following: can we add constants to help the user? I'd like to add some constants like the width and height of the screen.
Which file is the proper one?

orchid basinBOT
lone axle
#

I would think that inside of board would be the best place to put extra constants that are helpful for the user based on things that are built-in to a specific piece of hardware as well. Though I don't know of any examples of just generic constants, generally it's holding pin names and initialized buses like SPI, I2C, as well as the display on device with one builtin.

jaunty juniper
#

I don't know, it's not something we do right now, the usual method is more a board helper library in python, which could even be frozen in, as some boards do

slender iron
#

@proven garnet I'd probably avoid AST analysis. I had some scripts that would analyze the contents of RAM that could be useful instead

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Category Channels

8

Text Channels

62

Voice Channels

7

Members

36830

Roles

36

jaunty juniper
lone axle
#

Interesting idea, I don't recall hearing of it before but I do think that seems like a nice bit of helper information.

timid bolt
#

The Adafruit MP3 guide is using low sample rate MP3s. I'd believe that would fix my real-time decoding problem. I must have been incredibly lucky that the first time I did this it worked with "standard" MP3 (44.1 kHz, 16-bit, stereo). But now I am cursed knowing that it can work. 😬

tulip sleet
#

@solar whale @slender iron I have to squeeze the Feather M0 RFM69 board on 8.0.x to get a tiny fix in. ja is overflowing by 20 bytes. Current modules:

#

any suggestions? I might be able to shrink the frozen library, but that is more work

#

there are pins BATTERY and VOLTAGE_MONITOR which are the same, could drop one

#

also various other pin aliases

solar whale
#

That sounds like a great way

#

At some point, should they go the way of the "pirkey" and just stop being updated?

tulip sleet
#

pirkey was never a real product

solar whale
#

I guess it will be problematic to maintain the .mpy's

tulip sleet
#

I can probably shrink the library, I'll take a brief look. I think I did that for rfm9x already

solar whale
#

I just meant that PIRKEY is on the circuitpython.prg site, but only old versions are avaialbe fpr it.

#

I'm sure there are some things that can be done for the library.

#

I don't know if the more recent stuff that added types also made it bigger?

tulip sleet
#

not so much, but there are recent additions to various things in the runup to 8.0.0, and it must have been on the hairy edge of fitting

solar whale
#

rfm9x is building ok?

tulip sleet
#

we have a shrink for main, but I'm reluctant to backport that to 8.0.x

#

yes rfm9x is ok, surprisingly

#

it even has room for rainbowio

solar whale
#

hmm -- hopefully there are some things that never got done for rmf69. I'm surprized it is bigger than rfm9x.

#

Would you like me to look at it?

#

Will just dropping one of the pin names -get you by?

tulip sleet
#

library has stuff in it that checks whether supervisor.ticks_ms() exists. That is a given now, could remove that code

#

i'll look and see when that happened

solar whale
#

That could be simplified a lot if the check is not needed.

tulip sleet
solar whale
#

just have to dig out the boards and make some room on my bench!

tulip sleet
solar whale
#

OK - I'll run some tests in a bit.

tulip sleet
solar whale
#

ugh!

tulip sleet
#

I didn't see any obvious other things to shrink the code significantly, other than to remove functionality

solar whale
#

how much does dropping the extra pin name save you?

tulip sleet
#

I will llok

solar whale
#

getting rid of one of the battery names is a good start

#

can you get a few bytes by shorteining the message here if version != 0x24: raise RuntimeError( "Failed to find RFM69 with expected version, check wiring!" )

tulip sleet
#

nah - it is just namedtuple left in collections anyway

solar whale
#

I have not tried using neopixels much with the m0 -- Is there enough ram to even import the library? -- could neopixel_write be removed?

#

Im sure that would make some folks unhappy..

tulip sleet
#

that's kind of major, i could imagine projects that use the RFM to control neopixels

solar whale
#

yeah -- samw with pwmio and analogio I guess

tulip sleet
#

i can shorten several messages, i'll try that, after the meetings

#

we are saving several hundred bytes in 8.1.0, that should be ok for later

solar whale
#

Nice!

jaunty juniper
tulip sleet
#

i see a little bit of common subexpression elimination as well

solar whale
#
        """Enter idle standby mode (switching off high power amplifiers if necessary)."""
        # Like RadioHead library, turn off high power boost if enabled.
        if self._tx_power >= 18:
            self._write_u8(_REG_TEST_PA1, _TEST_PA1_NORMAL)
            self._write_u8(_REG_TEST_PA2, _TEST_PA2_NORMAL)
        self.operation_mode = STANDBY_MODE

    def sleep(self) -> None:
        """Enter sleep mode."""
        self.operation_mode = SLEEP_MODE

    def listen(self) -> None:
        """Listen for packets to be received by the chip.  Use :py:func:`receive` to listen, wait
        and retrieve packets as they're available.
        """
        # Like RadioHead library, turn off high power boost if enabled.
        if self._tx_power >= 18:
            self._write_u8(_REG_TEST_PA1, _TEST_PA1_NORMAL)
            self._write_u8(_REG_TEST_PA2, _TEST_PA2_NORMAL)
        # Enable payload ready interrupt for D0 line.
        self.dio_0_mapping = 0b01
        # Enter RX mode (will clear FIFO!).
        self.operation_mode = RX_MODE

    def transmit(self) -> None:
        """Transmit a packet which is queued in the FIFO.  This is a low level function for
        entering transmit mode and more.  For generating and transmitting a packet of data use
        :py:func:`send` instead.
        """
        # Like RadioHead library, turn on high power boost if enabled.
        if self._tx_power >= 18:
            self._write_u8(_REG_TEST_PA1, _TEST_PA1_BOOST)
            self._write_u8(_REG_TEST_PA2, _TEST_PA2_BOOST)
        # Enable packet sent interrupt for D0 line.
        self.dio_0_mapping = 0b00
        # Enter TX mode (will clear FIFO!).
        self.operation_mode = TX_MODE
```  we may be to use a function for the `if self._tx_power >= 18`  tests.  2 are identical and one is jsut a different address....
tulip sleet
#

in tx_power(), self.output_power can be fetched once at the top into a variable. That will make all return statements smaller.

#

may help to do a = b = 0 etc some places instead of a = 0; b = 0

#

that kind of thing. we have a 1pm meeting, tty after 2

solar whale
#

ok -- I'll keep looking after lunch

candid sun
#

<@&356864093652516868> we'll be having the meeting about 1 hour from now. please add your notes ahead of time here: https://docs.google.com/document/d/18-Buy1i0z-7l-fJlpYge63EPgbZoqKBTd8YRQOKy9cU/edit#

crimson ferry
#

(not worth immortalizing in the notes, but I'll be afk first half of March... no cell/wifi/internet/MSC/CDC)

solar whale
lone axle
tulip sleet
lone axle
solar whale
lethal abyss
onyx hinge
#

@candid sun if your voice wants a break I can take the libraries section

candid sun
#

that would be excellent @onyx hinge thank you

brazen hatch
#

I am now finally fixing pystack for S3. I am defining hard-limits for every port at it's effective maximum (the point where no more depth can be gained).
Are there #ifdef's for all esp cpus?
I can only see:
CONFIG_IDF_TARGET_ESP32C3
CONFIG_IDF_TARGET_ESP32

slender iron
#

what limits the depth?

#

seems like there shouldn't be a limit

brazen hatch
#

unknown. but increasing the size past some point (differs per port), doesn't make recursion tests to reach bigger numbers

slender iron
#

maybe there is a separate check

brazen hatch
#

Ah, no the stack is allocated alright

#

did a megabyte on s2

#

Currently known:
3.5k S3
3.7k S2
7.0k rp2

#

I haven't tested the rest.

slender iron
#

I wouldn't limit the size you can set pystack too

#

if you have the ram for it

wraith crow
#

I think the S3 limit may be a different barrier than the other boards since the S3 causes a crash

brazen hatch
#

I mean, if it doesn't wield any benefit, why permit more?

slender iron
#

ya, fixing the crash would be good

#

@brazen hatch your test case is pretty specific

#

its possible that larger function frames could benefit from it still

#

figuring out what limit you are hitting now would be good for understanding the new constraint

brazen hatch
#

Ljinux doesn't benefit from larger-than-effective either. And nested commands take 3kb each.

slender iron
#

I don't think you should cap it unless its too big to fit or will cause a crash

brazen hatch
#

Alright

brazen hatch
#

Or else I will have to do it board-per-board

slender iron
#

you want to set a max for s3 to prevent a crash?

tulip sleet
#

@midnight ember could be a cracked solder connection

slender iron
#

@tulip sleet I think we could make any circuitpython board work as a slow debug probe

onyx hinge
#

not sure about the UM Feather S3 but often one of those LEDs next to the USB connector is the charge indicator; without a battery the activity of the charge state indicator can be irregular... (because it's based on the voltage measured from a battery that's not there)...

midnight ember
#

i've rebooted 3 times, restarted the device 50 times, yes, all manner of button sequences attempted.

onyx hinge
#

"jtag" might be the ROM bootloader, if uf2 is not installed on it or not successfully starting...

candid sun
#

yes i've seen jtag as a device before if the uf2 is missing

midnight ember
#

potato camera sorry

ornate breach
#

Potatoes are delicious

midnight ember
#

no more chip shortage song though 😦

#

Used the installer first time today. It seemed to work ok but I had other issues afterward. The actual update was really cool. All the different options might confuse a beginner though.

onyx hinge
midnight ember
#

Even knitting has code? didn't know that.

still zephyr
#

🙂

brazen hatch
slender iron
#

do you understand why it crashes?

midnight ember
#

Looking forward to the M7's zoom zoom.

onyx hinge
#

it'd be nice to understand why on non-crashing systems there's still some kind of soft limit too

thorny jay
#

Thanks for hosting the meeting.

midnight ember
#

Thank you for hosting Liz!

gilded cradle
#

Thanks

onyx hinge
#

otherwise 👻 🪦 it's just spooky 🎃

still zephyr
#

Thanks

slender iron
#

it could be interaction with the c stack limit

onyx hinge
#

thanks liz!

candid sun
#

thanks folks!

errant grail
#

Thanks for running the meeting, Liz!

onyx hinge
#

pystack doesn't mean that a function call uses no C stack memory, just that it doesn't use it for the python objects such as arguments?

slender iron
#

that's my guess

#

but I haven't looked into it

brazen hatch
#

I have no S3 board, so can't gdb it to see.

wraith crow
#

I was wondering if the dynamic pystack allocation was doing something like using the RTC memory and running into the physical limit

brazen hatch
#

I have no jtag dongle even, so can't even debug S2.

#

I have been swd'ing picos for debugging this whole time.

manic glacierBOT
slender iron
#

I generally use ESP_LOG debugging on ESP because it goes out the uart

#

(and crashes usually generate backtraces there)

solar whale
#

@tulip sleet it's been a long time since I submitted a PR -- Do I need to initiate a new release for the rfm69 library or does someone do that routinely? Should we even bother since there is no functional change. it really only impacts the size.

wraith crow
#

As soon as I have some time, I'll try and get a debugging build for the S3 setup and see if I can get a backtrace from the crash

brazen hatch
#

I will in the meantime try to find the #ifdef's for the hard-limit.

candid sun
#

Here is the notes document for next Monday’s CircuitPython Weekly meeting (March 6, 2023). It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Everyone is encouraged to attend! Please add your hug reports and status updates even if you’ll be attending the meeting - it’s super helpful! If you are unable to attend but would still like to include updates, feel free to include them in the notes and we’ll read them off during the meeting. Hope to see you there! <@&356864093652516868>
https://docs.google.com/document/d/1qZcdRI7ho9WyFsDM8X6hhcUYfifnyVcCTaYT_LUTmqk/edit?usp=sharing

tulip sleet
#

@solar whale Thank you! I made a release and I will incorporate it into the 8.0.x PR that was too big.

solar whale
manic glacierBOT
lethal abyss
onyx hinge
#

@lethal abyss add to pins.c { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)},

lethal abyss
lethal abyss
orchid basinBOT
slender iron
#

not sure its what is on my board though...

#

I think it is

tulip sleet
slender iron
#

let me try it

tulip sleet
#

And… it just broke all my USB devices. Have to reboot

slender iron
#

it works fine for me

tulip sleet
#

ok, i am back -- had to boot up another machine to log in over the network to reboot cleanly

manic glacierBOT
slender iron
#

@tulip sleet have you only tried with this one board?

tulip sleet
#

@slender iron I have to update the RFM69 library to shrink the Feather M0 RFM69 build on that PR ^^ to get that board to build. Will get a re-review from you

slender iron
#

@tulip sleet you could try cp on an evk

tulip sleet
#

have to figure out how to get it on the evk

slender iron
#

teensy requires the teensy loader

#

the evk will be more similar to the metro

tulip sleet
#

have you loaded the .bin or gotten the .uf2 bootloader onto the evk? There are lots of jumpers and switches here

#

I never used this

slender iron
#

I probably went straight to swd

#

I've been metroing so far

#

it is tricky with the dip switches

#

have you done teensy before?

manic glacierBOT
tulip sleet
#

yes, but it's been a while

slender iron
#

I can find my evk if you want to try that

tulip sleet
#

i have to look at the doc. Let me finish what I was doing for Erin. this is going to take a while, and I may need to try more than one.

slender iron
#

kk. I'm on ari time so it might need to be tomorrow

tulip sleet
#

I was maybe going to stop soon anywy

slender iron
#

kk, let's regroup tomorrow

tulip sleet
#

i can report to you tomorrow what is working or not, and you don't have to wait around for me

slender iron
#

I still think you should consider the beagle

tulip sleet
#

Maybe yes, but I don't think it

slender iron
#

its pricey but we're going to do more stuff that utilizes hs

tulip sleet
#

's going to help this problem

#

there is an alternative to the beagle, that Thach has, but it might be more pricey

#

I love its diagrams, though

slender iron
#

teledyne?

tulip sleet
#

yah I think so

slender iron
#

may be closer in cost

tulip sleet
#

beagle 480 is $1295, Teledyne USB-TMS2-M02-X is $1305

tulip sleet
#

is that high speed too?

#

they have many models, have to study this

slender iron
#

beagle is what I have

tulip sleet
#

yeah

slender iron
#

so I'd go that way to have the same thing

#

I'd love to use open source analysis software anyway

#

in my fantasy world

#

could I order one of the dell's you have?

tulip sleet
#

choose micro size

slender iron
#

a specific model that matches yours

#

@lone axle are you finishing these 7-color epd drivers for me?

tulip sleet
#

they don't have the exact model, but I have demonstrated the issue on a 3020 with an i5, and a 7060 with an i7

slender iron
#

I think it'd be money better spent for you getting a beagle 480

#

if I get a dell then I have to store it

#

and maintain it

tulip sleet
#

35% coupon. If you could use a solid Windows machine for testing, these are great

#

these a NUC-sized

lone axle
slender iron
#

@lone axle I think they need to be pushed to pypi and bundled

#

I'll look into it

tulip sleet
#

let me just try some more tomorrow with the other boards. For this particular problem, i don't think the Beagle helps

#

you need at least 8th generation to run Windows 11

slender iron
#

I'd assume that linux is resetting due to a tinyusb error

#

and you may be able to see what that error is with the beagle

lone axle
#

Ah, I think they will go automatically to pypi when a release is made.

tulip sleet
#

I turned on logging and Thach looked at the log -- did you see that?

#

he said a READ10 was late in replying

slender iron
#

I saw the discussion but didn't look at the log

tulip sleet
#

he figured it out from the log, he didn't say he needed a trace, and he didn't need the wireshark

slender iron
#

wait, when does this error happen?

#

are you interacting with the drive?

tulip sleet
#

no, the drive doesn't show. /var/log/syslog shows that linux attempts to mount the drive, and read stuff from it, but then it decides to reset

tulip sleet
#

@slender iron 1011 EVK is showing CIRCUITPY, so there is something odd about my other board

#

It has a .bin MSC bootloader. I was just able to copy the .bin to RT1010-EVK MSC device that appears on the debug USB port

#

not sure if changing the switches was necessary or not. The MSC devices always appears

#

the documentation is kind of terrible

manic glacierBOT
manic glacierBOT
#
ide

CircuitPython version

Adafruit CircuitPython 8.0.3 on 2023-02-23; Raspberry Pi Pico W with rp2040

Code/REPL

import ssl

ssl_context = ssl.create_default_context()
ssl_context.load_verify_locations()

Behavior

This code throws: TypeError: can't convert 'NoneType' object to str implicitly

Description

The docs describe cadata as optional and that None is a valid value: https://docs.circuitpython.org/en/latest/shared-bindings/ssl/index....

manic glacierBOT
#
ide

I am interested in using CircuitPython running on a Pico W to serve a small website over HTTPS. The main reason for HTTPS is to enable browser APIs like service workers (good for offline support) and push notifications (useful for IoT).

The good news is it's possible to serve content over HTTPS using a self-signed certificate, shown in this minimal reproducible example. It's about 15 lines of code that does real work. The not-so-good new...

manic glacierBOT
manic glacierBOT
#

This is the code to add the Lilygo T-Embed s3 board.
I followed the Adafruit guides, ran the pre-commit and I hope I was correct on all rules.

This PR was based on espressif_esp32s3_devkitc_1_n8r8 which was already working on that board.
I adujsted the proper amount of RAM and PSRAM
I added pins definitions for all features of the board
I then added display init to ease the usage of the screen attached to this board.

This was tested on two boards and I also tested with [the examples...

slender iron
#

@tulip sleet @onyx hinge why are you changing color conversion stuff in displayio?

tulip sleet
#

we are not; we were looking at gifio

slender iron
#

most SPI displays have a bit in MADCTL for swapping RGB/BGR

#

so my intent was to have a single ordering throughout displayio

tulip sleet
#

gifio converts a frame to RGB565 BE, we were seeing whether LE might be better

#

yes, pyportal has the "reverse bytes" flag true, so we were saying that. it expects LE, gifio outputs be, so the frames need a ColorConverter that is RGB565_SWAPPED (as opposed to RGB565)

#

jeff tried raw writes to the display as well, not going through displayio

#

much faster but expects native byte order that you set up in board.c

#

so we are not changing gifio's output now, we'll just document it needs RGB565_SWAPPED for now, and maybe add an optional arg to specify order later

onyx hinge
#

@slender iron yes madctl can swap R and G, but this is about the order of the 2 bytes that hold the full 16 bit color value

slender iron
#

ah, ok

onyx hinge
#

as far as I could see this is NOT settable it's always big-endian on st7789 and ili9mumble displays used in spi mode. it might be settable for displays in 8-bit mode, not sure, I saw some small indication of it when browsing the st7789 manual

solar whale
#

@slender iron how do you load the bangle2 build into the bangle2?

slender iron
#

@solar whale using nrf connect to load the dfu

#

you can also use swd if it comes to it

#

nrf connect on ios hasn't worked reliably for me. it has been good on android

solar whale
#

ok so just use nrf connect and load the .bin file or does it produce some special files?

slender iron
#

there should be a zip

solar whale
#

ah great. i’ll give it a try later today .

slender iron
#

it is secure dfu (but they publish the private key)

solar whale
#

i’ve had mixed success with IOS as well. i have an android phone just for this purpose!

slender iron
#

they did just redo the ios app. I meant to test it more

tulip sleet
#

@slender iron EPaperDisplay says the terminal is shown if the root_group is None, but do you show the terminal on epaper? I thought it would be refreshing the display too fast.

#

I think maybe that is just copy pasta

#

(I was writing deprecation notes for show()

slender iron
#

it will show it but not auto-refresh

tulip sleet
#

got it thanks, wasn't sure where to look

solar whale
#

i’ll try the bangle 2 when i get home this afternoon . i’ll probably have more questions then…

slender iron
#

main does the refresh manually after code is done

#

thanks @solar whale. I should be around until 3:30 pst at least

#

(then I'm gone when the baby wakes from his nap)