#circuitpython-dev

1 messages Β· Page 367 of 1

blissful pollen
#

I think it is correct. A little bit "backwards" cause the GPIO29/AD3 is A0 and then counts down as you go A1, A2, A3. If that makes sense?

idle owl
#

OH

#

I read it wrong.

#

Ok.

ionic elk
#

Yeah what Mark said, I don't think the schematic numbers matter

idle owl
#

Thank you. This is why I asked.

#

So it is backwards from the Feather. Meh.

#

Ok.

blissful pollen
#

Probably to keep the RP2040 pins in order on the breakout board (for PIO)

ionic elk
#

if it's any consolation that might have been the mistake I just made too

#

I looked at the AD part I think and mixed them up

idle owl
#

The "AD" vs "A" was what caught me up.

#

Yeah that.

#

Ok. So what I put in the guide is correct, even though it didn't feel right.

#

Thanks @blissful pollen and @ionic elk!

ionic elk
#

np good sanity check

blissful pollen
#

no problem!

manic glacierBOT
solar whale
#

@gilded cradle I see the new funhouse guide. It has come up several times that with a new board, it is necessary to do an erase_flash with esptool before loading the CP .bin file. I don’t know if that is also necessary for loading the .uf2 boot loader .bin, but I was surprised that it was not included in the esptool part of the guide.

idle owl
#

Oh snap, the BOOT button on the QT Py is available to CircuitPython on board.BUTTON. I was entirely unaware of this. Is it like that on all the RP2040 boards, I wonder.

onyx hinge
#

@idle owl no, not on all of them

idle owl
#

Ok so I didn't miss something obvious.

onyx hinge
#

I think if you look at the schematic you'll see two connections to the switch

#

the place it's normally hooked up is not readable as a DigitalInOut

idle owl
#

Hmm ok

onyx hinge
#

I was going to look at the guide for the schematic, hmmm 😜

idle owl
#

Haha, yeah about that.

#

I'm currently carefully going through the digital pins making sure that I get them right. Because RP2040 and a million functions per pin.

onyx hinge
#

I do not see the thing I think is there for Qt Py RP2040 on the Feather RP2040

idle owl
#

Copying from the Feather guide, but checking the datasheet for some of it.

#

Ok

onyx hinge
#

QT Py RP2040 ^^

idle owl
#

Yah I have it open

#

not sure how to read it though.

onyx hinge
#

so "somehow" the extra diode D2 and the extra connection USBBOOT (GPIO21) enable the switch to be read from software

#

the feather and the pico don't have that, they just have the 1k resistor

idle owl
#

Ok

onyx hinge
#

I'd have to think about how it works to explain it but I think the best thing to look for is just that extra connection from the reset button (which will always go to QSPI_CS) to another GPIO

#

or just having the USBBOOT listed in pins.c

#

