#circuitpython-dev

1 messages · Page 383 of 1

manic glacierBOT
#

There's CIRCUITPY_BOARD_ID already defined (only used on rp2040 for picotool information). MICROPY_FULL_VERSION_INFO is also the string printed to the REPL, and I want the resulting string to be easily parsable.

I did some tests on a couple of boards. Adding it at the end of MICROPY_FULL_VERSION_INFO like this " (" CIRCUITPY_BOARD_ID ")" takes 68 bytes on Arduino Nano 2040 and 64 bytes on a Gemma.

I also tried printing it to boot_out.txt from main.c without changing `MICROPY_F...

manic glacierBOT
orchid basinBOT
slender iron
#

Ya, I think this would be fine to do

#

They are supported separately. Adafruit tends to support both so they can seem to go hand in hand.

atomic summit
#

Anyone else getting VSCode (latest July build on macOS at least) crashes with 7 alpha 5 when updating code.py ?

manic glacierBOT
lone axle
#

In core code I have a tuple containing two values (155, 110)

I used

mp_obj_tuple_get(current_point, &tuple_len, &tuple_items);

to get the items from the tuple and I can successfully print them like:

mp_printf(&mp_plat_print, "%d\n", mp_obj_get_int(tuple_items[0]));

I can also successfully do some math operation on the value and print the result:

mp_printf(&mp_plat_print, "%d\n", mp_obj_get_int(tuple_items[0])+1);

These print 155 and 156 respectively.

I am trying to figure out how to make a new tuple containing result of the math operation, so I'd like to end up with a tuple that has (156, 110) but I'm not understanding how. When I try to create the new tuple with these values I end up with TypeError: can't convert float to int printed even though the math from the prints above is working properly and the way I'm creating the new tuple is the same as the way the original one was created as far as I can tell. I can share more of the code used for this attempted creation if it would be helpful.

Anyone have a hint or point in the right direction on how I can access a value from a tuple, manipulate it (add or subtract 1) and then make a new tuple containing the result and the other value from the original tuple.

blissful pollen
onyx hinge
#

@lone axle I think you need to index into tuple_items with 1 to get the 110 value out: mp_printf(&mp_plat_print, "%d\n", mp_obj_get_int(tuple_items[1]));

#

oh wait you were trying to do math on the item, sorry, I misunderstood

manic glacierBOT
lone axle
#

yep, trying to do math on the item and then store the result into a new tuple. I can successfully do the math and print the result. I can also successfully make the new tuple using the original values (without the math operation) but doing the math and storing the new value into a tuple is where I'm hitting the wall atm.

tulip sleet
#

you could use mp_obj_get_int_checked() to get the int value as an mp_int_t, which is a c int, and then use MP_OBJ_NEW_SMALL_INT() to convert it back

#

look for examples of those functions/macros in use, and I think it will become clear.

lone axle
#

Thank you, I'll give that a try. Appreciate the help 🙂

tulip sleet
#

I would also suggest studying the object representations in py/mpconfig.h. we are using OBJ_REPR_C.

#
// A MicroPython object is a machine word having the following form (called R):
//  - iiiiiiii iiiiiiii iiiiiiii iiiiiii1 small int with 31-bit signed value
//  - 01111111 1qqqqqqq qqqqqqqq qqqq0110 str with 19-bit qstr value
//  - 01111111 10000000 00000000 ssss1110 immediate object with 4-bit value
//  - s1111111 10000000 00000000 00000010 +/- inf
//  - s1111111 1xxxxxxx xxxxxxxx xxxxx010 nan, x != 0
//  - seeeeeee efffffff ffffffff ffffff10 30-bit fp, e != 0xff
//  - pppppppp pppppppp pppppppp pppppp00 ptr (4 byte alignment)
// Str, immediate and float stored as O = R + 0x80800000, retrieved as R = O - 0x80800000.
// This makes strs/immediates easier to encode/decode as they have zeros in the top 9 bits.
// This scheme only works with 32-bit word size and float enabled.
#define MICROPY_OBJ_REPR_C (2)
#

I think the best way to learn about pointers is to study some machine-language programming. A pointer contains a memory address. You don't have to learn it in any great detail, but once you see how machine instructions use addresses, how they are modified to subscript arrays, etc., I think it will become clear.

lone axle
#

Thank you

tulip sleet
#

You might look at the instruction set for a simple architecture like the IBM 360, which is byte addressed. Ignore all the I/O stuff. ARM is trickier, and x64 is highly irregular. Also learn about little-endian vs big-endian, if you do not already know about it.

#

The PDP-10 has a very nice architecture, and it's what I cut my teeth on, but it is not byte-addressed

lone axle
#

I learned a bit about big-endian vs little-endian working on the Android CircuitPlayground Bluefruit app, that turned out to be the crux of an issue I had initially when using values that came from the device if I recall correctly..

tulip sleet
#

some "intro to machine-language programming" course might be helpful

lone axle
#

Converting the types using those functions you mentioned looks to have worked 🎉 Thank you again for help on this and suggestions of things to study further.

tulip sleet
#

mainly you want to see what are the fundamental building blocks of a simple CPU

crimson ferry
analog bridge
#

where should the tests go for a module implemented in shared-module directory like the traceback module?
I tried tests/circuitpython directory but tests in that directory aren't executed on a CI run.

#

one more thing if the test output matches the CPython output then do I still need to add a .py.exp file?

idle owl
#

You're entirely welcome! Thanks for watching!

onyx hinge
#

@analog bridge Good question! First off, you'd have to ensure that the traceback module is built into the "unix" build. I did this recently for qrio, so I know it's possible, but it involves editing Makefiles & such. As for the location -- yes, the circuitpython/ tests aren't run. I put my tests for qrio in tests/extmod, even though that's a little incorrect. And, no, if the output exactly matches standard python you don't need a .exp file.

#

It might be a good idea to make the circuitpython/ tests print("SKIP") and exit if they are depending on unavailable modules or whatever, so that the tests can run them and generally skip them; then your tests and mine for "pure C" modules could go where they belong, but also get run.

idle owl
#

@lone axle @low sentinel Hey! I keep seeing discussion about vectorio going by. I am wondering what the current status of it is. I'd still like to go back to using it in my current MacroPad project, but I'm not sure what the timeline is on it working. (My issue is it not working with a rotated display, but I believe you're doing a feature addition as well.)

analog bridge
onyx hinge
#

@analog bridge You're welcome. I hope I didn't step on your toes too hard.

#

I saw some commentary about it go by and realized I maybe had some knowledge that would make implementing it easier.

analog bridge
#

@onyx hinge I am getting a crash with the latest build artifact and the following code.

import traceback

try:
    raise Exception("abc")
except Exception as exc:
    traceback.print_exception(None, exc, None)
    traceback.print_exception(None, exc, exc.__traceback__)
#
void mp_obj_exception_get_traceback(mp_obj_t self_in, size_t *n, size_t **values) {
    GET_NATIVE_EXCEPTION(self, self_in);

    if (self->traceback->data == NULL) {
        *n = 0;
        *values = NULL;
    } else {
        *n = self->traceback->len;
        *values = self->traceback->data;
    }
}
manic glacierBOT
analog bridge
lone axle
#

Once that PR is merged and next release made i think its probably ready to be used in that macropad script. Or immediately if using the build from the PR is alright for the time being.

idle owl
#

The rotation borked all rectangles, not only the 1px "line" rectangle, so if the others work, I assume the line will as well.

lone axle
#

Looks like pretty soon to me. Maybe waiting input from Scott about potentially disabling on devices without enough room. Although the actions show passing so maybe thats taken care of already.

onyx hinge
#

@analog bridge thanks!

thorny jay
#

Skipping the meeting. Sorry no notes. Just a Hug Report to all the participant on the CP day/week.

slender iron
#

k, grab water and then we'll get going

tulip sleet
turbid radish
#

Lurking, notes posted in the doc

idle owl
#

Accurate.

lone axle
low sentinel
lone axle
idle owl
lone axle
low sentinel
lone axle
onyx hinge
#

I think it's "de programmatica ipsum" (maybe latin "about programming itself")

#

aha yeah

De Programmatica Ipsum is a monthly publication, the collaboration of Graham Lee and Adrian Kosmaczewski, self described as “two old burnt out guys shouting into the void *.”

turbid radish
#

Thank you

onyx hinge
#

I'm not sure about that @idle owl

idle owl
onyx hinge
#

I answer to jeffler

turbid radish
#

Thanks @slender iron

solar whale
modern wing
#

Very nice 🙂

#

Free time? What's that?

gilded cradle
#

@solar whale you can do still do stuff while you wait for prints to finish.

lone axle
#

Nice! looks like it's coming out quite nicely especially for a first print.

solar whale
#

Yes, I am really pleased.

gilded cradle
#

At least once you get over the having to stare at it printing because it's so cool phase.

lone axle
#

My first few weeks with the printer I was mesmerized staring at it while it worked. Eventually that wore off and I could get back to doing other stuff during the prints though.

solar whale
modern wing
supple gale
#

I'm building my 3rd, or 4th. I only build 3d printers, hardly use them except to print parts for the next one 🙂

modern wing
#

They're self-replicating! Excellent in Star Trek, not so much in Stargate.

onyx hinge
#

I frequently get tempted to build one, then come to my senses. It's not for me, I am not a mechanical tinkerer like some of y'all are

turbid radish
#

I just got a Prusa Mk2S I'm refurbing

gilded cradle
#

That's exciting @turbid radish

modern wing
#

I have a Prusa Mk2s from a makerfaire -- it needs to be assembled. And well, we all know when the last makerfaire was. It's hard to carve out the 15-20hrs to build it -- and all the space it'll need for assembly.

solar whale
#

I had to screw in about 20 bolts -- doesn't that count as "building it" 😉

turbid radish
#

Noe & Pedro hand me down

lone axle
#

It works very similarly to their bitmap based counterparts from the display_shapes library now 🔵 🟦

#

💯 awesome updates. Thanks again @low sentinel

idle owl
#

I'll pop the build onto my MacroPad and verify I can do what I thought I could do, and then merge it!

lone axle
low sentinel
#

Yeah! Note that now you can make interesting shapes (like arrows) out of polygon that point at the xy position like the picture in the pr

modern wing
#

Thanks everyone! Another excellent meeting in the bag 🙂

gilded cradle
#

Thanks everyone

ember iris
#

Thanks!

idle owl
#

@low sentinel I'm looking for "Draw protocol" correct?

lone axle
idle owl
#

Thank you

low sentinel
modern wing
#

🚧 🏗️ ⚒️

lone axle
#

@idle owl I'm around the rest of the day today as well. If you run into any issues during testing with vectorio I can try to help out.

modern wing
#

I feel your pain. For the last 3 weeks, they've been running a jackhammer. About 20 feet from my bedroom. At 7am sharp. Six days a week.

modern wing
#

@slender iron Have you thought about using a highly directional mic like a Shure SM58? They have a steep falloff, at the cost of needing to speak closely to it.

low sentinel
#

Feel free to @ me if it’s messed up @idle owl and thank you for your time!

modern wing
#

It's an XLR mic, so you'd have to get an amp for it (cloudlifter or the like).

idle owl
slender iron
#

I haven't but would be open to it. it's possible I have the yeti on the wrong setting too

modern wing
#

Condenser mics like the AT2020/AT4040/Yeti are awesome. They give a much richer, easier to capture sound. And they pick up everything in the room unless you aggressively noisegate them.

fluid canopy
#

Hello I need help, I do not know about python. How can I generate a message listener with the ring that brings a rockblock using adafruit_rockblock.py that is executed until I receive a message and receive a print ok? I

idle owl
#

@lone axle @low sentinel I was able to pull from the example code in the PR, and it works exactly as I expected it to in the first place. I have two lines dividing my display sections up, for two less lines of code! Thank you so much. I'll merge this now!

idle owl
#
line_palette = displayio.Palette(1)
line_palette[0] = 0xFFFFFF
line_one = vectorio.Rectangle(width=64, height=1, x=0, y=51, pixel_shader=line_palette)
line_two = vectorio.Rectangle(width=64, height=1, x=0, y=91, pixel_shader=line_palette)```
#

