#circuitpython-dev

1 messages Β· Page 325 of 1

onyx hinge
#

Open On-Chip Debugger 0.10.0+dev-01288-g5a79481d3-dirty (2020-06-18-10:52)

#

sometimes I have to hit the microcontroller reset switch and then start openocd right away. feels finicky.

#

but it's a miracle this stuff works at all, i sometimes think

tulip sleet
#

i may just use the j-link

onyx hinge
#

let me know if that works, I might switch.

#

is there a jumper to pop off so they don't have a fight?

#

I don't see it

#

@tulip sleet any idea why feather_m4_express has EXTERNAL_FLASH_QSPI_DUAL ? It seems to have all 4 QSPI data lines on the board.

tulip sleet
#

@onyx hinge there was a user who wanted that, for some reason. They submitted a PR.

onyx hinge
#

that's weird, won't it decrease performance?

tulip sleet
#

i think it was for the particular chip they were using. I'll find the PR; it might have just been added for completeness and they wanted QSPI "single"

onyx hinge
#

I understand why the underlying code would have support for 1/2/4 bits

tulip sleet
onyx hinge
#

but feather_m4_express's board config defines EXTERNAL_FLASH_QSPI_DUAL while the chip that is placed on it supports quad mode

tulip sleet
#

oh, you are asking about the Feather; i'm fixating on the PR

#

πŸ˜•

#

I have no idea; that's the original code from three years ago. Maybe an early board design was different.

#

@onyx hinge yes, Rev C was dual, Rev D became quad. I have no idea if Rev C shipped. Revs A and B were straight SPI

#

i will ask limor

ionic elk
#

@tulip sleet what are the criteria for a release being marked as "stable"? I'm concerned about STM32 boards being defaulted to the 5.3.1 release.

tulip sleet
#

re your email: 5.3 I thought didn't contain the low power stuff. That was 5.4, now 6.

ionic elk
#

Oh hmm did I mix that up?

tulip sleet
#

but nevertheless, if 5.3.1 is buggy for STM32, we can advise to use 6.x

#

I think we have been saying for a while that the STM32 support was preliminary and evolving. I will point that user to 6.x

ionic elk
#

No, that's my bad. The primary issue on 5.3.1 then I guess was the stack limitations, which has kept coming up. But I'll check out this SPI thing

tulip sleet
#

would you say 6.x is definitely better for stm now?

#

i can leave answering that thread to you

ionic elk
#

I'd say so, there have been a number of bugs I've found and resolved as a part of other projects, and significant reworks to the clocks, flags, etc

#

I'd like to get STM32 out of the "preliminary and evolving" stage someday, however. Do you feel there are specific milestones that need to happen for that?

#

It has most of the modules, the only big missing one now is audio. Beyond that, is it just heavy duty testing that's required?

tulip sleet
#

i don't feel like we've had a lot of support issues come up, but we may not have that many users. I think some testing with various SPI and I2C devices, NeoPixels, and maybe displays would help shake out anything remaining. Limor in the past has done quite thorough testing (like testing all the Feather Wings) when we introduced a new chip family, but that was testing the board design and Arduino, not CPy.

blissful palm
#

Hey @slender iron I finally got around to making the OTG USB mod on my Kaluga, I was just trying to build and flash current circuitpython main - "make BOARD=espressif_kaluga_1 PORT=/dev/ttyS6 flash " in the ports/esp32s2 dir and I get : "CMake Error: The source directory "/mnt/c/Users/awood/Desktop/circuitpython/ports/esp32s2/build-espressif_kaluga_1/esp-idf" does not appear to contain CMakeLists.txt." what am I missing, is there something I need to run first?

ionic elk
#

have you entered the esp-idf/ directory and run . ./export.sh?

#

or install.sh?

blissful palm
#

Yeah I was just thinking it may be point at the wrong esp-idf

#

let me just check in a new terminal

ionic elk
#

export.sh will help with that

blissful palm
#

Gah the install is soooo slow..

gilded cradle
#

@onyx hinge did the RGB Matrix fixes get into the latest circuitpython release?

blissful palm
#

Thanks @ionic elk but I am still getting the same issue unfortunately

analog bridge
#

@blissful palm did you run make clean before retrying ?

blissful palm
#

Thanks @analog bridge no juice with that either I'm afraid 😩

onyx hinge
#

@gilded cradle no, I don't think so

gilded cradle
#

Ok thanks, I'll keep using 5.3.1 for now then.

onyx hinge
gilded cradle
#

Ok thanks, if I start running into issues, I'll update. I've been able to play by it's rules so far.

analog bridge
#

@blissful palm What platform are you using ? wsl ?

blissful palm
#

yup

#

wsl

analog bridge
#

Try following this

blissful palm
#

Ok @analog bridge I wil give it a try

analog bridge
#

After you finish building mpy-cross. Go to esp-idf and run ./install.sh and . ./export.sh

blissful palm
#

Ok tried all of that @analog bridge get the same error😫

manic glacierBOT
manic glacierBOT
#

@DavePutz: @jepler mentioned it on discord this morning, and we discussed it including that PR. He tried a longer delay, but it didn't seem to help. I have a SAME54 dev board also and will try some things eventually.

The errata say that the TEMP functionality is broken, without giving any details. I have two different boards with identical chips but different date codes: one was hanging before I added the delay, and one was fine. So it may vary by sample.

supple gale
#

@blissful palm I had the same problem first time. I eventually wiped the install and did it again. 2nd time worked. Are you using WSL or WSL2? If so you will get better file performance moving everything to the Linux root. So under your /home/wherever

blissful palm
#

Thanks @supple gale I just started again with the instructions from start by clean cloning into my home dir but get same results!!

#

It's WSL not WSL2 BTW

slender iron
#

@slender iron if you're streaming the meeting tomorrow, does that mean you'll also take the timecodes?
@onyx hinge Yup, happy to.

#

@blissful palm I'm around now but don't have any more insight into your problem

#

ah! actually, make sure you have a newer version of cmake

supple gale
#

You also have to do the git submodule update β€”init β€”recursive ports/esp-idf

blissful palm
#

I have cmake version 3.10.2 is that old?

#

let me see if I can update that

#

looks like latest is 3.18.2

onyx hinge
#

@slender iron ok, anything else we need to plan or do ahead of time, besides get started on time?

slender iron
#

it'd be good to get everything setup a bit earlier

#

I need to add things to my calendar

onyx hinge
#

<@&356864093652516868> Thanks again for working with us on the changed meetings schedule this week! We'll have the weekly meeting about 24h from now, and it will be livestreamed on youtube (as well as twitch, linkedin and twitter/periscope) as a part of CircuitPython day. I do plan to get us started promptly at 2PM ET, so I'll be around starting a little earlier (no later than 1:45PM ET) if people need to do mic checks, etc. Here's the document for the meeting, adding your hug reports and status updates is super helpful: https://docs.google.com/document/d/1Zeeb_ZJltPcESMhRtofP4_QGoLWagNtAPfoAeA2q8Ms/edit?usp=sharing

slender iron
#

I plan on using restream so it'll go to youtube, twitch, linkedin and twitter/periscope

onyx hinge
#

@slender iron handle community news in the usual way even though it won't precede the newsletter?

slender iron
#

sure, it's ok to recap it

idle wharf
#

@blissful palm I am on Mac, but I successfully built the Kaluga from adafruit/main yesterday. Whenever I see catastrophic failures like you seem to be having is when I've not run get_idf which is an alias to do the exports the other people mentioned. My setup process is documented here: https://gist.github.com/askpatrickw/0a276c7e2d4f54e442b2cb6eaa0d32ea#building-circuitpython-for-esp32-s2-boards TL;DR: IDF steps 1-4, CP Build Steps through the MPY-Cross (skipping the ARM install stuff) and then run the make command.

#

Also, my cmake --version is cmake version 3.17.3

manic glacierBOT
#

My loader for the OSHWA 2020 badge would appreciate this functionality. I assume that since the proposed mechanism is simply designating which file to run, there would be no need to make sure pins are released/de-initialized?

As you suggested previously @tannewt , this will mean we (I ) will need to handle the "don't reinit already initialized stuff" case for libraries. Since the libraries will need to know the 'commanded reload' vs 'default start' state, it would/could be exposed by`super...

supple gale
#

@blissful palm For fun i did the install and build again. For me it works, Which doesnt help you.
git clone https://github.com/adafruit/circuitpython.git
cd circuitpython
git submodule update --init
git submodule update --init lib/tinyusb
git submodule update --init --recursive ports/esp32s2/esp-idf
cd ports/esp32s2/esp-idf
./install.sh
souce ./export.sh
cd ..
git status (for fun)
make BOARD=espressif_kaluga_1 clean
make BOARD=espressif_kaluga_1

GitHub

CircuitPython - a Python implementation for teaching coding with microcontrollers - adafruit/circuitpython

#

My process was

blissful palm
#

I tried updating use apt-get update/upgrade but cmake is still old, trying to build cmake from source to see if that helps

#

(very slowwww)

#

what's your cmake version? @supple gale ?

supple gale
#

i'm on cmake 3.16.3

#

@warped laurel did you make sure you have the entire esp-idf submodule? you can also clone it somewhere else and do it that way

blissful palm
#

Yeah

#

I suspect it's cmake

supple gale
#

this was done on a linux box. i did it previously on WSL2/ubuntu on my windows laptop

blissful palm
#

Looks like it is cmake

#

Although I now have some other issues

supple gale
#

what is in your esp-idf/CMakeLists.txt file?
first line is
cmake_minimum_required(VERSION 3.5)
So your cmake should be ok

slender iron
#

I think we changed the cmake requirement

#

3.13+

blissful palm
#

It seems to be building now @tannert I also had to change the requirements to eliminate gbdui

slender iron
#

πŸ‘

blissful palm
#

Oops spoke too soon 'make: esptool.py: Command not found'

#

The IDF path is fine?

slender iron
#

did you do the export?

blissful palm
#

yup

slender iron
#

hrm

blissful palm
#

Ok re did it seems fine, very strange

slender iron
#

πŸ‘

blissful palm
#

OK built now to flash

supple gale
#

@slender iron still planning SPI tomorrow?

slender iron
#

yup, think so

supple gale
#

good. was looking at how micropython does it. for fun.

slender iron
#

what did you find?

supple gale
#

they do a malloc from DMA capable memory if needed, and move the buffer there

slender iron
#

every transmit?

supple gale
#

yes

slender iron
#

interesting....

supple gale
#

they actually check during the ISR i think

blissful palm
#

how do I change the flash upload speed default baud rate?

slender iron
#

I was thinking I'd move it on first transmit only

supple gale
#

i thought it was odd . i would have thought the same.

slender iron
#

it's more work to move it once because then you need to worry about freeing it

supple gale
#

yes. why not just setup the buffer in the right place rather than move it

#

they must have their reasons?

slender iron
#

you don't want to set it up in DMA memory to start because you don't know you'll need to DMA it

#

and it is a scarce resource

supple gale
#

dont you know that the spi is using dma when you create it?

slender iron
#

sure but you give the spi and array or bytearray to transmit

#

the spi doesn't hold the memory itself

#

unless you plan on copying it every transmit

supple gale
#

i see

#

thanks

slender iron
#

np, all up for discussion tomorrow πŸ™‚

supple gale
#

see you then.

manic glacierBOT
blissful palm
#

I lowered the baudrate in the Makefile to 115200, others may need to do that also

manic glacierBOT
blissful palm
#

Yay I think my Kaluga mod works..

#

I'm seeing both an ESP32-S2 device and a com port

#

using a single usb cable on the Kaluga (power) usb

#

I literraly just ran mod wires from GPIO19/20 to respective d+/d- test points using tiny mod wire

manic glacierBOT
manic glacierBOT
onyx hinge
#

0 bytes used, 499712 bytes free in flash firmware space out of 499712 bytes (488.0kB).
that's interesting

tulip sleet
#

very impressive; what optimization flags did you use?

onyx hinge
#

It was a missing 'attribute((used))' on the vector table in the (new) same51 port

tulip sleet
#

too bad; i thought we could make more room on the samd21 ports πŸ™‚

blissful palm
#

Thanks everyone for all the help, it's all working nicely now..

slender iron
#

πŸŽ‰

manic glacierBOT
#

I was proposing an actual function; I didn't really think about the hanging part. It could return None if no report was available.

We have a long-term interest in using HID RAW reports for communication with a host, because all hosts already support HID RAW natively and don't need drivers. That would require real FIFO support, so I would lean toward a function. It does not have to buffer for now; we can add that later.

manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Acting like a tag. The peripheral in the nRF52 platform is actually called "NFCT", since it only behaves as the NFC Tag side. Updated the title to more clearly call attention to this! So in other words, this effort wouldn't overlap with parts like the PN532 pretty much at all (for now, at least.)

I agree: an nfcio interface makes a lot of sense to me, especially as I hope the NFC tag (and reader, for that matter) c...

tulip sleet
#

@narrow dirge E. I am looking at the CPy PR for the new boards. It's contingent on the asf4 PR. I had one comment there about including asf pr #21. Is that in your sights? I don't want to hold everything up.

onyx hinge
#

Is the thing that #21 is on the main branch but not the circuitpython branch?

#

oh I think I understand what you mean, these changes need to be made in the new e51 files

tulip sleet
#

yeah, and you might want to make them for same54, if you have not already

onyx hinge
#

sure, I'll get to it soon

tulip sleet
#

got it, i just wasn't sure who was waiting for whom

onyx hinge
#

I assume there's some way we could "deduplicate" the files

tulip sleet
#

you mean factor out the identical routines? well, maybe, but I'm not sure it's worth it.

onyx hinge
#

weird, ```>>> "".format(7)
''