D2 stops the USBBOOT pin from interfering with QSPI_CS if it has its pull-up enabled (or if it's set to a high output, which is not useful)

idle owl
#

Fair enough

onyx hinge
#

It's a bit hand-wavy but I don't think you are really invested in understanding it?

idle owl
#

I'll take hand-wavy when it makes sense πŸ™‚

#

So it wants a pull up?

#

That was unclear, worked in code with both

onyx hinge
#

I think you should suggest treating it like a normal button, set pin to have pull-up, and it's pressed when .value is false

idle owl
#

up or down didn't change that it was if not button.value which felt odd.

#

But yah ok

onyx hinge
#

The microcontroller is changing QSPI_CS between high and low whenever it wants

#

thinks

#

You're best off giving the same instructions as for other buttons, even if other instructions might work

#

no need to deviate from the usual

idle owl
#

Agreed

#

I was being sincere with the "yah ok"

jaunty juniper
#

you must be careful not to press it when resetting obviously (or you go bootloader mode) but that doesn't really impact how you use it as a generic button

idle owl
#

Right.

#

Thanks!

ionic elk
#

@tulip sleet I have another NRF error I'm very confused by - I'm trying to exclude the simmel and PCA boards that fail from Alarm, and I'm getting the following:
```circuitpython/ports/nrf/../../supervisor/shared/safe_mode.c:64: undefined reference to `sleepmem_wakeup_event'

#

but this file doesn't have anything like that on line 64, in fact it doesn't reference that keyword anywhere in the file

onyx hinge
#

@ionic elk locally or in CI?

ionic elk
#

locally

onyx hinge
#

if locally I'd "make clean" to see if it makes a difference. otherwise, is some macro expanding to refer to sleepmem_wakeup_event?

ionic elk
#

I'm giving make clean a shot - it appeared even in a clean build, but it was alongside other errors which I've since fixed, so maybe it's getting confused about file boundaries, or something?

idle owl
#

@tulip sleet What do we do with an nRF that isn't showing up on Windows as CIRCUITPY, but the bootloader is? Feather Sense.

ionic elk
#

There are no macros that expand to user set values in that line, and no macros are ever set to sleepmem_wakeup_event anyway

idle owl
#

I don't see an eraser file for it, and I'm not sure if they can get to the REPL.

ionic elk
#

hmm, weird, I seem to have solved it, there was another instance of sleepmem_wakeup_event in port.c that the compiler didn't catch, and apparently thought was in this totally separate file?

onyx hinge
#

@ionic elk next guess, the reference is inside a function that is inlined by the code at safe_mode.c:64

idle owl
gilded cradle
ionic elk
#

@onyx hinge I dunno, it would have needed to really mangle that file to get it in there

onyx hinge
#

LTO is very wizardly, and its results can be weird

ionic elk
#

Well whatever it's gone now.

onyx hinge
#

even wierd

ionic elk
#

I just don't like that it happened on a clean build

#

seems wack

onyx hinge
#

just guessing, but if you check out this simple program you can see that gcc misdiagnoses the location where the missing function f is called for the error message: https://godbolt.org/z/zKK8f188Y

extern int g(void);

int f(void) {
    g();
}
int main(void) {
    f();
}
/tmp/ccpon7VG.ltrans0.ltrans.o: In function `main':
<source>:4: undefined reference to `g'
#

It may still feel mysterious, but I'm guessing it might be something like this that happened in your case, just more complicated

jaunty juniper
#

@idle owl there's a CLUE flash erase, it might work for the feather ?

idle owl
#

I'm not sure πŸ˜•

idle owl
#

Better if they can get to the REPL.

idle owl
#

Nevermind. 🀦 They were loading the wrong build. Still, curious what we would have done if that hadn't been the issue.

jaunty juniper
#

we need a checklist, like phone tech support that always asks if it's plugged in first

#

like, if somebody mentions that they loaded a UF2, ask for the name of the file first

solar whale
#

@gilded cradle thanks! As long as it works as explained in the guide it should be fine.

idle owl
ionic elk
#

is tab detection/replacement more of a precommit thing or an uncrustify thing?

idle owl
#

Where did we land on adding board.I2C1 to the QT Py RP2040?

ivory yew
#

I just observed a SAMD21 board with the uf2 bootloader fail to start - it was as if the bootloader + firmware had been erased. Has anyone seen anything like this?

ivory yew
#

looks like the first page of flash got nuked. 😐

manic glacierBOT
still zephyr
#

@fossil gorge Thank you πŸ™‚

ivory yew
#

Ahhh I think I know what's happened.

#

The bootloader never sets BOOTPROT unless either all the fuses are bogus or if you update the bootloader with a uf2 file.

#

We don't change the default fuses during factory setup, so they're valid but no BOOTPROT.

#

and we just flash the .bin file for the bootloader so it never self-updates and never sets the fuse.

#

🀯

#

Alright, I'm gonna make my firmware set bootprot correctly.

slender iron
#

@ivory yew we had a batch of metro m4s go out that way

#

were you running circuitpython?

ivory yew
#

Nah, Castor & Pollux has its own firmware.

slender iron
#

interesting! that means it happens in other code too

ivory yew
#

I don't think we've seen any of this with Big Honking Button, which does use CircuitPython

slender iron
#

I always assumed it was a CP bug somewhere

ivory yew
#

I'll have to double check that, though.

#

I'm going to write some code tonight to check and set fuses first thing in Castor & Pollux's firmware and then subject one to an obnoxious amount of power cycles and see if it dies again.

slender iron
#

πŸ‘

ivory yew
#

Do you think it makes sense for the bootloader to do that, too? As in always check & fix bootprot if needed.

slender iron
#

Β―_(ツ)_/Β―

#

I feel like we're up against space constraints in the bootloader

ivory yew
#

I don't think it'd add much more space, the logic is there it just needs to be called in main() in addition to selfmain

misty garnet
#

it looks like the RP2040 only supports 1 address in i2c peripheral mode (unlike the SAMD21). is it preferable to change the setup input function to only take an INT instead of an array of INTs, or leave the function inputs the same and only pick off the first address to use?

#

it also looks like it needs a baudrate, which currently isn't an i2c_peripheral input

ivory yew
#

@misty garnet I think it's preferable to maintain the same interface, you can raise a ValueError if the list contains more than one element.

#

ValueError("Only one I2C address is supported on this hardware")

#

Hmm, it should at least support the read/write variant of the same address.

misty garnet
#

sounds good, but the lack of a frequency input variable is a bit trickier

ivory yew
#

I'd assume 400 kHz

#

In peripheral mode, the controller should be driving the SCL line

#

That's why the SAMD implementation doesn't require a frequency

#

Looks like on the RP2040 you shouldn't need to set a frequency in peripheral mode.

#

section 4.3.14 of the RP2040 datasheet says

#

It is not necessary to program any of the *CNT registers if the DW_apb_i2c is enabled to operate only as an I2C [peripheral], since these registers are used only to determine the SCL timing requirements for operation as an I2C [controller]

misty garnet
#

yeah, not sure how the C++ SDK interacts with the hardware registers. It looks like you need to do this:
uint i2c_init (i2c_inst_t *i2c, uint baudrate)
followed by:
void i2c_set_slave_mode (i2c_inst_t *i2c, bool slave, uint8_t addr)
so maybe the first init command can just take a dummy baudrate that it subsequently ignores

ivory yew
#

yeah, that's what I would guess.

ivory yew
#

@slender iron setting the BOOTPROT fuse seems to do it. πŸ™‚

#

I've been power cycling it like ^

manic glacierBOT
#

Looking at my old code, I think you have to float the old pins too (set as input). I've included some relevant parts below. Please try this and let me know if you still encounter an error. I can clean up what I have (was messily written during a hackathon) and just post the whole thing as a demo. I'd also suggest blowing on the sensor as a means to test it, I found it was the lowest effort method to produce a lot of apparent noise (turbulence).

` from adafruit_pybadger impor...

tulip sleet
ivory yew
#

I'm probably going to update our factory scripts to set bootprot as well

tulip sleet
#

oh, you just hadn't pushed yet!

ivory yew
#

(it's just needlessly tricky to do that with a JLink script πŸ™„ )

tulip sleet
#

I'll ask Limor about this, but we have had very few SAMD21 boards brick themselves; with SAMD51 it happened a LOT more

ivory yew
#

I hadn't seen it at all with Big Honking Button, which uses the same samd21 as Castor & Pollux.

tulip sleet
#

I mean we can discuss loosening the check for bad BOOTPROT

#

I only put in the current fuse fixer because people had a tendency to erase the entire chip, including the fuses, with various Segger tools, etc.

ivory yew
#

lol yeah

#

(I'm one of those people)

tulip sleet
#

the underlying problem of the lowest section of unprotected flash being erased is still weird, and I didn't know SAMD21 was susceptible to this under harsher conditions

ivory yew
#

Yeah, idk. there's a lot more stuff going on with Castor & Pollux's board, so it's possible the voltage rise is a bit slower than other boards.

tulip sleet
#

glad you figured it out, and sorry for the bootloader not being as robust as it might have been

ivory yew
#

oh nah, it's fine. The fact that it exists is great.

#

I'm gonna take a look at VDDCORE's rise with my oscilloscope tomorrow.

tulip sleet
#

like i said, we could certainly add a bit of brownout checking for SAMD21 too. I don't know what TinyUF2 does.

#

good night!

ivory yew
#

thank you. πŸ™‚

paper notch
#

moving here from #help-with-circuitpython because it seems like a dev topic, i have an issue with udp with the esp32spi module, details are here https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI/issues/135 but TL;DR is it doesnt clear the write buffer for udp sockets between socket_write()s. I have a couple solutions proposed there but Im not really sure which I should actually turn into a patch because one option is a patch to esp32spi and the other is a patch to nina-fw which are separate projects

manic glacierBOT
#

Hi @tannewt,

Thanks for all you do on this. I've been watching your streams lately, and really appreciate your efforts.

That said, I do have a bit of a complaint about the response above...

While I can certainly understand a "we don't support this modality of things because of resource limitations on the platform" (a paraphrased restatement of what I think you're fundamentally trying to say), I find "I'm not personally a fan of the REPL" (direct quote) to be rather dismissive, and r...

tulip sleet
# paper notch moving here from <#537365702651150357> because it seems like a dev topic, i have...

Let's wait for some feedback from our NINA-FW maintainers. An ESP32SPI fix has the advantage of working with current firmware. In the long run if the semantics of NINA-FW are inadequate, that should be fixed too. The ESP32SPI fix should work with an unfixed and a fixed NINA-FW. This might also be brought up in the upstream repo: https://github.com/arduino/nina-fw. I don't see any dicussion there about this, but there could have been discussion elsewhere (e.g. in the Arduino forums).

manic glacierBOT
#

@lindes Thank you for your comments. We are very resource-constrained on the CPX, and have to balance stack size vs heap size. Does this still fail with 6.x? We turned on using a heap-based stack frames for Python.

@tannewt I know this is old, but I also use import test kind of things when doing some iterations. There are sometimes reasons why I don't want to use code.py (for instance, I need to start a clean Saleae trace before importing), but instead import manually from the REPL. If...

tulip sleet
#

@ivory yew @errant grail Both of you have boards in circuitpython that change the USB_INTERFACE_NAME away from "CircuitPython" to your own prefix. This means that the USB interface names change, from, say "CircuitPython CDC control" to, say, "Sol CDC Control".

Recently I submitted a PR (which was merged) to the Mu editor to detect CircuitPython boards by matching the USB interface name. It assumes a "CircuitPython CDC" prefix. So your boards would not be detected as CircuitPython by Mu due to this change.

Is this significant to your user base? I'm trying to decide what to do about this. The actual check is not in Mu itself, but is here: https://github.com/adafruit/Adafruit_Board_Toolkit/blob/main/adafruit_board_toolkit/circuitpython_serial.py, in a library I wrote for Mu to use.

#

(The Mu PR also handles secondary CDC channels, which was the main motivation for it.)

#

we could change these interface strings going forward so they are more general (e.g. "<something> CircuitPython CDC"). I need them to be backward compatible as well.

#

I can update the board toolkit library to detect your boards for now.

ivory yew
#

Crap, yeah, it'll definitely impact folks using Sol

#

For us, we really just need to change the name of the MIDI endpoint descriptor so that it's easier to differentiate Sol's MIDI output from others.

#

The user never really sees the CDC name, so I'm personally fine with that always being "CircuitPython".

tulip sleet
#

that sounds ok, or I can change the library to match against "Sol" as well. There is this "unbranding" effort going on for boards that aren't in the adafruit/circuitpython tree, so that enters into this too.

#

I think the easiest fix for now is to add "Sol" and "StringCarM0Ex" to Adafruit_Board_Toolkit as alternate prefixes, and then just submit a small PR to Mu to bump the required version of Adafruit_Board_Toolkit. This is all in a beta of Mu right now anyway, so this is the kind of thing to shake out. I did not realize you had changed the prefix until this morning when I was owrking on some code for dynamic USB descriptors.

#

yay str.startswith() can take a tuple of prefixes

onyx hinge
#

@tulip sleet huh I never knew! ```python

"abc".startswith(('x', 'y', 'b'))
False
"abc".startswith(('x', 'y', 'a'))
True

tulip sleet
#

i thought I would need a regex

onyx hinge
#

doesn't work in circuitpython, just desktop python

tulip sleet
#

that's ok, this is in the adafruit_board_toolkit library, which is desktop only

jaunty juniper
#

I'll take all the regex you don't use

tulip sleet
#

i am good at regex but it's harder to read

onyx hinge
#

yeah the problem with regex is the second person who has to work with it

jaunty juniper
#

(I switched to a regex for identifying the repl in my tool a few days ago, I wanted to add "IGNORECASE" and other changes without having to lookup every point of use in my code)

manic glacierBOT
#

Currently there is a USB_INTERFACE_NAME make macro that is normally set to "CircuitPython". But a few boards change this, currently to either "Sol" or "StringCarM0Ex".

USB_INTERFACE_NAME is currently used as a prefix when constructing USB interface names, so we have, for instance, "CircuitPython CDC control". I just started using this prefix in https://github.com/adafruit/Adafruit_Board_Toolkit/blob/main/adafruit_board_toolkit/circuitpython_serial.py to identify CircuitPython boa...

solar whale
#

@onyx hinge Woohoo! the ov7670_simpletest works great!!!

onyx hinge
#

@solar whale awesome! I always hold my breath when someone else is testing my code for the first time

solar whale
#

I was shocked that my first test of the Arduino code worked...nice work -- let me know if there are specific things you want testd

onyx hinge
solar whale
#

Thanks -- I'll try modifying it for my display -- 2.4 featherwing

still zephyr
idle owl
#

@still zephyr Thank you for noticing we hadn't updated it πŸ˜„

still zephyr
#

πŸ™‚

idle owl
#

@still zephyr Much of what's on there requires internal credentials, so you're aware. It initially had a lot of things that other folks could fix, but, well, folks fixed them. πŸ˜„ So now it's mostly keeping track of stuff for us. If you find something you can fix, great! But don't feel bad if you can't deal with some of it.

#

Always feel free to ping me with questions though about what something means or how it could be resolved.

solar whale
#

@onyx hinge oops -- I don't have the si5351 clock generator ... yet any hope without it?

onyx hinge
#

@solar whale sure is -- that was just debugging code for me

solar whale
#

ah - I see it is disabled ...

onyx hinge
#
ov.size = OV7670_SIZE_DIV4
ov.flip_x = False
ov.flip_y = True
g = displayio.Group()
bitmap = displayio.Bitmap(160, 120, 65536)
tg = displayio.TileGrid(bitmap, pixel_shader=displayio.ColorConverter(input_colorspace=displayio.Colorspace.RGB565_SWAPPED))
g.append(tg)
display.show(g)
buf = memoryview(bitmap)

display.auto_refresh=False
while True:
    ov.capture(bitmap)
    bitmap.dirty()
    display.refresh(minimum_frames_per_second=0)
    print(end=".")
#

after you create your camera you just need to do something like this .. most of the rest is just junk

#

after you have it working, I'm VERY curious what happens if you change your OV7670 constructor to ask for mclk_frequency=24_000_000. BEWARE, it may cause your board to crash hard at start, so you'll need to be able to get to safe-mode by reset button to fix it (unplugging the camera module might prevent the crash too). 24MHz works on Arduino but gave me problems in CP.

#

like the comment says, frequency_16m = True # Somewhere between 16MHz and 24MHz, ghosts haunt me

solar whale
#

OK -- will give that a try after I get something working.

idle owl
#

@onyx hinge Ok so, this? (I'm still fuzzy on what the pull should be) ```python
import board
import digitalio
import neopixel

pixel = neopixel.NeoPixel(board.NEOPIXEL, 1)
button = digitalio.DigitalInOut(board.BUTTON)
button.switch_to_input(pull=digitalio.Pull.UP)

while True:
if not button.value:
pixel.fill((255, 0, 0))
else:
pixel.fill(0)```

#

(It works.)

onyx hinge
#

shows red when button is pressed, dark otherwise? Is the same as you'd do for some other standard button? check and check

idle owl
#

Yes. Though I thought whether you pull up or down is based on whether you attach the button to gnd or 3.3v on a regular button.

#

So I get confused with ones that I don't hook up myself.

#

But it does turn red when pressed and off otherwise.

#

Thanks πŸ™‚

solar whale
#

@onyx hinge so far, the code runs, but it is not displaying -- I probably have something set up wrong for the ILI9341 -- I'll let you know when I get it going.

onyx hinge
#

@solar whale okay -- it would be good to add a displayio simpletest!

solar whale
#

@onyx hinge Progress. I’m getting 8 copies of the image, but it’s an image!!

onyx hinge
#

@solar whale that's odd!

idle owl
#

Pieces of 8!

solar whale
#

likely my setup -- I'm a displayio newbie...

onyx hinge
#

I should write up a proper test program, but each one will be specific to its display...

#

I'm getting faster at modifying the cameras now, this is #4. Seems to work well to push the VCC/GND pins up but not remove them, so that they become top-side headers. Carefully solder the SCL resistor to VCC flush with the PCB, then solder the SDA resistor to the SCL resistor's VCC side. I don't have my phone or I'd take a photo of what I mean..

ionic elk
#

@tulip sleet I have one final failure on the NRF52 sleep PR - French isn't fitting, even though basically all the new additions are turned off. Only a 36 byte difference.

#

Should I try cutting something? Or dig around for byte savings?

#

or, wait, I guess it's 484 bytes locally

#

For EN, it's 1948 bytes free. Is it normal for fr translations to differ by over ~2.5kb like that?

onyx hinge
#

short answer, yeah, translations can be a lot bigger than the original

ionic elk
#

I just made some message changes to be shorter and the FR bytes went up

#

I guess this isn't my ballpark 😬

#

can I turn off AESIO for the Simmel? It's the one thing holding this PR back

slender iron
solar whale
#

@onyx hinge I changed OV7670_SIZE_DIV4 to DIV2 for the 320x240 display but I now get an error ```
Adafruit CircuitPython 7.0.0-alpha.1-113-g46c9b1bc3 on 2021-04-21; Adafruit Grand Central M4 Express with samd51p20

import ov7670_displayio
note: mclk frequency = 17142857
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "ov7670_displayio.py", line 41, in <module>
File "adafruit_ov7670.py", line 640, in size
File "adafruit_ov7670.py", line 779, in _frame_control
File "adafruit_ov7670.py", line 723, in _write_register
OverflowError: value must fit in 1 byte(s)

#

do I have to change more than that one line setting the Divisor?

onyx hinge
#

interesting -- I probably haven't tried DIV2 (or DIV1)

#

probably it's a bug, mind filing an issue?

solar whale
#

sure -- will do.

onyx hinge
#

thank you!

still zephyr
#

But the pylint ones I could work on those right?

idle owl
still zephyr
idle owl
#

Great!

still zephyr
#

πŸ™‚

#

but I will do the pylint ones first

idle owl
#

Perfect. I will want to discuss how I want Adabot to handle directories, so working on the Pylint ones for now is a great plan.

still zephyr
#

Adabot is tricky πŸ™‚

#

yeah I will take a look on that for sure this week

idle owl
#

Adabot is indeed tricky.

still zephyr
#

Thanks Kattni

idle owl
#

You're welcome!

mental nexus
tulip sleet
#

@ionic elk is it being compiled -Os?

ionic elk
#

O2

#

Lemme give Os a shot

still zephyr
idle owl
idle owl
still zephyr
#

Good I am free on monday and tuesday

ionic elk
#

@tulip sleet weirdly, Os is larger again. I keep removing things and the builds get bigger, I don't understand it

#

Only thing that works is removing whole modules, and I don't know what's safe to exclude

tulip sleet
#

Make sure you do a clean in between

ionic elk
#

Yeah, did that

#

It is FULL_BUILD so maybe there's some other stuff we can scrap? HID mouse and keyboard, maybe?

tulip sleet
#

I don't know the use case for this board, but maybe

#

so the failures are in the nrf 52 sleep PR?

idle owl
still zephyr
tulip sleet
#

@ionic elk simple, just set SUPEROPT_GC = 0, and see if that's enough. If not do SUPEROPT_VM = 0 also

ionic elk
#

@tulip sleet yes, even though I've turned the actual Alarm module off for the board, and it also doesn't have Jun2Sak's debug stuff enabled. I think the board itself is this: https://simmel.betrusted.io/, which is an enclosed device for contact tracing, so I think we could actually safely get rid of quite a lot of stuff, even things like PulseIO, since there's no practical way they would be implementable on it

#

@tulip sleet while keeping Os?

tulip sleet
#

yes, then don't bother with shorter messages and all that, that's a pain

#

yes, the SUPEROPT things override the normal optimization flags for certain modules

ionic elk
#

Should I keep Os for the whole port? Probably not right? I can add a new flag for extra size optimization on small boards.

tulip sleet
#

no, keep that flag

#

just keep ditching more modules: usb_hid, pulseio, pwmio, countio, etc.

ionic elk
#

Won't it reduce performance across some boards that might like it?

#

not having O2 turned on I mean

tulip sleet
#

no, i mean this in the mpconfigboard.mk file for that board:

# Override optimization to keep binary small
OPTIMIZATION_FLAGS = -Os
#

keep that

ionic elk
#

Oh, I can override it. I didn't notice the ?= my bad

tulip sleet
#

turn off synt

ionic elk
#

Yeah I'll give that a shot. So far none of the option based stuff has done anything, is that weird?

tulip sleet
#

bitbanio, pulseio, pwmio, synthio, usb_hid, turn all those off. Leave the rest

#

yes, it's weird, you need to clean each time and then do make BOARD=simmel TRANSLATION=fr

#

make sure make clean BOARD=simmel. A general make clean does not clean that board

ionic elk
#

That's what I've been doing: make BOARD=simmel TRANSLATION=fr clean, and V=1 on the builds to make sure the files are being rebuilt. Maybe there's just nothing that can be optimized for this particular build?

#

Anyway I'm sure removing the modules will fix it, it's not that much memory

tulip sleet
#

what options were you changing before removing modules?

ionic elk
#

Build Os, SUPEROPT_GC, SUPEROPT_VM

tulip sleet
#

it's possible the SUPEROPT's are done wrong and are being overriden. Don't worry about it. Just put back the non-module stuff and ditch a few more modules

ionic elk
#

Built Os actually increased the flash size, and the other two didn't do anything

#

yeah no problem, I just wanted to ask about these other options, it's good to know about

tulip sleet
#

they definitely make a difference on atmel-samd, but the nrf makefile might be constructed a little differently

ionic elk
#

making a note that a) they exist but b) might not be working right

