#circuitpython-dev

1 messages Β· Page 175 of 1

marble hornet
#

Thanks @prime flower nice profile pick

stuck elbow
#

very down to earth

prime flower
#

thankya. usb superposition is something I'd love to become standardized soon

marble hornet
#

okay, downloading most recent beta from master, good idea?

slender iron
#

yup!

manic glacierBOT
#

@tannewt the IRQ thing I'm still experimenting with but the version in this PR has the advantage that it'll merge cleanly with upstream. It's the YAGNI version :-) It looks silly but works fine if you register a callback with machine.Pin.irq as well ... both handlers get called.

(and it'd be easy enough to transition to a more flexible approach if this is warranted by some other library later ... those experimental branches still need some fixing up anyway.)

marble hornet
#

okay

#

downloaded

#

going to build the metro m4 firmware, will post error message

manic glacierBOT
marble hornet
#

error: @slender iron

#
Jonahs-MacBook-Pro:atmel-samd jonahy-m$ make
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
install -d build-metro_m0_express/genhdr
python3 tools/gen_usb_descriptor.py \
        --manufacturer "Adafruit Industries LLC"\
        --product "Metro M0 Express"\
        --vid 0x239A\
        --pid 0x8014\
        --output_c_file build-metro_m0_express/autogen_usb_descriptor.c\
        --output_h_file build-metro_m0_express/genhdr/autogen_usb_descriptor.h
Traceback (most recent call last):
  File "tools/gen_usb_descriptor.py", line 9, in <module>
    from adafruit_usb_descriptor import cdc, hid, msc, standard, util
ModuleNotFoundError: No module named 'adafruit_usb_descriptor'
make: *** [autogen_usb_descriptor.intermediate] Error 1
Jonahs-MacBook-Pro:atmel-samd jonahy-m$ ```
tulip sleet
#

git submodule update --init --recursive

marble hornet
#

im missing that file

#

okay

slender iron
#

@marble hornet no need to ping me only. others can help too. just ask

marble hornet
#

understood

tulip sleet
#

btw notice you are building for Metro M0

marble hornet
#

should i run git submodule update --init --recursive in the tools ? thanks, i would have totally missed that

tulip sleet
#

anywhere in the hierarchy is fine as long as you're not in a submodule directory

marble hornet
#

okay, so i have a fork that is a little out of date but has my alterations in it. i need to git fetch master to update it right? then i can run that ?

#

wait, i can look that up for myself, sorry

tulip sleet
#

did you already set up a remote?

#

if you have a remote named adafruit, then you can do:

#
git checkout master
git fetch adafruit
git merge adafruit/master
#

kattni is writing a guide for all this!

#

git is full of incantations

drowsy fox
#

@sand salmon
clear path is a servo that have integrated controller build in.

it is a good idea for some application, but a very bed idea if you want to control simple dc motors as servos, or using external encoders.

#

also, if you have a problem in the controll unit or the motor, you need to buy the whole new motor.

marble hornet
#

i think it is working

sand salmon
#

indeed , pink you're right :}

drowsy fox
#

i love the fact that i can use the same controller and just replace the motor / encoder connectors,

the g320x is about 100$

and if you have few projects that use dc motors, you only need to add an encoder to them.

marble hornet
#

so the my 'M4 Playground' has the W25Q16JV on it. this is what is in the mpboardconfig file:#define EXTERNAL_FLASH_DEVICE_COUNT 2 #define EXTERNAL_FLASH_DEVICES S25FL216K, \ GD25Q16C,
does this work to add this specific flash module?:

#define EXTERNAL_FLASH_DEVICES S25FL216K, \
                               GD25Q16C, W25Q16JV```
#

since it is already supported in devices.h

tulip sleet
#

should be fine

sand salmon
#

i made a cnc i used nema 23 , but looking to upgrade to servos , for there low noise , more then anything . i do like automation , and robotics

marble hornet
#

thanks

sand salmon
#

as for my programmings skills , make code is about as good as it gets for me ;}

marble hornet
#

gdb jlink connection error:

#

ran:

#

JLinkGDBServer -if SWD -device ATSAMD51j20

#

output:

#
J-Link is connected.
Firmware: J-Link V10 compiled Apr 20 2018 16:47:09
Hardware: V10.10
S/N: 260103303
OEM: SEGGER-EDU
Feature(s): FlashBP, GDB
Checking target voltage...
Target voltage: 3.32 V
Listening on TCP/IP port 2331
Connecting to target...Connected to target
Waiting for GDB connection...
#

stuck there

#

ill try restarting

tulip sleet
#

that's not an error, did you try starting gdb?

#

after you see Waiting, you can then do arm-none-eabi-gdb build-metro_m4_express/firmware.elf

marble hornet
#

i didn't, but after plugging and unplugging i got a new error:

Target connection failed. GDBServer will be closed...Restoring target state and closing J-Link connection...
Shutting down...
Could not connect to target.
Please check power, connection and settings.Jonahs-MacBook-Pro:atmel-samd jonahy-m$ ```
timber mango
#

https://github.com/wa1tnr/ainsuForth-gen-exp-m4 πŸ”Ή
ItsyBitsyM4 tested for basic Arduino IDE programming - blink D13 works.
CircuitPython 3.x beta (preloaded at Adafruit factory) works.
The above link is the port of YAFFA-ARM (a forth) for ItsyBitsyM4.

tulip sleet
#

try unplugging the jlink from usb, then plugging it back in, and make sure your board is powered as wel

stuck elbow
#

the jlink doesn't provide power

#

that surprised me at the beginning too

tulip sleet
#

right, that's what i meant.

marble hornet
#

i'm powering over usb

#

just jiggled everything

#

the jlink light is orange,

raven canopy
#

@marble hornet the manual points to "target reset active" on all versions with bi-color indicators. Whenever i get into states like that, i start over from zero. πŸ˜„

marble hornet
#

@raven canopy when you say start over form zero do you mean unplug and re-plug? or...

raven canopy
#

yeah. sorry, i could've clarified that statement a little better.

#

unplug the target SWD, unplug the target USB, unplug the JLink. then reverse order. πŸ˜„

marble hornet
#

@raven canopy done, changed swd cable too

tulip sleet
#

maybe measure some voltages on the board before and after regulator

marble hornet
#

checked, 3v3 = 3.29-3.3 vcore = 1.18, vbus = 4.97

#

just tried again, Connecting to J-Link... J-Link is connected. Firmware: J-Link V10 compiled Apr 20 2018 16:47:09 Hardware: V10.10 S/N: 260103303 OEM: SEGGER-EDU Feature(s): FlashBP, GDB Checking target voltage... Connecting to target failed. Connected correctly? GDB Server will be closed... Shutting down... Could not connect to target. Please check power, connection and settings.Jonahs-MacBook-Pro:atmel-samd jonahy-m$

#

might i need to update j-link?

#

have been checking online for updater...

tulip sleet
#

why is 3v3 3.0v instead of 3.3v

#

but it worked once, so fishy

#

anything feel hot?

marble hornet
#

typo, 3.29 to 3.30

tulip sleet
#

do you have another board you can try jlink on?

marble hornet
#

not an m4, but yes

#

testing...

manic glacierBOT
marble hornet
#

@tulip sleet it connects to and atsamd21g18

tulip sleet
#

Your first try was good, so something happened:

$ JLinkGDBServer -if SWD -device ATSAMD51j20
Connecting to J-Link...
J-Link is connected.
Firmware: J-Link V10 compiled Apr 20 2018 16:47:09
Hardware: V10.10
S/N: 260103303
OEM: SEGGER-EDU
Feature(s): FlashBP, GDB
Checking target voltage...
Target voltage: 3.32 V
Listening on TCP/IP port 2331
Connecting to target...Connected to target
Waiting for GDB connection...
#

so if that now doesn't work, then do you know what changed between that good try and the next try? Did you change any wiring? I'm worried something got fried, but that's pessimistic.

marble hornet
#

yah!, then when i re-plugged it it stopped working

tulip sleet
#

your SWD connector is keyed, right? cable can't be wrong way round in that socket?

#

could be a bad solder joint somewhere

marble hornet
#

it is keyed, the one sold in the store i'm now using an external regulator

#

ill try again

#

same error, reading voltage not connecting. i realised i'm running a j19, using that name didn't change anything

stuck elbow
#

look like the jlink doesn't detect power

#

can you check the voltage on the jtag pin?

marble hornet
#

the output on terminal has it reading 3.3 volts

#

so i just tried running:

#

JLinkGDBServer -if SWD -device foobar14j19

#

and i got a different error message

#

checking jtag pin...

#

3.29 volts

stuck elbow
#

unplug and re-plug the cables?

marble hornet
#

twice

#

and replaced swd cable

stuck elbow
#

the first cable was keyed too?

marble hornet
#

yes

#

one from ada one not

stuck elbow
#

maybe the connector is reversed, but you connected it initially wrong by mistake and it worked?

marble hornet
#

even if keyed?

stuck elbow
#

if it's keyed, then obviously that is impossible

#

I'm grasping at straws here

marble hornet
#

me too

#

update gdb?

stuck elbow
#

it worked once

slender iron
#

@marble hornet anything hot?

marble hornet
#

no

#

how about i remove the reset button, maybe it is broken...

stuck elbow
#

I had a broken reset on one Β΅Game

#

worth a try

tulip sleet
#

since the cable worked on a samd21, seems like the fault has been isolated to the board

marble hornet
#

didn't help to remove reset

#

getting schematics

tulip sleet
#

@marble hornet is the regulator off-board?

marble hornet
#

iv's tried both , think it could affect it ?

tulip sleet
#

what do you mean, both? VBUS_RAW doesn't onnect to anything but a header pin, it loks like?

#

oh i missed the reg at the top

marble hornet
#

it connects to two, look below the port, there are five header pins in a group, i broke out the usb to those, i'm powering that way

#

but ill try into vin

tulip sleet
#

well, if 3v3 is 3.3v, then it's ok. I more suspect say the SWD connector. I just tried soldering two such connectors to some boards. One works, one doesn't, can't see what's wrong with the bad one, but maybe bad soldering. Maybe press down on the SWD cable where it plugs in while trying to start the jlink gdbserver

#

check continuity between SWD connector pins and the mcu pins

#

on Metro M4 the pullup on SWDCLK is 1k. you are using 10k. I didn't look at the datasheet

marble hornet
#

i think you are right

#

stuck here:

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link V10 compiled Apr 20 2018 16:47:09
Hardware: V10.10
S/N: 260103303
OEM: SEGGER-EDU
Feature(s): FlashBP, GDB
Checking target voltage...
Target voltage: 3.32 V
Listening on TCP/IP port 2331
Connecting to target...Connected to target
Waiting for GDB connection...
tulip sleet
#

that is not stuck, that is waiting for gdb start

marble hornet
#

when i squeezed the swd connector

#

oh

#

so:

tulip sleet
#

half the time it's a mechanical problem!

marble hornet
#

ah

#

Waiting for GDB connection...arm-none-eabi-gdb /Users/jonahy-m/tricorder/trico04c/circuitpython-trico04c/ports/atmel-samd/build-metro_m4_express/firmware.elf

#

stopped there

#

consistently connecting now

#

correct command? and how long does it normally take to flash? minutes, seconds?

manic glacierBOT
raven canopy
marble hornet
#

tried both, it ends the process

#

@raven canopy ill re-check power, but it is connecting

#

hmmm

tulip sleet
#

do you have something in .gdbinit?

raven canopy
#

you could always read the GDB docs. But GNU's docs are difficult at times... πŸ˜„

tulip sleet
#

you should get a (gdb) prompt

#

then you connect to the jlink with target extended-remote :2331

marble hornet
#

like: Connecting to target...Connected to target Waiting for GDB connection...target extended-remote :2331?

tulip sleet
#

yah, but do you have something in ~/.gdbinit?

#

it should connect immediately.

#

and you should see some output on the gdbserver side

#

are you running gdbserver in one terminal window and gdb in another?

marble hornet
#

i don't get (gdb) unless i unplug the chip after being connected. and i didn't realise they were different things

#

that makes a little more sense now

tulip sleet
#

so I think you have .gdbinit file that is alwayws trying to connect. I prefer to do that by hand or define a shorthand command in .gdbinit

#

normally when you start gdb it just goes immediately to the (gdb) prompt

marble hornet
#

okay, restarted terminal, two open windows: in one:

in the other:
gdb

tulip sleet
#

which gdb?

#

arm-none-eabi-gdb?

marble hornet
#

oh

tulip sleet
#

one is for x86

marble hornet
#

Jonahs-MacBook-Pro:~ jonahy-m$ arm-none-eabi-gdb build-metro_m4_express/firmware.elf

tulip sleet
#

and it gives a "trying to connect" message immediately?

marble hornet
#

im on a 2017 mac so x64 right?

tulip sleet
#

yeah, I just meant one is for intel. but you need the arm one for debugging samd51

#

so we do need to know if you have a ~/.gdbinit file

marble hornet
#

@tulip sleet

tulip sleet
#

that looks good, you just need to specify the proper path to the firmware.elf file, if your current directory is not circuitpython/ports/atmel-samd

#

or cd there

#

but you have no bootloader on this chip, right?

marble hornet
#

correct

#

but it should run the metro m4 bootloader

tulip sleet
#

you can try circuitpython now, or you can load the bootloader

marble hornet
#

what do you mean

#

i'm getting a file format not recognized error for bin and elf, and it is the arm-gcc-...

tulip sleet
#

you give gdb a .elf file to debug. It will load that file into flash onto the chip. The .elf file specifies where to load it. Then you can run it. If it's the bootloader, it will load the bootloader.

#

paste the gdb command line and its output here

marble hornet
#

for gdb: ```
Last login: Tue Jun 12 20:36:07 on ttys000
Jonahs-MacBook-Pro:~ jonahy-m$ arm-none-eabi-gdb /Users/jonahy-m/tricorder/trico04c/circuitpython-trico04c/ports/atmel-samd/build-metro_m4_express/firmware.elf
GNU gdb (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 8.0.50.20171128-git
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-apple-darwin10 --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /Users/jonahy-m/tricorder/trico04c/circuitpython-trico04c/ports/atmel-samd/build-metro_m4_express/firmware.elf...(no debugging symbols found)...done.
(gdb) load
You can't do that when your target is `exec'
(gdb)

#

for jlink:```
Last login: Tue Jun 12 20:28:41 on ttys000
Jonahs-MacBook-Pro:~ jonahy-m$ JLinkGDBServer -if SWD -device ATSAMD51j19
SEGGER J-Link GDB Server V6.32d Command Line Version

JLinkARM.dll V6.32d (DLL compiled May 28 2018 17:00:02)

Command line: -if SWD -device ATSAMD51j19
-----GDB Server start settings-----
GDBInit file: none
GDB Server Listening port: 2331
SWO raw output listening port: 2332
Terminal I/O port: 2333
Accept remote connection: yes
Generate logfile: off
Verify download: off
Init regs on start: off
Silent mode: off
Single run mode: off
Target connection timeout: 0 ms
------J-Link related settings------
J-Link Host interface: USB
J-Link script: none
J-Link settings file: none
------Target related settings------
Target device: ATSAMD51j19
Target interface: SWD
Target interface speed: 4000kHz
Target endian: little

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link V10 compiled Apr 20 2018 16:47:09
Hardware: V10.10
S/N: 260103303
OEM: SEGGER-EDU
Feature(s): FlashBP, GDB
Checking target voltage...
Target voltage: 3.31 V
Listening on TCP/IP port 2331
Connecting to target...Connected to target
Waiting for GDB connection...

tulip sleet
#

you have to do the target extended-remote :2331 before you load

#

the target connects to the jlink, and then the load will talk to the jlink and flash the program

marble hornet
#

jlink:Waiting for GDB connection...Connected to 127.0.0.1 Reading all registers WARNING: Failed to read memory @ address 0xFFFFFFFE

#

it seems to be writing

tulip sleet
#

it only takes a few seconds

marble hornet
#

what's a normal amount of time for you ?

tulip sleet
#

5 seconds

marble hornet
#

still writing register

#

hmmm

tulip sleet
#

I'll show you a sample transcript, hold on a sec

marble hornet
#

thanks

tulip sleet
#
J-Link is connected.
Firmware: J-Link V10 compiled Apr 20 2018 16:47:09
Hardware: V10.10
S/N: 50104963
Feature(s): GDB
Checking target voltage...
Target voltage: 3.29 V
Listening on TCP/IP port 2331
Connecting to target...Connected to target
Waiting for GDB connection...Connected to 127.0.0.1
Reading all registers
Read 4 bytes @ address 0x0001BFD0 (Data = 0xF400B510)
Read 2 bytes @ address 0x0001BFD0 (Data = 0xB510)
Reading 64 bytes @ address 0x0001BF00
Downloading 16096 bytes @ address 0x00004000
Downloading 16080 bytes @ address 0x00007EE0
Downloading 16064 bytes @ address 0x0000BDB0
Downloading 16064 bytes @ address 0x0000FC70
Downloading 16112 bytes @ address 0x00013B30
Downloading 16112 bytes @ address 0x00017A20
Downloading 16064 bytes @ address 0x0001B910
Downloading 16080 bytes @ address 0x0001F7D0
Downloading 16064 bytes @ address 0x000236A0
Downloading 16080 bytes @ address 0x00027560
Downloading 16160 bytes @ address 0x0002B430
Downloading 16224 bytes @ address 0x0002F350
Downloading 16320 bytes @ address 0x000332B0
Downloading 12496 bytes @ address 0x00037270
Downloading 8 bytes @ address 0x0003A340
Downloading 1020 bytes @ address 0x0003A348
Writing register (PC = 0x00004000)
#
halbert@salmonx:~/CP/circuitpython/ports/atmel-samd$ arm-none-eabi-gdb build-metro_m4_express/firmware.elf
GNU gdb (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 8.0.50.20171128-git
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-pc-linux-gnu --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from build-metro_m4_express/firmware.elf...(no debugging symbols found)...done.
(gdb) target extended-remote :2331
Remote debugging using :2331
0x0001bfd0 in compile_expr_stmt ()
(gdb) load
Loading section .text, size 0x36340 lma 0x4000
Loading section .ARM.exidx, size 0x8 lma 0x3a340
Loading section .data, size 0x3fc lma 0x3a348
Start address 0x4000, load size 223044
Transfer rate: 36302 KB/sec, 13940 bytes/write.
(gdb) 
#

that took a very few seconds. try mon reset from gdb, and try the load again. but I think your SWD connector is still flaky.

marble hornet
#

(gdb) mon reset
"monitor" command not supported by this target.

tulip sleet
#

?? did you do target extended-remote :2331

#
(gdb) mon reset
Resetting target
marble hornet
#

let me try that, why that address?

#

resetting worked

tulip sleet
#

:2331 is the port for talking to the gdb server

marble hornet
#

ah

tulip sleet
#

it's listening on that port

marble hornet
#
Jonahs-MacBook-Pro:~ jonahy-m$ arm-none-eabi-gdb /Users/jonahy-m/tricorder/trico04c/circuitpython-trico04c/ports/atmel-samd/build-metro_m4_express/firmware.elf
GNU gdb (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 8.0.50.20171128-git
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-apple-darwin10 --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /Users/jonahy-m/tricorder/trico04c/circuitpython-trico04c/ports/atmel-samd/build-metro_m4_express/firmware.elf...(no debugging symbols found)...done.
(gdb) mon reset
"monitor" command not supported by this target.
(gdb) target extended-remote: 2331
Remote debugging using : 2331
0x00004000 in exception_table ()
(gdb) mon reset
Resetting target
(gdb) load
Loading section .text, size 0x3516c lma 0x4000
Loading section .ARM.exidx, size 0x8 lma 0x3916c
Loading section .data, size 0x3fc lma 0x39174
Start address 0x4000, load size 218480
Transfer rate: 42671 KB/sec, 13655 bytes/write.
(gdb) 
tulip sleet
#

great, now type continue or c for short

#

that will start the program

crude fossil
#

Are you folks working on SWD for the SAMD chips? What would you recommend as the best USB interface device to use?

tulip sleet
#

hi @crude fossil we are using jlinks

marble hornet
#
Reading all registers
WARNING: Failed to read memory @ address 0xFFFFFFFE```  nice to meet you @crude fossil
tulip sleet
#

the "failed to read" makes me suspect flaky swd connector

marble hornet
#

hmmmmmmmmm, replace?

tulip sleet
#

I just got a Black Magic Probe from Adafruit, and tried it briefly, but I didn't see the advantage ove the jlink yet. I have to make up a new set of aliases

#

more likely just a soldering problem

raven canopy
#

evening...err, morning? @crude fossil. sorry for missing the obvious GPIO16 IRQ. wanted to get my thoughts in before getting home (to read docs, which would've maybe alleviated that).

tulip sleet
#

@slender iron i reproduced https://github.com/adafruit/circuitpython/issues/289 but it's late and will debug further tomw. I have to re-set it up on a Metro for easy debugging. I was using the Feather Crickit audio amp. Not sure if it's a core problem or maybe adafruit_sd lib.

crude fossil
#

@raven canopy no problem! GPIO16 is annoyingly useless for a lot of things..

raven canopy
#

yeah. when i was researching it before, people love to hate that pin. πŸ˜„

crude fossil
#

@marble hornet good to meet you too! I've just soldered the extra SWD contacts onto this Trinket M0 πŸ˜ƒ

tulip sleet
#

@crude fossil do you have a jlink?

crude fossil
#

@tulip sleet not yet, I was hoping it'd talk to this knockoff STLink I had in the junkbox ...

tulip sleet
#

sadly, i'm not sure that will succeed for Atmel chips

#

we of course can send you a jlink

crude fossil
#

Oh well that would be fantastic πŸ˜ƒ Quite keen to mess with the SAMD stuff.

marble hornet
#

@tulip sleet i replaced the connector and im getting the Reading all registers WARNING: Failed to read memory @ address 0xFFFFFFFE error again, in your experience are the connectors really quite bad? like two in a row

tulip sleet
#

i only have experience with two πŸ˜ƒ

#

it wasn't the connector, it was my soldering

#

did you power-cycle everything? The jlink can get in a bad state. Did you update the software, also?

marble hornet
#

which software?

#

it could be the chip

tulip sleet
#

the jlink software on your mac.

marble hornet
#

i will, but it is very new

tulip sleet
#

it is a 51j20 or 51j19? I saw you use both

reef seal
#

Newbie question: does CircuitPlayground Express work with neopixel ring? Or the voltage mismatch a nonstarter (3.3v vs 5v)?

The other day I was able to get the neopixel working with power from 5v Trinket chip and the signal from the CPE. However today i wasn't even able to make that setup work. Any suggestions?

marble hornet
#

it is a 19

#

i purchased both, safety and one i want to use

onyx hinge
#

I haven't tried this guide for myself

#

"""

Verify the wiring on your strip or device - plugging into the 'DOUT' side is a common mistake! Wire up NeoPixels only while the Circuit Playground Express is not on, to avoid possible damage!

If the power to the NeoPixels is > 5.5V you may have some difficulty driving some strips, in which case you may need to lower the voltage to 4.5-5V or use a level shifter
"""

tulip sleet
#

@reef seal I just drove a 24-neopixel ring from a Gemma M0 last night - it worked fine

marble hornet
#

@tulip sleet it is possible i powered the sam off of 5v for a couple seconds, not sure. could that do it?

tulip sleet
#

@marble hornet maybe, maybe. I have seen that "can't read" kind of error when the jlink was confused. Maybe it's time to populate your second board anyway.

marble hornet
#

if feel like packman jones with all these green rectangles, although these are worth less then even ones.

#

i have to go to school tomorrow, and have a task or two left for today. sleep well all.

raven canopy
#

night @marble hornet. πŸ’€

marble hornet
#

night @raven canopy

manic glacierBOT
crude fossil
#

There's a weird thing with NeoPixels ... D_in has to be > 0.7 V_DD to count as high, so a typical 3.3V IO pin is just barely not enough to drive a pixel running at 5V.

#

... so sometimes it works, sometimes not.

marble hornet
#

one last though, what about a non-questionable jtag standard... pogo? ill share any successes.

tulip sleet
#

(well, not right at the chip, on the round manufacturing pads that Limor puts on the boards)

raven canopy
#

which they use with pogos for the in-house testers...

#

at least, if i understand correctly.

tulip sleet
#

instead of wires, I have also soldered header pins (at an angle) to those pads. They are often on 0.1" spacing, so I can use a double header. Then I can just slip on a female jumper and not have dangling wires all the time.

marble hornet
#

i'm thinking a stardarised 2x3 +1 pogo pin layout. and adapter board can be made, with power injection... maybe im just dreaming

reef seal
#

OK i'll try out those suggestions thanks guys

onyx hinge
#

really wish somebody would do a nice Customizable 3d printable pogo jig

stuck elbow
#

I would expect there to be hundreds of those

#

though I think most are laser-cut

#

for production, you can also use one of those chip sockets to program the chips before soldering them

#

saves you space for the debug headers

prime flower
#

@onyx hinge like a parametric one?

meager fog
#

@umbral dagger heeey do you by chance still have those fritzing files for the prox lighting project and if so, would you mind adding them to the guide?

#

i think thats the coolest part of the project πŸ˜ƒ

#

u can also put em here and ill load them into the guide if you're onto the next thing

umbral dagger
#

@meager fog I have a new version in fab now. Once I get them & vet them, I will add a page with them (and share on Aisler.com, as well as offer a kit there with their new kitting service)

meager fog
#

ooh ok

#

we'll make the guide live now then?

umbral dagger
#

The boards shown have some serious flaws, mostly to do with the neopixel stick part.

#

I'm cool with that. Might be a week or so before I have boards.

meager fog
#

np, next question! do you have a photo or video anywhere we could take a snippet of for a demo gif

umbral dagger
#

They're putting a rush on it. This will be one of their initial kits to be offered.

meager fog
#

sweet

umbral dagger
#

yes. I'll mail you a video?

meager fog
#

we'll add and make it live for the show πŸ˜ƒ

umbral dagger
#

On it's way

meager fog
#

ok!

lone sandalBOT
idle owl
#

Ok so with our rotary encoder, what do you call the changes in rotational position? @tulip sleet You helped me with the code that tracks the difference in rotational position to determine how many times to increment or decrement the volume on a computer. What are those increments called? "clicks"?

stuck elbow
#

units :P

#

steps

tulip sleet
#

for this particular rotary encoder, you could say clicks, since it clicks. I like deshipu's "steps" too.

#

that's more general

idle owl
#

Yah same

#

ok

#

Thank you both

tidal kiln
#

i'd favor "steps" over "clicks" also

prime flower
#

^

#

i'd call the press-down onto the rot. encoder a click, though

idle owl
#

Already went with steps so that works.

umbral dagger
#

steps for rotation, click for the push

tulip sleet
#

the press down can be a click or a press and hold: click implies quick press-and-release

idle owl
#

I didn't do anything for it being held for this one, so, click would work. I'm pretty sure I simply said "press" earlier in the explanation

#

@tulip sleet Can you please check and merge that?

umbral dagger
#

@tulip sleet very true

timber mango
#
From Kenwood IC-2200H and TS-850-S manuals (shop, owner's):
verbs
  select
  set
  press (on end of shaft for encoders with inbuilt pb switch)
  scroll(?)

nouns
  input ports for encoder signals 4-5-3 CPU IC-2200H service manual

directives

   change the adjustment value
   
   select the channel (not verbatim, but select and channel maybe)
   
   turn the dial

   dial in the frequency

   rotate [DIAL] to select the desired memory channel
#

Select and Press seem generic enough -- the user experience explains the presence of detents in the encoder's rotation. 'detent' is the usual noun for the tactile stops found in such controls.

idle owl
#

@tulip sleet The prints work where they are.... am I missing something?

tulip sleet
#
       for _ in range(position_change):
             cc.send(ConsumerControlCode.VOLUME_INCREMENT)
             print(current_position)

will print current_position position_change times. So if position_change == 2, for instance, and current_position == 7, say, it will print 7 twice.

idle owl
#

Oh you have to spin it quickly for that to happen. I see now.

#

Ok thanks

#

I'll fix it

#

Is this called instantiating when you assign a variable to a class so you can use it later? ex. cc = ConsumerControl()

meager fog
#

@idle owl yep it means "to create an object"

#

you dont have to assign it, its the creation that is instantiation

#

like just running "[1, 2, 3]" is instantiating a list in python

idle owl
#

Ah ok

meager fog
#

so is mylist = [1,2,3]

idle owl
#

thanks πŸ˜ƒ

stuck elbow
cunning crypt
#

@stuck elbow What screen is that?

stuck elbow
#

the 160x80 one, Adafruit also has it

#

0.9"

#

it's exactly the size of a trinket

cunning crypt
#

Tiny tiny!

stuck elbow
#

I made two touchpads under the srcreen, so you can switch pictures by touching the top corners

manic glacierBOT
#

Hello,

I just started using Circuitpython in one project with RTC chip DS3231, but this chip is bit more expensive to use as IΒ΄m focusing this to be workshop for children, so I want to ask if is in CP support for RTC in SAMDG21G18. I saw commit #888 from @notro but we can not make it work.

Any help or info about it is very welcome. At least I will not waste my time try to make it work.

Many thanks.

lone sandalBOT
marble hornet
#

the itsybitsy m4 looks awesome!

raven canopy
#

@slender iron i didn't assign a milestone to the FrequencyIn issue. and seeing how slow i'm going, i definitely don't want to hold up 3.0. thoughts or desire for a milestone on it (4.0, long term)?

tulip sleet
#

@slender iron extmod/vfs_fat_diskio.c diskread():

        mp_call_method_n_kw(2, 0, vfs->readblocks);
        // TODO handle error return

πŸ˜† πŸ™ƒ 🀷 that's why SD card playback is crashing, I think.

#

HAHAHA

slender iron
#

@raven canopy either works. we'll decide on 4.0 in the meeting on monday

#

@tulip sleet πŸ˜„

ruby atlas
#

Blah. This week is tooooooo busy

#

When you have to ditch the family to take the train home alone because of last minute meetings...

#

I really want to get back to the neopixel/dotstar work!

raven canopy
#

@slender iron i'll switch to the esp8266 GPIO12+busio issue tomorrow to get it cleared. all this "priority" thinking is b/c ladyada mentioned issue cleanup. and you already fixed the original pulsein issue.

#

@ruby atlas sorry to hear about the busy week. i feel ya; that was me last week (though it was family and airport).

lone sandalBOT
rugged olive
#

Newbie here, hello everyone. Please redirect me if this is the wrong channel for this.

Is it possible to expose a mounted SD card in the USB drive presented to my OS?

I can mount the SD card just fine using storage, and the directory does come up when I run os.listdir("/"), but the directory isn't visible from the mounted drive on Mac. I've exhausted the documentations and tutorials I could find, so I thought I'd ask here before digging into the circuitpython source. I'm on an Adalogger board.

stuck elbow
#

I don't think that's possible at the moment.

#

it would probably need to be added as another usb device at the usb configuration level, but there is no code for that

#

not sure if it's even possible like that

timber mango
#

sd cards are /dev/mm something and usb thumb drives are /dev/sd something

stuck elbow
#

that doesn't matter, it would get mounted properly

#

but it would have to first be exposed as an msc device by the usb-handling code on the samd21

#

of course it would be visible as a separate disk

rugged olive
#

I think I'm getting it.

timber mango
#

OH I think fractal is saying that there's a filesystem on the SD card that they can list in the host PC (the Mac).

rugged olive
#

@timber mango - Yes, that's right, that's what I'd like to be able to do.

timber mango
#

But when the target board is mounted as a USB drive there is no exposure of the filesystem on the SD card.

rugged olive
#

even if it's mounted on the root filesystem that is exposed as a USB drive

timber mango
#

Well imagine an M0 target board that has an SD slot and it also has SPI flashROM.

#

CircuitPython is smart enough to make a new filesystem on the SPI flashROM and talk to it, and present its storage as a mounted USB volume to the host PC.

#

I think the SAMD hardware has everything to do with how this is even possible.

stuck elbow
#

it's not

#

not sure if it has enough channels to support two MSC devices at the same time

timber mango
#

you would know, deshipu. I'm just surmising /guessing here. ;)

stuck elbow
#

and someone would need to write the code of course

rugged olive
#

I'm not against trying to implement this myself, it was just quite surprising behaviour. For example:

>>> os.listdir()
['boot_out.txt', 'sd', 'main.py', 'boot.py', '.fseventsd', 'lib']
>>> os.listdir("/")
['sd', 'boot_out.txt', 'sd', 'main.py', 'boot.py', '.fseventsd', 'lib']
>>>
#

Note how there are two entries called sd?

stuck elbow
#

interesting

#

that is probably a bug

rugged olive
#

One is a folder created on the USB, the other is the sd card mount point

timber mango
#

I have to back out of here .. late for my usual mid-morning haunts. Interesting ideas.

rugged olive
#

Thanks for taking a look @timber mango πŸ˜ƒ

umbral dagger
#

Today's MetroM4/Crickit foci: audio and analog input.

prime flower
#

sounds good dastels!

umbral dagger
#

Well, audio was easy.

#

Sounds decent even using a speaker salvaged from a broken headset.

slender iron
#

@rugged olive mass storage support is done at the block level so the code that exposes the internal disk has no notion of mount points. we could add it as a second disk perhaps. It'd have to have hte same constraints on write-ability as the internal disk

prime flower
#

hrm, cpboard.py is not having a good time detecting my CPX. Weird

#

the PID/VID which it searches for is 100% correct (I double checked with PySerial) though

tulip sleet
#

@slender iron have you got time for an audio or video chat re exception handling in background tasks? This has come up with the SD card fixes. Tnx.

tawny creek
#

poofs in from listening to circuitpython updates on youtube I'm really excited about the super secret circuitpython (handheld? magicalbox) thing... and envision a way to easily play with the different adafruit sensors a-la "cartridge" type adaptor poofs back to working on school finals

manic glacierBOT
slender iron
#

@tulip sleet yup I have time shortly

#

after I finish breakfast

idle owl
#

@tulip sleet I'm around as well.

tulip sleet
#

k - I'll add you in however we chat

slender iron
#

k ready whenever

dapper vapor
#

when will the download for the itsybitsy be ready?

#

never mind. I found it

stuck elbow
idle owl
#

@slender iron I am terrible at Celeste πŸ˜„

slender iron
#

its hard with a keyboard

stuck elbow
#

what was the original controller?

idle owl
#

Ah. That makes me feel a little better.

#

Any idea if a Steam controller will work with it? I've never tried to use it with other things.

slender iron
#

@stuck elbow I played on switch first

#

@idle owl probably. I haven't tried it. instead I'm porting to the handheld πŸ˜ƒ

stuck elbow
#

ah, that is not the "celeste" I was thinking about

idle owl
#

@slender iron Also excellent πŸ˜ƒ

stuck elbow
#

@slender iron I think it was first written for pico8

#

I played it on that

idle owl
#

I'm using Pico 8 on my Mac.

slender iron
#

@stuck elbow I didn't start with that version. I'm trying to port it to our handheld though

stuck elbow
#

do you already have a prototype?

#

how is the button handling? are you polling it all the time?

slender iron
#

I have the very first one and haven't done the input yet

#

we plan on polling like gamepad because they are connected through a shift register

#

the proto I have uses a feather as the brains so pins are scarce

stuck elbow
#

the prototypes for Β΅Game used a feather and it had plenty of pins

#

6 for the buttons, 3 for the spi

#

but we could add matrix support to gamepad

slender iron
#

Β―_(ツ)_/Β―

#

thats how limor did it

meager fog
#

wait

#

what

#

what did i dooooooooooooooooo

#

i wanted 8 bit interface and a lot of extras i ran out of pins

#

and a shift reg is soooo cheap

#

to save 12 pins its worth it

stuck elbow
#

we could make the gamepad module read one row of the matrix every click

meager fog
stuck elbow
#

and switch to the next row

#

then by the time there is the next click, it should be stable

meager fog
#

between 8 bit TFT (plus 5 control lines), 6 pins for QSPI flash, and the rest of the peripherals, you run out of pins really fast

stuck elbow
#

aah, parallel interface for the tft?

meager fog
stuck elbow
#

that is great

meager fog
#

yeah M4 can DMA to PORT pins

#

we're still working out the dets

stuck elbow
#

@meager fog what I did with my esp8266 prototype, is I added an attiny24 to scan and buffer the button presses

#

the difference is that it latches

meager fog
#

yeah 74hc165 is 10 cents or so, you can latch em too

stuck elbow
#

so it keeps the presses recorded until you read them

#

this way you don't have to poll that fast

meager fog
#

but they're also super fast to read, you can read a 165 at 10+MHz

stuck elbow
#

this is the problem I had with the joystick wing too

meager fog
#

and it shares SPI port

#

but no analog

stuck elbow
#

ah, so it's not a matrix

#

well, if you can latch the buttons in the closed position, then it's perfect

meager fog
#

yah

#

no diodes needed just pullups but resistors are very cheap

#

same technique i used in the x0xb0x

stuck elbow
#

I was afraid of something that only gives you the state of the button at the current moment, like on the joystick wing, and then you have to poll very fast

meager fog
#

yeah you do

#

but you can poll at 10ms and be happy

stuck elbow
#

I wonder if seesaw could have latching added to it

meager fog
#

polling will happen in c land

#

then you query button state in python

stuck elbow
#

I wonder, does the samd have any support for the parallel protocol like the one for tft? like on the AVR you can set the state of the whole port, all 8 pins at once

#

maybe even dma?

meager fog
#

noo

#

AVR has no DMA

#

and samd21 does not have PORT DMA

#

only samd51

#

lame huh? πŸ˜„

stuck elbow
#

no, I know avr has no port dma

#

well, it's going to be used with samd51 mostly anyways

#

nothing else has enough memory even for a framebuffer

idle owl
#

@slender iron I'm trying to figure out which repo to use for my Git/GitHub guide. I'll need to go through the entire process including submitting code that fails travis, and will eventually need a "review" with changes requested. I need screenshots of everything so I need to actually go through it. I'm writing the guide as being written for contributing to CircuitPython and associated libraries since that's a larger likely audience than simply submitting to Learn. But regardless of the repo the process is the same. Do you have a preference?

slender iron
#

nope. I made a fake repo for my guide

idle owl
#

Hmm ok, I'd have to get travis going on it. That was why I was thinking of using a current one.

slender iron
#

you are free to use an existing one too. I'm sure there are some that need a fix of some sort

idle owl
#

Ok, keen. I'll let you know when I put in the PR so you don't immediately merge it. I'll deliberately do something that will need a change request and so on, and I'll let you know which it is.

stuck elbow
#

Hey, check out the nickname of the author. Coincidence? :P

#

(it's krickit)

tidal kiln
#

woooo! i made it to that first flower! only took 5 minutes!

idle owl
#

I was able to get to the shelf past the flower. but that was it.

prime flower
#

@tidal kiln x+c boosts you to it

tidal kiln
#

"it" = the spikes of death?!!!! yep. i'm good at that.

idle owl
#

highfives @tidal kiln

#

Me too!

tidal kiln
#

that's the "point" of the game, right?

simple pulsar
#

On subject of guide for library creation, do you have any house style guides for python?

#

And are there any guidelines/tips for interfaces?

tidal kiln
#

@idle owl suggestion - add links to appropriate RTD for each section in your CP Essentials guide

simple pulsar
#

Thanks @tidal kiln

idle owl
#

@tidal kiln I don't understand where they would go.

raven canopy
idle owl
#

@tidal kiln Oh wait I conflated the link with what you suggested to me.

tidal kiln
#

ha! yah. two separate things.

idle owl
#

@tidal kiln Can you email that suggestion to me? I'm currently on something else

#

We don't have any obvious lib issues to fix from Adabot that would work for the current guide.

#

I need to dig apparently.

tidal kiln
#

what would the lib issues be?

idle owl
#

I'm thinking add another example to the cpx examples folder. It's not necessarily needed, but it'll work and I can do it to trigger all the failures and change requests I need.

#

@tidal kiln I'm looking for an issue to fix that can trigger a travis failure and that I can do in a way that needs a change request in the review. I'm writing a guide on a Git/GitHub workflow and need screenshots of the entire process.

tidal kiln
#

oh. as a way to track it?

idle owl
#

Explain it? What do you mean by track

tidal kiln
#

back up...

idle owl
#

ok

tidal kiln
#

like at the bottom or something. real quick and simple.

idle owl
#

Yes that is separate from what I'm working on now. so I was asking you to email me that suggestion. Then I started to discuss what I'm currently working on.

tidal kiln
#

ok. no prob. will email.

idle owl
#

Thank you

raven canopy
#

@idle owl i need to do a quick update to the Trellis library, that cater discovered. I can leave a trailing whitespace so it fails for ya...

idle owl
#

@raven canopy Oh hmm, that could work for part of it.

rigid path
#

Sample Code: Is there any circuitpython code sample for using the 3 buttons use on the OLED Feather Wing with an M0 Express Feather and the Ultimate GPS Feather Wing? I want to show GPS data on the OLED based on the button pressed. I can get the GPS data to the OLED, now I just want to show different data with the button press. Thanks.

prime flower
#

@rigid path not that I know of, but the pinout on the oled board btns is:

#

#define BUTTON_A 9#define BUTTON_B 6
#define BUTTON_C 5

rigid path
#

@prime flower - Thanks, I will give it a shot.

prime flower
#

@rigid path I have one of the OLED FeatherWings at my desk at work, I'll make some sample code in the AM for it while I'm at it (I have a use for it anyways)

rigid path
#

@prime flower - Cool, thanks.

tulip sleet
#

@slender iron oh man, the problem was that audio_dma_background() can call Python code, and it ended up being called recursively when the Python code let the background run again. I forbade this, and I can play audio from the SD card!

tidal kiln
#
10 PRINT "YAY! "
20 GOTO 10
idle owl
#

@tulip sleet Nice!

tulip sleet
#

It's a little scratchy, so it's probably not quite keeping up. But it's not terrible.

idle owl
#

Better than a hardfault.

tulip sleet
#

Still should probably be reimplemented in C.

idle owl
#

Agreed

tulip sleet
#

I didn't expect it to actually work -- I just expected it not to fault. I was completely surprised when I heard my clip play.

ruby atlas
#

did it make you jump?

tulip sleet
#

yes!

ruby atlas
#

🐸

tulip sleet
#

this is a brief clip from some YouTube music

manic glacierBOT
#

Fixes #289.

Playing audio is done in the background, in audio_dma_background(). Playing from the SD card will invoked the Python-based adafruit_sdcard library, which may run for long enough to invoke audio_dma_background() again, recursively. This caused some havoc. Added code to prevent recursive call from repeating work.

Also cleaned up error handling in audio code

Unrelated minor fixes:

  • reduced size of buffer used to compare whether boot_out.txt is identical or not and...
ruby atlas
#

I wish I could see my bad pointer use πŸ˜ƒ

raven canopy
#

its right there.. πŸ‘€ πŸ˜†

ruby atlas
#

slow and steady careful examination of each line of code and how it runs πŸ˜ƒ

raven canopy
#

yep. debugging is why we do this, right?

crude fossil
#

As soon as we started programming, we found to our surprise that it wasn't as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs.
-- Maurice Wilkes

gusty topaz
#

@timber mango @ebon horizon @errant grail Guys, in reference to the current drainage on the nRF52 + NeoPx Matrix, I think I found an elegant and easier solution: a 6-pin 2-position DPDT switch : https://amzn.to/2yiVg38

On one position (OFF position) brings Enc to Gnd and disconnects Bat pin from the +V on the Matrix. Then, on the ON position, it reverses the connections.

errant grail
#

@gusty topaz Super! If possible, a mechanical power switch is usually a great solution.

slender iron
#

@tulip sleet awesome! I've definitely had that happen before. looking now at the PR

manic glacierBOT
ruby atlas
#

I think I've pasted this m0 express bt before, but I'm guessing I should be looking for bad pointers or stack corruption?

#0  HardFault_Handler () at supervisor/port.c:295
#1  <signal handler called>
#2  mp_load_method_maybe (obj=obj@entry=0x20001e60 <heap+5728>, attr=attr@entry=283, dest=dest@entry=0x20007db8) at ../../py/runtime.c:1107
#3  0x0000c704 in mp_load_method (base=0x20001e60 <heap+5728>, attr=283, dest=dest@entry=0x20007db8) at ../../py/runtime.c:1126
#4  0x0000c758 in mp_load_attr (base=<optimized out>, attr=<optimized out>) at ../../py/runtime.c:965
#5  0x0001836a in mp_execute_bytecode (code_state=code_state@entry=0x20007e48, inject_exc=<optimized out>, inject_exc@entry=0x0) at ../../py/vm.c:339
#6  0x0001035e in fun_bc_call (self_in=0x20000ae0 <heap+736>, n_args=0, n_kw=536873696, args=0xc4f1 <mp_call_function_n_kw+44>) at ../../py/objfun.c:267
#7  0x0000c4f0 in mp_call_function_n_kw (fun_in=fun_in@entry=0x20000ae0 <heap+736>, n_args=n_args@entry=0, n_kw=n_kw@entry=0, args=args@entry=0x0) at ../../py/runtime.c:658
#8  0x0000c504 in mp_call_function_0 (fun=fun@entry=0x20000ae0 <heap+736>) at ../../py/runtime.c:632
#9  0x00020c72 in parse_compile_execute (source=source@entry=0x39a39, input_kind=input_kind@entry=MP_PARSE_FILE_INPUT, exec_flags=exec_flags@entry=32,
    result=result@entry=0x20007f74) at ../../lib/utils/pyexec.c:103
#10 0x00020f74 in pyexec_file (filename=filename@entry=0x39a39 "main.py", result=result@entry=0x20007f74) at ../../lib/utils/pyexec.c:516
#11 0x0001b1d8 in maybe_run_list (filenames=filenames@entry=0x20007f80, exec_result=exec_result@entry=0x20007f74) at ../../main.c:122
#12 0x0001b314 in start_mp (safe_mode=safe_mode@entry=NO_SAFE_MODE) at ../../main.c:158
#13 0x0001b4e0 in main () at ../../main.c:372```
#

borrowing from issue 900, (gdb) frame 2 #2 mp_load_method_maybe (obj=obj@entry=0x20001e60 <heap+5728>, attr=attr@entry=283, dest=dest@entry=0x20007db8) at ../../py/runtime.c:1107 1107 } else if (type->attr != NULL) { (gdb) p $sp $4 = (void *) 0x20007d90 (gdb) p/x mp_state_ctx.thread.stack_top - mp_state_ctx.thread.stack_limit $5 = 0x20007550 (gdb) p mp_state_ctx.thread.stack_top - $sp $6 = 616 (gdb) p mp_state_ctx.thread.stack_limit $7 = 2728 (gdb) p &_ezero $8 = (uint32_t *) 0x20007150 which i'm now going to have to figure out how to interpret πŸ˜ƒ

#

Any tips on other things to look at would be helpful to get me unstuck and developing again would be wonderful πŸ˜ƒ

timber mango
amber oracle
#

Apologies for my lack of google skills but is there a Circuit Python for ESP32 feather yet? I just got my Feather Wing Crickit.

#

Micro Python is working great but I want to access all the Crickit goodness πŸ˜ƒ

raven canopy
#

@amber oracle not yet. no ETA on when we'll pull it down from MicroPython.

amber oracle
#

ok thank you - are the board etc Crickit libraries available outside of the firmware?

#

Seesaw etc

raven canopy
#

seesaw is, but i haven't looked specifically at the Crickit libs yet. (just got mine yesterday) πŸ˜„

amber oracle
#

πŸ‘ ok thanks πŸ˜ƒ

#

with CPX it is amazing, but needed the internets πŸ˜„

raven canopy
#

i would get on the adafruit github, and search the repositories; quicker than google.

amber oracle
#

Ah yes, will do πŸ˜ƒ

ruby atlas
#

ooh, i think i finally have a clue. i think i'm misusing mp_obj_get_array(item, &len, &items);: $9 = (mp_obj_t *) 0x200028b0 <heap+8368> (gdb) print items[0] $10 = (mp_obj_t) 0x5

#

hmmm.... digging into MP_OBJ_IS_INT / MP_OBJ_IS_SMALL_INT

drowsy snow
#

Any idea when the Feather M4 Express will be available?

slender iron
#

soon πŸ˜ƒ parts are ordered for them

wraith tiger
#

Limor said something about them possibly being available in a couple of weeks.

manic glacierBOT
#

Reference this...
https://forums.adafruit.com/viewtopic.php?f=50&t=132938&p=677479#p677479

Raspberry Pi Rx-> Cpx Tx
Raspberry Pi Tx -> Cpx Rx
And grounding pin on raspberry pi (39) to ground on cpx cause the crash immediately.

Ultimately, what I am trying to accomplish is a two way communcation between the pi and cpx using the serial pins.

I have no crashing issues if I do not use the ground, but then I am only able to send data from the Pi; the pi can not receive data from the cp...

manic glacierBOT
raven canopy
#

@stuck elbow


Adafruit CircuitPython 3.0.0-alpha.1-737-gd1b3c3c-dirty on 2018-06-15; ESP module with ESP8266
>>> import board, busio, digitalio
>>> spider = busio.SPI(board.SCK, board.MOSI, MISO=None)
>>> spider.try_lock()
True
>>> spider.configure(baudrate=100000)
>>> gp = digitalio.DigitalInOut(board.GPIO12)
>>>

still need to do an actual test of the SPI. luckily i at least have a TFT, but i need to headerize it. πŸ˜„

timber mango
ruby atlas
#

i must be messing up the runtime environment somehow.

timber mango
#

.oO(Is it gonna tell on me that I forked)

raven canopy
#

@ruby atlas i haven't had the pleasure of debugging a hard fault yet. i can't imagine it is all that much fun...

ruby atlas
#

now to see if my build works if I don't touch my module πŸ˜ƒ

#

i was running into TypeError: Expected a DigitalInOut and similar when I had explicitly passed a DigitalInOut and had verified it with a print just before that, but that error was happening in a different library (neopixel_write).

raven canopy
#

was that the "pointer of complaint"?

ruby atlas
#

nope πŸ˜ƒ side effect after restructuring main.py to be simpler.

#

and only when i use my module, so.

#

actually, that's my biggest clue yet... the very next variable in the code is being corrupted.

timber mango
#

sommersoft is there source available for itsybitsym4 circuitpython?

#

I thought I'd have fun and build it and install it but I don't see a way forward, to do so.

ruby atlas
#

okay, well, now I know for sure I'm corrupting stuff πŸ˜ƒ

manic glacierBOT
slender iron
#

@timber mango its just another board to build on the master branch

timber mango
#

@slender iron the boards directory has no itsybitsym4 subdirectory like it has for some of the other targets.

ruby atlas
#

@slender iron if i'm corrupting the value of the next defined variable in the code, any thoughts about what I messed up? πŸ˜ƒ

slender iron
#

@ruby atlas sounds like an array boundary problem

timber mango
#

I see what's going on -- my fork didn't pick it up, I think.

ruby atlas
#

that's what i think too.

timber mango
#

Thanks Scott. I can figure it out from here. I'm misoperating git somehow. ;)

slender iron
#

@ruby atlas if its consistent and you have gdb you can use a watchpoint to see what changes the value

ruby atlas
#

i just need to find the address of that variable still πŸ˜ƒ

slender iron
#

@timber mango good luck! I'm about to head to dinner otherwise I'd offer help

ruby atlas
#

at least i've narrowed things down and will be able to watchpoint soon enough

timber mango
#

It's fine. The fork didn't take for reasons I don't really need to understand, tonight. ;)

slender iron
#

πŸ˜ƒ

timber mango
#

Not in there. ;)

timber mango
#

πŸ”Έ

Converting to uf2, output size: 434688, start address: 0x4000
Wrote 434688 bytes to build-itsybitsy_m4_express/firmware.uf2.
 $ cat ~/.date-cpy-build-start ~/.date-cpybld-END 
Fri 15 Jun 02:30:23 UTC 2018
Fri 15 Jun 02:32:54 UTC 2018
#
 $ microcom -s 19200 -p /dev/ttyACM0 
connected to /dev/ttyACM0
Escape character: Ctrl-\
Type the escape character followed by c to get to the menu or q to quit

Adafruit CircuitPython 3.0.0-beta.1-21-g720042f on 2018-06-15; Adafruit ItsyBitsy M4 Express with samd51g19
>>> 

πŸ”Ί

ruby atlas
#

all this m4 hardware is making me wants.

#

I wonder how long before CPX M4

timber mango
#

With all the cowbells and whistles.

#

Whoever thought up that cowbell thing really made me smile from a place deep down inside me. ;)

ruby atlas
#

when all pointers look the same might mean: a) give up for the night b) drink something hard