tulip sleet
#

it's not an error in CPython either

#

there's nothing in the string that needs an arg, so all the format args are ignored

onyx hinge
#

I guess, but in my case it was a mistake

tulip sleet
#

oh πŸ™‚

#

I guess the idea is that you might supply multiple strings to a single format statement, and it uses what it needs

onyx hinge
#
'b'
#

learn something everyday

manic glacierBOT
manic glacierBOT
#

When the Shape is constructed, I think the dirty area should cover the whole Shape.
I wrote it consistent with the constructor for Bitmap.c (see below). Maybe I am missing something?

https://github.com/adafruit/circuitpython/blob/bbd802940ee707fbf8647e0f1017dfb713a94c14/shared-module/displayio/Bitmap.c#L67-L70

Also, I feel like the Shape code has an "off by one" error in the for loop in line 53. The malloc is based on height, but the for loop here goes from 0 to `height...

manic glacierBOT
manic glacierBOT
#

Two problems: The lead byte for 3-byte sequences was wrong, and one mid-byte was not even filled in due to a missing "++"!

Apparently this was broken ever since the first "Compress as unicode, not bytes" commit, but I believed I'd "tested" it by running on the Pinyin translation.

This rendered at least the Korean and Japanese translations completely illegible, affecting 5.0 and all later releases.

Testing performed: Ran the japanese translation in the unix port:

$ ./micropython...
stuck elbow
#

@tulip sleet do you think you could remove me from the librarians group on github? All those notifications make it difficult to see the actually important things for me.

manic glacierBOT
#

Hi, use the example code:

https://github.com/adafruit/Adafruit_CircuitPython_VL53L0X/blob/master/examples/vl53l0x_simpletest.py

set the delay at the end of loop to 0.1 sec. This should be enough, and the error should manifest itself in a reasonable time. Try code for a few minutes.

Because of this I2C bug I can not use Circuitpython. I use different development environment now, so I can not test this issue again to provide a small example. If issue will not be reproducible with "simp...

onyx hinge
#

I believe that removing you from librarians would also remove your abilities to review and/or merge PRs

manic glacierBOT
tulip sleet
wooden lichen
#

Does someone know if the circuitpython gameboy cartridge is still in development or that it has been cancelled?

stuck elbow
#

@onyx hinge I can't merge things anyways

#

@wooden lichen I think @slender iron still works on it in his free time sometimes

manic glacierBOT
tulip sleet
cobalt grail
silver tapir
manic glacierBOT
#

Ok, I'm still forming my thoughts around this concept. I think this can be done in python, but adding the opacity check may required some additions to the core.

Function definition: child_at(x, y, group, search_level=0, **require_opacity=False**)

This function iterates through this group and its subgroups to determine the top display element that is located at the given x,y pixel position. This display element could be a Group, a TileGrid or a Shape. This function will re...

ionic elk
#

Is there a good name for the kind of bug that's caused by something far away in the program? Like if you have memory corruption from some process way off in other code, but it happens to land in something you're working on. I feel like that must have some kind of hacker-dictionary type name

manic glacierBOT
slender iron
#

@wooden lichen I do want to get back to it but had reliability issues without great tooling to debug.

wooden lichen
#

Aah too bad!

slender iron
#

yup!

tulip sleet
#

@ionic elk "second-order bug" is usually what I say when one bug causes another

#

@stuck elbow it would be nice to keep your review privileges

manic glacierBOT
#

Sorry I'm late to the party here. If I'm understanding this correctly @tannewt you'd rather have functions like common_hal_reset_pin check whether the incoming pin object is NULL? Rather than having the special values?

The main thing the non-object API is used for (port and number) is iterating resets - iterating through the pin objects for a microcontroller is kind of annoying, and doing it with the STM32 port and number values is easier. That said, we have done pin iteration a couple tim...

manic glacierBOT
onyx hinge
#

<@&356864093652516868> The special CircuitPython day edition of the meeting is coming up in about 2 hours at 2PM ET. We'll be streaming it live on youtube and other services. If you plan to participate, add your name (and if possible, your notes) to the notes document beforehand -- to make things go more smoothly, we'll assume that anyone who hasn't done that is lurking. If you plan to participate but for any reason you can't add yourself to the notes doc, let us know and we'll add it for you. https://docs.google.com/document/d/1Zeeb_ZJltPcESMhRtofP4_QGoLWagNtAPfoAeA2q8Ms/edit?usp=sharing

onyx hinge
#

.. and if the discord voice chat fills up, remember that you will be able to head over to https://adafru.it/live to listen/lurk

hybrid scarab
#

Oooh I need to remember not to forget!

#

1900 GMT!

solar whale
#

I think it is 1800 GMT EDT is -4

tulip sleet
#

google will tell you what time it is somewhere else πŸ™‚

turbid radish
#

The next event is here on Discord - the weekly CircuitPython Discord meeting in the CircuitPython voice chat

slender iron
#

in 30 minutes

hybrid scarab
#

I should clarify GMT + DST nonsense, since I've turned up an hour early before and wondered where everyone was πŸ˜†

#

I guess that's BST πŸ˜†

onyx hinge
#

Feel free to join the voice channel to do mic check -- if you are not usually a participant, please note that (A) you need to be added as a Circuitpythonista to speak and (B) you need to list yourself in the notes document. When not actively speaking, please keep your mics on mute. And if the voice chat fills up, remember that we'll also be streaming live on youtube so you can catch the audio there. We'll be getting started prompty at 2PM ET, about 17 minutes from now. Notes doc: https://docs.google.com/document/d/1Zeeb_ZJltPcESMhRtofP4_QGoLWagNtAPfoAeA2q8Ms/edit?usp=sharing

modern wing
#

Good afternoon all you wonderful folks -- happily lurking today adabot

I've updated the notes doc to reflect as such.

#

[If more space is needed, I'd be happy to drop to Twitch or Youtube.]

#

@onyx hinge xwit?

#

Thanks πŸ™‚

slender iron
onyx hinge
modern wing
#

Live on Twitch

#

Not live yet on Youtube

solar whale
#

yup

modern wing
#

Live on Youtube.

idle owl
#

@hybrid scarab Would you like to participate in the meeting by talking?

turbid radish
#

I am here, not lurking for once

idle owl
#

@hybrid scarab Because if so, I need to add you to the CircuitPythonistas role.

modern wing
#

It's always morning somewhere πŸ˜‰

onyx hinge
#

@river quest @meager fog will either of you be talking during hug reports or status updates?

#

@turbid radish and you ?

thorny jay
#

Hi, I am going to be lurking today. Some stuff in the notes.

turbid radish
#

I will be talking

meager fog
#

yep i will be chatterin

#

ITS NOT OUT YET DONT ASK

#

except for this one time

idle owl
#

She's already got the role.

meager fog
#

u kan azk

hybrid scarab
#

Sorry @idle owl I'm lurking!

idle owl
#

No worries!

hybrid scarab
#

Was also afk, rooting through cupboards πŸ˜†

idle owl
#
uncut nexus
#

lurking today

idle owl
#

@inland tusk If you join, please mute.

river quest
meager fog
#

yay this is like that time when the Undertaker came back from the dead

#

and gave WWE updates & notes

river quest
#
JustGiving

Help Impact Lebanon raise money to support LIFE Generation Ltd

#

September 9, 2020 (9/9/2020) is CircuitPython Day, the snakiest day this year! Today we highlight all things CircuitPython and Python on Hardware.

THERE IS A FINAL SCHEDULE OF EVENTS WORLDWIDE ON GITHUB HERE
https://github.com/adafruit/circuitpython-weekly-newsletter/blob/gh-pages/circuitpythonday2020.md

meager fog
#

πŸ™‚ πŸ™‚ πŸ™‚

#

1️⃣ 5️⃣ 0️⃣

onyx hinge
#

could there be any .. "leax"?

river quest
thorny jay
#

We are going to party like it's '99.

river quest
#

A New Version of MicroPython Released: A new version of MicroPython has just been released: Version 1.13. It includes a new uasyncio module, code formatting, and BTstack bindings with Unix support. For the ESP8266, the default filesystem has changed from FAT to littlefs v2 –
https://github.com/micropython/micropython/releases/tag/v1.13

#

Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
https://adafruit.com/vote

Adafruit Industries - Makers, hackers, artists, designers and engineers!

Adafruit has had paid day off for voting for our team for years, if you need help getting that going for your organization, let us know – we can share how and why we did this as well as the g…

hybrid scarab
#

STM32H750? πŸ˜†

slender iron
#

We have some H7 support already I think

hybrid scarab
#

Honestly the thought of doing bring-up on our hardware scares me!

inland tusk
#

hope to see eps32s2 grand central

manic glacierBOT
#

On a CLUE running 5.3.1 there appears to be some timing issue where if the frequency is changed and then the duty_cycle immediately afterwards the latter does not take effect.

Adafruit CircuitPython 5.3.1 on 2020-07-13; Adafruit CLUE nRF52840 Express with nRF52840
>>> import board
>>> import pulseio
>>> import time
>>> board.DISPLAY.auto_refresh = False
>>> pwm_p0 = pulseio.PWMOut(board.P0, frequency=50, duty_cycle=0, variable_frequency=True)
>>> pwm_p0.frequency = 440 ; p...
slender iron
#

I don't think the s2 has enough pins

#

@hybrid scarab it's usually not too bad. the MCU support is the toughest bit

river quest
silver tapir
#

lurking

hybrid scarab
#

Cute!

ionic elk
#

I hope that moors law keeps up long enough for us to get that 500MHz Wifi Bluetooth HS USB Uberchip for <$1

hybrid scarab
#

Played with the FT232H recently, very slick experience hooking up a qwiic sensor and running the code

errant grail
#

Holiday season as in Halloween?

river quest
turbid radish
#

Another 100 episodes

meager fog
#

πŸŽ™οΈ πŸ’§

ornate breach
#

CircuitPython... the movie

#

I like it

hybrid scarab
#

Would like to get Blinka working with an FT part that can do SPI and I2C simultaneously... .for.... reasons πŸ‘€

meager fog
#

you could look at the FT2232H issue list - you can use the MCP2221 with bitbang SPI + I2C

#

afk

slender iron
#

πŸ‘‹

turbid radish
#

Yes, thanks @silver tapir

ionic elk
#

@slender iron oh whoops I tested and merged it this morning

slender iron
#

np

idle owl
static sphinx
#

hi

idle owl
#

Hello, @static sphinx

static sphinx
#

nice stream

idle owl
#

@static sphinx It's the CircuitPython Weekly meeting. We typically don't stream it, but the videos are posted to YouTube. This meeting is normally held Mondays at 2pmET/11amPT. Glad to have you!

static sphinx
#

oh cool

slender iron
#

and you can join live here on discord every week

static sphinx
#

thx I will

slender iron
#

we just don't stream out to youtube and others normally

idle owl
#

@ionic elk You're not muted.

supple gale
#

looking forward to the CANBUS support. Will mesh nicely with some stuff I'm playing with. Thanks for it

thorny jay
#

That was a top secret?

opaque yew
#

saludos desde colombia

idle owl
#

Hola, bienvenidos!

onyx hinge
opaque yew
#

greetings from colombia, gracias por su labor en organizar eventos de encuentro

silver tapir
#

Hola @opaque yew

slender iron
#

I'm happy to make a spanish language channel here on discord. what should we call it?

#

what games @idle owl? well earned break

modern wing
#

Enjoy your time off @idle owl !

slender iron
#

remove her from mods temporarily πŸ™‚

#

πŸ’―

#

snipperclips

opaque yew
#

Hola @opaque yew
@silver tapir hi

mental nexus
idle owl
#

Thanks, @modern wing !

candid herald
#

@slender iron perhaps name the spanish language channel hola

idle owl
#

@candid herald It should probably be a little more explanatory than that πŸ˜„

candid herald
#

@idle owl Perhaps πŸ˜€

turbid radish
mental nexus
idle owl
#

I saw that one @mental nexus. It's great!

pastel skiff
#

Hi , I'm Curtis from Hackerlab in Sacramento California, I was planning on three hours of Circuit Python Day events for later today but unfortunately I have been impacted by the intentional power cut off here in California due to high fire risk in my area; high winds, low humidity, high heat. Super sorry, we'll plan to do a follow up event to celebrate at some point in the future, not due how to best get the word out to this community, im sending this out on my solar backup but wont be online much longer

quaint hawk
#

@slender iron looking forward to joining the Deep Dive stream✌️ today:)

slender iron
#

Be safe @pastel skiff and let us know when it is rescheduled for

idle owl
#

@pastel skiff So sorry to hear that! Let us know when you're ready to do your follow up event!

atomic heart
#

@pastel skiff Best of luck out there. Stay safe.

turbid radish
#

@pastel skiff will do, thanks for letting me know

pastel skiff
#

thanks all, bumming I wanted to join in the days fun

static sphinx
errant grail
turbid radish
#

@pastel skiff - schedule changed, I hope I got the text correct

manic glacierBOT
turbid radish
#

It's done

pastel skiff
#

Thanks Anne, can you ;link me to the schedule?

idle owl
pastel skiff
#

thanks!

idle owl
#

For sure!

turbid radish
lone axle
#

Will Do, Thanks Jeff.

modern wing
#

Hmmm. Pickles. Yum.

meager fog
#

yayyyy

gilded cradle
idle owl
#

Thanks everyone! Thanks for participating or lurking!

mental nexus
#

Awesome get-together, everyone!

errant grail
#

Thanks. Excellent moderation today @onyx hinge !

gilded cradle
#

Thank you everyone!

turbid radish
#

Thanks Everyone

ionic elk
#

Thanks all

inland tusk
#

Thanks eerybody and see you next week

modern wing
#

Thanks!

prime flower
#

Thanks everyone

turbid radish
meager fog
#

πŸ€

onyx hinge
#

πŸ‘‹

inland tusk
#

@meager fog I was just wondering if you could create a stema board for the mcp23017

slender iron
#

@onyx hinge are you going to do notes or should I?

mental nexus
#

Strange. My Mac went to sleep and the soft reboot issue went away.

meager fog
#

@inland tusk dont have any current plans, kinda huge πŸ˜„

onyx hinge
#

@slender iron I was planning to do the post-meeting notes stuff but not until tomorrow. if you have the time to do it now that would be great though

low sentinel
#

I really want an M7f Feather if we're taking hardware requests =)

ornate breach
#

M7f would be the whole bird πŸ™‚

#

unless we're talking BGA πŸ™‚

low sentinel
#

I love my m4f's, just would love the extra power efficiency and performance of the 7's. I don't know how feasible it is, I just literally designed my first circuit board this weekend (made a featherwing).

ornate breach
#

congrats πŸ™‚

#

The first board is was starts you down the rabbit hole

#

I have some boards coming that will hopefully be the final iteration before launch of my ICE40 Ultra feather wings πŸ™‚

slender iron
#

@low sentinel @indigo wedge has designed at least one feather with an imx rt on it

#

@ornate breach I'm excited for your work πŸ™‚

ornate breach
#

I'm hoping it plays well with your SoC library πŸ™‚

slender iron
#

will need an i2c bootloader for it

#

or expand the lib to load over spi

ornate breach
#

i'll have to expand it over SPI

#

Pin wise, it only has SPI flash programming

slender iron
#

built in

ornate breach
#

yeah

supple gale
#

hi all

#

the teensy 4 and 4.1 are imxrt

#

as an aside @slender iron the dma buffer switching is done in the esp-idf stuff, so should work

#

oops

#

so confused

ionic elk
#

@slender iron @tulip sleet do you remember working on an error where DisplayIO instances that were initialized wrong would cause null reference errors when cleanup_after_vm tried to deal with them? This esp32 crash seems related to that, and it's giving me crazy deja vu - I could have sworn I worked on or solved this exact issue before...

tulip sleet
#

@ionic elk I don't think it was me, but it sounds vaguely familiar. Maybe they are not getting cleared out at startup?

#

though this kind of thing is common, maybe something is not in root pointers list or is not listed in the specialized gc routine for the module

ionic elk
#

So, the call stack is:

#0  reset_displays () at ../../shared-module/displayio/__init__.c:169
#1  0x4009cfde in cleanup_after_vm (heap=0x3ffc9f4c <allocations>) at ../../main.c:219
#2  0x4009d0bf in run_code_py (safe_mode=NO_SAFE_MODE) at ../../main.c:286
#3  0x4009d346 in main () at ../../main.c:511

Best I can tell, this is the cleanup_after_vm that runs after the code is done. And the issue seems to be that it calls reset_displays, and there's an item in display[0] that has a valid type, but not a valid bus. So it tries to reference the bus in a memcpy and explodes.

#

So a display is made... but it's wrong? Incomplete? And the reset_displays code can't tell that it's invalid. I'm trying to figure out whether I need to add more error checking to reset_displays, or if the real answer is something else.

onyx hinge
#

I think that if initialization of a display or a bus fails, the failure needs to ensure that the object's type is set to NULL or none type

#

and presumably also raise a python exception

tulip sleet
#

@ionic elk you could set a watchpoint on the bad pointer and see when it gets set

ionic elk
#

I mean, what I'm pretty sure is happening is it's hitting the mp_raise_ValueError_varg(translate("Unable to find I2C Display at %x"), device_address); exception, but not actually resetting the type of the display, like Jeff was suggesting. Adding a self->base.type = &mp_type_NoneType; seems to have resolved it. But as usual with bugs like this, I'm scratching my head trying to figure out how this has not been breaking stuff constantly across every port??

#

I mean surely someone has plugged in the wrong I2C address for a display before, without immediately landing in perpetual hardfaults

manic moat
#

is it damaging in any way to leave the circuit playground express on for a long time? Sorry I'm new to this stuff and I dont know what other chat to put this on

lone axle
#

@manic moat the best channel for questions like this is #help-with-circuitpython. No it shouldn't be damaging. if your code is doing things with time it can start to get a bit wonky after a while but you can use resets to work around it. It's also not damaging really, just something to account for.

manic moat
#

ok, thank you.

manic glacierBOT
#

I'm not sure if it's the same thing, but my first venture into i2c also involved this error message and sensor but on a different board. In my case I had removed a 100ms pause when translating the code and that seemed to trigger it after a while. Gemma M0 gives OSError: 5 on i2c.writeto to tinyLiDAR. Perhaps it's worth verifying the VL53L0X isn't in one of the slower ranging modes?

manic glacierBOT
manic glacierBOT
#

I found some time. My code is:

import time
import board
import busio
import adafruit_vl53l0x


i2c = busio.I2C(board.SCL, board.SDA)
vl53 = adafruit_vl53l0x.VL53L0X(i2c)

while True:
    print("Range: {0} mm".format(vl53.range))
    time.sleep(0.1)

serial output:
log.txt

Sometimes it takes longer.
For example, with time.sleep(0.05) it take about 10 seconds for an error to pop up.

tall owl
#

@idle owl is this where you wanted me to post my use case for CAN? What I am looking for is an interface that allows several devices to talk to each other. I have started creating/designing things that do 1 thing well. So a neopixel controller, a sound controller, motor controller, etc, that respond to set commands. I started using I2C for this, but it has become limiting. I like the idea of CAN, that any of the controllers can broadcast a message and any one can choose to listen. So my use case is pretty simple, wanting to be able to broadcast a message with an identifier, and for receiving, be able to set the filter identifiers and respond when there is a match.

I (think I) know that the SAMD doesn't support CAN its self. There are a couple of hardware solutions including Arduino shields. The one I decided upon is the MCP2515 CAN Bus Transceiver Breakout Boards. They are pretty cheap. They communicate via SPI with the microcontroller, and have an onboard chip to convert to the CANBUS voltages.

I am guessing that this might not be the support that most are looking for. It seems like most people want to interface with a vehicle. I am a First Robotics mentor, and their robot components communicate over CANBUS, (but with their own software stack) so thats how I heard about it.

idle owl
#

@tall owl Yes! @onyx hinge check it out!

tall owl
#

I have started to do the above with a couple of the breakout boards in Arduino, but that was a few months ago before things got crazy.

onyx hinge
#

@tall owl I would love to talk about motors and canbus! But it's late, it'll have to be another day.

#

Right now we have one person working on CAN support for the SAM E51 and E54 MCUs (me) and another person working on a SPI to CAN chip which I think is the MCP2515 you mention.

placid stirrup
#

Does anyone know if there are any libraries available to integrate a current CT for current monitoring?

onyx hinge
manic glacierBOT
#

Since I have the most experience with it, it makes sense for me to tackle Type 2 Tags first, but the nRF libraries do have Type 4 Tag support too, so I'm designing with that in mind.

One thing I'm definitely curious about is memory management. Because the API that renders the NDEF messages requires the message to be defined with the number of records it has, I was planning on collecting up the records in a python object, then rendering them as the raw buffer that is used as the actual pay...

tulip sleet
placid stirrup
#

I saw that, thank you. I'm trying to use a current transformer

tulip sleet
#

i had not heard of that; I looked it up, but could you measure the current in the secondary using one of those sensors (after rectification)??

#

i know only what I read in wikipedia πŸ™‚

placid stirrup
#

πŸ™‚

#

That's an interesting idea though

#

let me look into that

#

thanks πŸ™‚

mental nexus
#

@gilded cradle you mentioned tonight about a wish list for UI display/input elements. On a tangentially-related note, I know @lone axle is working on a remote JSON scripting language for displays using existing display elements and is coming up with some new ones, like text input. I’ve just started looking into an open issue β€œmake dispio more touch friendly” and your comment tonight seems along a related but higher level concept. If you have some ideas on what you would like to achieve and maybe a specific starting project, I’d be glad to assist.

lone sandalBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

This is a follow-up to 9-9-20 (CPY Day) esp32s2 Deep Dive in which esp32s2 manual safe mode support was briefly discussed.

The esp32s2 posses a challenge for manual safe mode implementation as it lacks a dedicated reset pin instead the reset button is connected to CHIP_PU which when pulled low turns off the power to the chip thus causing a hard reset.

A solution to this problem as discussed during the deep dive is to use IO0 (boot but...

lone axle
#

@mental nexus along the same lines, I also created this "hamburger" menu button a while back: https://gist.github.com/FoamyGuy/b11390a020d213b1ee15fb5f02eacfff. It could use some refining to make it a bit more re-usable. But it could also be reworked into a select/dropdown type control fairly easily I think. @gilded cradle's answer last night has inspired me to make an attempt at Checkbox and Radio buttons next. I am keenly interested in what is possible on the touch event location front as well. It would be great if the system could tell you what got clicked somehow instead of having to pass the touch event object into a function on each control to check if it got hit or not.

manic glacierBOT
mental nexus
#

Thanks @lone axle that sounds cool. Your point about touch reaction is what I’ve been wondering about, and about how to structure it. If there are a bunch of touch-reactive elements, should they somehow get β€œregistered” in a touch handler so that when an element is touched that their .pressed function is called and .released is called upon button release? I think multitouch might be considered in the future too, and what hooks should be there for that? How can we organize this so people can weigh in, give feedback, come up with a plan and divvy up the work, maybe a github issue?

manic glacierBOT
lone axle
#

I do think an issue on github is a good place to start collecting thoughts and conversation. I would assume some or most of these UI controls will end up in libraries like the existing ones for button, label, and some others. But I think the touchscreen discussion is probably best fit for the main CircuitPython repo atm since it's likely to be integrated into the system somehow if it's making use of some of the displayio internals.

manic glacierBOT
ionic elk
#

@lone axle @mental nexus I'd also be interested in seeing some kind of summary of the UI elements discussion, as I've got some touch UI projects coming up.

lone axle
#

Thinking outloud a bit. Maybe the systen could provide a Gamepad-like object where each property represents a screen control instead of a IO pin or similar.

gilded cradle
#

Thanks @mental nexus and @lone axle. It's kind of like experiencing the Graphical UI all over again and that's been my inspiration on the UI controls. It's really just a bunch of loose ideas at this point. So as you mentioned, radio button and checkbox. Maybe a scrolling text area (which may have been done on a project or two already). A drop down box, list, tree control, maybe groups. I like to look at some old Visual Basic interfaces with available controls for inspiration. I do like the idea of touch events where each element keeps track of it's own touches it receives.

ionic elk
#

@tulip sleet so, as crazy as it is, I'm getting the same hardfault crash on my STM32 control of DisplayIO when I intentionally put in the wrong I2C address. So potentially this null reference error has been around on all ports, possibly for a long time?

#

So yeah anyway putting in a fix, maybe we can poke around and see if there's even more object validity checking we should be doing in the DisplayIO reset functions

#

@gilded cradle do we have a system for a rotating selection list? Like the kind of thing you have on a 3D printer, where a carrot moves down a list to select menu items, can enter submenus and such. And if the list is larger than the screen, it will cycle into new items once you hit the bottom or top?

gilded cradle
#

Not that I'm aware of @ionic elk, though it would make a cool library.

ionic elk
#

I put together one on Mbed one time, maybe I'll try doing it for circuitpython

#

I'll need it for some upcoming things I think

solar whale
#

@tulip sleet FYI -- I have been using my Linux box again lately for building CP and flashing to several boards (esp32s2,feather_m4, itsy_bitsy_m4, metro_m4_airlift) and I have not experienced any crashes. I should know better than to jinx it, but it sure seems to be improved. No idea why...

mental nexus
#

There was a recent demo of a touch menu buttons and/or page changing, I think on a pyportal. Can anyone point me there? I think it may have been a YouTube video. Not sure if it was CP or Arduino.

mild lintel
#

Hullo. I'd like some advice on debugging. I'm trying to run some CPy tests on a Feather M4 connected to a 144-led RGBW NeoPixel strip. The strip's not lighting up but I can control the onboard LEDs. Here's how I have it hooked up (shown without power hookups) EDIT: That resistor is 470-ohm as measured by multimeter:

#

The code I'm running is this one:

# Test NeoPixel
import time
import board
import neopixel

pixel_pin = board.D6
num_pixels = 10

# For RGBW NeoPixels, simply change the ORDER to RGBW or GRBW.
# ORDER = neopixel.GRB
ORDER = neopixel.GRBW

pixels = neopixel.NeoPixel(
    pixel_pin, num_pixels, brightness=0.2, auto_write=False, pixel_order=ORDER
)


def wheel(pos):
    # Input a value 0 to 255 to get a color value.
    # The colours are a transition r - g - b - back to r.
    if pos < 0 or pos > 255:
        r = g = b = 0
    elif pos < 85:
        r = int(pos * 3)
        g = int(255 - pos * 3)
        b = 0
    elif pos < 170:
        pos -= 85
        r = int(255 - pos * 3)
        g = 0
        b = int(pos * 3)
    else:
        pos -= 170
        r = 0
        g = int(pos * 3)
        b = int(255 - pos * 3)
    return (r, g, b) if ORDER in (neopixel.RGB, neopixel.GRB) else (r, g, b, 0)


def rainbow_cycle(wait):
    for j in range(255):
        for i in range(num_pixels):
            pixel_index = (i * 256 // num_pixels) + j
            pixels[i] = wheel(pixel_index & 255)
        pixels.show()
        time.sleep(wait)


while True:
    pixels.fill((255, 0, 0, 0))
    pixels.show()
    time.sleep(1)

    pixels.fill((0, 255, 0, 0))
    pixels.show()
    time.sleep(1)

    pixels.fill((0, 0, 255, 0))
    pixels.show()
    time.sleep(1)

    rainbow_cycle(0.001)  # rainbow cycle with 1ms delay per step
#

Measuring voltage from the power supply (5V 10A) at the barrel adapter, it reads 5.25V. Is that too much for the NeoPixels?

ionic elk
#

@slender iron you have a sec?

#

I have some questions about DisplayIO

slender iron
#

@ionic elk yup

ionic elk
#

I'm finding some null reference errors that have me very confused, because it seems so improbable that nobody would have run into them before. So I'm wondering if I'm somehow barking up the wrong tree or if there's some kind of meta-fix I should be doing.

#

Like, for instance, I'm having one where if you set the reset pin to none in I2CDisplay, release_displays doesn't actually detect that it's not there, and tries to reset it anyway, leading to a hardfault

#

Does that mean that nobody ever set a reset pin to none in I2CDisplay before?? I'm sure I've even done that myself, so why is it only cropping up now?

slender iron
#

where does it hardfault? that generally doesn't surprise me

#

my code doesn't cover edge cases like that very well

ionic elk
#

It will crash whenever release_displays is called at the beginning of a sketch, if you have defined an I2C screen with no reset pin

lone axle
ionic elk
#

Same deal with the memcpy hardfault I just found in reset_displays for I2CDisplay (that's the one Limor was running into), it implies that nobody ever put in a wrong address for their I2CDisplay, because that causes an immediate hardfault when your code_py completes.

#

as soon as cleanup_after_vm is called. It's not a hard fix or an especially big issue, I was just baffled that it hadn't come up before

#

just seems like that'd be something we'd be seeing recurring issues about

slender iron
onyx hinge
#

@idle owl if you have a second can you mark the old notes doc read-only ?

ionic elk
#

The issue is that if you hit mp_raise_ValueError_varg(translate("Unable to find I2C Display at %x"), device_address); it won't set self->bus, but it keeps the display with a valid type in the display array, so it blows up a memcpy in cleanup_after_vm later

#

I've verified that it happens on the ESP32 and the STM32

slender iron
#

so that seems like a legit bug then

ionic elk
#

Ok, cool. I might scrounge around more then, and see if I can find more dereferences that might be going on

#

I was just worried there was something I had missed for those ports in particular

slender iron
#

there are plenty of bugs to find and fix

onyx hinge
#

Here is the notes document for Monday 14 September 2020's CircuitPython Weekly meeting. We return to our normal Monday meeting schedule, at the typical 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/1vPWZyHRhsrAMZdc7nQJCDBmshHgtot2UotPJuIgSM_U/edit?usp=sharing

ionic elk
#

I guess I just shouldn't second guess myself so much, maybe there just aren't that many people using the I2CDisplays

slender iron
#

πŸ‘

mental nexus
#

Thanks! That’s it @lone axle, the one with the cartoon finger! I’ll start an issue and add a few examples including this one and your hamburger menu. Also I’ll put some references to one or two existing python GUIs that I’ve found.

manic glacierBOT
#

This is a great start! Take a look at the design guide here: https://circuitpython.readthedocs.io/en/latest/docs/design_guide.html It's a random collection of things that could be helpful to know.

The reason I point it out is because this API could actually be split into two. Native APIs should be minimal and just encompass the core of the functionality. For example, NDEFMessage could be done in Python much easier than C.

One existing API to compare against is [the BLE Advertising API...

idle owl
#

@onyx hinge Done.

onyx hinge
#

thank you @idle owl

manic glacierBOT
#

Objective: To define a CircuitPython friendly method for an easy-to-use set of touch-based graphical controls for displays

Recent discussions highlight the desire for easy-to-use screen based Graphical User Interface elements for CircuitPython displays.

These requests range from a desire to relate touch input to existing displayio graphics elements (https://github.com/adafruit/circuitpython/issues/1598) and to @makermelissa 's request for [radio buttons and scrolling text boxes](ht...

crimson ferry
#

Is there any ESP32-S2 test CP code around for exercising wifi, socketpool, and ipaddr?

manic glacierBOT
slender iron
#

requests should be the same as my http11 branch

crimson ferry
#

cool, thanks!

slender iron
#

@atomic summit I just merged in the native wifi code

atomic summit
#

Awesome @slender iron - I missed the second half of your deep dive when you started going over the SPI + SPRAM +DMA stuff... where did you land on that?

slender iron
#

I need to fix it today

#

will probably just turn off DMA in that case

atomic summit
#

What did you decide to do? turn off DMA?

slender iron
#

yup

#

since its simpler and the cp api is blocking anyway

atomic summit
#

ok

crimson ferry
#

d'oh! it's already in readthedocs too

slender iron
#

/en/latest is based on the latest commit

#
  • to main
crimson ferry
#

I love whoever put together this whole build system... all the things in their right places every time there's a merge πŸ˜„

manic glacierBOT
slender iron
#

part of it is me realizing having artifacts from the latest commit means early testing on everything πŸ˜„

manic glacierBOT
#

This PR fixes null reference exceptions in DisplayIO related to the use of I2CDevice, which were causing crashes if the user entered the wrong I2C address for an I2C OLED screen, or did not include a reset pin in the construct function. These issues were identified by @ladyada in #3334, but were apparently occurring across all ports, not just the ESP32-S2.

This PR also adds an openocd configuration file and linker flag required to use GDB with the ESP32-S2, which assisted in tracking this ...

crimson ferry
#
If you can read this, its working :)```
#

