#circuitpython-dev
1 messages ยท Page 306 of 1
@tannewt I can look into it if you have a pointer to where else we're doing this. In samd audio it looks like audio interrupts "are involved" (e.g., we look at event_interrupt_active to decide whether more data needs to be fed) but it still didn't work, which is why #2889 had a similar "fix" for audio weirdness. I guess both could use further looking into rather than speculative fixes.
Ya, I should have thought about it more with the samd fix as well. I'm ok having it in temporarily. It ...
Ok, I've polished this up and switched Sphinx to using autoapi on top of the stubs.
@jepler want to do a review for merge?
@slender iron it is already in master, so it works, it's just slower (and the USB connection drops after a while)
the usb thing is waiting on tinyusb right?
i think so tinyusb #396 or something like that
kk
I'd be happy to see a beta.1 soon
it'd be nice to get docs swapped over to stubs
right https://github.com/hathach/tinyusb/pull/396 and thach says he'll test it soon
stubs would be nice. i had a q about mock stuff too, i feel like #pylint: disable=no-member is getting out of hand in some cases. Do we just need to add more more complete native module stubs to blinka to fix that? I ran into it on microcontroller.cpu.temperature, for example.
ya, adding more info to blinka would fix it too
I saw the new Adafruit product page for Teensy 4.1, so I updated board to match.
I think it's a good idea.
Would you mind updating our test repo including the CI checks? https://github.com/adafruit/Adafruit_CircuitPython_TestRepo
The step after that would be to update the cookiecutter: https://github.com/adafruit/cookiecutter-adafruit-circuitpython/
How is the support matrix generated? It has modules that aren't in the build, and vice versa (e.g., PyPortal)
Oh that cookiecutter looks nice!
Sure I'll prepare a pull request for testrepo โ there's at least one question that stays open though: what's the license of the logo? (In the favicon.ico)
@tulip sleet another option for things not stubbed out in Blinka is to update the .pylintrc config file to ignore them at the module level.
@crimson ferry support matrix is built with this: https://github.com/adafruit/circuitpython/blob/master/docs/shared_bindings_matrix.py
@raven canopy that's an interesting idea, but I like having pylint catch typos as well. It would be a significant job to add stubs for all the native modules in blinka, but it would also make it clear what's not in blinka and what could be
as an example, board is already ignored by pylint for every lib. https://github.com/adafruit/Adafruit_CircuitPython_BLE_Adafruit/blob/master/.pylintrc#L159
I'm just puzzling over some of the BLE CP code.
I've noticed something strange about AdafruitColor. If I make one then I can make its bytes() representation larger by calling dir() on it. Is this an intentional/desirable side-effect? ```>>> from adafruit_ble.advertising.adafruit import AdafruitColor
ca = AdafruitColor()
ca.color = 0x112233
ca
Advertisement(data=b"\x0a\xff\x22\x08\x06\x00\x00\x33\x22\x11\x00")
bytes(ca)
bytearray(b'\n\xff"\x08\x06\x00\x003"\x11\x00')
ca
Advertisement(data=b"\x0a\xff\x22\x08\x06\x00\x00\x33\x22\x11\x00")
dir(ca)
['bytes', 'class', 'dict', 'init', 'len', 'module', 'qualname', 'repr', 'str', 'address', 'connectable', 'matches', 'rssi', 'scan_response', 'tx_power', 'complete_name', 'from_entry', 'prefix', 'data_dict', 'flags', 'mutable', 'short_name', 'appearance', '_rssi', 'manufacturer_data', 'color']
ca
Advertisement(data=b"\x02\x01\x00\x0a\xff\x22\x08\x06\x00\x00\x33\x22\x11\x00")
bytes(ca)
bytearray(b'\x02\x01\x00\n\xff"\x08\x06\x00\x003"\x11\x00')
020100 gets prefixed on which I think is flags=00 in BLE lingo. It looks legal to my untrained eye but it's very odd the way it appears after a dir(). There is some stuff about lazy instanitation in the code but I would have thought that would all have happened if bytes() was called?
@tulip sleet the stub work we're doing for docs may make it easy to add stubs to blinka
I wonder if pylint can use the .pyi directly
i did a brief search. it doesn't look like it can...
transforms seem the allowable route: http://pylint.pycqa.org/en/stable/how_tos/transform_plugins.html
@prime flower @pastel panther I started a doc for ideas doable for the mentored sprints
@slender iron thanks, I added two ideas. Will add more as I think about it.
@solar whale I was browsing thru the RFM9x guide on Learn. It mentions that the circuitpython library " does not support advanced RadioHead features like guaranteed delivery or its internal node addressing scheme.". You added these recently, right?
Are you interested in writing a guide which uses the node addressing scheme with guaranteed delivery? We could also update https://learn.adafruit.com/multi-device-lora-temperature-network.
@pastel panther @slender iron Drivers could use some updates. looking at WRT reorganizing Internet, IoT, Radio (https://github.com/adafruit/Adafruit_CircuitPython_Bundle/pull/234). May be do-able as a quick sprint
๐
@prime flower yes that was added โ I can update the guide if you want. As much as I hate guide writing, I will work on one for the updates. Should I just add it to the existing RFM9x guide? Same for RFM69. Which guide were you looking at? Would you prefer a new independent guide?
@gilded cradle I want to add the UDOO BOLT to Blinka, but I am a little lost going through the PlatformIO tutorial. Help please?
@solar whale I'll message you in authors
Thanks for your help on this @tannewt
Nice speedup! One suggestion to remove duplication. All good otherwise.
if (!mp_obj_get_int_maybe(tuple_items[0], &self->points_list[2*i]) ||
!mp_obj_get_int_maybe(tuple_items[1], &self->points_list[2*i + 1])) {
self->len = 0;
gc_free( self->points_list );
self->points_list = NULL;
mp_raise_ValueError_varg(translate("unsupported %q type"), MP_QSTR_point);
}
@timber mango I don't use platformio at all. Check out https://learn.adafruit.com/adding-a-single-board-computer-to-platformdetect-for-blinka and https://learn.adafruit.com/adding-a-single-board-computer-to-blinka
That tutorial refers one to the PlatformIO tutorial.
@gilded cradle I meant PlatformDetect, not PlatformIO. ๐
Ah, gotcha. I'm in a meeting at the moment, but after I can help out.
OK.
Besides the comment, I noticed that ulab doc is empty now. ulab is an oddball, it is just a rst file rather than a source file. There's a pyi file there, but its content still looks like it's restructuredtext. The fact that this is not showing an error during doc build is worrying; if it's treating it as pyi but the content is nonsense, the build should fail.
Documentation of "math" is missing.
There's a page for "protomatter" and there shouldn't be. It was renamed rgbmatrix, which ...
these should probably be $(PYTHON), at least the added lines. Otherwise, systems where the bare python program is python2 fail. This was the case on my usual development system, made out of debian stable.
Got my production Big Honking Button and Sol boards from MacroFab today. ๐ฏ
Now to just program, test, and attach a button and panel to 149 more of these...
@timber mango what are you stuck on? Also, does the udoo bolt run linux?
I do not know what information I should use for detection.
I have a UDOO BOLT now. ๐ With 32GB RAM and 1TB SSD. ๐
Nice. What do you get when you type cat /proc/cpuinfo?
Well, basically you want to look for something that it returned that identifies the board as the UDOO bolt. If you look at __init__.py, each of the functions looks at different files. You can go down one by one until you find something unique., but I usually find something in the first or second file.
vendor_id : AuthenticAMD
cpu family : 23
model : 17
model name : AMD Ryzen Embedded V1605B with Radeon Vega Gfx
stepping : 0
microcode : 0x810100b
cpu MHz : 1486.465
cache size : 512 KB
physical id : 0
siblings : 8
core id : 0
cpu cores : 4
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb hw_pstate sme ssbd sev ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 xsaves clzero irperf xsaveerptr arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov succor smca
bugs : sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass
bogomips : 3992.76
TLB size : 2560 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 43 bits physical, 48 bits virtual
power management: ts ttp tm hwpstate eff_freq_ro [13] [14]
processor : 1
vendor_id : AuthenticAMD
c```
ok, what about with cat /proc/device-tree/compatible?
I do not have that.
/proc/device-tree/model
I do not have that either.
Ok, which distro of linux are you running?
Ubuntu MATE 18.04
That's tough. It doesn't really give you anything useful in the first and the others are missing. I'll have to get back to you on that. Want to make an issue on https://github.com/adafruit/Adafruit_Python_PlatformDetect ?
Well, the first was over 200 lines. I just posted the first 30.
Oh gotcha. can you put it in a text file and upload?
There it is.
Yeah, nothing else really useful. The problem with trying to just check for something general like an AMD Ryzen proc is that it will probably produce false positives.
Probably.
What was the actual message you received when you typed: cat /proc/device-tree/compatible
Yeah that will work for the processor. For the board, unless that proc is used on no other boards, we need something more specific to be sure the board is unique.
yeah
Bummer
You may just need to poke around and see if you can find something.
OK.
what does uname -a show?
Linux bolt 5.3.0-51-generic #44~18.04.2-Ubuntu SMP Thu Apr 23 14:27:18 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
That might be workable
How so?
We we can narrow down the processor with /proc/cpuinfo and then "bolt" is in the uname.
"bolt" seems to be the only unique item there.
Yeah, the combination may be enough
I have a Particle.io Xenon processor that I've converted to Circuit Python. I've installed the latest .udf2 file 5.3. After about 5 - 10 minutes or so the system crashes with the following error (see below). I'm running the adafruit gps_echotest.py example code. The putty session is closed once the error occurs. Any suggestions?
You are in safe mode: something unanticipated happened.
CircuitPython core code crashed hard. Whoops!
Crash into the HardFault_Handler.
Right, cpuinfo returns "Ryzen Embedded V1605B"
Then there's probably no other boards with that proc called a bolt
I am betting on that.
Try using os.uname() to find bolt
posix.uname_result(sysname='Linux', nodename='bolt', release='5.3.0-51-generic', version='#44~18.04.2-Ubuntu SMP Thu Apr 23 14:27:18 UTC 2020', machine='x86_64')
Maybe something like if "nodename='bolt'" in os.uname():
for the constant, you should probably use UDOO_BOLT = "UDOO_BOLT"
OK, but where does the other go?
if "nodename='bolt'" in os.uname(): would be in your board detection code.
I do not know where to put that, or have I not got that far yet?
Further down in the tutorials?
Sounds like you haven't got that far yet
OK, let me go see if I can figure it out on my own then. ๐
nodename is just the hostname, and can be changed, so unfortunately that may not be great
Thanks for the pointers.
Thanks dan, that won't work then
Durn.
yw @timber mango. Seems to be a challenging board.
@timber mango how about the output of sudo lshw ?
I have this on my old Dell workstation:
salmonx
description: Space-saving Computer
product: OptiPlex 7010 (OptiPlex 7010)
vendor: Dell Inc.
version: 01
serial: [redacted by Dan]
width: 64 bits
capabilities: smbios-2.7 dmi-2.7 smp vsyscall32
configuration: boot=normal chassis=space-saving sku=OptiPlex 7010 uuid=44454C4C-5200-1043-804B-B7C04F485831
*-core
description: Motherboard
product: 0WR7PY
vendor: Dell Inc.
physical id: 0
version: A01
serial: /[redacted]
*-firmware
description: BIOS
vendor: Dell Inc.
physical id: 0
version: A29
date: 06/28/2018
size: 64KiB
capacity: 12MiB
These lines are right at the beginning
unfortunately you need the sudo to get a lot of these details
I know. I do not see anything useful there. I posted a query on the UDOO forums to see what I can find out.
I am itchy to install Ubuntu on the Bolt's SSD, but I think I need to install Windows first or it will not be happy.
I posted on the UDOO forums that I am trying to get the UDOO BOLT added to Blinka and what that is and that I do not work for Adafruit.
@timber mango @gilded cradle apologies if this is retreading old ground, but for x86/amd64 PC-style devices the files in /sys/class/dmi/id may be useful. some are only readable by root, but others can generally identify motherboard part number or such. The "uevent" line gathers up the most useful bits into a single string for searching. For instance, two of my devices say MODALIAS=dmi:bvnLENOVO:bvrG4ET90WW(2.50):bd12/20/2012:svnLENOVO:pn2359CTO:pvrThinkPadT530:rvnLENOVO:rn2359CTO:rvrNotDefined:cvnLENOVO:ct10:cvrNotAvailable: and MODALIAS=dmi:bvnAmericanMegatrendsInc.:bvrP1.90:bd07/27/2015:svnToBeFilledByO.E.M.:pnToBeFilledByO.E.M.:pvrToBeFilledByO.E.M.:rvnASRock:rnH97Pro4:rvr:cvnToBeFilledByO.E.M.:ct3:cvrToBeFilledByO.E.M.:
as you can see the info is often not filled or not available
oh interesting, did they basically stick an Arduino on the motherboard next to a whole PC? Not sure how well that'll fit blinka's way of thinking of HW. A challenge for sure.
for the other bits (the i2c bus and gpio; spi doesn't seem to get a mention?), the interfacing is via a proprietary static link library https://www.udoo.org/docs-bolt/BIOS_UEFI_and_Tools/EAPI.html
./BIN/linux_64/libEAPI.a
@onyx hinge Thank you! I am looking at those files now. Is the product_uuid unique just for a product or for each board?
Yes, somewhere on the UDOO BOLT there is something that is compatible with an Arduino Leonardo. I have not looked closer to see what it actually is though, because I will not likely be using that feature.
I do not see anything in uevent that would be useful. ๐ฆ
Most of the things that could be useful are not even filled in and just contain "Default string," which is not helpful at all.
The board_asset_tag might be useful. My BOLT has "SC40-2000-0000-C0|C" there. I do not know if that is unique per board type or individual board though. I have three Raspberry Pi 3 boards here, so I will check that value on each of them and see if it is the same or different.
@gilded cradle I think I am getting a handle on how board detection works in Blinka now. ๐ I am going to play with a bit of Python to see if I can grab the board_asset_tag. Is there a function that already handles that?
Has anyone else seen this combination BLE and WiFi module? https://www.dialog-semiconductor.com/products/da16600-modules It looks interesting.
I think "asset tag"s are probably intended to be unique identifiers, though who knows... for sure the thing dmi calls board_uuid should be a unique identifier for that particular piece of hardware, like a VIN
@idle owl thanks for the python weekly video! I think it got us contributors on Weblate which is awesome.
@raven canopy those lists of contributors in the weekly meeting notes, are those generated by an adabot script? can you point me at it? With weblate, we have contributors who are listed as the author of individual commits but are NOT the creators of the PR to include the changes. I think it would be good if we can recognize them in the same way as other code contributors.
@onyx hinge https://github.com/adafruit/adabot/blob/master/adabot/lib/circuitpython_library_validators.py#L828
need to add an api request to the /pulls/<number>/commits endpoint, then cycle through the entries.
note: unless you gate it with if repo["name"] == "circuitpython": it will run for all the libraries as well. not saying it isn't beneficial for everything involved, just mentioning it.
@timber mango I don't think there is a function for that, though it would be a nice one to add.
Thanks @onyx hinge. Anything like that is helpful.
@raven canopy thanks, that was enough to point me in the right direction. adabot was pleasant to hack on.
do nrf52840 devices need the 32Khz crystal for bluetooth to work?
@marble hornet no, as long there's a 32MHz crystal, it can work. It divides it down. You can't make a crystalless board that can do Bluetooth, because the internal RC clocks aren't accurate enough for the timing. The radio won't even work without specifying a crystal clock, I think.
the CPB, CLUE, and Feather Sense have only a 32MHz crystal. The RayTac etc. modules come with a 32MHz crystal inside>
The Feather nRF52840 has both 32kHZ and 32MHz
Okay, then the has_crystal definition in the board config is for to say if there is a 32Khz and is not taking about the 32Mhz?
the #define is BOARD_HAS_32KHZ_XTAL to make it clear.
are you seeing a different #define name?
e.g. from mpconfigboard.h for the CLUE:
// No 32kHz crystal. THere's a 32MHz crystal in the nRF module.
#define BOARD_HAS_32KHZ_XTAL (0)
ah, thank you!
I don't think there is a function for that, though it would be a nice one to add.
@gilded cradle Would I need to add that new function to Blinka itself? I will poke at PlatformDetect and see what I can find. ๐
@timber mango, you can add it to __init__.py in in PlatformDetect. If it helps, just remember that PlatformDetect should work independent of Blinka since Blinka depends on PlatformDetect.
Exactly
Oh, I added a comment to issue #74 for the HT16K33 library. I believe I can add multi-display support completely transparent to users. It will continue to work exactly as is now unless somebody activates the multi-display support. ๐
That sounds good
It took me a bit of thinking to work it out, but I think I have it locked into my brain now.
And, I have notes in my last comment. ๐ ๐
@slender iron @indigo wedge I'm having some trouble with the 1010 evk not halting properly when code is reloaded over SWD. I can't run mon flash erase either. Have either of you had any issues with that?
The one that's built in, right? What's your toolchain for connecting gdb to it?
nvm it's just localhost 2331
no I do still need a gdb server application, durr. @indigo wedge what are you using for the gdb server?
@ionic elk did you upload upgrade all the j-link sw? (Is there J-link on the board? if so, did you try an external j-link?)
if you are using jumpers, make sure RESET is connected (but I am speaking about issues I had with SAMD51)
I'm using an external Jlink with JLinkGUIServerExe (though I'm using the command line interface). Specifically, it seems to be having trouble interacting with flash memory after the chip has crashed - it's unable to halt the processor. I'm not currently using the on-board CMSIS-DAP programmer because I don't know how to run GDB with it (I've put the power jumper on USB-OTG so it shouldn't even be powered)
In order to get around the failure I have to switch over to the CMSIS-DAP and use the drag-and-drop programming, which puts the chip back in a state that I can program it with the Jlink once I swap back.
sorry I mean "upgrade" not "upload"
they are always fixing LOTS of bugs; if you're having trouble you can file an issue with them, but it would be good to test with the latest
JLinkARM.dll V6.60d (DLL compiled Jan 9 2020 17:43:40)
I'll give it a shot but this strikes me as something that might have to do with hardware settings, I had similar issues with STM32 boards that were flaky about power.
now, how to update it....
to the 1000 page manual!
why can't everyone just use brew ๐ฉ
@tulip sleet Does the super inexpensive J-Link do everything the EDU J-Link does? I am guessing the EDU does a lot more because of the size of it.
they say it is the same: https://www.segger.com/products/debug-probes/j-link/models/j-link-edu-mini/ the bigger one has bigger connectors, so it needs a bigger box
dang it how do I update this software they don't tell you ANYWHERE
that's how i understand it as well. the different versions are only different in packaging, connector, and most importantly licensed usage. i use my edu-mini for much less than most around here, but i've yet to hit any limitations.
@ionic elk which software? The firmware is updated automatically when you start it. The others have installation packages for the specific os
So do I have to manually go in and delete my software pack and reinstall>?
what os are you on?
mac
it's a pkg file, doesn't that install if you double-click?
I'll see whether it does a clean replacement
it does on windows and linux for me
I'm just used to most mac apps having a self-update
or being on brew, which updates them
It's pretty rare to have to re-download, hence my confusion
yep it installed a duplicate hmmm guess it installs a duplicate, then symlinks the most recent
so you could clean up the old ones as you wish
its always duped on Win10 for me, as well. though, i'm a little behind obvs. ๐
The .deb's do a nice job of cleaning up
well, seems a little better so far
they still do symoblic links
halbert@salmonx:~$ ls -l /usr/bin/JFlashLite
lrwxrwxrwx 1 root root 36 Apr 28 04:57 /usr/bin/JFlashLite -> /opt/SEGGER/JLink_V672/JFlashLiteExe
halbert@salmonx:~$ cd /opt/SEGGER/
halbert@salmonx:/opt/SEGGER$ ls
JLink JLink_V672 ozone
nope nevermind still no dice
can't read big blocks of memory, or halt the processor
too bad
are you writing to internal or qspi?
It's the i.MX so I assume it's a mix
I don't 100% grok the process, so I guess that's what I should work on now
i looked on their forum but don't see anything obvious. However, that is not the official support fourm https://forum.segger.com/index.php/Thread/5826-SOLVED-Unable-to-flash-QSPI-flash-connected-to-IMXRT1052. They do respond to tickets
I guess I'll shoot them a ticket! But still, I'd assume that Scott or Arturo have gotten GDB up and running properly at some point..
ping scott about it, sure
FYI, I've just starting looking at some BLE stuff and put in a few tickets for things I spotted in the code, some rather minor: https://github.com/adafruit/Adafruit_CircuitPython_BLE_BroadcastNet/issues/7 | https://github.com/adafruit/Adafruit_CircuitPython_BLE_Eddystone/issues/7 | https://github.com/adafruit/Adafruit_CircuitPython_BLE/issues/83
Comparing Adafruit_CircuitPython_BLE_BroadcastNet/adafruit_ble_broadcastnet.py Line 129 in c6328d5 color = ManufacturerDataField(0x0A0E, "<f") with https://circuitpython.re...
I noticed: the code makes us of Google's Bluetooth Company ID (0xfeaa) but doesn't describe it as such and it's duplicated as a little-endian 16bit value, embedded in a cryp...
@simple pulsar also see https://github.com/adafruit/Adafruit_CircuitPython_BLE_Adafruit which I am just about to announce; I have to finish a couple of guide pages
that is connection-based sensor stuff, as opposed to advertising
Thanks, I'll have a look.
needs 5.4.0-beta.0 or later to work for some of the services
You have a 0 byte https://github.com/adafruit/Adafruit_CircuitPython_BLE_Adafruit/blob/master/adafruit_ble_adafruit/__init__.py ? I think somehing either chokes or used to choke on that? Maybe!
i thought we could omit it, but some things want to see __init__.py to have it as a package. I don't think an empty one will break things. I looked in the bundle and there are a number of empty __init__.py files
Oh, maybe that's what I'm remembering, perhaps the 0 byte was needed.
yes, long ago I thought it could be omitted in python 3 (vs 2), but that's not the case
@ionic elk just to my desk now
ya, it does work for me
I had to add a mon halt before mon reset
the imx is different than what we're used to because the flash is only external
even with the halt, I still get ERROR: Timeout while preparing target, core does not stop. (PC = 0x20200630, XPSR = 0x61000003, SP = 0x20201D68)!
@onyx hinge That's great to hear!
@ionic elk unplug everything and start fresh
@slender iron do you use jlink directly, or are you using the DAP?
jlink iirc
@tulip sleet Ah, this is what I was remembering: https://github.com/adafruit/circuitpython-build-tools/issues/29
should be off off on off, for QSPI, right?
yeah that's what I've got
the flash stores it's own config
what's a bootstrapping problem?
if you did manage to erase the whole flash it won't be able to boot to the flash
have you gotten it to run at all yet?
No, I'm getting this:
Program received signal SIGTRAP, Trace/breakpoint trap.
0x860c0000 in ?? ()
(gdb) where
#0 0x860c0000 in ?? ()
#1 <signal handler called>
#2 0x860c0000 in ?? ()
#3 <signal handler called>
#4 0x600233c2 in Reset_Handler () at supervisor/port.c:240
I wasn't sure what to make of it, since I was getting so many erase and write errors before, but now I've gotten at least one "clean" program and it's still happening
port.c:240 is the // Clear OCRAM bss section
hrm, do you hit a breakpoint on main?
I don't remember this happening before my current branch but I don't see how my pin resets would have borked it
@simple pulsar i see, it was a problem the other way!
is the QSPI on the GPIO pins?
@simple pulsar pages just published:
https://learn.adafruit.com/bluefruit-playground-app/circuitpython
https://learn.adafruit.com/bluefruit-dashboard-web-bluetooth-chrome/circuitpython
also there is a simple example (TemperatureService only) in the examples that has both client and server sides
I noticed that USB was not on GPIO, so I guess the idea that the chip's core memory could be on resettable pins didn't even cross my mind
The logo is CC-BY 4.0: https://www.dropbox.com/sh/l6tp9ym5nf8h5v9/AABGu_q2pcdUQdx1avr8Xvvda?dl=0&preview=license-readme.txt
It's worth noting that the copyright license on the logo doesn't override the limitations of using it because of Adafruit's trademark.
Still looks like it has the duplication. Did you accept the suggestion without pulling it down to your local copy?
what options do I have on a PyPortal for the equivalent to this?
https://circuitpython.readthedocs.io/en/latest/docs/library/binascii.html#binascii.b2a_base64
I found these BLE related docs by a search: https://circuitpython.readthedocs.io/en/latest/shared-bindings/_bleio/Adapter.html - it describes start_advertising() but this is not the same as the adafruit_ble library one. Is it worth having a note in the text at the top to mention most users should be using adafruit_ble or whatever guidelines are for selection one or t'other?
@simple pulsar there is already a note to use dafruit_ble here: https://circuitpython.readthedocs.io/en/latest/shared-bindings/_bleio/__init__.html
Not directly related to this but is there any way to control or influence what channel an Advertisement goes out on?
@tulip sleet Thanks, my search ended up directly on the Adapter page so I didn't see that. Search engines risk bringing people in to deeper pages...
yes, i find readthedocs not the best for finding things, since there are so many cross references
In a different world we used to mark the top and bottom of each page when there was an important note. Both ends was an attempt to reduce risk from the other pitfall of anchors bringing in users half way through a long page.
we need more BLE guides, and there is too much of a disconnect between Learn Guides and readthedocs. But these are long-term problems not immediately solvable
Not directly related to this but is there any way to control or influence what channel an
Advertisementgoes out on when it's transmitted?
It is possible to restrict advertising to only some of the main primary advertising channels 37-39. The secondary channels cannot be turned off.
@tulip sleet what's the kosher place to put never_reset_pin reservations for JTAG and stuff? The ST port has them in peripherals/gpio but I don't think that's the right spot for them.
those pins are mostly hardwired, so they don't need to be reserved because they're not part of the pool. On Metro M0 I think one of the SWD pins might be reused for something like the NeoPixel
on most of these chips they are dedicated
Trying to understand properly what you mean. On STM and i.MX they're a part of the GPIO peripheral and can be reassigned to other purposes. Or do you mean they're left out of the pin definitions completely for NRF and Atmel? I need to exclude them from the automatic turnoff in reset_all_pins at least
@ionic elk they are dedicated for SWD use on most boards, except on Metro M0 where PA30 is reused for the NeoPixel. But see atmel-samd/common-hal/microcontroller/Pin.c: reset_all_pins(), which does not reset the USB or the SWD pins. Those are hard-coded, and don't need to be in never_reset_pins()
So the mistake that Arturo and I made was to even include them in our pin tables, basically?
@slender iron when is the deep dive this week?
they are in our pin tables, but it was easy to hardcode them in reset_all_pins(). That may be harder in STM-land if they wander around
i meant they are most not in boards/*/pins.c; they are not available to circuitpython
Or in the __init__.c of Microcontroller, too, for most ports I would assume?
Hello ... I'm new to discord and all that, so please tell me to get lost if I'm doing it wrong. ๐ I found what I think might be a bug in the latest 5.4.0 RC. Should I report that here or open an issue?
Please open an issue, unless you're unsure. But an issue is fine.
it's better to record it for posterity
10-4. Basically, 'microcontroller.cpu.voltage' hangs - at least on an M4 board I'm working on. Worked fine with 5.3.
And I don't have time to attach a debugger and trace it.
that sounds like a real bug; thanks for finding it
what's the particular board? or is it custom
Custom. With at SAMD51N20A
we expect there to be a numbero of issues with the beta, because of the new lower_power stuff
Ok. I'll go ahead and open and issue. microcontroller.cpu.temperature and ....frequency work.
Also, is it allowed for me to be slightly annoyed at the decision to name only SAMD51s "M4"s? Like, almost every board we work with is an M4. STM32s are M4s. NRFs are M4s. Drives me nuts
Haha, agree. Mine has _m4 in the name. Maybe I should change it just to be different.
I'd definitely dig a move in that direction! I guess m4 was picked because for the very early hobby boards it was one of the only m4s that was consumer facing.
@ionic elk, no, the SWD pins are in __init__.c. They are just mostly not available to circuitpython, and the reset code special-cases them
But my buddy in my makerspace is always asking questions about "M4s" and I'm always confused for a minute before prying out of him what M4 he actually means
@tulip sleet so if you were determined, you could brick your own board with Microcontroller ๐
historically, we were only concerned with Atmel chips, so it was SAMD21 vs SAMD51. In retrospect calling the boards M4 was not the best distinguisher. It was originally AVR vs M0, still all in the Atmel line. e.g. classic Arduino vs Zero.
I getcha but man, SAMD51 isn't that hard to say
Metro_51 has a cool enough ring to it
Oh well lol
really, the circumscribed world at that time was all Atmel. The other chip mfrs were extremely uninterested in hobby stuff, it appeared.
๏ฟผI think that M4 is the reference to the ARM ip.
Atmel was the main user of that core early on along with the M0.
i am not trying to excuse it, just explain the circumstances
Yeah totally. I'm not actually irritated, it was a historic shift to ARM, but it's definitely a really interesting case study of how a brand name can impact people's understanding of the underlying technology
naming stuff in expanding fields is tricky
microcontroller.cpu.voltage hangs on latest 5.4.0 RC (5.4.0-beta.0-76-g0f55f5865-dirty), and only a hard reset appears to bring it back. Both .temperature and .frequency work, though.
This appears new - it didn't happen on 5.3.
Here is how to reproduce:
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.4.0-beta.0-76-g0f55f5865-dirty on 2020-05-14; BDMICRO Vina M4 v004 with samd51n20
import os
import microcontrolleros.uname()
...
I was going to post the issue number, but there it is!
@daring ridge thanks for reporting!
@daring ridge thanks, the ADC on the SAMD51 is kind of a mess, unfortunately
i was looking through things yesterday on an unrelated quest, and saw that samd-peripherals is still using SysTick for all of that.
Yep. Thank you guys! CircuitPython rocks!
this one has lots of errata
oof
external references are broken, doing the temp measurement is painful, the voltage measurement has to be done oppositely from the obvious way (measuring reference vs VDD as opposed to the opposite) because it hangs otherwise, ugh, in gneral
I've seen rssi stepping which suggests there's a 5 second timer on changing channel for sending Advertisements over 37-79.
It might be useful to drop that momentarily that from 5s to 1s for some code I'm writing, I'm still investigating this so it may not help!
@tulip sleet how many years ago was that Atmel/M4 decision? The first Metro?
just curious
i think I would look at the first M0, rather than the first M4.
in the adafruit store, check the product listings and intro dates for Metro M0 Express and Feather M0 Express, and then Metro M4 Express. The dates on the videos are helpful
@inland tusk normal time. 2pm pacific on friday
Oldest Adafruit product "M0" refs I could find were Adafruit Feather M0 Basic Proto #2772, video is 12/2/2015 & Adafruit Feather M0 WiFi - ATSAMD21 + ATWINC1500 #2598 (may have been released earlier, I ordered one in Jan 2016).
Maybe the scan interval can beat against the advertisement interval in a way that you get the pattern you want. That seems hard. It might be easiest to filter the received packets. If you are looking at RSSI and distance for individual channels, I can point out some papers.
@crimson ferry neat. I'll try and remember that - it's nice to give people a timeline when I'm chatting about microcontroller industry context
@slender iron should the flexSPI protections never_reset_pin go into board.c? is that going to be early enough?
should be, since it's before port_reset
Since it's flex, they could theoretically be different per board, right? So putting direct checks in reset_all_pins is probably not a good idea
looks like there's a python version? https://pypi.org/project/circuitpython-base64/
argh I was looking at old messages
@tidal kiln but maybe nobody else answered, not sure if it's still relevant โ๏ธ
thanks. nope. you're the first. will take a look.
i think someone did a base64 lib and put it in the community bundle. may not do bin->ascii though. wonder if there was a reason we turned off the built-in...
@ionic elk ya, board.c would work!
it's still built in, just only on some boards, the wifi ones i think?
yeah, its in extmod/ so could just be a matter of receiving some shared-bindings/ treatment.
haha. two issues for just that thing: https://github.com/adafruit/circuitpython/issues?q=is%3Aissue+is%3Aopen+binascii
ha! thanks. i didn't even think to look through the issues.
me neither, until i typed "wonder why its gone" out loud. ๐
Besides the comment, I noticed that ulab doc is empty now. ulab is an oddball, it is just a rst file rather than a source file. There's a pyi file there, but its content still looks like it's restructuredtext. The fact that this is not showing an error during doc build is worrying; if it's treating it as pyi but the content is nonsense, the build should fail.
I made the script error correctly and then fixed up ulab.
Documentation of "math" is missing.
Fixed!
There's a pa...
I'm using a Metro Express M0 board with CircuitPython 5.2.0. I have built my own LED driver "shield" that simply buffers digital outputs from the M0. I am trying to write a CircuitPython program that will create a "walking" sequence of up to 5 LED's, i.e. one LED turns on then off; when the first one turns off the second one turns on, and so on. I also want to be able to vary the frequency. So in order to guarantee correct timing from LED 1 to LED 2 to LED 3, etc. my concept is to completely ...
Now needs a .po merge. (Allow maintainers to edit and I can fix it for you. ;-) )
@ionic elk The M4/SAMD51/etc naming thing is very important for end users to select the right product. It's messy in the Arduino world too, you see people talking about X doesn't work on the Zero/Due.
@ionic elk Did Tindie cancel your order for the Toasty board? They cancelled my order. ๐ฆ ๐ฆ
Thanks for addressing my comments!
maybe a debug print that should be removed?
For BLE, I get an _bleio.BluetoothError: Unknown soft device error: 0007 error if I set an advertising interval of 0.020 but 0.0201 is fine. I'd imagine this is an FP issue? If I'm reading it correctly apple recommend a 20ms initial burst so this is legit ?
@simple pulsar yeah it looks like for "0.020" the value actually stored is a little lower
Now needs a .po merge. (Allow maintainers to edit and I can fix it for you. ;-) )
Ah there's that silly button. Fix away and thanks :-D
@tannewt I think this is not sticking and I'm not sure why. I'll look at it when I get to a computer
@onyx hinge Should I file that as an issue?
the basic behavior of floating point numbers in circuitpython? no, probably not, it's not going to change anytime soon.
No, an interface that will confuse anyone who tries to set an interval value to a recommended value.
Hmm... I feel like this is a silly question, but are bytearray() objects not just mutable bytes() objects?
Yeah, I got a bytearray() back from the Bluetooth stack, and I'm slicing it using an array, but the aesio functions don't accept that slice because it's a bytearray and not bytes (which are apparently also strings)
bytes shouldn't be strings
I would have thought that a bytearray would coerce into a bytes, but maybe that's not how things go.
there is a specific way to get the array out of a "buffer" object
which includes both
@slender iron but all byte functions are handled with mp_obj_str_* functions, it looks like that takes both bytes and strs depending on how you call it.
ya, internally they are
in python2 strs were literally bytes
strings are utf-8 interpreted bytes
How do I go from a bytearray to a bytes? Doesn't saying bytes(bytearray(n)) cause an allocation?
why do you need bytes from bytearray?
Or should mp_obj_str_get_data() accept bytearray objects?
Thanks for addressing my comments!
This is for contact tracing stuff. The _bleio returns a bytearray() as part of Characteristics.value, which I need to slice up and pass to aesio.
you probably want to switch it to get_buffer
Ok, removed the debug prints.
Ah, will that accept bytes and bytearrays?
That's good. Because bytearray looks like it should be immutable.
Right. Except there's no implicit conversion from bytearray to bytes, unless you use a buffer object.
Thanks for clearing this up.
It's definitely a bug in the aesio stuff caused by me not understanding this.
sorry I didn't catch that in review
I'll write up a patch. It's always a learning process!
๐ should be easy and quick to get in
By the way, I have been able to use the AES stuff with an explicit conversion to decode TraceTogether packets in Circuit Python! So it's definitely working mostly.
๐
In order to accept both bytes objects and bytearray objects, use a
bufinfo construct to retrieve the data rather than
mp_obj_str_get_data().
@half geyser in encrypt_into the get_buffer for the destination should be write
same for decrypt into
You're right. I wonder why it worked?
maybe because you gave it a byte array?
once it's in C land it doesn't verify mutability
Could be! I'll fix that, too. Thanks for catching that.
np, got me thinking about it ๐
Added a second patch to that PR
kk
Hmm... though now it doesn't actually work.
TypeError: object with buffer protocol required
and you're passing in bytes?
Yeah. Let me break there and see if it's what I think it is.
Yes, the type at least has a .make_new of bytes_make_new
Yeah, you can't write into a string. mp_obj_str_get_buffer() returns NULL.
And bytes are strings, so you can't write into a bytes using bufinfo.
Oh weird. You can write to a bytearray. So I guess I got it backwards: bytearray is mutable, bytes is immutable. Well I'm glad it's caught now.
@gilded cradle I now have code that can read the value from /sys/class/dmi/id/board_asset_tag
I just have to look at __init__.py in PlatformDetect to see how I can use that to detect the UDOO Bolt. ๐ ๐
Somewhat-related question: How can I do a json decode of a bytearray? It looks like cpython has a .decode() to turn a bytearray into a str, but that doesn't exist here. And if I do str() then linefeeds get turned into \n which the json parser doesn't like.
And json.load() says stream operation not supported if I feed it a bytearray object.
Or do I need to wrap decode_into in some sort of stream-like object?
That does it. Thanks!
๐
@slender iron No .decode for strings? Why?
it's enabled by a setting that is used to save space
well, disabled to save code space
Couldn't it be enabled for all M4 and later?
the nrf52833 is limited flash space iirc
OK. Can .decode be enabled per build?
OK, so it could be enabled for other M4 and later boards.
ya, it should be
Is that being done now?
it should already be enabled. it's just not for the board xobs is on
Oh, OK, got it! I was getting worried! ๐
np
It looks like we will not be getting any Toasty boards. ๐ฆ Tindie cancelled my order because they had not shipped and refunded my money.
It's hidden behind CIRCUITPY_FULL_BUILD, which is enabled on my board.
bytes() does have a .decode() function, but bytearray() does not.
It looks like micropython's bytearray() doesn't implement .decode(), whereas its bytes() does.
ah, interesting
is that a CPython thing? can you call .decode() on a bytearray in CPython?
You can, I just checked to make sure.
I have used it that way.
Yeah it's annoying that bytearray doesn't have decode.
I've been meaning to fix that myself but I keep forgetting about it.
It is a useful function. ๐
Speaking of mp, do we have any plans to pull in from upstream at any point? There's been a lot of changes.
@ivory yew I'd like to but it's a huge task
& lots of improvements to the native decorator.
Yeah it's a big undertaking.
Do we have any documentation on how we did it last time?
dan did it last time
and its just a big git merge
at least when we've done it before
Oh god he did a proper git merge and resolved all the conflicts? God bless.
yup
took a couple weeks iirc
I did one before that
the string compression is the thing that worries me most at this point
Why's that?
micropython does it differently than we do and doesn't do translations
Ah.
They're not interested in adopting your approach?
they were inspired by it but got better compression than my approach
so we could probably benefit from it but it's not likely worth it
Could it be worth it for mcus like the M0 which are memory constrained?
probably not. it's not hugely different and it's a lot of work to switch
Ah, OK.
M0s are basically frozen now
I have a CLUE board now, so I can fiddle with BLE stuff. That is not a priority right now though. I want to add the UDOO Bolt to Blinka first, then do the multi-display support for HT16K33.
@onyx hinge we could likely speed up our builds with this: https://help.github.com/en/actions/configuring-and-managing-workflows/caching-dependencies-to-speed-up-workflows
To make your workflows faster and more efficient, you can create and use caches for dependencies and other commonly reused files.
is that one new? i remember early in the switch reading that caches couldn't traverse a matrix. at any rate, glad there's a way. ๐
probably? this is the first I've seen it
time for me to get off the computer ๐
night all!
๐
(got esp32s2 building in actions: https://github.com/tannewt/circuitpython/runs/676840679?check_suite_focus=true )
He has to get his beauty sleep so he can stream tomorrow. ๐
๐ฏ
btw a workaround for the bytearray.decode missing is to do bytes(bytearray).decode
though I'm about to send a PR to add it
@ivory yew Yay!
I have a computer I could stream from now, but I need to get a good webcam.
OK, I am out. Back tomorrow or if I can not sleep (likely).
CPython has a decode() method on bytearray. This adds that method using the code from bytes.decode.
Test program:
byte_boi = bytes([0x6D, 0x65, 0x65, 0x70])
print(byte_boi) # b'meep'
byte_boi_str = byte_boi.decode("utf-8")
print(byte_boi_str) # meep
byte_array_boi = bytearray(byte_boi)
print(byte_array_boi) # bytearray(b'meep')
byte_array_boi_str = byte_array_boi.decode("utf-8")
print(byte_array_boi_str) # meep
print(byte_array_boi_str == byte_boi_str)...
there we go, I can be less grumpy about that. ๐
This looks like it was resolved by #2871, so I'm going to close this. If that's not correct, feel free to reopen.
Please could someone help me change the threshold value on MPR121_simpletest.py? I'm very near giving up!!
@timber mango I'm looking into it...it seems that you're not meant to change the threshold...but there should be a way...
ah...I see...give me a moment.
Thank you! I'm new to python and am struggling a bit! There seems to be threshold and threshold.setter functions in the mpr121_channel class but I'm really struggling to access it
My only issue is that I don't have the device to test ๐
to date, I've added: mpr121_channel = adafruit_mpr121.MPR121_Channel(i2c, channel) to the example code. This didn't like channel being undefined so I changed to "mpr121_channel = adafruit_mpr121.MPR121_Channel(i2c, 1)" Now if I try "print(mpr121_channel.theshold) I get "i2c has no attribute 'read_register_bytes'". It doesn't have an issue reading values from the general mpr121 class...
I'm writing some code for you to test...
Amazing, thank you
Note: I don't know what the values should be...I guess you do?
Threshold settings are dependant on the touch/release signal strength, system sensitivity and noise immunity requirements. In a typical touch detection application, threshold is typically in the range 0x04~0x10. The touch threshold is several counts larger than the release threshold.
Seems the default is 12 and 6(release)
I'm almost there. Sorry - just trying to copy this across to the pi
no problem ๐
basicallly, the MPR121 class has a method getitem(self, i), this means you can use mpr121[i] to access the item that it's returning, which is a MPR121_Channel object.
@timber mango I realised I made a mistake...I added a comment with // instead of #
Just noticed that too and edited it!
I'm normally a C developer
This looks like it works perfectly!
Thanks so much, I'll get everythign hooked up and I'll need to determine the threshold values experimentally
No problem! Glad I could help
@gilded cradle How are the board constants in PlatformDetect boards.py created? Do they come from a specific place? I need to make one for the UDOO Bolt.
@slender iron it does feel like time to look into it, we're over an hour wall time lately
e-lessons
In discussion in the comments in #2667 I noted that https://learn.adafruit.com/clue-teletype-transmitter/code-the-tty-transmitter was at risk from timing issues and @tannewt pointed out this could be catered for with an enhancement to PulseOut or similar to support DACs.
:(
Hmm... this problem has cropped up again, so I'll ask here again: How can I diagnose OSError: [Errno 5] Input/output error when saving code.py over USB MSC?
It feels like there's a buffer that's not getting flushed somewhere, because if I go into the repl, frequently running import io; print(io.open("/code.py").read()) and then exiting will cause it to work.
When I dump the internal FAT filesystem, it looks sane, or at least fsck.vfat has no qualms.
..
@timber mango @lucid solar Do they not self calibrate once when code first runs? That's mentioned in https://learn.adafruit.com/adafruit-mpr121-12-key-capacitive-touch-sensor-breakout-tutorial/python-circuitpython#circuitpython-and-python-usage-5-14 - a relative tweak of the value after calibration is a typical approach if sensitivity needs to be changed. There's an example of a relative tweak on another device here: https://forums.adafruit.com/viewtopic.php?f=58&t=143210
ok
@timber mango yeah they did cancel my Toasty!
@half geyser what OS?
I've seen this before when copying a lot of files to a board from WSL.
@ivory yew Windows, not inside WSL currently. I'm tracing the FAT filesystem. It looks like it's f_read that's failing, possibly returning FR_INT_ERR.
I've found that using the sync utility generally resolves that.
Hmm... that's not it. Good suggestion, though. The weird bit is that if I read the file in the Circuit Python REPL and then exit, it works. Which means it's there, just not accessible to the auto-reload process.
Hrm.
I would see if there's some way for you to monitor the writes that windows does to the drive.
Interestingly, the issue appears to be in f_seek, with get_fat() returning 0xffffffff, which means it couldn't find the FAT. I think?
Hmm... I'm using Process Monitor to look at the writes, and there are none. Yet when I save this file it says "Errno 5", and exactly 30 seconds after that it reloads successfully.
Hmm... This could be a USB thing...
Actually, that's looking more promising.
If I inspect _mscd_buf after it saves, then it contains my file. During that time, circuit python reports "Errno 5".
A short time later, it successfully runs, and _mscd_buf becomes what looks to be a FAT table.
yeah they did cancel my Toasty!
@ionic elk Bummer. I checked and they show 2 in stock.
what's the deal with that, I wonder?
did they take ours and put them back on the store?
what's the deal with that, I wonder?
@ionic elk I do not know. I know you ordered 1 and I ordered 2, so maybe that is why they cancelled our orders. I really wanted some of those too!
Alright, given the timing and the fact that it fixes itself shortly after a call to tud_msc_write10_cb, and that my file is still in the buffer, I'm going to guess this is a USB issue that I'm running into. Unfortunately my USB Beagle is still not working so well. I'll have to fix that, then I can take a closer look.
I sent them a tindie message to see what's up
might also be a COVID related shipping issue
@ionic elk It's from the UK, they're on quite a strict lockdown, so postal services are affected a lot. It's weird if they just cancel the order without saying something though.
@half geyser I had that with an m4 express feather on windows. I resolved it by making my own deployment tool that (among other things) forces an fsync after copying each file.
Robocopy also works but I didn't want to use it
@ionic elk @lucid solar Which company are you referring to? I've noticed a (non-electronics) shop near me have changed the way they do inventory due to the massive shift towards mail order.
@timber mango for the constants, they just need to be unique and easy enough to read to identify the processor/board. So for the board, you might do something like UDOO_BOLT = "UDOO_BOLT" and for the processor, something like RYZEN_V1605B = "RYZEN_V1605B".
Oh is this https://www.tindie.com/stores/webtronics/ ?
@simple pulsar it's not a company it's just some guy who made a nice looking H7 devboard I'd like to add support for.
yeah
I mean it's not a big deal if they're having shipping issues, just double checking to see if they might have some way around it - I think it'd be a nice board to have in the H7 port
Since #2552 we have just one DMA channel, so becoming out of sync like this should be impossible. Please feel free to reopen this if you still reproduce the problem on 5.3.0.
There's probably an innocent explanation. The shop near me (in London) had this huge pallet of flatpack cardboard boxes turn up and they're now getting worried as they've chewed through those in two weeks and are struggling to get the next delivery.
Since #2552 we use just a single DMA channel to send stereo audio (at least when it's 16 bits). This should resolve such problems. If the problem is not resolved with CircuitPython 5.3.0, feel free to reopen this bug.
@ladyada Do you or PT or your lawyers have an opinion on this? Also see
https://github.com/adafruit/Adafruit_CircuitPython_TestRepo/pull/33
https://github.com/adafruit/actions-ci-circuitpython-libs/pull/8
@half geyser Windows can delay writing to a FAT12 drive for up to 90 seconds, so it's import to flush/eject whatever. However, this should not cause errors on the host side, as you see, because the host side sees a consistent FAT12 filesystem, it just hasn't been flushed yet.
@tulip sleet I have a feeling we share the ideal that the more things can be addressed automatically without asking a human to notice them, the better โ so hopefully the pre-commit.com stuff I've sent over is going to help ๐
Is this example correct? adafruit_sdcard is not imported.. am I just missing somthing?
@gilded cradle OK, will do! I already added the function get_board_asset_tag(). Also, I believe there may be at least one bug in other functions that are supposed to return True when nothing is found. Some will never return True.
Ok, yeah it's definitely possible there' a bug somewhere in there. ๐
I will fix them. ๐
thanks
@slender iron @onyx hinge I was just playing with a Teensy4.1 -- loaded CP and it seems to be working fine. No issues. Next I need to put headers on and I'll try some I2C/ and SPI devices. I was curious if i should expect to be able to access the SDCard at this time or does that interface require a new QSPI driver. On a side note, I hope to run some tests with the sdcardio PR soon. Again, any point in trying it on the Teensy 4.1?
@solar whale I think I heard that it's "SDIO" which is not compatible with our current SD card driver which assumes SPI. However, I'm not sure.
yes, that is what it says SDIO -- no problem ... just wanted to make sure I was not missing an opportunity.
Implementing SDIO is on my short list, though I've been asked to start with STM32 feather.
No pressure from me!! I'm just poking and prodding...
@simple pulsar This is the board https://www.tindie.com/products/webtronics/toasty-480mhz-stm32-usb-development-board/
@indigo wedge what's the difference between the Feather M7 1011 and the Feather mimxrt1011?
Also could I get the schematic? Need to double check which pins to protect from reset - USB, SWD, flash, etc
in case you used different ones than the EVKs
How is your GPS connected? Uart or I2C? I can try to reproduce this.
UART.
Sent from Outlook Mobilehttps://aka.ms/blhgte
From: jerryneedell notifications@github.com
Sent: Friday, May 15, 2020 10:54:20 AM
To: adafruit/circuitpython circuitpython@noreply.github.com
Cc: desilveyk desilveyk@outlook.com; Author author@noreply.github.com
Subject: Re: [adafruit/circuitpython] Xenon CircuitPython Crashing (#2891)
How is your GPS connected? Uart or I2C? I can try to reproduce this.
โ
You are receiving this because you auth...
This PR expands the Microcontroller/Pin module to allow pin objects to be claimed and reset in the context of a python program. Claiming prevents pins that have previously been used for a peripheral instance from being used again without a de-init, and resetting returns pins to their startup state. All pins except those in the never_reset array are automatically reset at startup and soft reboots.
This ended up being a little trickier than it usually is for other ports, since the i.MX does...
UART. Sent from Outlook Mobilehttps://aka.ms/blhgte
โฆ
________________________________ From: jerryneedell notifications@github.com Sent: Friday, May 15, 2020 10:54:20 AM To: adafruit/circuitpython circuitpython@noreply.github.com Cc: desilveyk desilveyk@outlook.com; Author author@noreply.github.com Subject: Re: [adafruit/circuitpython] Xenon CircuitPython Crashing (#2891) How is your GPS connected? Uart or I2C? I can try to reproduce this. โ You are receiving this becau...
Input:
python3 tools/extract_types.py shared-bindings/analogio
Output:
Parameter: __init__ on line 37
Parameter: deinit on line 44
Return: deinit on line 44
Parameter: __enter__ on line 48
Return: __enter__ on line 48
Parameter: __exit__ on line 52
Return: __exit__ on line 52
attribute on line 57
attribute on line 63
Parameter: __init__ on line 78
Parameter: deinit on line 84
Return: deinit on line 84
Parameter: __enter__ on line 88
Return: __enter__ on line 88
Paramet...
@WarriorOfWire For some reason I couldn't push to your branch still. I pushed the merge to my corresponding branch if you want to snag it from there.
@dhalbert is this review on your radar?
Does this unintentionally add it to array objects as well? It shouldn't.
For CPython:
>>> import array
>>> byte_boi = bytes([0x6D, 0x65, 0x65, 0x70])
>>> a = array.array("B", byte_boi)
>>> a.decode("utf-8")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'array.array' object has no attribute 'decode'
@tulip sleet @slender iron looking at the sdcardio PR, I wonder what we'll do when SDIO goes in. Is one sdcardio.SDCard object going to accept a bus of either kind, like displayio? Or will we have SDCard_SPI and SDCard_SDIO types within one module? A twist is that SPI needs a cs= argument but sdio would not. SDCard(*, bus, spi_chip_select=None) as signature, even if it's less compatible with adafruit_sdcard?
It seems that for a number of reasons a FourWire bus couldn't be used, even though that would help with the chip select aspect.
is the command protocol the same?
I do like the idea of accepting a bus but for spi it could be a bus device
to encapsulate chip select
we need to avoid dipping back into Python, so I think an adafruit_bus_device is right out
unless we bring that into the core too
the command protocol looks almost the same, except maybe some bits about detection. I haven't gotten far enough in writing sdio to know
given that Limor's asked me to look at SDIO next do you want to just hold off on this until both kinds are ready to go in at once ? Just to avoid unneeded backtracking on the API, so we have a design that encompasses both right from the start ?
maybe just commit it as _sdcardio for now?
OK, if that's what you like will you write me a note on the PR? I am fine with that.
yup, I can add that
thank you
This looks like a good start! Just a couple comments.
This list is already available in the locals table for microcontroller.pin: https://github.com/adafruit/circuitpython/blob/master/ports/mimxrt10xx/common-hal/microcontroller/__init__.c#L110
For now, let's call this _sdcardio just in the top level so that we can evolve the API as SDIO support is added. Internally the names can stay the same.
Hmm, how would I access the pin members for that list? I don't really get the macro used when defining it, #define MP_ROM_PTR(p) {.u32 = {.lo = (p), .hi = NULL}}. Would it just be mcu_pin_global_dict_table[i][1] when iterating?
I'd need to change up the order, too, since it's important that it aligns with the IOMUXC enumeration order.
I ran int for well over an hour with no crashes ... Other tithe some periods of poor gps reception, it has been working fine. Just restarted about 5 min ago -- still no problems.
How are you powering the Xenon + GPS? I am just using USB from my host computer and have 3.3V from the ARGON to the GPS.
@slender iron I have checked that box no less than 10 times on 2 devices. ๐ง
I tried to install Zephr, but it requires gcc-10, and I only have gcc-8. Unable to install gcc-10. Ubuntu MATE 18.04.
hmm -- I installed it a few weeks ago and my system had gcc-9
What OS?
Ubuntu 20.04
I've got gcc 9 and have no problems either on Mac OSX
That is why I can not install gcc-10. I am only on 18.04 here.
gcc-9 is just released.
I was wondering if there is a repository that allows me to install gcc 9 on Ubuntu 18.04 LTS (bionic)?
There seems to be repositories supporting disco:
https://packages....
sudo add-apt-repository ppa:jonathonf/gcc-9.0 sudo apt-get install gcc-9
I will check that out. Zephr is not that important to me right now, so I can do without it.
@tannewt Sorry, I looked for this the other day, and it seemed like a number of changes were pending, so I waited.
This is resolved on STM32, investigating for i.MX
Crap. Now apt is broken on my system. ๐ฆ
I need to stay on 18.04 because some nVidia stuff for Jetson has not been upgraded to need 20.04 yet.
Also note this, though I'm not sure whether it's relevant: https://github.com/adafruit/circuitpython/issues/384
Current errors are:
../../lib/tinyusb/src/portable/nxp/transdimension/dcd_transdimension.c: In function 'dcd_edpt_xfer':
../../lib/tinyusb/src/portable/nxp/transdimension/dcd_transdimension.c:481:33: warning: cast increases required alignment of target type [-Wcast-align]
481 | CleanInvalidateDCache_by_Addr((uint32_t*) buffer, total_bytes + 31);
| ^
sdk/devices/MIMXRT1011/drivers/fsl_clock.c:24:6: warning: "__ARMVFP__" is not defined, evalua...
the usb one I guess we should ask @hathach about
OK -- I found the commit fixing the doc example -- thanks !
sorry -- I don't see any changes -- did you commit something?
It looks like I get to reinstall Ubuntu MATE today. ๐ฆ ๐ฆ
@onyx hinge I saw a desktop notification go by from you with a whole paragraph about sdcardio naming, I thought, but I can't find it now.
did you delete a discord post or something like that?
ok, got it, thanks, i was in the channel but afk and somehow didn't get a red notification number circle
Ah it seems like it does add it to array, too. I can fix that if you want.
On Fri, May 15, 2020, 12:00 PM Dan Halbert notifications@github.com wrote:
Also note this, though I'm not sure whether it's relevant: #384
https://github.com/adafruit/circuitpython/issues/384โ
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/adafruit/circuitpython/pull/2896#issuecomment-629425785,
or unsubscribe
<https:...
@ionic elk the Feather M7 1011 was designed for Adafruit, it has a Stemma QT connector, microsd but no ESP32
Ok, neato
for usb and swd pins i thinking there's only one choice
for flash i use the bank A pins which i think is same as the evk
Question someone can maybe help me out with. I demoed my sensor fusion / ahrs code on show and tell a couple weeks ago and I got some hints on how to make it into an actual circuitpython library. I've followed all I could find on making a library and was wondering is there anything else I should be doing to contribute it to the available libraries?
@blissful pollen Have you considered submitting it to the Community Bundle?
Just ran it for another hour with no problems.
Sorry, I am not able to reproduce the issue.
I presume you mean you followed the Creating and Sharing a CircuitPython Library guide?
Yup that guide, and the assorted coding standards ones i found
And I hadn't really considered what the next step was, I could submit it to that bundle
Basically if it's not a product we sell and support, it should be submitted to the community bundle. If it's included in the main bundle, the expectation is that we will be supporting it.
That makes sense, I'll take a look at submitting it there. I did write up a quick "how to" and some references back to the Ardunio only learn guide adafruit has for sensor fusion
I'm actually also interested in this, because I've been working on a library that is NOT sold or supported and I was wondering whether there's any way to register it to some non-supported list or someething
That's what the Community Bundle is ๐
@idle owl do things ever move back or forth?
@blissful pollen Oooh. How to's are good.
hears kattni's eyes light up at the idea of how-tos
@idle owl thanks for the advice
@blissful pollen it's sure to be good material for the Python on Hardware newsletter and/or the Adafruit blog, so keep us posted
@onyx hinge will do! This has been a good learning experience with python, git and just how everything fits together
Do we have a guide for writing a how-to ๐
I would definitely like adafruit_bus_device to be pulled into core.
I only had stylistic comments. It looks good but I have not tested it. Are we going to rewrite adafruit_sdcard to be a thin wrapper around this for now, or just deprecate it?
This is a complete nit, could you put the SDCARDIO one in alphabetcial order with the others?
I think you mean "not bigbangio.SPI".
I'm also running it from USB. Are you running it on a Aragon or Xenon processor? I'm running on a Xenon.
Sent from Outlook Mobilehttps://aka.ms/blhgte
From: jerryneedell notifications@github.com
Sent: Friday, May 15, 2020 1:40:00 PM
To: adafruit/circuitpython circuitpython@noreply.github.com
Cc: desilveyk desilveyk@outlook.com; Author author@noreply.github.com
Subject: Re: [adafruit/circuitpython] Xenon CircuitPython Crashing (#2891)
Just ran it ...
Yes, Xenon with an Ultimate GPS breakout board.
Thanks @dhalbert I'll take your comments into account when I revise the PR to rename it as _sdcardio.
I think adafruit_sdcard will still be used for M0 devices where we don't have space for sdcardio in flash.
Hum, maybe I just have a hardware issue on my processor. I have lots of them. I'll try the same conversation process on another one. Thanks very much for your time.
Sent from Outlook Mobilehttps://aka.ms/blhgte
From: jerryneedell notifications@github.com
Sent: Friday, May 15, 2020 1:45:02 PM
To: adafruit/circuitpython circuitpython@noreply.github.com
Cc: desilveyk desilveyk@outlook.com; Author author@noreply.github.com
Subject: Re: [adafruit/circui...
Glad to help -- Good luck!
I think this is written down somewhere but in terms of memory efficiency, for .mpy files what's the most efficient format for CP for storing strings of bytes and 16bit ints?
bytes()
as opposed to tuples, etc, is that what you're asking?
note that for readability, you can have consecutive b'...' strings that get concatenated at compile time, e.g. (from the HID library:)
ASCII_TO_KEYCODE = (
b"\x00" # NUL
b"\x00" # SOH
b"\x00" # STX
b"\x00" # ETX
b"\x00" # EOT
b"\x00" # ENQ
b"\x00" # ACK
...
Ah, just looking back to Feb that was when I last asked this, I was looking for PROGMEM style things in CP
for regular .mpy's (not frozen), all the data will still get loaded into RAM. I kind of remember that, perhaps if they are large you could read them from a binary file, which will keep them out of RAM if they don't need to be present all at once
Thanks, I'll have a play and see how much memory I chew through
This failed to merge due to issues Github is currently experiencing. I will try again later once they fix the issue.
Heya, we're doing round 2 of this live Q&A now -- this time with hopefully less technical glitches! https://twitter.com/nnja/status/1260967179236728832
Please join us for round 2 of this interview, this time new and improved with 100% less technical difficulties! https://t.co/sqPUv2tEhJ
The live stream will be at: https://www.twitch.tv/mbcrump
Learn about CircuitPython, device simulator express, PyBadge with Nina Zakharenko
Fixes #458. Github issues are reporting fixed, so maybe it will work this time.
@tannewt made it where decode only applies to bytearray.
print(dir(array.array))
# ['__class__', '__name__', 'append', 'extend']
print(dir(bytearray))
# ['__class__', '__name__', 'append', 'decode', 'extend']
As I feared, giving bytearray a separate locals table pushed some of the smaller boards over capacity. :(
I shrank the crickit build. Let's see if it works.
So it can be used for internal and external flashes.
Found this when trying to enable neopixel.
Make sure background doesn't do a delay(1).
...for Czech, Danish, Finnish, Norwegian Bokmal and Dutch.
I have people ready to start translating these.
@k0d Feel free to merge whenever someone wants to get going.
as requested by weblate user dronecz
I'm pretty puzzled by this. I checked out the exact same commit locally (a3ca9401b4eab35d4fa3190141d576bcd059d070z_, and my builds are about 500 bytes smaller, and they fit. I'm using the same arm-none-eabi-gcc. My regular gcc is newer, but that's just for mpy-cross and shouldn't matter.
@tulip sleet the CI is built on a merge commit
oh, I was looking at the wrong commit in the actions log
@slender iron what else was merged in recently that would be so much bigger?
ยฏ_(ใ)_/ยฏ
@slender iron pixelbuf was turned ON in the CPX crickit build
ah ya
was that deliberate?
oh yeah, got it, no room to freeze pypixelbuf
there was something I was going to turn off
rotaryio?
want to update the neopixel frozen library too?
bitbangio also. If it's not already off.
it's off
Was worth a try.
@tannewt it builds now; I think you already took a look so if it's easy for you to finish the review go ahead
@gilded cradle I had to reinstall Ubuntu 18.04 on my system. I lost a bit of work, but I can easily recreate what I did. ๐
tud_task() will sleep forever if there is no usb events, in fact, it wonโt return unless the stack is not initialized. Therefore anything afterwards wonโt be executed
Thanks @tulip sleet , @low sentinel , and @ivory yew , I think I understand more about what's going on. Do others see similar issues?
Rather, how often do they see this issue? I ask because I can actually see the whole file sitting in the MSC buffer on Circuit Python, it just hasn't been flushed.
@gilded cradle I want to call my new get_board_asset_tag() function in chip.py, but am having some difficulty. How do I do this when the function is in __init__.py? Do I need to move it to chip.py?
Closing in favour of #2911
Will create single PRs for each language, plus use the shorter language tags (cs instead of cs_CZ)
Question RE usb_hid. How hard would it be to make it output a Joystick axis? Does the library have anything that can do that at the moment?
Edit: I can see Gamepad now. I guess you could spin up many Gamepads. Or hack it to one axis
@half geyser are you seeing the filesystem flush problem on 5.3.0 or only later? If the latter, this is likely to be a CircuitPython flush problem brought on by not running a background task promptly. The internal flushes were done on a timed bassis before, but the new lower power code may not be triggering the flush timer properly.
@craggy galleon right, there is gamepad. It was very hard to find a particular gamepad definition (descriptor) that would work across MacOS, Windows, and Linux. If I remember right, it does not currently work on Linux. Our long-term goal is to allow user-defined HID descriptors at run-time (set in boot.py)
see for instance the XAC descriptor for its gamepad, which right now is a compile-time flag
grep for XAC
Here's a bit of background... I want to make a Flight Simulator Throttle console using CircuitPython to send back out the values. So I need probably 6-axes of control.
do you have an existing device you want to emulate?
similar to this but times 2
is it to work with a specific game? Do you own one of those?
so the q is what kind of HID device descriptor is FSX expecting.
Flight Simulator X lets you configure the individual axis control for each engine
right...
So does there need to be some kind of driver (for example in Windows) running on the other side that understand what the device is doing... rather than it just spitting out commands?
there are USB standards for Flight Simulator Devices (https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf#page=37), but it could be that FSX is not expecting that but some proprietary thing. E.g. Xbox controllers use some proprietary HID descriptor
Ohh - I know FSX works with any controller
I have a generic joystick that shows up as such in Windows
is there a settings window where you can map various joystick ranges to various functions
but that Logitech thing above could be doing various different things... I'll see if someone has published its HID descriptor
on sec, I'll plug in my joystick now
this would be useful: https://www.thesycon.de/eng/usb_descriptordumper.shtml
USB descriptor dumper is a Windows utility that displays the USB descriptors of any USB device.
I don't have any experience playing with this sort of thing. Just thought I would ask the question.
that report is incomplete; it doesn't include the HID report descriptor
looking to see if there's a way to get it....
@tulip sleet you sure it does not include the descriptor you are looking for?
What should it look like?
it has the HID descriptor, but not the HID report descriptor
example of a report descriptor: https://github.com/adafruit/circuitpython/blob/master/tools/hid_report_descriptors.py#L50
i did tons of work on this a couple of years ago, trying to find the tools I used then. You can use wireshark, but I think there are easier tools
joystick example is at line 177 in that link
wireshark can work. Do I need any add-ons?
you need to install the optional usb pcap stuff. Hold on, let me find some references
I think I've got that already
also if you have a linux box i think you can use usbhid-dump
i was doing this over and over, I just can't remember how i did this
i was mostly doing it on linux, not windows
this is very handy: I think I got hex dumps from wireshark and then used this to parse them: http://eleccelerator.com/usbdescreqparser/
do you have linux?
Not at the moment. It's on a seperate SSD
I think I've got what we are looking for though. Give me a sec
I can send that packet if that's it
that's the actual report; but the hid report descriptor is sent when it's plugged in. So start a capture, then plug in the controller and wait a few seconds, then stop the capture. If you send me that pcap file I can tell you where to look
I can go back. give me a sec
i.e. the device describes to the host the structure of the data it is sending
those are other kinds of descriptors. but if you upload the capture file I'll find it
There you go ๐ The mouse is sending loads of spam.
look at frame 939
yep
you can add a filter usb.src=="3.24.0"
How do you know that is for the Joystick and not something else?
In the display for frame 939, right click on HID Report, and choose Copy -> Copy Bytes as Hex Dump. Then paste that into http://eleccelerator.com/usbdescreqparser/ and press the "USB HID Report Descriptor" button
you'd only see that kind of frame when the device is enumerated, when you first plug it in, so it should be your joystick, as opposed to the mouse that's already plugged in, etc.
Right...
usually I sort the trace based on the Info colum and just look for the right name of the Response
or you could add a filter
Does this make a CircuitPython easier to work with?
actually that dump has numbers at the left, should be removed
copy as Hex Stream instead of Hex Dump
Ahh, yes - removing the numbers makes it look better
Like to create a 6-axes joystick ๐
You probably dislike "magic numbers" in your code as anyone else, and it would be a challenge ( but not impossible ) to extract the actual value from
tasks.c ( in esp-idf/components/freertos )
329:#define tskSTACK_FILL_BYTE ( 0xa5U )
I would humbly suggest adding a mention of tskSTACK_FILL_BYTE in the comment below
( it would have been nicer if freertos exported their symbol or value in some .h or API call so an assert or compile time check could be use to
associate STACK_CANA...
i was just using it to figure out what existing joysticks that worked were doing
Not sure if this helps either:
That one is 3-axis and 2 buttons.
i did this kind of thing extensively when debugging HID and USB support, not just for joysticks. Then I took the output from that tool and turned it into some python code that generated a bytestring that was the descriptor (e.g. the link into circuitpython above)
there were joysticks that worked and ones that didn't; sometimes it was something like 8-bit vs 16-bit axes, or signed vs unsigned ranges. it was painful. ideally the drivers on the OS side should be flexible, but sometimes they are not
or i'd take an existing descriptor and modify it to see if I could get it to work. There was a lot of trial and error
so if you have one that works, you can get its descriptor, and then use the same descriptor in a custom build of CircuitPython. We'd like to make that easier so you don't need a custom build, but it's not as high priority as other stuff right now
Cool. When I look at this again, I will do that.
Thank you for your lesson in USB HID. I feel I learned a lot ๐
you're welcome! it is pretty arcane. If you can get people to give you dumps of their working controllers, that is helpful. Wireshark is powerful but it's a lot of work. As I mentioned, there are linux tools that get the same thing
@tulip sleet I think I eventually want to do something similar when I start working on my wireless robot controller. I hope to use RFM69 radios to send and receive short bursts of data. Right now, I want to experiment with using my PyGamer as a controller because it is easy to add on to.
I wish there were a module of some kind that I could add to a PyGamer that has the latest Bluetooth and Wifi. It might be interesting to use a PyGamer to use one of the new Bluefruit devices as an I2C (or maybe SPI) slave. Then, I could add WiFi and RFM69 to the Bluefruit device which would do most of the data analysis and processing. I already know I can run at least two SPI devices from an ItsyBitsy M4, and see no reason why I could not add a third if I have a pin available for CS. I need to get a Feather nRF52 Bluefruit board and a Feather Airlif WiFi featherwing. OR, I could figure out a way to connect my Bluefruit LE SPI Friend and one of my RFM69 radio breakouts to my PyGamer.
I think one or two Feather Prototype wings would work for that. ๐
there is a co-processor protocol called "HCI" that is implemented for various Bluetooth SoC's, analogous to the "NINA" SPI protocol for the airlifts. But we would need to implement a _bleio equivalent that uses HCI
HCI is available on nRF via Zephyr
Is Zephyr running on the new nRF52 boards now?
yes, Nordic sees it as the long-term future, instead of the SoftDevice model
I tried to install Zephyr on my system, but I only have GCC 8.x and I got everything all messed up. I had to reinstall Ubuntu.
Do you think it would be difficult to use HCI from a PyGamer to communicate through a Bluefruit LE SPI Friend to a newer nRF52 board?
@timber mango the Bluefruit LE SPI Friend has its own protocol; you wouldn't use HCI. You could use the existing library https://github.com/adafruit/Adafruit_CircuitPython_BluefruitSPI
i wouldn't try to install the HCI firmware on a Friend.
It should work, it's all Bluetooth
OK. I already have my SPI Friend and an RFM69 radio connected to an ItsyBitsy M4, so that can take the place of the PyGamer for the purpose of testing communications. I also recently got a CLUE board, so that would work for the nRF52 side. ๐
you have to decide what you're going to transmit over Bluetooth. You could use the Nordic UART protocol and make up an ad hoc protocol on that, or you could define some services. It's probably easiest to use the UART protocol for now, though it's not really the best way to use Bluetooth, given its capabilities
I know, but it would be a good way to ease into using Bluetooth between two devices. ๐
it's by far the simplest ๐
Simple is good when starting out with something complex like Bluetooth. ๐
OK, I think I am overwhelmed enough now that I can go off and play for awhile. ๐
Thank you much for the tutoring!
yw!
@tulip sleet since I saw you talking about HID ๐ https://github.com/Flameeyes/usbmon-tools is a bunch of tools I wrote in the past months and has a "chatter" exporter for HID traffic from pcap files (Linux and Windows) โ it doesn't extract/parse the reports yet but I should probably get to that soonish as I still have a mouse config protocol to reverse ๐
(and as you can tell, I hadn't gotten through that with reuse yet, which is why I did that before sharing because it's the kind of "light dusting" you do before inviting someone home, to me ๐ )
@topaz quest that would have been useful! bookmarked!
i actually stumbled upon usbmon-tools this week (and saw it was yours) as i continued to debug my RPi/CP bootloader issue. it was one of those odd coincidences. ๐
Closing in favor of #2865, which is a dupe but has had more discussion.
heh small world of hardware hacking after all ๐
This may be a dupe of the other USB issues we are seeing with lower_power.
If this is code.py, USB doesn't connect: no CIRCUITPY and no REPL
import time
while True:
print('hi') # not necessary, just easier to see it's running
time.sleep(1)
Anyone around and want to help with mentored sprints?
@timber mango you should be able to keep it in init.py, but make sure it's a member function of Detector. Then just call self.detector.get_board_asset_tag(). Maybe look at how the other functions that live in there are being called.
@gilded cradle Ah, OK, got it! ๐ ๐
@slender iron is TinyUSB the same as LUFA?
This is my first try at this kind of a change.
@slender iron i think i understand the difference. TinyUSB is a driver for builtin USB Hardware an LUFA an old USB Software Stack
@gilded cradle I made it past PyLint with just four commits this time. ๐ Now, I have to read about how to test this. I pushed everything to git because I had already lost all my work when I messed my computer up. I did not want that to happen again.
I don't think I'm going to bother making display DMA run in parallel like I was considering yesterday.
Various sized update timings from Display.c:
refresh: 16.97ms fill: 13.31ms send: 0.12ms buffers: 19
refresh: 2.93ms fill: 1.71ms send: 0.24ms buffers: 5
refresh: 2.69ms fill: 1.83ms send: 0.12ms buffers: 5
refresh: 2.93ms fill: 1.95ms send: 0.12ms buffers: 6
refresh: 15.01ms fill: 10.99ms send: 0.12ms buffers: 18
refresh: 295.29ms fill: 274.66ms send: 0.12ms buffers: 100
Blocking DMA transfers are fast enough that pixel fill is the long pole. Perfectly parallelizing 0.12 milliseconds per refresh won't really do much, and it looks like at best we'd see 10% improvement on the smallest updates (which aren't a problem anyway)
Added type hints to DigitatlInOut.C file
One suggestion but looks good otherwise! Thank you!
//| def __enter__(self, ) -> DigitalInOut:
@rhooper this starts to flesh out some of the stuff we talked about last week. If you get a chance to take a look, let me know what you think.
Hey, so it's ready for another look
Thanks! I'll merge once the CI is happy.
Good work! Some comments and ideas
This Feather also doesn't use SWO, it uses AD_09 as A3.
SWO is not used in this board, AD_09 is used as A2 so you can skip it here.
For anyone working on this, switch to the ninja git branch, generate and run the build.ninja file using:
$ python3 tools/build/circuitpython.py feather_m0_express
$ ninja -C build-feather_m0_express
At the minute it fails with:
In file included from .././py/lexer.h:32,
from ../extmod/vfs.h:29,
from ../main.c:30:
.././py/qstr.h:42:10: fatal error: genhdr/qstrdefs.enum.h: No such file or directory
42 | #include "genhdr/...
When using the STM32F746ZG discovery get "ImportError: no module named 'analogio'"
hey, Mu-Editor doesn't give me the option of using Adafruit as a Mode. What can I do to change that pls?
This PR got too dirty; I've rebased the intended changes on master to keep the changelog clean. Should be good to go.
It looks roughly like this:

There are other widgets we could choose instead:
https://hosted.weblate.org/widgets/circuitpython/
Is there a ticket in GitHub to register demand for the "libraries with native/compiled bits". I think this topic was mentioned in Discord about a week ago and I'm about to try and find that discussion...
Hi @arturo182
I am new in the family MIMXRT10xx, but I have the dev board RT1052 of NXP
This is the port for RT1052, I await your review
Thanks
Ah, I believe this is what I seek: https://github.com/adafruit/circuitpython/issues/2825
This ideas seems to make sense for libraries that only a small percentage of developers will use ones that would otherwise bulk up the CircuitPython interpreter?
I've done a hacky port of https://github.com/adafruit/Talkie into CircuitPythong and that will only be usable for generating samples in non-real-time. That's fine for what I want but it would be nice to be able to use it as it's intended, for real-time playback of speech with an ultra-compact data representation. This is probably ...
File "adafruit_display_text/label.py", line 103, in __init__
File "adafruit_display_text/label.py", line 119, in _update_text
MemoryError: memory allocation failed, allocating 64 bytes
:expressive_sigh:
it is too easy to exhaust a samd51 feather
@low sentinel I said that about the SAMD21, but so far I have not exhausted the SAMD51.
Yeah that's surprising
Sol has a SAMD51 and a lot of library code and I've yet to make it run out of memory.
I made vectorio to claw back dozens of kilobytes and simplify my code - but that only got me a little further.
You couldn't have convinced me before that making a basic frontend for a 3d printer would be this tough with circuitpython on a 160kb samd51! I mean, I made a pretty involved 60fps animated instrument cluster for my car with a 128kb flash and 128kb ram m3 no sweat (particle photon, didn't ever bother enabling the sram) ๐
maybe I type too much? But I've resorted to .mpy for everything at this point
2340 SLOC in this project. It's really frustrating; sorry for venting.
In case you're curious, this is one way to bend a samd51 to its knees. (it's a heavy construction zone atm)
https://github.com/WarriorOfWire/rrfui
@gilded cradle I am starting to think that the UDOO Bolt qualifies as a special case as far as detection goes. I believe the board_asset_tag allows detection without detecting the chip. I have been having a heck of a time trying to detect the chip. Has it ever been this difficult to get a new board detected?
Thanks for the PR! Have you tested that it works on the 1052 EVK?
@gilded cradle I have the chip and board correctly detected now! ๐ ๐ Now, I can move on to the next phase with Blinka. I sure am learning a lot! ๐ Pushed to Git and passed PyLint.
As far as ulab goes, we should also check with v923z whether he wants pyi files upstream, though we can do that second and move the file out if desired. Originally he was not interested in adapting his documentation to CPy standards (which is fine), but we should make an overture anyhow. But that assumes the ulab doc is put into shape first.
I am a bit late to the party, but here are my comments. A second movement, if you wish, since @jepler started out with the overture.
- I genera...
@modest flint answered you in #help-with-circuitpython
The failure was an internal failure in github CI, not a problem with the PR's change:
The runner did not connect within the allotted time of 45 minute(s).
Didn't somebody run a test the other day and find that the increase in flash size for builds with --ggdb on was under a kilobyte? If that's wrong I'll take this out
How is this differentiated between the EVK and the feathers? I found that if I reset these pins on the EVK, it would mess up USB function.
I personally don't feel it's a good pattern to imply functionality that doesn't actually exist in the code, like Speaker pins for a board that doesn't have AudioIO yet. I'd rather just bring in the functionality from other ports at the time that capability is being coded in.
That said I thought an APA102 was AudioIO related and should have done a quick google search sooner to discover otherwise. I'll turn it back on and enable it for the STM32 also as soon as I can.
There's a good number of different reset values and to be honest I don't know that all of them are actually justified fully by the documentation - they aren't really here to be a value a user ever sets, they're just the default values provided in the datasheet. Minor changes to pullup values to adhere to JTAG/etc specifications, as far as I can tell. If you have specific names or uses for them outside of resetting however I'd be down to implement it.
I'm confused by this. a gdb build normally has many symbol strings in it, which makes it a lot larger. Are we talking about the .elf only? We of course don't want these strings in the .bin/.uf2.
A gdb build normally has many symbol strings, however it's missing various .debug_* sections. These sections can be used to go from $pc locations back to function locations. Without these sections you can kind of get a sense of where you are in the program, but if you're in a function that got inlined then the debugger has no idea where you are. Additional information about symbol sizes may also be lost, and you won't get symbols such as preprocessor #define values.
These sections d...
We could... it's a little clunky but would still be better than going the STM32 route and having a pin_port function that fetches the pointer from the GPIO index every time. I'm thinking my preferred solution however would be to use the mux_idx for everything, rather than bothering with the GPIO banks structurally at all. That way the numbering systems are consistent across Microcontroller, and you only ever need one number as a parameter. I'll take a look at swapping on Monday.
This experimental patch adds a new parameter to _bleio.adapter.start_advertising(): anonymous.
This boolean parameter defaults to False. When set to True, it enables privacy mode by calling sd_ble_gap_privacy_set().
I have tested this on my device, and I confirm that it works -- the address is randomized, and is rotated every 15 minutes. A second device is capable of connecting to a GATT service and communicating.
Unanswered questions:
- How does this work with bonding?...
Of course, it shouldn't be in the ifeq if it's in both cases... I'll move it.
Creating as a draft because I expect CI failures.
Closes: #2790
wow amazing progress on the Swedish translation
at 80% translated it's now the second most complete translation
there are also a lot of suggestions made, which is great, but those have to be reviewed and accepted. I can do a half-job of it in French and a quarter job of it in English. But if you read another language (even if it's less than fluently) this is a great way you can still contribute, by giving it a sniff test, fixing any errors (there's a lot of "% d" instead of "%d" for instance), and saving the translation
I see, wasn't aware, just felt a bit like a random change and having it on both sides of the ifdef made it ever more confusing :D
hey, Mu-Editor doesn't give me the option of using Adafruit as a Mode. What can I do to change that pls?
#circuitpython-dev
#help-with-circuitpython
It's because on the EVK the OTG port can be used for both Device and Host modes so the ID and OC pins are actually used by the USB power switch. On the Feathers we only support Device so those pins are not used for any USB-related functionality.
Ok, then maybe for each removed TODO in code we create an Issue so we don't forget what is left to be done :)
wow amazing progress on the Swedish translation
@onyx hinge I'm now done. 100%.
But thanks! ๐
@cobalt grail thank you !
@onyx hinge did you see my review on your adabot-include-weblate PR? i can go ahead and merge it in so the reports start including it; the question isn't that important up-front... ๐
hehe. all good. afk for a few
responded now
actions is having a rough day with another of my PRs, trying to keep smiling ๐ฌ ๐
Should be good, pending the outcome of CI.
sv.po translation at 100% :confetti_ball:
I have no idea what a 'traslador' is in English.
I don't know what a portkey is in English. It is apparently a Harry Potter thing.
Transitive Property of AI translations?
yeah I was on to the harry potter angle, but it doesn't really matter. I was trying to figure out if a Swedish translation for something about "unicode escapes" was wildly wrong, or mostly right, but that's hard to do when I don't speak any of it.
Flyttnycklar nรคmns fรถrsta gรฅngen i Harry Potter och den flammande bรคgaren
โ
Moving keys are mentioned for the first time in Harry Potter and the flaming beaker
machine translation is so weird
well now we've all learned something I hope
if a Swedish translation for something about "unicode escapes" was wildly wrong
@onyx hinge It is totally untranslateble. :-)
But I did check where in the code base it is used, and it's nothing that normal users would encounter.
I think I've tamed the wild beast of autotranslation that was making suggestions for every string in every possible language on weblate. If actual translators want it back, I can reverse course.
@gilded cradle Are Pin mappings from the actual MCU to the pins on the board? So python PA1 = Pin(1)would mean that MCU pin PA1 maps to pin 1 on the board.
Should be good, pending the outcome of CI.
sv.po translation at 100% :confetti_ball:
I wish github would explain submodule updates by showing the submodule's log, not the diffstat.
Author: Dan Halbert
Date: Sat May 16 11:20:25 2020 -0400
update frozen libs
Submodule frozen/Adafruit_CircuitPython_BLE 96774b15d..5d584576e:
> Merge pull request #81 from dhalbert/max_length
Submodule frozen/Adafruit_CircuitPython_BusDevice 0b0d1e999..e9411c424:
> Merge pull request #50 from adafruit/black-update
> buil...
@gilded cradle In looking at what little technical data I can find on the UDOO Bolt, I see stuff like Pin EC Pad 8 I2C08_SCL 10 I2C08_SDA 34 UART0_RX 36 UART0_TX 38 UART0_RTS# 40 UART0_CTS#Are the EC PADs possibly the CPU pin numbers?
put my circa-1998 HTML skills to task. success. ๐คฃ
@raven canopy beautiful.
Happy to help give that a prettier look if you want some help.
hehe. i appreciate it. still trying to decide if i want to implelment a full server+CDN, or stick with the Azure Function w/ jinja and inline CSS (as above).
I'm having another stupid moment. I'm trying to trigger a relay from circuit python. It should be the most basic thing, wire the control pin to a pad on the playground, set the pins up like a led, and then set the value true or false. Is the 3v out from the python not enough to trigger a relay? I'm feeding it vcc from the python vcc. So it should be
so i'm doing
switch = DigitalInOut(board.A6) # For Circuit Playground Express
switch.direction = Direction.INPUT
switch.pull = Pull.UP
ignitionRelay = DigitalInOut(board.A2)
ignitionRelay.direction = Direction.OUTPUT
ignitionRelay.value = False
while True:
print (switch.value)
if switch.value:
led.value = False
ignitionRelay.value = False
else:
led.value = True
ignitionRelay.value = True
I like the bar graphs, one of these:
, because it will be apparent to someone with a particular language skill what's needed.
I think that in combination with one of the "big" status badges conveys a lot of information.

It's the most basic example and I'm not able to get the 5v relay to fire off
Something I'm missing in CPY atm is more low level access to TinyUSB.
I can understand that one might not want to expose the whole C API to the Python side but would it be possible to write a library in C that can interact with TinyUSB and only expose a higher abstraction of my desired functionality to Python? I have no idea how linking works for python modules with native code, can I just call any part of the core or would I need to build my code together with the core?
Also would I run in...
@eternal parcel thats a question probably better suited for #help-with-circuitpython ๐
Something I'm missing in CPY atm is more low level access to TinyUSB.
I can understand that one might not want to expose the whole C API to the Python side but would it be possible to write a library in C that can interact with TinyUSB and only expose a higher abstraction of my desired functionality to Python?
We could add functionality that seems like it would be generally useful. What are your use cases?
I have no idea how linking works for python modules with native code, can ...
@raven canopy There's always https://11points.com/11-best-old-school-animated-gifs/ to raid for HTML page inspiration
It would not make sense to be able to call TinyUSB in general; you could easily conflict with what we need for CircuitPython.
Thats what I feared
My use case right now would be to add support for HID generic transfers.
Would also be nice to provide your own descriptor for that and define multiple endpoints, set report size and stuff like that .
Access to certain events and functions would also be of interest. f.e. setting the PID VID in user code and events for usb mounted/unmounted.
@eternal parcel I don't think you have a chance of driving a relay without a hardware relay driver in between the CPE and the relay. How much current does it take to drive the relay? 20 or 40 mA for a sensitive one. The maximum current out of a CPE pin is going to be 3 or 5 mA. I would start by substituting an LED and series resistor that will light at 2 mA and check out your software and logic. Then build/buy a little hardware drive.
Oh, that's a good idea. I knew it was something wierd like that.
I'm at the cabin, I did bring my tool box. I wonder if could use a transistor and get the current up to the right level
I will have to see if i can get the relay spec shet. they look like super generic ones, all the ones I have are the same source
@eternal parcel @lunar crown Perhaps obvious and already in the plan, but I think you'll need a reverse diode across the relay's coil to protect against back emf too. I looked this up recently for the nRF52840-based boards like the CLUE and nordic put them in the microcontroller on the GPIO but they are inevitably going to be tiny. [added later] this look inspirational: https://learn.adafruit.com/adafruit-power-relay-featherwing/downloads
Speaking of translations, what's the backstory behind the Chinese pinyin translation?
Was pinyin selected because it wasn't clear if BIG-5 or UTF-8 should be selected as the encoding method?
There is already some latent support for raw HID, but we haven't written the corresponding Python part of the library yet. User-defined descriptors are a pending issue: #1015. PID/VID would come along with that. Feel free to open issues for specific features. I'll close this one for now, since it's more about how rather than what.