And then append them.

#

So nice.

low sentinel
idle owl
manic glacierBOT
#

Tested successfully on a rotated display using MacroPad, and using vectorio.Rectangle to generate two 1px tall lines across my display at the appropriate y-coordinate. Thank you so much for this fix! It was much easier to use this time around and it works as I expected it to in the first place. Well done!

@FoamyGuy We should probably document this somewhere once 7.0.0 is released or maybe even in beta. Up to you, but worth considering either way.

idle owl
#

@low sentinel @lone axle Merged!

#

Now to make Fidget Mode enable automatically after 15 seconds or so and require the button press to turn it off versus you needing to remember to turn it on.... which in retrospect, defeats the purpose.

manic glacierBOT
lone axle
low sentinel
#

Would you find masks useful? Like putting a star Polygon over a bitmap to clip a star out of it? Was seeing how I could add it for all shapes pretty easily

idle owl
idle owl
inland tusk
#

@idle owl Is there a learn guide on how to create a learn guide for a project?

tulip sleet
idle owl
lone axle
low sentinel
#

A spinny star with a picture of my daughter’s dog showing through would really brighten her day. Maybe worth just for that haha. Next weekend if I have time I’ll look at it.

inland tusk
#

@idle owl Okay, I am going to follow the general format as listed in the navigation menu of a project guide

low sentinel
#

Shouldn’t be another breaking change.

lone axle
#

@tulip sleet for fixes-enhancments section: fixes to vectorio drawing on rotated displays. | For breaking changes section: user code no longer needs to use VectorShape and instead can directly add vectorio.Rectangle , vectorio.Circle, or vectorio.Polygon to displayio.Groups to get them drawn on the screen. Also vecotrio now uses index 0 in the palette instead of index 1.

idle owl
# inland tusk <@!330227457296957440> Okay, I am going to follow the general format as listed...

Sounds like a plan. Basically, they all consist of an overview, maybe a wiring page, then a code walkthrough page, possibly a usage page if it's not easy to use, and maybe a resources page if there are separate resources to be downloaded like datasheets etc. Everything else in addition to that would come out of you writing those pages up, and wanting to add something that maybe doesn't fit on those pages. Learn has many examples though to work from.

tulip sleet
#

I go through all the PR's to do the fixes/enhancements, but I will save the "breaking changes", which are not as easily recognized.

#

ty

idle owl
inland tusk
#

Thanks for the guidance

idle owl
#

Which is also why I wanted to get the vectorio thing in, to not be blocking beta, or to not be in 7.0.0. Sure, it's because I wanted to use it, llol..... but still. I think it's a really useful and under-used feature.

low sentinel
#

Under used today because it doesn’t work well in pre-7 😬
Should be more useful going forward

idle owl
idle owl
#

For time.monotonic() a value of 1500 is 15 seconds, right?

jaunty juniper
#

monotonic is in seconds

idle owl
#

Oh, lol.

#

I would have been waiting a while then.

jaunty juniper
#

the new supervisor.ticks_ms() is in ms

blissful pollen
#

waiting for that would have been a good excuse for a coffee break

manic glacierBOT
#

The time it takes to set and synchronize the COMP register is longer than some incoming pulses; and does not seem to be interruptible. This means we cannot afford to do that while an incoming pulse is taking place. As painful as it is, I think we need a way to simply avoid the COMP setting while in a pulse. I did some testing with a boolean flag that returns from port_interrupt_after_ticks() in supervisor/port.c before hitting the COMP statement. It is set in pulsein_interrupt_handler( ) in ...

carmine girder
#

@jaunty juniper may I ask a somewhat newbie q on time.monotonic() ? How high would that go before it wraps? Assuming it does wrap eventually, yes? Asking specifically for a CircuitPython 6.x on a matrixportal board.

slender iron
#

you'll lose float precision before it wraps

#

it's usually a 32 bit counter that has a 32 bit overflow counters as well

carmine girder
#

@slender iron ack. ty. so 32 bits (4billion seconds)?

slender iron
#

not necessarily because the underlying counters may count sub-seconds

#

internally we have 1/1024 of a second tick which may have up to 32 subticks

#

since many boards have a 32.738khz crystal

idle owl
#

Do I want the new supervisor.ticks_ms() versus time.monotonic()?

#

Or some kind of ticks anyway

tulip sleet
slender iron
#

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

idle owl
#

Thanks, Scott.

#

This code is not doing what I want it to be doing. 😦

#

Thought it might have been my counting, but no.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 6.3.0 on 2021-06-01; Adafruit Circuit Playground Bluefruit with nRF52840

Code/REPL

# Note: same code as in this tutorial: https://learn.adafruit.com/make-it-change-potentiometers/circuitpython
import time
import board
from analogio import AnalogIn
potentiometer = AnalogIn(board.A1)  # potentiometer connected to A1, power & ground
while True:
    print((potentiometer.value,))      # Display value
    time.s...
manic glacierBOT
#

@tannewt have been chatting with @danh on Discord & he pointed out that wiring to 3.3v on the CPB instead of CPX would be more appropriate. I just tried this & the "retreat" didn't occur - worked as expected. I was following the wiring diagram at: https://learn.adafruit.com/make-it-change-potentiometers/connections For the CPX I was using VOUT as well, though. I'm running 6.3 on all boards, so I think that's the latest release, unless you want me to try this out on 7.0. @danh mentioned the wi...

idle owl
#

@onyx hinge Is there any reason for me to be using supervisor.ticks() instead of time.monotonic() in something that will eventually be guide code? I don't know what sort of use cases there are for ticks .

onyx hinge
#

@idle owl anytime you are worried about how time.monotonic() loses resolution after days/hours, you could probably use the adafruit_ticks library instead

idle owl
onyx hinge
#

it's more burden on the programmer to think about, so the case for using it in a learn guide is harder to make

idle owl
#

Ok

onyx hinge
#

I'd like to see it in other libs though

idle owl
#

Fair enough.

jaunty juniper
#

is it fair to say ticks_ms is for boards that don't have long ints and want to have accurate ms timing after a few hours ?

idle owl
#

@onyx hinge Do you have a few minutes for me to bug you about code? I was going to write here "Either I have a complete and utter inability to count seconds, or this code isn't doing what I want." But I used a timer on my mobile this time, and it seems like maybe the code is working, and it was a me-fail. So nevermind.

#

I think it wasn't doing what I wanted earlier for real, but I think I fixed it.

onyx hinge
#

@jaunty juniper yes, that's the goal. adafruit_ticks the library adds compatibility for CP6.3 and blinka, and defines the standard addition and comparison functions as well

idle owl
#

Does it matter where in the while loop you do the now = time.monotonic() ? e.g. Does it have to be at the beginning or does it matter because loop?

onyx hinge
#

I would tend to put it above the first time in my forever-loop that I use it

idle owl
#

Ok, that's where I had it, but I moved it.

idle owl
#

@onyx hinge Should the Fidget Mode delay be reset when you press a key? Is that how you'd expect it to work? I feel like yes, but want your input since this was partially your idea.

onyx hinge
#

Yes, if you press a key while it's NOT in fidget mode, I think it would extend the timeout until it enters fidget mode

idle owl
#

That's what I mean.

#

Ok.

#

Simply needs an initial_time = time.monotonic() in the right place... now to figure out where that place is.....

simple pulsar
#

Hello. Is there interest in adopting this library https://github.com/kevinjwalters/Adafruit_CircuitPython_SPS30 ? It's almost finished for i2c - I'm not planning to implement that uart one at the moment. I may have a go at the Omron B5W LD0101 too. I have one connected up now and can read its pulses with pulseio and countio. It appears to be the only inexpensive sensor that can genuinely measure stuff with > 2.5um diameter.

GitHub

CircuitPython library for Sensirion SPS30 sensor. Contribute to kevinjwalters/Adafruit_CircuitPython_SPS30 development by creating an account on GitHub.

idle owl
#

Found the sweet spot!

#

deletes the 🌮 from her code

carmine girder
manic glacierBOT
manic glacierBOT
onyx hinge
# carmine girder heh, sorry but that really confused me. Assuming the board never went down, on a...

@carmine girder the problem is not that that time.monotonic wraps but that because it is a "floating point number" as the values get larger the minimum difference between adjacent values gets larger too. For instance, after about 8 million seconds (92 days), a difference of 1 second is the smallest possible difference that can be represented. (I may be off by a factor of 2 or 4 here). 100ms periods of time can't be measured after about 9 days, and so on. Depending on your needs, this may be just fine or it may be a deal-breaker. supervisor.ticks_ms() is defined as wrapping around, which limits the maximum interval you can measure but ensures that the resolution never gets worse even when your board has been up & running for a long time.

manic glacierBOT
atomic summit
#

But I think this is a VSC thing.. with the latest update, not a CPY thing.

manic glacierBOT
#

For further information on this topic.
For testing, I deinitialized all 12 pins and passed them together with a TimeAlarm to light_sleep_until_alarms()
Here my code:

            braillekeyboard.deinitpins()
            time_alarm = alarm.time.TimeAlarm(monotonic_time=time.monotonic() + 60*60)
            alarms = [time_alarm]
            for p in braillekeyboard.pins:
                p_alarm = alarm.pin.PinAlarm(pin=p.pinid, value=False, pull=True)
                alarms.ap...
atomic summit
#

Actually, nope, same with TextMate - as soon as I save a file, it tries to restart the code, and the board goes into boot loop - tries flashing yellow then goes purple, then starts again.

#

Unplug, plug it back in, and all works again, until I save any code, then the same.

#

Surely someone else is seeing similar?

manic glacierBOT
#