#

Want me to remove all the modules you mentioned to get extra space, or just enough to have it build?

tulip sleet
#

some of them are pointless on the board, go ahead and remove them

#

they probably have their own fork anyway

ionic elk
#

yeah synthio, pulseio and countio are plenty, and probably would have been hard to use on it anyway, so that's a good enough fix for now. Thanks for the help!

#

Now I just gotta figure out what on earth Jun2Sak did to the main sleep loop

mental nexus
mental nexus
idle owl
errant grail
tulip sleet
idle owl
#

Thank you for catching that @tulip sleet. It was in the template example as well copied from when I wrote the quick code to see if the button even worked on the QT Py.

tulip sleet
#

it works, for sure, I myself, was just, "wait a minute", why does 0 work?

idle owl
solar whale
#

@onyx hinge progress. Now have one image. See issue for my workaround.

solar whale
#

THis is one of those cases where the code is running an I am hanging on -- not sure if I have any idea what it is doing...

#

Actually - I have learned a lot by testing this. Thanks for the opportunity Jeff!

idle owl
#

So far, we have taught reading the microcontroller temperature using the REPL. Is it worth continuing to do so, or is it worth posting it as a short code.py? I'm leaning towards code.py but if anyone has an opinion, strong or otherwise, I'm open to it.

#

We don't need it to teach using the REPL, we do that elsewhere.

solar whale
#

@onyx hinge I tried the 24MHz setting and it did lock up the board. Since I'm not running it as code.py, a few resets brought it back...

onyx hinge
#

@solar whale OK, I'm glad it's not just me. The Arduino code uses 24MHz, so it must be something about CircuitPython -- but what....? a puzzler.

solar whale
#

one of many...

onyx hinge
#

@idle owl I can't think of a particular reason to show microcontroller temperature via REPL and not code.py

#

As long as the REPL is being introduced in one way or another

idle owl
#

Very much so, earlier in any guide that would include this page.

#

Thanks for the feedback.

ivory yew
#

@tulip sleet thanks for the pointer on the BOD33, I've added that to Castor & Pollux's firmware and that seems to work really well.

onyx hinge
#

@idle owl thanks for making the learn system better& more consistent

idle owl
ivory yew
#

Intentionally limiting the current to starve the voltage and watching it wait patiently for me to increase the current limit is :chef's kiss:

tulip sleet
#

the spi flash chips also don't work so well at low voltage. I think we may have seen some problems on that as well

ivory yew
#

I have 5 units powered by my bench supply and I'm just absolutely ruining their lives.

#

Thankfully no SPI flash for Castor & Pollux.

solar whale
#

@onyx hinge From my perspective, this OV7670 capability is a fantastic addition. Thanks for all the work on it. It will be a lot of fun to have.

ivory yew
#

But yeah, this is definitely due to the combination of missing bootprot and the voltage not being stable enough before the processor tries to run at 48MHz.

#

Keeping it at 1 MHz until VDD stabilizes is the ticket.

tulip sleet
#

even with bootprot, we were seeing the next flash page after the bootloader being FFFFFFF'd when the voltage was too low. This was just destroying people's programs, fortunately not brickingthe board.

ivory yew
#

oof, but yeah, at least that's recoverable.

idle owl
#

@mental nexus Invite sent. Welcome to the review team!

tulip sleet
#

it took several PR's to nail this all down.

ivory yew
#

Having my customers ship their module back to me to fix 256 bytes makes me sad.

tulip sleet
#

i know... our testers failed to set bootprot on some early SAMD51 boards, and that combined with this glitch meant we replaced a number of early boards

ivory yew
#

yike

#

Hehe setting my bench supply to just under the inrush current and watching the fixed boards patiently wait for their caps to charge while the unfixed ones run ahead to their death.

#

that situation is depressingly common in the eurorack world. People stuff a bunch of power hungry modules into a cheap power supply and that spells disaster quickly.

tulip sleet
#

kudos on being a responsible mfr πŸ™‚

ivory yew
#

well I feel dumb for not catching this before I shipped 100 of them, but yeah lol

#

I'm also publishing our stress test results in the user guides:

tulip sleet
#

you are building a real consumer product ; this is great

idle owl
#

"We don't recommend it, but you're not going to blow out your board if you accidentally:"

ivory yew
#

I am more nervous about the environment that my eurorack modules will be in than the environment that Perseverance is in.

idle owl
#

I imagine it can be more volatile than the environment that Perseverance is in πŸ˜„

ivory yew
#

"Hi yes, my module isn't working correctly. It's in a rack with 32 other modules, some of which are literally just some random leaves I shoved into the case #aesthetics. The power supply is a rusty 9v battery that I wired up through my cat."