πŸ₯³

slender iron
#

πŸŽ‰

manic glacierBOT
solar whale
#

cool!```
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.0.0-alpha.3-151-ge5dd2a32f on 2020-09-10; Saola 1 w/Wrover with ESP32S2

import wifi_test
cp mem free 2036592
idf total mem 157280
idf mem free 97208
idf largest block 53032
<Network> Needell Airport -62 1
<Network> Needell Airport -48 11
<Network> WYZE_FBAB62DE71811B38 -64 11
<Network> Expelliarmus2 -79 2
<Network> central2.4 -84 5
<Network> 31A -84 5
None
ip 10.0.0.107
8.8.4.4
ping 0.038
200
This is a test of Adafruit WiFi!
If you can read this, its working :)

200
{'url': 'https://httpbin.org/get', 'headers': {'User-Agent': 'Adafruit CircuitPython', 'Host': 'httpbin.org', 'X-Amzn-Trace-Id': 'Root=1-5f5a8aeb-28890ae856666eb9eaf7ba7d'}, 'args': {}, 'origin': '73.61.89.123'}

#

sorry did not see post above -- great work @slender iron

#

And FYI -- this build for my saola-wrover was done on my Mac in a "non-casesensitive" file system !

manic glacierBOT
manic glacierBOT
#

@kevinjwalters I envision situations where blitting into itself will cause strange behavior.

The function is pretty simple and iterates pixel-by-pixel through the source bitmap through y, then x. I think if you copied from a higher x or y in the "source" bitmap to a lower x or y in the same "target", it would work ok. But if you copy pixels into regions of the "source" that haven't been copied yet, it will do something strange. (Maybe that would be cool for an art project?)

If yo...

#

Awesome, the design guide is exactly the sort of thing I was looking for!

I definitely wanted NDEFMessage to be python only, so the fact that it's not only possible but encouraged sounds excellent to me!

For your questions:

  1. First I guess it makes sense to touch on what makes them similar: They do both have byte payloads (typically NDEF messages according to the spec I think.) They both are the "target" device in an NFC interaction. The "reader/writer" would be something like your ...
opaque abyss
#

I think scott may kill me based on the novellas I've written about NFC before I ever write a line of code πŸ˜¬πŸ˜‚

slender iron
#

@opaque abyss all good! api design is my favorite part

#

thanks @solar whale !

crimson ferry
#

That's odd... I didn't put any AP code on the ESP32-S2 (there isn't any via CP yet afaik), but it broadcast a Beacon frame ( MAC address + 1) earlier in testing. Must be some startup in the core or ESPIDF sub-core? (advertised rates = 5, 11, 1, 2, 6, 12, 24, 48 Mbps)

slender iron
#

Β―_(ツ)_/Β―

crimson ferry
#

lol

slender iron
#

sounds like you have a better setup for testing than I do πŸ™‚

#

you can help me fix bugs

crimson ferry
#

I have sniffers πŸ˜‰

#

RPi & Arduino-ESP32

slender iron
#

perfect! now I know who to ask πŸ˜‰

#

it may start in AP mode actually

crimson ferry
#

Is this expected```E (136) esp_image: image at 0x2d0000 has invalid magic byte
E (142) boot: Factory app partition is not bootable

