#circuitpython-dev

1 messages ยท Page 306 of 1

slender iron
#

@tulip sleet I would just put it into master and we can do another beta

#

the speed slowdown is probably the increase in background task running

manic glacierBOT
#

@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 ...

tulip sleet
#

@slender iron it is already in master, so it works, it's just slower (and the USB connection drops after a while)

slender iron
#

the usb thing is waiting on tinyusb right?

tulip sleet
#

i think so tinyusb #396 or something like that

slender iron
#

kk

#

I'd be happy to see a beta.1 soon

#

it'd be nice to get docs swapped over to stubs

tulip sleet
#

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.

slender iron
#

ya, adding more info to blinka would fix it too

manic glacierBOT
crimson ferry
#

How is the support matrix generated? It has modules that aren't in the build, and vice versa (e.g., PyPortal)

raven canopy
#

@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.

tulip sleet
#

@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

raven canopy
simple pulsar
#

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?

slender iron
#

@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

raven canopy
#

i did a brief search. it doesn't look like it can...

slender iron
#

@prime flower @pastel panther I started a doc for ideas doable for the mentored sprints

prime flower
#

@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?

slender iron
#

๐Ÿ‘

solar whale
#

@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?

timber mango
#

@gilded cradle I want to add the UDOO BOLT to Blinka, but I am a little lost going through the PlatformIO tutorial. Help please?

prime flower
#

@solar whale I'll message you in authors

manic glacierBOT
gilded cradle
#
Adafruit Learning System

The first step to adding your favorite board to Blinka is correctly detecting it

Adafruit Learning System

Now that the board is being detected, it's time to add functionality.

timber mango
#

That tutorial refers one to the PlatformIO tutorial.

#

@gilded cradle I meant PlatformDetect, not PlatformIO. ๐Ÿ˜‰

gilded cradle
#

Ah, gotcha. I'm in a meeting at the moment, but after I can help out.

timber mango
#

OK.

manic glacierBOT
#

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 ...

ivory yew
#

Now to just program, test, and attach a button and panel to 149 more of these...

gilded cradle
#

@timber mango what are you stuck on? Also, does the udoo bolt run linux?

timber mango
#

I am trying to connect the stuff in chips.py to board.py and do not see it. Yes, it runs Linux.

#

I do not know what information I should use for detection.

#

I have a UDOO BOLT now. ๐Ÿ™‚ With 32GB RAM and 1TB SSD. ๐Ÿ˜‰

gilded cradle
#

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.