idle owl
#

Wow this RP2040 runs hot. Anyone else have a QT Py RP2040?

#

I'm seriously going to have to change the wording on this page to not mention ambient temperature. Because I think it's misleading at this point. The iMX ran super hot as well.

solar whale
#

yes -- want me to try something?

idle owl
#

Yeah - run this: ```python
import time
import microcontroller

while True:
print(microcontroller.cpu.temperature)
time.sleep(0.15)

#

And tell me what you get.

#

And if it's not as hot as mine, let it run for a bit and then tell me what you have. Because this has been running code all day.

solar whale
#

36.9

blissful pollen
idle owl
#

Huh ok. Mine's at ~40.

solar whale
#

letting it run a bit

idle owl
#

Even 36 is up there.

solar whale
#

sitting around 36

idle owl
#

Beyond ambient air temperature.

idle owl
solar whale
#

yes -- its about 22 in here

idle owl
#

Ok, so scrub the wording. Noted.

#

This is why you test your code before publishing your guide pages, folks.

solar whale
#

I've never found the cpu temperature to be close to ambient.

idle owl
#

Hmm. The text surrounding it until now implies it's close. I am finding it not to be.

solar whale
#

asi t runs, it is getting hotter -- >37 now

idle owl
#

Ok. Good to know.

blissful pollen
#

Just started the feather, hanging about 30. Just as reference Pico is showing 17 but its slowly creeping up

idle owl
#

Hmm.

solar whale
#

Must be cold in your room!

idle owl
#

Well that's still a majority that are coming in hot. And this page is meant to go in every guide.

#

Any idea if it varies based on the intensity of the code or anything like that?

solar whale
#

It should!

idle owl
#

Ok.

#

Making sure I'm not making things up here πŸ˜„

solar whale
#

certainly does on something like Pi4

blissful pollen
solar whale
#

Maybe its upside down πŸ˜‰

idle owl
#

Holding it wrong πŸ˜†

solar whale
#

just got to 38...

blissful pollen
#

i'll let them sit here running for a while to see

idle owl
#

Thanks @solar whale and @blissful pollen. I appreciate the help!

solar whale
#

Glad to help!

blissful pollen
#

No problem, they're both slowly creeping still. Feather is just shy of 32 now. No clue why the pico is colder then my room maybe something else going on

idle owl
#

Yeah it is a bit odd.

#

Updated Mu, and it went through the initial install sequence and the animated snake checking its watch made me laugh out loud. I love it! @plucky flint

#

Odd, the latest version of Mu, I can't make the window as small as it used to let me. Wonder what the reasoning was for that.

#

Oh well. Wider screenshots. πŸ€·β€β™€οΈ

#

Or they won't include the entire window. Also valid option.

plucky flint
#

πŸ‘hmmm... not sure about window size thing. A couple of contributors have been working on the UI. Glad you like the splash screen. Mu (and coding) is all about having fun.

#

Playful=good

idle owl
#

It was so on point. You're stuck waiting for a bit, and the snake is right there with you.

#

I'll file an issue then if it wasn't a deliberate design decision.

plucky flint
#

Please do.

#

All feedback is always welcome

idle owl
#

I know, but I try to avoid whinging about things that were added for a reason πŸ˜„

#

Anyway, cheers! Mu keeps getting better and better.

plucky flint
#

Thank you... and it's important to note that Mu only improves because folks whinge at us... (Where whinge = constructive criticism). πŸ˜† mu πŸ‘

idle owl
#

Valid!

plucky flint
#

Also, Steve and I (Steve does the snake logos), spent WAY too much time perfecting that splash screen. There's more of that vein coming too.

idle owl
#

Well done you and Steve, then!

plucky flint
#

πŸ‘

idle owl
#

Sanity check. This is the proper maths for Fahrenheit, correct? microcontroller.cpu.temperature * (9 / 5) + 32

#

Seems right.

blissful pollen
#

Yeah think that's right (as I tried well known values to verify with a calculator πŸ™‚ )

idle owl
#

I guess if I wanted to be stricter, I could (microcontroller.cpu.temperature * (9 / 5)) + 32 but given that multiplication/division happen first regardless, it is unnecessary.

manic glacierBOT
#

This is a weird one, but both @jerryneedell and I have seen it.

If an OV7670-style camera is plugged into the Grand Central M4, and a 24MHz PWM signal is generated on pin D29, then "weird stuffβ„’" happens. This causes a crash or hard-fault during camera initialization (before the new ParallelImageCapture object is even instantiated), and occasionally things that look like non-fatal memory corruption. If the PWM signal is slower (nominal 16MHz, actually 17.mumble MHz) then things are OK.

...

manic glacierBOT
#

Tested this on the Feather NRF52840 across real/fake light/deep sleep types, and it works well across all modes. The only functional issue it has is not retaining a system tick across deep sleep, which causes the USB enumeration delay to occur every time it tries to deep sleep, but that's only a minor power loss with longer sleep periods and likely solvable with a follow up issue.

There are also a couple of stylistic things that could still be changed - `common_hal_alarm_pretending_deep_s...

#

Note that this required a few final edits, including some formatting changes and a couple of module exclusions to make the new code fit on existing small NRF boards like the Simmel. I've also reverted the changes to main - the existing sleep loop is already capable of detecting a fake sleep wakeup, and changing it to an on-the-spot return breaks the ESP32-S2 and STM32 builds of Alarm.

ionic elk
#

@tulip sleet wrapped up final fixes and testing for the NRF52 Alarm. There's still a little bit of sweeping up to do but if it's ok I'd rather circle back to that later so we can get STM32 and the changed ESP32S2 internals in.

tulip sleet
ionic elk
#

I didn't edit much of their code other than reverting the changes to main. I'm not sure if it was maybe the new changes that I merged in, or just a misunderstanding from the start, but they do a lot of wakeup reason detection in the common_hal_alarm_pretending_deep_sleep that shouldn't be necessary. I just deleted the stuff in main, and sleep works exactly the same in testing.

tulip sleet
#

there was a motivation for that initially, but I don't remember exactly. There might be hints in the previous comments.

ionic elk
#

I know the general reason for common_hal_alarm_pretending_deep_sleep is that a system reset on exiting the VM returns pins to a state that's unable to detect wakeups, which is the same for STM32

tulip sleet
#

ah but once that was removed, then it was unnecessary; yes, that might be it

ionic elk
#

But my hunch is that the stuff detecting non-alarm wakeups is just an oversight that main.c does the same thing. The flow is a little weird so I wouldn't blame them

tulip sleet
#

yes, the flow is quite weird - the odd use of an exception ,etc

#

originally this pr was only deep sleep, I believe

ionic elk
#

common_hal_alarm_pretending_deep_sleep is still there, I just got rid of the stuff that returns after it, because main.c will do that automatically after the loop cycles around

tulip sleet
#

this sounds fine, especially since you've tested it. Are you blocked if it's not merged? I though we'd just wait overnight on this, since jun2sak is in Japan.

ionic elk
#

I'm fine to wait overnight that's no problem, I'm doing RP2040 stuff. I'm just feeling the pileup a little bit - we have this, then STM, then the internal API, then RP2040...

#

For instance, I'm not comfortable fixing parts of this PR, like simplifying common_hal_alarm_pretending_deep_sleep to match STM32, until the #4606 changes are in

#

I'd rather just get NRF and STM in, and then we can clean everything up in one big push in #4606

tulip sleet
#

that sounds fine; tomorrow let's merge even if we don't have feedback. I will take a last look also.

ionic elk
#

great, ty

still zephyr
#

@idle owl I verified two libraries that showed as failed pylint checks in the infraestructure issues, Imageload and requests, and both passed when I run pre-commit locally πŸ€”

idle owl
still zephyr
#

😳 good point. I ll verify that

idle owl
#

That's the first thing that pops into my head is that the Pylint versions are different. Because Pylint added things etc.

#

No guarantees I'm right.

still zephyr
#

I just do the same as alwawys. clone, and it creates ethe .env, install dependencies

#

So I need to verify the version

idle owl
#

Ok

still zephyr
#

I will inform you next Monday πŸ™‚

idle owl
#

Sounds good πŸ™‚

idle owl
#

What the..... 🀯 Setting auto_write=False isn't necessary for the rainbow cycle to work. I....... seriously thought it was.

#

deletes a couple of things from code and saves herself having to explain calling show()

#

@tulip sleet Am I missing something here? Maybe it was carried over from using the rainbow cycle with other things that required auto_write=False?

#

Or is it one of those things that's required sometimes and not others, and if I don't include it, behavior will be different on different boards. πŸ˜–

tulip sleet
#

auto_write=True will just update on each change to a pixel of set of pixels (each call). So if you need to do multiple calls to set up something, then auto_write is faster. I guess it's possible that intermediate auto-writes will also change the appearance of an anmiation

#

definitely not different on different boards

#

the state of the pixel buffer is written out on .show() if auto_write is false, and on every call if auto_write is true

idle owl
#

Oooooh right, it was faster.

#

I think pixelbuf also made it faster

#

Because it is zooming over here without it set to False.

tulip sleet
#

try it true and see if it's slower, which is should be

idle owl
#

Ok, I forgot about the making it faster part.

#

It's zooming with auto_write=True

tulip sleet
#

i mean false is faster, true will be slower

idle owl
#

Honestly can't tell the difference anymore.

onyx hinge
#

in adafruit_led_animation/animation/__init__.py, Animation.__init__ sets self.pixel_object.auto_write = False

idle owl
#

Between True and False.

onyx hinge
#

so .. I think it's happening behind the scenes?

idle owl
#

Used to be REALLY obvious.

tulip sleet
#

that is good that it does the right thing

onyx hinge
#

ok nevermind, I zoomed through the conversation too fast πŸ™‚

idle owl
#

@tulip sleet So should I continue with what we've been doing and include False and show() or roll with the improvements pixelbuf brought and leave it out now?

#

Because I can't tell the difference between them anymore. Used to be sooooooo sloooooow without it set to False.

tulip sleet
#

i think for any significant animation, auto_write=False is better, because it will be faster. You just have to figure out where to call show

idle owl
idle owl
#

Ok, I'll leave it in and explain it.

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
still zephyr
#

Are the new changes available when merging with MP in CP 7 or before?

ivory yew
glossy pecan
#