timber mango
#

Drink regular drinking water when you hit the wall (unless you need nutrition instead or in addition to it)

#

I always get less stupid after a glass of plain old drinking water.

ruby atlas
#

is that the distilled 100 proof kind of plain old drinking water.

timber mango
#

No, Daddy was a gambling man who drank enough for the both of us. A few beers a month is my limit. ;)

ruby atlas
#

πŸ˜ƒ

#

i feel like i'm at least looking in the right places now.

timber mango
#

Hey, you were smart enough to pick a three letter nickname for Discord. So you already got it goin' on. ;)

ruby atlas
#

I always wished my name had some form of nickname. Made sure my kids can have nicknames.

timber mango
#

I'm Christopher so my first self-applied nick was probably more of a response than a name:
she: CHRIS-topher!
me: WHAT-topher?

#

When you have a very long name to pronounce, it gives you time to think, even while saying your name out loud. Three vowels.

#

Everyone enjoys saying my name. It's weird.

ruby atlas
#

been a popular name since the 40s

#

peaked in the 80s

timber mango
#

Well I think your name means King doesn't it (sire)?

ruby atlas
#

yeah, but it was popular in the 1890s and declined since πŸ˜ƒ

timber mango
#

(we are way off topic here)
I was a little annoyed when my given name went into common use, as when I was growing up I was the only one around -- never heard it, hardly ever.
I figured I was worth a unique name. ;) must be that Fred Rogers influence hehe.