timber mango
#
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```
gilded cradle
#

ok, what about with cat /proc/device-tree/compatible?

timber mango
#

I do not have that.

gilded cradle
#

/proc/device-tree/model

timber mango
#

I do not have that either.

gilded cradle
#

Ok, which distro of linux are you running?

timber mango
#

Ubuntu MATE 18.04

gilded cradle
timber mango
#

Well, the first was over 200 lines. I just posted the first 30.

gilded cradle
#

Oh gotcha. can you put it in a text file and upload?

timber mango
gilded cradle
#

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.

timber mango
#

Probably.

gilded cradle
#

What was the actual message you received when you typed: cat /proc/device-tree/compatible

timber mango
#

What about the "V1605B" string?

#

File not found.

#

Same for model.

gilded cradle
#

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.

timber mango
#

Hmmmmm.

#

UDOO is not very helpful in this.

gilded cradle
#

yeah

timber mango
#

Bummer

gilded cradle
#

You may just need to poke around and see if you can find something.

timber mango
#

OK.

tulip sleet
#

what does uname -a show?

timber mango
#

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

gilded cradle
#

That might be workable

timber mango
#

How so?

gilded cradle
#

We we can narrow down the processor with /proc/cpuinfo and then "bolt" is in the uname.

timber mango
#

"bolt" seems to be the only unique item there.

gilded cradle
#

Yeah, the combination may be enough

manic glacierBOT
#

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.

timber mango
#

"bolt" is not in cpuinfo.

#

I doubt anyone else will call their board a Bolt.

gilded cradle
#

Right, cpuinfo returns "Ryzen Embedded V1605B"

timber mango
#

I took "V1605B" as the processor and put that into chips.py

gilded cradle
#

Then there's probably no other boards with that proc called a bolt

timber mango
#

I am betting on that.

gilded cradle
#

Try using os.uname() to find bolt

timber mango
#

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')

gilded cradle
#

Maybe something like if "nodename='bolt'" in os.uname():

timber mango
#

I was thinking UDOO_BOLT = "BOLT"

#

Does that work?

gilded cradle
#

for the constant, you should probably use UDOO_BOLT = "UDOO_BOLT"

timber mango
#

OK, but where does the other go?

gilded cradle
#

if "nodename='bolt'" in os.uname(): would be in your board detection code.

timber mango
#

I do not know where to put that, or have I not got that far yet?

#

Further down in the tutorials?

gilded cradle
#

Sounds like you haven't got that far yet

timber mango
#

OK, let me go see if I can figure it out on my own then. ๐Ÿ™‚

tulip sleet
#

nodename is just the hostname, and can be changed, so unfortunately that may not be great

timber mango
#

Thanks for the pointers.

gilded cradle
#

Thanks dan, that won't work then

timber mango
#

Durn.

gilded cradle
#

yw @timber mango. Seems to be a challenging board.

timber mango
#

I guess so!

#

I will go see what I can find out from UDOO, maybe in their forums.

tulip sleet
#

@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

timber mango
#

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.

timber mango
#

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.

onyx hinge
#

@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.

#
./BIN/linux_64/libEAPI.a
timber mango
#

@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.

timber mango
#

@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?

timber mango
manic glacierBOT
onyx hinge
#

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

onyx hinge
#

@idle owl thanks for the python weekly video! I think it got us contributors on Weblate which is awesome.

onyx hinge
#

@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.

raven canopy
raven canopy
#

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.

gilded cradle
#

@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.

onyx hinge
#

@raven canopy thanks, that was enough to point me in the right direction. adabot was pleasant to hack on.

marble hornet
#

do nrf52840 devices need the 32Khz crystal for bluetooth to work?

tulip sleet
#

@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

marble hornet
#

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?

tulip sleet
#

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)
marble hornet
#

ah, thank you!

timber mango
#

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. ๐Ÿ™‚

gilded cradle
#

@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.

timber mango
#

OK, sounds good.

#

We just can not have circular dependencies! ๐Ÿ˜‰ ๐Ÿ™‚

gilded cradle
#

Exactly

timber mango
#

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. ๐Ÿ˜‰

gilded cradle
#

That sounds good

timber mango
#

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. ๐Ÿ™‚ ๐Ÿ˜‰

ionic elk
#

@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?

indigo wedge
#

i guess you're using jlink?

#

i've been using cmsis-dap, never had any issues

ionic elk
#

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?

tulip sleet
#

@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)

ionic elk
#

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.

tulip sleet
#

sorry I mean "upgrade" not "upload"

ionic elk
#

I have not

#

what's your version?

tulip sleet
#

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

ionic elk
#

JLinkARM.dll V6.60d (DLL compiled Jan 9 2020 17:43:40)

tulip sleet
#

they are up to 6.72 or later

#

i subscribe to the email updates

ionic elk
#

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 ๐Ÿ˜ฉ

timber mango
#

@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.

tulip sleet
ionic elk
#

dang it how do I update this software they don't tell you ANYWHERE

raven canopy
#

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.

tulip sleet
#

@ionic elk which software? The firmware is updated automatically when you start it. The others have installation packages for the specific os

ionic elk
#

So do I have to manually go in and delete my software pack and reinstall>?

tulip sleet
#

what os are you on?

ionic elk
#

mac

tulip sleet
#

it's a pkg file, doesn't that install if you double-click?

ionic elk
#

I'll see whether it does a clean replacement

tulip sleet
#

it does on windows and linux for me

ionic elk
#

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

tulip sleet
#

so you could clean up the old ones as you wish

raven canopy
#

its always duped on Win10 for me, as well. though, i'm a little behind obvs. ๐Ÿ˜„

tulip sleet
#

The .deb's do a nice job of cleaning up

ionic elk
#

well, seems a little better so far

tulip sleet
#

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
ionic elk
#

nope nevermind still no dice

#

can't read big blocks of memory, or halt the processor

#

too bad

tulip sleet
#

are you writing to internal or qspi?

ionic elk
#

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

tulip sleet
ionic elk
#

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..

tulip sleet
#

ping scott about it, sure

simple pulsar
#
ionic elk
#

@slender iron ping - does GDB work for you on the i.MX 1010 EVK?

tulip sleet
#

that is connection-based sensor stuff, as opposed to advertising

simple pulsar
#

Thanks, I'll have a look.

tulip sleet
#

needs 5.4.0-beta.0 or later to work for some of the services

simple pulsar
tulip sleet
#

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

simple pulsar
#

Oh, maybe that's what I'm remembering, perhaps the 0 byte was needed.

tulip sleet
#

yes, long ago I thought it could be omitted in python 3 (vs 2), but that's not the case

slender iron
#

@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

ionic elk
#

even with the halt, I still get ERROR: Timeout while preparing target, core does not stop. (PC = 0x20200630, XPSR = 0x61000003, SP = 0x20201D68)!

idle owl
#

@onyx hinge That's great to hear!

slender iron
#

@ionic elk unplug everything and start fresh

ionic elk
#

@slender iron do you use jlink directly, or are you using the DAP?

slender iron
#

jlink iirc

simple pulsar
slender iron
#

@ionic elk also check the boot dip switches

ionic elk
#

should be off off on off, for QSPI, right?

slender iron
#

there may have been a bootstrapping problem though too

#

yup

ionic elk
#

yeah that's what I've got

slender iron
#

the flash stores it's own config

ionic elk
#

what's a bootstrapping problem?

slender iron
#

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?

ionic elk
#

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

slender iron
#

hrm, do you hit a breakpoint on main?

ionic elk
#

I don't remember this happening before my current branch but I don't see how my pin resets would have borked it

slender iron
#

pin resets can bork the swd connections

#

that's a painful lesson ๐Ÿ™‚

ionic elk
#

hmm, yes?

#

OH THAT'S WHAT IT IS

#

I'm blowing up the QSPI or something I bet

tulip sleet
#

@simple pulsar i see, it was a problem the other way!

ionic elk
#

is the QSPI on the GPIO pins?

slender iron
#

ya, that could be it too

#

I'd assume so

tulip sleet
ionic elk
#

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

slender iron
#

looks like GPIO_SD_06 - GPIO_SD_11 are "FlexSPI"

manic glacierBOT
tidal kiln
simple pulsar
tulip sleet
manic glacierBOT
simple pulsar
#

@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...

tulip sleet
#

yes, i find readthedocs not the best for finding things, since there are so many cross references

simple pulsar
#

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.

tulip sleet
#

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

manic glacierBOT
ionic elk
#

@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.

tulip sleet
#

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

ionic elk
#

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

tulip sleet
#

@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()

ionic elk
#

So the mistake that Arturo and I made was to even include them in our pin tables, basically?

inland tusk
#

@slender iron when is the deep dive this week?

tulip sleet
#

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

ionic elk
#

Or in the __init__.c of Microcontroller, too, for most ports I would assume?

daring ridge
#

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?

tulip sleet
#

Please open an issue, unless you're unsure. But an issue is fine.

#

it's better to record it for posterity

daring ridge
#

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.

tulip sleet
#

that sounds like a real bug; thanks for finding it

ionic elk
#

what's the particular board? or is it custom

daring ridge
#

Custom. With at SAMD51N20A

tulip sleet
#

we expect there to be a numbero of issues with the beta, because of the new lower_power stuff

daring ridge
#

Ok. I'll go ahead and open and issue. microcontroller.cpu.temperature and ....frequency work.

ionic elk
#

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

daring ridge
#

Haha, agree. Mine has _m4 in the name. Maybe I should change it just to be different.

ionic elk
#

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.

tulip sleet
#

@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

ionic elk
#

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 ๐Ÿ˜†

tulip sleet
#

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.

ionic elk
#

I getcha but man, SAMD51 isn't that hard to say

#

Metro_51 has a cool enough ring to it

#

Oh well lol

tulip sleet
#

really, the circumscribed world at that time was all Atmel. The other chip mfrs were extremely uninterested in hobby stuff, it appeared.

inland tusk
#

๏ฟผ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.

tulip sleet
#

i am not trying to excuse it, just explain the circumstances

ionic elk
#

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

manic glacierBOT
#

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 microcontroller

os.uname()
...

daring ridge
#

I was going to post the issue number, but there it is!

ionic elk
#

@daring ridge thanks for reporting!

tulip sleet
#

@daring ridge thanks, the ADC on the SAMD51 is kind of a mess, unfortunately

raven canopy
#

i was looking through things yesterday on an unrelated quest, and saw that samd-peripherals is still using SysTick for all of that.

daring ridge
#

Yep. Thank you guys! CircuitPython rocks!

ionic elk
#

when is the ADC not a mess

#

I still haven't gotten it in for the H7

tulip sleet
#

this one has lots of errata

ionic elk
#

oof

tulip sleet
#

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

manic glacierBOT
ionic elk
#

@tulip sleet how many years ago was that Atmel/M4 decision? The first Metro?

#

just curious

tulip sleet
#

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

slender iron
#

@inland tusk normal time. 2pm pacific on friday

crimson ferry
#

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).

manic glacierBOT
ionic elk
#

@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

ionic elk
#

@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

onyx hinge
#

argh I was looking at old messages

#

@tidal kiln but maybe nobody else answered, not sure if it's still relevant โ˜๏ธ

tidal kiln
#

thanks. nope. you're the first. will take a look.

raven canopy
#

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...

slender iron
#

@ionic elk ya, board.c would work!

tidal kiln
#

it's still built in, just only on some boards, the wifi ones i think?

raven canopy
#

yeah, its in extmod/ so could just be a matter of receiving some shared-bindings/ treatment.

tidal kiln
#

ha! thanks. i didn't even think to look through the issues.

raven canopy
#

me neither, until i typed "wonder why its gone" out loud. ๐Ÿ˜„

manic glacierBOT
#

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 ...

simple pulsar
#

@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.

timber mango
#

@ionic elk Did Tindie cancel your order for the Toasty board? They cancelled my order. ๐Ÿ˜ฆ ๐Ÿ˜ฆ

simple pulsar
#

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 ?

onyx hinge
#

@simple pulsar yeah it looks like for "0.020" the value actually stored is a little lower

manic glacierBOT
low sentinel
simple pulsar
#

@onyx hinge Should I file that as an issue?

onyx hinge
#

the basic behavior of floating point numbers in circuitpython? no, probably not, it's not going to change anytime soon.

simple pulsar
#

No, an interface that will confuse anyone who tries to set an interval value to a recommended value.

half geyser
#

Hmm... I feel like this is a silly question, but are bytearray() objects not just mutable bytes() objects?

slender iron
#

I think they are basically that

#

something weird going on?

half geyser
#

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)

slender iron
#

bytes shouldn't be strings

half geyser
#

I would have thought that a bytearray would coerce into a bytes, but maybe that's not how things go.

slender iron
#

there is a specific way to get the array out of a "buffer" object

#

which includes both

half geyser
#

@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.

slender iron
#

ya, internally they are

#

in python2 strs were literally bytes

#

strings are utf-8 interpreted bytes

half geyser
#

How do I go from a bytearray to a bytes? Doesn't saying bytes(bytearray(n)) cause an allocation?

slender iron
#

why do you need bytes from bytearray?

half geyser
#

Or should mp_obj_str_get_data() accept bytearray objects?

manic glacierBOT
half geyser
#

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.

slender iron
#

you probably want to switch it to get_buffer

manic glacierBOT
half geyser
#

Ah, will that accept bytes and bytearrays?

slender iron
#

for reading yes

#

it should raise an error if you try to write to bytes

half geyser
#

That's good. Because bytearray looks like it should be immutable.

slender iron
#

it should handle arrays I believe too

#

bytes is immutable and bytearray is mutable

half geyser
#

Right. Except there's no implicit conversion from bytearray to bytes, unless you use a buffer object.

#

Thanks for clearing this up.

slender iron
#

not done by C or Python

#

you can do bytes(bytearray_obj) but should never need to

half geyser
#

It's definitely a bug in the aesio stuff caused by me not understanding this.

slender iron
#

sorry I didn't catch that in review

half geyser
#

I'll write up a patch. It's always a learning process!

slender iron
#

๐Ÿ‘ should be easy and quick to get in

half geyser
#

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.

slender iron
#

๐ŸŽ‰

manic glacierBOT
slender iron
#

@half geyser in encrypt_into the get_buffer for the destination should be write

#

same for decrypt into

half geyser
#

You're right. I wonder why it worked?

slender iron
#

maybe because you gave it a byte array?

#

once it's in C land it doesn't verify mutability

half geyser
#

Could be! I'll fix that, too. Thanks for catching that.

slender iron
#

np, got me thinking about it ๐Ÿ™‚

half geyser
#

Added a second patch to that PR

slender iron
#

kk

half geyser
#

Hmm... though now it doesn't actually work.

#

TypeError: object with buffer protocol required

slender iron
#

and you're passing in bytes?

half geyser
#

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.

timber mango
#

@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. ๐Ÿ™‚ ๐Ÿ˜‰

half geyser
#

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?

slender iron
#

try str(bytearray_obj, "utf-8")

#

we may not have .decode enabled

half geyser
#

That does it. Thanks!

slender iron
#

๐Ÿ‘

timber mango
#

@slender iron No .decode for strings? Why?

slender iron
#

it's enabled by a setting that is used to save space

#

well, disabled to save code space

timber mango
#

Couldn't it be enabled for all M4 and later?

slender iron
#

the nrf52833 is limited flash space iirc

timber mango
#

OK. Can .decode be enabled per build?

slender iron
#

ya, it's per-board

#

I can't remember which MP define it is

timber mango
#

OK, so it could be enabled for other M4 and later boards.

slender iron
#

ya, it should be

timber mango
#

Is that being done now?

slender iron
#

it should already be enabled. it's just not for the board xobs is on

timber mango
#

Oh, OK, got it! I was getting worried! ๐Ÿ˜‰

slender iron
#

np

timber mango
#

It looks like we will not be getting any Toasty boards. ๐Ÿ˜ฆ Tindie cancelled my order because they had not shipped and refunded my money.

half geyser
#

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.

slender iron
#

ah, interesting

#

is that a CPython thing? can you call .decode() on a bytearray in CPython?

half geyser
#

You can, I just checked to make sure.

timber mango
#

I have used it that way.

slender iron
#

ah, maybe we should add it then ๐Ÿ™‚

#

maybe array can't?

ivory yew
#

Yeah it's annoying that bytearray doesn't have decode.

#

I've been meaning to fix that myself but I keep forgetting about it.

timber mango
#

It is a useful function. ๐Ÿ˜‰

ivory yew
#

Speaking of mp, do we have any plans to pull in from upstream at any point? There's been a lot of changes.

slender iron
#

@ivory yew I'd like to but it's a huge task

ivory yew
#

& 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?

slender iron
#

dan did it last time

#

and its just a big git merge

#

at least when we've done it before

ivory yew
#

Oh god he did a proper git merge and resolved all the conflicts? God bless.

slender iron
#

yup

#

took a couple weeks iirc

#

I did one before that

#

the string compression is the thing that worries me most at this point

ivory yew
#

Why's that?

slender iron
#

micropython does it differently than we do and doesn't do translations

ivory yew
#

Ah.

half geyser
#

They're not interested in adopting your approach?

slender iron
#

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

timber mango
#

Could it be worth it for mcus like the M0 which are memory constrained?

slender iron
#

probably not. it's not hugely different and it's a lot of work to switch

timber mango
#

Ah, OK.

slender iron
#

M0s are basically frozen now

timber mango
#

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.

slender iron
raven canopy
#

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. ๐Ÿ˜„

slender iron
#

probably? this is the first I've seen it

#

time for me to get off the computer ๐Ÿ™‚

#

night all!

raven canopy
#

๐Ÿ‘‹

slender iron
timber mango
#

He has to get his beauty sleep so he can stream tomorrow. ๐Ÿ™‚

slender iron
#

๐Ÿ’ฏ

ivory yew
#

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

timber mango
#

@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).

manic glacierBOT
#

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)...
ivory yew
#

there we go, I can be less grumpy about that. ๐Ÿ™‚

manic glacierBOT
timber mango
#

Please could someone help me change the threshold value on MPR121_simpletest.py? I'm very near giving up!!

lucid solar
#

@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.

timber mango
#

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

lucid solar
#

My only issue is that I don't have the device to test ๐Ÿ˜‰

timber mango
#

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...

lucid solar
#

I'm writing some code for you to test...

timber mango
#

Amazing, thank you

lucid solar
#

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)

timber mango
#

I'm almost there. Sorry - just trying to copy this across to the pi

lucid solar
#

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 #

timber mango
#

Just noticed that too and edited it!

lucid solar
#

I'm normally a C developer

timber mango
#

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

lucid solar
#

No problem! Glad I could help

timber mango
#

@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.

onyx hinge
#

@slender iron it does feel like time to look into it, we're over an hour wall time lately

timber mango
#

e-lessons

manic glacierBOT
timber mango
#

:(

half geyser
#

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
#

..

simple pulsar
#

@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

timber mango
#

ok

ionic elk
#

@timber mango yeah they did cancel my Toasty!

ivory yew
#

@half geyser what OS?

#

I've seen this before when copying a lot of files to a board from WSL.

half geyser
#

@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.

ivory yew
#

I've found that using the sync utility generally resolves that.

half geyser
#

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.

ivory yew
#

Hrm.

#

I would see if there's some way for you to monitor the writes that windows does to the drive.

half geyser
#

Interestingly, the issue appears to be in f_seek, with get_fat() returning 0xffffffff, which means it couldn't find the FAT. I think?

half geyser
#

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.

timber mango
#

yeah they did cancel my Toasty!
@ionic elk Bummer. I checked and they show 2 in stock.

ionic elk
#

what's the deal with that, I wonder?

#

did they take ours and put them back on the store?

timber mango
#

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!

half geyser
#

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.

ionic elk
#

I sent them a tindie message to see what's up

#

might also be a COVID related shipping issue

lucid solar
#

@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.

low sentinel
#

@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

simple pulsar
#

@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.

gilded cradle
#

@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".

simple pulsar
ionic elk
#

@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

manic glacierBOT
simple pulsar
#

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.

tulip sleet
#

@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.

topaz quest
#

@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 ๐Ÿ˜„

manic glacierBOT
timber mango
#

@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.

gilded cradle
#

Ok, yeah it's definitely possible there' a bug somewhere in there. ๐Ÿ™‚

timber mango
#

I will fix them. ๐Ÿ™‚

gilded cradle
#

thanks

solar whale
#

@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?

onyx hinge
#

@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.

solar whale
#

yes, that is what it says SDIO -- no problem ... just wanted to make sure I was not missing an opportunity.

onyx hinge
#

Implementing SDIO is on my short list, though I've been asked to start with STM32 feather.

solar whale
#

No pressure from me!! I'm just poking and prodding...

timber mango
ionic elk
#

@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

manic glacierBOT
#

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...

manic glacierBOT
#

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...
onyx hinge
#

@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.

slender iron
#

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

onyx hinge
#

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

slender iron
#

we could bring bus device in too

#

the api is stable and it's widely used

onyx hinge
#

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 ?

slender iron
#

maybe just commit it as _sdcardio for now?

onyx hinge
#

OK, if that's what you like will you write me a note on the PR? I am fine with that.

slender iron
#

yup, I can add that

onyx hinge
#

thank you

manic glacierBOT
low sentinel
#

@slender iron I have checked that box no less than 10 times on 2 devices. ๐Ÿงƒ

timber mango
#

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.

solar whale
#

hmm -- I installed it a few weeks ago and my system had gcc-9

timber mango
#

What OS?

solar whale
#

Ubuntu 20.04

ionic elk
#

I've got gcc 9 and have no problems either on Mac OSX

timber mango
#

That is why I can not install gcc-10. I am only on 18.04 here.

ionic elk
#

sudo add-apt-repository ppa:jonathonf/gcc-9.0 sudo apt-get install gcc-9

timber mango
#

I will check that out. Zephr is not that important to me right now, so I can do without it.

manic glacierBOT
timber mango
#

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.

manic glacierBOT
#

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...
timber mango
#

It looks like I get to reinstall Ubuntu MATE today. ๐Ÿ˜ฆ ๐Ÿ˜ฆ

tulip sleet
#

@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?

onyx hinge
#

@tulip sleet no

#

2:03PM your time I think

tulip sleet
#

ok, got it, thanks, i was in the channel but afk and somehow didn't get a red notification number circle

manic glacierBOT
#

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:...

indigo wedge
#

@ionic elk the Feather M7 1011 was designed for Adafruit, it has a Stemma QT connector, microsd but no ESP32

ionic elk
#

Ok, neato

indigo wedge
#

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

blissful pollen
#

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?

idle owl
#

@blissful pollen Have you considered submitting it to the Community Bundle?

manic glacierBOT
idle owl
#

I presume you mean you followed the Creating and Sharing a CircuitPython Library guide?

blissful pollen
#

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

idle owl
#

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.

blissful pollen
#

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

ionic elk
#

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

idle owl
#

That's what the Community Bundle is ๐Ÿ™‚

ionic elk
#

oh wait I misread, so it's the community bundle

#

yeah

onyx hinge
#

@idle owl do things ever move back or forth?

idle owl
#

@blissful pollen Oooh. How to's are good.

onyx hinge
#

hears kattni's eyes light up at the idea of how-tos

blissful pollen
#

@idle owl thanks for the advice

onyx hinge
#

@blissful pollen it's sure to be good material for the Python on Hardware newsletter and/or the Adafruit blog, so keep us posted

blissful pollen
#

@onyx hinge will do! This has been a good learning experience with python, git and just how everything fits together

solar whale
#

Do we have a guide for writing a how-to ๐Ÿ˜‰

ivory yew
#

I would definitely like adafruit_bus_device to be pulled into core.

manic glacierBOT
#

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 ...

#

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...

simple pulsar
#

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?

tulip sleet
#

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
...
simple pulsar
#

Ah, just looking back to Feb that was when I last asked this, I was looking for PROGMEM style things in CP

tulip sleet
#

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

simple pulsar
#

Thanks, I'll have a play and see how much memory I chew through

orchid basinBOT
fathom trellis
manic glacierBOT
manic glacierBOT
manic glacierBOT
slender iron
#

@tulip sleet the CI is built on a merge commit

tulip sleet
#

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
#

ยฏ_(ใƒ„)_/ยฏ

tulip sleet
#

@slender iron pixelbuf was turned ON in the CPX crickit build

slender iron
#

ah ya

tulip sleet
#

was that deliberate?

slender iron
#

it's needed for the new neopixel library

#

yes, we need it

tulip sleet
#

oh yeah, got it, no room to freeze pypixelbuf

slender iron
#

there was something I was going to turn off

#

rotaryio?

#

want to update the neopixel frozen library too?

tulip sleet
#

i'll try that

#

i can but I won't in this PR

idle owl
#

bitbangio also. If it's not already off.

tulip sleet
#

it's off

idle owl
#

Was worth a try.

manic glacierBOT
timber mango
#

@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. ๐Ÿ˜‰

manic glacierBOT
half geyser
#

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.

timber mango
#

@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?

manic glacierBOT
craggy galleon
#

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

tulip sleet
#

@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

craggy galleon
#

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.

tulip sleet
#

do you have an existing device you want to emulate?

craggy galleon
#

similar to this but times 2

tulip sleet
#

is it to work with a specific game? Do you own one of those?

craggy galleon
#

I don't own one of these.

#

Specifically FSX (or the new one)

tulip sleet
#

so the q is what kind of HID device descriptor is FSX expecting.

craggy galleon
#

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?

tulip sleet
craggy galleon
#

Ohh - I know FSX works with any controller

#

I have a generic joystick that shows up as such in Windows

tulip sleet
#

is there a settings window where you can map various joystick ranges to various functions

craggy galleon
#

in FSX, yes

tulip sleet
#

but that Logitech thing above could be doing various different things... I'll see if someone has published its HID descriptor

craggy galleon
#

on sec, I'll plug in my joystick now

tulip sleet
craggy galleon
#

I don't have any experience playing with this sort of thing. Just thought I would ask the question.

tulip sleet
#

that report is incomplete; it doesn't include the HID report descriptor

#

looking to see if there's a way to get it....

craggy galleon
#

@tulip sleet you sure it does not include the descriptor you are looking for?

#

What should it look like?

tulip sleet
#

it has the HID descriptor, but not the HID report descriptor

#

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

craggy galleon
#

wireshark can work. Do I need any add-ons?

tulip sleet
#

you need to install the optional usb pcap stuff. Hold on, let me find some references

craggy galleon
#

I think I've got that already

tulip sleet
#

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

#

do you have linux?

craggy galleon
#

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

tulip sleet
#

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

craggy galleon
#

I can go back. give me a sec

tulip sleet
#

i.e. the device describes to the host the structure of the data it is sending

craggy galleon
tulip sleet
#

those are other kinds of descriptors. but if you upload the capture file I'll find it

craggy galleon
#

There you go ๐Ÿ™‚ The mouse is sending loads of spam.

tulip sleet
#

look at frame 939

craggy galleon
#

yep

tulip sleet
#

you can add a filter usb.src=="3.24.0"

craggy galleon
#

How do you know that is for the Joystick and not something else?

tulip sleet
#

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.

craggy galleon
#

Right...

tulip sleet
#

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

craggy galleon
#

Does this make a CircuitPython easier to work with?

tulip sleet
#

actually that dump has numbers at the left, should be removed

#

copy as Hex Stream instead of Hex Dump

craggy galleon
#

Ahh, yes - removing the numbers makes it look better

tulip sleet
#

what do you mean? ๐Ÿ™‚ "easier to work with"

craggy galleon
#

Like to create a 6-axes joystick ๐Ÿ˜‰

manic glacierBOT
#

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...

tulip sleet
#

i was just using it to figure out what existing joysticks that worked were doing

craggy galleon
#

Not sure if this helps either:
That one is 3-axis and 2 buttons.

tulip sleet
#

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

craggy galleon
#

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 ๐Ÿ™‚

tulip sleet
#

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

timber mango
#

@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. ๐Ÿ˜‰

tulip sleet
#

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

timber mango
#

I will have to look into that HCI protocol.

tulip sleet
#

HCI is available on nRF via Zephyr

timber mango
#

Is Zephyr running on the new nRF52 boards now?

tulip sleet
#

yes, Nordic sees it as the long-term future, instead of the SoftDevice model

timber mango
#

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?

tulip sleet
#

i wouldn't try to install the HCI firmware on a Friend.

#

It should work, it's all Bluetooth

timber mango
#

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. ๐Ÿ™‚

tulip sleet
#

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

timber mango
#

I know, but it would be a good way to ease into using Bluetooth between two devices. ๐Ÿ˜‰

tulip sleet
#

it's by far the simplest ๐Ÿ™‚

timber mango
#

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!

tulip sleet
#

yw!

topaz quest
#

@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 ๐Ÿ˜‰ )

tulip sleet
#

@topaz quest that would have been useful! bookmarked!

raven canopy
#

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. ๐Ÿ˜„

manic glacierBOT
topaz quest
#

heh small world of hardware hacking after all ๐Ÿ™‚

manic glacierBOT
slender iron
#

Anyone around and want to help with mentored sprints?

slender iron
gilded cradle
#

@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.

timber mango
#

@gilded cradle Ah, OK, got it! ๐Ÿ™‚ ๐Ÿ™‚

timber mango
#

@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.

low sentinel
#

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)

manic glacierBOT
manic glacierBOT
#

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/...
manic glacierBOT
modest flint
#

hey, Mu-Editor doesn't give me the option of using Adafruit as a Mode. What can I do to change that pls?

manic glacierBOT
orchid basinBOT
manic glacierBOT
simple pulsar
#

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...

manic glacierBOT
simple pulsar
manic glacierBOT
#

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 ...

low sentinel
#
  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

timber mango
#

@low sentinel I said that about the SAMD21, but so far I have not exhausted the SAMD51.

ivory yew
#

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.

low sentinel
#

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

low sentinel
#

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

GitHub

Contribute to WarriorOfWire/rrfui development by creating an account on GitHub.

timber mango
#

@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?

manic glacierBOT
timber mango
#

@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.

manic glacierBOT
#

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.

  1. I genera...
tulip sleet
manic glacierBOT
manic glacierBOT
#

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.

#

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?...
manic glacierBOT
manic glacierBOT
onyx hinge
#

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

modest flint
cobalt grail
#

wow amazing progress on the Swedish translation
@onyx hinge I'm now done. 100%.

#

But thanks! ๐Ÿ™‚

onyx hinge
#

@cobalt grail thank you !

raven canopy
#

@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... ๐Ÿ˜„

onyx hinge
#

@raven canopy no I apparently missed it

#

looks

raven canopy
#

hehe. all good. afk for a few

onyx hinge
#

responded now

#

actions is having a rough day with another of my PRs, trying to keep smiling ๐Ÿ˜ฌ ๐Ÿ˜

manic glacierBOT
onyx hinge
crimson ferry
#

Transitive Property of AI translations?

onyx hinge
#

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

#
Harry Potter Wiki

A Portkey is a magical object enchanted to instantly bring anyone touching it to a specific location. Most of the time, a Portkey is an everyday object that would not draw the attention of a...

#

well now we've all learned something I hope

cobalt grail
#

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.

onyx hinge
#

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.

timber mango
#

@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.

manic glacierBOT
#

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...
timber mango
#

@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?

raven canopy
ivory yew
#

@raven canopy beautiful.

#

Happy to help give that a prettier look if you want some help.

raven canopy
#

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).

eternal parcel
#

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

eternal parcel
#

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

orchid basinBOT
eternal parcel
#

It's the most basic example and I'm not able to get the 5v relay to fire off

manic glacierBOT
#

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...

crude blaze
manic glacierBOT
#

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 ...

simple pulsar
manic glacierBOT
#

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.

lunar crown
#

@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.

eternal parcel
#

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

simple pulsar
#

@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

Adafruit Learning System

1200 Watts - turn it on and off

half geyser
#

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?

manic glacierBOT