Question on using SPI in CP on ESP32S2
Found busio.SPI in the docs, but how can I setup pin assignments and a chosen ESP32 SPI peripheral? This chip has several variant peripherals that can do SPI, and the peripheral pins can be mapped to various HW (GPIO) pins. Lots of choices in setup. Looked at the sample code in Examples, but all of them seemed too complicated or not ESP32 specific. Where can I find a simple example that just creates an SPI object, reads a specific addressed byte from a SPI slave device (e.g., an ID register) and prints its value?
TIA, Mike

manic glacierBOT
#

@dhalbert Gladly. :)

Given that memory error I mentioned at the end, I ended up starting to use mpy-cross for things, and that seems to have fixed things up for me fairly well. I've still had occasional problems, but not the stack error -- even after removing the supervisor.set_next_stack_limit call entirely. It even works in the REPL! Yay!

@tannewt fair enough. Given the experience I had above, I guess my suggestion for future advice is to advise folks to use mpy-cross if they'r...

manic glacierBOT
manic glacierBOT
manic glacierBOT
ivory yew
tulip sleet
ivory yew
#

That would be lovely

tulip sleet
ivory yew
#

😊 thank you!

manic glacierBOT
still zephyr
slender iron
#

when was it added?

#

but ya, probably

tulip sleet
#

not sure it is turned on

#

@slender iron πŸ‘ I started a review last night; going through files, but not in great detail

slender iron
#

thanks! I marked as ready since the CI passed

still zephyr
#

I saw it in the change diff in the 1.10 yesterday

#

I am talking about deque

still zephyr
manic glacierBOT
tulip sleet
#

@slender iron reviewed and approved 1.10 merge. I did not merge yet in case you want to do anything else in advance

slender iron
#

nothing I'm aware of

#

just about done with merging 1.11 and then it'll be fixing the compile and then the tests

tulip sleet
#

ok, merging!

slender iron
#

πŸŽ‰

still zephyr
solar whale
#

@onyx hinge If I clone your pcc branch of CP, I can keep up with any changes you make to the PR 4635, correct? With all the new stuff going into CP main I was not sure if you were going to keep the pcc branch updated as well. I found it gets very mess building PRs that are not up to date with main.

tulip sleet
#

Warning to all 7.x testers: the .mpy file format has changed with the merge of #4646, so use .py libraries to test (or make a fresh mpy-cross and recompile). It will change once or twice more

onyx hinge
#

@solar whale I hope it'll be in mergeable state soon, but probably not today.

solar whale
#

Good luck!

onyx hinge
#

@solar whale I'll merge main into it if that seems to help with getting it ready, like if it has conflicts

solar whale
#

@onyx hinge no problem and no rush on my part.

#

thanks

onyx hinge
#

i'll be working on it tomorrow

solar whale
#

Good luck with it an let me know if there is anything I can do to help.

#

@tulip sleet so a new mpy-cross "should" work with 7 going forward, correct?

tulip sleet
#

Scott is merging MicroPython 1.10, 1.11, 1.12, 1.13, 1.14, 1.15 in succession to keep the size of each merge down. I think he said the .mpy format changed at least twice in that succession. So as those merges go in, there will be churn on the mpy version

solar whale
#

Sounds like fun!! Good luck!

ivory yew
#

We're pulling in upstream? Color me excited.

still zephyr
#

Wondering if we could pull the C DHT library from MP also πŸ€”

slender iron
#

1.10 doesn't actually change the format. 1.11 and I believe 1.12 do though

blissful pollen
#

Really exciting news about the merges. Is the best bet to read the micropython release notes to see what will change in regards to CP?

slender iron
#

yup yup

#

and ignore all of the port specific stuff

manic glacierBOT
#

Some other considerations:

API:

  • There's no CPython API that I know of for controlling an AP, so we'd be winging it to some extent. Initially maybe just a wifi.radio.start_ap(ssid, password) or similar, optional params like channel, max_connections, etc. could be added later, along with some helper functions to get info about the SoftAP (MAC, etc.)

STA vs. STA+AP vs. AP:

  • There are reasons to keep STA as the default, and support STA or STA+AP. For example: scanning requires a stat...
manic glacierBOT
#

@daveythacher this is the PCLK rate, not related to FPS, we are not using video.

PCLK is correlated to data rate. CLK is correlated to internal clock. (Table 5) Some internal CLK is correlated to PCLK. (Table 5) A single frame will exceed RAM limit. The exact internal clock value needed is not clear me, however I did not read the entire thing. I failed to see internal osc, so I can only assume there is a correlation from CLK to PCLK. I saw the pull request which works off single frame ca...

manic glacierBOT
slender iron
#

@onyx hinge @lapis hemlock do you know if there is a ulab that uses all lower case mp_obj_is_type?

onyx hinge
#

@slender iron I don't know offhand, I can check around

#

@slender iron in fc80a256856d3eb4245aa5e83153061967c2e5c5 I changed them all to "Increase CircuitPython compatibility"

