#circuitpython-dev

1 messages · Page 308 of 1

timber mango
#

OK, got them! Is that where I should put my new board chip file?

gilded cradle
#

yeah

timber mango
#

I think the learn guide needs a little updating then. 😉

gilded cradle
#

I'm not seeing where it shows the wrong folder. It says to look in src/adafruit_blinka/microcontroller rather than src/microcontroller.

timber mango
#

Hmmmm, I do not know where I got the other path from then. Anyway, it does not matter now that I have the correct path. 🙂

gilded cradle
#

🙂

charred flare
#

Am I correct in that there isn't a board with built in wifi that is 'built for circuitpython'?

gilded cradle
#

@charred flare, look for the airlift boards if you want to use WiFi.

charred flare
#

Yeah I have one of those now. Just checking to make sure there wasn't an all-in-one board that I missed. 🙂

gilded cradle
#

Ah, ok. Yeah, the Metro M4 Airlift is probably the closest thing though the Particle boards may also be capable.

charred flare
#

Thanks. Yeah it's not a big deal, I can keep using the airlift stuff.

Now on to the more complicated question. Has anyone tried to connect several boards together over SPI or I2C or something to create a "multithreaded" device? I've got some things I don't want to pause while other things like getting data over wifi are working.

timber mango
#

@charred flare Ah, do you want to have other micro boards be slaves to a single master?

charred flare
#

Yeah

raven canopy
charred flare
#

I read only the pyboard can use that, currently? or was that an old article?

raven canopy
#

according to the support matrix, 31 boards have the module available.

charred flare
#

Eek, maybe that was an old article then, lol

raven canopy
#

well, i don't have empirical evidence that it works. just that the package is available. 😄

timber mango
#

@gilded cradle Quoted from the add board file section of the learn guide - "The board file is much easier than the chip file. It basically involves loading the chip file and just mapping the chip pins to the physical pins on the board." I thought the chip file already did that.

gilded cradle
#

It's kind of a pass through really. You define your pins in the chip/pins file and then the board files just defines what pins are available for that board. For instance, if you had an old raspberry pi with 26 pins, then it would have fewer than one with 40 pins even though they use the same chip file.

timber mango
#

@charred flare Basically, you have to initialize the slave micro as an I2C slave, and give it an address. Then, you can do whatever you want to do with it. 😉

charred flare
#

@raven canopy Sadly neither my nRF52840 or the little Trinkets I wanted to do the secondary tasks seem to support it. :-/

I'm thinking that since all the secondary tasks are "canned" and won't change, maybe I can use normal digital I/0 as sort of binary code as to what I want it to do.

If D5 = high and D6 =low - do this, etc. Hmm.

raven canopy
#

😦

timber mango
#

@raven canopy The underlying micro chip should be able to support either I2C master or I2C slave. I guess I will have to look at the datasheets to find out for sure.

charred flare
#

Yeah I'm like 2 weeks into teaching myself CP so that much goes over my head for now, lol

timber mango
#

@gilded cradle Oh, OK. For a moment there, I thought I was confused. 😉

#

The src/adafruit_blinka/microcontroller dir should have been named "chip."

raven canopy
#

i suspect the decision was to mimic the original semantics as a MicroPython compat layer, and keep the shared code agnostic.

timber mango
#

Ahhhh, got it.

#

@gilded cradle If I do something like D4 = KSI2 in the board file (KSI2 = Pin(17) in the chip file) would that allow that pin to be accessed as D4 from Circuitpython/Blinka?

gilded cradle
#

yes

timber mango
#

Cool! 😉

gilded cradle
#

I think it's more like D4 = pin.KS12 though

timber mango
#

Well, you got what I am going for. 😉

gilded cradle
#

Nice

timber mango
#

Doing this will require a bit more work by me, but I think it is well worth the effort.

gilded cradle
#

Yeah

manic glacierBOT
#

The SPI bus can certainly handle it, and the Feather M4 has native support for multiple displays if you're using the Adruino env. I'd just prefer to use the CP environment. Maybe there is an issue for the kind of system/debug info that CP will render on the display if the there is ambiguity about which one to use, not sure. I can recompile if that's all it takes -- just hoping I can use 4 displays on the m4 hardware spi bus.

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
half geyser
#

@slender iron ping

slender iron
#

Just sat down for dinner. How’s your schedule look the next four hours?

half geyser
#

I'll be sitting right here. Though lunch may arrive at some point. Enjoy dinner.

manic glacierBOT
slender iron
#

@half geyser you around?

half geyser
#

@slender iron yep

manic glacierBOT
lone sandalBOT
manic glacierBOT
#

This patchset got big. But it was refactored twice. It contains the following features:

  • The watchdog is a singleton under microcontroller
  • Setting microcontroller.watchdog.mode = watchdog.WatchDogMode.RAISE works
  • If watchdog.WatchDogMode.RESET causes a reset, and the board is plugged in to USB, then it enters safe mode
  • When the watchdog timer hits, it calls reset_cpu()
  • Calling microcontroller.reset() now goes through reset_cpu()
  • The number of system ticks is sa...
half geyser
#

Yay! With that patch, nrf now [mostly] keeps its clock across resets.

solar whale
#