manic glacierBOT
crimson ferry
#

ah yea, here it is: I (12901) wifi:mode : softAP (DE:AD:BE:EF:FE:ED)

opaque abyss
#

yum, hamburgers.

crimson ferry
#

(redacted)

old smelt
#

I see that there is no 5.3.1 UF2 download option for our board. Is that because we added it to the repo after 5.3.1 was released? If so, will there be a stable release option for our board after the next official stable release?

https://circuitpython.org/board/aloriumtech_evo_m51/

The Evo M51 is an FPGA-enhanced Feather compatible compute module from Alorium Technology that features a 32-bit SAMD51 microcontroller along with an Intel MAX 10 FPGA.Designed for use as an embeddable system-on-module, all of the standard Feather I/O are also routed to castel...

lone axle
#

@old smelt yes I believe you are correct. Once the next major stable release occurs that option should appear.

slender iron
#

@crimson ferry That error is because there is no valid factory partition where the uf2 bootloader will go

crimson ferry
#

ah, makes sense, thanks

slender iron
#

@old smelt your board won't have a stable release until 6.0.0 is released. we're not backporting to 5.x any more

onyx hinge
manic glacierBOT
manic glacierBOT
#

I was able to find that it is a copy or near-copy of a file from openocd-esp32. The overall openocd project is GPL licensed. These cfg files do not have an alternate or exception notice posted.