#
src/micropython$ git grep OBJ_IS_TYPE
py/obj.h:#define MP_OBJ_IS_TYPE mp_obj_is_type
``` shouldn't it automatically switch over to the "right one" via this macro?  I assume this is something that changed since our old cp version
tulip sleet
#

and the current ulab is compiling ok with 1.15

onyx hinge
#

Yes, I believe their CI is always using the latest micropython when it runs. (same with cp, right now)

#

for a long time, or maybe in their legacy branch?, we had checked out specific branches or releases, but their main branch seems to just get the latest

tidal kiln
#

for namedtuples, it seems like this option only works for some boards?

onyx hinge
#

@tidal kiln I don't recall anything like that, but if accurate it would be good to document it. what are you seeing?

tidal kiln
#
Adafruit CircuitPython 6.1.0 on 2021-01-21; Adafruit ItsyBitsy M4 Express with samd51g19
>>> from collections import namedtuple
>>> foo = namedtuple("foo", "x y z")
>>> 
#
Adafruit CircuitPython 6.2.0 on 2021-04-05; Adafruit QT Py M0 with samd21e18
>>> from collections import namedtuple
>>> foo = namedtuple("foo", "x y z")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: object 'str' is not a tuple or list
>>> foo = namedtuple("foo", ("x","y","z"))
>>> 
#

(edited to add what works for 2nd case)

onyx hinge
#

huh, okay. I don't see where that can be separately enabled/disabled, and qt py m0 would not intentionally have things deactivated like that (it's not cramped like samd21)

#

it may be an unintentional change, you compared 6.1 and 6.2 above

tidal kiln
#

yep. just the firmware that were on these.

#

let me update the itsy m4 just to be sure

onyx hinge
#

#if MICROPY_CPYTHON_COMPAT

#

ok you're right, it is enabled/disabled by this

#

so the question is why MICROPY_CPYTHON_COMPAT is not set on rp2040, I think

tidal kiln
#

the QT Py is M0

#

so maybe a "small board" thing

onyx hinge
#

I doubt it's intentional, it has plenty of code space

tidal kiln
#

not QT PY RP2040

onyx hinge
#

oh okay .. then that's why

onyx hinge
#

my reading comprehension ... sorry

tidal kiln
#

np. there's only like 5000000000000 different boards πŸ™‚

onyx hinge
#

indeed

#

so yeah that would have to be changed for compatibility. adding .split() to the string-arg would be sufficient, or would be listifying it yourself

#

assuming it otherwise fits

tidal kiln
#

yah, haven't tried with a mod'd version yet. for now, just fails due to that named tuple thing.

slender iron
#

I'm trying to switch us to the lower case version

crimson ferry
#

shared-bindings is hard

blissful pollen
#

Someone is asking in livebroadcast and I cannot recall, does compiling to mpy save any RAM or just disk storage? Also asked the same regarding comments in the library

jaunty juniper
#

saves a bit of RAM that is used for loading the .py text and compiling, nothing after that

#

(so if you run out of ram due to big allocations in the code, that's not gonna help)

manic glacierBOT
still zephyr
manic glacierBOT
manic glacierBOT
#

Super-rough and early proof-of-concept. I'll make a draft PR, still many questions on architecture, API, and implementation. It gets complex pretty fast, it would be great to collaborate with someone knowledgeable about the core and wifi.

import wifi
import ipaddress
import socketpool

from secrets import secrets

# this STA connects to an AP
print(f"Enabled?  {wifi.radio.enabled}")
print("Connected?", end=" ")
wifi.radio.connect(secrets["ssid"], secrets["password"])
print(boo...
manic glacierBOT
#

Rough early implementation based on comments in #4246...

Current Assumptions:

  • Station (STA) is the baseline default mode.
  • Access Point (AP) is started to create STA+AP mode.
  • Single event handler due to STA and AP events sharing the WIFI_EVENT_ base.
  • Single radio object with STA and AP configs and netifs
  • Like STA, AP netif is always created at wifi init, and destroyed at reset
  • ...

Current Status:

  • AP has params ssid and password only (needs channel, au...
idle wharf
thorny jay
#

https://xkcd.com/2407/ so it was not only a French speaker lost in translation joke... I made an xkcd joke I had not seen beforehand!

stuck elbow
#

oh. the PAIN-first search!

manic glacierBOT
manic glacierBOT
#

I agree that Sphinx is not obvious in what is the best way to highlight things as code and cross-reference to other documentation.

I had tested a local docs build and the changes made, the single quotes, get rid of the red links (generally interpreted as errors or missing links) that are currently on the website . I can rechange these back if you prefer but I think that __getitem__ and...

manic glacierBOT
#

With your changes, these new warnings below are generated during make html:

home/halbert/repos/lesamouraipourpre/circuitpython/shared-bindings/displayio/index.rst:36: WARNING: 'any' reference target not found: ulab.numpy.frombuffer
/home/halbert/repos/lesamouraipourpre/circuitpython/shared-bindings/displayio/index.rst:66: WARNING: 'any' reference target not found: y * width + x
/home/halbert/repos/lesamouraipourpre/circuitpython/shared-bindings/displayio/index.rst:76: WARNING: 'any'...
manic glacierBOT
manic glacierBOT
lapis hemlock
#

@tulip sleet Dan, is there somewhere a decent summary of the different representations in micropython?

tulip sleet
#

makes it easy to drop the two lowest bits when testing our float represenation

lapis hemlock
#

@tulip sleet Thanks for the link! Someone pointed out that circuitpython uses the C representation, and then the float constants didn't work.

slender iron
manic glacierBOT
idle wharf
#

Sorry, I couldn't find this.... what is the link to "install the example with its dependencies" ?

idle owl
jaunty juniper
#

oh by the way I noticed a thing in the learn guides: when looking at the "Single Page" version, the table-of-content links on the side don't lead to anything, because the #someting anchors are not in the page

idle owl
jaunty juniper
#

it's not you, there are no anchors in the page for the big section titles

manic glacierBOT
idle owl
jaunty juniper
#

ok

idle owl
manic glacierBOT
manic glacierBOT
#

Just a note: I can't think of any material downsides to using STA+AP mode for achieving AP mode. There is some resource load, I don't know how significant. But STA+AP can be used just like AP-only, by just not invoking any STA functionality (scan, ping, connect, etc.)

The trick about AP-only mode is that STA currently starts by default, so if we want to allow AP-only as opposed to STA+AP, there are two ways I can think of:

  1. Don't start STA by default (don't start anything by default...
manic glacierBOT
idle owl
#

@slender iron What phrasing are we using for the two I2C address options? I don't remember. Jose David is updating docs in a lib, and I noticed "slave address" was still used. But I can't remember what it should be.

#

Peripheral, maybe?

blissful pollen
#

Was it sensor, or secondary?

idle owl
#

Finally found it in the design guide.

#

It's all three.

#

So I don't know which one is preferred for I2C. I feel like it's peripheral.

blissful pollen
#

Kinda makes most sense...

idle owl
#

I don't want to steer him wrong is all.

#

So I asked first.

still zephyr
#

Ohhh,, Did I use slave that is my bad, I could correct that.

idle owl
#

@still zephyr Yeah πŸ˜„ That's what I was trying to sort out to comment on the PR.

still zephyr
#

Ok I would correct that, I need to go back and verify, no problem

#

Meaning old PRs

idle owl
#

OK I'm not going to comment everywhere. I'll comment once and let you make the changes.

still zephyr
#

Yes thanks no problem

#

@idle owl Thanks πŸ™‚

idle owl
still zephyr
#

So danh requested to change the reference from busio to board...So the thing here is, I can do that everywhere but the parameter list. If I do that in the parameter list, I do not get the link for our Circuitpyhton documentation

idle owl
#

Hmm.

#

Oh I guess that makes sense because board isn't really a thing.

still zephyr
#

But as you could see in the designing guide we use busio

#

Yeah, when sphinx try to get the documentation objects from the page, they return a non valid object

idle owl
#

Hmph.

#

That's disappointing.

still zephyr
#

Yes, but the end user will not see this

#

they will see I2C, if they click on the word they will go to the busio.I2c documentation

idle owl
#

Ok. I guess leave it as is for now. We can always dig back into it if we come up with another solution.

still zephyr
#

Yes I try even to include the reference in the sphinx_intermapping withou any luck

#

Maybe there is a way I could not find it yet, but Agree we can go back and change it, it will be easier

#

Do yo see anything else that I need to change?

idle owl
#

Keep it in the back of your mind in case you happen upon a solution in the future, but don't stress over it.

#

Nope, everything else looks pretty good

still zephyr
#

ok, no problem will do thanks again kattni πŸ™‚

idle owl
#

Thank you!

tulip sleet
#

@still zephyr Could you point to a line where the link cannot be created?

#

board and busio should work equally well here. But I have an idea of something that might dbe different.

manic glacierBOT
onyx hinge
slender iron
#

yup yup

onyx hinge
#

thank you kindly

slender iron
#

np!

onyx hinge
#

πŸŽ‰

manic glacierBOT
onyx hinge
#

hmmm before now it didn't matter that weblate was always a "first-time contributor" but now it'll be an irritation

slender iron
#

@onyx hinge maybe you can add it as a collaborator

onyx hinge
still zephyr
#

I tried differents options and then build documentation locally to verify...

#

~board.I2C() board.I2C :class:board.I2C :class:board.I2C(), I tried to use the reference in read the docs, and use the sharedbindings documentation directly putting it in the sphix_intermapping.

#

Just for the fun of it I tried to include board, and busio in the mockup documents😬 , and other crazy things like that, I think once, I could get the link to the correct board.I2C page, but not sure at that time I was dreaming or what... so no luck

tulip sleet
still zephyr
#

ohhhh

tulip sleet
#

the example uses board.I2C() to return a busio.I2C object

still zephyr
#

no board.I2C() did not work

tulip sleet
#

right, it would not work, because it's just one instance

#

of the class

still zephyr
#

agree

#

ok so I could continue usins as it is?

tulip sleet
#

yes, absolutely. It's just the examples that would use board.I2C() for convenienece

still zephyr
#

πŸ™‚

#

happy now , thanks DAHN

#

yes, the examples yes, I tested that in a lot of sensors yesterdays and work without a problem, i have a proposition...

tulip sleet
#

you don't need to test board.I2C() where you are changing from busio.I2C()

#

if that's what you were testing

still zephyr
#

In an old example I found, explaining in a nothe that in case that they need to define an specific address they can added to the sensor constructor

#

I was testing board.I2C()

tulip sleet
#

you only give the address when you create the sensor object

still zephyr
#

agree

#

but as you always mentions, I guess for beginners it is better to leave the example without any address, right?

tulip sleet
#

yes, you can use the default address. these are just the most basic examples. If there is a sensor where there is no default address or something like that (not sure what that would mean, maybe set by DIP switches or something), then I would give the address. But for a just-out-of-the-bag sensor, it will use the default address

still zephyr
#

Will do, thanks dahn for the explanation I have a couple of free days off from work so I was planning to do this πŸ™‚ thanks !!!

tulip sleet
#

you're very welcome, and thank you for doing all this work!!

manic glacierBOT
still zephyr
#

@tulip sleet I push the first one, I did the BME280 and add the note that you recommended for the other PR on the BMP280 regarding the pressure. With all the discussed changes.

solar whale
#

@onyx hinge FYI just updated to tip of main with your parallel image code merged. Still works on my grand central!

manic glacierBOT
#

I've encountered this bug after building the touch deck from John Park's tutorial: https://learn.adafruit.com/touch-deck-diy-tft-customized-control-pad. Power cycling is my workaround.

Adafruit CircuitPython 6.2.0 on 2021-04-05; Adafruit Feather RP2040 with rp2040

Traceback (most recent call last):
File "code.py", line 34, in <module>
File "adafruit_featherwing/tft_featherwing_35.py", line 34, in init
File "adafruit_featherwing/tft_featherwing.py", line 67, in init
...

still zephyr
#

Thanks @tulip sleet blinka.

meager fog
#

@lone axle hey00

#

i have a QUESTION and possible a QUEST

#

(the quest has a πŸͺ™ at the end too πŸ˜‰

lone axle
meager fog
#

ok your gfx thing is awesom

#

which gave me a Bad Idea

#

(sometimes these are good ideas in disguise)

#

could we auto-generate a PNG that is auto-commited to the learn repo for each circuitpython project?

#

by the CI runner

#

cause then it 'lives' somewhere, and is updated every time the code changes

#

code may need to be 'ported' to a CLI-lang like python+pillow or somethin

lone axle
#

Interesting. I'm relatively green with CI stuff but I do think it's possible to get it set up to be automated like that.

meager fog
#

the CI stuff i can do

#

(its just like, a shell script we run)

#

but i need the script to run on a headless linux compy

#

so javascript is a bit tough..

lone axle
#

I will tinker with it some and see what I can come up with

meager fog
#

ok ill reply to the thread, we have a budget for it!

#

are you using melissa's json-parsin-requirements code to do it?

lone axle
#

Currently I've been typing in the names. But the plan was to re-use whatever is generating the new zips to be more automated.

meager fog
#

ahh

#

ok so you'll want it to run on the python script itself

#

and then use.....

#

hmm

#

hold on

#

i gotta find the thing that determines the imports hehe

#

hehe

#

@lone axle try that

#

so that gives u the imports

#

then you can use...

lone axle
#

Ooh neat. I'll give it a shot

meager fog
#

the latest bundle json

#

(that will require github api)

#

parse the json to get the dep tree

#

then generate the image

#

and we'll see how it goes!

ornate breach
#

I’ve only seems a few instances of DFS/BFS algorithms used in the wild and it’s kind of cool to see it in action here

manic glacierBOT
#

Connection to AP (open wifi) working now:

W (6142) wifi: got ip
I (6212) wifi:mode : sta (7c:df:re:da:ct:8c) + softAP (7c:df:re:da:ct:8d)
I (6212) wifi:Total power save buffer number: 8
I (6212) wifi:Init max length of beacon: 752/752
I (6212) wifi:Init max length of beacon: 752/752
W (6222) wifi: ap start
I (6222) wifi:Total power save buffer number: 8
W (6222) wifi: ap stop
W (6232) wifi: ap start
W (6232) radio: ssid=Bob
W (6232) radio: password=
W (6242) radio: max_connec...
meager fog
#

@ornate breach 🌲 🌳 🌴

ornate breach
#

I learned a lot of algorithms in my Algorithms class and I honestly wish I used them more in my day job.

meager fog
#

srsly i would love to use merge sort at least once before i die

#

i feel like most is just teaching you what to avoid

fossil gorge
#

After balancing a binary tree

meager fog
#

"oh look its concurrency - use one of the many theoretical algorithms that deal with it? NO just DONT DO IT"

#

my first interview i was asked what a red-black tree was and i said i couldnt remember

#

and i got credit for admitting i had no idea because nobody at the table except for one guy did either

fossil gorge
#

"How would you go about implementing a binary tree in your system"

  • Errr, pip install one-of-many-binary-tree-package ?"
meager fog
#

i was also 16 so kinda surprised they'd expect it

jaunty juniper
#

now I have to google it !

meager fog
#

"i dont! i use a built in object model in the language because its not 1996 anymore!!!"

#

"i also know how to write a compiler but why do that? nothing good comes from lex or bison"

fossil gorge
#

"But lets say it WERE 1996? How would you do that?"

  • Let me answer your question with a question: Has that need EVER come up on this or any related projects before?
meager fog
#

if its 1996 i demand acid tekno, large pants, and no cell phones in the work place

#

@lone axle ok well reply to the thread if/when yr at a spot. i have to go iron my JNCOs

fossil gorge
#

That 2nd request, that's legit.. some would say even 2 legit!

ornate breach
#

The standard we follow for my job, JSF++ prohibits using recursive algorithms

fossil gorge
#

That can certainly make certain projects a bit difficult

ornate breach
#

Granted it was written for C++99

#

Back when memory alloc and management was much much harder

#

We are at C++11 now πŸ˜†

fossil gorge
#

Yeah, but still, I've had to write Fibanocci and tower of hanoi functions in school. But also, how would you do compounding interest calculations without them?

#

For me, that was pre-C++99

ornate breach
#

Only 10 years behind

fossil gorge
#

Wait... C++11, wouldn't that make it C12?

ornate breach
#

I did algorithms in Java

fossil gorge
#

Since you're using prefix ++ operator?

ornate breach
#

Version type is usually C++11

#

For 2011 stable release

fossil gorge
#

(this is why we use parenthesis for order of operations, kids!)

ornate breach
#

Pedmas except for when you don’t mean pedmas

#

At work we basically default to horrible horrible exponential time algorithms

#

O(N^m) complexity

#

Well, except when we do any DSP stuff then we just do whatever the complexity of the algorithm is

crimson ferry
#

Other than Scott (who is busy merging mp), who else knows the core well (wifi specifically, but also just general core/mp/c++ things)? The more I get into this PR, the more the scope creeps as complexity reveals itself. At some point, I'll draw a line and leave enhancements as an exercise for future contributors, but I have... Questions. Better in the PR, or just pop them into here from time to time?

still zephyr
#

danh?

hollow token
#

Would there be any push back if I were to make a combined library for both the MCP230xx and MCP23Sxx?

#

Named as MCP23XXX?

lone sandalBOT
manic glacierBOT
blissful pollen
manic glacierBOT
#

I understand that there is limited time and resource for concurrency but more and more devices/MCUs are supporting/providing more than 1 core.

It would be great to have this in general and not just for the RP2040 also for various reasons/usecases. I'd honestly prefer some planning go into getting concurrency as a whole (if it isn't/hasn't been done yet) because more devices in the future will have a multicore offering.

Offering even just async tasks to be placed onto other cores that sh...

solar whale
#

@onyx hinge do you want me to merge your PR for the OV7670 or do you want to do that yourself or wait to see if there is more discussion. Still don't understand why the "4" was there in the first place...

solar whale
#

@onyx hinge for the RP2040 Pico -- do you use GP12-19 for the data pins - for the OV7670?

manic glacierBOT
still zephyr
hollow token
#

0 is I2C and S is SPI

still zephyr
#

gotcha

hollow token
#

I'd rather be able to provide a lib that allows both

#

and yes I know Adafruit doesn't sell the SPI version

still zephyr
hollow token
#

yeap

still zephyr
#

πŸ™‚

hollow token
#

so that would become MCP23XXX

#

instead of MCP230XX

still zephyr
#

Any PR is always welcome πŸ™‚

hollow token
#

But he isn't being the most helpful because I'd like to keep his account in the commits

solar whale
still zephyr
#

mm interesting, is this library in the community bundle?

hollow token
#

Pretty sure it isn't

#

@solar whale thanks

still zephyr
#

right, yes I jerryn mentioned we have a lot like that.

#

we need to see changing that name what implies... learning guides, and references... but for sure the SPI support is helpful

misty garnet
#

As long as combining the libraries doesn't stress the memory needs too much, usually you're using one or the other at a time

hollow token
#

I'll see if I can include compat so that the old name still works

still zephyr
#

Thtat is a valid point

hollow token
#

actually, could just make 2 lib release artefacts with the new and old name

hollow token
still zephyr
#

I think from all the things behind this (meaning: documentation, examples, rst files, readme, etc,) is easier just to crate a new MCPSXXXX.py file in the library

hollow token
#

I'll see how I go with it

still zephyr
#

Thanks

hollow token
#

Might just leave the name change as an extra question on the PR for the spi support

still zephyr
#

right right good idea

crimson ferry
#

@blissful pollen Thank you!

onyx hinge
#

@solar whale yes that's right for the data pins. You are welcome to merge after you review.

manic glacierBOT
stuck elbow
#

Apropos #4602, did anybody try receiving for ir remote on samd21 recently? I can't get it working, while on samd51 it works fine.

#

I'm getting 'Both even/odd pulses differ' and 'Only mark & space handled' errors.

solar whale
#

@stuck elbow I just tried it with a new build (tip of main) on a PIRKEY_M0 and it seems OK. receives from remote.

#

but I am finding an old issue that sometimes I can't use Control-C to break out of the program after receiving data.... I know I've seen this before. Does not happen all the time. Looking at old issues...

jaunty juniper
#

I have that happen a lot with the Mu beta, though it might be unrelated

solar whale
#

Not using Mu here, and now I can't reproduce it....

#

ah -- yes I can...

#

The code is running fine -- just won't respond to a Control-C...

jaunty juniper
#

that was a few days ago, it seemed like it was triggered by Mu and I made a note to look into it, but haven't yet, it might actually be the same and not related to Mu

solar whale
#

It may be a "linux" issue -- "screen" is not happy.

#

I'll have to see if I can come up with a clean "issue" to file.

#

Out of time for today -- I'll look into it tomorrow.

stuck elbow
#

it shouldn't matter on which pin the sensor is connected, should it?

#

also, while it's waiting for pulses, autoreload doesn't work

stuck elbow
#

tried a different board, and now it's not throwing errors, simply just not capturing any pulses

stuck elbow
#

hmm, works with serpente

ionic elk
#

@tulip sleet should Pinalarms be claiming pins? They don't, at present. Is there some reason we'd want them to be able to overlap with another module?

tulip sleet
#

They should for light sleep, but for deep sleep all the pins are released, so they get "claimed" during deep sleep.

ionic elk
#

Different ports will react differently to the overlap, note. Redefining a pinalarm as a digitalIO on RP2040 will have basically no effect, doing it on STM32 will cause all interrupts to shut off.

#

@tulip sleet well, if you redefined it after creating the alarm but before setting it, it would have the same effect for deep sleep.

#

In other words, I guess what I'm trying to say is that not claiming is dangerous for STM for any form of sleep, not dangerous for RP2040, maybe dangerous for other ports.

#

so we should do it if there isn't a specific reason not to

tulip sleet
#

For deep sleep, I would think the implementation would do nothing with the pin, until you actually call exit_and_wait_for_alarms(),

#

in other words, you shouldn't do anything in advance except remember which pin

#

does that make sense?

ionic elk
#

Well, in the STM32 case, I use a never-reset method instead of re-enabling pin detection with the EXTI. But I think you're still correct, because it enables that particular element in set_alarms

#

Wait, alarms aren't actually aware of what kind of sleep they're being used for until it's called. So this is a moot point anyway - if we want them claimed for light sleep, they have to be claimed for deep sleep too

stuck elbow
#

adding filtering capacitors fixed it

tulip sleet
ionic elk
#

I guess in the light sleep case, it could fetch and memorize things like the existing pull settings, change them for light sleep, and then switch them back to the original once sleep is over?

still zephyr
#

@mental nexus Thanks for reviewing the slider πŸ™‚

river quest
manic glacierBOT
#

Lets back this conversation up and start over. Lets look at the fundamentals of the coding. Python, Java, etc. are mostly interpreted programming languages which normally reside in user space. Interrupts are normally reserved for kernel space. Many interpreted programming languages crutch off kernel APIs or use native code in the background.

This is mostly how CircuitPython works. It provides a large flexible API which works around the overhead. This works for bandwidth however really stru...

manic glacierBOT
#

Current status:

STA starts up by default in init.c common_hal_wifi_init().

STA and AP can be independently started and stopped, with no disruption to the other.

wifi mode is retained through transition from wifi.radio.enabled = False (wifi stop) to wifi.radio.enabled = True (wifi start).

There are four wifi modes:

  • Station
  • AP
  • Station + AP
  • NULL (turns off both Station and AP, but wifi remains init'ed
#

Make code maintainable? Make code understandable? Make code not require insane testing? Is that not like the point of application code, APIs, libraries, etc.?

Anyone write state machine for polling in super loop?

Logic need low priority long running computation while fully saturating IO bus. - Maybe supported.
Logic needs to be target from other device. - Maybe supported.
Cannot redesign protocol or timing standard. - Maybe supported.

On reliability, can I freeze my code? Convert t...

modern wing
#

So, I remember hearing some folks were looking for the Nordic Power Profiler Kit II (PPK2), as it's been out of stock for many months.

As of 11:56pm Eastern late Saturday evening, Digikey has 21 of them remaining. Hope anyone who needs one is able to get it.

https://www.digikey.com/en/products/detail/nordic-semiconductor-asa/NRF-PPK2/13557476

solar whale
#

@jaunty juniper FYI - the issue I was having with control-C turns out not to be an issue with irremote, but is an issue with usb_hid -- I'll file an issue on that later.

manic glacierBOT
#

Tested this on the Feather NRF52840 across real/fake light/deep sleep types, and it works well across all modes. The only functional issue it has is not retaining a system tick across deep sleep, which causes the USB enumeration delay to occur every time it tries to deep sleep, but that's only a minor power loss with longer sleep periods and likely solvable with a follow up issue.

There are also a couple of stylistic things that could still be changed - `common_hal_alarm_pretending_deep_s...