ruby atlas
#

oh man, found my bug. 4 != 3.

#

time for the big neopixel strip!

umbral dagger
#

I had an uncle Roy

#

My dad's family was all kinds of uncommon names.

#

I suppose in the 40s & 50s they might have been more common.

raven canopy
#

sorry @timber mango. i bailed to play a little (rather poorly, if i might add).

simple pulsar
manic glacierBOT
#

It turns out the reason for this has to do with what's mounted where, and how MicroPython was set up to handle mounted filesystems. On the pyboard, the internal flash is mounted as /flash, and an SD card is mounted as /sd:

>>> os.listdir('/')
['flash', 'sd']

On the pyboard, / is not a filesystem: it's only a location for mount points. On the pyboard, you cannot create files or directories in /:

>>> f = open("/foo.txt", 'w')
Traceback (most recent call last):
  Fi...
tulip sleet
#

@simple pulsar answered your post

simple pulsar
#

Thanks, just saw it. The truncation from 32 -> 30 bit sounds a bit iffy?

#

Was this representation chosen to be more frugal with memory?

tulip sleet
#

@simple pulsar I thought about the rounding vs truncating for 32->30 bits, but I came up with some cases where rounding was not a good idea -- can't remember them off the bat. Yes, the reason is to save memory, which is a big deal when you only have, say 20k of heap space (12k is for stack). MicroPython did all this work -- we just inherited it. The alternative would be to use a pointer to 32-bit or 64-bit floats, and that would use double or triple the RAM, except for array.arrays of floats. Regular Python also uses shorter ints, but includes longints as a matter of course, and it uses double floats all the time.

