#circuitpython-dev

1 messages Β· Page 366 of 1

tough flax
#

Hi folks, I know I can enable writing to the filesystem in CP, but are there any other persistent storage libraries? I need to store a small amount of data (100-200 bytes) that help keep track of the bluetooth connections. Basically, I need to track the IDs of the BLE Centrals in the order they were originally bonded.

I know I can enable writing the filesystem and save that to a file, but it's not really something that needs to be exposed to the user, and I'd like the end user to be able to edit the code.py and config files. So, ideally, it wouldn't put it in the filesystem but perhaps in FLASH somewhere.

#

Is there something kinda like the old EEPROM block that's just out there? Maybe some Python feature that I don't know that puts the data in FLASH instead of RAM?

tough flax
#

That would work perfectly - do you know how much memory is there?

lone axle
#

I'm not certain. It may differ on different device.

tough flax
#

Ok, this would be on the NRF52840

lone axle
#

you might be able to call len(microcontroller.nvm) to find the number of bytes

tough flax
#

good idea!

#

ha!

#

Looks like 8K

import microcontroller
len(microcontroller.nvm)
8192

#

That should do it

#

THanks!

manic glacierBOT
#

If we need to conditionalize the doc strings in the special //| comments, I found the cpp -C and -CC flags, which pass through comments instead of discarding them. However, if a comment is inside a false #if or similar, it will be discarded. So there is a mechanism to conditionalize the docstrings.

Or, since we are extracting the docstrings and processing them as Python, maybe there's a Python-oriented way of doing it, by doing computations to build the docstrings or select among...

solar whale
#

This came up in the forum -- the ADC on the nrf42840s isnot used as described in the guide. it is initialized here https://github.com/adafruit/circuitpython/blob/main/ports/nrf/common-hal/analogio/AnalogIn.c#L80 with gain 4 and Vref = VDD/4 but the guide refers to the RESET default condition which is gain 1/6 and Vref .6 (interenal) https://learn.adafruit.com/adafruit-feather-sense/pinouts#analog-pins-3058299-9 It's not a bug, but the guide should be clarified. I have not checked how Arduino initializes it. forum post https://forums.adafruit.com/viewtopic.php?f=60&t=178104&p=867150#p867150

tulip sleet
#

I will clarify that paragraph - thanks

solar whale
tulip sleet
#

ah great, I will xref that

#

@solar whale I fixed the Feather, Feather Sense, and Itsy nRF52840 guides

solar whale
#

@tulip sleet Looks good! Thanks!

manic glacierBOT
#

When a function is defined, but its declaration isn't present, the compiler can't check that the declaration and definition match. "-Wmissing-prototypes" enables a diagnostic in this case.

Fixes fall into several categories:

  • Include headers where needed
  • Add/fix declarations / definitions where needed
  • Mark functions as static if appropriate
  • Remove some never-used functions

I ran into problems due to this while working on I2SOut for imxrt10xx, and initially thought I coul...

onyx hinge
#

kCLOCK_PllUsb1 and kCLOCK_Usb1PllClk are both clock-related constants in imxrt. tears at hair

manic glacierBOT
idle owl
#

TFW you don't pull before you push, but it turns out there hadn't been any updates anyway. πŸ˜…

idle wharf
#

Its Wednesday and i finally have time to listen to the Monday meeting...

#

So no Spoilers !

manic glacierBOT
lapis hemlock
slender iron
#

I have no numpy background so I'm a bad judge for what is worth it

ember iris
#

Would it make more sense to add a complex math library, rather than adding a complex dtype to the standard library?

slender iron
#

@ember iris probably best to discuss on the issue

ember iris
#

Sounds good, chimed in here because I don't know enough about the inner workings of circuit python to know if 'it doesn't work like that' πŸ˜„

slender iron
#

πŸ™‚

#

issues are better for longer discussions because chats can scroll away

lapis hemlock
ebon ingot
#

Hi. Apologies if this is the wrong channel. I'm trying to build CircuitPython to add some new board definitions, and am getting the following error when I try and build any of the existing RP2040 boards.