mental nexus
#

@still zephyr Do you have a suggestion on another widget to add to my review queue fir this week?

jaunty juniper
manic glacierBOT
manic glacierBOT
jaunty juniper
#

basically when clicking back and forth between the Serial panel and the code file in Mu, ctrl-C ends up not working any more, which seems just a Mu UI issue until you quit Mu and connect to the board with tio and it still doesn't receive your ctrl-C until the code stops by itself, like by adding an error in the file or breaking on a button, at which point many of the missing ctrl-C are received (as indicated by multiple >>> lines)

manic glacierBOT
#

Firmware

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

Code 1

from board import GP13
from pulseio import PulseIn

PulseIn(GP13).deinit()
PulseIn(GP13).deinit()  # Traceback 1

Code 2

from board import GP13
from pulseio import PulseIn

with PulseIn(GP13):
    pass
with PulseIn(GP13):  # Traceback 2
    pass

Traceback 1

Traceback (most recent call last):
  File "co...
#

I would also like to look at the problem from a different perspective.
I agree very much with the statements of David Thatcher.
But my approach to the problem which we want to solve with introducing interrupts would go in a different direction. In general CurcuitPython is fast enough on most microcontroller to respond to Hardware events and do the processing in an adequate time. However longer running pieces of code are often in the way. Here I am helping with calling out to hardware event ...