simple pulsar
#

@tulip sleet Size makes sense, I'm not so sure on the rounding approach, but lunch is more important at the moment! Then i need to get back to my new Bearables library. Thanks for the background info.

idle owl
#

@tulip sleet I told Scott, but I wanted to mention to you as well, I'll be putting in a travis-failing PR soon, and something that will require a change request of some sort so I can document the whole process. I'll let you both know when I do it so you don't simply merge it.

tulip sleet
#

sure, thanks for the heads-up

idle owl
#

Trying to find something. I can add another example to the cpx lib, I guess. Adabot didn't provide anything useful to fix.

manic glacierBOT
idle owl
#

The buggery thing is, I have a PR into the CPX lib right now that has change requests on it. It'd make more work for whomever has to check it again, but I could close it and resubmit it.

#

Either way someone is going to have to review something for me.

manic glacierBOT
#

This makes os.listdir() include mounted filesystems when the current directory is /.

Also fixes the mounted filesystem sometimes showing up as, e.g., b'sd' instead of 'sd'. Some code was treating a char * as an mp_obj_t by accident.

The handling of "" by mp_vfs_lookup_path() is not ideal when the main filesystem is mounted at /. This avoids that by actually passing in the current directory instead of "".

Note that os.listdir('.') when the current directory is `/...

tidal kiln
#

@idle owl happy to help with review for guide. just let me know...

idle owl
#

@tidal kiln Thank you!

manic glacierBOT
#

member hybotics/geekguy mentioned the same use case that I have for which this feature is highly desirable. At my company we use Raspberry Pi boards to host our internal test and production machines and sometimes have Arduino boards hanging on them over USB. CircuitPython boards are preferred compared to Arduino because we can stay with one language and also the instrument is self-documenting because it hold's its own code and readme files. The hardware is relatively elegant because it...

manic glacierBOT
#
[adafruit/circuitpython] New branch created: nrf52840\_usbboot
manic glacierBOT
#

@hathach OK thach we now have 'nrf52840_usbboot' as a branch you can use here!
if you can fork this repo (instead of the microbuilder fork), we can take pull requests directly from you without bugging @microbuilder - i will also put you as a collaborator/reviewer so you can accept and review other pull requests if you want :)

also we will try to set up automation so on commits, binaries for bootloader and circuitpython will be built, that way you do not have to!

does that sound OK?

timber mango
#

@tulip sleet Do you know why forking circuitpython did not bring over the itsym4 code along with it?

tulip sleet
#

if you forked before that was added, you need to update and sync your fork.

#

hold on for a url

manic glacierBOT
meager fog
#

maybe helpful!

timber mango
#

Thank you, @meager fog

tidal kiln
timber mango
#

@tidal kiln thanks! I'm trying to do a recipe ladyada just pointed to. I think it'll work but the going is slow as I take a long time to absorb stuff I can (later) recount without effort. ;)

tulip sleet
#

sorry I got an important phone call just when I was looking. cater's link to "syncing-a-fork" is what I was looking for

timber mango
#

That's fine Dan. I think it worked (what I just did; a simple Pull Request with mine as base and adafruit's as head. Then merged that. Should not impact others, I'd guess).

tulip sleet
#

if you do a pr, you will get out of sync with the commit chain from master. The basic recipe is:

git remote add adafruit https://github.com/adafruit/circuitpython
git checkout master
git fetch adafruit
git merge adafruit/master
timber mango
#

I can type all that into my local linux host, is that correct?

tulip sleet
#

That should be a fast-forward merge.

#

right

timber mango
#

Should I undo anything on my personal repo?

tulip sleet
#

if you've strayed from master, it won't be a fast-forward.

#

did you commit on master on your fork?

timber mango
#

No commits just the merge.

#

(thru the webbed github interface only)

tulip sleet
#

did you pull from github yet with that change?

#

DON't yet

timber mango
#

I haven't done a pull to my local machine at all today.

tulip sleet
#

then don't pull. Instead do what I showed you above. It should be a fast-forward merge. then do

git push -f

which should override the merge you via the PR.

#

if it wasn't a fast-forward merge locally, then you have other changes that need to be undone or something

#

in general, never commit changes on master in your fork. use a branch instead. Then your master will always be an exact copy of the upstream repo

timber mango
#

I do not know what fast forward means in this context (at all; new term for me as of this very conversation ;)

#

I'll just take all this down in my notebook and try to learn a thing or two. ;)

tulip sleet
#

it will say "fast-forward" when you do git merge adafrui/master. What that means is that no merging of different files was necessary: instead you just had older versions and it brought them up to date. If you had made changes locally, then git would have to compare the files and merge in (hopefully automatically) the changes in adafruit/master

timber mango
#

I always commit to my master branches so I'm uncertain about branch uses (I can parse them okay when someone else's repository makes use of them).

stark portal
#

Is there any fast way of disabling the signature check thingy when running this command: "sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa"? Reading some manpage for APT-SECURE but doesn't really know linux that well.

tulip sleet
#

don't comit to master of a forked repo, it's much harder to keep up to date that way

timber mango
#

Scotty picks up the Apple II mouse and says 'Hello, Computer!'

#

I think I get that very easily -- that advice not to commit to the master of a forked repo. Got that.

tulip sleet
#

I would highly recommend studying this book: https://git-scm.com/book/en/v2. It will take some hours but you will come away with a much better understanding.

timber mango
#

Yeah @wraith tiger has told me at least twice where to read for more info. On my bucket list. ;)

tulip sleet
#

@stark portal you can do sudo add-apt-repository -y ... -y says answer "yes"

timber mango
#

Firefox says I bookmarked that in March of this year (which was probably a re-bookmark of an earlier visit to it!)

tulip sleet
#

man add-apt-repository will help

#

a few years ago I printed it out and read it (at work)

timber mango
#

This is great information!

raven canopy
#

Pro Git book is worth it's bits in platinum.

tulip sleet
#

also don't forget git submodule update bringing yourself up to date

timber mango
#

(I'm a big Linus Torvalds fan, so I do want to learn what he's done, here)

stark portal
#

@tulip sleet thanks, I'll try to get this working.

timber mango
#

I always remember the submodule update. That stuck very early on.

tulip sleet
#

my general feeling is that git has a terrible UI, since it has to give you hints about what to type all the time (e.g. what git status prints)

raven canopy
#

Agreed. But it's utility begs you to forgive it. πŸ˜„

timber mango
#

I think it's one of those software suites that you have to employ frequently to use it very intuitively.

stark portal
#

I might have installed the wron version of Ubuntu, is 16.04 the one I should use? Installed the 18.04 one. (Running Windows 10 btw) Trying to get the build tools for circuitpython installed.

idle owl
#

Working on a guide that will help with all of this πŸ˜ƒ

tulip sleet
#

@stark portal either is fine

#

are you using Windows Subsystem for Linux (WSL?)

stark portal
#

@tulip sleet yes, getting some strange 404's when running apt install. Will disable VPN, brb.

tulip sleet
#

the ppa for the arm toolchain hasn't had a bionic build included yet. You may need to set it to xenial. Or you can use 16.04 instead of 18.04 and that will work fine.

stark portal
#

Seem to work now in 16.04, could've been the VPN acting up-

manic glacierBOT
idle owl
#

@slender iron @tulip sleet PR going into cpx, please ignore it. Working with it for the guide.

timber mango
#

Transcript. Unexpected outcome (no more itsybitsym4 in my github repo. Local looks okay (will try a build on it soon).

#

Alright. I might have it, correctly, now, everywhere. Maybe. ;)

simple pulsar
#

Hello, I'm writing a driver for a 12 led device where the brightness can be varied per LED but not the colour.

#

I was thinking of doing the array thing so it can be used like the neopixel library but I'm curious if anyone has an tips on values to use as brightness. I've seen an existing library use floating point values which means the user doesn't need to know the range. I'm wondering if there's an established pattern in Adafruit libraries for non-RGB leds with variable brightness?

meager fog
#

we like to use 0 to 1.0 for brightness

#

cause its easier to visualize than 0 to 255

#

and in the code/library do the mapping to whatever range you need based on your pwm

simple pulsar
meager fog
#

yah i think thats cause its a low level and not a big range

stark portal
#

0-15 is a 4bit number, probably a reason for that πŸ˜ƒ

meager fog
#

i would recommend 0 to 1.0 if ya can add it to your code

#

especially if its a wrapper πŸ˜ƒ

simple pulsar
#

Ok, i'll go with a float for now. Ah, you're probably familiar with these, I hadn't realised you sold them too: https://www.adafruit.com/product/3745

stark portal
#

If you have RGB values later it's pretty neat to do brightness with float like (0.4150, 0.4190, 0.4*255). I think I did something like that some years ago in processing.org.

simple pulsar
#

From memory the dotstar/neopixel code does this, detects whether an int or tuple is passed. I suspect for cost reasons this cute little bear/fox will not go rgb but we'll see

#

Thanks all

prime flower
#

@rigid path did you end up getting the OLED featherwing going?

dapper vapor
#

What's the difference between itsybitsy and metro mini besides voltage?

timber mango
#

Which two boards (product numbers) are you comparing? @dapper vapor

dapper vapor
#

@timber mango Let's go with 3727 and 2590

tulip sleet
#

@timber mango Your transcript shows you were operating in a clone of adafruit/circuitpython, not a fork. If you do git remote -v in that repo, what do you see? Did you ever click the "Fork" button? After you fork, you need to clone your fork.

timber mango
#
 git $ git remote -v
adafruit        https://github.com/adafruit/circuitpython (fetch)
adafruit        https://github.com/adafruit/circuitpython (push)
origin  https://github.com/adafruit/circuitpython.git (fetch)
origin  https://github.com/adafruit/circuitpython.git (push)
tulip sleet
#

@dapper vapor the Metro mini is a much weaker processor, much less memory and flash

#

@timber mango what is your git username?

timber mango
#

wa1tnr my ham call is my git username

tulip sleet
#

that repo is a clone of adafruit/circuitpython, because there's no mention of wa1tnr/circuitpython in the remotes list

#

you need to git clone https://github.com/wa1tnr/circuitpython and then add the adafruit remote.

#

If there is no significant code in your fork you may just want to delete it and re-fork.

timber mango
#

Yeah I want to delete it for sure. ;)

tulip sleet
#

that will get you a clean copy

timber mango
#

I was worried if I deleted it and then fork again it'd annoy everyone else who uses the upstream.

tulip sleet
#

we don't see you fork, don't worry

timber mango
#

Haha. Okay good enough! Thanks.

tulip sleet
#

thousands of people could fork - upstream wouldn't necessarily want to hear about it every time

timber mango
#

Indeed!

#

@dapper vapor generally you evaluate a target board on:
1. MCU -- what processor? is it 8-bit or 32-bit?
2. RAM and FLASH capacities?
3. Peripherals: what peripherals are inside that tiny chip?
4. Pinouts: Which of the many pins on the chip did the vendor (Adafruit) bring out to the edge where they can be soldered to?

#

Adafruit does a lot with #4 on that list -- they bring out different pins on different targets, usually a subset of what's possible given infinite space resources.

#

ItsyBitsy has a lot of pins brought out for the size of it, comparable to the full-sized Metro boards, for example.

#

Your project may be pin-hungry or you may only need a few pins. You might choose one or the other based on the asking price, or on the space it has to fit into inside your tiny project. Tradeoffs.

#

I'm biased away from anything 5V so all my comparisons (personally) are between 3.3V microcontrollers. Usually M0 or M4 (SAMD series).

stark portal
#

Is the STM32 port really broken now or should it work? Getting: make: *** No rule to make target 'lib/mp-readline/builtin_input.c', needed by 'build-PYBV11/genhdr/qstr.i.last'. Stop.

stuck elbow
#

@stark portal there is no stm32 port for circuitpython

#

only samd21, samd51, esp8266 and experimental nrf52

stark portal
#

Ahh alright, thought there was one. Browsing circuitpython on github and saw the stm32 folder. πŸ˜‰ I'll just buy one of the official ones.

dapper vapor
#

does metro mini work with circuitpython?

stark portal
#

It should, SAMD51 processor on that one.

#

Actually looking at that one right now. πŸ˜ƒ

stuck elbow
#

@dapper vapor which one? you have a link?

#

@stark portal it's there from MicroPython, but it's not functional

dapper vapor
stark portal
#

Sry, I'm looking at the Metro M4

stuck elbow
#

@dapper vapor no, that is an AVR, atmega328

#

way too weak for circuitpython

stark portal
#

If you need a really small one I think the Trinket M0 is the one to buy.

stuck elbow
#

generally anything M0 or M4, plus the ESP8266 HUZZAH (but not the esp32 one), and experimentally the nrf52 ones

#

trinket m0 or if you need more pins, itsy bitsy m0/m4

#

the m4 one is really powerful and rather cheap

#

it's also good to take the "express" version, because it has more flash memory for all the libraries and code

stark portal
#

@stuck elbow Would it require a ton of work to get circuitpython running on a STM32F429I Discovery? It's an M4 based board.

tender thorn
#

I've run out of memory with the trinket m0 a couple of times

stuck elbow
#

@stark portal in Adafruit show M4 is the code for SAMD51, not any Cortex-M4 board

tender thorn
#

until I got careful

stuck elbow
#

@stark portal it would be a considerable effort

stark portal
#

Alright, I'll try to get the ESP8266 Huzzah up and running.

#

I think it's called that atleast.

#

This one: Adafruit HUZZAH ESP8266

prime flower
#

git question - is there a shortlink to get to a latest release?

tulip sleet
#

@stark portal we have prebuilt binaries for that. Just making sure you know?

stark portal
#

Yea I saw that. Great! Got this FTDI Friend that I probably need to use. πŸ˜‰

raven canopy
#

Not needed. Feather Huzzah esp8266 has on board USB serial chip (SI2104 IIRC)

tulip sleet
stark portal
#

I have no USB port on this one. Might be a non Feather one? Or I've got some ripoff.

prime flower
#

@tulip sleet hrm, I was wondering why /latest wasnt working. I'll fix that on monday when I do a release

tulip sleet
stark portal
#

Yea, I've got the Breakout one

raven canopy
#

I don't think CircuitPython will work with any non-feather esp8266. The pin mappings are most likely different...

tulip sleet
#

it might because there are so few pins. not sure about the serial mapping

raven canopy
#

Might be an interesting thing to attempt... πŸ€”

stark portal
#

Pin mappings could probably be solved.

timber mango
#

I don't understand why the second time I forked the upstream, it pulled in the itsybitsy_m4_express code (didn't, last night late in the evening).
Using the webbed github interface logged in to my account.
No voodoo this time -- just worked the first time I tried it.

dapper vapor
#

@digital urchin suggestion: you should make the boards with color coded solder mask so that all the circuitpython compatible boards are one color and the rest are a different color

raven canopy
#

@timber mango as Dan alluded to, I think you're conflict is that the webbed fork isn't what you have locally. Your local should be git clone https://github.com/waltn1r/circuitpython. Then you do git remote add upstream https://github.com/Adafruit/circuitpython. To bring you local and fork up to Adafruit master, you do git pull upstream master for local, then git push origin master for the webbed fork.

simple pulsar
#

I would comment that the Gemma is a confusing product because it's very easy for a novice to not understand the difference between a Gemma and a Gemma M0 and order the wrong one. I emphasise M0 heavily in anything I write about them.

manic glacierBOT
timber mango
#
Adafruit CircuitPython 3.0.0-beta.1-23-g5ce1d71 on 2018-06-15; Adafruit ItsyBitsy M4 Express with samd51g19
>>> 

built a moment ago from the new fork.

#
Adafruit CircuitPython 3.0.0-beta.1-21-g720042f on 2018-06-15; Adafruit ItsyBitsy M4 Express with samd51g19
>>> 

last night's build.

tulip sleet
#

@timber mango I think your original problem was that you didn't clone your fork - you cloned the upstream repo. If you cd into your fork now, git remote -v should show wa1tnr/circuitpython as origin

timber mango
#
 git $ /bin/pwd | cut -b17-99
circuitpython
 git $ git remote -v
origin  https://github.com/wa1tnr/circuitpython.git (fetch)
origin  https://github.com/wa1tnr/circuitpython.git (push)
#

Looks to me like 3.0.0-beta.1-21-g720042f is older than 3.0.0-beta.1-23-g5ce1d71 and that's all I needed to be concerned with, that I'm up to date.

#

And, apparently, I've forked correctly, so that seems good to me. I just do not understand why it didn't work correctly last night (forked, then discovered there was no itsybitsy_m4_express source; today; forked, and there it is where it belongs).
Last night's build was against a direct clone of adafruit's repo, which probably explains how I got off track today (conflating that against the fork I thought I did).

tulip sleet
#

I think you forked last night but never actually cloned that fork, and were instead working in older clone of adafruit/circuitpython

timber mango
#

Why did the fork itself not show boards/itsybitsy_m4_express though?

#

Did something change overnight that's none of my doing? Or am I misoperating the software on my end?

tulip sleet
#

you mean on github it didn't show that board?

timber mango
#

On github my fork of last night did not show the itsym4 source at all (and others were also missing).

#

Metro M4 Express was present iirc.

tulip sleet
#

did you actually press the "fork" button last night? Was that the first time you ever did that?

timber mango
#

Yes I pressed it once and only once, and that was last night well after 6 pm.

#

Anyway it seems to be working now with a simple two-step 'fork, then clone the fork that you now own' and that worked quite well in the past hour.

tulip sleet
#

i have no explanation but my guess is that what you remember you did is not exactly what you did (happens to me too). Or you might have accidentally been looking at an older commit or branch when browsing the source online.

timber mango
#

Fair enough -- haha I have trouble discerning what I did 5 minutes ago. ;)

#

Another oddball clue: the fork never appeared at the top of my Repositories list (on github web). I had to hunt for it. That's last night's. Todays: appeared at the top of my Repositories list, just as if I'd created a new Repo.

wraith tiger
#

Well, I completed my uflash edits and submitted a pull request. We'll see what comes of it.

slender iron
#

@timber mango I think the notion of a fork is more confusing than helpful in this case. You really only need to worry about our github and your local git

#

your fork only matters when you want to host your code on github

simple pulsar
#

hello, for a minor document issue what's best thing to do?

raven canopy
#

@simple pulsar there is a "Feedback? Corrections?" link on the left side of the guide, below the page links. That will notify the guide author(s).

simple pulsar
#

Thanks, I've used that before. I'll use it again!

slender iron
#

@simple pulsar if the code block has alink to github then you can PR to it there

raven canopy
#

I looked. it doesn't.

#

that was my first thought, too. (sorry if that reply seemed "snarky" πŸ˜„)

meager fog
#

@idle owl @slender iron hey since that's an older guide, can you take a look next week?

karmic notch
#

I just got a shipment of ItsyBitsy M0 Expresses for a class I will be teaching this summer. I am running through the example CircuitPython code and get a memory error when I try to play any of the example audio files. Any suggestions?

manic glacierBOT
slender iron
#

@meager fog ⬆

meager fog
#

yeo thank uuu

#

@karmic notch hmm it should be ok, what version are you running of circuitpy?

#

do you have the code you're running - maybe post a gist

karmic notch
#

i just installed the latest on this board.

simple pulsar
#

Are you playing dubstep?

karmic notch
#

well, I just checked again, button 10 plays laugh.wav

#

here is the play_file code

#

def play_file(filename):
print("")
print("----------------------------------")
print("playing file "+filename)
f = open(filename, "rb")
a = audioio.AudioOut(board.A0, f)
a.play()
while a.playing:
pass
print("finished")
print("----------------------------------")

#

def play_file(filename):
print("")
print("----------------------------------")
print("playing file "+filename)
f = open(filename, "rb")
a = audioio.AudioOut(board.A0, f)
a.play()
while a.playing:
pass
print("finished")
print("----------------------------------")

#

oops

meager fog
#

oh yknow pleae close the files when you're done

#

f.close()

karmic notch
#

gotcha

simple pulsar
#

Does f.close() effectively happen when f goes out of scope as function returns?

tulip sleet
#

@simple pulsar, no, you could use a with block instead

slender iron
#

@simple pulsar nope, python doesn't make any promises about when a finalizer (before deletion) is run

simple pulsar
#

😦

karmic notch
#

'''def play_file(filename):
print("")
print("----------------------------------")
print("playing file "+filename)
f = open(filename, "rb")
a = audioio.AudioOut(board.A0, f)
a.play()
while a.playing:
pass
print("finished")
print("----------------------------------")
f.close'''

meager fog
#

contexts are good too, but i am not "hip" and "cool" and i forget about em

#

yeah!

karmic notch
#

hmm I didn't do that correctly πŸ˜ƒ

meager fog
#

er f.close() <- parens

tulip sleet
#
    ...
# done
raven canopy
#

```
code here
```
the backtick is usually next to the number 1, under ESC.

karmic notch
#

oh, ha, thanks. Same as Tilde.

raven canopy
#

yep! that's the one. they're lonely keys, these days. πŸ˜„

timber mango
#

@slender iron I figured I'd begin the process of possibly contributing patches and so forth. So if I do make some progress in that direction, I'm not at the same time trying to learn even the basics of a PR.

ruby atlas
#

Woohoo, the work on pixelbuf, even if not yet optimized, is going to help with big strips for sure.... 32 pixel featherwing running the colourwheel and setting single pixels via p[x]:
Time for one full loop of the colourwheel animation, (brightness=1).

Pixelbuf+neopixel_write 6.75098
Neopixel 17.818

slender iron
#

@timber mango awesome!

ruby atlas
#

Now that I know it works well enough time to make the remaining code just work, then add accelerated brightness adjustment to it too.

timber mango
#

;) @raven canopy I seem to recall I blew past your input today. I am sorry. I juggle a lot when I learn the slightest thing. there are casualties :(

ruby atlas
#

I was wondering which of the following ways to do brightness computation for neopixels:

  1. double buffering: require two buffers be passed in, update both on setting pixels, recompute the scaled one on brightness change
  2. compute on write, don't handle brightness changes (requires re-writing pixels)
  3. add way to copy the pixel buffer to another one with brightness scaled.
raven canopy
#

@timber mango hehe. no worries.

#

restrains "I like option 3" joke oh wait... πŸ˜†

timber mango
#

minerva minerva minerva << they fly

ruby atlas
#

lol @raven canopy i finally remembered my 3rd option

raven canopy
#

oh man...now i look crazy. shoe fits, though. πŸ‘Ÿ

ruby atlas
#

i personally like the two buffer approach, but it requires more heap. option 2 makes sense for tight memory uses.

#

option 3 is closer to the current libraries, but is probably the slowest approach

#

option 2 is also probably the fastest - fire and forget.

slender iron
#
  1. is closest to what we do now
ruby atlas
#

sorta. we keep allocating and throwing away a buffer πŸ˜ƒ

#

and keep recomputing the brightness each time

#

(which is why i'm benchmarking with brightness=1 right now)

slender iron
#

peak memory is the same πŸ˜ƒ

ruby atlas
#

true.

timber mango
#

I like setting a brightness parameter 'into the environment' that affects all future brightnesses, but (of course) does not go back and 'correct' previous commands to any NeoPixel. Just impacts writes, going forward.

ruby atlas
#

so maybe #1 and note that #2 is viable.

#

Since I don't really want to change existing behaviour on anyone.

timber mango
#

But if you want highest color fidelity, algorithmic processing probably doesn't work so good. So, table lookups.

ruby atlas
#

well, yeah. that's where some of the the stuff in fancyled/fastled will eventually come into play.

#

but those libs are huge.

#

well fastled is.

#

(huge by m0 standards)

simple pulsar
#

I'm not following all of this but one way to introduce new behaviour is via an option to the constructor to allow people who want it to select new behaviour

timber mango
#

I would make a complete palette of say, 16 colors, in 3 brightness levels -- and discard any that aren't used in a given program.

ruby atlas
#

@simple pulsar yep! that was my plan.

timber mango
#

I think smoked glass filters (or the like) might enhance things visually. Many projects don't make it that far.

ruby atlas
#

I need to print a diffuser for the featherings

#

In fact, I'm gonna do that NOW....

#

Oh wait, my calipers are inside in my office, not on the porch.

manic glacierBOT
slender iron
#

@meager fog @tulip sleet I'm adding a nrf52840 build to travis for the DK

manic glacierBOT
#

I meant to note that I did not test one-way SPI (MOSI only, MISO only). I don't have a test case for that, so feel free to wait for someone who does/can. I could hook up the Saleae, but not sure that is a valid test...

I think a sufficient test for MISO is to jumper the MISO pin high and see if you read 1's and then hold it low and see if you read 0's. For MOSI you could use the Saleae and just send data, or even just send it to an LED: all 1's and all 0's.

It's equally important just ...

#

@dhalbert

It's equally important just to test that supplying None for either pin doesn't crash.

>>> import board, busio, digitalio
>>> spider = busio.SPI(board.SCK, board.MOSI, MISO=None)
>>> spider.try_lock()
True
>>> spider.configure(baudrate=100000)
>>> gp = digitalio.DigitalInOut(board.GPIO12)
>>>

That is what I ran for both to check construction and pin lockout.

I can run those with the Saleae. Just wasn't sure if that would pass muster for a real-world test.

raven canopy
#

stomach is overriding brain... food. then, test. πŸ˜‹

manic glacierBOT
tulip sleet
#

@slender iron should we do anything about precise_time now or defer it for 3.later. Still more to discuss maybe (after I found the new PEP)? That's a remaining 3.0 PR.

slender iron
#

yeah, I'm ok punting it

tulip sleet
#

i will change the milestone

slender iron
#

kk

#

great job on the filesystem stuff!

tulip sleet
#

tnx - i was in the groove on that. but the base code is kinda ad hoc - it could use some long-term cleanup, maybe we would get os.path support out of that for free or vice versa

slender iron
#

@tulip sleet totally, we can clean things up as we need to improve them

idle owl
#

Great job, @tulip sleet!

manic glacierBOT
tulip sleet
#

@slender iron @idle owl re our discusiion about stuffing lib/ into a zip file: some existing points of reference: .egg Python package files, wheel (.whl) package files (supersedes eggs). zipimport:
https://packaging.python.org/discussions/wheel-vs-egg/
https://www.python.org/dev/peps/pep-0427/
https://docs.python.org/3/library/zipimport.html
adding an unzip library to the runtime might take significant space - anyway I'll continue to check out things and read about packaging in general, since that's a hot topic (I should catch up on the PyCon stuff).

slender iron
#

zip import looks like what I'm looking for

#

any other extension won't be obvious to the user

tulip sleet
#

i'm not sure extension matters as much as the fact that it's one file. gotta step out, will be back

slender iron
#

I think the extension is important because zip is the most well-known container extension. It says "Hey, there are files in me!"

ruby atlas
#

indeed. and it's file index is uncompressed.

idle owl
#

Nice

ruby atlas
#

and the "central directory" is at the end so incomplete zips won't partially work. https://en.wikipedia.org/wiki/Zip_(file_format)#Structure

ZIP is an archive file format that supports lossless data compression. A ZIP file may contain one or more files or directories that may have been compressed. The ZIP file format permits a number of compression algorithms, though DEFLATE is the most common. This format was ori...

#

2k of code

#

the author claims

#
timber mango
#

pkzip was a big deal when it came out. Around 1989 I was working in a computer retail store (repairs, sales) and I distinctly remember pkzip was still 'news'.

ruby atlas
#

indeed. then the compression wars began.

timber mango
#

iirc one of the differences was in the maximum archive size.

#

pkzip was known to be reliable up to a given (pretty large) size of archive file.

#

winzip.exe kind of sealed the deal; made this format accessible to untrained people.

#

(click and grunt)

#

I think ARJ was considered superior but spartan -- not friendly to novice users.

ruby atlas
#

i'm forgetting some, but arc, zip, rar, bzip, 7zip...

#

oh right arj!

#

and cab needs some honourable mention for making windows distributions smaller

timber mango
#

really when gzip came out that was the first time I thought "this replaces .ZIP and .ZIP should bow out".

ruby atlas
#

except that gzip alone didn't replace zip, still needed tar or cpio

#

some of the newer ones are interesting - trading space for speed - eg snappy and lz4 and lzop

timber mango
#

stuffit.

ruby atlas
#

ouch. oh wait, expander. not me.

#

πŸ˜ƒ

timber mango
#

I imagine ftp.funet.fi still has some of the oldest ones (if a mirror exists or if it exists).

ruby atlas
#

oh wow funet isnt slow anymore.

timber mango
#

zoo

ruby atlas
#

next we'll start talking about the old music file formats (which might be relevant for CP)

#

mod, s3m, stm, etc

timber mango
#

As long as it's not a self-extracting archive *EXE I'm not complainin'.

manic glacierBOT
#

In UNIX(-like) systems, you have to have an existing dir as a mountpoint. But storage.mount() does not require or mean allow this now, and neither does MicroPython. In fact, right now, it breaks things to have a dir with the same name: you end up with two identical names in the dir listing and it wreaks havoc when you try to umount or use the mount point. So this checks for duplicates and complains. It's just enforcing something that should have been tested previously. In MicroPython it was...

tulip sleet
#

@slender iron @idle owl turning on uzlib (which is basically just a tiny unzip impl) adds about 2900 bytes. So that's probably about the minimum for something like zipimport.

idle owl
#

@tulip sleet can we work it?

tulip sleet
#

if we were to provide on non-Express boards, we need to reclaim a lot of space to make it fit

#

Scott has some ideas about reclaiming a few kilobytes, and we might get some back when we merge MicroPython 1.9.4: Damien made some compilation tables smaller

#

right now the non-Express builds are very close to full

ruby lake
#

Finally getting around to my "when MIDI was New " blog articles

manic glacierBOT
manic glacierBOT
#

Computers running Ubuntu/Linux may be unable to write to the Circuit Playground Express board. To fix this udev rules need to be installed.

The steps to install the udev rules are mentioned in Arduino guides, but are not mentioned in the CircuitPython guides. Would it be possible to add the udev rules installation steps to the CircuitPython troubleshooting guide?

The Arduino guide can be found here https://learn.adafruit.com/adafruit-arduino-ide-setup/linux-setup#udev-rules

manic glacierBOT
#

@BtreeComputingServcies could you explain a little further what you mean by "crash"? It is a little hard to tell if this is a hardware issue, or a software issue.

Does the CPX reset completely (power cycle)? Or, does the program just stop running (with an Exception)?

If there is an exception, please post the Traceback.

hazy trail
#

I have trying to get familiar with circuitpython. I have a few questions about it libraries.....in one of the learn projects there are the import commands:
import time

import board

import busio ....My question is are there separate libraries to load on the circuitpython device (trinket M0)? The reason I ask is because when I look at the circuitpython bundled library (lib) I don't see individual files named as time, board or busio.

raven canopy
#

@hazy trail those three are "built-in" libraries; no need to load them as external libraries.

hazy trail
#

understood. thank you very much for the very quick response.

raven canopy
hazy trail
#

another question. I was using 'atom'. But which app would I use to compile the code with the device (trink M0) connected to check and see if all the libraries are with the device? to do sort of a check first hand to insure all my libraries are loaded.

raven canopy
#

Python (aka CPython), and by extension CircuitPython, is an "interpreted language". It is not a compiled language like C/C++/Arduino/etc. The CircuitPython firmware converts the code you write into "bytecode" that the MCU can use. The easiest way to check if all your dependencies are loaded is to just look at the CIRCUITPY drive. Also just as easy to run the program you've written, and see if it complains about missing libraries.

hazy trail
#

Got it. Thank you. Also, Thanks for the link .

raven canopy
hazy trail
#

very much appreciated.

#

your preview comment makes sense now. because when I connected the device, I saw a drive named something like 'python' and then another drive named 'circuitpython'.

raven canopy
#

That's one of the great parts for the SAMD (M0, M4) boards. They have USB Master Storage Class capability, so it mounts just like a flash drive. Makes moving files to/from much easier.

slender iron
#

@tulip sleet I don't think we need zip in the non-express builds. We could probably make it M4 only too

tulip sleet
#

yah, since the whole library won't fit on non-express builds anyway

tulip sleet
#

i will test MISO on sommersoft's PR and then approve it

tulip sleet
idle owl
#

@tulip sleet Might make sense, we should test on both.

#

I wonder if you can simply put two checkboxes before it. I'm guessing not.

raven canopy
#

@tulip sleet if you wouldn't mind, let me know how you get a successful test. i was thinking that the lack of SCK activity is where i was coming up short, but using a FeatherM0X to gen the SPI signal didn't work as i thought it would. could never get spi.readinto(buffer) to populate...

ruby atlas
#

Phew, I now have the basics working in pixelbuf. Time to deal with brightness then with dotstars.

#

~1.5s per cycle for for j in range(255): p[0:8] = [wheel( (i * 32) + j & 255, i) for i in range(8)] neopixel_write(pin, p.buf) vs 4.3s per cycle for ``` for j in range(255):
strip[0:8] = [wheel( (i * 32) + j & 255, i) for i in range(8)]
strip.show()