Traceback (most recent call last):
  File "gen_stage2.py", line 82, in <module>
    typer.run(main)
  File "/home/chris/.local/lib/python3.8/site-packages/typer/main.py", line 859, in run
    app()
  File "/home/chris/.local/lib/python3.8/site-packages/typer/main.py", line 214, in __call__
    return get_command(self)(*args, **kwargs)
  File "/home/chris/.local/lib/python3.8/site-packages/typer/main.py", line 239, in get_command
    click_command = get_command_from_info(typer_instance.registered_commands[0])
  File "/home/chris/.local/lib/python3.8/site-packages/typer/main.py", line 425, in get_command_from_info
    command = cls(  # type: ignore
TypeError: __init__() got an unexpected keyword argument 'no_args_is_help'
make: *** [Makefile:271: build-raspberry_pi_pico/stage2.c] Error 1

Anyone encountered it before? I have been able to add boards previously without this issue. This is built from my own fork of the main repo, but there's no changes from the adafruit repo yet. This is under Ubuntu 20

jaunty juniper
#

try pip install --update click I think

manic glacierBOT
ebon ingot
#

@jaunty juniper that exact command didn't work but doing just pip3 install click says I already have it installed

jaunty juniper
#

we have seen issues with older versions of click being installed

#

if I'm not mistaken

ebon ingot
#

ah its pip3 install --upgrade click

jaunty juniper
#

ah yeah that was the wrong option sorry

manic glacierBOT
ebon ingot
#

That pulled down 7.1, whereas I had 7.0 before

jaunty juniper
#

it's like "uninstall", "remove", every package manager has a different name for it πŸ˜›

manic glacierBOT
ebon ingot
#

Haha, yep. That worked @jaunty juniper. Thanks for the help! Worth including a note in the guide about it if it's been a common occurrance?

#

Or can the requirements line be forced to upgrade?

jaunty juniper
#

I think it's weird, because the typer requirement should already require the right version of click, but somehow it doesn't

ebon ingot
#

Oh, how odd

tulip sleet
#

yes, we have not figured this out yet, and I tried it in a fresh virtualenv and it worked fine, so 🀷

#

it is as if it's not doing transitive updates

#

i even installed click 7.0 in the virtualenv and it DID update upgrade it

manic glacierBOT
idle wharf
manic glacierBOT
slender iron
#

@idle wharf I invited you to join

idle wharf
#

Would the azure_iot (and maybe the the other cloud providers not adafruit_io) be good candidates to move ?

slender iron
#

ya, potentially since you and jim are working on it. I think it's up to brent and limor though too

idle wharf
#

Totally other people have a say

#

I forgot Brent was adafruit

slender iron
#

it does fall in the category of "things other people worry about" for me πŸ˜‰

idle wharf
#

lol

#

Community is good

slender iron
#

πŸ’―

lone sandalBOT
idle wharf
#

Maybe the next in the weeds is to review a list of potential candidates (not_adafruit_iot, circup, cookiecutter, ... )

idle owl
#

@idle wharf Add it to the notes doc now while you're thinking about it πŸ™‚

idle wharf
#

I just got PM'd ....

(that's a joke in my house... my wife and I both have PM backgrounds so we always PM each other)

slender iron
#

πŸ˜„

#

oooh, arm gcc 10.3

tulip sleet
slender iron
#

yup yup

idle wharf
#

I added an In The Weeds topic for potential first candidate repos for the CP GitHub Organization. I encourage everyone to add to the list. Its not intended as my list just a list to discuss. My list items could be totally wrong. Yours are probably awesome. πŸ˜‰

idle owl
#

@solar whale Thank you for testing my Trinkey examples, by the way! Appreciate it!

solar whale
#

@idle owl No problem! Thanks for creating them!!

idle owl
#

The content is live in the guide now, not that you needed the guide to figure them out πŸ˜„

#

@solar whale Do you not have perms to merge in the Learn repo? Or were you letting one of us do it deliberately?

solar whale
#

Nice -- sometimes I get in trouble running the code without the guide...

idle owl
#

I mean it worked out because I wanted Limor to look at it in case it wasn't what she wanted, but I was curious.

#

She would have caught it even if it was merged.

solar whale
#

I think I do, but I thought it best to let others look first since this is all new hardware.

idle owl
#

Fair enough! I simply wanted to make sure I wasn't missing something on who to request reviews from.

manic glacierBOT
#

Any update on this? @tannewt and @dhalbert have a lot of discussion in a lot of different issues, so apologies if I have missed the solution. I see mention of alarm being in 6.1 Beta, but I don't yet see it in 6.2 released:
The alarm module doesn't seem to be in the base CircuitPython 6.2, nor do I find a standalone lib..
code.py output:
Traceback (most recent call last):
File "code.py", line 5, in <module>
ImportError: no module named 'alarm'

I've also checked https://learn.adaf...

orchid basinBOT
manic glacierBOT
#

Firmware

6.2.0

Adafruit CircuitPython 6.2.0-beta.2 on 2021-03-01; Raspberry Pi Pico with rp2040

Code/REPL

keyboard.row_pins = (board.MOSI, board.A0, board.A1, board.A2, board.A3)

or

keyboard.row_pins = (board.GP23, board.A0, board.A1, board.A2, board.A3)

Behavior

AttributeError: 'module' object has no attribute 'MOSI'

Description

I'm attempting to use the RP2040 Pro Micro in a kmk keyboard application where a traditional pro micr...

jaunty juniper
#

so, at some point I wanted to check what boards had certain modules on it, for example to answer "what board can do i2cperipheral" and I tested having a dynamic filter on the support matrix:
https://neradoc.github.io/support_matrix_filter/
would there be any interest in having that kind of feature somewhere ?

idle owl
#

@jaunty juniper Would it work properly on Read The Docs?

#

As in, can we integrate it into the current documentation?

jaunty juniper
#

I don't know anything about readthedocs

idle owl
#

Heh fair enough. That's where we host our documentation. It's rendered from within the CircuitPython core.

idle owl
#

But if we're going to integrate it into our current documentation, we'd have to sort out making it work.

jaunty juniper
#

I was thinking integrating into the search on https://circuitpython.org/downloads but then how do you choose between stable or beta, and what's even the UI for it (a big checklist of modules seems... intimidating)

idle owl
thorny jay
manic glacierBOT
manic glacierBOT
slender iron
#

broke 10kB/s write speed on my demo

#
wrote /random.txt at rate 15420.2 B/s
read /random.txt at rate 6168.09 B/s
ornate breach
#

Wow nice

slender iron
#

prints really slow it down πŸ™‚

manic glacierBOT
idle wharf
slender iron
#

I wasn't exactly. I was thinking about a board toml database like I made for flash chips

idle wharf
#

That was it...

misty garnet
#

isn't a lot of this information (modules, flash, etc...) in the mkboard files, just parse them all

lone sandalBOT
manic glacierBOT
manic glacierBOT
#

Also i think you are kind of advertising bords wrong!

instead of the list of supported modules there should be a list of "missing features".

for a beginner it is not easy to know what kind of modules you would need for your project and choose the correct board!

i jumped on the RP2040 hype right at the beginning and also used CP for the first time. I chose a small GSM Datalogger as project to learn CP. It was written nowhere that the implementation was not completetd or beta...

fir...

manic glacierBOT
manic glacierBOT
tulip sleet
stuck elbow
#

you should be able to add any javascript

#

you can even provide your own custom templates for anything

jaunty juniper
#

yep, I tested it locally (make html) by adding a css file and a js file that injects the search field into the page. I don't know how to customize the template though, it would cleaner

stuck elbow
#

iirc you just create the file you want to override, and sphinx picks that

#

in a _templates directory

manic glacierBOT
jaunty juniper
#

ah I can put html in support_matrix.rst

manic glacierBOT
manic glacierBOT
#

@npendlington @deshipu Yes, this will be possible. MSC, REPL CDC and data CDC, and MIDI will all be togglable individually from boot.py. You will also be able to specify a list of included HID devices, and include your own descriptors if needed, or drop HID entirely. It might also be possible initially to have extra non-composite HID devices so that a boot keyboard is possible, though I may not do that for the first pass.

#

The request is to add alarm and deep sleep to CircuitPython for RPI2040 aka Pico.
Creating this FR here (not a PR) based on the feedback from @ladyada and @dhalbert .

We intend to use RPI2040 for a FIRST innovation project (Go RoBucs Team 4160!) where power consumption is a main factor, as is lowest cost. There already is support for alarm and deep sleep on ESP32 in 6.x.b but those are more expensive, and draw more power.

The current support on ESP32 with 6.1 Beta is illustrated her...

lapis fjord
# manic glacier

So I opened this one up and am chatting here based on what @tulip sleet mentioned. Closed out the wrongly opened Pull Request.. Hopefully this is all in the right place now.

tulip sleet
#

hi, so my question is, why are you targeting the Pico in particular, esp since you want wifi?

lapis fjord
#

Power and Cost.

tulip sleet
#

what are you going to do for wifi?

lapis fjord
#

Airlift at the moment:

tulip sleet
#

so why not use an ESP32-S2 board instead?

#

are you making many copies of this?

lapis fjord
#

I was under the impression that those were more expensive.

#

But it looks like they are $15 ish?

#

Yes. Potentially a lot. The goal is to have a very power efficient platform to collect and upload garden sensor data.

tulip sleet
#

airlift board is $10, pico is $4. Metro ESP32-S2 or Feather S2, etc are ~$20, so not a big difference

lapis fjord
#

We are aiming for lowest power use, lowest cost.

tulip sleet
#

well, if you are really pushing for that, then a cheap module-based project not using CircuitPython could bring the cost way down, but you'd need to use ESP-IDF or Arduino

#

but i thought this was a robotics team project, so it's basically a demo??

#

are you scored on cost?

lapis fjord
#

Yes. It's for the Qualcomm Innovation Contest. One of the FIRST at home challenges.

manic glacierBOT
lapis fjord
#

Yes, it's part of the business plan to hit a certain cost, and to have a useful battery life.

tulip sleet
#

the ESP32-S2 can get down quite low when sleeping.

lapis fjord
#

CircuitPython is so much easier for the kids, but yea we can go back to Arduino if needed.. They already do stuff on that with limited sucess.

slender iron
#

one chip will always be lower power and cheaper than a two chip solution

tulip sleet
#

there is the assembly cost to consider when using multiple boards

#

the ESP32-S2 modules themselves are about $3

#

so the business plan could include that

lapis fjord
#

Funny you should mention that. One part of the project is for them to design an "All in one" board that sockets in a RP2040 board.

slender iron
#

if you don't need wifi, you could use an nrf52840 and bluetooth

tulip sleet
lapis fjord
#

Need either WiFi, or LORAWAN (if we can get that to work).

tulip sleet
#

the all-in-one board will also need a regular ESP32 module

#

so more parts, more complicated

lapis fjord
#

Yep, we could socket an ESP just as easily.

tulip sleet
#

so the single-module solution of ESP32-S2 is the simplest. As a proto board you can use Metro ESP32-S2 or FeatherS2

lapis fjord
#

Yea that certainly has promise.

tulip sleet
#

The Pico has a lot of eyes on it, but a lot of it is name recogntion and very low price

#

there are many similar things

lapis fjord
#

Thank you all for all the great work.

#

Yea the kids are LOVING working on it. So much easier than Arduino IDE and C.

slender iron
tulip sleet
#

just to make sure, you are aware that "ESP32" and "ESP32-S2" are two different thigns

#

(bad naming on their part)

lapis fjord
#

I am seeing that for sure!

tulip sleet
#

so, I hope you can consider a single-module solution; I think it makes sense in this case as a business case

slender iron
#

I edited the readme with offset changes

#

and will implement them today

lapis fjord
#

Absolutely will @tulip sleet !

tulip sleet
#

πŸ‘ i have my second shot in an hour, so will leave in about half an hour

lapis fjord
#

I just got my first.

#

Good luck!

tulip sleet
lapis fjord
#

I think I am good. Want to personally thank all of you for the awesome contributions especially @slender iron more often than not things that I need were implemented by him. πŸ‘

slender iron
#

I'm eligible as of today. waiting to hear about some schedule slots

lapis fjord
slender iron
#

I'm on a couple waitlists

#

and they just opened to everyone 16+ today

tulip sleet
#

i got emails from the medical systems I have been seen in, offering appts

slender iron
#

I just went through my personal email to make sure I don't miss something

manic glacierBOT
#

The request is to add alarm and deep sleep to CircuitPython for RPI2040 aka Pico.
Creating this FR here (not a PR) based on the feedback from @ladyada and @dhalbert .

We intend to use RPI2040 for a FIRST innovation project (Go RoBucs Team 4160!) where power consumption is a main factor, as is lowest cost. There already is support for alarm and deep sleep on ESP32 in 6.x.b but those are more expensive, and draw more power.

The current support on ESP32 with 6.1 Beta is illust...

slender iron
#

looks like the CI is broken for ESP builds

#

is that the issue we fixed by bumping the cache key?

tulip sleet
slender iron
#

k, I'll bump it

manic glacierBOT
#

Adds a dynamic text filter to the support matrix.
Enter module names in the text field to hide all boards that don't have that module in their build.
Prefix a search term with "-" to hide boards that have that module (is it useful ? Maybe I was overthinking it).
Search terms are added to the URL and read from it if present (code borrowed from circuitpython.org).

Here is a live demo (just that page)
https://neradoc.github.io/support_matrix_filter/?filter=i2cperipheral

#
[adafruit/circuitpython] New branch created: tannewt\-patch\-2
#

@kevinjwalters - In my tests I'm seeing that the pulses are accurate after I power cycle the CircuitPlayground. They stay accurate until I change the duty cycle; then they stay messed up until I power cycle the board again. Can you verify whether or not you see the same thing? If so, there may be something not getting reset properly when we set up the PulseOut.

slender iron
#

@tulip sleet any feedback on my protocol updates?

jaunty juniper
#

I opened a PR to implement, and discuss the support matrix filter thing

tulip sleet
#

reading right now; I really like the statelessness of the chunk stuff; re-reading "List a Directory"; you might want to leave more room in the flags bits so you could return more chmod info (like rwxrwxrwx stuff etc).

manic glacierBOT
slender iron
#

@tulip sleet the path is still needed for pure statelessness but it should help determine when things go awry

#

I'm happy to make flags 32 bits

#

though we can change things with a version bump too

#

thanks @jaunty juniper. looks very cool

#

one idea would be to allow clicking the modules to include them further

jaunty juniper
#

like, clicking the module names in the table ?

slender iron
#

yup

jaunty juniper
#

they are links to their respective pages though, so I'm not sure what the best way to do that would be

river quest
#

OSHWA Open Source Hardware Survey –

http://bit.ly/oshwa-community-2021

This only took 10 mins and had some really good questions. This is also a good spot to let OSHWA know if Adafruit’s open-source hardware and software has helped you, your company, or in any way and why/how. From Feather to CircuitPython and the investment in open, we’re looking forward to making and releasing even MORE open hardware and software in 2021!

orchid basinBOT
ionic elk
#

@tulip sleet seems like the NRF port is still kinda stuck. Should I try investigating fixes?

#

STM32 is ready for review, whenever you have time.

tulip sleet
#

jun2sak fixed the hard reset on simulated deep sleep; is there more to do? I have not done a full re-review

ionic elk
#

Just wondering if there's anything I should be doing besides working on the RP2040

#

Are they still not hard resetting on real deep sleep?

tulip sleet
#

i thought they were, but they were also doing hard a hard reset on fake deep sleep, and then fixed that?

#

i don't remember really, yes, you are much closer to it now than I am, if you are willing to re-review and test. I just did a smoke test and ran into the reset problem, so I can try that again

ionic elk
#

Sure, I can try digging in a little more. I'm just weak on NRF stuff, I don't really get the whole system on/off stuff so well

#

Does the NRF shut down RAM in deep sleep? Or does it keep it, like the RP2040 does?

tulip sleet
tulip sleet
#

@slender iron do you remember which other libraries you changed when you added .from_entry()? Now a received advertisement always goes through __init__(). I had to take note of this case in adafruit-ble-adafruit, and just want to make sure it's the case in the other libraries you had to edit.

slender iron
#

I had a list in the related issue

#

or maybe that was packet_size

#

looks like just eddystone

manic glacierBOT
#

I'm not fiddlng with duty_cycle just setting it once in constructor.

I just noticed code can misbehave in a way I've not seen before on 6.2.0. The output can stop showing up on serial console and control-c doesn't work but CIRCUITPY is accessible and still works. The code can also get stuck but CIRCUITPY still ok, that's weird combination.

ionic elk
#

Does anyone know what the difference between RP2040_M0_0 and RP2040_M0_1 is for the pico using Jlink? The wiki doesn't say

blissful pollen
#

the core you access?

ionic elk
#

@blissful pollen I guess? What would the difference be? I didn't have options for that kind of thing on the STM32 dual core H7s

blissful pollen
ionic elk
#

There aren't any variations of the RP2040, right? So I think your guess is probably as good as any

blissful pollen
#

As far as I've heard they're all the same, just the one chip

tulip sleet
#

i think there have been 2 revs of the chip

ionic elk
#

how would I know which one I have?

tulip sleet
#

... but looking in the RP2040 errata, the chip designations are RP2040B0 and B1, so I think it's more likely the core

ionic elk
#

oh boy, I just tried loading onto the RP with Jlink and all it does is hardfault now. I don't suppose we might have a guide or something somewhere, would we?

tulip sleet
#

i think the support for loading the external flash through J-Link is either non-existent or could be flaky. Have you upgraded the sw recently? Early on Scott loaded by hand and debugged with the J-Link, because there was no support for flash loading

ionic elk
#

oh no wait, maybe just a Jlink fluke, it seems to be working now

#

was weird, it was dropping into the ISR Hardfault for a little bit. Good to know it's kinda flaky, I'll keep an eye out for new updates from Jlink.

#

Do custom builds overwrite the existing UF2 bootloader or steer around it?

blissful pollen
slender iron
#

@ionic elk you want _0 for core 0

#

that's where CP runs

manic glacierBOT
#

I'll look into that tonight then,and once I get something I'll post it here.

In the meantime, I tried the same code in the code.py file and also noticed the same behavior, except that I could not get back any kind of control with CTRL+C or CTRL+D.
And after leaving it for a 5-15 seconds, the onboard LED seems to be displaying an error code:

When importing the wifi module:
1x Long Green
1x Long White
1x Short Pause
2x Short Yellow
1x Short Pause
9x Short Blue

When conn...

manic glacierBOT
hollow token
#

Oh hey, its me

onyx hinge
#

@tulip sleet @slender iron If you have comments, here's the draft API for the 'parallel capture peripheral': ```python
class PCC:
"""Parallel capture peripheral"""

def __init__(
    self,
    data0,
    pixel_clock,
    vertical_sync,
    horizontal_sync,
    data_count=8,
    pixel_clock_invert=False,
    vertical_sync_invert=False,
    horizontal_sync_invert=False,
):
    """Initialize the parallel capture peripheral with the given settings"""
    ...
def capture(self, buffer, width, height, bpp=16):
    """Capture a single frame into the given buffer"""
    ...
def deinit(self):
    """Deinitialize this instance"""
    ...
def __enter__(self) -> PCC:
    """No-op used in Context Managers."""
    ...
def __exit__(self) -> None:
    """Automatically deinitializes the hardware on context exit. See
    :ref:`lifetime-and-contextmanagers` for more info."""
    ...
#

all initialization of the camera itself is assumed to be done in Python

tulip sleet
onyx hinge
#

@tulip sleet self, *, data0,... ?

tulip sleet
#

yes

onyx hinge
#

OK

slender iron
#

I'm worried that API is very specific

tulip sleet
#

is there a PCC-style peripheral in other families?

onyx hinge
#

Apparently we think esp32-s2 and rt10xx both have similar peripherals

slender iron
#

I imagine a PIO can be used for it

onyx hinge
#

and yeah pio

#

dragon is working on the pio implementation recently

tulip sleet
#

did you look at the other peripherals to see what was common?

#

or could be generalized?

slender iron
#

can you abstract away the camera specific terms and still have enough to use for cameras? make it generic ParallelIn

#

I think making a PR would be good. That way we can comment/discuss inline

onyx hinge
#

The very lowest level code is quite concerned with the H & V sync

#

I don't have a "non-camera" use case to consider trying to accomodate

#

I should take the time to watch your presentation though πŸ˜€

slender iron
#

I was just thinking "capturing parallel data"

#

this iteration feels very "inside out" because the class name matches the peripheral and the arguments aren't explained on their own

#

if you do want to make it camera specific then I'd call it CameraCapture, VideoCapture or ImageCapture

#

it is good that the API is minimal

onyx hinge
#

The majority of the complexity seems to be in configuring the camera via i2c, and that seems to be working

slender iron
#

πŸ‘

onyx hinge
#

I can name the pins different things -- data_clock instead of pixel_clock is a no-brainer. horizontal_sync is kind-of data-valid, but you also need to know how many valid samples there are per burst (the width), to use the low-level code

slender iron
#

why do you need to know the width?

onyx hinge
#
void OV7670_capture(uint32_t *dest, uint16_t width, uint16_t height,
                    volatile uint32_t *vsync_reg, uint32_t vsync_bit,
                    volatile uint32_t *hsync_reg, uint32_t hsync_bit) {

  while (*vsync_reg & vsync_bit)
    ; // Wait for VSYNC low (frame end)
  OV7670_disable_interrupts();
  while (!*vsync_reg & vsync_bit)
    ; // Wait for VSYNC high (frame start)

  width /= 2;                             // PCC receives 2 pixels at a time
  for (uint16_t y = 0; y < height; y++) { // For each row...
    while (*hsync_reg & hsync_bit)
      ; //  Wait for HSYNC low (row end)
    while (!*hsync_reg & hsync_bit)
      ;                               //  Wait for HSYNC high (row start)
    for (int x = 0; x < width; x++) { //   For each column pair...
      while (!PCC->ISR.bit.DRDY)
        ;                     //    Wait for PCC data ready
      *dest++ = PCC->RHR.reg; //    Store 2 pixels
    }
  }

  OV7670_enable_interrupts();
}
#

you start capturing at the proper edge of hsync, then you capture for width-times

slender iron
#

maybe because that's faster than checking hsync?

onyx hinge
#

also, I don't know if for all cameras, hsync is active for the whole row or is just a pulse

#

Limor emphasized that polarities need to be chooseable (even though they aren't in the code I pasted)

slender iron
#

so the pcc itself has two enable pins

#

plus clock and data

onyx hinge
#

here's what a full frame looks like fwiw

slender iron
#

so VS is enable high and HS is enable low

onyx hinge
#

of one particular camera

slender iron
#

basically allowing you to ignore clock cycles

#

and VS is also the "trigger" you want to align the capture to

#

imx rt uses flexio for it. section 41.5.8 in the 1010 RM

#

esp uses i2s

onyx hinge
#

yes, or at least esp32 does.

slender iron
#

I'm look at the s2 trm

onyx hinge
#

ok good

slender iron
#

9.11.1

#

my local version is probably old

#

the version number is the same but mine is missing a number of sections at the start

#

I wonder if they mis-generated it πŸ™‚

#

openmv is the other place to look

#

though it looks like they do all camera controls internally

onyx hinge
#

I was not aware of the HSYNC/HREF distinction, since I'm operating from a sample of 1 camera

slender iron
#

ya, me neither

#

I only see it on the s2

#

could be an artifact of being for other formats as well

onyx hinge
#

zoomed in, it looks like the H-signal I have might be href

slender iron
#

ya, seems that way

#

I think you could make it generic by saying vsync is "trigger" and href is "enable"

#

or you can lean into camera-ness and just document them all as such

#

leaning into the camera capture would allow you to expand into the pixel format stuff later

onyx hinge
#

this camera does support 2 formats (RGB565 and YUVmumble) I think

slender iron
#

but disallow using it for generic capture

onyx hinge
#

(but this layer doesn't know about that, it's at the camera-config layer)

slender iron
#

right, and post processing can always do it

#

but there may be a world where we want to pipe camera directly into a displayio.Bitmap or something

#

it could be a "PixelIn" object

#

maybe in pixelio that can do output to an rgb display

#

since it's basically the same protocol

#

samd51 doesn't have a peripheral for output though

onyx hinge
#

well see that's the awesome thing

#

we have the pieces for that

#

pcc.capture(bitmap, bitmap.width, bitmap.height, bitmap.bpp); bitmap.dirty()

#

because a bitmap is now a WriteableBuffer

manic glacierBOT
manic glacierBOT
#

I'd really like this for a project I'm building to allow the 2nd core to handle a bunch of additional IO tasks while the first core is on input detection.

This would be a valid usage for this. Use one core for IO, DSP, computation, interface, real time, etc. The memory design of the RP2040 is fairly strong. However the IO design is not as strong. DMA and CPU can compete for the lower and upper IO region. However you could partition the upper region to one and the other to the other one.
...

#

My limited understanding is that Circuitpython is, or started out as, a fork of Micropython. Micropython supports multitasking, locks, and inter-task globals on the Pico. Can a Circuitpython developer comment as to the difficulty of implementing this on Circuitpython?

MicroPython uses python for both cores. I believe the suggestion here is to use C/C++ or assembly for the secondary core. Each has there own set of confusion. Python on both may be a little more straightforward in high leve...

#

My limited understanding is that Circuitpython is, or started out as, a fork of Micropython. Micropython supports multitasking, locks, and inter-task globals on the Pico. Can a Circuitpython developer comment as to the difficulty of implementing this on Circuitpython?

It's really hard to say because none of us have looked into it.

Right now we're based on MicroPython ~1.9.4 (https://github.com/micropython/micropython/commit/25ae98f07cb3c4488cb955403dfe56b8bb8db6f0) which is a year or ...

slender iron
#

@tulip sleet for the file transfer protocol: what do you think about me adjusting the packet format so the 32-bit ints are 4-byte aligned

#

that'll make them easier to parse in C

manic glacierBOT
manic glacierBOT
#

I'm confused about USB vs USB_AVAILABLE. Did you find who defines USB? Could you merge the uses of these to into a single toggle, like CIRCUITPY_USB_AVAILABLE or CIRCUITPY_USB?

There's an #if USB_AVAILABLE (not #ifdef) in litex/supervisor/internal_flash.c.

It would also be good to not use #ifdef USB_AVAILABLE, but instead always define it as 0 or 1, and use #if USB_AVAILABLE (or some new name).

manic glacierBOT
#

As a work-around I'm using a hardware hack leveraging the information from:
https://learn.adafruit.com/adafruit-pdm-microphone-breakout/circuitpython
Namely, I've set D5 and D6 to digital inputs, set D1 as CLK and D12 as DATA in the code, then routed jumpers from D1 --> D5 and D12 -->D6. Using the PDMIn code in this configuration shows clear response to audio input (covering the mic significantly diminishes the RMS of the measurements).

I can't find D1? Please suggest.

#

I'm confused about USB vs USB_AVAILABLE.

USB is a makefile variable, USB_AVAILABLE is a C definition: both were added in 9d91111, but apparently both stayed unused -- except in litex/supervisor/internal_flash.c since 786e79e, which would never work as intended because USB_AVAILABLE is either empty or undefined.

Did you find who defines USB?

None of the in-tree targets; a target would inevitably fail to compile if it did.

microbit_v2, when/if added, should become t...

manic glacierBOT
#

@tyomitch - Hi, I was worried about some builds growing while others shrank, based on the graphs above, which might simply cause overflows for other different languages. I wondered if there was a formula that showed nearly reductions more uniformly.

Sure; my point above was that if the biggest translation per board shrinks, it doesn't matter if other translations for the board grow.
For completeness, the graph below shows the effect on the biggest translation for each board:

![image]...

onyx hinge
#

@tulip sleet if you know -- when a samd51 pin is set to a special function, can it still be used as an input (in C)?

tulip sleet
#

it has to do with the circuitry; looking ...

#

i think not

onyx hinge
#

thanks, I hate it

tulip sleet
#

But this is confusing, it might work, because I thought you could set the pulls on a pin set to a function - maybe not

onyx hinge
#

it seems like it must be working

#

I mean, something's broken or I wouldn't be asking πŸ™‚

#

er, it's the peripheral that's not acting like it sees the data, not the as-GPIO

#

probably missing a clock enable or something?

manic glacierBOT
onyx hinge
#

@tulip sleet my problem was setting the wrong peripheral in the pinmux

manic glacierBOT
#

Personally, I'd prefer if CircuitPython offered "more difficult" to use features such as _thread because I really just want to get this done and I know how to handle myself with concurrency and memory access.

I'd really want Python on the 2nd core because frankly all my IO tasks are laid out with CircuitPython libraries, so if I had to write C for it I might instead just move to MicroPython instead and re-implement the libraries I'm currently using in MicroPython.

manic glacierBOT
manic glacierBOT
#

The built-in struct tests are using the "modstruct" version, so either we need to circuitpythonify the "unix" build so it can use the shared-bindings version, or you need to

diff --git a/py/modstruct.c b/py/modstruct.c
index 1c5319608..8f78fa234 100644
--- a/py/modstruct.c
+++ b/py/modstruct.c
@@ -214,9 +214,11 @@ STATIC void struct_pack_into_internal(mp_obj_t fmt_in, byte *p, size_t n_args, c
             p += cnt;
         } else {
             while (cnt--) {
-           ...
manic glacierBOT
manic glacierBOT
#

Firmware

Adafruit CircuitPython 6.2.0 on 2021-04-05; Raspberry Pi Pico with rp2040

Code/REPL

import board
import busio
import bitbangio
from adafruit_bus_device.i2c_device import I2CDevice

i2c = busio.I2C(board.GP17, board.GP16)
# i2c = bitbangio.I2C(board.GP17, board.GP16)

addr = 0x40

while not i2c.try_lock():
    print("i2c not locked, retrying...")

print("i2c initted")

dev = I2CDevice(i2c, addr)  # if we try to pro...
manic glacierBOT
#

The problem for me is that using circuitpython on the Pico means throwing away half of the machine. I don't really see C++ on the 2nd core as a solution. Most people who use circuitpython do so for the advantages that it offers over C++. I'm not sure how the decision making works as to which features get to the top of the list but it would be great to see this get prioritized. I've been using micropython, but that means rewriting a lot of the hardware drivers that already exist in Circuitpyth...

manic glacierBOT
manic glacierBOT
#
[adafruit/circuitpython] New branch created: dhalbert\-pico\-gp24
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

in python the garbage collector can run at anytime - theres no such thing as true guaranteed real time task handling in interpretted python which is why you'd have to do it C.

i'd like to find a solution to the problem, however the problem isnt clear yet - USB tasks out every 1ms, its not 'instant' either. some really specific numbers or complete example code would be useful. if it cannot be measured, we cannot improve it :)

lone sandalBOT
manic glacierBOT
jaunty juniper
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

GamePadShift is an essential component of some Adafruit boards (read: PyGamer), but is not very... beginner-friendly. BetterPad aims to fix that. It's a small wrapper over GamePadShift that makes it far easier to use. It provides one class, BetterPad. This class takes the same parameters as a GamePadShift class, and has one function: getPressed. This function returns a dictionary in this format: {"a": True, "b": False, ...} where the value of each key corresponds to the state of the but...

#

Firmware

Adafruit CircuitPython 6.2.0 on 2021-04-05; FeatherS2 with ESP32S2
# vs.
Adafruit CircuitPython 6.2.0 on 2021-04-05; Teensy 4.1 with IMXRT1062DVJ6A

Code/REPL & Behavior

This works on 6.2.0 on a FeatherS2, with a SHT31D connected, but no SHT40 connected:

import board

i2c = board.I2C()

try:
    import adafruit_sht4x
    temp_dev = adafruit_sht4x.SHT4x(i2c)
    t = temp_dev.temperature
    print("SHT40", t, "Β°C")
except (...
#

@ladyada This can be done, however circuitPython will need to scope it in some manner. C/C++ API is one approach, which manages resources. This may be required even for the Python version, but hidden. There are other approaches. How you plan to scope the role of the secondary core is probably the leading question. The official scope of circuitPython is indirectly referenced here.

There is a coherency issues regardless in at least three places. This is kind of true for C and Python. However...

hollow token
#

@tulip sleet RE 4106,
Thanks for the suggestion but I have some pretty unique hardware and feature requirements for my project and I think only mpy can serve them right now.
If you're interested my project is here: https://github.com/Red-M/RedPycoKeeb
MCP IO expanders, key remap/macro, in board configuration and built in macropad via a screen.

manic glacierBOT
manic glacierBOT
fossil gorge
#

Quick and simple question, hopefully. I thought I remembered hearing or reading that when a PR is ready, there was a group, maybe "CircuitPython Librarians", that should be mentioned in the GH issue, or maybe elsewhere. However, I don't see any name close to that in the "@" mentions in either location.

meager fog
#

its a group that can be assigned to an issue

#

ya cant at them tho πŸ™‚

mental nexus
#

@still zephyr I’ll have a little time this week. Do you have a specific widget from your queue of awesome widgets you’d like me to look at?

still zephyr
#

πŸ™‚

#

kmatch really?

#

give me a sec, I am talking with hugo

manic glacierBOT
#

This arose from an issue on [Discord](#help-with-circuitpython message). I don't have this board to try it out.

Firmware

Adafruit CircuitPython 6.2.0 on 2021-04-05; Adafruit Feather M0 Adalogger with samd21g18

Code/REPL

In https://github.com/adafruit/Adafruit_CircuitPython_ServoKit library:

i2c = board.I2C()

Behavior

code.py output:
Traceback (most re...
mental nexus
#

No rush, just let me know what you want me to look at and I’ll look at it this week, just thinking through my plans for the week. But may lose a day or two depending upon how the second vaccination dose goes midweek!

manic glacierBOT
meager fog
#

@mental nexus great memory guide!

still zephyr
#

@mental nexus are you around still?

still zephyr
fossil gorge
mental nexus
mental nexus
still zephyr
#

And also the color palette needs to be refactored

mental nexus
#

Ok sounds good. I think the slider is a good example to use to finalize the Control class function names so it’s a good one for me to look at to learn how the touch_move function can work.

#

Or whatever name it ends up being called.

manic glacierBOT
#

Tested it with a Sparkfun I2C SerLCD wired to the M0 adalogger.
Using both busio and board.I2C to make sure I didn't wire it wrong. ;)

import board
import busio
i2c = busio.I2C(sda=board.SDA, scl=board.SCL)
while not i2c.try_lock(): i2c.unlock()
i2c.writeto(0x72,b"|-") # clear
i2c.writeto(0x72,"Hello")
i2c.unlock()
i2c.deinit()

i2c = board.I2C()
while not i2c.try_lock(): i2c.unlock()
i2c.writeto(0x72," World")
i2c.unlock()

Before the PR: `ValueError: Invalid pi...

still zephyr
#

Agreed, this would be a good example to define the name that we would use for the events

manic glacierBOT
#

And... just when I thought I was done with them, I am getting OSError: [Errno 19] Unsupported operation on i2c writes. Here is the code I am using: gist link
Here's the traceback:

Traceback (most recent call last):
  File "code.py", line 25, in <module>
  File "adafruit_bus_device/i2c_device.py", line 84, in write
OSError: [Errno 19] Unsupported operation

It rarely happens, so I can't make a minimal exa...

manic glacierBOT
manic glacierBOT
hollow token
#

@meager fog I'm right here but I'm busy for about another 30 minutes

meager fog
#

@hollow token i can help you with your project

#

however, you have to be willing to be helped πŸ™‚

hollow token
#

Sorry if I've come off as a bad sport, everything seems to just tell me "no this doesn't work" or "no you can't have this"

meager fog
#

@hollow token no biggie - we're here to solve problems

manic glacierBOT
#

Here is a simplified example that demonstrates the issue:
`
from adafruit_irremote import GenericTransmit
import pulseio
from board import A2
from time import sleep

20% duty cycle at 40kHz.

pwm = pulseio.PWMOut(A2, frequency=40000, duty_cycle=13107)
pulse = pulseio.PulseOut(pwm)
ir_encoder = GenericTransmit(header=[2400, 600],
one= [1200, 600],
zero= [600, 600],
...

crimson ferry
#

Is it too late to flip the easy switch and make QT Py board.I2C() be the Stemma/QT?

#

I guess that would break with SAMD21 though?

#

or more directly, I guess it breaks with the silk

#

what's one more conditional in my code? o_O

jaunty juniper
#

let's add board.STEMMA_QT on both

tulip sleet
#

maybe STEMMA_QT_I2C ?

#

another thing to discuss in In the Weeds

crimson ferry
#

that would be easy (doesn't save me a conditional)

manic glacierBOT
still zephyr
#

@mental nexus how about a Dial + Arrowline -> Analog Clock?

mental nexus
#

Why not?

still zephyr
#

good

#

will try next week, that way I will learn about dial

manic glacierBOT
manic glacierBOT
#

I can't find D1? Please suggest.

Try the TX pin. Please advise if that works or not; If not I'll have access to the old hardware in a few days and can check what I had setup at the time.

I have already tried TX but the readings doesn't change if I speak into the microphone or not. Here is what I did. I jumped D12->D6 and D5->TX. I'm trying to read audio from the inbuilt microphone and I'm running this https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/master/PDM_Mi...

#

@kevinjwalters - sorry I should have been more specific. The USB console
does not seem to have any impact. I
get the incorrect timings after I do anything that writes to the
CIRCUITPY drive (reads seem to be OK)

On Sun, Apr 18, 2021 at 2:22 PM kevinjwalters @.***>
wrote:

@DavePutz https://github.com/DavePutz Is this some sort of deferred
processing due to incorrect interrupt masking then? BTW, when you say
anything over USB does that include connecting to serial console? That'...

manic glacierBOT
#

Watching the live stream from this week's deep dive and thinking about colors. I was thinking something like ...

  • Red for Compile Time Errors (Blink Morse Code "SOS" x2)
  • Yellow for user land thrown and uncaught Exceptions. (Blink Morse Code "Error" x2)
  • Purple for when it's first running the code. (Blink Morse Code "Run")
  • Green for when it gets to code completion. (Blink Morse Code "Done").

SOS = ... --- ...
Error = . .-. .-. --- .-.
...

manic glacierBOT
manic glacierBOT
onyx hinge
#

I still have circup refusing to install modules on a "7.0" CircuitPython πŸ˜•

#

@idle wharf I guess this didn't magically resolve itself

#

oh I guess circup needs released?

#

OK, yeah, I did a pip install . of the git version of circup, then removed the already downloaded bundle. Now it works πŸ™‚

manic glacierBOT
orchid basinBOT
manic glacierBOT
#

Right now, OnDiskBitmap is a bit odd--it kind of has an internal palette or color converter depending on the format of the underlying bitmap file. This has led to bugs (#3834) and made it difficult to implement features we want (#4438).

For 7.0, I basically propose an incompatible change to OnDiskBitmap so that it gets a .pixel_shader property that is to be used with the bitmap. If the bitmap is paletted, it is a Palette otherwise it's a ColorConverter.

6.x Compatibility code can use ...

still zephyr
still zephyr
#

πŸ™‚

#

Basically at that time, we wated to list, and scott request some modifications to allow the library to work with different "bundles" and not only Circuitpyhton and the Community Bundle, that was done. That was the state when I closed the PR

idle owl
still zephyr
#

yeah ping me, it is the best way to get my attention πŸ™‚

manic glacierBOT
idle wharf
#

I won't be able to make the meeting today, and I added an in-the-weeds about repos which might make sense to move to CircuitPython org. I don't think I'm a necessary attendee for that conversation, its just a placeholder for the community to discuss.

idle owl
#

Hello, all! The CircuitPython Weekly meeting is in ~40 minutes. If you wish to participate or have your notes read off during the meeting, please update the notes document with your hug reports and status updates. Thanks! https://docs.google.com/document/d/10lckbM5mFHKpZLjH7k8IeSUo5t8Sa1rkoPA30iuOKDc/edit <@&356864093652516868>

manic glacierBOT
idle owl
#

@onyx hinge I added the community news

modern wing
#

Good afternoon all you wonderful people!

onyx hinge
#

@idle owl thank you! I got the stats ....

idle owl
#

Oh right.

#

I'll update the notes

onyx hinge
#

Hey all, we just broke from our internal meeting so I'll be back in a few to get the meeting going. I'm your host today πŸ™‚

idle owl
#

@slender iron I'm thinking moving forward we should type out our own "Overall" notes. I can never stay caught up with the Core Overall section when I'm supposed to start the Libraries section immediately afterwards.

slender iron
#

πŸ‘

idle owl
#

Thank you!

lone axle
#

When I saw the big emoji (old school - smiley) on Carter Nelson’s RGB Matrix Portal Room CO2 Monitor project on Adafruit, I knew he was on to something. I wished that I would begin seeing more such displays in places like restaurants and shops, not to mention school classrooms, offices and makerspaces in the coming months. In Carter’s Adafruit p...

ionic elk
#

do we have charts of the downloads week over week?

idle owl
#

@ionic elk No. But the data is available. If you want to make one πŸ˜‰

ionic elk
#

It's kind of tempting, to look at the data over a multi-year period

#

Have we recorded them in a single document? Or would it be mining all of the prior google docs?

idle owl
modern wing
#

As someone who massages data, what sort of output would we want to generate? Is the data in a CSV/excel format?

ionic elk
#

A general website for open source project health would be neat, tbh. Looking at the PR and issue resolution frequency for various hardware/software Github projects

#

if that doesn't exist already, which it might

lone axle
#

🚁

blissful pollen
#

Their first flight went MUCH better then my first remote control plane flight, and it was on another planet

modern wing
#

@blissful pollen Solution to that is to go to another planet, obviously πŸ˜‰

thorny jay
#

I hope my notes are ok. I am text only and late.

blissful pollen
#

You can read mine I'm expecting a call

modern wing
#

@ionic elk The web part is a bit outside my wheelhouse, I'm stronger with standalone data manipulation.

#

πŸ’‰ πŸ‘

tidal kiln
slender iron
#

@deep saffron did you delete your status update?

deep saffron
idle owl
thorny jay
#

Maybe the name of the file should be as a comment on top of the file...

slender iron
#

πŸ‘

tidal kiln
#

i think altitude is via lidar @onyx hinge

thorny jay
#

@mental nexus if you make any progress with the Teensy, I am interested. I fail to use the hardware specific tools to upload the hex file for CP. Maybe it's my PC (need to try another OS and/or other computer) or the Teensy as I never really used it.

idle owl
#

@lone axle Great!

lone axle
mental nexus
solar whale
#

Sorry to have to miss the rest of the dicussions -- will catch up via the video. Have a great week all πŸ‘‹

lone axle
#

I think you might be able to ping @circuitpythonlibrarians in a github comment to get a notification to everyone on the team perhaps?

#

yep, I'll give it a try

crimson ferry
#

may have been asked, but there's no way to automatically assign @circuitpythonlibrarians as default reviewers on all libraries?

lone axle
#

it might need to be @adafruit/circuitpythonlibrarians. It did offer to autocomplete that for me with the adafruit/ infront of it.

thorny jay
#

Usually, if I know someone has the hardware, I would ping that person. Like for the PM25 sensor, I may have ping @idle owl .

lone axle
#

whoops, didn't mean for that to ping adafruit here

crimson ferry
#

@lone axle is that when not logged in?

thorny jay
lone axle
#

I was logged in.

blissful pollen
#

I got the e-mail about the test ping @lone axle

slender iron
#

@deep saffron I added you to circuitpythonistas role so you have voice permission

deep saffron
#

oo ok

slender iron
#

up to you if you want to speak

thorny jay
#

Or come here and ask?

tulip sleet
crimson ferry
#

But can people without a Github Adafruit role tag @circuitpythonlibrarians?

fossil gorge
#

That's what I was wondering, but don't want to test and mass-ping

tulip sleet
#

i think so, it's just an @ name; it just won't autocomplete

thorny jay
thorny jay
#

Can we have both? with one with a #

#

Because Pico user will need help.

idle owl
#

It is clarified in the Pico guide.

#

In a very detailed manner.

thorny jay
#

There are "big Stemma" too.

crimson ferry
#

PyPortal

thorny jay
#

PyGamer?

#

I had to cut something on my PyPortal.

crimson ferry
#

adapter cable + solder voltage jumpers

thorny jay
#

Do you have adapter cable that go from 5V to 3V. πŸ™‚

idle owl
jaunty juniper
#

big or small it would still be board.STEMMA_I2C I think

still zephyr
#

Question, regarding my topic, so how do I document the old libraries? busio, still? I could mention that it will change in the future?

slender iron
tulip sleet
#

you don't need to test: it's equivalent

still zephyr
#

no problem will do.

ionic elk
#

Hi Simon!

tulip sleet
#

@still zephyr Like I suggested, you might add a comment for beginners like:

i2c = board.I2C()   # uses board.SCL and board.SDA
still zephyr
#

But we will have a mismatch between, code and learning guides, is that ok?

tulip sleet
#

some learn guides use board and some use busio. It's ok: we can revise the guides later

still zephyr
#

spi, also?

lone axle
#

some learn guide sections are "included" via github so changes will get carried over automatically.

still zephyr
#

how about when SPi needs a frequency specification for certain sensors?

lone axle
#

if it's learn guide sections that aren't linked to github and need to be updated you can ping me if you'd like I have access to make fixes in most places within learn.

tulip sleet
#

i think it's less important for SPI because you don't usually have more than one device on the SPI bus

still zephyr
thorny jay
#

Per hardware library.

still zephyr
thorny jay
#

Some library support multiple revision or multiple sensor or multiple hardware that use the same "chip".

still zephyr
tulip sleet
thorny jay
#

Already eliminating the import I added to my code and did not use would be usefull...

#

But that is for user code.

still zephyr
thorny jay
#

Gemma M0 and Trinket M0

lone axle
#

I find myself running out of space on the MagTag

jaunty juniper
#

it was about the animations library on the Neo Trinkey

#

which is a non express M0

thorny jay
#

I had to cherry pick the file I needed...

#

And reduce the size of some.

#

So I was on a road to a small version of animation that would fit on tiny board.

#

I think I wanted to do a QT Py CO2 sensor, before the QT Py RP2040 and without soldering the flash. So I needed a way to blink the RGB and say the CO2 Level. A bit like what @slender iron did in the last Deep Dive.

blissful pollen
#

@idle owl if you need help trying to change the animation library let me know, i spent quite a bit of time poking at it making my own animations so probably still have some of that in my head

cobalt grail
#

πŸ‘‹

idle owl
modern wing
#

Thanks everyone!

manic glacierBOT
#

For convenience, we can add a board.STEMMA_I2C() singleton (analogous to board.I2C()) to designate the I2C bus attached to the STEMMA connector on boards that have those conenctors. On some boards, board.I2C() and board.STEMMA_I2C() would be the same (e.g. QT Py SAMD21); on others they are different (QT Py RP2040).

We will call it STEMMA_I2C instead of STEMMA_QT_I2C because some older boards have larger (non-"QT") STEMMA connectors.

onyx hinge
#

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/1IBhFVC1LdW_ptX07F6KpWOSZBpEv2eZWFguEIP4nJio/edit?usp=sharing

onyx hinge
#

Happy to!

slender iron
#

I'm happy to add you to the team if you like

low sentinel
#

I did not. It 404’s for me!

slender iron
#

ok, good to know

low sentinel
#

Is this a graphics or widgets api conversion?

#

I could join in.

slender iron
#

ok, invite sent

#

we should figure out a public place to discuss

uncut nexus
#

@slender iron - I'm looking at issue #4602 - inconsistent PulseOut timings on CPX. What I'm seeing in the timer interrupt handler is that the compare register is often up to 250us lower than the count register after doing writes to CIRCUITPY drive. Without the writes it is always 2us different. Any thoughts where I should be looking?

slender iron
#

@uncut nexus do you think that the counter is wrapping around?

uncut nexus
#

no - I've checked for thAT

slender iron
#

that makes it sound like it's firing too early

uncut nexus
#

firing too late - COUNT is higher than CC[0]

slender iron
#

firing too late could happen if a higher priority interrupt is active

uncut nexus
#

once it is incorrect it stays that way until a hard reset

#

nothing else should be going on - I've even commented out the call to RUN_BACKGROUND_TASKS with no impact

slender iron
#

weird!

uncut nexus
#

I'm thinking we're not clearing out something when we create the pwmio/pulseout objects that has been affected by writing to USB. But, I can't figure out what.

manic glacierBOT
slender iron
#

did you try disabling auto-reload?

#

there is the autoreload timer but I didn't think that used any TCs

uncut nexus
#

no - I can try that. But I'm running my test script manually, not using code.py

slender iron
#

ah, so it's already disabled in the REPL

uncut nexus
#

I've never looked at the fatfs code - any chance something in there would be affecting timers?

slender iron
#

not that I can think of. maybe there is a buffer overflow somewhere

uncut nexus
#

reading & writing the USB console doesn't affect things

#

just writing to CIRCUITPY

slender iron
#

the compare is set correctly but the interrupt is delayed after writing right?

uncut nexus
#

yes, compare is correct.

tough flax
#

quick question - on the QT PY RP2040, should I be using SDA/SCL as the pin names when I use the STEMMA port? I'm getting missing pullups error but there are pullups

tough flax
#

Thank you!

manic glacierBOT
#

This is kind of a trivial note but how will this activate with regards to deep sleep? Currently, while waiting for USB to enumerate, Deep Sleep iterates constantly over the tick_rgb_status_animation call in main. There is also the general difference between true and fake deep sleep in terms of how they trigger a restart, and the fact that chips like the RP2040 which do not reset their own flash may always use the fake deep sleep method. I have no real preference on the actual specifics of t...

uncut nexus
#

@slender iron - thanks ! I'll see if playing with that yields any fun results.

manic glacierBOT
slender iron
#

sorry I don't have any better ideas

uncut nexus
#

no problem - you gave me at least one more avenue to follow

slender iron
#

you could also build before that PR to see if it's the culprit

#

I suspect it is

orchid basinBOT
misty garnet
#

any estimate of the i2c_peripheral for RP2040 difficulty level? just wondering if I have a shot at helping out

manic glacierBOT
tulip sleet
misty garnet
#

will do, thanks

idle owl
# tough flax Thank you!

We're planning to add board.STEMMA_I2C in the near/far future that will work for the RP2040, but also on other boards with STEMMA connectors. So that might help, but not immediately. What Neradoc said is obviously the immediate answer.

tough flax
#

All good - I have something amazing working πŸ™‚

#

Want a picture?

idle owl
#

Yes!

jaunty juniper
#

the port is marked I2C1 on the silkscreen, would be encumbering to also alias it to board.I2C1 ?

tough flax
idle owl
idle owl
tough flax
#

So, that is a STEMMA QT board that replaces our entire FreedomWing - provides 12V to the wheelchair joystick and "just works" with 50 lines of CircuitPython

tough flax
#

One of our members (Dmitrii Votintcev) designed it. Total cost (assembled) should be < $10

idle owl
#

Oh the connector is built into it! I thought it was pins into the connector. That's even better!

tough flax
#

Yes, it's 100% STEMMA QT compliant

idle owl
tough flax
#

I will have him join me next wednesday to show it off (Chris Young is on this week w/his IOT IR Remote)

#

Look how tiny it is! πŸ™‚

idle owl
#

Right?!

tough flax
#

It has the ADS1015 differential ADC on it... because you have a CP driver for it πŸ™‚

#

I have raw values now - adding the HID Mouse stuff before our 8pm meeting

idle owl
#

Very cool.

tough flax
#

Seriously took me 20 minutes + figuring out the secondary I2C bus to get this working

#

You guys rock

idle owl
#

Thanks πŸ™‚ This is what we're striving for.

#

I submitted a talk to a conference called "The First Five Minutes" and it's about how the initial experience anyone has with your project is crucial to whether they'll stick with it. And I'm planning to show what the first five minutes of CP is for folks, to the best of my non-beginner ability.

#

I have a CPX and a CPB that are still mint in box to use so I can get as close to real as possible.

#

Anyway... That's the point. From start to finish in 20 minutes, and a successful experience.

manic glacierBOT
#

The problem for me is that using circuitpython on the Pico means throwing away half of the machine. I don't really see C++ on the 2nd core as a solution. Most people who use circuitpython do so for the advantages that it offers over C++. I'm not sure how the decision making works as to which features get to the top of the list but it would be great to see this get prioritized. I've been using micropython, but that means rewriting a lot of the hardware drivers that already exist in Circuitpy...

tough flax
#

So... as awesome as that is, @idle owl it's not really our #1 driver for using CP... it's that our end-users can configure and even modify the code directly. We have a guy in Seattle that's using our sip & puff device... to edit the CircuitPython code that runs the Sip & Puff device... how cool is that

jaunty juniper
#

is there a way to test the CI in like a mock-up environnement to see if a command is [not] triggered properly ? I think the test to add for 4632 is github.ref == 'refs/heads/main' on push, but...

tough flax
#

Mouse works

idle owl
#

And I can understand that entirely. With you helping folks all over the place, you can't exactly go to every one of them to edit their setups. They can do that themselves this way.

#

Nice!

tough flax
#

How long was that? 5 min?

idle owl
#

Maybe πŸ˜„

tough flax
#

(I mean I've done it before.. but)

#

Here's the code. It's pretty basic - read the ADS1015 as two differential inputs from the joystick. Map them to mouse movement with a tiny bit of sanity checking.

tidal kiln
#

@tough flax ^^ awesome stuff ^^

manic glacierBOT
#

Valid usage: Crypto-Processor. May support 3Mbps AES-256 with 133MHz. M3/M4 may do 13Mbps with 80MHz.

https://www.bearssl.org/speed.html
https://github.com/Ko-/aes-armcortexm

Valid usage: Graphics Processor. Drawing Mandelbrot algorithm can be stressful on lower end CPUs.

Valid usage: IO Controller. Tight timing and event resolution.

Valid usage: Signal Processor. AI/ML/DSP/etc.

Singleton for secondary core? Make supported classes implement runnable? Not sure I am crazy about ...

manic glacierBOT
fiery silo
#

hi all, seeking some guidance as I try to port circuitpython to a new MCU (the SAM L22). I've made it as far as bringing the SAML22 support files into a fork of the asf4 submodule, and setting up a new family in samd-peripherals. My thought was to do this inside the atmel-samd port, because the chips are quite similar. alas, I'm running into a challenge in that port's common-hal, DigitalInOut.c specifically

#

in the common_hal_digitalio_digitalinout_set_value method, two functions seem to be undefined (hri_port_clear_DIR_DIR_bf and hri_port_set_OUT_OUT_bf). it looks like these functions exist in the HRI for all the SAMD and SAME chips (i.e. hri_port_d21.h), but not for the SAML22 (hri_port_l22.h)

#

the L22 does however have hri_port_set_DIR_reg and hri_port_set_OUT_reg functions that address the same registers, and i think that these two could be used to accomplish the same thing that clear_DIR_DIR_bf and set_OUT_OUT_bf are doing, if i swapped them out in DigitalInOut.c

#

but before i went down that path, i figured i would reach out here and see if i'm missing something crucial or if y'all have any guidance on what i might want to do here. thanks!

tulip sleet
fiery silo
tulip sleet
#

we are not very happy with ASF4 - it is very cumbersome to use for what we want to do. ASF3 was more straightfoward.

manic glacierBOT
#

Firmware
Adafruit CircuitPython 6.2.0 on 2021-04-05; Adafruit Circuit Playground Bluefruit with nRF52840

Behavior
This code allows two bluetooth devices (iPhone, iPad, Android, PC, etc.) to connect as a central and bond to the device.

When "kl1.write(c)" is called on line 71, the keystroke is sent to BOTH devices, not just the one connected to kbd1.

It seems there is no way to associate a Service (HIDService in this case) with just one of the connections - nor is it possib...

gloomy shuttle
# tough flax

is that stemma qt db9 connector available somewhere or is it custom?

tough flax
manic glacierBOT
slender iron
#

@atomic summit @crude blaze @stuck elbow just watched makercast. good discussion! I wanted to clarify that I'd merge interrupt support into circuitpython if someone did the legwork and made a PR. I wouldn't have us at adafruit do that work though for the reasons you mentioned. πŸ’€

idle wharf
manic glacierBOT
onyx hinge
#

(I liked the old github cards better; I suppose I'll get used to it)

idle owl
#

@still zephyr Hello! Do you have permission to merge PRs on Adafruit CircuitPython library repositories? I notice you approved the update to hashlib but did not merge it. Is there a reason for that?

idle owl
#

@still zephyr Looking at it, it looks like the.gitignore on cookiecutter is already more robust than many of the libraries. So all new libs are doing better than the current libs. I'll still file an issue in case we can improve it further.

#

@tulip sleet Is it ok for me to file an issue about updating the .gitignore on the CircuitPython issue list so it is more visible? I'll label it "Libraries".

tulip sleet
#

sure

idle owl
#

Thanks

manic glacierBOT
#

We should update the .gitignore on the libraries to be more robust. There are plenty of good options to start with. We already include the PyCharm and VSCode directories in the cookiecutter version, but the current libraries do not all have that included. I think we should discuss here what to add before considering applying a patch to all the current libs to bring them up to date with our current working version. I will also organise and comment the final version so it's clearer.

Ther...

still zephyr
idle owl
#

@still zephyr See? Exactly! That's how it goes πŸ˜„

still zephyr
idle owl
#

You can go ahead and merge it if you like! Dylan was asked to request my review on all PRs relating to the Pylint update, but it doesn't mean I need to review them.

idle owl
manic glacierBOT
idle owl
#

@onyx hinge I have been pronouncing Sensirion wrong for three years until I heard you say it in the meeting yesterday. I left out the last "i" apparently.

#

Looks like I'm not the only one who leaves it out.

crude blaze
crimson ferry
#

I always left the "i" out too, but then heard ladyada say it on some videos and double-checked the spelling

onyx hinge
#

@idle owl I need to add a fresh library to the bundle. Can you walk me through it, or point me at someone who can?

idle owl
#

I can help if the guide isn't clear.

onyx hinge
#

yes, I can transfer it

#

I think I may not have the permissions to do stuff like RTD though

idle owl
#

It's basically do a git submodule add, and then update the drivers.rst file.

idle owl
#

I think.

#

Might need to add you to a thing. I'd have to check.

onyx hinge
#

I have a personal RTD account

tulip sleet
#

i usually do it logged in as adabot on rtd

idle owl
#

Ok, let me finish this blog post, and then I'll look into it.

onyx hinge
idle owl
tulip sleet
#

rtd is very fiddly

idle owl
onyx hinge
#

sounds great @idle owl thanks

#

It's not a rush-rush, because it only works with unreleased-7.0 with a PR that's not merged yet πŸ™„

#

in fact it may not make sense to bundle it yet, but it would be nice to get it readthedocsing

idle owl
#

@onyx hinge Ok. Give me a minute to look at RTD. Then I'll walk you through getting it going.

still zephyr
#

I got showcased in the Newsletter Thank you Kattni πŸ™‚

idle owl
#

You're welcome! Thanks for creating!

#

@onyx hinge What is your personal RTD username?

onyx hinge
#

let me figure that out, jas

idle owl
#

Should be upper right when you login. Though I guess you need it to login.

onyx hinge
idle owl
#

Ok

slender iron
idle owl
#

@onyx hinge Ok, I added you as a maintainer to the CircuitPython Read the Docs. This is necessary for the workflow to get RTD setup for a lib.

onyx hinge
#

ok

idle owl
#

@onyx hinge You ready to go through the process?

onyx hinge
#

I can now see CircuitPython under "my projects"

#

let me get back to that guide and see if I can understand what to do on my own

idle owl
#

I am verifying that it's still accurate

#

There are steps not in the guide

#

Because they require the access I just provided you

onyx hinge
#

it may not show the correct info for a subproject rtd ?

idle owl
#

I don't understand the question

onyx hinge
#

OK un-ask the question

idle owl
#

Show me what you did already please

onyx hinge
#

nothing yet

idle owl
#

Oh hehe

#

You have to do the other steps first

#

Before adding a subproject

onyx hinge
#

OK

idle owl
#

That is the LAST step.

onyx hinge
#

is "name" like "CircuitPython OV7670"?

idle owl
#

Adafruit CircuitPython OV7670

#

Once you add it, let me know. There is an extra step there too.

#

I still don't see it in your projects.

#

Profile, whatever.

onyx hinge
#

OK, I think it's added now

idle owl
#

Lovely!

#

Now please go into settings > maintainers

#

And add "adabot" as a maintainer.

onyx hinge
#

done

idle owl
#

Then go back to the subprojects/create URL you linked earlier. It should be in the dropdown.

#

the alias is lowercase libname without Adafruit CircuitPython, so ov7670 in this case.

onyx hinge
#

ok, done

idle owl
#

alright, once it builds, the docs badge in the repo should be green. and the link should work.

#

Excellent!

#

That's how you do it.

onyx hinge
#

okay!

onyx hinge
#

@idle owl OK that's the part I needed help with, I can handle adding to the bundle once it's tagged & released.

manic glacierBOT
#

Yes, they are via notify, e.g. https://github.com/adafruit/Adafruit_CircuitPython_BLE/blob/df40a241841918d6c0a984d427e61ca831b7b431/adafruit_ble/services/standard/hid.py#L172.

I thought this might have to do with not handling duplicate services correctly. We need to see what the handles are for the duplicate characteristics. I looked again (briefly) at the SD API and it seems to handle this case, as you said.

onyx hinge
#

@idle owl do I need to set branch protections in the OV7670 repo?

idle owl
onyx hinge
#

I'll check vs some other lib and see what I can see

#

OK I changed some things

idle owl
#

@still zephyr The PR above should fix the "mismatched Read the Docs yml" check on the Library Infrastructure Issues page.

still zephyr
#

@idle owl wow already that was fast

#

Thanks

idle owl
#

Yep! It won't update until the Adabot cron runs, and then the site rebuilds. So sometime tomorrow.

still zephyr
#

We should promote more this page, for people looking to contribute, I find it very helpful.

idle owl
#

I promote it every Monday πŸ˜„ But yes, that was the point.

#

That's why I added it.

still zephyr
#

I lovedddd that page I!!

idle owl
#

I'll ask whether everyone agrees and consider making the link more obvious.

still zephyr
#

YEs, is is helpful a good dashboard for circuit python, we should include also circuitpython core issues in there as well

idle owl
#

I think that would make it overwhelming. And it's pretty solidly geared towards the libraries. Hmm.

#

I'll think about it.

still zephyr
#

gotcha πŸ™‚

manic glacierBOT
still zephyr
#

@idle owl do you think that this guide is something that I could edit, improve. I would like to make some changes and put more examples if possible..

idle owl
still zephyr
#

Yes, will do, thanks kattni

still zephyr
idle owl
jaunty juniper
#

bitbangio.I2C.writeto demands a ReadableBuffer but accepts strings, is that normal ?

#

by which I mean, can we write a string, and is it supposed to work ?

manic glacierBOT
#

this issue was initially opened against the STMPE610 library https://github.com/adafruit/Adafruit_CircuitPython_STMPE610/issues/16
but subsequent testing has shown that it is not related to that specific library.

I was able to reproduce the same behavior with another SPI device (FRAM breakout)

First -- here is a recap of the initial issue followed by more recent findings taht hopefully help narrow down the root cause.

Issue recap:
on a feather rp2040 connected to a 2.4inch TFT ...

#

@tannewt this is ready for a fresh review.

Main question I have right now is, I used "audio_dma" channels. As far as I can see this will work just fine (but didn't test): with 3 channels you can play stereo audio in the background and capture a framebuffer image in the foreground; we'd have to increase the channel count in the future when we enable this or audio capture to also happen in the background. That said, should the APIs audio_dma_allocate_channel() and `audio_dma_free_chan...

ionic elk
#

@tulip sleet I'm running into the precommit problems I think you were describing yesterday, FileNotFoundError: [Errno 2] No such file or directory: 'uncrustify': 'uncrustify'?

tulip sleet
#

sudo apt install uncrustify

ionic elk
#

I'll have to look up a brew version

#

the github is very unhelpful

tulip sleet
ionic elk
#

ah, it's pretty easy though

tulip sleet
#

I keep updating the guide, but it's hard to keep up

ionic elk
#

I misplaced the post it I wrote that guide down on, which one is it again?

tulip sleet
manic glacierBOT
ionic elk
#

Oh, I thought that was the one you said it had been left out of, so I didn't check it. My bad.

tulip sleet
#

i did, but i fixed it 5 minutes later πŸ™‚

#

i try to fix guides immediately if I have time

solar whale
#

@onyx hinge I thought I'd give your ov7670 library a try, but I'll show my ignorance by asking a few questions... You only show D0 connected to PCC_D0 - do the other Dx pins have to be connected to the PCC_Dx pins? -- also my board does not have a pin marked clock -- it has PCLK and MCLK -- is clock==PCLK? in your example ```import board
from adafruit_ov7670 import OV7670

cam = OV7670(
bus,
data0=board.PCC_D0,
clock=board.PCC_CLK,
vsync=board.PCC_DEN1,
href=board.PCC_DEN2,
mclk=board.D29,
shutdown=board.D39,
reset=board.D38,
)``` what is bus?

onyx hinge
#

bus is an i2c bus, that could be clearer. All 8 data pins have to be connected, but because they are a group only data0 is specified. mclk is the "master clock" that goes TO the camera and "clock" is the "pixel clock" that comes back from the camera.

#

mclk is marked xclk sometimes

solar whale
#

Same board. Thanks

onyx hinge
#

if you don't mind using Arduino for a bit you should verify it works with Arduino code and only then give the CP code a try

#

if the names are egregeously bad, file me an issue so I address it please!

solar whale
#

Looks good -- glad you patterned it after to other example.

#

I have some soldering to do -- I'll let you know how it goes.

onyx hinge
#

I appreciate the testing! I'll read back if you mention me with your results

solar whale
#

Glad to -- it may take some time for me to work through the hookup and arduino testing.

#

I've had these cameras since the Arduino Guide first came out -- just never got around to trying it.... Thanks for the prompt to move ahead!

manic glacierBOT
#

Is anyone thinking about this, or working on it?

Espressif has a basic example:
https://github.com/espressif/esp-idf/blob/cf457d4/examples/wifi/getting_started/softAP/main/softap_example_main.c

I think we would need in init.c:

  • new 2nd event_handler for AP events
  • in wifi_init(): create default wifi AP & register 2nd event handler

In Radio.c:

  • new start_ap() to set AP mode and set config
  • in set_enabled(): some handling depending on mode

STA mode may be a little e...

idle wharf
ionic elk
#

@tulip sleet CI failures for the pca10100 don't mean anything, right?

#

I feel like I saw that before once and it wasn't relevant

tulip sleet
#

they do mean something, it's an nrf dev board

#

what's the link?

ionic elk
#

oh, sorry, I thought it was a litex thing, I'll check it out

#

it's a flash overflow, looks like we might need to restrict the alarm system to fewer boards

#
/usr/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: build-pca10100/firmware.elf section `.text' will not fit in region `FLASH_FIRMWARE'
/usr/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: region `FLASH_FIRMWARE' overflowed by 2768 bytes
idle wharf
idle owl
#

Ok, before I head down a rabbit hole - is it me, or do these not match:

#

Doing the pinouts page for the guide, and I feel like maybe the board def is wrong.

ionic elk
#

@idle owl looks wrong to me

idle owl
#

Because the schematic matches the Feather order of those pins as well

ionic elk
#

I mean obviously. They don't match

idle owl
#

Ok, so it might be wrong.

ionic elk
#

not the first time that's happened

blissful pollen
#

They match to the far right side, are the middle column the pin# on the acutal chip?

idle owl
#

@blissful pollen Yah I think so.

#

Let me get a screenshot of that whole section for context

ionic elk
#

Oh wait no, I was looking at it backwards

#

lmao sorry it's late in the afternoon and the caffine just wore off