https://github.com/espressif/openocd-esp32/blob/83c424a784f16cf47322da52f0ed42fddf7d85fb/tcl/target/esp32s2.cfg

FWIW the esp32s2.cfg file is also installed when install esp-idf, e.g., to $(HOME)/.espressif/tools/openocd-esp32/v0.10.0-esp32-20200420/openocd-esp32/share/openocd/scripts/target/esp...

old smelt
#

Thanks for confirming @lone axle & @slender iron

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

Currently I have tested this:
adafruit-circuitpython-espressif_saola_1_wroom-en_US-20200911-9256e6b.bin
everything works

adafruit-circuitpython-espressif_saola_1_wrover-en_US-20200911-9256e6b.bin
doesn't work

import spiloopback
loopback IO35-IO37
bytearray(b'\x00\x00\x00\x00') fail
bytearray(b'\x00\x00\x00\x00') fail
bytearray(b'\x00\x00\x00\x00') fail
bytearray(b'\x00\x00\x00\x00') fail

On 9/11/20, Scott Shawcroft notifications@github.com wrote:

@emard please test artifacts from t...

manic glacierBOT
#

Spresense only needs a 32-byte alignment for camera. I changed BYTES_PER_BLOCK to 32 and aligned the heap to 32 bytes.

I also changed the API. Now Camera constructor has two arguments: width and height. The take_picture function also has two arguments: buffer and format. It also returns the size of the taken picture. The ImageFormat enum is created for the format.

Let me know what you think about it.

thorny jay
#

SOLVED: MpyError: Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/mpy-update for more info.
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.0.0-alpha.3-147-gfd30832e3 on 2020-09-10; Adafruit PyRuler with samd21e18

#

Ok, could be a corruption on my Flash... I need to "clear" everything. Was there a uf2 for doing that?

#

Can I "format" the drive? Not sure I want to lose the folder ".fseventsd" or the files ".metadata_never_index" and ".Trashes".

#

Ha ha, now adafruit_dotstar need adafruit_pypixelbuf ... this is new to me. Maybe some guide will need to be updated.

stuck elbow
#

sure, you just run storage.erase_filesystem()

#

it will also re-create those hidden files

manic glacierBOT
analog bridge
#

Anyone online with a CircuitPlayground Express cpx handy ?

#

Need to confirm a bug

solar whale
#

@analog bridge I have one -- what version of CP are you using? need to update mine

analog bridge
#

Hi, @solar whale What ver do you have ?

solar whale
#

what version of CP? -- any you want -- I just loaded the latest tip of main to it.

analog bridge
#

That will work. Can you post the output of serial console when the board is powered-on/reset while holding both A & B buttons

solar whale
#

nothin special

analog bridge
#

Does it enter safe-mode ?

solar whale
#
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.0.0-alpha.3-165-g9256e6b37 on 2020-09-11; Adafruit CircuitPlayground Express with samd21g18
> 
> ```
#

no - this is just a control -d -- let me try a power cycle

#

yes on power cycle it does go to safe mode

#
You are in safe mode: something unanticipated happened.
CircuitPython core code crashed hard. Whoops!
Unknown reason.
Please file an issue with the contents of your CIRCUITPY drive at 
https://github.com/adafruit/circuitpython/issues

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

analog bridge
#

Yup!

solar whale
#

same on RESET -- either A or B is ok , but both results in safe mode

analog bridge
#

The reason being provided for safe mode is wrong.

onyx hinge
#
// pressed, then boot into user safe mode.
``` It's intended that holding both enters safe mode, but .. yeah what microDev said πŸ™‚
#
        return USER_SAFE_MODE;
solar whale
#

just says "unknown reason"

analog bridge
#

USER_SAFE_MODE is not handled in safe_mode.c properly. I came accross this while implementing manual_safe_mode for esp32s2

onyx hinge
#

yup, supervisor/shared/safe_mode.c switch(reason) near line 116 lacks a case for USER_SAFE_MODE

#

shoot us a PR, @analog bridge !

#

117 case MANUAL_SAFE_MODE:

#

unless USER_SAFE_MODE and MANUAL_SAFE_MODE should be the same, with the MANUAL_SAFE_MODE text revised slightly