idle owl
#

@raven canopy πŸ˜† at Discord saying you're "Playing Atmel Studio".

raven canopy
#

It's a strategy game. The opponent usually wins... πŸ˜„

#

and Pandora doesn't have a cool deal with discord (and isn't available since it won't detect WinStore apps).

tulip sleet
#

@raven canopy I didn't check the SCK signal. I just grounded or raised the MISO pin and did a readinto(buf) and saw whether it had zeros or ones in it.

raven canopy
#

i tried that, and got nothing... 🀷

tulip sleet
#

The SCK signal would come from the ESP8266, because it's still an SPI master. You wouldn't generate it externally.

>>> import busio, board
>>> spi = busio.SPI(clock=board.SCK, MOSI=None, MISO=board.MISO)
>>> spi.try_lock()
True
>>> buffer = bytearray(5)
>>> spi.readinto(buffer)
>>> buffer
bytearray(b'\xff\xff\xff\xff\xff')   # jumpered MISO to 3.3V
>>> spi.readinto(buffer)
>>> buffer
bytearray(b'\x00\x00\x00\x00\x00')   # jumpered MISO to ground
>>> 
raven canopy
#

hmmm...maybe it was because i used a zero length bytearray. it was late, and Taco Bell was settling. otherwise, my test was exactly the same (using a gpio as OUTPUT vs 3.3v).