woohoo! ```Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.4.0-beta.0-291-geea01c32b-dirty on 2020-05-22; Saola 1 w/Wrover with ESP32S2

help('modules')
main digitalio micropython supervisor
array gc os sys
board io random time
builtins math storage usb_hid
collections microcontroller struct usb_midi
Plus any modules on the filesystem

half geyser
#

@solar whale Congratulations!

#

@tulip sleet I spoke with @slender iron yesterday, and he mentioned you might be able to help to merge the watchdog stuff. The only platforms that are failing are pca10100 (which is overflowing flash), and xtensa (which isn't building at all for some reason?). Should I just disable it for pca10100, or adjust the flash size?

manic glacierBOT
tulip sleet
#

@half geyser I'll take a look!

manic glacierBOT
#

This is a strong start, thank you! I did turn up a problem in my testing. If you get stuck trying to rectify it, please let me know and I can dig into it too!

I created a program which compares the behavior of slicing lists to the behavior of slicing pixelbufs. For lists of length 1 to 4, starts and ends from -len to +len inclusive, and strides of -3, -2, -1, 1, 2, and 3, the results of slicing pixelbufs match the results of slicing lists.

import _pixelbuf

for num in range(1,...
solar whale
#

Should I open an issue for this on an esp32s2 -- or is it just not expected to work at this time ... after flashing, it boots -- I see CIRCUITPY and REPL works, but if I try ls /media/jeerry/CIRCUITPY`` it gets very upset jerryneedell@solar whaleeedell-ubuntu-macmini:~$ ls /media/jerryneedell/CIRCUITPY/
ls: cannot access '/media/jerryneedell/CIRCUITPY/    FSEV.EN~': Input/output error
ls: cannot access '/media/jerryneedell/CIRCUITPY/    '$'\001''.': No such file or directory
ls: cannot access '/media/jerryneedell/CIRCUITPY/e.DA~': Input/output error
ls: cannot access '/media/jerryneedell/CIRCUITPY/    TRAS.HE~': Input/output error
ls: cannot access '/media/jerryneedell/CIRCUITPY/äI'$'\002''.Be': Input/output error
ls: cannot access '/media/jerryneedell/CIRCUITPY/äI.A.': No such file or directory
ls: cannot access '/media/jerryneedell/CIRCUITPY/  .TRA': Input/output error
ls: cannot access '/media/jerryneedell/CIRCUITPY/äi'$'\003''.boo': Input/output error
''$'\001' '    '$'\001''.' äI.äI boot_out.txt 'EN~1 '$'\020' n.MET
''$'\b' 'ä-²?.'$'\001' äI.äI ''$'\001''.cir'     FSEV.EN~   .TRA
''$'\030' a.e 'äI'$'\002''.Be' DA~1 HE~1     TRAS.HE~
' '$'\020' 'äI'$'\004' 'äi'$'\003''.boo' e.   lib 'TXT '$'\030''.äI'
' '$'\020\b' äI.A. äI.LIB e.   'l-ⁿ?.'$'\001' 'UITPY '$'\b'
'[' 'äi.äi'$'\004' a.n e.DA~ n 'Y '$'\b'
jerryneedell@solar whaleeedell-ubuntu-macmini:~$

#

dmesg shows ```[273479.668050] sd 7:0:0:0: [sdc] 4097 512-byte logical blocks: (2.10 MB/2.00 MiB)
[273479.697795] sd 7:0:0:0: [sdc] Write Protect is off
[273479.697802] sd 7:0:0:0: [sdc] Mode Sense: 03 00 00 00
[273479.727778] sd 7:0:0:0: [sdc] No Caching mode page found
[273479.727789] sd 7:0:0:0: [sdc] Assuming drive cache: write through
[273479.947858] sdc: sdc1
[273480.117956] sd 7:0:0:0: [sdc] Attached SCSI removable disk
[273483.087851] FAT-fs (sdc1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[273483.367782] FAT-fs (sdc1): error, corrupted directory (invalid entries)
[273483.367788] FAT-fs (sdc1): Filesystem has been set read-only
[273483.368366] FAT-fs (sdc1): error, fat_get_cluster: invalid cluster chain (i_pos 0)
[273486.459292] FAT-fs (sdc1): error, fat_get_cluster: invalid cluster chain (i_pos 0)
[273486.460088] FAT-fs (sdc1): error, fat_get_cluster: invalid cluster chain (i_pos 0)
[273486.460179] FAT-fs (sdc1): error, fat_get_cluster: invalid cluster chain (i_pos 0)
[273486.460318] FAT-fs (sdc1): error, fat_get_cluster: invalid cluster chain (i_pos 0)
[273486.460542] FAT-fs (sdc1): error, corrupted directory (invalid entries)
[273486.460677] FAT-fs (sdc1): error, corrupted directory (invalid entries)
jerryneedell@jerryneedell-ubuntu-macmini:~$ ls /media/jerryneedell/CIRCUITPY/

onyx hinge
#

@solar whale does formatting the filesystem from within circuitpython fix it? I don't know whether @slender iron wants bugs about esp32s2 filed yet or not, since it's so early. I personally favor bug filing though

solar whale
#

it looks OK from REPL ```uto-reload is on. Simply save files over USB to run them or enter REPL to disable.

Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.4.0-beta.0-291-geea01c32b-dirty on 2020-05-22; Saola 1 w/Wrover with ESP32S2

import os
os.listdir()
['.fseventsd', '.metadata_never_index', '.Trashes', 'lib', 'boot_out.txt']

onyx hinge
#

oh interesting

solar whale
#

thid is on Linux -- I think he uses Mac so may be related -- I'll wait on issue.

onyx hinge
#

Either way I bet you won't be the only one to encounter this

orchid basinBOT
#

Hi, could you limit the features to those in this guide?
https://learn.adafruit.com/how-to-add-a-new-board-to-the-circuitpython-org-website/adding-to-downloads? The list should only be limited to these 10 items and spelled exactly the same:

  • Speaker
  • Solder-Free Alligator Clip
  • Feather-Compatible
  • Battery Charging
  • Display
  • Wi-Fi
  • Bluetooth/BTLE
  • Robotics
  • LoRa/Radio
  • GPS

So for instance BlueTooth 5 (nRF52840) whould be changed to Bluetooth/BTLE and thing like `D...

manic glacierBOT
orchid basinBOT
solar whale
#

@slender iron as noted a few posts above, I am having issues with esp32s2 CIRCUITPY drive on my Linux box. Do you want Issues filed or is it not expected to be working yet?

onyx hinge
#

While tannewt's circle is green, I think he was planning a 4-day weekend...

solar whale
#

ah -- thanks -- I'll do some more testing and file an issue if I can't resolve it.

#

hmm -- it shows up fine on my Mac --- I'll file an issue after some more testing.

old smelt
#

Hi @gilded cradle - still learning the details of this process. So, if I remove that line from the .md file, then I can just push to my branch again? Is that right?

gilded cradle
#

yes and it will update the PR

old smelt
#

Sweet. Ok. I have a slightly cleaner set of images, too. Might as well update those at the same time.

gilded cradle
#

yeah

#

Can they be sized so they are a 13:10 ratio like the other images while you're at it?

old smelt
#

Sure.

gilded cradle
#

Thanks, that would be awesome

manic glacierBOT
#

Feel free to close if it is too early for issues on this - I just wanted to give you a heads up.

Using Ubuntu 20.04 -- when I plug in the esp32s2 its boots and CIRCUITPY mounts -- REPL works

But if I try to access the CIRCUTPY drive -- Linux cannot read it.

it gets very upset ``` jerryneedell@jerryn#2399eedell-ubuntu-macmini:~$ ls /media/jerryneedell/CIRCUITPY/
ls: cannot access '/media/jerryneedell/CIRCUITPY/    FSEV.EN~': Input/output error
ls: cannot access '/media/jerrynee...
old smelt
#

@gilded cradle - just to be clear, remove this line, right? +download_instructions: "BLINKA ONLY - url"

gilded cradle
#

Yeah @old smelt . You can remove the comments right below it too.

manic glacierBOT
old smelt
#

Ah yes, the comments even instructed me to do so.

#

Sorry...

#

Done

old smelt
#

Thank you!

gilded cradle
#

It takes several minutes for the site to be regenerated, but it's merged in now. Thanks

old smelt
#

Cool. This has been a great exercise. Thanks for your help.

#

Easier caught than taught, as they say.

gilded cradle
#

You're welcome. Thanks for submitting a PR and making the requested changes right away.

old smelt
#

My pleasure

#

What's the tech behind the CP.org site?

gilded cradle
#

It's hosted on github pages and runs with jekyll and uses JavaScript for a lot of the magic.

old smelt
#

Ah, yes. I have seen some of those words before. 🙂

gilded cradle
#

🙂

#

I've only used jekyll for cp.org, but I can get around in it well enough.

solar whale
#

magic describes it pretty well 😉

manic glacierBOT
manic glacierBOT
timber mango
#

@gilded cradle How do I get to the code in your PR without merging it? I am new to this.

gilded cradle
#

You may want to create a branch off your repo first

old smelt
#

That guide is outstanding. Just ran through it twice to do PR's. Kudos to @idle owl.

timber mango
#

@gilded cradle I may not get to this today. I am having some trouble with my left eye. I will figure this out as soon as I can.

gilded cradle
#

No worries @timber mango.

idle owl
#

@old smelt Thanks! Glad to hear it.

manic glacierBOT
#

To get pca10100 to build (it's overflowing), change the options list in mpconfigboard.mk to this:

CIRCUITPY_AUDIOMP3 = 0
CIRCUITPY_BITBANGIO = 0
CIRCUITPY_BUSIO = 1
CIRCUITPY_COUNTIO = 0
CIRCUITPY_DISPLAYIO = 0
CIRCUITPY_FRAMEBUFFERIO = 0
CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_I2CSLAVE = 0
CIRCUITPY_NEOPIXEL_WRITE = 0
CIRCUITPY_NVM = 0
CIRCUITPY_PIXELBUF  = 0
CIRCUITPY_RGBMATRIX = 0
CIRCUITPY_ROTARYIO = 0
CIRCUITPY_RTC = 1
CIRCUITPY_TOUCHIO = 0
CIRCUITPY_ULAB = 0

SUPERO...
manic glacierBOT
topaz quest
manic glacierBOT
manic glacierBOT
orchid basinBOT
manic glacierBOT
timber mango
#

@gilded cradle Is it possible to merge a remote branch into a specific local branch? I would like to merge your branch udoo_bolt into my local branch add_udoo_bolt_detect.

gilded cradle
#

Ok, it automatically updated the PR. After it passes, I'll merge. Thanks

manic glacierBOT
timber mango
#

OK, it is merged. Now you can do your stuff. 🙂

gilded cradle
#

Yep, thanks

timber mango
#

I have a decent start on the changes to Adafruit_Blinka, but can not seem to find information on the GPIOs. I have both I2C and the single SPI port.

gilded cradle
#

Awesome

timber mango
#

Should I try going with what I have so I can see if I am on the right track?

gilded cradle
#

I have been working on displayio for Blinka. Here it is running an existing example script.

timber mango
#

Nice!

gilded cradle
#

Thanks

manic glacierBOT
timber mango
#

I have progress. I can import busio, but it does not find board.

gilded cradle
timber mango
#

Ooooops! I did not finish the tutorial!

onyx hinge
#

@gilded cradle are there supposed to be snowflakes or are there still some bugs to chase?

#

(either way excellent progress wow)

manic glacierBOT
gilded cradle
#

@onyx hinge still bugs to chase. It's an off by one issue.

onyx hinge
#

you'll get there

gilded cradle
#

Earlier today all the letters were stacked on top of each other

manic glacierBOT
#

As noted by @dhalbert in https://github.com/adafruit/circuitpython/pull/2933#issuecomment-632859678, the new nRF52833 part does not suffer from the same DMA bug that requires the nRF52840 port to dedicate 8 kB of RAM to SPIM3.

Currently, the one nRF52833 port (Simmel) disables SPIM3, which means it does not have access to the sole fast SPI bus in the system.

The SPIM3 DMA workaround should be special-cased so that it does not get enabled on parts that are not nRF52840.

manic glacierBOT
manic glacierBOT
timber mango
#

@gilded cradle <ping>

#

@gilded cradle I have no libgpiod library and there seems to be something wrong with my gpiod library. I think this is almost working.

manic glacierBOT
#

Very interesting --

If I flash the board with CP on the linux box - I am not able to access the CIRCUITPY drive as above BUT if I then plug it into my Mac I can access it fine and then if I go back to the Linux box it also works normally - I can read/write to the CIRCUITPY drive.

summary
flash CP to board on linux -- CIRCUITPY not readable
plug into Mac -- CIRCUITPY OK
plug back into Line -- CIRCUITPY OK

onyx hinge
#

It seems that Github doesn't provide any interface for manually managing the "cache". This is a problem, because something is wrong in the cache, and all our builds are failing.

manic glacierBOT
#

We were seeing actions failures where the cache would be restored
"successfully" but then "Install CircuitPython deps" would fail:

# Step "Fetch IDF tool cache"
Cache Size: ~247 MB (259277989 B)
/bin/tar -xz -f /home/runner/work/_temp/a990f24d-c365-4685-b739-10e052812c81/cache.tgz -C /home/runner/work/circuitpython/circuitpython/.idf_tools
Cache restored from key: Linux-idf-tools-731ed12bcdfbfa8b5dd37e03703992271b3ce85dd629e45130f80f43b84ce3a8
...
# Step "Inst...
manic glacierBOT
#

hmm -- a bit more information - Once the File system has been "fixed" by plugging it into the Mac, I am able to refresh CP to the board and the FS (CIRCUITPY) is still accessible on the Linux (and a Raspberry Pi) however, if i erase the flash then refash CP, it is back to the bad state that cannot be accessed on the Linux box (or raspberry Pi) but can be "fixed" but plugging it into the Mac.

I hope that makes sense...

I think this makes some sense since if I recall correctly flashing C...

timber mango
#

I should have read the title of the issue more closely. 😉

manic glacierBOT
#

@tannewt this build fails on several resource-constained builds, such as pyruler, because the added translations cause us to overflow flash.

Build pyruler for de_DE took 10.34s and failed
make: Entering directory '/home/runner/work/circuitpython/circuitpython/ports/atmel-samd'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.

188360 bytes used, -200 bytes free in flash firmware space out of 188160 bytes (183.75kB).
8980 bytes ...
crimson ferry
manic glacierBOT
#

We have several translations which only fit on resource-constrained boards due to being incomplete. With contributions on weblate, some builds no longer fit.

Rather than rendering ourselves unable to accept updated weblate translations, this change allows specific boards to be switched to monolingual. It also adds the boards which are failing in the latest
weblate PR due to space to the list. (#2942)

charred flare
#

Hey, quick question. I bought a raspberry pi to play around with multiple threads and use blinka to do the circuitpyhon-y stuff. That's doable, right? I'm not limited to what's in the blinka library but can use all the normal python functions, etc?

tidal kiln
#

yep. when you use blinka, you're running normal python.

#

blinka is like a shim that let's you use CircuitPython libraries on platforms that aren't running the CircuitPython firmware

#

so you could, for example, use Blinka to get data from a sensor and then use that data in SciPy, etc.

kind river
crimson ferry
#

@kind river Cool, thanks!

charred flare
#

Thanks @tidal kiln I thought about that only after I bought a Pi Zero W, lol.

Which makes me wonder, aside from native battery support, what then are the differences between the Pi boards and the microcontroller boards that run CP/Arduino? I guess what are the downsides of just using Pi's? Faster clock speeds, storage space, ample I/O, etc. (not counting specialized boards with unique sensors/coms)

topaz quest
#

attack surface? — a Pi has to have a whole operating system behind it, it gets "interesting" fast if too much stuff is running behind the scenes

charred flare
#

That makes sense. Hmm. Well I guess I'll find out! lol

crimson ferry
#

@kind river Does Failed to autodetect chip type ring a bell? I thought esptool 2.8 would fix that

#

espfuse works fine

kind river
#

I used --chip esp32s2

crimson ferry
#

weird, even with esptool.py v2.8, I get esptool: error: argument --chip/-c: invalid choice: 'esp32s2' (choose from 'auto', 'esp8266', 'esp32')

kind river
#

You need a newer version then. I used the most recent one from github

#

It was version v3.0

manic glacierBOT
tidal kiln
#

@charred flare trade off is mainly with general complexity. with a pi, you have a full linux computer to bring up, maintain, etc. that's a lot to take on for someone who's just beginning and wants to blink an LED. with MCU's running CP, it's much more just plug and play. no need to worry about network configuration, SSHing, tweaking HDMI output....

charred flare
#

Yeah that's all true. I suppose I'll find out. I'm wanting to do more complex lighting effects than the micros can handle, I'm finding. I'm hoping the faster clock speed and multithreading will let me get there. I'm mostly just poking around and learning what I can for the time being. 🙂

manic glacierBOT
#

I posted about this here CircuitPython program prevents drive from mounting and mentioned on discord, but am not sure that the right developers have seen it.

Warning- before anyone tries this please make sure that you have a backup of your CIRCUITPY drive, and you know how to run a flash eraser specific to your CircuitPython board. e.g. https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51/troubleshooting

I am usi...

tidal kiln
#

if you're comfortable using a pi, then totally fine to use

#

there are a couple of other use cases, like neopixels, that end up being trickier on a Pi.

crimson ferry
#

Oh, I found it, duh it's Python so easy peasy 🙂

charred flare
#

@tidal kiln I'm not comfortable with using a Pi - I've never used one, lol. (but I never used CP/Python up until a couple weeks ago) I hope neopixels aren't tricker! That's what I need, lol. Why do you say that?

tidal kiln
#

neopixels have a very tight timing requirement on their data stream

#

for a Pi, that's tricky, since it's running a full OS

#

for an MCU, that's pretty easy, since it just does the one thing

charred flare
#

Oh right, I do recall reading something about that

tidal kiln
charred flare
#

Hmm. I wonder how to best go about both driving neos AND doing other work in the background

#

Thanks, I'll read through that

timber mango
#

@charred flare Run a Raspberry Pi and use a Circuitpython board as a slave to it. 🙂

tidal kiln
#

yep. also checkout fadecandy.

charred flare
#

I was just thinking about that but how do I not have to pause what I'm doing while I give it new instructions?

And the slightly bigger technical issue I'm running into is driving two strings with the same micro. I have to do one iteration on one and then one iteration on the other, etc.

#

I've never heard of fadecandy! I need to read more about it.

manic glacierBOT
#

Try doing a slow double-click. There is a 700ms interval when the on-board DotStar is yellow. If you click during that time, CircuitPython will restart in safe mode and will not run code.py. 700ms is too short for you to see it and react in time, but try a slow double-click and you may hit it.

Of course, we need to figure out what's wrong here in any case.

topaz quest
#

To @timber mango's point — I'm seriously considering using my Feather M4 as a usb slave for a NUC, simply because the two things I need (simple IR command executor; web app) are different types of load altogether…

simple pulsar
#

@onyx hinge You can ask GitHub for new features as you may already know. There's a random guy who tracks them in public too. For a different matter, I put one into his repo with GH's ticket number for public tracking/comment. https://github.com/isaacs/github/issues/1683 Tactics may be different for paying customers.

crimson ferry
#

Is there a trick to get CP running on the ESP32-S2? Flashing seems to go fine (first file), and when I connect a screen and hit RST, I get seemingly good boot output (second file). But no REPL or CIRCUITPY. Same behavior WROVER and WROOM (different .bins). Latest macOS.

manic glacierBOT
#

Hello! Many people call exit() or quit() at the regular Python prompt rather than Ctrl-D or other key combos on other operating systems. The CircuitPython REPL (as seen from the Mu editor) doesn’t have exit or quit. (I also tried import site to have them added but could not import.)

IMO it is easier to document calling a function than a shortcut that may be unfamiliar, changes between platforms (I think macs don’t have Ctrl), can be confused with Ctrl-C or Ctrl-Z.

(Redirected he...

kind river
#

@crimson ferry The built in USB on the dev boards is via a USB serial chip. The native USB is on pins 19(D-) and 20(D+).

manic glacierBOT
crimson ferry
#

@kind river Boom, in business, thank you!

kind river
#

You're welcome, I'm also currently playing with my ESP32-S2

solar whale
#

@kind river or @crimson ferry are you using Linux? I have run into an issue with the esp32s2 file system on Linux.

crimson ferry
#

macOS, saw your issue

idle wharf
#

@kind river What board are you using ?

crimson ferry
#

ESP32S2 gc.mem_free() shows <64k, should be much more? (something approaching 320k)

solar whale
#

same here

kind river
#

@solar whale I'm having the same issue. fsck sees a bunch of junk files/folders. Windows seems able to ignore the junk and open it correctlly, but doesn;t fix it for linux.

solar whale
#

@kind river thanks for confirming ... plugging it onto a Mac is like a magic fix 😉

kind river
#

@idle wharf I'm just using the saola dev board

idle wharf
#

I have an ESP32-S2-SAOLA-1R-ND on the way !

#

So glad to see you're having success

crimson ferry
#

I ordered mine Thursday night, didn't expect them until Tuesday, but they showed up today 🙂

idle wharf
#

Wait... I think mine did too...

#

/* runs to mailbox */

kind river
#

Yeah, Digikey shipping has been surprisingly fast for me

crimson ferry
#

Digikey was out (they're fast for me too), I got these from Mouser

idle wharf
#

Yay! It was delivered 4 days early from DigiKey... USPS for the win!

#

TinyPico (esp32) | Espressif WROVER R1 (esp32-s2) | Circuit playground bluefruit (nrf52840)

crimson ferry
#

TinyPICO is nice for small footprint. The Bitsy Add-On ESP32 can actually be used as an Arduino device too if you only need a couple of pins 😉

manic glacierBOT
manic glacierBOT
crimson ferry
#

NotImplementedError: byte code not implemented ...I suppose that's expected for a new processor family

manic glacierBOT
simple pulsar
stuck elbow
#

@simple pulsar thanks, looking

manic glacierBOT
#

@dhalbert was involved in this one but to bring things together there's a very interesting case in https://forums.adafruit.com/viewtopic.php?f=60&t=165589 of some simple, killer code. From the description and analysis so far it sounds like an atypical, very lengthy operation in the interpreter seems likely to be the cause of USB problems due to starvation. Might be worth some brainstorming to work out if there are any other things that can cause this.

crimson ferry
#

Uh-oh, is my flash damaged? Things were basically working, then the dreaded Guru Meditation Error after power cycles, reflashing.

#

Ah, erase_flash fixes it

timber mango
#

@gilded cradle Is there another version of the gpiod library that works with Blinka? The version on PyPi does not work and has no Chip attribute.

manic glacierBOT
gilded cradle
#

@timber mango look at how I did the Rock Pi S. I had the same issue and made a special sysFS gpio pin class that should work on any linux board.

#

There's no section in the guide on using it because it's pretty new though

manic glacierBOT
manic glacierBOT
manic glacierBOT
charred flare
#

Hey, @tidal kiln or anyone. Is the fadecandy board able to continue to drive neos on its own while the micro/MCU does other things? Like keep running the same loop until it is told to do otherwise? Didn't see anything in the docs that it could but would be super cool if that was the case.

manic glacierBOT
old smelt
#

@topaz quest @idle owl - Sorry I missed this on Friday. I am not familiar with that, but it's funny you mention it. Because, as I was riding my bike Friday after work, I started wondering if this exact kind of thing was possible.

manic glacierBOT
manic glacierBOT
#

The Xenon build presented a difference device which appeared as a USB Drive, which is the clue I needed to trace the issue. 100% Windows trying to be clever but failing.

I don't use a Particle Xenon as I use the NRF52_DevKit seems silly to buy another version of the same thing.

So if someone does not see a CIRCUITPY drive they need to look in Device Manager -> Disk Drives; if they do not see an Argon/Boron/Xenon drive they need to check ->Ports (COM &LPT) to see if they have A...

bleak tiger
#

Could anyone familiar with ulab and displayio offer some advice? Essentially I'd like to use some numpy code to rotate a displayio ondisk bitmap and I have a feeling there should be an easier solution to the one I have planned!

timber mango
#

@gilded cradle OK. I notice that there seems to be a Pin class in two files within generic_linux. If these are identical, would it be better to put Pin somewhere separate where it can be imported by both rather than have it in two different places?

bleak tiger
#

Ideally I'd like to load an ondisk bitmap to a numpy array, transform it, then convert it to a bmp for displayio to write to the screen

crimson ferry
#

If you flip and transpose the containing TileGrid, does the bitmap stay the same?

#

d'oh, guess so... no effect on the .bmp

unkempt pulsar
#

When working on a system which doesn't support time.monotonic_ns() is there some accepted practice to guarantee that a program can measure short 1-100 ms delays with time.monotonic() or is there an alternative? Is there some way for the program to reset the timebase at a convenient place? I looked at adafruit_hcsr04.py (ultrasonic sensor) and it doesn't do anything special. So I believe that it will fail after an extended run. With single precision floating point 1 [day] + 10 [ms] = 1 [day] if everything is expressed in seconds.

crimson ferry
#

Works for 90° increments (human error earlier), I suspect @bleak tiger you want arbitrary angles?

manic glacierBOT
timber mango
#

@gilded cradle That generic_linux.sysfs_pin.Pin works fine. Thank you for that - I will know next time if I have this problem. UDOO does have a few more boards I would like to add in time and when money permits.

manic glacierBOT
#

@TonyLHansen you can already use the "meanwhile" library (https://github.com/deshipu/meanwhile) — it implements a simple async reactor mostly compatible with how the big Python async functions work. The only downside of it is that in the absence of internal mechanisms it works by polling, but that shouldn't be a problem for things like counters.

Threads are rather hard to implement on small microcontrollers with very limited memory, and they are very counter-intuitive to program (it's very...

timber mango
#

@gilded cradle The GPIO on the UDOO Bolt seem to be made of two pins, one input and one output. I am looking closer at this now. Also, I forgot there are two versions of the UDOO Bolt and have made necessary adjustments in Platformdetect with PR #83 - tests OK for V8. They both have the same peripherals as far as I know.

simple pulsar
#

@bleak tiger If you don't need arbitrary angles you could just pre-generate different bitmaps with the angles you need?

stuck elbow
#

that's how most games did this kind of thing historically, before we had those ridiculous graphics cards with more processing power then the CPUs

crimson ferry
#

flip and transpose TileGrid is slower than precomputing, but there's probably a practical limit of open OnDiskBitmaps ...only one at a time just incurs the usual overhead

manic glacierBOT
#

Maybe it's my inexperience with this build system. Able to build for STM32F746GZ and SAMD21G18A however after building flashing HEX/BIN or UF2 in bootloader mode and the device does not show up as usb device. On both windows and unix the device will show up after about 5 mins, and in windows it fails with USB descriptor error.

Is it a clock error or something? Cause if I load the build output on the board it does run after loading the UF2 file. The problem is that it does not show up as a...

manic glacierBOT
manic glacierBOT
timber mango
#

@gilded cradle I am ready to start testing digitalio and i2c in a real circuit now. 😉 🙂 🙂 Unfortunately, i2c will not be usable except as root in the vanila setup. 😦 I am not quite ready to dig into how to write udev rules.

#

The Ubuntu folks seem to believe they must protect us from ourselves, when these are OUR computers. I have had one or two run-ins with them about stuff like this.

#

The first thing I do after installing any Ubuntu derived system is to set a password for root. 🙂

manic glacierBOT
half geyser
#

Is it possible to get the current time without using additional memory? Or, alternately, is the fact that (on nrf at least) getting the current time creates a new object?

manic glacierBOT
bleak tiger
#

Thanks for the suggestions, I do need arbitrary angles though. The up side is it doesn’t need to be at all fast, the eink will update only twice a day.

#

The image I’m using is fairly large so I don’t think separate bit maps are possible

half geyser
#

@bleak tiger I missed what it is you're trying to do, and what you need the angles for, but for i2c, if you do ls -l /dev/i2c* does it show they're owned by the i2c group? Because if so, you could just add yourself to that group. That's how I do it for Fomu development, and I suspect that comes from Debian. Ubuntu probably does something similar.

#

Sorry, that should have been @timber mango .

#

I'm interested in what @bleak tiger needs angles for, though!

manic glacierBOT
#

What is the current status of this?

After skimming over the long discussion here, it seems like there was a sample implementation at #1415, but it won't be merged, and there's been a lengthy discussion comparing different approaches.

@bmeisels and I are working on an app framework for the AramCon Badge 2020, and some kind of async I/O will be super useful for us. Right now we're looking at the implementation from @deshipu, but we'd l...

bleak tiger
#

No worries @half geyser! The context is I'm building an eink based Moon Phase display that uses data downloaded from a cool NASA blog post. I've got the phases working by drawing a sprite of the dark portion of the moon over a full moon bmp.

#

The next step is to have the moon bmp and sprite rotate gradually over the lunar month. The north pole cycles 23.5 degrees to the left and right over the month from earths point of view.

manic glacierBOT
#

I looked closely at
@deshipu, thank you for the response.

@TonyLHansen you can already use the "meanwhile" library (https://github.com/deshipu/meanwhile) — it implements a simple async reactor mostly compatible with how the big Python async functions work. The only downside of it is that in the absence of internal mechanisms it works by polling, but that shouldn't be a problem for things like counters.

While "meanwhile" looks like it can handle simple counters, I don't see any way t...

timber mango
#

@half geyser The /dev/i2c* devices are all root.root unfortunately. This is Ubuntu MATE 18.04.

manic glacierBOT
manic glacierBOT
#

fix #2912 and/or other "slow responses" with USB after low power PR. It is basically the same as #2868 for nRF. There is lots of discussion there, I will sum it up here. Following is the racing.

  1. USB Interrupt handler is complete and submitted to the event queue of TinyUSB task
  2. WFI happens
  3. Since tud_task() isn't called yet to response, there is no more USB event. CPU has a good full sleep of N seconds.
  4. WFI end, tud_task() is called to handle usb events

It is the racin...

manic glacierBOT
#

Revisiting this because I noticed the support matrix said that pyruler had several modules it obviously didn't, such as the recently added vectorio.

It is less error-prone because we can use the final values instead of re-coding the Makefile logic in python. The only things we need to do are invoke make in "print-database" mode, then chase any indirect references like CIRCUITPY_VECTORIO = $(CIRCUITPY_DISPLAYIO)

It does take longer, about 45s on my laptop.

gilded cradle
#

@timber mango using blinka as root is fine. I’ve had to do that for certain boards. I’m glad the sysfs gpio class worked for you.

manic glacierBOT
timber mango
#

@gilded cradle It worked great! I wish Linux OS makers would let I2C be usable by non-priv users. I can not see any reason not to. Testing with real circuits today! 🙂 😉

raven canopy
#

@onyx hinge i like the approach to support_matrix using the make output; much cleaner. however, i'm not confident that it will run on ReadTheDocs, since it requires the toolchain to be available...

#

i somehow, still haven't setup a personal RTD to test, so its just conjecture at this point. 🤣

onyx hinge
#

oh ugh hmm

raven canopy
#

i mean, we could python-ize the toolchain setup, and then run it from conf.py like make stubs.

#

maybe?

onyx hinge
#
docs@e690e6e0a50b:/$ which make
/usr/bin/make
raven canopy
#

does make -C [...] -qp negate the need for the rest (arm-none-eabi-gcc, etc)?

onyx hinge
#

It should. "-q" means make never invokes any commands

raven canopy
#

ahh. k.

onyx hinge
#

and -p means "print database", which dumps a LOT of stuff, but including every make variable setting

#
CIRCUITPY_FREQUENCYIO = $(CIRCUITPY_FULL_BUILD)
CIRCUITPY_ANALOGIO = 1
#

does rtd run as python2 or python3 @raven canopy ?

raven canopy
#
python3.7 -mvirtualenv  /home/docs/checkouts/readthedocs.org/user_builds/circuitpython/envs/latest

from the last build.

onyx hinge
#

ahah got it

#

from what I can tell it'll succeed but there's always room to be mistaken

raven canopy
#

yep. you've assuaged my fear. being make illiterate was the cause. 😄

onyx hinge
#

happy to give more explanation. Should I mention it on the PR too, just for the record?

raven canopy
#

wouldn't hurt i guess, but not a requirement. i could've google-fu'd better. hehe

onyx hinge
#

initial comment updated

manic glacierBOT
raven canopy
#

@onyx hinge looks like we'll need submodules, but I don't see them being available in RTD.

Traceback (most recent call last):
  File "/home/sommersoft/.pyenv/versions/3.7.4/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/sommersoft/.pyenv/versions/3.7.4/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/sommersoft/Dev/circuitpython_current/docs/shared_bindings_matrix.py", line 158, in <module>
    print(json.dumps(support_matrix_by_board(), indent=2))
  File "/home/sommersoft/Dev/circuitpython_current/docs/shared_bindings_matrix.py", line 138, in support_matrix_by_board
    settings = get_settings_from_makefile(f'ports/{port}', entry.name)
  File "/home/sommersoft/Dev/circuitpython_current/docs/shared_bindings_matrix.py", line 105, in get_settings_from_makefile
    raise RuntimeError(f"Invoking '{contents.args}' exited with {contents.returncode}: {contents.stderr}")
RuntimeError: Invoking '['make', '-C', 'ports/atmel-samd', 'BOARD=capablerobot_usbhub', '-qp']' exited with 2: make: *** No rule to make target 'extmod/ulab/code/compare.c', needed by 'build-capablerobot_usbhub/genhdr/qstr.i.last'.  Stop.
#

this is RTD clone incantation:

[rtd-command-info] start-time: 2020-05-25T14:56:30.733175Z, end-time: 2020-05-25T14:56:44.348788Z, duration: 13, exit-code: 0
git clone --no-single-branch --depth 50 https://github.com/adafruit/circuitpython .
Cloning into '.'...

[rtd-command-info] start-time: 2020-05-25T14:56:44.925230Z, end-time: 2020-05-25T14:56:45.511622Z, duration: 0, exit-code: 0
git checkout --force origin/master
Note: checking out 'origin/master'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 6356e0c2f Merge pull request #2942 from weblate/weblate-circuitpython-master

[rtd-command-info] start-time: 2020-05-25T14:56:45.803865Z, end-time: 2020-05-25T14:56:46.046473Z, duration: 0, exit-code: 0
git clean -d -f -f
onyx hinge
#

hmmm okay

raven canopy
#

sorry for the walls of text

#

i really want this to work though. its soooo much cleaner.

onyx hinge
#

since y've got it all set up ... what if you change it to make ... -qp print-CC

#

if that works I can tell you what it even does

raven canopy
#

well, no errors. result seems accurate.

simple pulsar
raven canopy
onyx hinge
#

hmmmmm we'll need submodules someday soon anyway, if we move the pyi file for ulab into the submodule

raven canopy
#

does running the docker locally not go through the git clone step? i would guess it does, but couldn't find it in their repo (the git clone).

idle wharf
#

I noticed there is a camera interface on the ESP32-S2 and I was curious about what capabilities it might offer in the future. I did a little research comparing it to the Raspberry Pi's port and wrote up a little summary gist.

https://gist.github.com/askpatrickw/0179d09e74d5f2a4347d5666ea937c4d

If I made errors feel free to let me know. I only know what I read this morning and that doesn't mean I understood it all. 😉

Gist

Research about the ESP32-S2 Camera Interface. GitHub Gist: instantly share code, notes, and snippets.

slender iron
#

@solar whale @crimson ferry heap is just 64k because it's currently statically allocated. It can be adjusted later and we'll need to determine how to play nice with FreeRTOS wrt memory too.

timber mango
#

@gilded cradle I seem to have hit a snag when it comes to GPIO numbers. In my board file, I have stuff like D13 = pin.KSO0 but it appears that I need GPIO numbers somewhere. In my chip file, I have GPIO_40 = Pin(13). I think I must have things backwards because I think my Blinka is taking 13 as the GPIO number which is not correct. I want D13 to show up as the board pin number when I import board. How do I fix this?

gilded cradle
#

Maybe try D13 = pin.GPIO_40 in your board file.

timber mango
#

OK, I can try that. I patterned my files after the rockchip files.

gilded cradle
#

Yeah, you gotta start somewhere and then make changes as necessary.

timber mango
#

I see that. It seems like there should be a pattern to this though.

timber mango
#

That did not work, so I will take a break now and maybe try again later. I think I know what it wants now.

timber mango
#

@gilded cradle I really do not know what format these files are supposed to be in. I have tried two different types and neither has worked. According to how others are setup, one of these should work.

gilded cradle
#

Want to start a PR so I can see what you have so far?

manic glacierBOT
#

@TonyLHansen

There are no threads. This is cooperative multiprocessing — the tasks suspend their execution and let other tasks run explicitly, by yielding the control back to the main loop. The tasks don't have to know about each other's details, I'm not sure what you mean here.

I'm also not sure what kind of primitives you require. Maybe you could give me a simple example of the kind of a program you wanted to write with those counters, and I can show you how this can be done with that...

timber mango
#

I guess so, but what I have now is kind of a mess. Let me get it setup.

timber mango
#

@gilded cradle PR #296

#

It is probably something real simple that I am missing. That is how it usually goes when I get stuck on something.

crimson ferry
static jay
#

knowing nothing about what you are doing I'd have to agree 🙂

crimson ferry
#

It seems I'm somehow corrupting my flash storage by running code.py in Normal run mode

timber mango
#

In my case, I am adding a new board, the UDOO Bolt, to Blinka so Circuitpython stuff can be used on it. I think I am at that 10% left point that takes 90% of the time.

#

@crimson ferry That should not be possible. Is this an ESP32-S2?

crimson ferry
#

Yes, ESP32-S2. So unanticipated results are fully expected 😉

timber mango
#

Yes, that is why I asked. 😉

manic glacierBOT
#

While I was testing out the code for #2931 and found some issues with how time.sleep() is working for the ESP32S2.

  1. Float values passed seem to be rounded up to the nearest integer.
  2. Passing a small float value like 0.001 causes a board to crash on boot (serial output below). Since the board no longer mounts because of that, only solution I was able to find to get a board working again was to run idf.py erase_flash then reflash CP.

Hardware tested on:

  • Espressif Saola Wrove...
timber mango
#

I just submitted a 'bug' (change request) to see if the Ubuntu MATE folks will add groups 'gpio,' 'i2c,' and 'spi' with read/write access to allow unpriv users to use this hardware. One should not have to have the root password in order to access these.

half geyser
#

@timber mango Do you have the i2c-tools package installed by any chance?

manic glacierBOT
half geyser
timber mango
#

Do you have the i2c-tools package installed by any chance?
@half geyser I did not have it installed, but I do now and have unpriv access to i2c. I need the same for gpio too.

timber mango
#

@gilded cradle I believe I figured out what is happening. In sysfs_pin (line 138), the pin id is being taken from the board file as 13. I am trying to use D13. I am just not sure how to fix this.

manic glacierBOT
#

Nothing wrong here, really. But, when I was testing, I had to change up the call to figure out what exactly was breaking. Using subprocess.run allows for some better error messaging, which I think would prove handy since this is largely machine-run.
This was my local version:

contents = subprocess.run(
        ["make", "-C", port_dir, f"BOARD={board_name}", "-qp", "print-CC"],
        encoding="utf-8",
        errors="replace",
        stdout=subprocess.PIPE,
        stderr=s...
ionic elk
#

Is there some secret to avoiding translations merge conflicts? It's driving me nuts

#

Feels like I need a half a dozen translation merges on any PR that takes a while in the review stages

#

I don't understand why the changes are causing merge issues - these seem like they should just be superseded by master?

<<<<<<< mimxrt-uart-oneway
"POT-Creation-Date: 2020-05-21 11:18-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
=======
"POT-Creation-Date: 2020-05-19 15:01+0800\n"
"PO-Revision-Date: 2020-05-24 03:22+0000\n"
"Last-Translator: someperson <someperson@gmail.com>\n"
>>>>>>> master
half geyser
#

@ionic elk I usually put translations last as part of a pull request, and make it its own commit. That way I can rebase prior to making a PR, and re-do make translate

ionic elk
#

So you rebase every single PR?

half geyser
#

Oftentimes. I also tend to do a rebase -i HEAD~5 or so and drop the commit with the make translate in it and then re-add it.

#

If you add the make translate step as a separate commit, it's easy to drop it via git rebase -i and add it in later.

ionic elk
#

Seems like it'd make sense to not even run make translate until after you rebase and get it up on github, in that case

#

But I still don't think that'd help with PRs that take a week or so to pass review - as long as you've run make translate once, you'll need to update it every time someone edits the master ones or CI will fail.

old smelt
#

Can someone post a link to the notes doc for today's call?

ionic elk
#

Well, rebasing is probably as good as you can do.

#

@old smelt it's in pinned

timber mango
#

It is always pinned.

old smelt
#

I thought so, too. But my pinned list was empty.

#

Weird.

#

Oh - maybe I was in the wrong channel?

#

Thanks!

timber mango
#

🙂

manic glacierBOT
ionic elk
#

@tulip sleet Could I bug you for a sec on a C question?

#

aaand just like that I figure it out. 30 minutes being unable to find the answer, and as soon as I ask for help I figure it out in the next minute. 😑

tulip sleet
#

@ionic elk 😆

#

btw, for make translate, I merge from upstream whenever there are new translations upstream, and then make translate. I don't bother to rebase.

ionic elk
#

is there an easy way to check whether upstream had a translation update?

#

I mean I should still probably just run a merge before ever running make translate but still

tulip sleet
#

if you just look for the PR's since your last push, they are usually clearly labeled as translation updates. Or, a new module wll have new messages.
My usual "technique" is just to notice the failure, be annoyed, and then pull, merge, make translate, and re-push

timber mango
#

@tulip sleet You are anoid. 🤓

#

a noid 🤓

tulip sleet
#

i googled it and it's not a complimentary term

#

"anoid" is not complimentary. "Noid" is some pizza character i am not familiar with.

timber mango
#

@tulip sleet Yes, it is complimentary within my context. Google does not know what it is saying. A noid = A nerd. 🤓 😉

#

PUN

ionic elk
#

@tulip sleet is there a process for "taking over" a community submitted PR? There's one that came in for the i.MX 1050 that hasn't been updated in two weeks, but it'd actually be really great to have that SoC

#

Just needs a couple tweaks

tulip sleet
manic glacierBOT
slender iron
#

it's not meant to work with a rebase though

#

just plain merges

ionic elk
#

Nice!

lucid solar
#

That's a seriously smiley photo

manic glacierBOT
#

Identifying a common API for reference voltages is harder. Trying not to have "device-specific modules" for enhancing functionality of modules like ADC and DAC has led to us having only pretty basic functionality. I thought that this would help with some MP3 playback problems (which it turns out not to) and I have no idea how to extend this to encompass multiple ports, so I guess we can just close this up. I'll try to find time to see whether the enum factoring I started here actually give...

slender iron
#

@lucid solar vacation in thailand 🙂

onyx hinge
#

@slender iron can you think of any other enumerated-ish types in CircuitPython? pin direction and pin pulls. There are probably others I'm not thinking of

slender iron
#

those two and uart parity

manic glacierBOT
#

Core enumerated types: Pin direction and pull. UART parity.

Can we save code size or improve code quality by using some common code for enumerations?

Common code looks something like this (from #2939)

typedef struct {
    mp_obj_base_t base;
    int16_t value;
    int16_t name;
} cp_enum_obj_t;

#define MAKE_ENUM_VALUE(type, prefix, name, value) \
const cp_enum_obj_t prefix ## name ## _obj = { \
    { &type }, value, MP_QSTR_ ## name, \
}

#define MAKE_ENUM_MAP_ENTR...
manic glacierBOT
modern wing
#

Good afternoon all you wonderful folks -- will there be a separate youtube/streaming link for text-only/lurkers?

#

[happily lurking today]

slender iron
#

@modern wing what time is jp's make code stream?

modern wing
#

I believe in an hour from now.

slender iron
#

hopefully we can fit everyone in the discord channel

#

I don't want to risk messing him up

#

our regular monday time should be ok for me to stream

#

need to sort it out for kattni too

onyx hinge
#

Yeah there are some hurdles to pass. Can the voice people exceed 25 or does turning on video at all limit us ?

gilded cradle
#

I think you're correct @onyx hinge

onyx hinge
#

If you're lurking, please let us know in here or add it to the notes doc

#

I'll be taking notes today

blissful pollen
#

lurking

modern wing
#

I swear my neighbors think I'm crazy for "talking to myself" all day [conference calls on headphones, etc].

#

If needed, I can bounce and watch at a later time.

blissful pollen
#

seems to toggle to whoever is speaking

sterile bronze
#

lurking

uncut nexus
#

lurking today

onyx hinge
#

restarting discord real quick, I don't seem to have the video button

indigo wedge
#

Hmm, I just upgraded to arm none eabi gcc 10.1 and CPY for mimxrt doesn't build , lots of "multiple definition of" errors. Downgraded to 9.3 for now

onyx hinge
#

@indigo wedge did ARM release an official toolchain? If so, we'll probably look into it soon

modern wing
tulip sleet
#

@indigo wedge micropython is having trouble with gcc10 also; weshould probably wait. memset was optimizing to calling itself

indigo wedge
#

@onyx hinge not sure, just got it from AUR #archlife

#

@tulip sleet wow 😂

onyx hinge
#

That's fun, in linuxcnc we had problems with sincos() being optimized into a call to itself

#

-fno-builtin-XXX FTW

slender iron
onyx hinge
#

(2nd is direct link to adafruit's section)

#

(it's wild, even if it's just a demo)

#

Adafruit has started shipping regular (non-emergency) orders after priority orders are filled.

If you have been waiting to order, read Adafruit's announcement and FAQ and then Shop Adafruit. https://www.adafruit.com/opensafely

old smelt
#

Who's going to write the first draft of the Dr. Seuss parody "Fox in Nox?"

onyx hinge
#

Many of those new contributors are contributing translations of CircuitPython, which is great

#

we have 4 languages at 100% now !

lucid solar
#

The stats are for the last 7 days...but it was 8 days since the last meeting 😛 My PR was 8 days ago... 😛

onyx hinge
#

❤️ @tulip sleet

slender iron
#

🎉

onyx hinge
#

congrats @ruby atlas

raven canopy
#

🎉

modern wing
#

Yay!

onyx hinge
#

@slender iron timecode

#

oh you got it, it was just laggy

slender iron
#

👍

raven canopy
#

lol. sorry!

inland tusk
#

lurking for hug rreports

onyx hinge
#

Thanks @inland tusk

modern wing
#

It was Andon 🙂

prime flower
#

@raven canopy I really like that design.

raven canopy
#

its nice. look for the blue dot in your profile menu (upper right).

lucid solar
#

Fun to SEE people, sometimes people look different to how you imagine 🙂

prime flower
#

@raven canopy says there are no new feature releases for me 😦

solar whale
#

text only for now

lone axle
#

Sounds better for me now

#

🥮

onyx hinge
#

Don't get us wrong, most people coming in are still good additions to the community

raven canopy
#

indeed

idle owl
#

It's simply that with visibility, comes spammers and bots.

onyx hinge
#

@solar whale you may need to mute

raven canopy
#

got work call. real quick. lurking..

modern wing
#

We're 63 people shy of 20,000 -- and only a tiny percentage over the past three years have caused any issues. It's an excellent community that does some absolutely amazing things.

I'm thankful that we have the tools and the team to assist in handling these challenges 🙂

inland tusk
#

I am goinng to lurk

solar whale
#

back online

onyx hinge
#

@old smelt is the FPGA bitstream for the Evo M51 going to be open source?

#

I use a Makefile to do the copying with rsync, but that's pretty linux-centric way to approach it.

raven canopy
#

back

onyx hinge
#

(there's no keystroke to turn video on/off is there?)

solar whale
old smelt
#

@onyx hinge - probably not out of the gate.

The top-level Verilog source will be available so that people can create their own logic blocks and stitch them into the design. All of the functionality for the FPGA will be there, but the top-level will contain some QXP files - which are pre-compiled blocks. By that measure, it's not entirely open-source.

#

Have to kick off a 2:00 call. Thanks all. Have a great week!

slender iron
#

thanks @old smelt !

modern wing
#

That camera is for the birds 🐦

onyx hinge
#

@old smelt thanks for clarifying. Finding that middle way can be hard, especially if there are IP blocks involved.

solar whale
#

It's for the humans 😉

#

The birds don't care

modern wing
#

So they don't give a hoot?

solar whale
#

😂

onyx hinge
#

(I removed my item from In the Weeds)

#

would love to see someone speed up our builds with docker (installing dependencies is a drag)

#

pirate puns arrrrr

gilded cradle
#

Thanks everyone

onyx hinge
#

👋

modern wing
#

Indeed 🙂

prime flower
#

👋

raven canopy
modern wing
#

Before covid, it was hard to find these premium chairs to "test drive" -- now, it's virtually impossible.

I'm still rocking the Ikea high back chair I have, only because it's...well, what I have. 😕

lucid solar
timber mango
#

There do not seem to be any chairs that fit shorter people comfortably.

modern wing
#

Best monitor arm I've found is an ergotron. They're not cheap, but they're the easiest to use and move.

lucid solar
modern wing
#

Oh, I have one of those. It's where I put my clean laundry before folding it 😉

lucid solar
#

I sit with my feet up...it's really comfy and I get no pain.

modern wing
#

Northern NJ here -- still under a lockdown that folks are beginning to ignore.

lucid solar
#

Sweden...no official lockdown, most people are being sensible though. Different mentality to the UK for example where my parents live and my parents have been in near total lockdown since the start.

timber mango
#

I am afraid I have zero sympathy for those who ignore lockdown rules.

topaz quest
#

Best monitor arm I've found is an ergotron. They're not cheap, but they're the easiest to use and move.
@modern wing those can be found cheaper under the AmazonBasics brand — if it looks like an Ergotron, with AmazonBasics branding, it is one. They ship from the factory.

modern wing
#

Hmm, I'll have to check that out -- thanks for the heads up @topaz quest

topaz quest
#

np! (I got one of those myself and I can confirm Ergotrons are the best :D)

modern wing
#

I've had a few various arms through the years, and the best was a double panel ergotron. Absolutely night and day difference between the budget brands.

topaz quest
#

yeah I bought a budget one once, and it was a terrible experience 😦 rated for my monitor weight didn't actually keep my monitor up — the single-arm ABbyE is still my favourite — might get the double if WFH becomes semi-permanent

modern wing
#

If amazonbasics is rebranding them -- even a 75% version is still massively better than others.

timber mango
#

@gilded cradle Did you have a chance to look at my PR yet?

modern wing
#

Ciao.

idle owl
#

Later all.

solar whale
#

Have a good week!

gilded cradle
#

@timber mango I took a quick look at it. What is the problem you're having with it exactly? It could be the 13 you're passing to Pin() isn't correct. I'll have to take a look at my notes after lunch, but I kind of remember something that tells you how to convert the microprocessor pin number to gpio pin.

manic glacierBOT
timber mango
#

The pin number is correct.```DEBUG: pin.id = 13
OSError: [Errno 22] Invalid argument

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/adafruit_blinka/microcontroller/generic_linux/sysfs_pin.py", line 136, in _open
f_export.write("{:d}\n".format(self.id))
OSError: [Errno 22] Invalid argument

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "./led.py", line 6, in <module>
led = DigitalInOut(board.D13)
File "/usr/local/lib/python3.6/dist-packages/digitalio.py", line 103, in init
self.direction = Direction.INPUT
File "/usr/local/lib/python3.6/dist-packages/digitalio.py", line 129, in direction
self._pin.init(mode=Pin.IN)
File "/usr/local/lib/python3.6/dist-packages/adafruit_blinka/microcontroller/generic_linux/sysfs_pin.py", line 90, in init
self._open(self.IN)
File "/usr/local/lib/python3.6/dist-packages/adafruit_blinka/microcontroller/generic_linux/sysfs_pin.py", line 139, in _open
raise GPIOError(e.errno, "Exporting GPIO: " + e.strerror + " id = " + debug)
adafruit_blinka.microcontroller.generic_linux.sysfs_pin.GPIOError: [Errno 22] Exporting GPIO: Invalid argument id = 13```I had to add some debug prints so I could find out what pin ID was being passed.

#

Clearly, '13' is wrong. It is GPIO_40.

tulip sleet
#

@onyx hinge ok to merge PR #2957?

timber mango
#

Pin(13) = GPIO_40

timber mango
#

@gilded cradle I do not get how to connect the board file with the chip pin file though. One error points in one direction and another error points elsewhere.

topaz quest
#

@tulip sleet can you take a look to https://github.com/adafruit/Adafruit_Community_Code_of_Conduct/pull/5 and https://github.com/adafruit/Adafruit_CircuitPython_TestRepo/pull/34 ?
I won't be able to send more pull request for the rest of this week until I straighten up paperwork for new dayjob, so no urgency 🙂

#

@tulip sleet thanks for the librarians reference, didn't know about that, will use it for the other pull request 🙂

tulip sleet
#

@topaz quest bleh, ok, we will just have to keep more of a watch out for open PR's. I don't always notice these. We should make periodic passes through the PR's and assign reviewers.

topaz quest
#

yeah I was also surprised I can't assign it 😦 I guess there's space for an auto-assigner bot of sorts

tulip sleet
#

that looks good on its face. modifying the incoming arguments is ... not a good idea :/

raven canopy
#

@onyx hinge ok to merge PR #2957?
@tulip sleet i meant to tag @slender iron on that one after I approved. was going to ask if the ninja work was going to nullify using make output...

slender iron
#

@raven canopy ya, I'd like to use toml + py for it in the future. it's long term though. make improvements are still welcome

raven canopy
#

k. figured that would be the case, but didn't want to assume. i'll merge it then.

slender iron
#

kk, thanks!

topaz quest
#

@tulip sleet since it seems to that you folks like pull request automatic lifecycle as much as me 🙂 has anyone considered mergify.io yet?
I've been using for some of my repos that invite most contributions: https://flameeyes.blog/2020/03/19/success-story-mergify/

onyx hinge
#

Thanks @raven canopy .. with the ninja build we'll have to revisit but it should still be doable in some fashion

tulip sleet
#

@topaz quest mergify looks interesting. I have not heard about it. Tagging @slender iron too.

manic glacierBOT
slender iron
#

looks

manic glacierBOT
slender iron
#

mergify looks cool! Rust has a similar bot for auto-merging

simple pulsar
#

What is WFI? Wake From Interrupt? Oh, I see Wait For Interrupt in other ticket.

raven canopy
#

yep

manic glacierBOT
gilded cradle
#

@timber mango, keep in mind there are 3 different pin numbers. There's the physical pin number of the 40-pin GPIO header, the physical pin number of the microprocessor chip itself, and the virtual pin number that the operating system sees. The chip file is meant to map the virtual pin number to match the physical pin of the microprocessor and the board file maps that pin to the physical pin of the GPIO header on the board. At a guess, perhaps try using Pin(40) instead of Pin(13) in case the virtual pin matches the physical microprocessor pin.

gilded cradle
#

So, I'm not really surprised that you're confused, because it is a little confusing.

manic glacierBOT
timber mango
#

@gilded cradle I know about there being three different pin numbers. If I need CPU pin numbers for the chip pin file there is a problem because I do not have access to that information. Making that change got the same error. So, the virtual pin would be 40 in that example, so GPIO_40? I am already using that form in the chip file.

#

This is really making my brain yell for help! 😖

manic glacierBOT
gilded cradle
#

@timber mango, you're going to need to figure out which sysfs pin goes to which gpio. Perhaps you can do some reading up on how sysfs works. It's really hard for me to know what is what because I don't have an UDOO bolt and there seems to be very little documentation available. I can only guess at this point. You're going to need to experiment with lighting up an LED and then you can be sure you have the correct pin number.

manic glacierBOT
gilded cradle
#

Due to having very little documentation, the UDOO seems to be on the more advanced side for adding, so it's a tough board to learn on.

#

Also, I didn't see anything obvious as to why the code you submitted didn't work.

timber mango
#

@gilded cradle I already know what the sysfs pin numbers are - they are the GPIO numbers which are used by the OS to access the pin. So, GPIO_40 matches physical pin 13 on the UDOO Bolt connector. The OS uses that number to export the pin and make it available for use.

gilded cradle
#

Ok, good. Can you get it to turn on an LED?

timber mango
#

@gilded cradle What I do not know is which pin numbering is used in which file. No, I can not light an LED yet because I am still getting errors.

gilded cradle
#

I mean can you get it to light up using the command line?

timber mango
#

I do not know about that. I will have to try from the command line. I remember some of how that works...

gilded cradle
#

👍

manic glacierBOT
#

What is the current status of this?

After skimming over the long discussion here, it seems like there was a sample implementation at #1415, but it won't be merged, and there's been a lengthy discussion comparing different approaches.

@bmeisels and I are working on an app framework for the AramCon Badge 2020, and some kind of async I/O will be super useful for us. Right now we're looking at the implementation from @deshipu, b...

simple pulsar
#

Here's a tricky one. What should getrandbits(31) and getrandbits(32) do on the small boards without "long int" support? Here's s a GEMMA M0 running 5.0.0: ```>>> maybeok = random.getrandbits(32)

maybeok = random.getrandbits(32)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: small int overflow
maybeok = random.getrandbits(32)
maybeok = random.getrandbits(32)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: small int overflow
``` 32 seems to be the max. Is this something that could benefit from a note in the getrandbits docs?

manic glacierBOT
#

We're using the Feather M4. I'll look at doing the recompile -- will that work w/ the latest cp v5.3? I noticed some folks were using two displays per bus -- do you know if we could have 4 displays on the primary SPI bus?

Ya, that setting should work in 5.3.0. I believe folks tested up to 6 on the same bus so 4 should be ok. Note, you'll drop framerate because you can only compute and send so many pixels.

We can have more than one device on an SPI bus. Why are SPI displays treated d...

timber mango
#

@gilded cradle I did not see anything obvious that would point to why my code is not working either. That is exactly what really BUGS me about this. I know there has to be a defined way this whole thing works. It looks like I am going to have to go into reverse engineering mode to figure this out. When I do figure it out, you can be guaranteed this is going to be well documented. 🙂 😉

raven canopy
#

disabled UART due to a boot bug with Ubuntu and the Pimoroni FanShim. soft-reset-into-bootloader issue: gone. 😑

now to verify...

#

nope. must've been an update to something. oh well...won't look the gift horse in the mouth. at least i can move forward again. :phew:

thorny jay
#

No, I have just aquired a FanShim. Hopefully I don't run Ubuntu on my Pi4. Should I? It already boot from SSD and that is a big bonus for me.

raven canopy
#

Raspbian is fine. I'm using Ubuntu for a specific reason; to avoid compiling GNU Arm compiler for Raspbian, when i can just grab the aarch64 binary from them.

my soft-reset-into-bootloader issues shouldn't affect many; double tap into the bootloader was unaffected.

manic glacierBOT
thorny jay
#

After months of not booting a Pi (because of CircuitPython)... I just restarted. Maybe it is time to try Blinka.

manic glacierBOT
manic glacierBOT
#

Why add one and not the other? The Python stdlib has had both for ages, I suppose to be compatible with expectations from other systems, or people’s intuition.

Generally it's better only have one way to do something. In this case I guess both are ok since it's meant to make it easy to escape the REPL.

I’m interested in making a PR. Just tell me where site.py should be added in the source!

Unfortunately, I don't think it's that easy. We'll need to add a site module to shared-b...

timber mango
#

@gilded cradle I do know now that the chip pin.py does not map virtual pins (GPIO) to microprocessor pins. The pin_id is being taken from the chip pin file Pin(xx), so pin_id would be xx. I still have no idea how the board file maps into the pin file. I can not believe this can be so difficult or confusing! So far, none of the existing boards seems to match how I need to do things for the UDOO Bolt. 😕 I am going to crack this nut... blinka

gilded cradle
#

All the board file does is say that you want for instance D13 to point to whatever you named the pin in the chip file, in your case GPIO_40. The reason there are 2 files is because different boards can implement the same chip different ways. The issue is we don't know what xx is supposed to be.

timber mango
#

That is pretty much it, in a nutshell. I do know for sure now that the pin_id in sysfs_pin is whatever xx is, so I have gained a bit of knowledge there. Each bit of knowledge brings me that much closer to cracking the nut. 🥜 Tomorrow, I will be diving in to sysfs_pin to find out exactly how the pin_id is being used. That should give me some clue as to what xx has to be.

cedar ether
#

Hi I am trying to use the adafruit hat for raspberry pi to control a stepper motor and it works but it is quite slow https://www.adafruit.com/product/2348. What ways are there to increase the speed? Thanks!

simple pulsar
#

@cedar ether What library are you using?

simple pulsar
#

@cedar ether I've not used these. I was just curious as I built something with stepper motors over 30 years ago. I don't think mine went particularly fast but it's a long time ago.

#

What rpm do you get? The ones I used were rated at 130 step/s max pull-in rate with a 7.5 degree step. Oddly, they were the slowest of the four in the data sheet. That's 162.5 rpm.

cedar ether
#

Haven't measured it, but seems less than that, around 60 rpm I'd say

simple pulsar
#

Is that without any time delays in the loop?

#

@cedar ether I see some double step functionality too in the library. What stepper motors are you using?

#

@cedar ether If no one is around here I'd post to the Adafruit forums including the stepper motor models, the code you are using and anything you've tried and if there's any juddering. I've just glanced at my 80s BBC Basic program and I have pauses in that between the steps and those reduce over time to accelerate it. I don't know if that's because it was missing steps or just traction / torque related.

cedar ether
manic glacierBOT
#

This now works:

import microcontroller
import watchdog
import time

wdt = microcontroller.watchdog
wdt.timeout = 5

while True:
    wdt.mode = watchdog.WatchDogMode.RAISE
    print("Starting loop -- should exit after five seconds")
    try:
        while True:
            time.sleep(10)
            # pass # This also works for a spinloop
    except watchdog.WatchDogTimeout as e:
        print("Watchdog Expired (PASS)")
    except Exception as e:
        print("O...
crimson ferry
#

ESP32-S2 digitalio seems to be working well. Beware pins with weak internal or Soala-external pull-ups or pull-downs, or otherwise in-use, e.g. pins 0, 18, 19, 20, 26, 43, 44, 45, 46:

>>> p26 = DigitalInOut(board.IO26)
>>> p26.direction = Direction.INPUT
>>> p26.pull = Pull.DOWN
>>> p26.value
True
manic glacierBOT
simple pulsar
#

@cedar ether The demo videos of that show it going a similar rate to what you describe. The data sheet isn't very detailed. I have an ancient data sheet which is not specific to that stepper but has a lot of detail on how they work. I can post that if you stick the question in the Adafruit forum. Perhaps gearing / gearbox is appropriate for your project?

manic glacierBOT
manic glacierBOT
slender iron
#

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

ionic elk
#

@slender iron and @indigo wedge I'm sorry I've been a bit absent over the last week or so. I've been having an issue with my home/Covid office where it gets to be crazy hot at about 12pm or so and stays that way until the evening. I've been trying to compensate by working a stint starting at 6pm, but it hasn't been going so great.

#

Just got a giant honking fan today which should hopefully alleviate the issue until I get back to Artisans Asylum in June.

slender iron
#

@ionic elk totally understand, that's how my office is in the summer too

#

10pm is a tempting time to work in that case

#

Anyone seen this with ESP? W (96422) CircuitPython I2C: scl 35 sda 34 W (96422) CircuitPython I2C: param config 0x3ffda940 1 2 E (96432) i2c: mode 0x3ffda940 1073588481 2 E (96432) i2c: ../../esp-idf/components/driver/i2c.c:597 (i2c_param_config):i2c mode error W (96442) CircuitPython I2C: error 258 1 2

ionic elk
#

My issue so far has been it conflicts with my dinner-making duties 😆

slender iron
#

basically a struct value changes in the call but is ok from the caller

onyx hinge
#

@ionic elk on stm32f405 feather you haven't figured out any way to do all the board-resetty things that pressing the physical reset button does, via j-link, have you?

ionic elk
#

mon reset

onyx hinge
#

what if I told you that was leaving ... something ... in a state that's different than pressing reset?

ionic elk
#

🤷‍♂️

onyx hinge
#

hah

ionic elk
#

what kind of thing?

slender iron
#

reset button can leave some things in the same state

#

usually the datasheet points it out

ionic elk
#

We had issues with the low power domain, if you recall. I think that has different power/reset rules

onyx hinge
#

I'm working on SDIO. On the first run it fails (some HAL routine is returning an error code), but after I "mon reset" it erroneously reads back a block of all zeros instead of the actual SD card content

slender iron
#

can you reset the individual peripheral before init?

ionic elk
#

@onyx hinge I don't find it super helpful to chase those errors before you deal with the "first" one

#

You often uncover what the cause is by fixing the first (HAL) issue

#

Otherwise you have multiple errors that can kind of masquerade as each other and it leads you in wrong directions.

onyx hinge
#

right, which is why it's such a pain in my workflow, because pressing reset confuses the jlink gdb server, so I have to restart it, ...

#

and all this is assuming I correctly fixed the HAL_Delay problem which is where I was stuck the last time. HAL_Delay, which may be using SysTick by default?? was never finishing. so I added: ```+void HAL_Delay(uint32_t delay) {

  • if (delay > 1000) {
  •    mp_hal_delay_ms(delay / 1000);
    
  •    delay %= 1000;
    
  • }
  • mp_hal_delay_us(delay);
#

in supervisor/port.c, not knowing the right place for it

manic glacierBOT
onyx hinge
#

I wonder if I also need to do something about HAL_GetTick, it seems to be used in timing but it does not count up consistently (since lower-power?)
uint32_t tickstart = HAL_GetTick();

ionic elk
#

Woof good thing this fan seems to be working because there are a LOT OF BUGS TO FIX TODAY

#

DANG

tulip sleet
#

@ionic elk When I heard about your third floor attic office earlier, I wondered about the summer aniblobsweat

ionic elk
#

Well, the room right below me has AC, and luckily this huge chonk fan I just got is circulating the air pretty well

#

We'll see how it combats the early afternoon heat

manic glacierBOT
#
[adafruit/circuitpython] New branch created: hiibot\-bluefi\-pid\-fix
ionic elk
#

@tulip sleet poking you again about this, can we just get rid of POT-Creation-Date:? Manually editing every file in locale/ for one timestamp sucks

slender iron
#

@ionic elk do git merge and then run make merge-translate. it was committed yesterday

ionic elk
#

Oh that's right you added the merge-translate thing I totally forgot

#

darn it I already fixed it I should have tested that

ionic elk
#

@slender iron any chance you could clear that PR? It'd let me merge in a nice clean version of Master for my busio cleanup branch

slender iron
#

what do you mean by clear?

#

I can't look right now. it's breakfast time for me and the cats

#

was just up early for a zephyr meeting

ionic elk
#

@slender iron just meant "approve". Don't worry about it if you're busy, I'll manually merge everything in. Anything interesting at the Zephyr meeting?

manic glacierBOT
#

This PR issues a general cleanup of the BusIO module to account for recent changes to the pin claiming structure, and issues fixes to a number of bugs and other minor feature requests. All changes are being stress-tested across I2C, SPI, UART, and DigitalIO to hit a baseline level of guaranteed functionality.

It is not currently ready for merge as I'm still tangling with a number of serious issues during testing, including an ugly startup hang, but I'm opening it up to style review and ot...

#

This one isn't too difficult, but its going to require either some additional metadata or cleaning up prior to implementation:

Duplicate found:
        Boards: stm32f411ce_blackpill, thunderpack
        VID:PID: 0x239A:0x806A
Duplicate found:
        Boards: meowbit_v121, feather_stm32f405_express
        VID:PID: 0x239A:0x805A
Duplicate found:
        Boards: makerdiary_nrf52840_mdk, feather_nrf52840_express, makerdiary_nrf52840_mdk_usb_dongle, 
                TG-Watch02A, pca...
manic glacierBOT
#

I didn't mean to be curt. In CPython, sys.exit() raises SystemExit and quits. It appears that exit() and quit() are just aliases for sys.exit() via the site module. You can change them if you want.

So I would suggest we either provide the site module, or we just make the builtin functions exit() and quit() be aliases for sys.exit().

Note that sys.exit() is not working right in CircuitPython right now. It just goes on to the next REPL line.

manic glacierBOT
#

Hi Guys,
it looks like i can find the answer for my problem here:) on esp8266-12e i'm using TFT module via HSPI however i'm using unidirectional communication thus MISO (GPIO12 aka D6) is not connected to TFT. The problem is i need to use GPIO12 to control TFT LED pin responsible for backlight control - thus one is out of SPI protocol, just set H to turn the backlit on, L to turn it off).
Initially i thought i damaged PGIO12 as even if i set its mode to OUTPUT (yes, i'm using Arduino IDE) ...

manic glacierBOT
sour lynx
#

Anyone seen this with ESP? W (96422) CircuitPython I2C: scl 35 sda 34 W (96422) CircuitPython I2C: param config 0x3ffda940 1 2 E (96432) i2c: mode 0x3ffda940 1073588481 2 E (96432) i2c: ../../esp-idf/components/driver/i2c.c:597 (i2c_param_config):i2c mode error W (96442) CircuitPython I2C: error 258 1 2
@slender iron do you have a link to the code for this?

slender iron
#

@sour lynx yup! 1 sec

#

very weird the mode check in the idf fails when not printing 4 params before i2c_param_config

#

idf change is

#
+
+    //ESP_EARLY_LOGE(I2C_TAG, "mode %p %p %x %d", i2c_conf, &(i2c_conf->mode), i2c_conf->mode, I2C_MODE_MAX);
     I2C_CHECK(i2c_conf->mode < I2C_MODE_MAX, I2C_MODE_ERR_STR, ESP_ERR_INVALID_ARG);
+    //ESP_EARLY_LOGE(I2C_TAG, "mode ok");
#

in components/driver/i2c.c

#

I couldn't figure out how to see the I2C_CHECK message so I switched it to EARLY_LOGE as well

sour lynx
#

Does the check pass when you un-comment ESP_EARLY_LOGE and fail otherwise?

#

mode 0x3ffda940 1073588481 2 seems to not match "mode %p %p %x %d"...

slender iron
#

I can only get the check to pass if the log before i2c_param_config has four values printed

sour lynx
#

ESP_EARLY_LOGW(TAG, "param config %p %d %d", &i2c_conf, i2c_conf.mode, I2C_MODE_MAX); this one?

slender iron
#

(I haven't tried more)

#

ya, that one

#

ESP_EARLY_LOGW(TAG, "param config %p %p %d %d", 0, 0, 0, 0); causes it to work

#

more specifically, it passes the check

#
W (1511) CircuitPython I2C: param config 0x00000000 0x00000000 0 0
E (1521) i2c: mode 0x3ffda930 0x3ffda930 1 2
E (1521) i2c: mode ok
W (1521) CircuitPython I2C: param config I2C done
W (1531) CircuitPython I2C: create I2C done
#

ESP_EARLY_LOGE(I2C_TAG, "mode %p %p %x %d", i2c_conf, &(i2c_conf->mode), i2c_conf->mode, I2C_MODE_MAX);

#

that's the idf print

#

with three params in the first print:

#
W (1511) CircuitPython I2C: param config 0x00000000 0 0
E (1521) i2c: mode 0x3ffda940 0x3ffda940 3ffda901 2
E (1521) i2c: ../../esp-idf/components/driver/i2c.c:597 (i2c_param_config):i2c mode error
W (1531) CircuitPython I2C: error 258 0x3ffda940 1 2
sour lynx
#

Do you have the .elf file for the failing case? If yes, can you send it to me, please?

#

(i can try to build myself, but will need to set up the environment — i haven't quite gotten it to work last time)

slender iron
#

happy to give you whatever you need

#

want the one that works too?

manic glacierBOT
sour lynx
#

You aren't compiling uPy code with fshort-enums, by chance?

slender iron
#

I thought about that. I believe I'm only passing it to the linker

#

will double check

sour lynx
#

Interesting, i thought it is a code generation option, and shouldn't do anything useful at link time...

slender iron
#

ya, that's what I was thinking

#

I think we have it there for lto

#

¯_(ツ)_/¯

#

we have cruft

#

-Werror -Wall -mlongcalls -std=gnu11 -Wl,--gc-sections -fsingle-precision-constant -fno-strict-aliasing -Wdouble-promotion -Wno-endif-labels -Wstrict-prototypes -Werror-implicit-function-declaration -Wfloat-equal -Wundef -Wshadow -Wwrite-strings -Wsign-compare -Wmissing-format-attribute -Wno-deprecated-declarations -Wnested-externs -Wunreachable-code -Wcast-align -Wno-error=lto-type-mismatch -D____ -ffunction-sections -fdata-sections -fshort-enums

#

ah, it is there

#

@sour lynx looks like that is the issue

manic glacierBOT
slender iron
#

how do I enable the check error messages?

sour lynx
#

better question is, how have you disabled them? 🙂 They expand to ESP_LOGE, which internally calls vprintf, i.e. prints to stdout.

#

If you printf something, do you see the output?

slender iron
#

😄

#

perhaps it's going out the cdc connection

#

on native usb

#

I'm trying printf now

sour lynx
#

I've noticed that somehow you already had log output over USB in your previous livestream! Although now I can't find the code in your branch which would implement the redirection...

slender iron
#

ya, I'm not sure how that happened

#

yup, it's going out USB CDC

#
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
hello from printfE (26100) i2c: i2c driver install error
Traceback (most recent call last):
  File "code.py", line 3, in <module>
OSError: [Errno 5] Input/output error
sour lynx
#

Suggest lowering USB task priority to something like 5 (lower than esp_timer, which you use for ticks)

slender iron
#

should probably update there too

sour lynx
#

yup, it's going out USB CDC
do you have a pointer, where is the redirection implemented?

#

just curious

slender iron
#

I don't know

#

trying to find it

#

I usually use mp_printf

#

I don't know the std c lib stuff that well

sour lynx
#

I see, okay, will clone the repo and see

slender iron
#

I'm looking too 🙂

#

looks like lib/utils/printf.c

#

yup, turning off MICROPY_USE_INTERNAL_PRINTF made it go out the UART

#

👍

#

thanks for the help @sour lynx !

sour lynx
#

You can also redirect stdout to some other place using fwopen, e.g. to USB or network (if you keep the printf provided in IDF / newlib)

#

np, you are welcome 🙂

slender iron
#

kk, should be using the IDF's copy now

#

gotta rework the build stuff a bit for it but that's no biggie

#

then I can debug the i2c driver install issue

ionic elk
#

@slender iron where is mcu_pin_globals actually populated?

slender iron
#

@ionic elk for what port?

ionic elk
#

mimxrt

slender iron
ionic elk
#

I'm getting real weird GDB behavior. It's jumping from reset_all_pins to completely different functions without intermediate steps

#

I'm wondering if ((mcu_pin_obj_t*)(mcu_pin_globals.map.table[i].value)) is allowing program memory to be overwritten without causing a hardfault somehow

onyx hinge
#

Two usual reasons for that: loaded elf doesnt match device, or the stack is smashed

slender iron
#

it should be stored in flash so it won't be easy to overwrite

ionic elk
#

I really don't know what's up then

#

I'm going to go back to my pin tables in Pins.h rather than trying to use the microcontroller table and see if that fixes it

onyx hinge
#

I've also "solved" gdb weirdness problems by re-powering the device and jlink and restarting gdb, but whether that was fixing an actual problem or not I don't know

ionic elk
#

I'll try a hard reset with reworked pins.

#

what a waste of time though jeeze, I should have stress tested that mcu_pin_globals thing more, I thought it might have sketchy problems.

ruby atlas
#

@onyx hinge i've had weird issues with jlink, gdb that were "solved" that way too.

stark wagon
#

@split ocean I'm trying to follow your latest tutorial for Lars the sloth using a Feather nRF52840 Express board but i get a library error at audioio. Any ideas?

split ocean
#

@next holly great, please let me know if any questions or issues arrise.

onyx hinge
#

@stark wagon on nRF you have to use audiopwmio. It's similar to audioio, in general, but the quality is not as good

#

let me find you a link real quick..

stark wagon
#

@split ocean OK, does that still work with MP3 or do I need to convert to WAV?

simple pulsar
#

Has there much use of adafruit_ble for sending Advertisements between Adafruit boards? I am seeing a bug where the data does not appear to arrive intact for custom Advertisement with multiple manufacturers' values. It feels more likely to be my code but I'm starting to wonder...

stark wagon
#

@split ocean Don't worry, sorted it now. Changed import audioio to audiopwmio and updated the speaker declaration accordingly. MP3's work perfect. Only noticeable issue is a click sound at the end of each clip but I assume that is to do with using PWM rather than Audioio library. Thanks for a great tutorial, I plan to make a suitably creepy toy that reacts when it is picked up, maybe adding eyes that glow when the audio is playing.

#

@onyx hinge Sorry only just noticed you were the one who replied not John. Bad form on my part, not paying attention. Thank you for the assist. As I said it works great. Sorry again.

onyx hinge
#

Great, glad we could help!

manic glacierBOT
onyx hinge
#

(JP is the good looking one)

raven canopy
#

haha! i linked an example actions run with that PR. when, the PR will have its own example. 🤦

simple pulsar
#

Hmm, I think my custom Advertisements are getting constructed with default values and not by the received data over BLE. [Added later]: mystery over, details in https://github.com/adafruit/Adafruit_CircuitPython_BLE/issues/79#issuecomment-634990957

lucid solar
slender iron
#

are they cheaper than a spi flash chip?

lucid solar
#

Ok...8M flash is about half that cost...but still...nice it includes the fonts.

timber mango
#

@gilded cradle Now, I know what sysfs is looking for, and it makes sense. I believe it wants Pin(40) in the chip file, because it is trying to open GPIO40 which is correct for sysfs. I will try a chip file that has all GPIO numbers in Pin(xx) and see how that goes. Each bit of knowledge...

#

The bad news is that I may have to build a new kernel in order to enable sysfs. 😦 This is not desirable. I am exploring the new way to access stuff that replaces sysfs now.

timber mango
#

@gilded cradle The sysfs stuff is not working at all. This is not good. I am doing the right things, but it is just not working for sysfs. 😦 This is pretty much going to stop this project for now, at least until I can get some answers from UDOO. I believe they do not have sysfs enabled in the current Bolt kernel because it is being deprecated. I have not been able to find good documentation on the new way to access pins, but will continue to look. I will crack this nut.

gilded cradle
#

Hmm, that's not good, but makes sense.

#

Just out of curiosity, what do you get if you type ls /dev/gpio*?

timber mango
#

I did figure out how to make the gpio stuff accessible by unprivileged users. Yes, not good but does make sense. Unfortunately, that is making my job much more difficult.crw------- 1 root root 254, 0 May 27 17:17 /dev/gpiochip0

gilded cradle
#

That's good. That means libgpiod or periphery should work.

timber mango
#

I am going to try periphery and see what happens.

gilded cradle
#

What do you get if you type sudo apt-cache search gpiod?

timber mango
#

I needed some custom udev rules, which I pieced together from various bits I found through googling. I added missing information to make them complete. apt gpiod is installed, but I have not figured out how to use it yet, due to very little or bad documentation. It is a minor miracle that I have been able to get this far. I have had to piece together a lot of little bits of information.

timber mango
#

Thank you. I will take a look. I am gaining a lot of good knowledge about this stuff. 🙂 I am thankful for a good analytical brain! 😉

gilded cradle
#

🙂

timber mango
#

I figure this should be good for a tutorial at some point.

timber mango
#

Is Github broken? I can not clone any of my repos now.

#

I just added a brand new ssh key.

manic glacierBOT
#

"Merge pull request #2005 931 from tannewt/esp32s2_digitalio"

I noticed that instead of being quasi-complete as they were a few days ago, these translations were back in the range of 2/3 complete.

Inspecting the git history, I saw that they were unexpectedly changed in the merge commit 357467022. This is easiest to see if you git diff 357467022^ 357467022 -- locale, you can see that e.g., this message translation is removed accidentally:

 #: shared-bindings/rgbmatrix/RGBMatrix....
timber mango
#

In Discord Discovery, I looked for science and technology servers, but Adafruit did not come up.

crimson ferry
#

It's in Explore Public Servers in the Discord app, under Education.

timber mango
#

Ahhhh, OK. I still think it should show up as a tech selection too.

#

I do not understand why I am getting authentication errors when I try cloning a repo, even if it is in my account. I just added a new ssh key for myself.

static shale
#

i have an issue with pyttsx3 in python anyone can help me?

rose dust
#

Hey,
Is there a way to get the raw advertisement bytes when BLE scanning?

entry.advertisement_bytes doesn't seem to be available when using Adafruit_CircuitPython_BLE.

manic glacierBOT
#

FYI - On recent attempts, when re-flashing CP to the board, the FS becomes inaccessible from Linux. ( as noted above -- it seemed like I was able to access it on some previous occasion)
When I plug it into the Mac it is recovered and the files on the CIRCUITPY drive are once again available to Linux, that is, the FS is not corrupted or erased, but I do have to go through the step of plugging it into the Mac before I can use it.

latest try with ```
Press any key to enter the REPL. Use CT...

simple pulsar
#

@rose dust You can turn any Advertisement into bytearray with bytes(ad) - I'd imagine under the covers it is reconstructing it from the parsed data... things like field order could be different from how it arrived.

manic glacierBOT
#

Length was stored as a 16-bit number always. Most translations have a max length far less. For example, US English translation lengths always fit in just 8 bits. probably all languages fit in 9 bits.
(in fact, all language string lengths presently fit in 8 bits)

This also has the side effect of reducing the alignment of compressed_string_t from 2 bytes to 1. So on average I estimate 1.5 bytes were saved per string.

Because the length of the string now counts against the compressed ...

ionic elk
#

@lucid solar I've had that experience with a number of chips. "Wow this IC is awesome and does this super cool specialized thing" followed shortly by "gosh darn it it's more expensive than an IC/FPGA/SPIFlash I could easily emulate it on"

tulip sleet
#

@rose dust @simple pulsar is correct, the advertisement gets reconstructed. But you can see all the components at Advertisement.data_dict, in dictionary form, which is probably more convenient anyway.

I am currently re-implementing _bleio for use on host computers (MacOS, Linux, Windows), and the underlying BLE libraries don't return the raw advertisement. In fact they discard some parts of it, unfortunately, and I can't recover an equvalent advertisement

manic glacierBOT
timber mango
#

Is anyone else having trouble with Github authentication when trying to clone repos??

tulip sleet
#

@timber mango could you paste the message? Do you have 2FA turned on?

timber mango
#

I do not have 2FA on. ```$ git clone git@github.com:hybotics/Adafruit_CircuitPython_RFM69.git
Cloning into 'Adafruit_CircuitPython_RFM69'...
sign_and_send_pubkey: signing failed: agent refused operation
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.```

#

I have never seen that "signing failed" error before.

solar whale
#

@timber mango try git clone https://github.com/hybotics/Adafruit_CircuitPython_RFM69.git

#

I just cloned it here.

tulip sleet
#

@timber mango https access is to be preferred

timber mango
#

Oh!

tulip sleet
#

i never use ssh anymore. have been use https access for years

timber mango
#

I do too and do not understand how I did not have https.

patent elbow
#

Hey @slender iron I flashed my esp32 s2 wroom saola with the master branch and it appears to boot, but I cannot enter antything in ther terminal.

#

Is this expected? I tried on Pop!OS. I can plug it into my mac or windows if this isn't expected towork yet.

solar whale
#

@patent elbow the REPL and CIRCUITPY drive are on the different Pins (GIPO 19 is D-, GPIO 20 is D+ ) you need a separate USB connection for it.

patent elbow
#

Ahhh... 🙂

#

I guess my USB breakout board from SparkFun needs to be soldered up.

#

Thanks.

solar whale
patent elbow
#

I do have a few macs, yes. I'm professionally an iOS app developer. I seem to only have a USB-C breakout. Do you know if I can ignored CC1 and CC2 on the breakout? Just connect D+, D-, GND and Power?

solar whale
#

sorry -- outside my "comfort zone" 😉 Hope someone else can comment.

patent elbow
#

No worries. I'll keep googling. Trying to be lazy. 🙂

tulip sleet
#

@slender iron could clarify when he is on

solar whale
patent elbow
#

Nice. Both look good, just trying to do it with what I have. I might just hook it up and leave CC1 and CC2 floating. What's the worst that could happen? 🙂

#

Or I could destroy a USB cable and crimp ends on it.

#

Well, it popped up as a drive, but it says the contents cannot be displayed.

#

And I can see the contents on my mac. 🙂

#

So, just to confirm, it seems like CC1 and CC2 are only needed for power delivery in USB-C.

manic glacierBOT
solar whale
#

Once you see it on your Mac -- go back to Linux and it should show up OK

#

I can read/write to it on my Linux box after just plugging it into the Mac once.

patent elbow
#

Yep, it shows up on the linux box fine after that. So strange.

#

My mac also decided that it was some sort of Keyboard. I told it no.

solar whale
#

agreed -- yes - I see that as well

#

Once it has been anointed by the Mac -- it works fine via Linux.

patent elbow
#

Well, now that I'm set up, hopefully I can contribute something starting this weekend. I cleared it with my company that I'm allowed to contribute to open source projects. It's been a while since I've written C, but I write C++ daily. I'm still a bit of a hardware noob too.

ionic elk
#

@indigo wedge Found the issue. I moved reset pin protections to board_init, thinking they were safe there because board init is before reset_port in main(), but there's actually a second reset_port in port_init. So the flash pins were getting reset again - and man, when they get reset it is weird, the debugger gets completely baffled and your code just jumps to random functions addresses for hundreds of steps before failing.

#

Fix is coming in with my PR but you can solve it locally by just commenting out reset_port in port_init

indigo wedge
#

yes that's what i've done for now 😄

manic glacierBOT
slender iron
#

@solar whale @patent elbow I found some issues with the flash writing code yesterday. I really need to factor out the caching from the external flash stuff. I think I have a temporary fix in my busio branch. Unfortunately, I have a concurrency issue still where I get "unsupported byte code" but if I add printfs it goes away.

#

I was trying to use the sht31-d library with the new I2C work

#

it's untested now

#

should come by monday

patent elbow
#

Awesome! Can’t wait.

slender iron
#

you can follow along with my esp32s2_busio branch

pastel panther
#

@slender iron is there an easy-ish way to tell what is working-ish in a port by looking at the port's directory in the CP repo?

slender iron
#

generally it's what modules are enabled

#

but with me turning on busio SPI and UART are just stubbed out

onyx hinge
slender iron
#

and it doesn't cover things like accurate sleep timing and filesystem reliability

patent elbow
#

Is there a list of bugs for esp32 s2 stuff to start looking at, or just general testing and familiarization the best way to start contributing?

slender iron
patent elbow
#

Sounds good. Bookmarked.

slender iron
#

there are definitely more bugs than those listed 🙂

onyx hinge
#

@slender iron okay to remove the esp8266 label on circuitpython github? I just removed the 1 straggling issue tagged with it

pastel panther
#

Thanks both. I just wanted a way to sanity check if a port is in a good enough state to make a board that uses it. Danke!

slender iron
#

ya, I think you can disable it

#

@pastel panther I think that's potentially a different interesting question because it's a matter of pinout confidence

pastel panther
#

🤔

#

@pastel panther what would be the worst case of an incorrect pinout, assuming I check pin capabilities against the DS while making the board?

slender iron
#

are you going to use a module?

#

the s2 has a full pin matrix for i2c, spi and uart

#

the high speed stuff is a bit pickier

#

(there are actually two muxes for pins)

pastel panther
#

no, a bare chip. I'm thinking about making a pro-micro pinout imxrt106x

slender iron
#

oh, you aren't talking s2 🙂

pastel panther
#

no, I just happened to jump into the convo with something seemingly related :0

slender iron
#

🙂

#

tries to remember the imx pin muxing

#

imx is a bit trickier because it requires external flash

pastel panther
#

ya, I imagine I'll remix one of @indigo wedge 's boards

slender iron
#

ya, that's the safest bet, remix an existing one

#

and make sure to read the layout guidelines doc

pastel panther
#

right

manic glacierBOT
slender iron
#

@lucid solar it goes away if I printf every malloc...

patent elbow
#

I don’t feel like that’s very sustainable. 😉

slender iron
#

me neither 🙂

#

that's how early the port still is

patent elbow
#

That’s why I feel like I have a chance to be able to contribute. 😄

slender iron
#

😄

#

that'd be great

pastel panther
#

@balmy sail 👋

balmy sail
#

aha yes! theres too many buttons on this thing for me;)

#

so im guessing that i need to first have a look at basic spi coms, and then look at how the adxl34x works with it? do you have any resources that would be a good place to start? @pastel panther

pastel panther
#

yes, indeed I do, one moment please... 👀

balmy sail
#

haha cheers

pastel panther
#

This one is SPI-only so we'll have to do things a bit differently for the 34x so we can support both SPI and I2C, however it's a decent example of how SPI is used

balmy sail
#

would it be easier to start with a library thats just for spi for simplicity? then combine them?

pastel panther
#

ya, I would do something like:

  • fork the existing lib
  • copy the existing adafruit_adxl34x.py to something like adafruit_adxl34x_spi.py
  • replace the I2C specific parts with SPI parts
  • test, test, test
  • refactor to join the two
balmy sail
#

sounds like a plan