Also, I am** very happy** with the reduction of power consumption in "light sleep"!
While active the project board is using 9 mA when running from a fully charged 3.7v LIPO battery
During sleep, the current is only 1.5 mA !
I am not sure about the exact mA values because I have no real high accuracy measuring equipment for so little currents.
But the power consumption reduction is very promising for long battery life!

#

@dhalbert Ok, tested with the MacroPad library using play_file(). Audio, as expected is still crackly, but the code continues running with this build following multiple playbacks.

I thought audio was only crackly on the first play before, and now it is crackly all the time. You may already be addressing this, but I wanted to let you know.

Here is the example I ran with examples previously converted as suggested by you, Dan. I'm pretty sure I sent them to you before, but let me know i...

idle owl
#

@tulip sleet I did not approve the audio issues PR because it seems like you're still working on it, but I updated it with a comment letting you know I tested it and what I'm seeing. ^^

atomic summit
#

I've confirmed this is happening on 3 different Macs, (Catalina and BigSur) but all with the same board and CPY version 😦

blissful pollen
atomic summit
#

I don't have anything connected to my board... this is a know "good board"

#

Currently trying to checkout 6.3.0 to confirm it's 7 alpha 5 that's the issue.... but I'm back to this old friend....

#
fatal: not a git repository: hw/mcu/nxp/../../../../../.git/modules/lib/tinyusb/modules/hw/mcu/nxp
fatal: 'git status --porcelain=2' failed in submodule lib/tinyusb```
#

I've tried a sync and --init and --init --recursive

#
fatal: could not get a repository handle for submodule 'hw/mcu/nxp'
Failed to recurse into submodule path '../../lib/tinyusb'```
#

Ok, just built with 6.3.0 and it's working fine... no crashes when I save any code, from any editor.

#

Not sure where to go from here folks... I can't be the only one having this issue in 7 alpha 5 right?

#

Mark's might be similar, but I have no peripherals plugged in, just the bare board trying to update code. The code does update, but crashes the board and it wont re-start the code, or even reboot the board.

slender iron
#

make sure you file an issue for it

atomic summit
slender iron
#

contents of CIRCUITPY is helpful

#

and then you could start hunting what alpha broke it

#

not that many people use the alphas

#

most folks are on stable

atomic summit
#

There aren't any more 6.x updates planned right? I have a new CPY board that might be out before 7 - but I have no way of 6.x firmware being built for it now do I?

tulip sleet
#

I will try a build of 6.3.0 in a fresh clone of adafruit/circuitpython

atomic summit
tulip sleet
#

but I thought you said you couldn't build 6.3.0?

#

i jsut built 6.3.0 for metro esp32-s2 in a fresh adafruit clone

atomic summit
#

No, I managed to build - just took some brute force to fix the submodule stuff to get to a buildable checkout.

#

6.3.0 is working fine on my FeatherS2 and my new FeatherS2 Neo - but 7 is crashing when I save any code to the boards

#

I originally thought it was a VSC thing as I had JUST updated that at the same time

tulip sleet
#

i will try that on my Metro ESP32-S2

atomic summit
tulip sleet
#

are you using the .uf2 or the .bin?

atomic summit
#

uf2

tulip sleet
#

i have a feathers2 right here too

tulip sleet
atomic summit
#

hmm... this on a mac?

tulip sleet
#

I basically never use the UF2 bootloader on ESP32. Also I find that I have to flash_erase when switching between UF2 and bin

#

no, on Linux

#

I can try it on a Mac

atomic summit
#

Ok. I only have Mac's here.

onyx hinge
#

I have been using Kaluga and Feather S2 both with 7 alpha on linux and it's also been quite stable. esptool for uploading firmware, not uf2.

atomic summit
#

I'm only using tinyuf2 + uf2 firmware as that's what my customers use.

tulip sleet
#

M1 Mac OK? I also have an Intel MacBook

atomic summit
#

I only have Intel Macs here.

onyx hinge
#

@analog bridge I see you added that suggestion to the format traceback PR, thank you!

tulip sleet
#

Edited using "mg"

atomic summit
#

Ok. I guess I need to go back to another clean clone and try again.

#

Unless it's tinyuf2/uf2 related.

tulip sleet
#

Try loading the .bin, just erase first

#

if you don't, it won't work

atomic summit
#

yup, been an ESP32 guy for a while 🙂

blissful pollen
#

I don't have time today likely but I can poke around with my FeatherS2 and see what I can reproduce too. I could get mine crashing pretty consistently

atomic summit
#

I'll have to tray it a bit later though - need to get the code I was writing done... been putting it off for too long 😉

tulip sleet
#

there were some recent fixes for UF2-based firmware recently:PRs #4925 and #4960

slender iron
#

I'm seeing exceptions not get caught

#

sometimes...

onyx hinge
#

@slender iron that's odd for sure. Like, there's an "except" but it's not reached and instead the exception is printed?

lone sandalBOT
manic glacierBOT
#

CircuitPython version

Adafruit circuitpython 6.3.0, Matrix Portal M4

Code/REPL

import displayio
import time
import math
from adafruit_matrixportal.matrix import Matrix

MATRIX_WIDTH = 64
MATRIX_HEIGHT = 32

# matrix and displayio setup
matrix = Matrix(width=MATRIX_WIDTH, height=MATRIX_HEIGHT, bit_depth=6)
display = matrix.display
group = displayio.Group()
display.show(group)

bitmap = displayio.Bitmap(display.width, display.height, 65536)
col...
manic glacierBOT
#

@tannewt @stonehippo @nitz I updated this PR to include an attempt at consistent pin names for all the existing MicroMod board definitions.

The table below shows the standard MicroMod primary and alternate pin names I'm using:

| SAMD51 | nRF52840 | STM32F405 | RP2040 | M.2 Pin | MicroMod Primary | MicroMod Alt 1 | MicroMod Alt 2 | MicroMod Alt 3 | CircuitPython |
| ------ | -------- | --------- | ------ | ------- | ---------------- | -------------- | -------------- | -------------- | -...

manic glacierBOT
manic glacierBOT
carmine girder
onyx hinge
#

this click / typer / cascadetoml / circup conflict is a bit frustrating. Is there something useful I could to do help? Make circup work with 7.2 again? remove typer use from cascadtoml & circuitpython?

jaunty juniper
#

I build circuitpyhon in a venv, but we can revert the changes to circup for 8, or try to make it work with both and release the requirement

tulip sleet
#

I don't know how easy it would be to remove typer. The "right" fix is to get typer fixed, but that seems distant right now. We can't really fork typer unless we also pypi it as "adafruit-typer" or something like that. Would it be hard to make circup be compatible with both versions with some condtionality?

#

But if typer is really not going to be maintained, maybe we should remove it. On the other hand I thought it provided unique functionality.

jaunty juniper
#

the differences are in the signature of completion_for_install(ctx, param, incomplete):, the "shell_complete" argument name in the @click.argument for install, which I have no idea how to make conditional, and the instructions on how to install the completion

tulip sleet
#

I think you could do if something: @click.argument..., since decorators are just syntactic sugar. Worst case you expand the sugar

jaunty juniper
#

oh actually we don't use the second argument in completion_for_install, so it shouldn't need to change

#

looks like we would have to do something like this:

def _install(ctx, modules, py, requirement):  # pragma: no cover
    """ the real thing """

...

if CLICK8:
    @main.command()
    @click.argument(
        "modules", required=False, nargs=-1, shell_complete=completion_for_install
    )
    @click.option("--py", is_flag=True)
    @click.option("-r", "--requirement")
    @click.pass_context
    def install(ctx, modules, py, requirement):  # pragma: no cover
        _install(ctx, modules, py, requirement)
else:
    @main.command()
    @click.argument(
        "modules", required=False, nargs=-1, autocompletion=completion_for_install
    )
    @click.option("--py", is_flag=True)
    @click.option("-r", "--requirement")
    @click.pass_context
    def install(ctx, modules, py, requirement):  # pragma: no cover
        _install(ctx, modules, py, requirement)
onyx hinge
#
if CLICK8:
    def shell_complete_arg(arg):
        return {'shell_complete': arg}
else:
    def shell_complete_arg(arg):
        return {'autocompletion': arg}

...
@click.argument(
    "modules", required=False, nargs=-1, **shell_complete_arg(completion_for_install)
)
#

if the only thing is renaming the argument

#

pipx seems interesting as a way to install commands, but pipx brings in click8 so it's not a solution to wanting click7.2 in the outside-any-venv world

#

.. I couldn't get pipx to work until I realized that a file named numbers.py in the current directory was what was fouling it up headdesk

idle owl
#

@onyx hinge I don't think I get why your script needs the fake keyboard. Which I think really translates to I don't understand what I'm looking at in the first place.

onyx hinge
#

@idle owl how else would you get the information from OBS into where your cursor happens to be in a google doc in a browser tab?

#

fakely typing it in seemed like the easiest way to me

idle owl
#

Oh hm.

idle owl
onyx hinge
#

@idle owl perhaps? Install it and try cliclick t:9:23 in a terminal window, see if it inserts 9:23 as hoped

idle owl
onyx hinge
#

yes that's what it would do. you could sleep 3; cliclick... and then tab/mouse over to where you wanted to have the insertion occur. though I would have expected the 9:23 to show in the terminal after cliclick exited, as though you had started typing your new command early...

idle owl
#

Hmm yeah. It does not.

jaunty juniper
idle owl
jaunty juniper
#

with a note like: Unfortunately Click 8 changes the name of the parameters, but using the wrong one does nothing, so you can do both if you are not sure which version might be installed.

low sentinel
#

Ugh embeds on mobile sorry :/

lone axle
#

I can close it, not sure about the root of the github permissions though

#

oh

#

or maybe not

#

I get the same thing as you. Seems like a bug in github to me. Not certain though

low sentinel
#

Rad thanks for checking!

jaunty juniper
#

(you can disable embeds by adding < and > around the link)

idle owl
#

You're assigned to it, you should have permission.

#

I'll close it.

#

Oddly, I couldn't "comment" which I didn't mean to click anyway, but I could "comment and close". Who knows what's going on with GitHub.

low sentinel
#

Maybe they need to correctly transpose their buttons’ actions.

analog bridge
#

This is probably the cause 👆

onyx hinge
#

I was just coming here to find out whether github is acting squirrely for anyone else

#

I can't even git push (to some other project besides circuitpython) at the moment .. remote: fatal error in commit_refs

idle owl
subtle sun
#

@onyx hinge Just came here to ask the same. Trying to open an issue results in an error

idle owl
#

@onyx hinge What is the obspython package name that you installed it from? I'm not finding it named that.

#

Was it called something else on install?

onyx hinge
idle owl
#

Ahh ok

onyx hinge
#

I really don't remember, but I think this computer I'm sitting at isn't configured with my hotkey script yet so I could try following through it with you

idle owl
#

I was on that page, and didn't follow that. Thanks.

#