#
``` maybe this text can be used somehow
analog bridge
#

USER_SAFE_MODE seems to be board specific reason for entering safe mode

onyx hinge
#

oh wait the block that's supposed to be running is the one above in safe_mode.c: ```106 // Output a user safe mode string if it's set.
107 #ifdef BOARD_USER_SAFE_MODE
108 if (reason == USER_SAFE_MODE) {
109 serial_write_compressed(translate("You requested starting safe mode by "));
110 serial_write(BOARD_USER_SAFE_MODE_ACTION);

analog bridge
#

I searched whole CPY but was unable to find any definition for BOARD_USER_SAFE_MODE

onyx hinge
#

I bet the guard on line 107 should be BOARD_USER_SAFE_MODE_ACTION instead

analog bridge
#

Also there is an else statement just chilling there without curly braces

#

This part of code never gets compiled

onyx hinge
#

I agree, right now that part never gets compiled due to the #ifdef

#

OK so what if you reorganize it like this:

        case USER_SAFE_MODE:
            #ifdef BOARD_USER_SAFE_MODE_ACTION
            serial_write_compressed(translate("You requested starting safe mode by "));
            serial_write(BOARD_USER_SAFE_MODE_ACTION);
            serial_write_compressed(translate("\nTo exit, please reset the board without "));
            serial_write(BOARD_USER_SAFE_MODE_ACTION);
            serial_write("\n");
            break;
            #else
            // fallthrough
            #endif
        case MANUAL_SAFE_MODE:
            serial_write_compressed(translate("CircuitPython is in safe mode because you pressed the reset button during boot. Press again to exit safe mode.\n"));
``` so that USER_SAFE_MODE case is handled in the first block, and you get the special message if it's available and otherwise you get the manual safe mode message (which might be inaccurate but is better than nothing)
#

and get rid of the weird if/dangling else as a bonus

analog bridge
#

I was planning to rename BOARD_USER_SAFE_MODE_ACTION to BOARD_USER_SAFE_MODE

#

And in the board specific mpconfigboard.h #define BOARD_USER_SAFE_MODE "board specific reson here"

onyx hinge
#

I don't have a strong opinion about that, but I do think the #ifdef should check the existence of the same thing that the serial_write is going to print

#

@slender iron prefers to use #if MACRO instead of #ifdef MACRO or #if defined(MACRO) and ensuring that MACRO is always defined to 0 or 1, as the way to enable/disable functionality. However in this case I feel like sticking with #ifdef for the macro that expands to the text is probably the way to go, because otherwise the guard and the text can get out of synch (as they have, and nobody noticed)

analog bridge
#
switch (reason) {
        case USER_SAFE_MODE:
            #ifdef BOARD_USER_SAFE_MODE
                serial_write_compressed(translate("You requested starting safe mode by "));
                serial_write_compressed(translate((BOARD_USER_SAFE_MODE));
                serial_write_compressed(translate("\nTo exit, please reset the board without "));
                serial_write_compressed(translate((BOARD_USER_SAFE_MODE));
                serial_write("\n");
                return;
            #else
                // fallthrough
            #endif
        case MANUAL_SAFE_MODE:
#

This seems to work

onyx hinge
#

I also compile-tested it on a trinket m0, which does not have BOARD_USER_SAFE_MODE_ACTION and it built

#

I'll let you select the final form, thanks for letting me work through the problem with you especially when it came to me announcing things you had already learned for yourself πŸ™‚

analog bridge
#

Np. I'll get a PR for this along with manual_safe_mode implementation for esp32s2

onyx hinge
#

πŸ‘

analog bridge
#

Thanks @solar whale & @onyx hinge

#

@solar whale can you link the wifi_test code for esp32s2

solar whale
#

you need scotts adafruit_requests as well

analog bridge
#

you need scotts adafruit_requests as well

#

okay... πŸ‘

manic glacierBOT
solar whale
#

@onyx hinge is the sdcard on the teensy4.1 supported by sdioio?

onyx hinge
#

@solar whale No, I don't think so

#

it needs some port-specific code. I wrote it for atmel-sam and stm32(f405) and I think there was an implementation contributed for spresense. someone would need to code it up for i.mx

solar whale
#

Not a problem -- just answering a forum question.

onyx hinge
#

would be happy to see that PR come in πŸ™‚

manic glacierBOT
#

I obtained the file from the script location noted by @jelpler on my machine (the path is also obtainable by using $OPENOCD_SCRIPTS after running the export script). It is the same as the esp32s2.cfg file but with the essential difference of adding the adapter_khz 1000 line, without which debugging will fail. I don't know why they don't include it by default.

I assumed it would have the same Apache2 licensing as the rest of the project. Do I need to take it out?

lone axle
#

@onyx hinge if you find yourself with a few moments to spare at some point today I'd love the chance to pick your brain a bit about adafruit_sdcard causing device lockup when used with OnDiskBitmap

onyx hinge
#

@lone axle I'm around, do you wanna do it now-ish or in a couple hours?

lone axle
#

Now's good for me.

onyx hinge
#

OK let me go to my circuitpython computer and grab a board for testing. would a pyportal or pygamer do it?

lone axle
#

Yep, pyportal is the one I've been using but another user has said the PyGamer has the same issue

onyx hinge
#

OK, I have a pygamer with a debug header soldered on which is great for getting extra info in these circumstances

#

do you want to do text only or do you prefer to hop into a voice or video chat?

lone axle
#

Voice is probably the easiest for me at the moment.

#

text is fine as well though

onyx hinge
#

whatever you feel will work best for you.

lone axle
#

Okay, I haven't used any of the voice rooms outside of the meeting. Are they available to just jump in to at any time or is there something specific that needs done in order to activate them or something?

onyx hinge
#

yeah you should just be able to enter one of those shared voice chats

onyx hinge
#
...
#10 0x00030a04 in f_read 
#11 0x0004749a in common_hal_displayio_ondiskbitmap_get_pixel 
#12 0x00047e52 in displayio_tilegrid_fill_area 
#13 0x00046fd6 in displayio_group_fill_area 
#14 0x000490b8 in displayio_display_core_fill_area 
#15 0x00045990 in _refresh_area 
#16 0x00045a66 in _refresh_display 
#17 0x00045fe2 in displayio_display_background 
#18 0x0004842a in displayio_background 
#19 0x00021a32 in supervisor_background_tasks 
#20 0x00021114 in background_callback_run_all 
#21 0x00021b06 in supervisor_run_background_tasks_if_tick 
#22 0x0001ca3a in mp_execute_bytecode 
[...]
#36 0x00030a04 in f_read 
#37 0x0004749a in common_hal_displayio_ondiskbitmap_get_pixel 
#38 0x00047e52 in displayio_tilegrid_fill_area 
#39 0x00046fd6 in displayio_group_fill_area
#40 0x000490b8 in displayio_display_core_fill_area 
#41 0x00045990 in _refresh_area 
#42 0x00045a66 in _refresh_display 
#43 0x00045cc4 in common_hal_displayio_display_refresh 
#44 0x0003ee12 in displayio_display_obj_refresh 
#45 0x00013618 in fun_builtin_var_call 
#46 0x0000ebbc in mp_call_function_n_kw 
onyx hinge
#

@lone axle and additionally the same change should be made in FramebufferDisplay.c as Display.c. I don't suppose you happen to have an RGBMatrix display for testing with that.

lone axle
#

I don't, but I've been looking for an excuse to get one because I do want to play with it. So I'm happy to have testing this out be that excuse πŸ˜† .

ionic elk
#

@onyx hinge do you know why the SPI write_value is 8 bits? Is it binary data that's simply supposed to be repeated over and over? Seems like all it's ever supposed to do is just drag the bus to a certain level for these SPI out-of-spec special cases like SD, right?

#

Is there any reason it would ever send anything other than 0xFF?

onyx hinge
#

@ionic elk I think 0x0 and 0xff would cover the real world cases

stuck elbow
#

spi is two-way full-duplex, so you always send and receive at the same time

#

there are some tricky devices that allow you to take advantageΒ of that

#

like sensors that give you the reading from the last measurement while at the same time letting you set up the next

onyx hinge
#
        buf = bytearray(2)  # 2 = 1 status byte + 1 byte of returned content
        with self._spi as spi:
            time.sleep(0.005)  # time for CSN to settle
            spi.readinto(buf, write_value=reg)
        self._status = buf[0]  # save status byte
        return buf[1]  # drop status byte and return the rest``` actually the way this is coded it needs values other than 0x00 and 0xff
#

(that's the nrf24 lib)

#

I don't know whether specifically it needs to receive the register number twice (once with each byte it reads) or if this is just a shortcut to send the register value out without allocating more buffers

ionic elk
#

@stuck elbow interesting. At the moment, only atmel-samd and i.MX actually implement write_value at all

#

so this will fail on every port except those, not just STM32

#

Probably at the very least we should put in a not_implemented exception here

#

for all ports without this capability

manic glacierBOT
#

While SPI just needs the value 0xff (all bits same), the nRF24 library needs specific values:

    def _reg_read(self, reg):
        buf = bytearray(2)  # 2 = 1 status byte + 1 byte of returned content
        with self._spi as spi:
            time.sleep(0.005)  # time for CSN to settle
            spi.readinto(buf, write_value=reg)
        self._status = buf[0]  # save status byte
        return buf[1]  # drop status byte and return the rest
onyx hinge
#

@ionic elk with respect to the stm hal, would it work to fill the var we call "data" with the outgoing byte value using memset, then pass the same "data" pointer twice to HAL_SPI_TransmitReceive ? Rather than introducing an extra buffer.

manic glacierBOT
#

@xiongyihui - what was your intent with the PR #3244 patch in regard to displays? Right now I see that qspi_enable() is being called during startup after qspi_disable(); but the Clue display does not come back on. I see that you did not use the NRF provided nrf_qspi_disable() to turn off QSPI, but you did use nrf_qspi_enable() to turn it back on. Was there a reason for this? I did find out the commenting out the
NRF_QSPI->TASKS_DEACTIVATE = 1;
line in qspi_disable() keeps the display...

ionic elk
#

This complicates my implementation as well, since the workarounds I've found for the ST HAL assume a binary idle level, and implement it by dragging the pin up and down as a GPIO temporarily

onyx hinge
#
        uint8_t *data, size_t len, uint8_t write_value) {
    if (self->miso == NULL) {
        mp_raise_ValueError(translate("No MISO Pin"));
    }
    HAL_StatusTypeDef result = HAL_OK;
    if (self->mosi == NULL) {
        result = HAL_SPI_Receive (&self->handle, data, (uint16_t)len, HAL_MAX_DELAY);
    } else {
        memset(data, write_value, len);
        result = HAL_SPI_TransmitReceive (&self->handle, data, data, (uint16_t)len,HAL_MAX_DELAY);
    }
    return result == HAL_OK;
}
ionic elk
#

πŸ€”

#

I can try

#

I mean, probably just running read as transmit_recieve should solve it, right? Why worry about the memset?

onyx hinge
#

I'm trying to imagine a reason (aside from "chip implementors are mad! MAD, I TELL YOU!") that it wouldn't work

ionic elk
#

Oh right, it needs to be on the MOSI pin

#

hmmm

onyx hinge
#

the memset makes every byte of the outgoing data equal to the write value

#

compared to an earlier suggestion I made, it just tries to re-use the same memory region for both purposes

#

it's at the boundary of possibility that the time to memset() would matter so you might still special case 0x00 and 0xff .. but only if you can measure it (vs time time to do SPI at 8MHz or something)

#

you might also want to be able to recognize the "write_value not specified" case, which would involve making the type of write_value wider than 8 bits (e.g, just an int) and then check for a distinguished value like -1 to mean "not specified". 0-255 would be all the valid single byte values.

#

but I would only do those complications subsequent to measuring performance with a simple variant like the above

ionic elk
#

I'm still trying to wrap my head around what you're suggesting. i might just need to try it and see what happens

onyx hinge
manic glacierBOT
onyx hinge
#

or is it all a case of being clear as mud

#
    memset(data_out, write_value, len);
    HAL_StatusTypeDef result = HAL_SPI_TransmitReceive (&self->handle,
        data_out, data_in, (uint16_t)len,HAL_MAX_DELAY);```
ionic elk
#

Oh, ok I get it now. I got the lines mixed up in my head. So, memsetting the data value is just a space saving measure, it re-uses the same array that is used for outgoing data to provide incoming idle values.

#

?

onyx hinge
#

Right, compared to my earlier suggestion on that issue the intended difference is re-using the same buffer

#

as well as making sure not to TransmitReceive on a bus that is transmit-only, which would give a HAL error I think

ionic elk
#

Why would we want a write value not specified case? It appears that the bus defaults to a logic level of 0 for a normal transmit function, so it makes more sense to me that we just have write_level default to 0

#

Which is the current case. What differences do you think would need to be implemented for an undefined write_value?

onyx hinge
#

I was prematurely worrying about performance

#

if you're moving a bunch of data you'd rather it be as fast as possible, so slowing down every case with a memset() might be something you'd notice

manic glacierBOT
ionic elk
#

@onyx hinge Ah, I see. So the idea with that would be to avoid actually performing the memset at all.

#

I think I'll just run a check for whether it's 0, and run a regular receive in that case, since that appears to be the default behavior.

onyx hinge
#

it might or might not be the last byte received, a common hardware optimization seems to be to share a single shift register with the send and receive machinery

manic glacierBOT
#

@water5 SDIO is generally preferable, but it is not available for some breakout boards like the Adalogger, which assume SD card access over SPI. I brought it up because the "write_value" issue Jepler mentioned (a problem with dictating what value the SPI write line is idling at while a read is occurring) is most commonly found on SD cards, but it also appears to affect some sensors like this one which require specific data to be transferred while reading.

To be honest, I see some redundanc...

ionic elk
#

@onyx hinge I had assumed from your pic that it had started an actual transfer later on - so what's actually happening in that image is that the data on MOSI starting with 0xC0 is actually all junk?

onyx hinge
#

"0x00 0xc0 0x7f" should have been "0xff 0xff 0xff"

#

I guess I didn't make it super clear did it

#

In the "good" trace, 0xff goes out and 0x3f comes in, so that's the point of departure

#

because that byte didn't have the expected value, the SD card implementation keeps sending out more bytes until it gives up

solar whale
#

@slender iron - using your demo code for the esp32s2 wifi, sometimes the last request fails
response = requests.get("https://api.github.com/repos/adafruit/circuitpython")
print(response.status_code)
print("circuitpython stars", response.json()["stargazers_count"])

200
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "wifi_scott.py", line 53, in <module>
 File "adafruit_requests.py", line 315, in json
 File "adafruit_requests.py", line 69, in readinto
 File "adafruit_requests.py", line 197, in _readinto
TypeError: unsupported types for __sub__: 'NoneType', 'int'```
> 
 but sometimes it works OK   
> 
> 
> if I try getting data from this URL (from the cheerlights demo) I get ``` 
> response = requests.get("https://api.thingspeak.com/channels/1417/feeds.json?results=1")
> ``` fails with
> ```Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "wifi_test.py", line 51, in <module>
>   File "adafruit_requests.py", line 506, in get
>   File "adafruit_requests.py", line 456, in request
>   File "adafruit_requests.py", line 401, in _get_socket
>   File "adafruit_requests.py", line 397, in _get_socket
> OSError: Failed SSL handshake
> > 
> > ```  Is that  expected at this time?
#

@crimson ferry when you tried the wifi test, dids you have the same error as above?

manic glacierBOT
#

Please go through issue https://github.com/adafruit/circuitpython/issues/3389 for a background of this PR.

What works:

  • On esp32s2, one can manually enter safe mode by pressing boot button during the 700ms loop on startup. This loop is indicated by:
    • yellow color on rgb led and/or,
    • a blinking led
      Note: If you do not have any way of guessing the loop status, power-on the board/press the reset button and after a short delay, press and hold boot button for a while ...
crimson ferry
#

@solar whale I did see that a couple of times, but haven't done rigorous testing yet. I'll be doing more testing later today hopefully. I also noticed and need to narrow down that connect seems to not connect (tries forever) unless a scan has been done, even with a timeout= kwarg.

#

I saw the handshake error, not the first one

solar whale
#

hmm you got the "stargazer" count OK?

manic glacierBOT
#

Hmm, interesting that yours is now working. I just pulled and built the
latest main (commit 9256e6b37)
and I still have nothing on the display when booting the Clue off a
battery, and running some
displayio code still produces nothing.

On Fri, Sep 11, 2020 at 10:54 AM jerryneedell notifications@github.com
wrote:

This issue appears to have been resolved -- at least, it works on my CLUE
now ... should this be closed?

β€”
You are receiving this because you were mentioned.
Reply to ...

crimson ferry
#

@solar whale I saw it (stargazer) work a couple of times I'm pretty sure, but then replaced the URLs with my own targets. I'll try again today.

solar whale
#

@crimson ferry Thanks -- I was just not sure what to expect at this point. I'll keep playing with it as well.

#

@crimson ferry odd -- now the stargazer is working (takes several seconds) but its working.

crimson ferry
#

I was trying it more and I'm getting that error now

solar whale
#

I guess I passed it to you πŸ˜‰

crimson ferry
#

huh, now it's working

solar whale
#

I feel much better now ...

crimson ferry
#

I have it looping and it keeps working, weird

solar whale
#

the error implies a None response when it fails.

#

now its working for me as well

slender iron
#

@solar whale @crimson ferry the github endpoint sometimes returns a chunked response

#

the adafruit_requests version I copied here may be older than my http11 branch which I think fixes it

solar whale
#

@slender iron thanks - is the SSL handshake error expected?

slender iron
#

I've seen it before but not sure why it happens

solar whale
#

OK -- that's fair πŸ˜‰ fun to be an early adopter -- I'll keep poking at it.

slender iron
#

thanks! which version of requests are you using?

idle owl
#

@slender iron UART doesn't need bus_device does it?

slender iron
#

nope because UART as we use it is just one device to another

idle owl
#

Ok. Essentials guide says you need it for a UART example. I'll fix it.

slender iron
#

thanks!

ionic elk
#

I'm getting modified: esp-idf (modified content) in my git status now that I've updated the esp-idf to the latest version on main. How do I get that to go away? updating the submodule doesn't seem to do anything

supple gale
#

I usually do a β€”recursive inside the esp-idf folder. Not sure if that is correct

ionic elk
#

That worked! I thought my shell alias had --recursive already though, hmm

supple gale
#

I think the entire process with esp32 needs a bit better docs at some point. Most of what I do seems more like an incantation.

analog bridge
#

@slender iron I got a PR for esp32s2 safe_mode support

#

@onyx hinge might also want to have a look at it

slender iron
#

I saw! Thank you! I'll look later today

analog bridge
#

sure...

crimson ferry
#

@solar whale this is fun, to ping a named host wifi.radio.ping(ipaddress.ip_address(pool.getaddrinfo("dns.google.com", 443)[0][4][0]))

ionic elk
#

@supple gale if you think this is bad you should try installing Zephyr RTOS

#

that's a party

#

@onyx hinge what's the SD card SPI speed supposed to be? I see 163kHz, which seems a little arbitrary

onyx hinge
#

There's a parameter for it in the constructor. ```adafruit_sdcard.py: def init(self, spi, cs, baudrate=1320000):

#

while for sdcardio sdcardio/SDCard.c: { MP_QSTR_baudrate, MP_ARG_INT, {.u_int = 8000000} },

#

163kHz doesn't seem right, unless you're using adafruit_sdcard and counting the byte time rather than the bit time

silver tapir
ionic elk
#

I thought I needed it to fix Logic picking up the signals with an analyzer, but it was actually confused about the clock signal idle level

#

My clock is pretty weird, it doesn't have any gaps. Wondering what's up with that...

supple gale
#

@supple gale if you think this is bad you should try installing Zephyr RTOS
@ionic elk Quite true. Did that recently, and first time no go, wipe and try again and it works. Its amazing.

manic glacierBOT
#

@tannewt I was referring to our previous convo where you suggested thinking about how sensors libs should handle a restart, though in that context I think you were talking about waking up from a sleep that was entered for power saving purposes so I may have crossed the streams.

It sounds like this is a related but different issue as there are certainly use cases where you would want a complete reset, sensors included ie: running an app that wants different configurations for a sensor.

slender iron
#

needs to merge weblate PRs first

tulip sleet
#

it just pushed another batch 2 minutes ago :/

slender iron
#

ya, it does every PR merge I think

slender iron
#

at least those that add messages

manic glacierBOT
manic glacierBOT
#
2. From my understanding, no.

Ok, so this means we may want to think of it as a singleton like the BLE Adapter class.

I think we can handle writing by reading the buffer back. No need to do any fancy callback stuff.

The caveat is that An NDEF message can have 0 or more records of any types. Perhaps an NDEFRecord object that could describe what it is, and provide interfaces to get it's data as the applicable type? (I see that being an intuitive thing, but I don't know how un...

marble hornet
#

@slender iron @mental nexus thank you for tagging in the touch-extension issue. I have an assembly assignment to finish for class then i'll draft a response. I've spent some time on this problem and would love to provide whatever help I can.

slender iron
#

no rush. just knew you'd have thoughts

manic glacierBOT
#
  1. it is nRF52840-MDK https://github.com/makerdiary/nrf52840-mdk
  2. it dose not support it
    3.`
    Sep 11 20:04:36 ubuntu /usr/lib/gdm3/gdm-x-session[1819]: (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.2/1-2.2:1.3/0003:239A:802A.000B/input/input44/event23"
    Sep 11 20:04:36 ubuntu /usr/lib/gdm3/gdm-x-session[1819]: (II) XINPUT: Adding extended input device "makerdiary nRF52840-MDK Keyboard" (type: KEYBOARD, id 2...
crimson ferry
#

Any way to recover in code from a espidf.MemoryError: ?

manic glacierBOT
slender iron
#

@crimson ferry do you have concurrent sockets in use?

manic glacierBOT
crimson ferry
#

@slender iron I do get a new from the pool on some exceptions in my code. The Github main comment code (yours) does not do that, but some of the other errors could be related. Possibly also related... I noticed:```after many reloads...

cp mem free 1994912
idf total mem 157296
idf mem free 95760
idf largest block 65596

after a fresh power cycle...

cp mem free 1994912
idf total mem 157296
idf mem free 98964
idf largest block 98592```Not sure if there's any user code action to clean up IDF mem

slender iron
#

that's pretty close overall

#

totally possible the sockets leak something

manic glacierBOT
#

I opened this after a brief discussion with @brentru about the Azure Iot Library supporting X509 based identification. It was Brent's suggestion that this would more likely be a CP library specific to the esp32s2 port than in the Azure IoT Library itself.

For additional context Azure IoT Device Provisioning Services(DPS) allows you to ship devices with Keys which are then used as Device IDs. Based on these Device IDs, DPS gives the device its name and its IoT Hub to which it connects and a...

crimson ferry
#

largest block down 1/3

slender iron
#

or there is a fixed overhead of having wifi on

crimson ferry
#

hm, will test that

slender iron
#

ya, fragmentation is a reality I think

crimson ferry
#

idf largest block stays constant through connect and getting new session, drops a lot after some HTTP activity

slender iron
#

https allocates some big buffers

#

not sure about http

crimson ferry
#

should we be explicitly closing?

slender iron
#

there is a lot that happens under the hood

#

you can try that but the finalizer should close when the object is cleaned up

crimson ferry
#

ok, I'll keep at it

manic glacierBOT
#

Regarding latest SPI, Is SD card supposed to work on WROVER?
I tried to mount SD card

import sdmount
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "sdmount.py", line 31, in <module>
File "adafruit_sdcard.py", line 116, in init
File "adafruit_sdcard.py", line 177, in _init_card
File "adafruit_sdcard.py", line 155, in _init_card
OSError: couldn't determine SD card version

If I remove SD card then it prints:

OSError: no SD card

slender iron
#

@crimson ferry I just pushed a new version of requests

#

I think you are hitting a bug with http that I just fixed

#

actually just pushed

#

had only committed locally

manic glacierBOT
#

Is SD card supposed to work on ESP32-S2 WROVER?
I pulled latest driver bundle and tried this example to mount
SD card:

https://github.com/emard/esp32ecp5/blob/master/circuitpython/sdmount.py

If SD card is inserted (it has FAT and old ESP32 non-S2 is able to mount),
then ESP32-S2 prints

Traceback (most recent call last):
File "", line 1, in
File "sdmount.py", line 31, in
File "adafruit_sdcard.py", line 116, in init
File "adafruit_sdcard.py", line 177, in _init_car...

crimson ferry
#

@slender iron still get ```Traceback (most recent call last):
File "code.py", line 34, in <module>
File "/lib/adafruit_requests.py", line 507, in get
File "/lib/adafruit_requests.py", line 494, in request
File "/lib/adafruit_requests.py", line 102, in init
RuntimeError: Unable to read HTTP response.

#

(only changes to code.py are import secrets (adds two lines to line #s), and credentials)

#

this is after a hard reset

slender iron
#

hrm

crimson ferry
#

I can try latest S3, but it didn't look like any relevant changes

slender iron
#

the native wifi stuff didn't change much

#

I wonder if it requires the hostname

#

and the esp32spi code requires the ip πŸ˜•

#

nope, not that

crimson ferry
#

latest S3 6.0.0-alpha.3-180-g7611e71a1 on 2020-09-11, latest Requests, Discord code.py with my credentials: same RuntimeError: Unable to read HTTP response @ line 34: requests.get("http://wifitest.adafruit...

slender iron
#

ya, the new requests doesn't work

#

looks

#

ya, I think socket recv_into isn't correct

#

0 means receive up to the size of the buffer

#

not a great api choice

pastel panther
#

@slender iron lmk when you've got a sec for an allocation q

slender iron
#

shoot

pastel panther
#

dangit πŸ€”

#

basically: how can one clear a bytearray without wasting memory

#

I've got a big buffer I make on __init__ and need to clear out chunks before use

#

this works but causes an allocation, right?

self._ole_faithful[0:20] = bytearray(20)
#

and it slices

slender iron
#

right, it'll do an allocation for the right hand side

#

a loop is probably simplest

pastel panther
#

ok, that's about where I landed

slender iron
#

you could get fancy and use a generator but I can't imagine it's faster than a loop

kind river
#

I got my simple wifi code updater working on the ESP32-S2. I'll clean it up and post it this weekend

idle wharf
#

@kind river Are you saying an over the air application code updater?

kind river
#

Yeah, it pulls files from a HTTP server on boot

manic glacierBOT
slender iron
#

@crimson ferry ☝️

idle wharf
#

@kind river I love this idea !

crimson ferry
#

@slender iron afk, will check after dinner

slender iron
#

thanks!

pastel panther
#

@slender iron how much of a hack is it to keep an empty buffer around that I copy into the one that is used, replacing the right side in the example above

kind river
manic glacierBOT
#

A singleton makes most sense to me. I suppose it's theoretical that a device could implement more than one NFC Tag, but that seems way out of scope for what CP looks to cover. I'm good with using the buffers as well for communication. Wouldn't be as "fully featured", but that's the kinda thing someone would probably be using their own stack for anyways.

For record types, I think the practical answer for now should be 5: Text, Uri, Application Launch, Connection handover [more on that much ...

idle wharf
#

@kind river very cool, i'll check it out

slender iron
#

@pastel panther is the for loop too slow?

pastel panther
#

no, just curious

#

I like the syntax better but not enough to do it just for that

slender iron
#

my guess is that it's only worth it if speed is critical

#

we usually prefer memory efficiency over performance

pastel panther
#

right

manic glacierBOT
manic glacierBOT
#

I've been slowly optimizing the nrf24l01 library, and I inadvertently already replaced the spi.readinto() calls with spi.write_readinto() calls (a while ago). Now I have a reason to expedite debugging my lite-beta branch for a new release.

@hierophect I don't own a STM32F405 Feather, so I'm depending on @water5 to test my changes on that board. Initial tests of my changes work well with the nRF24L01 transceiver, althou...

manic glacierBOT
analog bridge
#

@slender iron your online time blinkacomputer seems to coincide with my sleep time 😴 so can only have discussion during early morning or late night

#

that said should I mark the safe mode PR ready for review or also add the soft reboot approach ?

slender iron
#

@analog bridge mark it ready. If you ever want to plan a time to chat I’m happy to. I’m in seattle so pacific time

idle spindle
#

quick q.

#

if I had two versions of python on my laptop would that screw with things?

manic glacierBOT
manic glacierBOT
lone axle
#

@idle spindle It could. It just depends what else is going on within the system and what things are relying on python. Look up Python "Virtual Environments" to find one tool that is designed to solve that particular problem of using multiple versions of python within the same computer.

manic glacierBOT
manic glacierBOT
#

Current Status:

  • soft reboot approach is not yet implemented,
    some core functions need to be updated before it can be properly implemented.

What changed:
(since last review)

  • A fall-through reason was added in case BOARD_USER_SAFE_MODE_ACTION is not defined in the board specific config file.
  • There was a text formatting issue which I traced back to serial_write("\n") , it advances a line but doesn't set the cursor to the beginning of the next line. Fixed.
    _Th...
manic glacierBOT
marble hornet
#

what version of the gcc-arm compiler is suggested for building circuitpython and the related bootloaders?

manic glacierBOT
#

Massive savings. Thanks so much @ciscorn for providing the initial code for choosing the dictionary.

This adds a bit of time to the build, both to find the dictionarybut also because (for reasons I don't fully understand), the binary search in the compress() function no longer worked and had to be replaced with a linear search.

I think this is because the intended invariant is that for codebook entries that encode to the same number of bits, the entries are ordered in ascending value. ...

lone axle
#

@marble hornet I am not 100% certain but I think that 9-2019-q4-major version is still the suggested version (it's what is listed in the building CP guide). But I believe there has been some folks recently (Scott maybe?) that started using version 10 something.

solar whale
#

There are still some issues with gcc 10

lone axle
#

iirc he switched to a version of Arch linux or something where gcc 10 was the one available by default

solar whale
#

at least for SAMD51 builds

marble hornet
#

thank you! I'm hunting down an issue in build the nrf bootloader and wanted to make sure it wasn't my installation of gcc

#

if either of you are near a terminal could I please ask for a small favor?

lone axle
#

I am and yes

marble hornet
#

can you run

echo $GIT_VERSION
#

please

#

and post what you get

#

i've been getting an empty variable:

jonahym@Jonahs-MacBook-Pro Adafruit_nRF52_Bootloader % echo $GIT_VERSION

jonahym@Jonahs-MacBook-Pro Adafruit_nRF52_Bootloader %
lone axle
#

printed nothing for me:

~/circuitpython_me_edited$ echo $GIT_VERSION

~/circuitpython_me_edited$
marble hornet
lone axle
#
~/circuitpython_me_edited$ git --version
git version 2.20.1
#

I haven't. I don't think I've built any of the bootloaders

marble hornet
#

thank you, one last question. are you on a mac or gnu+linux box? (i presume that terminal is not windows)

onyx hinge
#

a specifc version of gcc is installed using a tool I'm not familiar with, xpm xpm install --global @xpack-dev-tools/arm-none-eabi-gcc@9.3.1-1.1.1

#

xpm seems to be a package manager in javascript for managing non-javascript packages.

lone axle
#

I ran it on a debian VM that is running in virtual box on Win7

onyx hinge
#

I find it's always helpful to refer to the CI scripts to determine exactly what is "correct", rather than relying on crowd wisdom. Also remember to check out the files in the specific branch you're building; it could be different for 5.3 vs main, for example

#

except for the build that creates the mac static version of mpy-cross, it's a safe base assumption that the canonical environment for building circuitpython or the bootloaders is a linux system, probably an ubuntu lts system 14.04, 16.04, or 20.04. Again, checking the CI scripts is going to get you the truth of the matter.

#

as for the compiler for the nrf bootloader, looks like they have bins for darwin (mac), linux, and windows (says win32 but who does win32 these days? surely it's 64 bit software inside)

marble hornet
#

thank you, i'm running on a but of an outdated compiler but i think the issue is related to something else.

onyx hinge
#

when I built an nrf bootloader locally recently, it didn't work. I am pretty sure the code was just too big for the segment of flash dedicated to it

#

when I downloaded a prefab one it was fine

marble hornet
#

I've been having trouble getting it to build. the nrf build scripts require a environment variable 'GIT_VERSION' but mine is an empty-string when it seems lie it should be a dot separated number. and google doesn't seem to have many answers about GIT_VERSION. may i ask what your echo $GIT_VERSION prints?

onyx hinge
#

nothing.

marble hornet
#

"string" and "number" used loosely, it is bash

#

but yours builds?

onyx hinge
#

Makefile:GIT_VERSION = $(shell git describe --dirty --always --tags) In the context of the build, GIT_VERSION will be assigned a value by running 'git describe'. This assumes the build is taking place in a tree that is managed by git, not e.g., by a source code zip from a release on github

#

however, GIT_VERSION would not be set just in a regular shell/terminal session

marble hornet
#

Ah, the version I downloaded is different. Give me one mo to find it

onyx hinge
marble hornet
#

GIT_VERSION != git describe --dirty --always --tags

lone axle
#

Does anyone know where to find or have a copy available of the pre-loaded "demo" script that comes on the Circuit Playground Bluefruit? Often times I find them in the downloads section of the primary product guide. But not seeing it listed for that device.

marble hornet
#

on line 25 of the MAKEFILE

solar whale
#

@marble hornet I was just able to build the feather-nrf52840_express bootlaoder

onyx hinge
#
I:  During build, GIT_VERSION set to 0.2.11-9-g661827c-dirty
I:  During build, GIT_SUBMODULE_VERSIONS set to lib/nrfx (v1.1.0-1-g096e770) lib/tinyusb (0.5.0~48)
``` after changing the build process to print the information: ```diff --git a/Makefile b/Makefile
index 55082e4..d198eba 100644
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,9 @@ LD_FILE      = $(SRC_PATH)/linker/$(SD_NAME)_v$(word 1, $(subst ., ,$(SD_VERSION
 MERGED_FNAME = $(OUTPUT_FILENAME)_$(SD_NAME)_$(SD_VERSION)
 
 GIT_VERSION = $(shell git describe --dirty --always --tags)
+$(info I:  During build, GIT_VERSION set to $(GIT_VERSION))
 GIT_SUBMODULE_VERSIONS = $(shell git submodule status | cut -d' ' -f3,4 | paste -s -d" " -)
+$(info I:  During build, GIT_SUBMODULE_VERSIONS set to $(GIT_SUBMODULE_VERSIONS))
 
 OUTPUT_FILENAME = $(BOARD)_bootloader-$(GIT_VERSION)
 
#

I don't know if the resulting bootloader files work, but I also don't have the same gcc that the CI process uses.

#

29044 348 22258 51650 c9c2 _build-feather_nrf52840_express/feather_nrf52840_express_bootloader-0.2.11-9-g661827c-dirty-nosd.out

marble hornet
#

@solar whale what branch? and when did you clone it?

solar whale
#

I am using Linux Ubunto 20.04

#

just did a fresh pull

#

master branch

marble hornet
#

and i'll try changing that line to what you have , jeff

solar whale
#

I did not have to make any changes

marble hornet
#

ah it's working. and i;m on macos 10.15.6 (19G2021)

solar whale
#

ah -- same issue on Mac

onyx hinge
#

I think you want to invoke make with something like: make BOARD=feather_nrf52840_express genhex genpkg one or both depending which kind of file you want (hex or zip)

marble hornet
#

agreed, it may be a mac thing. since changing line 25 works with the assignment being = $(shell <...>) and not != <...>

#

what version of make do you have installed? i have GNU Make 3.81

solar whale
#

same on MAc -- on Linux it is 4.2.1

onyx hinge
#

disregard what I said about genhex/genpkg

solar whale
#

@lone axle do you want the as-shipped .uf2? I have that

lone axle
#

yeah that would be great

#

I am trying to record a video of the "out of box" setup process. but mine already has Circuit Python loaded

marble hornet
#

@solar whale if you change line 25 to GIT_VERSION = $(shell git describe --dirty --always --tags) does your macos build work?

solar whale
#

be just a few minutes

onyx hinge
#

ah you weren't making some kind of typo when you said !=. ``` For the shell assignment operator, '!=', the right-hand side is
evaluated immediately and handed to the shell. The result is stored in
the variable named on the left, and that variable becomes a simple
variable (and will thus be re-evaluated on each reference).

#

"!=" was added in GNU make 4.0, released in 2013.

solar whale
onyx hinge
#

Because Apple chooses not to include software licensed as GPLv3 in the base systems, they use very old versions of a lot of GNU tools. You may be able to get newer versions with brew, but that's speculation, as I have never owened/used a mac

lone axle
#

Thank you! @solar whale

solar whale
#

@marble hornet it fails at ```LD feather_nrf52840_express_bootloader-0.3.2-165-g35e8ad9-dirty.out
text data bss dec hex filename
31356 1572 22618 55546 d8fa _build/build-feather_nrf52840_express/feather_nrf52840_express_bootloader-0.3.2-165-g35e8ad9-dirty.out
Create feather_nrf52840_express_bootloader-0.3.2-165-g35e8ad9-dirty.hex
Create feather_nrf52840_express_bootloader-0.3.2-165-g35e8ad9-dirty-nosd.hex
Traceback (most recent call last):
File "tools/hexmerge.py", line 178, in <module>
sys.exit(main())
File "tools/hexmerge.py", line 139, in main
import intelhex
ModuleNotFoundError: No module named 'intelhex'
make: *** [_build/build-feather_nrf52840_express/feather_nrf52840_express_bootloader-0.3.2-165-g35e8ad9-dirty-nosd.hex] Error 1
[Jerry-desktop-mini:~/projects/adafruit_github/Adafruit_nRF52_Bootloader] jerryneedell%

#

I have not built built it before on my MAc so may be missing something

onyx hinge
#

python3 -mpip install intelhex

#

or whatever general incantation you use to install python packages

#
.github/workflows/githubci.yml:        pip3 install adafruit-nrfutil uritemplate requests intelhex
thorny jay
#

I wanted to use Debouncer library on the Touchio interface from a PyRuler.
I was lost between a guide saying it is easy but not giving an example ( https://learn.adafruit.com/debouncer-library-python-circuitpython-buttons-sensors/advanced-debouncing ) and a Pull request that seems to make the guide obsolete ( https://github.com/adafruit/Adafruit_CircuitPython_Debouncer/pull/8 ).
So after abandonning my unecessary fight to use lambda function, I was hitting an error:
'''
File "adafruit_debouncer.py", line 112, in update
NotImplementedError: No long integer support
'''

That line 112 problem is not due to my code... but this line:
now_ticks = MONOTONIC_TICKS()

My current believe is that long integer has been removed to save space on M0, but it has impact on the use of time.monotonic_ns (or time.monotonic).

Any hint on where the problem is? Should Debouncer library be fixed?
Starting from what version did I loose long integer?

Adafruit Learning System

Debounce All the Things!

solar whale
#

πŸ‘ also need adafruti-nrfutil --- works now!

marble hornet
#

thank you

thorny jay
marble hornet
#

I'll put it in the running issue for this build problem.

onyx hinge
marble hornet
#

and my I call you the names in your usernames? ie do you mind 'Jeff' and 'Jerry' respectively?

onyx hinge
#

If you're writing on github then I am @jepler

solar whale
#

Not at all! What would you prefer to be called?

#

on github, I am "jerryneedell"

#

but I respond to most anything πŸ˜‰

onyx hinge
#

with respect to timekeeping, competing factors put us in a bind. monotonic_ns is untenable without long int because it overflows within seconds of boot without long ints, montonic returns floats which have precision limitations, and nothing else is compatible with the dekstop Python3 standard library.

#

(but yeah you can call me Jeff anytime)

#

something like microcontroller.monotonic_ms_wrapped() which is always modulo sys.maxsize should be possible on any platform but it would not be standard. (I think it wraps about every 12.4 days) It might be time to make the case for it, now that we have seen the pain that comes from the currnetly available APIs

marble hornet
#

Thank you Jeff and Jerry for all the help and time, it is really appreciated.
I'm @marble hornet on most platforms (- or _ depending)
but I'm usually called Jonah, I will respond to either

onyx hinge
#

(also the value for monotonic_ms_wrapped should start about 30s from its first overflow so that people write their code in a way that works right when wraps actually do occur πŸ‘Ή )