#circuitpython-dev

1 messages Β· Page 403 of 1

manic glacierBOT
#

This will enabled I2C power after a hard reset, but will not change the pin state after a soft reload. For that we would add it to reset_board().

So if you disabled power in boot.py by setting the pin high, it will stay high. Maybe this is what we want. If we moved pin setting to code.py, it would get changed every time code.py started.

I think that makes sense. It is similar to the CPB, which also turns off stuff on hard reset, but doesn't adjust it on each soft reload.

This fix...

#

CircuitPython version

7.0

Code/REPL

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

You are in safe mode because:
CircuitPython core code crashed hard. Crikey!
Crash into the HardFault_Handler.
Please file an issue with the contents of your CIRCUITPY drive at
https://github.com/adafruit/circuitpython/issues

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

Behavior

need to get out of the safe mode

Descriptio...

manic glacierBOT
#

Tested on both BlueMicro833 and PCA10100 - two nRF52833 boards.
I both flashed the latest bootloader and then the UF2 from this PR.
Both loaded up fine.

I also tested loading a prior build UF2 onto the new bootloader and it simply refuses to load - as expected.
I also tested loading a feather840 express from this build on a feather840 and that still works as expected.

Unless there is something else that need checking, I believe this can be merged in without any issue

robust quartz
#

Hi I fork the circuitpython, add a new board and generate successfully, right now I have problem on this step , there are many "board" list below the "matrix" line, I don't know which one is, could anyone help please

lunar gull
tulip sleet
#

I have deleted that section in the guide.

manic glacierBOT
robust quartz
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
tulip sleet
#

@lone axle thanks for being around, all this isn't urgent, but may as well get the merges built

manic glacierBOT
#

This is the pretty much the same as #5776, but is a PR against 7.1.x instead of main. I read the code and could not understand why it didn't work, and after trying it myself, I was unable to repoduce the D7 in use message.

@ladyada, could you test, in your own way? I was using this, with the DigitalInOut commented out and not.

import time
import board
import digitalio
import adafruit_bme280.basic

# Test with and without this.
# power = digitalio.DigitalInOut(board.I2C_...
manic glacierBOT
#

I'm not sure about this change. Specifically, I think it may behave differently when merged to main, where we've taken

and specifically fae6d47a458778797a10a6fdcc7d3f6b3be77d12 where we now ensure that a "never reset" pin continues is marked as "in use" after reset_all_pins().

This was needed to resolve a problem where the state of a displayio backlight pin was lost over soft resets.

manic glacierBOT
#

and specifically fae6d47 where we now ensure that a "never reset" pin continues is marked as "in use" after reset_all_pins().

This is true only on espressif. As another example, something similar is done for CPB, so we might want to be consistent across ports.

I think never_reset is being overloaded with responsibilities. Maybe we need to separate "never reset" and "never allocate".

manic glacierBOT
manic glacierBOT
#
[adafruit/circuitpython] New tag created: 7\.1\.0\-rc\.1
tulip sleet
proven garnet
#

What a gift!

timber mango
#

@tulip sleet i gave circuit python a try. and omg it's so much better than programming in

timber mango
#

ardiuno

#

oops

tulip sleet
#

Thanks for compliment! It is our goal to make it a lot easier.

mental nexus
#

As the days start to get longer, it’s a good time of year to count blessings, just wanted to express my gratitude to Adafruit and the CircuitPython development team and extended CP library developer/sample code community. While software and hardware sometimes are solitary activities, it’s always nice to connect with kind and welcoming folks willing to lend a hand. That makes each of us better and helps us all grow. Many thanks y’all!

tulip sleet
#

You're welcome, and thank you for being a great member of the community!

manic glacierBOT
#

I've been seeing this with my builds from 7.1.0-beta.3-174. Just adding my observations in case they provide any clues.

I've been tracking a memory leak in my python application which involves running the app for several hours. My code is constantly reading from flash and I've run several times for 2 or 3 hours when connected via UART without hanging.

When I've tried to run the same tests connected via the serial USB connector the PI Zero 2W has suddenly frozen at seeming random points.

manic glacierBOT
orchid basinBOT
teal thorn
#

What is the cleanest CircuitPython port to use as a template for a new port?

tulip sleet
teal thorn
#

NXP mcux-sdk. I know there is a mimxrt port. I'll use some of that, but I want to follow the best structure for supporting several families.

tulip sleet
# teal thorn NXP mcux-sdk. I know there is a mimxrt port. I'll use some of that, but I want ...

All the current examples are compromises in one way or another when it comes to incorporating a HAL layer like the sdk you pointed to:
atmel-samd: we had to use a snapshot of a HAL dump from https://start.atmel.com for ASF4. ASF3 was easier: we just used the sdk zip files.
STM: some HAL stuff is just copied
nrf: we use the nrfx low-level HAL, but not the nrf SDK. We had to patch nrfx a bit, and we have our own fork. In addition we use the SoftDevice
espressif: we use their SDK, which requires special build setup
RP2040 ("raspberrypi"): perhaps the simplest: we are using the pico-sdk, but there is some hackery to get the compile to work

#

In general most of the low-level modules are similar and atmel-samd, nrf, and rp2040 are all good examples. STM is a bit worse because the chips vary a lot, with minor but annoying differences between two similar chips

#

It also depends on where the firmware is stored. i.MX is tricky because it's all external flash. Same for RP2040 but a little easier. Which NXP chips are you thinking about?

#

this MCUXpresso SDK Builder looks like start.atmel.com a bit: you customize and download it. That can make it difficult to merge in fixes from upstream unless you set up automation to do that consistently. Ideally create a new separate repo with the SDK in it that you can update as needed. Then we included it as a submodule.

teal thorn
#

NXP posted the SDK to GitHub so we can submodule it. The API's are mostly universal, but there are some build differences, especially for parts with external flash. We've already got three families in TinyUF2, so I'll probably start with those.

tulip sleet
#

Which chips do you have in mind for this? i.MX, or simpler ones?

orchid basinBOT
teal thorn
manic glacierBOT
robust quartz
#

Hi I build the program is working on my dev, and I check the error, there is the UNIX board problem and I did not do any change to that board, please give some advice. thank you.

manic glacierBOT
#

This simplifies the pair of calls mp_get_buffer_raise + normalize_buffer_bounds into a single call. It also lays the groundwork for the element size to be used in normalization, so that e.g., if you work with an array of 16-bit values, write(buf, start=3, end=9)
will work in 2 byte chunks, just like write(buf[3:9]).

However, the latter part of the change is not enabled yet, it's just that the place it would need to be done is centralized by this change.

This change also saves 104 b...

viscid pine
#

so nothing to do with your changes

robust quartz
#

umm .. how to fix this case.

#

should I resubmit the pull request

viscid pine
#

i believe it doesn't matter, the devs can merge it anyway if they see it's an unrelated error

robust quartz
#

meke sense, thank you @viscid pine
wait for the good news

warm stump
#

4 different ports of python:
Top Left: avr8 LUFA USB-to-Serial with micropython embedded
Bottom Left: avr8 LUFA USB-to-Serial (no python, fits in 16KB)
Middle: Micropython Debian x64 Unix Minimal Port
Right: CircuitPython 7.0.x Adafruit Macropad RP2040 Port

warm stump
#

quite unbelievably 7.0.x worked on the macropad, but I did have to do the following:

sudo apt-get install git build-essential make gettext python3 python3-pip python3-jinja2
sudo pip3 install --upgrade pip
sudo pip3 install huffman
sudo git clone https://github.com/adafruit/circuitpython cp7
cd cp7
sudo git checkout 7.0.x
sudo git submodule init
sudo git submodule update --recursive
sudo make submodules BOARD=adafruit_macropad_rp2040
sudo make BOARD=adafruit_macropad_rp2040
cd build-adafruit_macropad_rp2040
sudo cp -rf ./* /mnt/d/cpy-debian-macropad/ #from Debian WSL
manic glacierBOT
#

Thanks!

There's actually a problem with this code that I'll report in a new issue, which could affect frozen-in modules that actually use long ints. It affects raspberrpi, mimxrt10xx, and now broadcom ports. However, this change should still be enough to allow long ints to be used in code.py and modules installed to lib/ whether in mpy format or not. Only frozen-in modules would be affected.

onyx hinge
manic glacierBOT
#

While reviewing

  • #5774
    I noticed that MPY_TOOL_LONGINT_IMPL is not being set correctly, because it depends on the value of LONGINT_IMPL being set earlier in the file.

The problem is that the setting of LONGINT_IMPL is after it use in the ifeq lines. This means LONGINT_IMPL is treated as empty at line 5, 9, and 13 and so none of the -mlongint-impl lines are taken.

The consequence of this is that if there are frozen files (there aren't, in these ports) _and they use lo...

#

The github repo admins can re-trigger the job - sometimes github actions has issues and a re-trigger clear things up. Alternately, there might be a change that happened in main that is in conflict. Considering this is a simple new board, I doubt this is the case.

Other than that, the changes look good for me! My boards are on their way and will be using this relatively soon! Thanks for the PR.

#

The recent updates to the bootloader and builds for the nRF52833 have resolved this.

If you encounter this issue, make sure you have the latest bootloader on your nRF52833 device as well as the latest CircuitPython build.

I suspect that the root cause of the problem is that the softdevice that was part of the bootloader was not at the version that was needed by Circuitpython. Now that this is resolved, I doubt we will see this again.

thorny jay
#

Oh, it is Monday again already. I have done nothing meaningful or really useful this week. I tested 7.1.0RC on Matrix portal and used a learn guide to display CO2 level during Xmas evening. I had one fight with circup and could not solve it, I guess something is broken, because of 7.1 so I had to update the library manually, but everything worked find. One thing I also noticed is that candle in the room do increase the CO2 level a lot, and this is not a good indicator that the room need ventilation... so it did not work as expected.

#

I don't think I am going to fill the doc. Hug report to all the contributor of CP core, library, documentation, learn guide.

tulip sleet
thorny jay
manic glacierBOT
tulip sleet
#

Reminder that we are having a regular CircuitPython Weekly Meeting today in #circuitpython-dev and the CircuitPython voice channel. We expect light attendance due to the holidays. Don't feel obligated. It is at the normal time of 11am Pacific / 2pm Eastern here on Discord. Here is the notes document for Monday’s CircuitPython Weekly meeting. 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.<@&356864093652516868>
https://docs.google.com/document/d/1NBK5WWMLkzOm3BYvKe3zdyLp1Z5S5DQfyDGdEudic5w/edit?usp=sharing

manic glacierBOT
onyx hinge
#

I have a phone call to make, I may be a tiny bit late joining the meeting.

idle owl
#

@tulip sleet I made the new folks in the State of section bold for you.

meager fog
#

woohoo

#

πŸ‘‹

onyx hinge
#

hmmmm google docs autocompletes "January 3," with "2021". πŸ˜•

river quest
#

hi hi folks, thanks @tulip sleet for kicking it off and DJing today! (pt here - in the @river quest account)

timber mango
#

can i get that role please.

onyx hinge
#

The calendar is up to date for the 2022 meeting schedule, and can be used online or in a variety of calendar apps included google

idle owl
timber mango
#

thanks!

meager fog
#

hiiiiiii

river quest
#

hi hi

turbid radish
#

Giving Anne a break

tulip sleet
idle owl
#

😊 I did!

tulip sleet
onyx hinge
#

insert pastry, receive pcb ?

river quest
#

258!

meager fog
#

hihi

idle owl
#

πŸ‘‹πŸ» Later!

river quest
#

cheers!

blissful pollen
#

Great to have you stop by

idle owl
#

Oh foamyguy is here!

lone axle
idle owl
#

@lone axle I'll leave it to you!

onyx hinge
tulip sleet
blissful pollen
#

is that my PR? If so I should really get to updating it asap. Probably not much work

onyx hinge
idle owl
#

Really if it's being worked on, it's fine. I'm more concerned about the ones that are stagnant, or missed, etc.

meager fog
#

hug reports to everyone! i gotta go work on some hardware πŸ™‚

#

byyyye

idle owl
#

Yes!

#

Thank you!

onyx hinge
#

Thanks & see you next year!

errant grail
#

Thanks!

solar whale
#

πŸ‘‹

onyx hinge
#

interesting, if you with NeoPixel(...) as n: ..., the pixels all get blanked at the end of the with-statement. Same if .deinit() is called, but not if you run to the end of code.py.

blissful pollen
#

Is .deinit() not ran at the end of code.py then? Or (just a guess) does the VM clear all the objects but then deinit pin steps (like clearing the pixels) isn't ran?

onyx hinge
#

seems like.

tulip sleet
#

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

meager warren
viscid pine
#

I couldn't even get __del__ to run for classes defined in python

#
import gc

class X:
    def __del__(self):
        print("Del was called")

print("Creating a new X")
my_x = X()
print("Trying to delete X")
del my_x

while True:
    gc.collect()
#

it does seem to run for native classes though

manic glacierBOT
#

new utility function for all vectorio shape specializations for testing
whether a screen-space x,y point falls within a shape's x,y.

This respects the current orientation of the screen in the manner of
displayio and vectorio - so your x,y requests are in the same coordinate
domain as your x,y locations and your width/height etc. properties that
ou set on other shapes. I.e., if you're using this for touch points then
you will need to make sure the touch events are in the same x,y domai...

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Category Channels

8

Text Channels

61

Voice Channels

6

Members

32364

Roles

36

manic glacierBOT
manic glacierBOT
teal thorn
manic glacierBOT
#

The stubs for adafruit_bus_device are wrong. The classes I2CDevice and SPIDevice are currently generated in adafruit_bus_device/__init__.pyi, as if they are imported like from adafruit_bus_device import I2CDevice.

Those classes are actually in their own packages and are imported like from adafruit_bus_device.i2c_device import I2CDevice. This pull request fixes it by moving the C files to i2c_device and spi_device directories.

main furnace
#

When I run the latest build from S3 (pybadge-en_GB-20211228-ea638c0) os.uname().version thinks it is "7.1.0-rc.0-189". I was expecting it to be "-rc.1".

tulip sleet
manic glacierBOT
#
[adafruit/circuitpython] New tag created: 7\.1\.0
spiral elk
#

Is the 7.1.0 website update also going to update the tinyuf2 link template to reflect the 0.70 release from yesterday? Because as of now they're still pointing to 0.52, which doesn't exist for some newer boards.

tulip sleet
spiral elk
#

Just wanted to nudge in case it hadn't been noticed

tulip sleet
#

np, we appreciate the reminder. We were trying to figure out how to automate that, but it's easy to update manually.

manic glacierBOT
#

Hmm FYI -- with the latest build of CP, I am not seeing the corruption (at least not immediately) and My Pi 4B is booting normally

Adafruit CircuitPython 7.1.0-rc.0-189-gea638c040 on 2021-12-28; Raspberry Pi 4B with bcm2711
>>> import os
>>> os.listdir()
['.fseventsd', '.metadata_never_index', '.Trashes', 'code.py', 'lib', 'boot_out.txt']
>>> 

This is without removing the cal to RESET all pins.

orchid basinBOT
manic glacierBOT
#

When the Pins are reset in
https://github.com/adafruit/circuitpython/blob/main/ports/broadcom/common-hal/microcontroller/Pin.c#L53
for the JTAG pins 22-27, the Pins it set to ALT4 then it returns without setting a PullDOWN.
Looikng ar the Datasheet, these pins are listed as having pull-downs.

Sould the be set here?

It seem sot be working as it and it and I f set them as Pull-down it still works. I'm just curious if they should be set .

here is the change I made to test it.

d...
tulip sleet
#

@spiral elk ^^

main furnace
#

Adafruit CircuitPython 7.1.0 on 2021-12-28; Raspberry Pi Zero 2W with rp3a0

#

Working over uart. It loads code.py from the SD card! πŸŽ‰

manic glacierBOT
tulip sleet
main furnace
#

zero2w: Tried USB tether, not working.

#

@tulip sleet I'll give 7.2.0 a try when it's available. Next up: feathers2.

solar whale
manic glacierBOT
main furnace
#

7.1.0 looks good on pybadge.

solar whale
#

actually -- zero2w boots from the SDCard, but the File system is not accessible....

main furnace
#

😦 Wonder how that is different from the 7.1.0 release. I boot from SDCard and have file system access (uart console, not connected via USB otg).

#

7.1.0 looks good on UnexpectedMaker FeatherS2.

tulip sleet
solar whale
#

works for me as well -- I think there have been lot of changes in main --- not sure what broke

#

Also did not like having the USB port connected....

thorny jay
# tulip sleet https://blog.adafruit.com/2021/12/28/circuitpython-7-1-0-released/

Oh, I was starting to upgrade all my board to RC1 (I only did FeatherS2) and circup was telling me about a new version C:\Users\MediaMonster>circup list Found device at D:\, running CircuitPython 7.1.0-rc.1. A newer version of CircuitPython (7.1.0) is available. Get it here: https://circuitpython.org/board/unexpectedmaker_feathers2 and I was super confused because I checked twice. So I was in the time frame where the json file was updated but not all the binary available. It is actually a good news as upgrading things like the STM32 is a pain, and I prefer not to do it for RC version.

tulip sleet
#

the GitHub release happens before the builds are done, which is a couple of hours later. I wish it were smoother, but I'm not sure there's an easy way

thorny jay
#

I even checked the S3 to see if it was the website not updated.

#

I got the final hint by checking my email and the message saying you were waiting for the build to finish.

#

I guess there is no good order and I was just super unlucky but very happy it happend right now.

thorny jay
#

Oh the Twitter message was 22 minutes ago. It just say "CircuitPython 7.1.0 Released!"

orchid basinBOT
tulip sleet
orchid basinBOT
thorny jay
#

Upgrade still in progress, maybe circup was confused by my Feather M0 Express board that was still in 6.2.0-rc.0. After upgrading to 7.1.0 everything is normal. Here is the error message: >circup list Found device at D:\, running CircuitPython 6.2.0-rc.0. A newer version of CircuitPython (7.1.0) is available. Get it here: https://circuitpython.org/downloads There was a problem: '6mpy'

tulip sleet
thorny jay
#

I should be fine, I totally removed every copy of Python on my PC and re-installed the latest of everything. >circup --version CircUp, A CircuitPython module updater. Version 1.0.3

manic glacierBOT
tulip sleet
#

@slender iron I am preparing a 7.2.0-alpha.1 release. Merge anything you want to be in it.

slender iron
#

@tulip sleet I'm just getting my work brain back. A 7.2 alpha is a good idea

manic glacierBOT
#

I spent some time last week on this and didn't get very far. I did see two things:

Pi4 is unreliable at startup. Before and after the clock frequency change it reads the SCL (IIRC) register that is basically an ID. If it reads wrong after the clock change, then it'll fail init. If it fails init, then no CIRCUITPY drive will exist. The weird part is that the read before the clock change appears to fail, not the one after. The one after is usually the correct value.

2W actually fails to...

manic glacierBOT
onyx hinge
#

https://pypi.org/project/circuitpython-stubs/#history Iooking at pypi releases of circuitpython-stubs, it appears that they are mis-described. Our CI has versions uploaded from releases and from the latest builds on the main branch. The latest non-released one went in as "7.1.0rc1.dev201" even though it's from main and should say something involving "7.2". Since we use setuptools_scm to get the version number, it's probably the old thing where git describe does surprising things because it uses a heuristic if there are multiple tags reachable from the named commit by different merges: ```shell
$ git fetch --tags origin; git describe --tags origin/main
7.1.0-rc.0-201-g3bc48802b

#

git describe --first-parent --tags works better right this second, because the 7.1.0-rc.0 tag is visible due to a merge, which makes it not a first-parent of the current tip of master, and there's a sneaky way to modify what setuptools_scm uses. I don't know if this is guaranteed to be the case always, but it seems like it (we create a current tag directly on main, but it gets other commits in its history due to merges only)

#

this apparently also affects builds of circuitpython, where they show the version string internally: ```shell
$ git checkout origin/main
$ cd ports/unix && make && ./micropython
MicroPython 7.1.0-rc.0-201-g3bc48802b-dirty on 2021-12-28; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode

#

s3 object names don't give a tag-derived string so they're things like .../adafruit-circuitpython-espressif_esp32s3_devkitc_1-en_US-20211228-3bc4880.bin and it doesn't make a difference (except to humans who want to tell the difference between a 7.1 and a main build from s3)

#

as a two-step process you can find out what tag is "the highest in version numbering, according to git's internal algorithm" and then get the describe from that: ```
$ BEST_TAG=$(git tag --sort=-v:refname --merged HEAD "[0-9]*" | head -1); git describe --tags --match "$BEST_TAG" HEAD
7.2.0-alpha.0-265-g3bc48802b

orchid basinBOT
#

On second thought, I think a more detailed discussion on the family/chip is needed...

As of now, the following families are in place:

  • Atmel-Samd
  • Cxd56
  • Esp32c3
  • Esp32s2
  • Esp32s3
  • Litex
  • Mimxrt10xx
  • Nrf52840
  • Raspberrypi
  • Stm

However, if we really want to make this right, we would need to change "nrf52840" to "nRF52" since the nrf52840 is a specific chip, not a whole family. If we want to get down to the chip details, we would need to have SAMD21 and SAMD51 as th...

viscid pine
#

That's on me, i hit a problem with uncrustify from apt being to old and I didn't bother fixing it

orchid basinBOT
#

Automated website update for release 7.2.0-alpha.1 by Blinka.

New boards:

  • raspberrypi_cm4
  • espressif_esp32s3_box
  • espressif_esp32s3_devkitc_1
  • espressif_esp32s3_devkitc_1_nopsram
  • bluemicro833
  • Seeed_XIAO_nRF52840_Sense
  • jpconstantineau_pykey18
  • jpconstantineau_pykey87
  • pimoroni_tiny2040_2mb
  • jpconstantineau_pykey44
  • seeeduino_xiao_rp2040
  • odt_cast_away_rp2040
  • sparkfun_stm32_thing_plus
tulip sleet
robust quartz
#

Hi I made a pull request on the circuitpython-org, please check it. thank you.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.2.0-alpha.0 on 2021-12-03; Raspberry Pi Zero 2W with rp3a0

Code/REPL

import board
import displayio
import vectorio

display=board.DISPLAY
splash=displayio.Group()
# background?
palette=displayio.Palette(1)
palette[0]=0xFF00FF
circle = vectorio.Circle(radius=24,x=display.width//2, y=display.height//2, pixel_shader=palette)
display.show(splash)
splash.append(circle)

Behavior

You see a black ...

onyx hinge
#
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.108.133, 185.199.111.133, 185.199.110.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 503 Egress is over the account limit.``` hum github says github transferred too much data πŸ˜• and a build failed
manic glacierBOT
#

Depending on the specific history of tags and commits, sometimes a commit from "main" would identify as being relative to "7.1.0" and not "7.2.0":

$ git checkout 3bc48802b
$ git describe --tags HEAD
7.1.0-rc.0-201-g3bc48802b
$ git tag --merged HEAD --sort=v:refname "[0-9]*" | tail -1
7.2.0-alpha.0

This is due to git describe preferring recency over other criteria. There's no way to directly influence this in git describe, but git tag can do so. When a maintenanc...

#

CircuitPython version

Adafruit CircuitPython 7.1.0 on 2021-12-28; Adafruit Feather RP2040 with rp2040

Code/REPL

import alarm
import board
import digitalio
import neopixel
import time

np = neopixel.NeoPixel(board.NEOPIXEL, 1)

# Off for 1 second
np[0] = (0,0,0)
time.sleep(1)

if alarm.wake_alarm is not None:
    # red if woke from sleep
    np[0] = (50,0,0)
else:
    # blue if not woke from sleep
    np[0] = (0,0,50)

# Create a an alarm ...
#

Testing on a feather m4 with busio spi. I placed a jumper wire between MOSI and MISO.

Before the change:

Adafruit CircuitPython 7.1.0-beta.0-153-g27e8a16bf-dirty on 2021-12-01; Adafruit Feather M4 Express with samd51j19
>>> 
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
bytearray(b'0123456789:;<=>?') bytearray(b'0000000000000000')
bytearray(b'0123456789:;<=>?') bytearray(b'0000000340000000')

After...

onyx hinge
#

we don't have a facility for issuing warnings, do we.....? In this new get_normalized_buffer_raise we could print a warning if the element size wasn't 1 byte, so users have a chance to understand their code will break...

solar whale
#

Are you warning of an upcoming breaking change?

#

like a deprecation warning?

#

I guess I'm asking why this is different from other breaking changes?

onyx hinge
#

like a deprecation warning

#

context is that pr 5781 linked above

tulip sleet
#

I think deprecations are difficult because they can generate a lot of output, and/or the output will never be seen. I think it's just better to error out with a message. We can do that on a version boundary

onyx hinge
#
data = array.array('H', range(16))
with ... as spi:
    spi.readinto(data, start=3, end=5)

In this case, we're considering changing the meaning of this so that it actually operates on data[3:5] (two 16-bit values) instead of 2 bytes... so there's nothing "to make into an error", unless we want the "data is not a bytes" case to be rejected for a whole version before we enable the new behavior.

onyx hinge
#

(full disclosure: I'd rather update the docs to say that all these functions use byte indices and ignore the actual data type)

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

The solution they presented to store the microcontroller temperature in a file does not work. Although it was written in the boot.py storage.remount("/", FALSE), it does not work in a cyclic way, it does it only once, that is, it only saves the temperature once. I wonder how to solve this problem?
The solution they presented to store the microcontroller temperature in a file does not work. Although it was written in the boot.py storage.remount("/", FALSE), it does not work in a cyclic way,...

vague thicket
#

@slender iron may I ask where do you parse (if you do so) config.txt for broadcom port? I would like to look how you do it and try to figure out how to pass display resolution to framebuffer from it, so I can set resolution for HDMI displey. Thanks

manic glacierBOT
#

I tested the functionality successfully on a pyportal with this test script:

import board
import vectorio
import displayio

display = board.DISPLAY
main_group = displayio.Group()

_palette = displayio.Palette(1)
_palette[0] = 0x4400dd
_palette2 = displayio.Palette(1)
_palette2[0] = 0xaa3344

# rectangle = vectorio.Rectangle(
#     pixel_shader=_palette,
#     width=200, height=100,
#     x=10, y=10)
# main_group.append(rectangle)

circle = vectorio.Circle(
    pixel...
#

Although it was written in the boot.py storage.remount("/", FALSE), it does not work in a cyclic way, it does it only once, that is, it only saves the temperature once. I wonder how to solve this problem?

Booleans notwithstanding, that is to be expected, open(...,"wr") will truncate the file, so you overwrite it with the last temperature every time. You want "a" for append.

manic glacierBOT
timber mango
#

unfortunately it doesn't work, do you have more examples of how to save files in circuitpython?

manic glacierBOT
timber mango
#

no unfortunately I added the delay time, and it doesn't record, I think it has to do with the while True, when there is no loop it works, but I need a loop to save the information.

slender iron
#

you need to reinit the display to get a different frame size

vague thicket
# slender iron CP doesn't parse config.txt

Ok, I thought it does as "enable_jtag" was not familiar to me from Raspbian OS. Reinit? How can I do that? Do I need to recompile CP for that or can I do that when CP is running? Thanks πŸ™‚

slender iron
#

its within CP

#

I'm looking for an example

#

first is displayio.release_displays()

#

import videocore

#

fb = videocore.Framebuffer(width, height)

#

import framebufferio

#

display = framebufferio.FramebufferDisplay(fb)

#

I think that's right

vague thicket
#

Ok, many thanks. πŸ™‚ I will try that.

onyx hinge
slender iron
wraith crow
#

@slender iron fb=videocore.Framebiffer(60,17) returns ValueError: no fb

slender iron
#

60 and 17 seem too small

#

that should be pixels

#

like 640, 480

wraith crow
#

LOL oh pixels

slender iron
#

πŸ™‚

wraith crow
#

Nice! 1024x480 works on my display

vague thicket
#

800x480 for me with this (https://www.waveshare.com/wiki/5inch_HDMI_LCD) LCD πŸ™‚ IΒ΄m using latest alpha version if 7.2.0 and I noticed that if I have this LCD plug in to the RPi 4B it will not boot up properly and it stuck at rainbow screen. I guess that there is some SPI communication which is blocking boot. Otherwise I have to say, that I did not have problem with SD card corruption. I can eject CP drive, reboot it and it is still working.

manic glacierBOT
#

Thank you @dhalbert and everyone for everything, I couldn’t get CircuitPython’s HID to work with my KVM either, due to the needed boot keyboard protocol. Special shout-out to @obra and the boot keyboard descriptors in https://github.com/keyboardio/KeyboardioHID, I used it to modify (slightly) the boot descriptor dhalbert graciously provided for a related issue https://github.com/hathach/tinyusb/issues/1129#issuecomment-937756019, and now it works with my KVM!

CP 7.1.0 rc1 on a Feather Ex...

manic glacierBOT
#

@retrospecced Thanks for reporting this. I compared your descriptor above with the one I referenced, and here are the diffs. Your changes are on the right hand side. See the | in the middle which marks the changed lines.

0x05, 0x01,        // Usage Page (Generic Desktop Ctrls)	0x05, 0x01,        // Usage Page (Generic Desktop Ctrls)
0x09, 0x06,        // Usage (Keyboard)				0x09, 0x06,        // Usage (Keyboard)
0xA1, 0x01,        // Collection (Application)			0xA1, 0x01,        //...
ornate breach
#

hey @tulip sleet are you around?

tulip sleet
#

yes, though not for long πŸ’€

ornate breach
#

have you had any issues building ESP32-S2 boards?

#

I've been getting issues on the auto_display_resources part of the build

#

i'll grab you the exact error i'm getting

tulip sleet
#

nope, as long as espressif/esp-idf is up to date. We changed versions around the 7.1.x/main split, so did you update the submodules?

ornate breach
#

i did

tulip sleet
#

ga and paste the error

ornate breach
#

i merged in latest on my circuitpython fork and pulled that down

#
../../extmod/ulab/code/numpy/approx/approx.c: In function 'approx_interp':
../../extmod/ulab/code/numpy/approx/approx.c:61:24: error: too few arguments to function 'ndarray_from_mp_obj'
     ndarray_obj_t *x = ndarray_from_mp_obj(args[0].u_obj);
                        ^~~~~~~~~~~~~~~~~~~
In file included from ../../extmod/ulab/code/numpy/approx/../../ulab_tools.h:14,
                 from ../../extmod/ulab/code/numpy/approx/approx.c:21:
../../extmod/ulab/code/numpy/approx/../../ndarray.h:201:16: note: declared here
 ndarray_obj_t *ndarray_from_mp_obj(mp_obj_t , uint8_t );
                ^~~~~~~~~~~~~~~~~~~
../../extmod/ulab/code/numpy/approx/approx.c:62:25: error: too few arguments to function 'ndarray_from_mp_obj'
     ndarray_obj_t *xp = ndarray_from_mp_obj(args[1].u_obj); // xp must hold an increasing sequence of independent values
                         ^~~~~~~~~~~~~~~~~~~
#
                 from ../../extmod/ulab/code/numpy/approx/approx.c:21:
../../extmod/ulab/code/numpy/approx/../../ndarray.h:201:16: note: declared here
 ndarray_obj_t *ndarray_from_mp_obj(mp_obj_t , uint8_t );
                ^~~~~~~~~~~~~~~~~~~
../../extmod/ulab/code/numpy/approx/approx.c:63:25: error: too few arguments to function 'ndarray_from_mp_obj'
     ndarray_obj_t *fp = ndarray_from_mp_obj(args[2].u_obj);
                         ^~~~~~~~~~~~~~~~~~~
In file included from ../../extmod/ulab/code/numpy/approx/../../ulab_tools.h:14,
                 from ../../extmod/ulab/code/numpy/approx/approx.c:21:
../../extmod/ulab/code/numpy/approx/../../ndarray.h:201:16: note: declared here
 ndarray_obj_t *ndarray_from_mp_obj(mp_obj_t , uint8_t );
                ^~~~~~~~~~~~~~~~~~~
../../extmod/ulab/code/numpy/approx/approx.c: In function 'approx_trapz':
../../extmod/ulab/code/numpy/approx/approx.c:160:24: error: too few arguments to function 'ndarray_from_mp_obj'
     ndarray_obj_t *y = ndarray_from_mp_obj(args[0].u_obj);
#
                 from ../../extmod/ulab/code/numpy/approx/approx.c:21:
../../extmod/ulab/code/numpy/approx/../../ndarray.h:201:16: note: declared here
 ndarray_obj_t *ndarray_from_mp_obj(mp_obj_t , uint8_t );
                ^~~~~~~~~~~~~~~~~~~
../../extmod/ulab/code/numpy/approx/approx.c:177:13: error: too few arguments to function 'ndarray_from_mp_obj'
         x = ndarray_from_mp_obj(args[1].u_obj); // x must hold an increasing sequence of independent values
             ^~~~~~~~~~~~~~~~~~~
In file included from ../../extmod/ulab/code/numpy/approx/../../ulab_tools.h:14,
                 from ../../extmod/ulab/code/numpy/approx/approx.c:21:
../../extmod/ulab/code/numpy/approx/../../ndarray.h:201:16: note: declared here
 ndarray_obj_t *ndarray_from_mp_obj(mp_obj_t , uint8_t );
                ^~~~~~~~~~~~~~~~~~~
make: *** [build-odt_branch-esp32s2/extmod/ulab/code/numpy/approx/approx.o] Error 1```
tulip sleet
#

so ulab submodule is not up to date?

ornate breach
#

i did git submodule sync and git submodule update --init

#

after pulling

tulip sleet
#

are you at the tip of main?

ornate breach
#

yeah

#

very latest

tulip sleet
#

ok, trying it myself

ornate breach
#

i'm on mac. i've had issues with it taking a lot of syncing submodules and init'ing them to get everything to work the last couple weeks. might be my computer

tulip sleet
#

cd circuitpython/extmod/ulab, and do git status and let's look at the commit

#
halbert@tuna:~/repos/adafruit/circuitpython/extmod/ulab$ git status
HEAD detached at a99e0b9
nothing to commit, working tree clean
ornate breach
#
Untracked files:
  (use "git add <file>..." to include in what will be committed)
    code/fft/
    code/numpy/approx/
    code/numpy/compare/
    code/numpy/filter/
    code/numpy/numerical/
    code/numpy/poly/
    code/numpy/stats/
    code/numpy/transform/
    code/numpy/vector/
    docs/manual/autoapi/
    docs/manual/source/ulab/
    tests/common/
    tests/numpy/
    tests/scipy/
    tests/utils/

nothing added to commit but untracked files present (use "git add" to track)```
#

same commit but it's showing untracked files

tulip sleet
#

this is on a clone of adafruit/circuitpython, not my own fork

#

what is git --version ?

ornate breach
#

2.23

tulip sleet
#

I am at 2.34.1, and there is junk in your ulab.

#

I would suggest cd circuitpython; git clean -xxffdd to remove all the non-repo stuff (stash any uncommited work), then see if that makes any difference. Or reclone your fork from scratch

#

a bit odd that the commit is the same but yours is showing an extra digit, but maybe that is just a cosmetic git difference

#

my build worked fine. You could try a fresh adafruit/circuitpython clone and see if it works

ornate breach
#

do i need to reinit the submodules after git clean -xxffdd

tulip sleet
#

I don't think so

ornate breach
#

i'll try these things and hopefully find success

manic glacierBOT
#

Thank you for the analysis on the descriptor, and your corrections to mine also work with my KVM, as you probably expected!

When I set boot_device=1, the KVM doesn't work unless I supply your descriptor as a parameter. I don't think it's ignoring it.

#usb_hid.enable((usb_hid.Device.KEYBOARD,), boot_device=1 )
# above line does not work with Belkin SOHO KVM

#usb_hid.enable((reference_keyboard,), boot_device=1 )
# above line works fine with Belkin SOHO KVM

<detail...

manic glacierBOT
timber mango
#

Thanks for helping me dahn πŸ™‚

manic glacierBOT
manic glacierBOT
#

When I set boot_device=1, the KVM doesn't work unless I supply your descriptor as a parameter. I don't think it's ignoring it.

You do need a descriptor. How it works is a bit more complicated than one might expect. If you set boot_device=1, then CircuitPython says it is capable of being a boot keyboard. But it doesn't do so unless the host asks for it to be a boot keyboard. If the host doesn't ask, then the supplied descriptor is used. If the host does ask, then the supplied descriptor...

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.1.0-rc.0 on 2021-12-23; Adafruit Metro M4 Express with samd51j19

Code/REPL

# testing pdm mic
import time
import board
from ulab import numpy as np
from audiobusio import PDMIn, I2SOut
from neopixel import NeoPixel

neo = NeoPixel(board.NEOPIXEL, 1, brightness=0.1)
YELLOW = 0xFFFF00
RED = 0xFF0000
GREEN = 0x00FF00

# M4 I2S pins are fixed
mic = PDMIn(clock_pin=board.D3, data_pin=board.D1,
    sampl...
manic glacierBOT
manic glacierBOT
thorny jay
#

Ideas and thinks that could be fixed about mpy:

  1. https://circuitpython.readthedocs.io/en/latest/docs/troubleshooting.html#valueerror-incompatible-mpy-file say:
    In particular, the mpy binary format changed between CircuitPython versions 1.x and 2.x, 2.x and 3.x, and will change again between 6.x and 7.x.
    We should change the "and will change again" as this is done already.
  2. While the CircuitPython_Bundle has been released recently and only contain 7.x mpy (and no more 6.x).
    The community bundle has not been updated since November 27 and contain both 7.x and 6.x mpy. Maybe it need a new release or there is a configuration difference to fix.
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit Feather nRF52840 Express with nRF52840

Code/REPL

import alarm
from alarm import exit_and_deep_sleep_until_alarms
from alarm.time import TimeAlarm
from board import I2C
from time import sleep, monotonic
from displayio import release_displays, I2CDisplay

# You'll need this lbirary
from adafruit_displayio_sh1107 import SH1107


# Board on + OLED on
release_displays()
displ...
manic glacierBOT
#

The python library (not yet merged upstream) https://github.com/gamblor21/Adafruit_CircuitPython_IS31FL3741/tree/native_changes

I added a is31fl3741_pixelbuf.py that is a subclass of pixelbuf the same way Neopixel is. Also led_glasses_map.py that provides the pre-defined mapping coordinates that a user will need if they're using the glasses.

I did some testing to see if the is31fl3741_write makes sense in C vs python, all this was modeled after the neopixel_write submodule. Doin...

manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.1.0-rc.1 on 2021-12-25; Raspberry Pi Pico with rp2040

Code/REPL

>>> 23.40 * 100
2340.0
>>> int(23.40 * 100)
2339

Behavior

The floating point version is 2340.0 and when cast to int becomes 2339. This works fine in regular python:

Python 3.9.7 (default, Sep 10 2021, 14:59:43) 
[GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 23.40 * 100
2...
crimson ferry
#

does CircuitPython only present MSC at start-up? Is there a way to mount CIRCUITPY (either from the Mac, or from code without hard reset) if it's been ejected (macOS)?

#

CDC data (console / REPL) is available, but device doesn't show up in Disk Utility

tulip sleet
crimson ferry
#

thanks, I’ll take a look

manic glacierBOT
#
  • Addresses #5606.

  • Add selectable counting of rising or falling edges, or both (both is not possible on RP2040).

  • Add ability to specify a pull-up or pull-down.

  • The default was supposed to be falling, though on RP2040 it appears to have been rising. Fixed RP2040 to be consistent.

  • Renamed pin argument of Counter() to be pin instead of pin_a. Not sure why it was pin_a. That may be a leftover of something else.

  • Remove common_hal_countio_counter_reset(), since it can be...

lone sandalBOT
tough flax
#

Thank you, #circuitpython-dev for everything you've done in 2021 to help us who make custom AT solutions

solar whale
manic glacierBOT
#

I am not sure if this is the right place for this, as I am new to working with hardware (sorry!).

The Pink Adafruit Feather RP2040 - Free for orders $99 or more Product ID: 5299 may have the incorrect Board ID: as a default value.

  • If not updating, and connecting to the device via Thonny, the Board ID: suggests it is a Raspberry Pi Pico of no particular variant, and it is missing a number of libraries (like board). Connecting via a s...
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit Grand Central M4 Express with samd51p20

Code/REPL

>>> print("{0:,.2f}".format(283525.34561))
283525.26
>>> value = 283525.34561
>>> print(f"{value:,.2f}")
283525.26

Behavior

In both cases the output should be "283,525.35"

Description

Comma specifier is ignored, decmail part rounding is incorrect.

Additional information

No response

manic glacierBOT
#

It may be something on my end or something particular to this board. I am able to get it working but if I return to the bootloader and try to start from there I get the Crash in backend error referenced above and it does not show as a drive in my file explorer unless I am running the bootloader.

Changing the line in INFO_UF2.TXT from Board-ID: RPI-RP2 to Bourd_ID: adafruit_feather_rp2040 and then dragging the *.uf2 over does reboot it and then everything seems to work. Thonny with ...

onyx hinge
#

oooh I have now officially written an asyncio program. It shows a blinking "12:00" potentially on multiple of the ht16k33 displays each one at a slightly different rate. Use address jumper A2 to tell CircuitPython if a display is 7-segment. https://gist.github.com/6fe570c0bcd9560a9a7822bdd58fc648

manic glacierBOT
manic glacierBOT
#

Did some further testing and i think this is a weird one. I didn't change the descriptor. I just added usb_hid.get_boot_device() to check if the host requests boot mode -> Yes it does.

So i said it locks up bios or grub boot loader. I found this is only half true.
After sending the first keypress it locks up. Nether from the cp-device nor from the original keyboard an input is accepted.
EXCEPT: pressing and releasing the left CTRL-key does unlock it. The normal keyboard starts working ag...

manic glacierBOT
#

I'm using a KVM, but what you describe is the same behavior I was seeing before I started using the custom descriptor. https://w3c.github.io/uievents/tools/key-event-viewer.html would report left-control was always pressed before my code ran. Also, the KVM wouldn't forward any shift key presses to the host. So an "A" was always showing as control-a (lowercase), and so on.

manic glacierBOT
#

In my testing, there is no way to accurately know how far into a MP3 file
you're currently playing. You can use monotonic time, but that can have
drift versus the audio playback system, which may not be running at exactly
the expected sample rate.

To allow syncing animation with timestamps in a MP3 file, this presents a
new property, decoded_samples, that records the number of audio samples
sent out of the decoder. While this may not be a completely accurate time,
due to mixer delays...

#

This change was needed to get perfect sync for my project at https://hackaday.io/project/183342-daft-punk-word-clock - the current code posted there uses differences between a monotonic clock time saved at the start of playback and the current time. Switching it to use this new decoded_samples property divided by 44100 gives much better results. I'm happy with any comments or suggested changes.

dusky halo
#

Question - for pioasm (or general circuitpy dev), I see both RuntimeError and SyntaxError for PIO asm. Is there a guideline anywhere on which to use and when? So my use case is catching invalid cases (which I found myself :D) of set registers, or mov operations missing spaces, and coming out with nicer exceptions (see https://github.com/adafruit/Adafruit_CircuitPython_PIOASM/pull/32).

GitHub

GitHub is where people build software. More than 73 million people use GitHub to discover, fork, and contribute to over 200 million projects.

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Category Channels

8

Text Channels

61

Voice Channels

6

Members

32472

Roles

36

onyx hinge
#

@dusky halo I don't see any particular logic to the existing SyntaxError vs RuntimeError exceptions in pioasm.

#

@dusky halo raise RuntimeError("Invalid mov source:", source) from exc any particular reason this wasn't an f""-string? Is this two argument RuntimeError correct?

tulip sleet
#

I think ValueError might be more appropriate for an invalid operand. I would reserve SyntaxError for what it says, invalid syntax (unparseable input line)

#

RuntimeError is usually used for unexpected things beyond the user's control, not programming errors.

#

we use ValueError all the time time for say, lengths < 0, etc.

dusky halo
#

@tulip sleet that sounds reasonable. For now I'll modify those that I've added - but do we have a good place in the repo to record a dev guideline like that? Like a dev.md or something?

#

Ok tidied up my PR a bit - made the exceptions consistent, and added tests for my changes.

jaunty juniper
manic glacierBOT
ancient whale
#

is the version of uncrustify in the debian repos suitable for building circuitpython?

#

(Uncrustify-0.72.0_f)

viscid pine
ancient whale
#

right, i saw that

#

but i'm on debian

#

and i was wondering if the version in the normal repos will work

#

looks like it's more up to date

#

it should hopefully work

viscid pine
#

i tried using a more up to date one at first and it didn't work out

#

0.71 is what the ppa gives me, you might be ok

#

actually if you're just building you don't need it

ancient whale
#

oh good

#

i'm planning on adding a module tho

#

so i might need it

viscid pine
#

it's for formatting

ancient whale
#

i know

onyx hinge
#

@ancient whale I usually use the version in debian bullseye (0.72.0+dfsg1-2) and usually get by without problem, fwiw.

manic glacierBOT
lone sandalBOT
ancient whale
#

i'm getting an error```
~/circuitpython/ports/atmel-samd$ make BOARD=adafruit_neokey_trinkey_m0 V=2
GEN build-adafruit_neokey_trinkey_m0/genhdr/mpversion.h
python3 ../../py/makeversionhdr.py build-adafruit_neokey_trinkey_m0/genhdr/mpversion.h
Creating build-adafruit_neokey_trinkey_m0/frozen_mpy.c
python3 ../../tools/mpy-tool.py -mlongint-impl=none -f -q build-adafruit_neokey_trinkey_m0/genhdr/qstrdefs.preprocessed.h > build-adafruit_neokey_trinkey_m0/frozen_mpy.c
usage: mpy-tool.py [-h] [-d] [-f] [--merge] [-q QSTR_HEADER]
[-mlongint-impl {none,longlong,mpz}] [-mmpz-dig-size N]
[-o OUTPUT]
files [files ...]
mpy-tool.py: error: the following arguments are required: files
make: *** [../../py/mkrules.mk:167: build-adafruit_neokey_trinkey_m0/frozen_mpy.c] Error 2
make: *** Deleting file 'build-adafruit_neokey_trinkey_m0/frozen_mpy.c'

stuck elbow
#

@ancient whale did you upgrade git submodules?

ancient whale
stuck elbow
#

do you have any files in, say, frozen/Adafruit_CircuitPython_NeoPixel?

ancient whale
#

yep

#
~/circuitpython$ ls frozen/Adafruit_CircuitPython_NeoPixel
CODE_OF_CONDUCT.md  examples  LICENSES     README.rst          requirements.txt
docs                LICENSE   neopixel.py  README.rst.license  setup.py
onyx hinge
#

If you did a build before you had your submodules, you may be able to fix the problem by make BOARD=... clean

#

where ... is the board you're building for

ancient whale
#

i think it's working

solar whale
#

I always do make ... clean before any build.

ancient whale
#

Yay! It worked! Thanks

#

alright now that i have the build working, how can i add a builtin native module

#

ok c modules are in extmod

manic glacierBOT
ancient whale
ancient whale
#

alright, got a build with a test module, let's see if it works.

#

it didn't

tulip sleet
#

@mortal mica reminder to PR your new pykey boards to circuitpython-org

upbeat plover
#

why is my username highlighted? did i do something wrong?

idle owl
#

You did nothing wrong.

upbeat plover
#

yeah under releases, thank you for very fast reply.

idle owl
#

No problem! It sees it as a tag event, so it highlights your name.

#

@onyx hinge Are you around for a quick discussion about your running the meeting suggestions?

orchid basinBOT
#

Hi, thanks for submitting. Please keep the features limited to the list on this page: https://learn.adafruit.com/how-to-add-a-new-board-to-the-circuitpython-org-website/adding-to-downloads. You can move the text for the feature list you do have down into the description.

The reason for that is the features filter options are automatically generated based on the items and even slight spelling differences will generate duplicate options. Thanks.

onyx hinge
#

@idle owl text is better right now but otherwise yes

idle owl
#

I agree it's obvious we recorded the meeting and isn't worth mentioning.

#

But it should be mentioned before.

onyx hinge
#

My goals were to make the calendar more prominent and to change some in meeting stuff too be more directed at later viewers then live participants

idle owl
#

You did a great job. That's what I thought you were aiming for.

#

I also think we should keep something about the "if you can't participate during, but want to be a part of it, leave notes for us to read"

onyx hinge
#

Since we almost always gloss over the pre meeting section I probably don't know what's there and I didn't check

idle owl
#

because later listeners might be an audience for that concept, since they didn't attend

idle owl
#

I'll paste that text into the pre-meeting stuff.

onyx hinge
#

Makes sense, thanks for looking it over

idle owl
#

@onyx hinge Do you want to reword the bit about adding your notes if you can't attend to make it shorter?

onyx hinge
#

Do you want me to do a back up recording today?

idle owl
#

I approved everything else.

idle owl
#

I am still recovering from booster, for one, and two, this will be the first actual recording with this new laptop.

#

So.... I expect problems.

idle owl
onyx hinge
#

@idle owl whoops got distracted

idle owl
onyx hinge
#

I will do backup recording!

idle owl
#

Thank you so much

onyx hinge
#

I lost a component right off my desk and had to call in Ingrid to find it for me because losing things within arm's reach is my super power

idle owl
#

<@&356864093652516868> Hello, and happy new year! We have our first CircuitPython Weekly meeting of 2022 in about 1 hour 45 minutes. If you plan to participate, whether or not you're attending, please add your Hug Reports and Status Updates to the notes doc. If you are simply planning to listen in, no action is needed. Looking forward to chatting with all of you soon! https://docs.google.com/document/d/1f_fD92NicBJd93xzFFBiBFzrk8kT9Fdud4rKqF1rbkQ/edit?usp=sharing

thorny jay
# idle owl <@&356864093652516868> Hello, and happy new year! We have our first CircuitPytho...

Hi, in my notes I have put optional extra written information that does not need to be read-out. Those are extra details or notes. I used parenthesis to separate that from the main point. The idea is to have it saved if someone want to dig more, but not to take too much reading time for you. Does that make sense or should I try to rewrite or just remove that? Or any preferred special tagging like ((( extra bla bla bla ))).

idle owl
thorny jay
#

I am usually after Dan, so you can have a pre-read and decide if it is worst reading or not.

idle owl
#

Will do!

thorny jay
#

Thanks.

#

Someone has pasted ```raspberrypi_cm4
espressif_esp32s3_box
espressif_esp32s3_devkitc_1
espressif_esp32s3_devkitc_1_nopsram
bluemicro833
Seeed_XIAO_nRF52840_Sense
jpconstantineau_pykey18
jpconstantineau_pykey87
pimoroni_tiny2040_2mb
jpconstantineau_pykey44
seeeduino_xiao_rp2040
odt_cast_away_rp2040
sparkfun_stm32_thing_plus#

#

Could be new supported board in 7.2.0-alpha.1

idle owl
#

Hmm. I'll take a look.

#

I deleted it. I didn't include the extensive details because there's so many updates.

idle owl
#

Alright, who wants to do an audio check with me?

#

BRB getting water.

blissful pollen
idle owl
#

Perfect, thank you!

turbid radish
#

That list is the boards added without corresponding notes at circuitpython.org so there are a bunch of "Unknown Board" entries

#

Sunny and 66 F here

blissful pollen
#

stopped being -20 F here, now around 0 F

lone axle
turbid radish
#

πŸ™‡

errant grail
solar whale
#

yes!

lone axle
#

There are a few display drivers that have non-Displayio and Displayio ones seperately. The ones I've seen tend to be much older frambuffer based libraries. Most of the newer hardware has just Displayio I think though.

errant grail
#

Thanks!

idle owl
#

No crashes!

onyx hinge
#

yay @idle owl

idle owl
#

Now to find out if the audio worked.

onyx hinge
#

I'm headed out for a bit, πŸ‘‹

#

ah I'll wait until you have checked that

idle owl
#

Dropping off to check audio. Thanks everyone!

idle owl
onyx hinge
#

ok great!

#

now I'm really headed out

#

but not outside it's crazy cold there

mortal mica
# tulip sleet <@!347768391773454337> reminder to PR your new pykey boards to circuitpython-org

Thanks for the nudge. I did a PR a while ago (https://github.com/adafruit/circuitpython-org/pull/815) but I left 2 of them "hidden" as they are not live yet on Tindie. Now that I am back from holidays, I'll need to get it in before I go back to work tomorrow (my day job...)

GitHub

Adding md files for 3 new boards.
Still need to update pictures and store links.
I turned-off the downloads to a couple as they are not ready on Tindie yet,

idle owl
#

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

mortal mica
#

@idle owl The video of the meeting just showed up on youtube but the link to the notes seems to be missing. Happy New Year eneryone!

mortal mica
#

wow our messages must have crossed paths on their way...

idle owl
#

No, the link I posted above is for next week.

#

I forgot to add the link for this week to this week's video.

mortal mica
#

It's up now.

idle owl
#

Been a while, and still recovering from booster πŸ˜„

#

Great! Thanks

thorny jay
#

Did someone recently try using RPi imager to write an image for the Pi2W? I'll try older version, but it could be related to the fact that the image first action is to format the CPYTHON drive. I remember Danh saying something about a new behaviour for the general CP when that drive is missing. So maybe it interact badly? I reverted to 7.1.0 and it works... but maybe I waited longer. But there might be something fishy, that you don't notice if you only update kernel8.img?

thorny jay
#

I start to be confident that adafruit-circuitpython-raspberrypi_zero2w-en_US-20220102-f2f38c7.disk.img and adafruit-circuitpython-raspberrypi_zero2w-en_US-7.2.0-alpha.1.disk.img are broken while adafruit-circuitpython-raspberrypi_zero2w-en_US-7.1.0.disk.img is working OK. It might be a timing issue, but I waited enough for the drive to be created at first startup. Sometime I see a console, and those error message including the above. I tried just pushing adafruit-circuitpython-raspberrypi_zero2w-en_US-7.2.0-alpha.1.kernel8.img and adafruit-circuitpython-raspberrypi_zero2w-en_US-20220102-f2f38c7.kernel8.img to a previously 7.1.0 image and it fail on me too. I have all kind of USB error message, my Win10 PC does not like what I do.

proven garnet
#

Hey @thorny jay, just wanted to check in about this issue you had that might be taken care of, aiming for the sweet, sweet Issue Closed if applicable adabot https://github.com/adafruit/Adafruit_CircuitPython_BLE_BroadcastNet/issues/13

thorny jay
#

Didnt' you add a few line to support that, like one or two weeks ago?

#

Those did seems to make a lot of sense, but I did not tested.

proven garnet
#

Yeah, the issue is still open though so I didn't know if it had been addressed

thorny jay
#

I believe so.

proven garnet
#

Or whether I just add some fun new characters to hang out in the source code haha

thorny jay
#

Not sure many use that ble_broadcast nowdays.

#

It is rather complex, you need a Pi and a CircuitPython board, and Adafruit.io ... that is a lot I guess.

#

It could be concept done before the ESP32S2 support.

proven garnet
#

It's the CPB right? Was looking to get one, and I managed to snag the RPi 2 Zero W before the holidays, and for the trifecta I've been meaning to checkout Adafruit.io. Maybe I'll do that once I get the Pi up

#

Actually, on that note, I can let you know when I do if you want me to try out anything regarding what you wrote above.

thorny jay
#

Don't hesitate.

#

A ping here is more efficient that the notification by email that Github will send me... I don't check emails every day anymore.

trim elm
lone axle
#

That PR fixes many of the docstrings and the example get everything working with the latest version of the library. So ideally we'll get that in before adding to the bundle to avoid anyone getting confused by the current state.

trim elm
#

ah ok. I'll take a look at it and see if I can approve it myself and forward it to someone who can if I don't know enough to

lone axle
#

Thank you!

spiral elk
lone axle
spiral elk
#

I was planning on working on the single-byte PR over the holidays but didn't get around to it.

lone axle
#

In this case the driver can support other devices with relatively minor changes (mostly updating the max size value). But this specific repo will remain for the 24LC32 Adafruit breakout.

orchid basinBOT
#

Hi, thanks for submitting. Please keep the features limited to the list on this page: https://learn.adafruit.com/how-to-add-a-new-board-to-the-circuitpython-org-website/adding-to-downloads. You can move the text for the feature list you do have down into the description.

The reason for that is the features filter options are automatically generated based on the items and even slight spelling differences will generate duplicate options. Thanks.

Make sense

manic glacierBOT
orchid basinBOT
manic glacierBOT
orchid basinBOT
pallid echo
#

During Christmas break I got the main branch of CircuitPython working on this cute little Waveshare RP2040-Zero board. The onboard neopixel is happily cycling through hsl hues using the neopixel library and board.NEOPIXEL. So I know I got the most important things in the board definition correct gus. For the USB_VID and USB_PID I jotted down the numbers from the firmware it came with that showed up with lsusb. I doubt those are correct; the string said "RPI-RP2" and the VID is from the Raspberry Pi Foundation... But then I saw other board definitions in the tree with the same VID. And now I'm a bit confused.

#

Hmmm. That looks like a statement, but feels like a question. πŸ˜… I guess my question is: what do I need to research or ask the manufacturer in order to get this closer to a PR?

idle owl
orchid basinBOT
pallid echo
# idle owl I feel like there's a thing with the RP2040, that it has a set VID or some such....

πŸ™‚ Thanks. It was surprisingly smooth to get built. I don't know who to compliment for that. But I only just now found https://learn.adafruit.com/how-to-add-a-new-board-to-circuitpython/customizing-the-board-files and I got this working first try. So the project layout and code organisation is pretty good.

Adafruit Learning System

Add your new CircuitPython compatible board to CircuitPython!

idle owl
idle owl
#

@gilded cradle Does that Blinka_DisplayIO PR need testing?

slender iron
gilded cradle
#

@idle owl I did some basic testing with the BrainCraft and the basic demo script, but nothing extensive, so some additional testing would probably be helpful.

pallid echo
gilded cradle
#

I'll make a note of that in the PR

idle owl
manic glacierBOT
#

@dhalbert Just read through your comments on #5803 there. It looks like it will be quite useful, thank you!

I'm curious, as I bounce between micropython and circuitpython for a project here due to differing demands, is there a way to tell how much time has elapsed in a pin state?

In the mentioned project I have a relatively slow speed serial protocol that depends on high pulse duration to determine 0/1 (0.8ms vs 1.2ms, with reset as high > 2ms OR low > 0.4ms). I've been able to de...

slender iron
#

@onyx hinge have you seen weblate hit a rate limit?

onyx hinge
#

@slender iron no -- I don't know why that would happen

onyx hinge
#

@slender iron That seems to be a message github is sending back to weblate, it might happen if they had a bug or configuration error that made them make too many github API requests

#

I don't see any opened issue in their github about it

manic glacierBOT
slender iron
#

@onyx hinge looks like it's working again. I told it to push through the weblate UI

#

I just needed to go on a run first πŸ™‚

timber mango
#

Hi,

I need to set CFG_TUSB_MEM_ALIGN defined in supervisor/shared/usb/tusb_config.h to custom value (256) in order to get USB running on NXP LPC55Sxx chips.

Tried to set the CFG_TUSB_MEM_ALIGN in nxp/mpconfigport.h
Modifing the tusb_config.h in following way.

#if !defined(CFG_TUSB_MEM_ALIGN) #define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4))) #endif
But the problem is that tusb_config.h is included directly in lib/tinyusb/src/device/usbd.h

Any suggestion how to overcome this issue?
Is it safe to simply change the value from 4 to 256?

manic glacierBOT
tulip sleet
#

oh never mind, you already said that

#

but what i'm saying is, you can put some dependencies from outside in there

#

like make the 4 be the default, and create a new variable that lets you override the 4

#
#define CFG_TUSB_MEM_ALIGN          __attribute__ ((aligned(4)))

to

#ifndef CIRCUITPY_TUSB_MEM_ALIGN
#define CIRCUITPY_TUSB_MEM_ALIGN (4)
#endif

#define CFG_TUSB_MEM_ALIGN          __attribute__ ((aligned(CIRCUITPY_TUSB_MEM_ALIGN)))
#

would that work, or is it the same problem?

timber mango
# tulip sleet would that work, or is it the same problem?

I am afraid that the problem is that tusb_config.h is included by tinyusb directly.
There is no chance to set CIRCUITPY_TUSB_MEM_ALIGN from circuitpython this way.

Here is the place in lib/tinyusb/src/tusb_option.h where this file is included.
// Allow to use command line to change the config name/location
#ifdef CFG_TUSB_CONFIG_FILE
#include CFG_TUSB_CONFIG_FILE
#else
#include "tusb_config.h"
#endif

I'll try is to override the file name (CFG_TUSB_CONFIG_FILE).

tulip sleet
#
CIRCUITPY_USB_MSC ?= $(CIRCUITPY_USB)
CFLAGS += -DCIRCUITPY_USB_MSC=$(CIRCUITPY_USB_MSC)
#

so you should be able to do this

#

add CIRCUITPY_TUSB_MEM_ALIGN = 256 to the appropriate mpconfigport.mk or mpconfigboard.mk, and then add the -DCIRCUITPY_TUSB_MEM_ALIGN stuff to circuitpy_mpconfig.mk, analogous to the above.

#
ifdef CIRCUITPY_USB_MSC
CFLAGS += -DCIRCUITPY_TUSB_MEM_ALIGN=$(DCIRCUITPY_TUSB_MEM_ALIGN)
#

Then in tusb_config.h, as above:

#ifndef CIRCUITPY_TUSB_MEM_ALIGN
#define CIRCUITPY_TUSB_MEM_ALIGN 4
#endif

#define CFG_TUSB_MEM_ALIGN          __attribute__ ((aligned(CIRCUITPY_TUSB_MEM_ALIGN)))
timber mango
timber mango
#

@tulip sleet The pull request (https://github.com/adafruit/circuitpython/pull/5453) is pending since quite a long time. Actually it became obsolete, because reworked the code significantly in the meantime.
I am going to cancel the PR#5453 and create new one with the latest changes.
Is it fair enough?

GitHub

Here is initial NXP LPC1768 and LPC55S28 support.
So far CPY NXP port has been tested on two boards: up and running on Keil MCB1700 and NXP LPCXpresso55S28 boards.
Serial interface, HAL digitalio a...

tulip sleet
timber mango
#

Another question regarding the ringbuffer.
I would like to add new function there to allow user buffer allocation:
bool ringbuf_init(ringbuf_t *r, uint8_t *buf, size_t capacity) { r->dynamic = false; r->buf = buf; r->size = capacity + 1; r->iget = r->iput = 0; return r->buf != NULL; }

So far the static allocation looked like this:
// Static initialization: // byte buf_array[N]; // ringbuf_t buf = {buf_array, sizeof(buf_array)};

This approach exposes the order of the fields in ringbuffer structure.
By using dedicated function (ringbuf_init), which still backward compatible with static and dynamic allocation, this risk is avoided.
However I had to add new field to ringbuffer structure:
typedef struct _ringbuf_t { uint8_t *buf; // Allocated size; capacity is one less. Don't reference this directly. uint32_t size; uint32_t iget; uint32_t iput; bool dynamic; } ringbuf_t;

Does it make sense?

tulip sleet
#

do you test dynamic somewhere?

timber mango
tulip sleet
#

ringbuf is a low-overhead thing from MicroPython. It could be made more general in a bunch of ways

#

I am not all that happy with it - for instance the 2-byte stuff is somewhat hacky

#

but it is fast and small

#

you would only test dynamic on freeing or something, is that right?

#

is it heap-allocated? You will need to worry about garbage collection and making the pointer be reachable.

timber mango
tulip sleet
#

Yes, I cleaned it up a bit a while ago

timber mango
# tulip sleet you would only test `dynamic` on freeing or something, is that right?

Right.

`// Dynamic initialization. This should be accessible from a root pointer.
// capacity is the number of bytes the ring buffer can hold. The actual
// size of the buffer is one greater than that, due to how the buffer
// handles empty and full statuses.
bool ringbuf_alloc(ringbuf_t *r, size_t capacity, bool long_lived) {
r->dynamic = true;
r->buf = gc_alloc(capacity + 1, false, long_lived);
r->size = capacity + 1;
r->iget = r->iput = 0;
return r->buf != NULL;
}

void ringbuf_free(ringbuf_t *r) {
if (r->dynamic) gc_free(r->buf);
r->buf = (uint8_t *)NULL;
r->size = 0;
ringbuf_clear(r);
}`

timber mango
tulip sleet
#

I think gc_free will notice that the pointer is outside of the heap and not do anything, so you don't need to guard gc_free() that way

timber mango
tulip sleet
#

what I said above is wrong, I think it checks that the pointer is in the heap and asserts out otherwise, but in general, for a particular ring buffer, you would know whether it is allocated dynamically or not, and wouldn't call ringbuf_free() on a non-heap ringbuf. What is your use case here?

#

you could do:

ringbuf_t buf = {
    .buf = ...,
    .size = ...,
};
#

and then not worry about the order

timber mango
manic glacierBOT
timber mango
tulip sleet
manic glacierBOT
manic glacierBOT
#

Howdy, I was directed to this issue when I asked about CP Zigbee/Z-wave, and was wondering if anybody here has made any headway into writing anything for CircuitPython? Or, if you have done research but not written anything and would like help implementing something. I would be starting from scratch, so any pointers would be helpful. But, seeing as I missed 24 pull requests in 2021, I might as well make up for it in 2022.

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

I think that this code will be simpler if you called common_hal functions directly here. The intermediary board_* functions don't provide any value because we no longer need their argument parsing. Leaving it in makes this code confusing as to what it's doing.

You could also have three macros, one for each bus type, instead of calling separate helper functions. CIRCUITPY_BOARD_UART_SINGLETON would allow the generated code to be more UART specific.

manic glacierBOT
#

In some use cases like debugging over UART, if DEBUG_TX/DEBUG_RX are defined, the static buffer is provided by serial_early_init with the call of common_hal_busio_uart_construct.

Mircopython originally recommended to use list of initialisers instead of calling ringbuf_alloc in case the buffer cannot be allocated from heap internally and static buffer must be provided by user code.

// Static initialization:
// byte buf_array[N];
// ringbuf_t buf = {buf_array, sizeof(buf_array)...
crimson ferry
solar whale
#

Why do new products always show up within hours of my placing an order? πŸ˜‰

slender iron
#

they are also hours before AAE πŸ˜‰

crimson ferry
blissful pollen
#

@idle owl I tried the IS31 code on the QtPy M0 Haxpress and seemed to still work with the additions. Only some of the samples would run with or without due to memory limitations. I doubt it will run on anything smaller then that.

idle owl
blissful pollen
idle owl
#

Ok, that's actually the result I was hoping for.

#

So let's include your code in the current library. Obviously make sure it remains backwards compatible.

blissful pollen
#

You have to use the mpy compiled version too it is that tight on memory. Using the python version ran out

idle owl
#

But let's make it work with what already has it.

#

Python version always runs out πŸ™‚

#

That's not a surprise.

blissful pollen
#

I'll try to take a look at it this weekend if I don't get some time before

idle owl
#

Perfect. Thanks for your patience with this decision. I really appreciate it!

blissful pollen
#

No problem I was in no rush myself, thanks for your help in looking at it too

manic glacierBOT
#

@gamblor21 Sorry I wasn't at this weeks meeting. I took the day off. What did you conclude there? 2x speed-up seems worth it.

I was checking with Kattni on the library end of things which looks good (it won't break the existing library on smaller boards). I'll clean up the code I have with the comments above and also submit the PR to the library so they can be looked at together.

slender iron
#

@tulip sleet @onyx hinge do you know how to disable __exidx_end?

tulip sleet
slender iron
#

something for exception unwinding

onyx hinge
#

-fno-exceptions?

slender iron
#

I think I just tried -fno-exceptions

#

it's just the dfu and usbtmc examples that fail. I think I'll just skip them

onyx hinge
#

/home/runner/cache/toolchain/xpack-arm-none-eabi-gcc-10.2.1-1.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: /home/runner/cache/toolchain/xpack-arm-none-eabi-gcc-10.2.1-1.1/bin/../lib/gcc/arm-none-eabi/10.2.1/libgcc.a(unwind-arm.o): in function `get_eit_entry': so the start files are referring to this function...

#

you'd get to trace back why unwind-arm is linked in in the first place, not fun

slender iron
#

it builds for me with gcc 11

onyx hinge
#

it's both host examples yeah?

slender iron
#

no, device

onyx hinge
#

oh there's a table at the bottom, must be incomplete or something

#

I saw 4 rows and 2 failures and drew a wrong conclusion

#

Build Summary: 16 succeeded, 0 failed, 7 skipped and took 4.06s .. with gcc version 10.2.1 20201103 (release) (xPack GNU Arm Embedded GCC, 64-bit) locally

#

so that's weird

#

oh I got it after you added the skips

slender iron
#

ah πŸ™‚

onyx hinge
#

how can I get build_family.py to show me what it actually invokes? or to invoke make V=2 or whatever the magic is

slender iron
#

Β―_(ツ)_/Β―

onyx hinge
#
/home/jepler/src/tinyusb/xpack-arm-none-eabi-gcc-10.2.1-1.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: /home/jepler/src/tinyusb/xpack-arm-none-eabi-gcc-10.2.1-1.1/bin/../lib/gcc/arm-none-eabi/10.2.1/libgcc.a(unwind-arm.o): definition of __aeabi_unwind_cpp_pr0
```for some reason the standard C library functions like strtol refer to this `__aeabi_unwind_cpp_pr0` symbol, which brings in `unwind-arm.o`
slender iron
#

huh, interesting

onyx hinge
#

I had a longer commit message which git ate and wouldn't give back. It explained that these symbols create an empty exception information table. The table is required because of a dependency we don't understand from C routines like strtol, which refers to the symbol __aeabi_unwind_cpp_pr0. That brings in get_eit_entry from the same object file, which needs __exidx_start and __exidx_end. It would be best if these routines weren't brought in, but we can't control that, and providing an empty table seems like the next best thing.

The link.ld file is copied from the bsp with just the two symbols added.

robust quartz
#

Hi I compile the Seeed_XIAO_nRF52840_Sense board is work on my local, coz I add the SOFTDEV_VERSION=7.0.1 in behind the "make BOARD=...SOFTDEV_VERSION=7.0.1", I think I downloaded that board from the Circuitpython web one does not add "SOFTDEV_VERSION=7.0.1", It cause the start address wrong.

#

I think the system build the uf2 is default make BOARD=..., how can I make it to add SOFTDEV_VERSION=7.0.1 behind the make BOARD=...

manic glacierBOT
#

Hi I compile the Seeed_XIAO_nRF52840_Sense board is work on my local, coz I add the SOFTDEV_VERSION=7.0.1 in behind the "make BOARD=...SOFTDEV_VERSION=7.0.1", I think I downloaded that board from the Circuitpython web one does not add "SOFTDEV_VERSION=7.0.1", It cause the start address wrong.

image

I think the system build the uf2 is the default make BOARD=..., how can ...

manic glacierBOT
proven garnet
#

That's been my experience from working with RTCs in CircuitPython so wanted to make sure

slender iron
#

@proven garnet I punted on it because I know it is complicated

proven garnet
#

Oh, gotcha, so a half truth then?

ember iris
slender iron
#

@proven garnet I think you are right. The library doesn't do it because it's complicated. An individual can do it for their needs when they need it.

#

One case is much more doable than all cases

proven garnet
#

I ended up doing one for a work project for DST, it was bidOOF

#

And that's just the USA's DST rules

slender iron
#

so you know better than I do πŸ™‚

proven garnet
#

Thanks for confirming!

half osprey
#

Hey! Just wanted to say that I watched this week's CircuitPython meeting on Youtube and it was so nice and pleasant, it reminded me of the weekly Mozilla meetings back when I worked for them. The hug reports warmed my heart! I hope I'll find some more things to contribute in the new year.

slender iron
#

Thanks @half osprey. Please reach out if you ever need guidance with contributing.

timber mango
#

Hello everyone, someone could help me, I have a QT Py RP2040, I need to send files to a USB memory stick. I found the USB_CDC Library and the USB_HID, which one can I use to transfer a file to the USB stick?
The QT is powered by 5 volts with a battery and if I put the USB stick, it should send the data to the USB stick.

stuck elbow
#

that's not possible, the rp2040 can't be an usb host

timber mango
#

the QT can be set as a Host

tulip sleet
#

CircuitPython doesn't currently support USB Host mode

timber mango
#

ahh 😦

tulip sleet
#

you can write to an SD card, would that serve your purpose?

timber mango
#

I imagine connecting a usb, can a micro sd be used?

tulip sleet
timber mango
#

as it is not possible, if it would be through the same connection that connects to the computer, where could I connect the usb.
In the QT Py RP2040 QT already has a USB connection, through which I connect to the MU, is it possible to use this connection?

tulip sleet
#

I"m not sure what you mean, do you want to send data to the host computer, or connect an SD card to USB? The former is possible, the latter not

timber mango
#

I want to send a file from QTPyRP2040 to USB memory stick

tulip sleet
#

not possible, you need USB host mode, and we don't have that

#

as mentioned

timber mango
#

that is, at the moment it sends the data to the usb it is not connected to the computer.

tulip sleet
timber mango
#

what I want to do is to put data in the QT py RP2040, after a while I want to see the behavior of the sensor, i.e. the data I have stored. Now I want to access the data via a USB stick. What I wanted to do was to press a button and have the microcontroller pass the data to the USB stick. So I figured using the USB_CDC or USB_HID libraries, because as I look at the microcontroller matrix I can use them.

#

so in order to send data to a USB memory stick. So the usb memory stick has to be a host?

tulip sleet
#

so, no you cannot do that. You can write data to an SD card. Later you can read that data with a USB card reader

manic glacierBOT
#

It might be misleading, but the size stores indeed the capacity+1 by design.
I just followed this rule when added ringbuf_init.
Please take a look on the code of following functions:

size_t ringbuf_capacity(ringbuf_t *r) {
    return r->size - 1;
}
bool ringbuf_alloc(ringbuf_t *r, size_t capacity, bool long_lived) {
    r->buf = gc_alloc(capacity + 1, false, long_lived);
    r->size = capacity + 1;
    r->iget = r->iput = 0;
    return r->buf != NULL;
}
tulip sleet
timber mango
#

thak you, but is very big. i think it is better the first option, sd card,

#

I thought that the microcontroller is the host and a device was the usb memory stick.

devout jolt
#

Is there a runtime way to determine precision of floats? I know about sys.maxsize for ints. Is that a universal proxy for float precision?

tulip sleet
#

You could try adding a small number to a larger number and see how small it has to be to not affect the result

devout jolt
tulip sleet
#

CPy floats are 30 bits, IEEE-754 32 bit floats with the lowest two mantissa bits dropped. H

#

They are not related to longints

devout jolt
#

ah, so it doesn't matter if it's a hardware FPU or software routines, the floats are always the same size across boards

tulip sleet
#

Except for the new RPi ports, maybe, but not sure about that

devout jolt
#

Right. okay that's very helpful. Thanks!

tulip sleet
daring ridge
#

Hoping this is an easy thing, so I'm asking here - if not, just let me know and I can open an issue.

My forked repo is a good bit out of date. So I'm updating locally - git fetch adafruit; get merge adafruit/main; git submodule sync --recursive; (and finally) git submodule update --init.

'git submodule update' (or with --init) fails with:
[bsd@yyz]:/circuitpython- git submodule update --init
fatal: 'bd34n' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: Fetched in submodule path 'ports/broadcom/firmware', but it did not contain bf96d0eda5952595d717fedb797aeb168483e9fa. Direct fetching of that commit failed.
fatal:
[bsd@yyz]:/circuitpython- git --version
git version 2.34.1
[bsd@yyz]:/circuitpython-

'bd34n' is my github id. Not sure why it thinks it's a repo. Not sure about the rest of the message - are special permissions needed for updating submodules? Any suggestions? Thanks!!

slender iron
#

otherwise you may suck down gigs of broadcom firmware

daring ridge
#

That's working, thank you, @slender iron !

devout jolt
tulip sleet
#

it was floating point precision ultimately.

devout jolt
#

yeah but not because of SAMD21 ahha

main furnace
#

Epsilon is the value you seek.

devout jolt
#

e.g. This prints out the same value on M0 and M4:

>>> import board; print(board.board_id, 1.2345678)
trinket_m0 1.23457
>>> import board; print(board.board_id, 1.2345678)
itsybitsy_m4_express 1.23457
tulip sleet
#

yes, not the SAMD21 inherently. But the small boards don't have longints, so you can't use time.monotonic_ns()

devout jolt
#

yes

#

thank you for walking me through this

manic glacierBOT
main furnace
#

epsilon = 0.01
while 1.0-epsilon < 1.0:
epsilon = epsilon / 2.0
print(epsilon)

What is the final value of epsilon?

devout jolt
main furnace
#

Ah, no problem.

devout jolt
#

It just took me a while to figure that out, ahaha

main furnace
#

Thanks for putting up with my math obsession. 😁

torn latch
# tulip sleet CircuitPython doesn't currently support USB Host mode

This is extremely topical, I was just thinking about this myself. Context, I have a quite few 'abandoned' USB devices that I've used https://www.amazon.com/gp/product/B01EWW9R1E/ to rewrite drivers to become vanilla HID devices and useful once again. With the work in CircuitPython and HID, I was optimistic that I could update my spaghetti Arduino code. If USB Host ever did come to circuit python, I would certainly make use of it. Thanks Dan!

slender iron
manic glacierBOT
#

Folks, please try artifacts from #5800 when you have a chance: https://github.com/adafruit/circuitpython/actions/runs/1664321924

For zero w and zero 2 w it sets the SDCard pins as never reset. It seems reliable on these two platforms to me. I still see weird corruption on the 4B and am looking at it briefly.

Please let me know how well it works for you on the 4B and the 2W. (The PR also adds Zero support.)

torn latch
manic glacierBOT
#

My MagTag just arrived yesterday and I spent today walking through the Calendar tutorial. Glad I found this thread because I was hitting the same errors. I've downloaded the example above, but have a question about calendar_id.

In the original code from the tutorial, the calendar_id for my personal calendar was hardcoded into the code.py. Does the full working example mentioned above now have the calendar_id in the secret.py file?
Or, should it go here:

now = self._iso_date(self.cl...
main furnace
#

I have a pi zero W around here somewhere...

slender iron
#

a non-W will work too

manic glacierBOT
#

The S3 Dev Kit I'm using has two micro USB connectors, one shows up as /dev/ttyUSB0 and the other as /dev/ttyACM0. CircuitPython grabs the ACM0 port for the REPL and the DEBUG=1 output goes to the USB0 port.

After placing some mp_printf statements that go to the USB0 port and some ESP_LOGW statements that go to the ACM0 port, it looks to me like the micro controller is not hanging, it's just reseting the /dev/ttyACM0 port. The device disappears from linux but the USB0 port is still there ...

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Folks, please try artifacts from #5800 when you have a chance: https://github.com/adafruit/circuitpython/actions/runs/1664321924

For zero w and zero 2 w it sets the SDCard pins as never reset. It seems reliable on these two platforms to me. I still see weird corruption on the 4B and am looking at it briefly.

Please let me know how well it works for you on the 4B and the 2W. (The PR also adds Zero support.)

Scott, is there support for the pi Zero as well as the Zero W -- I d...

manic glacierBOT
#

Also tried this on a Pi4B -- Mine boots from a USB stick and has the Files system on an SD Card.
It seem sot be working fine. I can access the CIRCUITPY drive via the File manager on Linux OK.
I do note that there is a worrisome delay one first truing to open the CIRCUITPY drive with File manager but it does work, the files show up, after a few seconds. I wonder if this is related to the issues I am having on the zero 2W.
So far so good on the 4B.

#

@tannewt I tested 7.2.0 alpha on RPi 4B over the Christmass and had no issue with SD card corruption. I used image from main branch (I guess) as I downloaded it from website.
One thing (minor one) which I noticed was that, if I had LCD screen (which has touch over SPI) plug in for power, CP would not finish boot. If I powered LCD with seperate cable, I was able to use it without problem. I can not use touch anyway, so this was not big issue and I know that there is not yet any supported ...

#

Went back to the zero2W on the Linux box and tried doing a storage.erase_fiesystem().
That worked OK, but I am still having the same problem with the File manger not being able to access CIRCUITPY and this time, it corrupted the SDCard when I disconnected. I dit notary an eject because of the problems that caused last time....
The zero2W is definitely behaving differently than the zero-w or the 4B for me.

proven garnet
#

Hey y'all! Does anyone have the HTS221 Temp & Humidity sensor? Looks like it's not sold anymore (or at least out of stock on Adafruit & Digi-Key)

#

If you do, I have a small request to run the simple test file on a PR branch of mine!

manic glacierBOT
solar whale
lone axle
#

@solar whale or @jaunty juniper if one of you end up having a moment. I think @proven garnet is likely referring to a quick test on this PR https://github.com/adafruit/Adafruit_CircuitPython_HTS221/pull/10. If you can check out that branch and try the simpletest in the examples dir using that branch to confirm it's working as expected that would be awesome.

jaunty juniper
#
Traceback (most recent call last):
  File "code.py", line 10, in <module>
  File "adafruit_hts221.py", line 188, in __init__
  File "adafruit_hts221.py", line 267, in data_rate
  File "adafruit_hts221.py", line 89, in is_valid
TypeError: can't convert 'int' object to str implicitly
#

let me check what that's all about

ember iris
jaunty juniper
#

(I am doing a review with fixes)

ember iris
#

Sweet! I was just about to test something but I'll wait for the fix. I'm not use to type hinting, and adding inheritance/setting attributes threw me for a loop. It'll be informative to see the fix

jaunty juniper
#

it's not related to types though, it's an unrelated change to the CV helper class

manic glacierBOT
ember iris
#

I think that's where I was about to test. Types just make it slower for me to read while I'm new to it

jaunty juniper
#

there is a typing change I suggest, but I'm not sure: if a value can be 1 or 12.5 is it enough to type it as float or does it have to be Union[int,float] ?

ember iris
#

Not sure. I clearly misread the code pretty strongly, I thought the is_valid was using the rate label number (0 through 3) to make the check, not the rate name or the actual frequency of samples.

#

I think I need to walk away from this code for a bit. Do you know why the rate tuple is (str, index, rate)? With the change you suggested I can't find where or why the index would be used

onyx hinge
# devout jolt Oh I know why I was thinking they're connected. On SAMD21, `time.monotonic()` wa...

fwiw and you may already know this, but in 7.x we have supervisor.ticks_ms which wraps around in a specified way, and adafruit_ticks to wrap it (including the best compatibility with blinka & 6.3) so you can do "100ms from now" style deadline calculations without ever running into precision trouble, on the whole range of boards including those without long ints. (precision problems still exists on 6.3 without long ints, but we do our best)

devout jolt
proven garnet
#

Just checking now, thank you @jaunty juniper!!

jaunty juniper
# ember iris I think I need to walk away from this code for a bit. Do you know why the rate t...

yeah it's not really useful here, it's the index of the entry in the list. I believe CV is a generic helper for enums, it dynamically creates a bunch of constants on the class, with the is_valid function to test if something is a valid value in the enum. So you dynamically define the possible values and simultaneously have a list of enums that can be used AND a list of valid values that can be tested.

#

and maybe the original does more, because it has that lsb property, but not in that library

proven garnet
#

Catching up now, yeah it seems like enum-like behavior, I've seen it in a few classes. This one doesn't use it to the full extent I've seen elsewhere hence why I wanted to reduce it

#

It's used commonly enough that I toyed with asking about turning it into a mini importable library

jaunty juniper
#

C python has some advanced structures helpers for structs, enums and such, this might be a pure-python adaptation of one of those

proven garnet
#

But it seemed antithetical to memory reduction for the basic functionality, that was my take

jaunty juniper
#

and it's so small, it would be kind of annoying to add one more dependency to a bunch of libraries

proven garnet
#

Alright, changes made per review

jaunty juniper
#

oh wait no I got it wrong

#

not in the code, but in my explanation

#

or understanding I should say

#

the values of the enums are the second value, the third value (renamed label) only serve as labels

proven garnet
#

Oh, yes that's correct

manic glacierBOT
silent crane
#

Hello circuit python team. Have a question about the best way forward:
This line in the EPaperDisplay module is giving me a headache: https://github.com/adafruit/circuitpython/blob/afd686986ac3abf2fd8a7a060d8bf115de2bd8db/shared-module/displayio/EPaperDisplay.c#L148
Specifically I have a Waveshare 2.9" Epaper display and the LUT table that I have to send during start up is 154 bytes long. Because of the delay bit location I can't submit this table. Would it be best to subclass this with a different bit defined?

slender iron
#

what controller chip is it?

silent crane
#

I don't know as Waveshare refuses to publish that information. @stuck elbow gave me something to try before I go this route.

slender iron
#

what display is it? I've usually been able to find it

silent crane
#

Waveshare 2.9" V2

tulip sleet
manic glacierBOT
silent crane
#

Yes, my apologies for crossposting, I had come to a bad conclusion.

slender iron
#

there is a different eink question in help-with

#

(it's easier)

manic glacierBOT
slender iron
manic glacierBOT
ember iris
manic glacierBOT
slender iron
#

(I'm trying to find the datasheet so see what is says about the LUT command)

manic glacierBOT
silent crane
lone sandalBOT
slender iron
#

it has the 0x32 command to send 153 bytes for LUT

#

(and the next command listed is 0x34)

manic glacierBOT
slender iron
#

we have a driver for it but the LUTs must be shorter

#

ah, it uses the default LUT

slender iron
#

I think the simplest thing is to add a kwarg for a two byte length field in the init list

#

and default it to false for the behavior we have now

manic glacierBOT
manic glacierBOT
#

Does CircuitPython need to have exclusive use of the pins and the SPI bus for the flash chip, or could it share them with other SPI devices as long as they use a different CS pin? It seems a shame to lose use of the pins even when the flash isn't being read/written to.

At this point yes. CircuitPython does have locking around a SPI bus but we haven't made sure it works ok to share a SPI bus between USB generated SPI flash accesses and user code accesses.

I think it'd be a lot of wor...

#

I don't think so. Size is buffer size. Capacity is the number of entries that can be held at once. You have to leave one entry empty so that you can distinguish between an empty ringbuf where iput == iget and a full ringbuff where iput == iget - 1.

So, r->size must match the actual buffer size. Otherwise, you'll write one byte past the end. The init arg really should be size rather than capacity because the buffer has already been allocated. alloc can take capacity because ...

manic glacierBOT
digital shoreBOT
#
adafruit
Owner

adafruit#3230

Category Channels

8

Text Channels

61

Voice Channels

6

Members

32563

Roles

36

winter mortar
#

32768 members soon!

manic glacierBOT
#

Is anyone else using Linux? Are you having the same issue with the File manager?

I'm on Arch Linux and use KDE.

Scott, is there support for the pi Zero as well as the Zero W -- I don't see an artifact for the Pi Zero - did it not get built?

You can use the same build for now. I just wanted to make sure and have different names for the future when we support WiFi.

I do note that there is a worrisome delay one first truing to open the CIRCUITPY drive with File manager but it d...

slender iron
#

@solar whale you around to test more pi stuff?

solar whale
#

yes

slender iron
#

k, I'll make you a 2w build

#

this has 10us delays after each EMMC register access

#

which the linux driver does afaict

solar whale
#

CanI just copy that to the boot partition of my SD Card?

#

I'm used to using Imager to load the whole.zip

slender iron
#

yup