manic glacierBOT
#

I'm experiencing the same with pulseio.PulseIn:

from board import GP16
from pulseio import PulseIn

pulse_in = PulseIn(GP16, maxlen=1)

for j in range(5):
    print(f"Run #{j}:")
    pulse_in.clear()
    while not pulse_in:
        pass
    print([pulse_in[j] for j in range(len(pulse_in))])

While signal is coming to GP16, I'm getting a similar output:

Run #0:
[141, 141]
Run #1:
[141, 141]
Run #2:
[141, 141]
Run #3:
[141]
Run #4:
Traceba...
manic glacierBOT
manic glacierBOT
crimson ferry
manic glacierBOT
#

I am using the code below on a neopixel_trinkey_m0 to send a string when either of the trinkey cap touch pads are touched.

I have found that it works fine, but if I have the REPL open then use then trigger it to send more than once, then I am no longer able to interrupt the execution of code.py from the REPL with a Control-C. Also if I try to exit my "screen" session on Linux, I am unable to close the session. The code keeps running fine.. If I move my focus to a different window, I can s...

manic glacierBOT
#

I was looking to quickly fix this but came across another issue that may be deeper. I added the reset_pin_number but now get the following:

p = pulseio.PulseIn(board.D11)
p = pulseio.PulseIn(board.D11)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: D11 in use
p.deinit()
p = pulseio.PulseIn(board.D11)
p = pulseio.PulseIn(board.D11)
>>> 

It seems however the PulseIn PIO is being allocated after the first reset_all_pins the conditio...

low sentinel
#

I think I saw it’s possible to consume a request body partially. Might be able to wrap at least the data transfer part of it in an async method (or poll it for completion). I recall that it demands the first byte of the response synchronously which I’m not super excited about but 🀷

manic glacierBOT
manic glacierBOT
#

Firmware

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

code.py

Note: GP16 and GP17 are directly connected with a wire.

from board import GP16, GP17
from digitalio import DigitalInOut, Direction
from pulseio import PulseIn
from time import sleep

trigger = DigitalInOut(GP16)
trigger.direction = Direction.OUTPUT
trigger.value = False

echo = PulseIn(GP17, maxlen=10, idle_state=False)


def trigger_pulse...
crimson ferry
#

@low sentinel thanks. yeah I think requests could be reworked to remove the largest source of blocking

low sentinel
#

requests is a blocking api. Probably shoehorning asynchrony into it is not a high priority? I have to admit I am curious about making an async http api though.

manic glacierBOT
#

Related issue: #4659

Firmware

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

code.py

Note: GP16 and GP17 are directly connected with a wire.

from board import GP16, GP17
from digitalio import DigitalInOut, Direction
from pulseio import PulseIn
from time import sleep

trigger = DigitalInOut(GP16)
trigger.direction = Direction.OUTPUT
trigger.value = False

echo = PulseIn(GP17, maxlen=10, idle_state=Fals...
low sentinel
#

would be rad to be able to make 4 requests at the same time while animating a progress bar or something.

manic glacierBOT
#

Related issues: #4659 #4660

Firmware

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

code.py

Note: GP16 and GP17 are directly connected with a wire.

from board import GP16, GP17
from digitalio import DigitalInOut, Direction
from pulseio import PulseIn
from time import sleep

trigger = DigitalInOut(GP16)
trigger.direction = Direction.OUTPUT
trigger.value = False

echo = PulseIn(GP17, maxlen=3, idle_state...
manic glacierBOT
#

For issue #4657

Two problems in deinit. First was the pin being used was not reset with reset_pin_number.

Second the deinit function was not calling common_hal_rp2pio_statemachine_deinit leaving the global pin usage out of sync with the pin now being reset.

Also noticed the constructor is not calling the common_hal version to construct a state machine but did not have time to fix that now. Did a small change so it doesn't allocate a state machine object to just copy to `self->st...

ornate breach
#

hey @tulip sleet was displayio removed out of the samd21 m0 core libraries?

tulip sleet
#

on what board?

ornate breach
#

it's one of my own boards but it's modeled off the qt py

tulip sleet
#

it's hard to get it to fit; the CPX build with displayio is squeezed in various ways

ornate breach
#

no SPI FLASH installed

tulip sleet
#

it will not fit

#

on non-SPI -flash SAMD21 boards we only have 192kB for firmware: not a lot of room

ornate breach
#

right, it was in there before, no?

#

i recall using it on a regular qt py a few months back

#

and by a few months like... December time frame

tulip sleet
#

it is on QT Py M0 Haxpress

#

I don't think it's ever been on plain QT Py

#

it wouldn't fit to begin with

ornate breach
#

hmm... okay maybe i'm just not remembering right

#

if SPI flash wasn't so hard to come by these days i might have bought more

#

how much addition space is needed to handle displayio?

tulip sleet
#

10's of kB

manic glacierBOT
#

Thanks! for the PR @gamblor21.

I believe moving to the common_hal version of construct is a better option.
Also, I found the following while going through PulseIn.c.

  • There is no error raised when all state machines are in use.
  • Instead of using save_self, the struct can be passed as an arg to the interrupt handler.

The above are not necessary with respect to the current issue and can have their own PR.

jaunty juniper
#

oh indeed region 'FLASH_FIRMWARE' overflowed by 31108 bytes

manic glacierBOT
manic glacierBOT
#

I came into doing core circuitpython code with a similar knowledge level. I think it is definitely possible to do. Have you set up a build environment to build the core code yet? Once I got past that step, I just started going through the code to learn what was there. I'm not 100% sure where the VM reset is but the discord channel circuitpython-dev is always able to provide guidance as well.

crimson ferry
#

This shared-bindings thing confuses me:typedef enum { SOCKETPOOL_SOCK_STREAM, SOCKETPOOL_SOCK_DGRAM, SOCKETPOOL_SOCK_RAW } socketpool_socketpool_sock_t;The code uses the SOCKETPOOL prefix, but users only put in the latter part. Whereas here, there's no module prefix and the same constants are used by user and code:typedef enum _digitalio_pull_t { PULL_NONE, PULL_UP, PULL_DOWN } digitalio_pull_t;

analog bridge
#

@crimson ferry the user facing api depends on the qstr table

crimson ferry
#

ah, ok I'll look at that, thanks

crimson ferry
#

got it, I hadn't done constants before, thanks!

lone axle
#

If I think I have found a bug in the new project bundling system, where would be the best place to report it or make an issue?

crimson ferry
#

n00b joy: when anything works at all ;-)>>> dir(wifi.radio) ['__class__', 'OPEN', 'WPA2_PSK', 'WPA2_WPA3_PSK', 'WPA3_PSK', 'WPA_PSK', 'WPA_WPA2_PSK', 'ap_info', 'connect', 'enabled', 'hostname', 'ipv4_address', 'ipv4_address_ap', 'ipv4_dns', 'ipv4_gateway', 'ipv4_subnet', 'mac_address', 'mac_address_ap', 'ping', 'start_ap', 'start_scanning_networks', 'start_station', 'stop_ap', 'stop_scanning_networks', 'stop_station']

blissful pollen
#

The first time I typed something into the REPL that showed/ran code I added to the core was pretty awesome

manic glacierBOT
manic glacierBOT
orchid basinBOT
manic glacierBOT
#

Go ahead and just mark this one as off topic also.

Interrupts are a couple of things.

  • They interrupt long running code. Making code structure simpler.
  • They handle events in a non predictable manner as the source is "random" without overhead. (Ex. User input.)
  • They mark critical events, which must be handled. Drop everything and do this. (Assuming processor can handle it.)
  • They can be IPC or signal state alignment. Block till this or notify me which section you are in. (Ex. Sta...
manic glacierBOT
manic glacierBOT
#

Firmware

Adafruit CircuitPython 6.2.0 on 2021-04-05; Adafruit QT Py M0 with samd21e18
and
Adafruit CircuitPython 6.2.0 on 2021-04-05; Adafruit Feather RP2040 with rp2040

Code/REPL

import time
 
from board import SCL, SDA
import busio
from adafruit_neotrellis.neotrellis import NeoTrellis
from adafruit_neotrellis.multitrellis import MultiTrellis
 
# create the i2c object for the trellis
i2c_bus = busio.I2C(SCL, SDA)

**Behav...

#

This sounds like there is no power being supplied to the NeoTrellis, because the the pullups should be pulling those lines up. TOr there may be something wrong on the NeoTrellis board. This is a support issue. Could you please start a thread in https://forums.adafruit.com, and include pictures of your wiring? Thanks. You can post a comment here later with a link to the forum thread.

manic glacierBOT
#

INFO_UF2.txt

UF2 Bootloader v2.0
Model: Raspberry Pi RP2
Board-ID: RPI-RP2

OS

macOS Big Sur 11.2.3 (20D91)

Description

Latest build that works is adafruit-circuitpython-raspberry_pi_pico-en_GB-20210411-c333acd.uf2, I've done the bisect actually flashing the images onto the device.

With these builds the volume doesn't show up:

  • adafruit-circuitpython-raspberry_pi_pico-en_GB-20210412-bd5a3a3.uf2 – this is the build following the latest wor...
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
turbid radish
#

?serverinfo

digital shoreBOT
#
adafruit
Owner

adafruit#3230

Region

us-west

Channel Categories

8

Text Channels

58

Voice Channels

6

Members

28766

Roles

34

jaunty juniper
#

what is busio.I2C.try_lock() supposed to return if called more than once without unlocking ? True then False right ?

blissful pollen
manic glacierBOT
jaunty juniper
#

ok I see it

manic glacierBOT
#

@tyomitch Hmm, it's just got way weirder.

I've uploaded a simple blink+print script, uploaded the bd5a3a3 firmware and the volume has appeared just fine. Same with 2a78a51 and today's 7cf8f79. With the latest firmware I was able to re-attach the device multiple times to USB and always see the mounted volume.

That wasn't the case while I was doing the bisect between 6.2.0 and the latest build; actually I've re-uploaded bd5a3a3 and c333acd multiple times to ensure I've found the correct...

ionic elk
#

@tulip sleet can we add a check to the uncrustify to look for spaces vs tabs? I'm having to fix that manually for some of Jun2Sak's commits.

#

seems like it might be a reasonable thing to have in there?

tulip sleet
#

definitely - Just open a quick issue; I don't know how to do it off the bat

ionic elk
#

Ok I can probably figure it out when I have a minute, I think it's just a regex