I'll look into it and let you know if I can't sort it.

onyx hinge
#

after adding it with "+" on that screen, then in settings > hotkeys, there is an entry for "Type the current recording timestamp" which is where you configure the hotkey to use

idle owl
#

OK. Heading out for COVID test. I'll try it when I get back.

onyx hinge
#

weirdly the "+" didn't seem to copy the script to somewhere like a configuration folder, it just is using the version in my Downloads folder. tsk!

manic glacierBOT
#

One area I'd like some closer review is the audio pin definitions. I haven't done anything with audio on any of these MCUs, so I'm not as familiar with these pins. I took a simple approach of defining the pins for each interface if all the pins for that interface were exposed on the M.2 edge connector. So, for example, on the STM32 processor, AUD_MCLK is not connected, so I I didn't define the AUD_* pins. However, I did define I2S_*, PCM_*, and PDM_* pins because those pins were...

solid blade
#

over uart? I don't think so, only over bluetooth

solid blade
slender iron
#

ya, uart. it's exposed through the battery compartment

#

I found a paper that said they figured it out

solid blade
#

oh how fascinating, I didn't realize anybody was still discovering things about that 🙂

#

hmm, I only see the guitar hero controller in my office, balance board must be elsewhere

#

that's pretty cool

#

"paper acquired and added to library"

manic glacierBOT
#

Another thing I wanted to mention: when I added the sparkfun_stm32f405_micromod board, I followed the <vendor>_<mcu>_<product line> naming convention that seemed to be used by most other SparkFun MicroMod boards:

sparkfun_<mcu>_micromod

  • sparkfun_nrf52840_micromod
  • sparkfun_samd51_micromod
  • sparkfun_stm32f405_micromod

The exception is the RP2040 boards, which all seem to use <vendor>_<product line>_<mcu> format:

  • sparkfun_micromod_rp2040
  • `sparkfun_pro_micro_rp...
slender iron
#

I emailed augusto but haven't heard back

#

I tried to get it to talk to me but couldn't figure out how

tulip sleet
#

@slender iron I think you gave me a script to parse or convert Beagle TDC files, but I cannot find it now. Could you point to it or give it to me again? Thanks.

slender iron
tulip sleet
#

sorry - I just moved it to the proper channel

slender iron
#

👍

tulip sleet
#

YES, thanks, I could not find that repo. I even searched for it

manic glacierBOT
#

I am working on rp2040 suspend/disconnect detection since I think it may be the cause. The problem is I couldn't reproduce the issue on my local machine. Though I made an cpy with usb debug message enabled (in the other issue). @ATMakersBill would you mind trying it out (you will need to hooked its gpio0,1 to FTDI/CP210x for the log).

I have enabled the tinyusb log output to UART @115200 baudrate. It print out all the usb information with level 2 and level 3. Would you mind using this for...

#

We recommend the PPK2 for measuring power: https://www.adafruit.com/product/5048

I wouldn't be surprised if there are bugs in the sleep implementation. It is very new. I'd suggest trying to narrow down the code that causes issues and then posting an issue so we can try and reproduce it.

We can leave this issue open for the sharing issue. I understand the problem but am not sure the best way to solve it. I'm happy you are working to the deinit and then pin alarm case because I'm curious ...

slender iron
#

anyone around to chat about this rtc sync thing?

onyx hinge
#

@slender iron I'm around but not in the know about the issue.

slender iron
#

I can lay it out

onyx hinge
#

give me 3 minutes and I'll meet you in the voice chat?

slender iron
#

sure

onyx hinge
#

OK I picked Valentina since it's usually the top one that gets used

slender iron
idle owl
#

@onyx hinge When I finally pick up this OBS project if it makes sense to do, I will want to sit down with you to understand better what's going on. Have other priorities at the moment, and you're busy right now anyway, but wanted to let you know that's what I'd like eventually.

onyx hinge
#

@idle owl when the time comes I will be at your disposal

idle owl
#

Thank you!

blissful pollen
#

If not I'll take a look at it - guess i should have stated that too!

onyx hinge
#

@blissful pollen no, I didn't start yet -- be my guest!

manic glacierBOT
manic glacierBOT
tulip sleet
# blissful pollen <@!426200547024961539> I was looking at some small issues that I could fix and s...

I have looked at the best way to fix that bug, and even started to code it a bit, but only very briefly. It was more complicated than I liked.

It could be done by using a Python set in the shared-bindings, adding all the pins to the set, and making sure the set length is correct. Or it might be done in the shared-module implementation, but it's really something that should be done as arg validation in shared-bindings.

Right now the pin-claiming logic checks some actual hardware state, so you can't see if the pin is claimed until you go to allocate it.

All the keypad classes should check for duplicate pins in the pin lists, not just KeyMatrix, so you might want to write a general duplicate object or duplicate pin checker which can be used in other cases as well. But KeyMatrix is special because it has two lists of pins, not just one.

manic glacierBOT
#

I have looked at the best way to fix this bug, and even started to code it a bit, but only very briefly. It was more complicated than I liked.

It could be done by using a Python set in the shared-bindings, adding all the pins to the set, and making sure the set length is correct. Or it might be done in the shared-module implementation, but it's really something that should be done as arg validation in shared-bindings.

Right now the pin-claiming logic checks some actual hardware state, ...

blissful pollen
#

I did just a basic check of the pin objects. I did look a bit more into pin logic but as you said that really delves into the shared-module and per port pin objects

tulip sleet
#

I wrote the comment above before I saw you'd pushed a PR 🙂

blissful pollen
#

no problem I figured I'd push it and get some feedback on it if nothing else

tulip sleet
#

If you could factor out the pin duplication checking, then we can put it in the other keypad classes as well

#

even duplicate object checking... You could add a duplicate object checker to py/argcheck.c

#

that would cover the pin case

blissful pollen
#

yeah I can factor it out for sure

tulip sleet
#

It's basically just the code you wrote already

blissful pollen
#

i'll take a look in argcheck too. Doesn't sound like it would be that difficult

tulip sleet
#

Look at for example mp_arg_validate_type() and nearby functions, which take a qstr as a general name, and also a type, so you could have an error like "Duplicate %q in %q", or just "Duplicate %q" might be good enough.

#

i spent like an hour or two on this already, and decided I needed to finish fixing audio first 🙂

#

hence the excessive kibitzing 🙂

blissful pollen
#

and then the keymatrix (and other) would just call like mp_arg_validate_duplicates or some name?

tulip sleet
#

yes, exactly, maybe mp_arg_validate_no_duplicates()` again 🙂

blissful pollen
#

yeah your way is a lot more reusable then my quick thing, and i love getting deeper into the core to learn more about it

tulip sleet
#

you could pile the row and col pins into one dynamic array and pass it, or make no_duplicates_2

blissful pollen
#

oh yeah two arrays to check. I wonder if any other functions would need to compare two arrays for duplicate items...

tulip sleet
#

RGBMatrix has two sequences of pins and some other loose pins. Not sure how you want to check for non-duplication of single pins. But the checking could be a side effect of creating the DigitalInOut's instead; it should throw a "Pin in use" error, but it doesn't, at least on some ports....

#

hmm maybe it's not worth doing in shared-bindings after all if the common_hal routines would find the duplication as a side effect. I cant' remember now why that wasn't going to work for KeyMatrix.

#

@blissful pollen ^^

#

I think maybe it is because claim_pin() for RP2040 does a lousy job.

#

it doesn't do pin-in-use checking

blissful pollen
#

Yes! that's what I was trying to remember I had found looking at it a bit ago.

#

And then realized this would be a real per port thing and wasn't sure if that was a great idea or not

tulip sleet
#

There is a fundamental flaw in how the shared-bindings stuff checks for free pins. It uses validate_obj_is_free_pin(), but since it doesn't claim the pin immediately, it fails to do a duplicate check.

#

Like if you did busio.I2C(board.D0, board.D0), does that fail on all the ports, or not? It should.

#

now I remember why I stopped doing it, because I was going down this same rat hole

blissful pollen
#

I'll play with it a bit and see what I can get. Seems an interesting enough problem, or one that will drive me crazy eventually.

tulip sleet
#

maybe validate_obj_is_free_pin() should take something that is a list of pins already validated as free so far, so it can do duplicate checking.

#

it has to consider free-ness in context

#

considering the other pins asked for at the same time

blissful pollen
#

i'd have to look but maybe even a validate_all_pins_are_free() would work

onyx hinge
#

If you do that, remember that you have to catch the exception and free all the pins allocated so far

manic glacierBOT
tulip sleet
#

@slender iron I appreciate your sweep of these issues!

slender iron
#

I know limor was talking about doing it and I'm bbqing

#

so its a good light weight task

tulip sleet
#

i think i just fixed audio. new PR push on the way

manic glacierBOT
#

I have found that moving the rtc_start_pulse from common_hal_pulseio_pulsein_construct to the pulsein_interrupt_handler
shortens the pulsein window and lets the auto-reload work more consistently. Patch file I used looks like:


--- a/ports/atmel-samd/common-hal/pulseio/PulseIn.c
+++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.c
@@ -101,6 +101,9 @@ void pulsein_interrupt_handler(uint8_t channel) {
         start_overflow = overflow_count;
     }
     if (self->first_edge) {
...
#

@kattni Assuming this builds, it is ready to try again. I no longer have crackly audio.

Main fix in the latest commit: Saleae pin instrumentation of the buffer filling in dma_audio.c showed that sometimes it gets out of sync at the very front of playing and fills the opposite buffer from what it intended to fill. Removed the flip/flop buffer management booleans from audio_dma_load_next_block() and audio_dma_convert_samples(), and instead pass in the desired buffers or buffer indices...

cunning crypt
#

OK, so I was curious. Is there a reason that we can't start a digitalio pin in the same way we can start a pulsio pin?

Here's what I mean. For PulseIO, this works:
led = pulseio.PWMOut(board.D13, frequency=5000, duty_cycle = 65535)

But for DigitalIO, this doesn't work:
led = digitalio.DigitalInOut(board.D13, direction=digitalio.Direction.OUTPUT, value=True)
Instead, it raises a TypeError that says "Function does not take keyword arguments". Which means to start a pin and turn it on we have to do this:

led.direction = digitalio.Direction.OUTPUT
led.value = True```
tulip sleet
#

or led.switch_to_output(True)

#

Yes, adding more args might be convenient. And maybe the direction can just be implied if you give a value argument.

#

If you'd like to propose that, we could certainly entertain it. Also you'd want a drive_mode optional argument.

#

and there would be an optional pull argument too

#

I think originally we were looking for minimal API. SimpleIO was originally meant to be used more than it ever was.

cunning crypt
#

Just a thing that got bypassed/overlooked, instead of something that was not done for a specific reason?

tulip sleet
#

it was even before my time; I think there may have been a rationale at the time.

cunning crypt
#

I do seem to remember earlier analog inputs having to be done in a way similar to this, but that doesn't seem to be the case anymore.

tulip sleet
#

It's a history q for @slender iron

cunning crypt
#

I think. Going to double check.

#

Well, Analog in doesn't exactly have anything to set.

#

Hm, nor does AnalogOut

#

Interesting that AnalogIn and AnalogOut are different and DigitalInOut is one. It makes sense - Any digital pin can be an input or an output, while a true analog output isn't available everywhere.

tulip sleet
#

I think the idea may have been that this library would be more used than it was. The *io modules were seen as lower-level building blocks. But it turns out they were convenient enough to use by the beginner.

cunning crypt
#

I can see how that could have happened.

manic glacierBOT
#

As it sits right now, I can set up nearly any type of pin input and output in one line. I can, for example, use:
led=pulseio.PWMOut(board.D13, frequency=5000, duty_cycle = 32767)
And this will start a PWM output that, on most boards, will turn the on-board LED on at half power. Similarly, AnalogIn and AnalogOut don't require any setup at all.

DigitalInOut, on the other hand, requires this, to largely accomplish the same thing:

led.switch...
manic glacierBOT
#

Is this problem as simple as removing the "claim pin" effect in PinAlarm? I did not foresee a use case like this so I think I specifically put it in there for all ports. That said we should think about whether there will be ill effects to allowing this form of overlap - initializing a PinAlarm will do things like change the pull settings and potentially the internal mux settings, depending on the port, and so it may become useless for the original purpose after being constructed for the alarm.

manic glacierBOT
manic glacierBOT
jaunty juniper
jaunty juniper
#

I have done too much jQuery when I think led = DigitalInOut(board.LED).output(True) is worth considering

manic glacierBOT
#

The most concise way to define a digital pin is currently 2 steps, not counting the imports.

led = digitalio.DigitalInOut(board.LED)
led.switch_to_output(True)  # LED is on
button = digitalio.DigitalInOut(board.BUTTON)
button.switch_to_input(digitalio.Pull.UP)

I have seen a couple of people on discord mention that they find the setup for pins in Circuitpython complicated (though they might think more of the 3-step version seen in many guides), and I tend to find i...

tulip sleet
cunning crypt
manic glacierBOT
cunning crypt
#

Your ideas in the comment - for helper functions and/or "splitting" into DigitalIn and DigitalOut (I suspect DigitalInOut would be kept to not break literally everything out there) - both accomplish this, too and may actually be better. I don't know enough about proper coding practices to say

manic glacierBOT
supple gale
#

git / pre-commit question
When i run locally pre-commit run --all-files no errors
When I push to my repo pre-commit fails with Formatting.
Locally I have

pre-commit 2.14.0
Uncrustify-0.71.0_f
manic glacierBOT
#

I think this is not too hard:

def  __init__(
    self, 
    pin: microcontroller.Pin,
    *,
    value: Optional[bool] = None,
    pull: Optional[Pull] = None,
    drive_mode: Optional[DriveMode] = None) -> None:

If value is None, the pin is set to be an input. If pull is None, it is set to be PULL_NONE. If drive_mode is not None, raise a ValueError.

If value is not None, the pin is set to be an output, with the given initial value. If pull is not `N...

tulip sleet
#

i am using the uncrustify from pybricks (Ubuntu PPA). Same version, more or less: 0.71.0-0pybricks1

#

but I agree I don't understand why the run is not noticing that

manic glacierBOT
manic glacierBOT
#

The reason we don't allow it from the constructor is that it's weird to have keyword arguments that are only valid depending on another (direction). Value and drive mode are for output and pull is for input. The class does default to input so we could add a pull kwarg. That'd simplify the input case. I'd push back against combining them.

The other examples don't have this weird dependency between kwargs.

onyx hinge
#
+        { MP_QSTR_pin, MP_ARG_REQUIRED | MP_ARG_FUNC, {.u_func = arg_is_free_pin} },
…
-    const mcu_pin_obj_t *pin = validate_obj_is_free_pin(args[ARG_pin].u_obj);
+    const mcu_pin_obj_t *pin = args[ARG_pin].u_cptr;

Each time we can do this saves 8 bytes, so hopefully this can out-save the core code additions to add MP_ARG_FUNC.

manic glacierBOT
supple gale
tulip sleet
onyx hinge
#

yeah that is a real good question

tulip sleet
#

once they are validated to be pins, they could be accumulated in an array and then passed to a dupe checker, but that is "manual" code

onyx hinge
#

if you reserve them as you go, you have to do something about freeing them in the error case

tulip sleet
#

dupe checker could take an array, or it could be a varargs function (e.g. for busio.I2C())

blissful pollen
#

Could you have a function to reserve a bunch of pins at once, include the error and exception handling there?

onyx hinge
#

reserve_pins_and_dup_check(size1, array1, size2, array2, 0);

#

(actually a C varargs function)

tulip sleet
#

I don't think we need to reserve them in shared-bindings; that will be done later in common-hal

#

just dupe checking. Also then we can dup-check other objects besides pins

onyx hinge
#

if you have a single value, dup_check(1, &scalar1, ...)

#

here I was thinking that by moving the reserve into this reserve_pins_and_dup_check function it would be more code size savings

#

what other items can you think of deduplicating?

tulip sleet
#

pin-claiming is done per port, and in common-hal, so I don't know I want to create a port-independent pin-claiming mechanism

#

i guess if we have free checks, we could have claiming, then. claim_pin() is a bit misleading on some ports because it doesn't do any claiming, it just checks for forbidden pins

#

one might dupe-check DigitalInOut's, I guess. I'm not sure there's an example right now

onyx hinge
#

we made free-pin checking available in the API, not sure why claiming shouldn't be.

blissful pollen
#

Last night I did notice the ESP32S2 code just sets a flag for claimed pins and those few lines should work for the RP2040 port as well

tulip sleet
#

that kind of thing is why I'd rather leave pin claiming to common-hal

analog bridge
blissful pollen
manic glacierBOT
#

I have a somewhat same use case, of trying to use an alarm pin, while awake.

I'm also trying to make sure that i don't miss any events, just on a single alarm pin.
The code does something along the lines of

1: Wake up from alarm pin
2: Log timestamp
3: Do some processing
4: Go to sleep and wait for next alarm pin event

In order to catch any pin events happening while at step 3, i'm trying to use countio on the same alarm pin.

`import alarm
import board
import countio
pin_al...

onyx hinge
#

The hook must exit nonzero on failure or modify files.

#

I think pre-commit is supposed to notice if uncrustify modified source files. Is there a situation where uncrustify exits with an error, but does not modify source files?

tulip sleet
#

would it complain if it can't parse a source file?

#

(not valid C)

analog bridge
analog bridge
onyx hinge
#

tools/codeformat.py discards the exit status from uncrustify

#

it always exits with a success status code as far as I can see

tulip sleet
manic glacierBOT
#

We recommend the PPK2 for measuring power: https://www.adafruit.com/product/5048

I wouldn't be surprised if there are bugs in the sleep implementation. It is very new. I'd suggest trying to narrow down the code that causes issues and then posting an issue so we can try and reproduce it.

We can leave this issue open for the sharing issue. I understand the problem but am not sure the best way to solve it. I'm happy you are working to the deinit and then pin alarm case because I'...

onyx hinge
#
    - name: Run code formatting
      run: source tools/ci.sh && ci_code_formatting_run
    - name: Check code formatting
      run: git diff --exit-code
``` The micropython CI checks that no files are modified according to `git diff`
#
tools/uncrustify.cfg:41: unknown symbol 'disable_processing_nl_cont'
``` @analog bridge are these the sorts of messages from uncrustify that you are referring to?
#

Here's a version check ^^

analog bridge
orchid basinBOT
onyx hinge
#

yup, 0.69 is not suitable for our purposes, so that's what I'm focused on helping users diagnose

analog bridge
#

yes, that is the main goal as it gets really annoying for someone who is using pre-commit for the first time...
I also factored in a case where uncrustify fails for some other reason apart from incompatible version and that is why the push for implementing exit code.

onyx hinge
#
+                subprocess.check_call(cmd + file_args)
``` like this
#

?

#

black and uncrustify seem to exit with status 0 even when they modify files so I guess that's fine

#

(you wouldn't want to interrupt after one file was changed/formatted, in the case that they used nonzero exit status to indicate 'any error, or any change')

#

I am in the middle of something else so if you want to PR either the addition of the exit status check or the explicit version check, please be my guest. I apologize that I had a bit of a knee jerk reaction since 0.69 is unsupported, but having installed an older version locally I now see just how badly it can mislead a user. Since we want use of a specific version for consistency (I don't think anybody knows whether uncrustify 0.80 will format the same as 0.71! but 0.72 and 0.71 seem highly consistent) I think adding an explicit version check is a good idea.

#

"it reformatted all my code differently, I committed it, and now CI is angry" is a different kind of failure I'd like to avoid

analog bridge
#

It will be a while before I get to this... I'll assign myself to the issue when I start taking a look at it.
If you get time and don't see any assignee then feel free to take a shot at it. 🙂

onyx hinge
#

OK, it's a deal

manic glacierBOT
manic glacierBOT
#

Perhaps instead of setting pull or value directly, an independent arg could be used? I'll call it startvalue because it's the value the pin starts with. Unless I'm missing something, you could use four arguments and, since things are exclusive anyway, there'd be no cases of keywords depending on other keywords.

My thought process says you'd have the following:

pin = digitalio.DigitalInOut(board.D13, startvalue=True) # This would start with an output with the pin high
pin = dig...
#

I think this would cause duplicate .o files when linking. It may link but I think it may grow the resulting link. We don't $(sort the OBJ value to prevent this.

I tried a very simple example:
foo.c:

int int1;
int int2;

main.c:

extern int int1, int2;

int main() {
    return int1 + int2;
}

Linking foo.o once vs twice causes different-size executables:

$ gcc main.c foo.c
$ gcc -c main.c foo.c
$ gcc -o 1.out main.o foo.o
$ gcc -o 2.out main.o...
idle owl
#

@lone axle tio is amazing. I reloaded CircuitPython entirely, and it's still connected in PyCharm. Where has this been?! (Thank you!)

#

@tulip sleet Oooh! It isn't scratchy now! I'm getting a click when the sound stops, both on wav and tone playback. Is that expected?

stuck elbow
#

tio automatically reconnects

#

it's really nice

manic glacierBOT
slender iron
#

@onyx hinge one size win would be using a -Os stdlib

tulip sleet
#

do the audio files have fade-in fade-out or are they abrupt

idle owl
#

Yeah it's better than the crackling and hanging.

idle owl
#

Acts the same for tone and wav though, so I don't know that fade helps.

#

But this is better than before.

#

I'm willing to approve and merge. Then you can file an issue for the clicking for later.

tulip sleet
#

I think it has to do with how PWM audio works (or doesn't work). Yes, there is more work to do, but I feel this is considerably better than before.

manic glacierBOT
tulip sleet
#

@slender iron ok if kattni merges the audio fixes? I think I address your requests. Maybe I will make an alpha.6 this afternoon and wait on the HID stuff

slender iron
#

let me do a quick look

tulip sleet
#

i could include the timer thing if you have time to work on it

tulip sleet
#

i'll start on the draft release notes

manic glacierBOT
slender iron
#

alpha.6 sounds good to me. I do think its worth to move onewire into its own module

#

but we'll need to be backwards compat in 7

#

don't wait for me for the alpha. I've got too much to fix

#

@tulip sleet I'm adding a switch to turn off UART and making it and SPI raise valueerror

#

that way it'll work with the pin finding script (and find no pins)

manic glacierBOT
#

EPaper.zip

I have recorded the communication between the Raspi Pico and the EPaper. I saw that the chip select is high between the first and second byte after the command. The chip select is not high after the command has been sent. Maybe the chip select ends the communication and the initialization is done with wrong parameters.

![Pulseview](https://user-images.githubusercontent.com/1408260/129086038-59b82396-202e-47...

#

Might be a fun exercise at some point to do some sort of "overlays" that provide per-carrier symbols for the different "common" carriers

Yeah, it would be nice if Micro/CircuitPython eventually supported something like Zephyr Shields for carrier or add-on boards.

We don't need to support this in the core. A library would be able to provide the carrier specific functionality.

@tannewt I don't know if it mat...

#

Look like some of the #defines for MicroPython have leaked into these board defs like MICROPY_HW_USER_SW. I think it'd be best to remove the ones that circuitpython doesn't use. That'll simplify the files and make them clearer.

Ah okay. We don't actually create board specific defines for Micropython so these were just added to CircuitPython. I think they are there because I did it on some of our past boards, which must have been because I used an existing board config as an example (...

#

@tannewt Actually its for a remote anemometer on an airfield.
It will generate 0-30 pulses/sec. The pulseio module is hence not usable, and using just countio makes the resolution bad at low speeds. (need to measure time between pulses, not the number of pulses)
When calculating gusts, average wind directions over different durations, and sending the data via the RFM95 module, pulses would potentially get lost.

For now i've worked around it, by connecting the input to two pins, and usin...

#

We haven't yet enabled an RGBMatrix as the built in display of a board, so there may be problems here.

Typically these panels are 64x32 at the greatest, leaving room for about 2 full rows of 6 characters or something; in my experience this hasn't been useful for viewing REPL errors. And of course if it's just a header, not integrated with a specific size of matrix, the display might be jumbled depending what the board is plugged in to.

tulip sleet
stiff pelican
#

It seems to be specific to the circuitpython repo. I've not pushed anything to that repo in a while.

tulip sleet
#

are there library PR's that are fine?

stiff pelican
#

Yes, eg. https://github.com/adafruit/Adafruit_CircuitPython_PYOA/pull/25
And Anne just merged a number on the Learn System.

tulip sleet
#

I will let you know when/if i hear. It is GitHub ticket #1270083. I mentioned you found other ones were OK.

stiff pelican
#

Cheers

tulip sleet
#

Your issues are OK.

manic glacierBOT
#

This is not a core bug. The reason for the extra delay is the time it takes to go to and from the quiescent_value. These ramps are done to prevent clicking. The CP library could reuse the AudioOut to reduce the timing impact of these ramps to and from 0. Furthermore, #1623 would help stop samples at the quiescent_value and not require the ramp on stop.

Screenshot_20210811_140017

I just...

tulip sleet
#

@stiff pelican reply from GitHub support:

Thank you for writing in and I apologize for the trouble!

Our engineering team is aware of this bug and I’ve added your report to the issue for further investigation.

A fix is currently underway.

stiff pelican
#

Cheers, @tulip sleet . They've had a number of incidents in the last couple of days. It seems like they borked something.

idle owl
#

Please don't cross-post questions in multiple channels. You chose the perfect channel the first time you asked. Please be patient as sometimes it takes a bit for folks to reply to your questions. Most folks here are community members that provide their time when they are available.

tough chasm
#

Oh sorry I wasn’t sure which I should ask it in

idle owl
#

This channel is for CircuitPython development discussion. The #help-with-circuitpython is for questions like yours. You did well in choosing. 🙂

tough chasm
#

Ok thanks I will delete this post

idle owl
#

Thanks!

manic glacierBOT
supple gale
#

It actually passes now. I brute forced it by recloning from adafuit and adding my changes. Guessing i broke something at some point and decided to stop hitting head against wall.

slender iron
#

fyi I'm turning off getpass and traceback for non-full builds

#

they shouldn't get any new modules unless we deliberately choose to add them

#

(think SAMD21)

manic glacierBOT
supple gale
#

The MorphEsp-240

jaunty juniper
#

oh no, that's what I wanted to avoid, is it a new module when it's replacing sys.print_exception ?

manic glacierBOT
#

Very interesting, and thanks for looking into this! Are the ramps built in? Or, does the CP library have control over them? As I recall, tones play sine wave samples generated by the CP library. With #1623, ramps may not be required at all if the sample begins/ends on zero.

Also, are different tones generated by generating different samples, rather than using the same sample with different sampling rates? (I may be mistaken, but I seem to remember noticing this when I looked at the code la...

manic glacierBOT
#

I think CircuitPython is and should be a "debug features ON by default" environment, but it would be great to have the ability to disable the REPL without rebuilding (I'll save my comments on why it's undesirable to do so for an appropriate thread).

So anyhow, on a 64x32 matrix panel, the onscreen REPL doesn't really fit, so the output line which I'm interested in reading is not visible, with Blinka looking more like a flamingo than a snake, and it just looks like a graphical glitch—it's n...

slender iron
tulip sleet
#

@slender iron I'm going to do alpha.6 right now with the current set of merged PR's, unless you can think of anything else.

slender iron
#

kk, np

manic glacierBOT
#
[adafruit/circuitpython] New tag created: 7\.0\.0\-alpha\.6
onyx hinge
#

thank you Dan!

#

now the code my guide needs will be in the latest alpha, yay

manic glacierBOT
orchid basinBOT
tulip sleet
hollow token
#

Will https://github.com/adafruit/circuitpython/issues/5086 be fixed before 7.0 releases? I'm only asking because a lot of the other issues for mimxrt10xx are added to a major version tag but then moved to long term later, eg one issue was marked for 5.0 then moved to long term and hasn't been touched since

slender iron
hollow token
manic glacierBOT
#

@DynamoBen @dhalbert I tried my best to update tinyusb to address this issue. However, since all my PC cannot reproduce the issue. Would you mind trying this out again. zip contains uf2 for for pico and macropad with multiple debug level (0, 2, 3) . 0 is no debug just for verifying (in case debug log accidentally resolve it by slowing down cpu)
Note: pico uart tx is GPIO0, macropad, uart tx is GPIO20 (SDA in qtstemma connector). Looking forward to your feedback.

[midi-usb-connection.zip](...

#

@ATMakersBill I tried my best to update tinyusb to address this issue. However, since all my PC cannot reproduce the issue. Would you mind trying this out again. zip contains uf2 for for pico and macropad with multiple debug level (0, 2, 3) . 0 is no debug just for verifying (in case debug log accidentally resolve it by slowing down cpu)
Note: pico uart tx is GPIO0, macropad, uart tx is GPIO20 (SDA in qtstemma connector). Looking forward to your feedback.

[midi-usb-connection.zip](https:/...

manic glacierBOT
manic glacierBOT
#

I tried to reproduce on a Dell Optiplex 3020 last night with Windows 10 and failed. I will try an Intel machine with an older motherboard.

Do you have any idea what this might be related to: is it Windows driver related, or might it be more USB controller related? Do you know if USB2 vs USB3 might make a difference? I can try various permutations, but I have many choices right now

manic glacierBOT
ornate breach
#

Is there anyway special I need to install to build ESP32S2 boards?

#

I’m getting a cmake error about Ninja

#

Is that a pip package I can install?

jaunty juniper
#

On Linux you probably need to install ninja-build and cmake.

manic glacierBOT
ornate breach
#

Thank you

#

Turns out I visited the page in the past but never did anything on it which is probably why I didn’t know 😅

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-alpha.5-117-gbe2342f32 on 2021-08-06; FeatherS2 with ESP32S2

Code/REPL

# code.py
while True:
  pass

Behavior

On file saving, when the code is running, the board disconnects from USB and resets (and comes back).

Description

  • Happens if the code is running, even during a single time.sleep() (no while loop).
  • Doesn't seem to happen if the code has finished.
  • Reproduced on mac and window...
jaunty juniper
#

@atomic summit does this issue match what you are seeing ? ☝️

manic glacierBOT
#

I tried to reproduce on a Dell Optiplex 3020 last night with Windows 10 and failed. I will try an Intel machine with an older motherboard.

By failed, you mean you couldn't reproduce the issue and everything works well right !?

Do you have any idea what this might be related to: is it Windows driver related, or might it be more USB controller related? Do you know if USB2 vs USB3 might make a difference? I can try various permutations, but I have many choices right now

I couldn't r...

ornate breach
#

How would I build circuitpython for 6.3 locally?

#

Mine seems stuck on 6.1 beta

jaunty juniper
#

something like git pull --tags; git co 6.3.0

#

I think

#

and of course git submodule sync --quiet --recursive && git submodule update --init

manic glacierBOT
#

@DynamoBen @dhalbert I tried my best to update tinyusb to address this issue. However, since all my PC cannot reproduce the issue. Would you mind trying this out again. zip contains uf2 for for pico and macropad with multiple debug level (0, 2, 3) . 0 is no debug just for verifying (in case debug log accidentally resolve it by slowing down cpu)
Note: pico uart tx is GPIO0, macropad, uart tx is GPIO20 (SDA in qtstemma connector). Looking forward to your feedback.

[midi-usb-...

spiral elk
#

In general, are GPIO pins used for external spi flash intended to be exposed in the board module?

slender iron
#

no

spiral elk
#

OK, another project for me to fix the blackpill.

#

Just something I happened to notice when loading on alpha 6.

#

Will open an issue and mention I'll work on it.

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-alpha.6 on 2021-08-12; stm32f411ce-blackpill-with-flash with STM32F411CE

Code/REPL

import board
dir(board)

Behavior

['__class__', 'A0', 'A1', 'A10', 'A11', 'A12', 'A15', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8', 'A9', 'B0', 'B1', 'B10', 'B12', 'B13', 'B14', 'B15', 'B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B8', 'B9', 'C13', 'C14', 'C15', 'I2C', 'LED', 'SCL', 'SDA']


### Description

Pins ...
slender iron
#

I should say, I wouldn't expose them if they are only connected to the flash. if they are available on a pin header as well, then it is fine to have them in board

spiral elk
#

They are also broken out, but it seems like leaving them easily available is really dangerous.

slender iron
#

generally we'd leave that as a board designer choice

#

though they should be considered "in use"

#

and probably only available through board.SPI()

spiral elk
#

That particular board doesn't actually provide a board.SPI()

slender iron
#

hrm

manic glacierBOT
spiral elk
#

Another fun one, looking at the schematic, The GPIOs for the USB D+/D- are also broken out as regular pins exposed in board as well.

manic glacierBOT
#

The ramps are built in. The library can set the quiescent_value which sets the destination. The init and deinit go to zero so setting quiescent_value=0 would only lead to ramps on stop.

We discussed this a bit in a meeting yesterday and thought the long term solution is to remove the ramps in favor of controlling speaker enable. This would allow us to disconnect the speaker and let it settle on its own.

For the library questions, I think its better to open a new issue. Generally we ...

slender iron
#

@spiral elk I think it's up to you how you want to treat them

manic glacierBOT
#

I think this means:

  • Too late per the target rate: returns False and do nothing
  • Too late per the minimum rate: raises exception and does nothing
  • Refresh happened: return True

I don't actually like encoding the return in True/False/None, that's probably a bad a idea. We could at least use an enum.

I wonder if we really need two targets. The best effort is to do the target. The program is struggling if it can't meet the minimum, but I'm not sure it should be an error it can't ke...

ornate breach
tulip sleet
#

if you don't have important state in the repo clone, you could delete it and reclone to clean up its state. Then checkout 6.3.0 and get the submodules

ornate breach
#

Incompatibility of mpy files

tulip sleet
#

you need to rebuild mpy-cross

#

it's used to compile the frozen modules

manic glacierBOT
#

Currently for some ports and some audio play mechanisms, there can be clicks at the beginning and/or the end of a sample due to sudden level shifts. We have support for quiescent values but these are often sample-file dependent.

Some ports ramp the amplitude up and down, but this prevents gapless playback and lengthens playing short samples (#3626).

We have also recommended in the past that users add ramping to their own audio files.

We should look at how this problem is solved in th...

manic glacierBOT
#

My larson scanner no longer kills the interpreter. I now get this.

Adafruit CircuitPython 7.0.0-alpha.6 on 2021-08-12; Raspberry Pi Pico with rp2040
>>>
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
  File "code.py", line 268, in <module>
  File "code.py", line 185, in start_sound
RuntimeError: Internal audio buffer too small

Code done running.

Press any key to enter th...
#

It is documented as if it's only in onewireio but is on busio and bitbangio as well for 7.x.

Adafruit CircuitPython 7.0.0-alpha.6-23-gd294692c4-dirty on 2021-08-12; Adafruit Metro M4 Express with samd51j19
>>> import busio
>>> dir(busio)
['__class__', '__name__', 'I2C', 'OneWire', 'SPI', 'UART']
>>> import bitbangio
>>> dir(bitbangio)
['__class__', '__name__', 'I2C', 'OneWire', 'SPI']
>>> import onewireio
>>> dir(onewireio)
['__class__', '__name__', 'OneWire']
manic glacierBOT
#

Related but the full code is mentioned in https://github.com/adafruit/circuitpython/issues/4208#issuecomment-804296887

I'd been setting the buffer size to 80k to see what it did. I reduced it and the code now runs but there's a fair bit of popping during as the sample plays which must be some clash between (lots of) PWM for other GPIO and the audio GPIO. I'll put a new ticket in for that - I wasn't sure originally if it would get fixed by other work.

manic glacierBOT
manic glacierBOT
#

@tannewt Is Neradoc correct that "Adding an entry to board seems to require adding an entry in every pins.c?"

It would, but how about using the existing os.uname(), such as os.uname().machine?

Currently:

>>> os.uname()
(sysname='rp2040', nodename='rp2040', release='7.0.0', version='7.0.0-alpha.6-3-g5d6706ce8-dirty on 2021-08-12', machine='Adafruit QT Py RP2040 with rp2040')

We could add the board ID to machine, maybe putting it parentheses or something like that...

slender iron
#

@tulip sleet did you test your usb descriptor changes on imx?

tulip sleet
#

tested on various other architecture since then; originally it was SAMD51 and then RP2040

slender iron
#

I don't think its crashing

#

the usb just doesn't enumerate correctly

manic glacierBOT
tulip sleet
#

perhaps the number of endpoints is not correct

#

fewer than I think, or some restriction is usage I was not aware of

#

could turn off everything but CIRCUITPY_MSC and/or CIRCUITPY_CDC and see what happens

slender iron
#
May 19th - high speed fix
aebee2de7309be36bbaca7ad690c680dc804d728
no assert and no enumeration

May 10th alpha.2 - assert failure on max packet size

May 6th - merge 1.13 - assert failure

May 3rd - merge 1.12

April 26th - merge 1.11 76033d5115889d779debfddc14c6990df31de799

April 5th alpha.1 - works
tulip sleet
#

high-speed fix may be some tinyusb platform-dependent thing that's not right?

slender iron
#

I'm gonna go grab some lunch and then will poke more

#

alpha.4 did crash for me later

#

but it's weird

tulip sleet
#

maybe a bisect will be more pinpoint

slender iron
#

that's essentially what I'm doing

#

but not strictly bisecting

#

I was trying to work forward from when it last worked (alpha.1)

#

🌮

atomic summit
jaunty juniper
#

BBEdit does well when the board goes away under it, not so much when it hangs (have to press reset to unhang BBEdit)

atomic summit
#

Interestingly, I also see it in my 6.3.0 build, but maybe only 1 out of maybe 20 hot reloads.

manic glacierBOT
manic glacierBOT
jaunty juniper
#

say, how about a public "API" (a flock of static json files) on circuitpython.org that would provide up-to-date information about boards and Circuitpython releases for 3rd-party tools (or circup) ?
Things like a list of board names and identifiers, and for each board: informations like the list of features, current releases, links to firmwares per language, and supported modules.

crimson ferry
#

@jaunty juniper I have issues with BBEdit when there are more than one "CIRCUITPY" volumes (even though they are uniquely named), i.e., always. If I try to open a code.py on one, it will likely open a code.py from another. So I reserve it for non-removeables.

jaunty juniper
#

that's the finder though, open with the open dialog or the "open with bbedit" action menu never does that

#

(I created a dummy app to test that it is indeed a Finder issue)

#

or at least so far 🤷‍♂️

#

oh it might happen when the file goes away though ? I'm not sure, I haven't had the issue recently, it seems it happens more with identical boards 🤷

manic glacierBOT
#

I started looking at this today and haven't had a ton of success. It appears #4689 caused an assertion error due to the bulk size of the high speed end point that #4774 fixed. At the #4774 commit it appears to work with CDC only. MSC causes issues similar to what Dave saw above. I don't see this issue on main though.

main as of d294692c4e698785f523fbe94a2de46d5fa90c63 seems to run but fails to enumerate even with CDC only:

[ 3979.436193] usb 3-5: unable to read config index 0 descrip...
#

Twist! I left it while writing this up and it eventually enumerated:

[ 8285.567739] xhci_hcd 0000:06:00.3: Timeout while waiting for setup device command
[ 8285.774389] usb 3-5: device not accepting address 51, error -62
[ 8285.897749] usb 3-5: reset high-speed USB device number 51 using xhci_hcd
[ 8290.901474] xhci_hcd 0000:06:00.3: Timeout while waiting for setup device command
[ 8296.234408] xhci_hcd 0000:06:00.3: Timeout while waiting for setup device command
[ 8296.441062] u...
hollow token
#

That is very strange

ornate breach
#

Any idea what would cause the build of a circuit python board to fail at this point? ```py Traceback (most recent call last):
File "gen_stage2.py", line 96, in <module>
typer.run(main)
File "/Users/sethkerr/opt/anaconda3/lib/python3.7/site-packages/typer/main.py", line 859, in run
app()
File "/Users/sethkerr/opt/anaconda3/lib/python3.7/site-packages/typer/main.py", line 214, in call
return get_command(self)(*args, **kwargs)
File "/Users/sethkerr/opt/anaconda3/lib/python3.7/site-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/Users/sethkerr/opt/anaconda3/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/Users/sethkerr/opt/anaconda3/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/sethkerr/opt/anaconda3/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/Users/sethkerr/opt/anaconda3/lib/python3.7/site-packages/typer/main.py", line 497, in wrapper
return callback(**use_params) # type: ignore
File "gen_stage2.py", line 40, in main
quad_enable_status_byte = all_match(flashes["nvm"], "quad_enable_status_byte", None)
File "gen_stage2.py", line 28, in all_match
shared_value = nvms[0].get(key, default)
IndexError: list index out of range
make: *** [build-oakdevtech_pixelleaf_rp2040/genhdr/flash_info.h] Error 1

jaunty juniper
#

probably pip3 install -U click==7.1.2

ornate breach
#

I'll try that, thanks 🙂

jaunty juniper
#

hmmm maybe not, it doesn't look like the usual clicker error

ornate breach
#

i think it might have been the ID i put for the QSPI flash

#

nope nvm

jaunty juniper
#

yeah typer is used only by cascadetoml as far as I know, so it's maybe an issue when parsing the nvm.toml stuff somewhere ?

ornate breach
#

well, maybe... i didn't revert it back to the right name. trying again

#

yep, that did it

#

😛

#

gotta love little things like that

manic glacierBOT
manic glacierBOT
#

usb_hid does NOT have the fix for HIGHSPEED that the other devices have:

usb_midi/__init__.c
131:    0x00, 0x02,  // 68,69 wMaxPacketSize (512)
133:    0x40, 0x00,  // 68,69 wMaxPacketSize (64)
151:    0x00, 0x02,  // 80, 81 wMaxPacketSize (512)
153:    0x40, 0x00,  // 80, 81 wMaxPacketSize (64)

storage/__init__.c
67:    0x00, 0x02,  // 13,14 wMaxPacketSize 512
69:    0x40, 0x00,  // 13,14 wMaxPacketSize 64
80:    0x00, 0x02,  // 20,21 wMaxPacketSize 512
82:    0x40, 0x00,  /...
manic glacierBOT
#

I was looking at this more tonight after the discussions on discord. I did implement a argcheck.c methods mp_arg_validate_no_duplicates. This checked one array for any duplicates, returning an error if so.

For test purposes I made a mp_arg_validate_no_duplicates2 which checked two arrays against each other. I think modified KeyMatrix.c to run these checks against rows, columns and then the second function for rows+columns. It works.

A couple of thoughts:

  • I haven't checked thi...
manic glacierBOT
#

@DynamoBen the usb log look pretty normal, I should add timestamp to the log (will do it next), do you know how long does it take until the USBD Bus Reset : Full Speed occurs.

  1. Does the usb comm both msc and terminal is both freeze ?
  2. Can you still connect / disconnect terminal to cdc
  3. Is pico still recognized by windows (even msc/cdc not responding) , you could check it using the usbtreeview software https://www.uwe-sieber.de/usbtreeview_e.html#download

Look like the issu...

manic glacierBOT
manic glacierBOT
#

@hathach It usually fails within 20 min, I can get some more exact timing if needed. Terminal continues after MIDI has stopped. I didn't try reconnecting the terminal. Pico is recognized still and no driver errors.

It's been mentioned by others but I can use other USB MIDI devices without failure and I can run similar test code with a Teensy with no failure. It doesn't help with this specific issue but does mean there isn't a systemic USB issue with newer Dell computers (which seems to be...

lone axle
#

Is there some extra flag that can be passed to the make command to have it also flash a connected device if it builds successfully?

supple gale
#

usually adding a flash target does it for me

#

so make -j16 BOARD=morpheans_morphesp-240 flash

tulip sleet
#

there is usually a flash command for the non-UF2-possible uploads, but not so much for plain UF2 copying

lone axle
#

Ah, that must be what I was thinking of. Thank you.

manic glacierBOT
#

Hiya!

I've recently put together a super-simple ESP32-S2 based dev board:

https://github.com/tylercrumpton/CrumpS2

The locally-compiled UF2 firmware seems to work well on the hardware, and I think I've covered all the pieces needed to add the board to CircuitPython! Please let me know if there are any other changes I need to make.

The PID/VID is currently requested from the pidcodes repo (#665), but hasn't been approved y...

idle owl
#

@lone axle @onyx hinge Bug report: The dynamic screenshot generator does not appear to grab subdirectories. e.g. this example has MIDI samples in a folder, and they are not included in the screenshot. Unrelated feature request: I also had a suggestion from Dylan that we add the "expanded directory triangle" to the CIRCUITPY at the top of the screenshot and shift the contents over appropriately because she felt it looked a bit like they're all on the same level as it is.

manic glacierBOT
lone axle
idle owl
#

Alright thanks. Getting link now.

onyx hinge
#

@lone axle let me know if I can chip in

onyx hinge
#

@idle owl do you know if learn just grabs ALL the files, or if it has a list of extensions, or what?

#

though it may literally be that only 1 level of folder was accommodated, I don't know

lone axle
#

Should it try to recursively look into sub directories? in this case inside of samples there is another layer of directories Arp and Horn which each have many wav files inside of them. The image will likely be very long if all of those files in each are included.

onyx hinge
#

maybe it should show a folder icon for each folder?

idle owl
#

But it is what it is, we want folks to know what to look for. I think anyway.

onyx hinge
#

so it needs to show an open triangle next to "samples", and inside it an open-triangle "Arp" .. does it need to go down and show Arp_A1.wav and all the others?

idle owl
onyx hinge
#

"other horn wav files..." is a hack in the manual screenshot?

idle owl
#

Oh

#

Good call.

#

Bugger.

#

I guess the third level of subdirectories can be only the folder.

#

If folks don't get it by that level, they're not going to get it.

#

And the one person who doesn't, we'll help them.

onyx hinge
#

@lone axle to go down multiple levels of directories, use os.walk instead of os.listdir, in case you're not familiar with it. Or you can make a function that is recursive, but I think os.walk is probably preferable.

onyx hinge
#

@idle owl bless them

lone axle
manic glacierBOT
#

this adds a new function boundary_fill() inside of bitmap tools which will fill all of the background colored pixels inside of an enclosed region of a Bitmap with the fill color passed by user.

This is the script I used to test it:

import board
import displayio
import bitmaptools

display = board.DISPLAY

bitmap = displayio.Bitmap(display.width, display.height, 3)

palette = displayio.Palette(3)
palette[0] = 0x000000
palette[1] = 0xffffff
palette[2] = 0x0000ff

...
manic glacierBOT
idle owl
#

@onyx hinge @slender iron The thunderous sound of building construction has begun. I need to back out of running the Monday meetings for a bit. I think for the next 5-6 weeks, which means the next 2-3 meetings I was supposed to run need to be covered. My future travel plans are still up in the air, but I should be able to resume at some point in September. Apologies for the obvious inconvenience. If you want me to coordinate with you to sort out who will do what, or if you want me to simply update the calendar, let me know, otherwise if you simply want to coordinate amongst yourselves, that also works.

slender iron
#

np, I think I'm around

manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-alpha.5 on Circuit Playground Bluefruit

Behavior
These problems are related to the Bluetooth FileTransferProtocol

Filenames with accents can be created but cannot be removed.
For example if you create a folder named "Carpeta sin título" ("untitled folder" in Spanish) it is not possible to remove it later

Filenames with emojis cause bigger problems.
Creating a folder using the with an emoji name will make the listDire...

idle owl
#

Thank you. Worst case, I pick one up at some point and we listen to construction in the background. But it's pretty bad 😕

manic glacierBOT
#

I re-tested with beta.6 loaded via uf2 with

from adafruit_magtag.magtag import MagTag
from adafruit_progressbar import ProgressBar

DATA_SOURCE = "https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/vaccinations/country_data/United%20States.csv"

magtag = MagTag(url=DATA_SOURCE)

print("Before magtag.network.connect()")
magtag.network.connect()
print("After magtag.network.connect()")

and the crash still occurs. Intially I thought it was fixed, be...

manic glacierBOT
onyx hinge
slender iron
#

I'm flexible so whatever works for you

#

@tulip sleet we aren't using the usb_descriptor library anymore right?

tulip sleet
#

right, I saw that comment late last night but was too tired to answer it

tidal kiln
#

@gilded cradle ping (non-urgent portalbase question)

manic glacierBOT
slender iron
#

kk, I'm gonna archive it then

gilded cradle
#

Sure @tidal kiln

tidal kiln
#

like have fetch just fetch, and not auto update any text labels

gilded cradle
#

which board?

tidal kiln
#

pyportal in this case

gilded cradle
#

I think I may have done something like that with magtag. Let me check.

tidal kiln
#

i'm passing in text_font = None when creating, which is working, but seems hackish

manic glacierBOT
gilded cradle
#
GitHub

Helper library for the FunHouse board. Contribute to adafruit/Adafruit_CircuitPython_FunHouse development by creating an account on GitHub.

#

Should basically be the same

#

It basically stops displayio from updating and then resumes it.

tidal kiln
#

issue is a little different

manic glacierBOT
tidal kiln
#

and could be because i'm not using the library correctly

gilded cradle
#

I think you can also set labels to be non data labels and they won't update

tidal kiln
#

for code in question, didn't use any add_text etc. from lib

#

instead, created "manually" with adafruit_display_text and added to splash

gilded cradle
#

I think if you just use the network component of it, then it avoids all the auto updating stuff

tidal kiln
#

like use network.fetch() instead of the pyportal.fetch()?

gilded cradle
#

yeah

tidal kiln
#

go directly down to that layer?

gilded cradle
#

yes, like pyportal.network.fetch()

tidal kiln
#

gotcha. ok. thanks. let me try that.

gilded cradle
#

👍

#

Sorry, it's been a bit and it's kind complex, so I forget sometimes.

tidal kiln
#

ha. no worries. same here.

#

this is like Nth time i've run into this...and forgot what i had done last time myself.

tidal kiln
#

this time wanted to ask you so i don't just repeat previous hack 🙂

gilded cradle
#

Yeah, I often look at my code, but then sometimes I have so much code I forget where I dealt with it.

#

Fair enough.

manic glacierBOT
orchid basinBOT
orchid basinBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 6.3.0 on 2021-06-01; Pimoroni Tiny 2040 with rp2040

Code/REPL

import busio
from board import *

print(dir(board))

i2c = busio.I2C(SCL, SDA)
print(i2c.scan())
i2c.deinit()

Behavior

code.py output:
Traceback (chiamata più recente per ultima):
File "code.py", riga 19, in
NameError: nome 'SCL'non definito

Translation from italian:
File "code.py", row 19, in
NameError: name 'SCL' not d...

idle owl
#

@lone axle You're going to have to deal with me being gaga over tio for a while because it keeps blowing my mind. Complete nuke and reinstall of CP, reconnected. Physical disconnect of Feather, reconnected. 🤯

lone axle
#

Indeed it is amazing 🎉

#

I am going to make a video about using the stubs with PyCharm, I think I'll show off tio as well since it fits so nicely into the pycharm workflow.

idle owl
#

Excellent. On both counts.

manic glacierBOT
#

The board does not have specific default pins for I2C (or UART or SPI for that matter), as the pin numbering on the board is just 0-7 (versus the QTPy with explicit naming). The intention was to give users choice of which pins to use.

If defaults would be preferred so the above case works then I can make an executive decision on which ones, but would this prevent those pins from being used for other functions @tannewt?

#

Since no pin are marked as default SDA or SCL on the sikkscreen or the pinout, it's perfectly normal not to have them in the board module. That's the case for the pico for example. However board.I2C, board.SPI and board.UART should be removed since they just raise NotImplementedError.

Default I2C pins do not impact what the users can do, board.I2C is only inited on first use, the names are aliases, a pin can be both named SDA and D5 for example.

@robdearpowa you probably wan...

#

Since no pin are marked as default SDA or SCL on the silkscreen or the pinout, it's perfectly normal not to have them in the board module. That's the case for the pico for example. However board.I2C, board.SPI and board.UART should be removed since they just raise NotImplementedError.

Default I2C pins do not impact what the users can do, board.I2C is only inited on first use, the names are aliases, a pin can be both named SDA and D5 for example.

@robdearpowa you pr...

manic glacierBOT
manic glacierBOT
#

For Circup: As long as its nicely parsable in boot.txt it doesn't matter.
For CP: My opinion is that board makes more sense. It feels like the place to look for it to me.

If the reason for not doing doing it in board is because of needing to edit so many pins.c files.. I'm happy to help with that tedium in a follow-up PR if someone does the actual C work.

manic glacierBOT
slender iron
gilded cradle
#

Thanks

manic glacierBOT
manic glacierBOT
#

@DynamoBen device log look normal to me, I think we should look more at the host log/app. Can you tell me more about what does not work when the issue occurs. Original post said both MIDI and serial not working. Can you re-test it.

  1. Check if REPL still work
  2. Check if MSC still work
  3. What is your MIDI app for testing, maybe either try to close and relaunch it (probably a bus reset cause it to loose connection and could;t reconnect with midi port)
  4. Try to test with other MIDI app i...
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

CircuitPython version

Adafruit CircuitPython 7.0.0-alpha.5 on 2021-07-21; Adafruit Macropad RP2040 with rp2040

Code/REPL

from adafruit_macropad import MacroPad
import time

macropad = MacroPad()

for i in range(10):
    time.sleep(0.25)

Behavior

After the for loop completes, "code done running" is displayed and pixels[0] will begin to flash red randomly.

Description

The "code done running" is expected. The flashing is not. I woul...

manic glacierBOT
lone axle
#

@onyx hinge thank you for the tip about os.walk() that is really nice compared to listdir()

kind river
#

Are there any plans for an nRF53 port? I have a dev board and would be interested in helping out.

manic glacierBOT