#circuitpython-dev
1 messages Β· Page 175 of 1
very down to earth
thankya. usb superposition is something I'd love to become standardized soon
okay, downloading most recent beta from master, good idea?
yup!
@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.)
PS: Allowing DigitalInOut would require changes to the shared-bindings/pulseio/PulseOut.c so I wasn't sure that was in scope either.
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$ ```
git submodule update --init --recursive
@marble hornet no need to ping me only. others can help too. just ask
understood
btw notice you are building for Metro M0
should i run git submodule update --init --recursive in the tools ? thanks, i would have totally missed that
anywhere in the hierarchy is fine as long as you're not in a submodule directory
it's covered here: https://learn.adafruit.com/building-circuitpython/build-circuitpython but fine to ask as well
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
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
@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.
i think it is working
indeed , pink you're right :}
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.
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
should be fine
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
thanks
as for my programmings skills , make code is about as good as it gets for me ;}
Ahhh...that's right. The curse of being attached to the RTC register.
This does appear to be an adafruit_sdcard issue. Closing this in favor of:https://github.com/adafruit/Adafruit_CircuitPython_SD/issues/8.
Agree that the larger change would be better outside this PR. If it is desired... π
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
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
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$ ```
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.
try unplugging the jlink from usb, then plugging it back in, and make sure your board is powered as wel
right, that's what i meant.
@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. π
@raven canopy when you say start over form zero do you mean unplug and re-plug? or...
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. π
@raven canopy done, changed swd cable too
maybe measure some voltages on the board before and after regulator
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...
typo, 3.29 to 3.30
do you have another board you can try jlink on?
3.0 works differently than CPy 2.3.1. The examples break with 3.0 because of the bytearray content check:
data = uart.read(1) # get a byte from RX if data is not None: β¦
@tulip sleet it connects to and atsamd21g18
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.
yah!, then when i re-plugged it it stopped working
your SWD connector is keyed, right? cable can't be wrong way round in that socket?
could be a bad solder joint somewhere
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
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
unplug and re-plug the cables?
the first cable was keyed too?
maybe the connector is reversed, but you connected it initially wrong by mistake and it worked?
even if keyed?
it worked once
@marble hornet anything hot?
since the cable worked on a samd21, seems like the fault has been isolated to the board
didn't help to remove reset
getting schematics
so i replaced the usb port with a different one but ALL other circuitry was left untouched
@marble hornet is the regulator off-board?
iv's tried both , think it could affect it ?
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
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
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
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...
that is not stuck, that is waiting for gdb start
half the time it's a mechanical problem!
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?
Confirmed in current 3.0.0.
@marble hornet i don't use GDB server (windows), but in Scott's guide, there is a note about the current directory being close to the binary. https://learn.adafruit.com/debugging-the-samd21-with-gdb/setup#gdb
tried both, it ends the process
@raven canopy ill re-check power, but it is connecting
hmmm
do you have something in .gdbinit?
you could always read the GDB docs. But GNU's docs are difficult at times... π
you should get a (gdb) prompt
then you connect to the jlink with target extended-remote :2331
like: Connecting to target...Connected to target Waiting for GDB connection...target extended-remote :2331?
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?
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
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
okay, restarted terminal, two open windows: in one:
in the other:
gdb
oh
one is for x86
Jonahs-MacBook-Pro:~ jonahy-m$ arm-none-eabi-gdb build-metro_m4_express/firmware.elf
and it gives a "trying to connect" message immediately?
im on a 2017 mac so x64 right?
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
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?
you can try circuitpython now, or you can load the bootloader
what do you mean
i'm getting a file format not recognized error for bin and elf, and it is the arm-gcc-...
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
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...
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
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
it only takes a few seconds
what's a normal amount of time for you ?
5 seconds
I'll show you a sample transcript, hold on a sec
thanks
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.
(gdb) mon reset
"monitor" command not supported by this target.
:2331 is the port for talking to the gdb server
ah
it's listening on that port
scott has written a lot of this up: https://learn.adafruit.com/debugging-the-samd21-with-gdb?view=all
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)
Are you folks working on SWD for the SAMD chips? What would you recommend as the best USB interface device to use?
hi @crude fossil we are using jlinks
Reading all registers
WARNING: Failed to read memory @ address 0xFFFFFFFE``` nice to meet you @crude fossil
the "failed to read" makes me suspect flaky swd connector
hmmmmmmmmm, replace?
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
Yup, it should work now @CedarGroveStudios
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).
@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.
@raven canopy no problem! GPIO16 is annoyingly useless for a lot of things..
yeah. when i was researching it before, people love to hate that pin. π
@marble hornet good to meet you too! I've just soldered the extra SWD contacts onto this Trinket M0 π
@crude fossil do you have a jlink?
@tulip sleet not yet, I was hoping it'd talk to this knockoff STLink I had in the junkbox ...
sadly, i'm not sure that will succeed for Atmel chips
we of course can send you a jlink
Oh well that would be fantastic π Quite keen to mess with the SAMD stuff.
@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
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?
the jlink software on your mac.
i will, but it is very new
it is a 51j20 or 51j19? I saw you use both
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?
@reef seal https://learn.adafruit.com/adafruit-circuit-playground-express/circuitpython-neopixel shows connecting external neopixels to GND, VOUT, and A2
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
"""
@reef seal I just drove a 24-neopixel ring from a Gemma M0 last night - it worked fine
@tulip sleet it is possible i powered the sam off of 5v for a couple seconds, not sure. could that do it?
@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.
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.
night @marble hornet. π€
night @raven canopy
7adc69b Initial pulseio.PulseIn implmentation for #716 ... - nickzoic
c4cf1c5 Initial pulseio.PulseOut implementation for #71... - nickzoic
011edf2 Clean up interrupt handling for pulseio.PulseIn... - nickzoic
6af1fba Work on pulseio.PulseOut for #716 ESP8266 - nickzoic
972b038 Merge branch 'master' into circuitpython-nickzo... - nickzoic
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.
one last though, what about a non-questionable jtag standard... pogo? ill share any successes.
you mean pins? I have just soldered jumpers to the SWD and SWCLK pins. Also this breakout is handy: https://www.adafruit.com/product/2743
(well, not right at the chip, on the round manufacturing pads that Limor puts on the boards)
which they use with pogos for the in-house testers...
at least, if i understand correctly.
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.
i'm thinking a stardarised 2x3 +1 pogo pin layout. and adapter board can be made, with power injection... maybe im just dreaming
OK i'll try out those suggestions thanks guys
really wish somebody would do a nice Customizable 3d printable pogo jig
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
@onyx hinge like a parametric one?
@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
@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)
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.
np, next question! do you have a photo or video anywhere we could take a snippet of for a demo gif
They're putting a rush on it. This will be one of their initial kits to be offered.
sweet
yes. I'll mail you a video?
! amazing - yes please and cc Mike Barela mbarela@adafruit.com
we'll add and make it live for the show π
On it's way
ok!
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"?
for this particular rotary encoder, you could say clicks, since it clicks. I like deshipu's "steps" too.
that's more general
i'd favor "steps" over "clicks" also
Already went with steps so that works.
steps for rotation, click for the push
the press down can be a click or a press and hold: click implies quick press-and-release
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?
@tulip sleet very true
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.
@tulip sleet The prints work where they are.... am I missing something?
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.
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()
@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
Ah ok
so is mylist = [1,2,3]
thanks π
The video pendant is working! For now just 16-color BMPs, now to compile the libgif into CP...
@stuck elbow What screen is that?
the 160x80 one, Adafruit also has it
0.9"
it's exactly the size of a trinket
Tiny tiny!
I made two touchpads under the srcreen, so you can switch pictures by touching the top corners
Super! I'll test it on the next release. Thanks!
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.
nothing works as well as an off-chip RTC because it has its own battery... the DS3231 is expensive but hte PCF8523 is a lot less expensive! https://www.adafruit.com/product/3295
the itsybitsy m4 looks awesome!
@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)?
@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
@raven canopy either works. we'll decide on 4.0 in the meeting on monday
@tulip sleet π
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!
@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).
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.
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
sd cards are /dev/mm something and usb thumb drives are /dev/sd something
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
I think I'm getting it.
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).
@timber mango - Yes, that's right, that's what I'd like to be able to do.
But when the target board is mounted as a USB drive there is no exposure of the filesystem on the SD card.
even if it's mounted on the root filesystem that is exposed as a USB drive
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.
it's not
not sure if it has enough channels to support two MSC devices at the same time
you would know, deshipu. I'm just surmising /guessing here. ;)
and someone would need to write the code of course
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?
One is a folder created on the USB, the other is the sd card mount point
I have to back out of here .. late for my usual mid-morning haunts. Interesting ideas.
Thanks for taking a look @timber mango π
Today's MetroM4/Crickit foci: audio and analog input.
sounds good dastels!
Well, audio was easy.
Sounds decent even using a speaker salvaged from a broken headset.
@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
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
@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.
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
Hi @dronecz for tech support please post on the Adafruit forums: https://forums.adafruit.com/viewforum.php?f=60 Please post more info there about what you are trying to achieve, what code you have to do it and explain how its not working.
Issues are mainly for feature requests and bug fixes.
@tulip sleet I'm around as well.
k - I'll add you in however we chat
k ready whenever
@slender iron I am terrible at Celeste π
its hard with a keyboard
what was the original controller?
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.
@stuck elbow I played on switch first
@idle owl probably. I haven't tried it. instead I'm porting to the handheld π
ah, that is not the "celeste" I was thinking about
@slender iron Also excellent π
I'm using Pico 8 on my Mac.
@stuck elbow I didn't start with that version. I'm trying to port it to our handheld though
do you already have a prototype?
how is the button handling? are you polling it all the time?
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
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
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
we could make the gamepad module read one row of the matrix every click
and switch to the next row
then by the time there is the next click, it should be stable
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
aah, parallel interface for the tft?
that is great
@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
yeah 74hc165 is 10 cents or so, you can latch em too
so it keeps the presses recorded until you read them
this way you don't have to poll that fast
but they're also super fast to read, you can read a 165 at 10+MHz
this is the problem I had with the joystick wing too
ah, so it's not a matrix
well, if you can latch the buttons in the closed position, then it's perfect
yah
no diodes needed just pullups but resistors are very cheap
same technique i used in the x0xb0x
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
I wonder if seesaw could have latching added to it
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?
noo
AVR has no DMA
and samd21 does not have PORT DMA
only samd51
lame huh? π
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
@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?
nope. I made a fake repo for my guide
Hmm ok, I'd have to get travis going on it. That was why I was thinking of using a current one.
you are free to use an existing one too. I'm sure there are some that need a fix of some sort
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.
woooo! i made it to that first flower! only took 5 minutes!
I was able to get to the shelf past the flower. but that was it.
@tidal kiln x+c boosts you to it
"it" = the spikes of death?!!!! yep. i'm good at that.
that's the "point" of the game, right?
On subject of guide for library creation, do you have any house style guides for python?
And are there any guidelines/tips for interfaces?
@idle owl suggestion - add links to appropriate RTD for each section in your CP Essentials guide
Thanks @tidal kiln
@tidal kiln I don't understand where they would go.
@simple pulsar there is also this learn guide for libraries. https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/overview
@tidal kiln Oh wait I conflated the link with what you suggested to me.
ha! yah. two separate things.
@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.
what would the lib issues be?
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.
oh. as a way to track it?
Explain it? What do you mean by track
back up...
ok
basically, just suggesting that somewhere here:
https://learn.adafruit.com/circuitpython-essentials/circuitpython-neopixel
you add a link to here:
https://circuitpython.readthedocs.io/projects/neopixel/en/latest/
and similar for all sections of that guide
like at the bottom or something. real quick and simple.
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.
ok. no prob. will email.
Thank you
@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...
@raven canopy Oh hmm, that could work for part of it.
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.
@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
for the featherwing oled, you might be able to model it towards the arduino example code: https://learn.adafruit.com/adafruit-oled-featherwing?view=all#run-example-code
@prime flower - Thanks, I will give it a shot.
@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)
@prime flower - Cool, thanks.
@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!
10 PRINT "YAY! "
20 GOTO 10
@tulip sleet Nice!
It's a little scratchy, so it's probably not quite keeping up. But it's not terrible.
Better than a hardfault.
Still should probably be reimplemented in C.
Agreed
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.
did it make you jump?
πΈ
this is a brief clip from some YouTube music
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.txtis identical or not and...
The amazing thing is that playing from SD cards actually works now. It's a little scratchy, so some samples are being dropped, but it's not terrible.
I wish I could see my bad pointer use π
its right there.. π π
slow and steady careful examination of each line of code and how it runs π
yep. debugging is why we do this, right?
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
@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.
Uxcell a15062200ux0753 2 Position DPDT 2P2T 6 Pin PCB Panel Mini Vertical Slide Switch, 6 Piece: Amazon.com: Industrial & Scientific
@gusty topaz Super! If possible, a mechanical power switch is usually a great solution.
@tulip sleet awesome! I've definitely had that happen before. looking now at the PR
Trinket build ran out of space and a few vfs tests failed.
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 π
@gusty topaz in #help-with-projects
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 π
@amber oracle not yet. no ETA on when we'll pull it down from MicroPython.
ok thank you - are the board etc Crickit libraries available outside of the firmware?
Seesaw etc
seesaw is, but i haven't looked specifically at the Crickit libs yet. (just got mine yesterday) π
i would get on the adafruit github, and search the repositories; quicker than google.
Ah yes, will do π
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
Any idea when the Feather M4 Express will be available?
soon π parts are ordered for them
Limor said something about them possibly being available in a couple of weeks.
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...
vfs tests were using a tiny RAMFS filesystem implementation: its readblocks() and writeblocks() routines were not returning the expected status codes, and I was now checking these.
@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. π
i must be messing up the runtime environment somehow.
.oO(Is it gonna tell on me that I forked)
@ruby atlas i haven't had the pleasure of debugging a hard fault yet. i can't imagine it is all that much fun...
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).
was that the "pointer of complaint"?
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.
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.
okay, well, now I know for sure I'm corrupting stuff π
@timber mango its just another board to build on the master branch
@slender iron the boards directory has no itsybitsym4 subdirectory like it has for some of the other targets.
@slender iron if i'm corrupting the value of the next defined variable in the code, any thoughts about what I messed up? π
@timber mango have you updated? its on github: https://github.com/adafruit/circuitpython/tree/master/ports/atmel-samd/boards/itsybitsy_m4_express
@ruby atlas sounds like an array boundary problem
I see what's going on -- my fork didn't pick it up, I think.
that's what i think too.
Thanks Scott. I can figure it out from here. I'm misoperating git somehow. ;)
@ruby atlas if its consistent and you have gdb you can use a watchpoint to see what changes the value
i just need to find the address of that variable still π
@timber mango good luck! I'm about to head to dinner otherwise I'd offer help
at least i've narrowed things down and will be able to watchpoint soon enough
It's fine. The fork didn't take for reasons I don't really need to understand, tonight. ;)
π
πΈ
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
>>>
πΊ
With all the cowbells and whistles.
Whoever thought up that cowbell thing really made me smile from a place deep down inside me. ;)
when all pointers look the same might mean: a) give up for the night b) drink something hard
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.
is that the distilled 100 proof kind of plain old drinking water.
No, Daddy was a gambling man who drank enough for the both of us. A few beers a month is my limit. ;)
Hey, you were smart enough to pick a three letter nickname for Discord. So you already got it goin' on. ;)
I always wished my name had some form of nickname. Made sure my kids can have nicknames.
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.
Well I think your name means King doesn't it (sire)?
yeah, but it was popular in the 1890s and declined since π
(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.
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.
sorry @timber mango. i bailed to play a little (rather poorly, if i might add).
hello, not a high priority (for me) but if anyone is delving around the floating point library/code, this may be of interest: https://forums.adafruit.com/viewtopic.php?f=60&t=137002&p=678425#p678425
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...
I don't know if this belongs here, but we also had a user report that if you create a directory called sd and also mount the sdcard as sd, you get "sd" listed twice by listdir.
@simple pulsar answered your post
Thanks, just saw it. The truncation from 32 -> 30 bit sounds a bit iffy?
Was this representation chosen to be more frugal with memory?
@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.
@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.
@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.
sure, thanks for the heads-up
Trying to find something. I can add another example to the cpx lib, I guess. Adabot didn't provide anything useful to fix.
@deshipu, hmm, that's another bug. It should not let you use a mount point that's the same name as an existing file or dir.
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.
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 `/...
@idle owl happy to help with review for guide. just let me know...
@tidal kiln Thank you!
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...
Mounting a filesystem does not check for name conflicts. For example, if there's a file or directory named /sd, you can still mount an SD card as sd. os.listdir('/') then shows two instances of sd`, and the filesystem can become corrupted easily.
Thanks @deshipu for passing this on from a user.
This PR includes an early alpha of the USB bootloader with CDC and MSC support (MSC WIP) based on tinyusb for the USB stack.
@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?
@ladyada ah thanks a lot, It makes lots of sense, I will fork and continue work there :D . For collaborator/reviewer, it is up to you. The CP repo is still quite comprehensive for me now ( haven't spent enough time to understand it fully), but I could help with the nrf52 PR if you like.
@tulip sleet Do you know why forking circuitpython did not bring over the itsym4 code along with it?
if you forked before that was added, you need to update and sync your fork.
hold on for a url
Yes only for nRF52 PRs of course :)
Sometimes @arturo182 has some suggestions or bugfixes so when he submits a fix or feature we would love to have you help look at it!
@timber mango this is my Go To "ahhh my fork!" git recipes https://stackoverflow.com/questions/41283955/github-keeps-saying-this-branch-is-x-commits-ahead-y-commits-behind
maybe helpful!
Thank you, @meager fog
@timber mango maybe also? https://help.github.com/articles/syncing-a-fork/
@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. ;)
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
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).
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
I can type all that into my local linux host, is that correct?
Should I undo anything on my personal repo?
if you've strayed from master, it won't be a fast-forward.
did you commit on master on your fork?
I haven't done a pull to my local machine at all today.
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
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. ;)
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
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).
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.
don't comit to master of a forked repo, it's much harder to keep up to date that way
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.
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.
Yeah @wraith tiger has told me at least twice where to read for more info. On my bucket list. ;)
@stark portal you can do sudo add-apt-repository -y ... -y says answer "yes"
Firefox says I bookmarked that in March of this year (which was probably a re-bookmark of an earlier visit to it!)
man add-apt-repository will help
a few years ago I printed it out and read it (at work)
This is great information!
Pro Git book is worth it's bits in platinum.
also don't forget git submodule update bringing yourself up to date
(I'm a big Linus Torvalds fan, so I do want to learn what he's done, here)
@tulip sleet thanks, I'll try to get this working.
I always remember the submodule update. That stuck very early on.
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)
Agreed. But it's utility begs you to forgive it. π
I think it's one of those software suites that you have to employ frequently to use it very intuitively.
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.
Working on a guide that will help with all of this π
@tulip sleet yes, getting some strange 404's when running apt install. Will disable VPN, brb.
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.
Seem to work now in 16.04, could've been the VPN acting up-
stat() for a file or directory with the same name.
Also I did all the error checking before doing any mount operations. For some reason the original code did part of the mount before checking for errors.
@slender iron @tulip sleet PR going into cpx, please ignore it. Working with it for the guide.
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. ;)
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?
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
That's what i was thinking but first example I loaded up https://github.com/adafruit/Adafruit_CircuitPython_MAX7219/blob/master/adafruit_max7219/max7219.py uses a (device dependent) 0-15
I'm writing a library for these: https://shop.pimoroni.com/products/bearables-bear-kit - there is an existing Raspberry Pi library but I don't think it would be easy to wrap it as is
yah i think thats cause its a low level and not a big range
0-15 is a 4bit number, probably a reason for that π
i would recommend 0 to 1.0 if ya can add it to your code
especially if its a wrapper π
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
These sewable badges areΒ unbearrrrrably cute.Β BearablesΒ is Pimoroni's range of woodland-themed wearable LED badges and sensors. String 'em with conductive thread to ...
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.
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
@rigid path did you end up getting the OLED featherwing going?
What's the difference between itsybitsy and metro mini besides voltage?
Which two boards (product numbers) are you comparing? @dapper vapor
@timber mango Let's go with 3727 and 2590
What's smaller than a Feather but larger than a Trinket? It's an Adafruit ItsyBitsy M0 Express! Small, powerful, with a rockin' ATSAMD21 Cortex M0 processor running at 48 MHz - ...
@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.
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)
@dapper vapor the Metro mini is a much weaker processor, much less memory and flash
@timber mango what is your git username?
wa1tnr my ham call is my git username
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.
Yeah I want to delete it for sure. ;)
that will get you a clean copy
I was worried if I deleted it and then fork again it'd annoy everyone else who uses the upstream.
we don't see you fork, don't worry
Haha. Okay good enough! Thanks.
thousands of people could fork - upstream wouldn't necessarily want to hear about it every time
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).
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.
@stark portal there is no stm32 port for circuitpython
only samd21, samd51, esp8266 and experimental nrf52
Ahh alright, thought there was one. Browsing circuitpython on github and saw the stm32 folder. π I'll just buy one of the official ones.
does metro mini work with circuitpython?
It should, SAMD51 processor on that one.
Actually looking at that one right now. π
@dapper vapor which one? you have a link?
@stark portal it's there from MicroPython, but it's not functional
Sry, I'm looking at the Metro M4
@dapper vapor no, that is an AVR, atmega328
way too weak for circuitpython
@dapper vapor there is a list of supported products here: https://www.adafruit.com/circuitpython
Adafruit Industries, Unique & fun DIY electronics and kits : - Tools Gift Certificates Arduino Cables Sensors LEDs Books Breakout Boards Power EL Wire/Tape/Panel Components & Parts LCDs & Displays Wearables Prototyping Raspberry Pi Wireless Young Engineers 3D printing NeoPix...
If you need a really small one I think the Trinket M0 is the one to buy.
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
What's smaller than a Feather but larger than a Trinket? It's an Adafruit ItsyBitsy M4 Express featuring the Microchip ATSAMD51! Small, powerful, with a ultra fast ATSAMD51 Cortex ...
it's also good to take the "express" version, because it has more flash memory for all the libraries and code
@stuck elbow Would it require a ton of work to get circuitpython running on a STM32F429I Discovery? It's an M4 based board.
I've run out of memory with the trinket m0 a couple of times
@stark portal in Adafruit show M4 is the code for SAMD51, not any Cortex-M4 board
until I got careful
@stark portal it would be a considerable effort
Alright, I'll try to get the ESP8266 Huzzah up and running.
I think it's called that atleast.
This one: Adafruit HUZZAH ESP8266
git question - is there a shortlink to get to a latest release?
i.e: https://github.com/adafruit/circuitpython_kernel/releases brings me to a release page, is there a way to just grab the latest .zip release?
@stark portal we have prebuilt binaries for that. Just making sure you know?
Yea I saw that. Great! Got this FTDI Friend that I probably need to use. π
Not needed. Feather Huzzah esp8266 has on board USB serial chip (SI2104 IIRC)
@prime flower example: https://github.com/adafruit/circuitpython/releases/latest but it has to be a published release. Looks like yours are not
I have no USB port on this one. Might be a non Feather one? Or I've got some ripoff.
@tulip sleet hrm, I was wondering why /latest wasnt working. I'll fix that on monday when I do a release
@stark portal here is the Huzzah breakout (non-Feather): https://www.adafruit.com/product/2471. Does it look like that? Compared with https://www.adafruit.com/product/2821
Yea, I've got the Breakout one
I don't think CircuitPython will work with any non-feather esp8266. The pin mappings are most likely different...
it might because there are so few pins. not sure about the serial mapping
Might be an interesting thing to attempt... π€
Pin mappings could probably be solved.
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.
@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
@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.
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.
#https://github.com/mrmcwethy/Adafruit_CircuitPython_L3GD20
I have a library in my area which I would like to start pushing thru into the bundle.
This was the no-voodoo version of a compare after a very simple fork, then clone.
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.
@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
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).
I think you forked last night but never actually cloned that fork, and were instead working in older clone of adafruit/circuitpython
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?
you mean on github it didn't show that board?
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.
did you actually press the "fork" button last night? Was that the first time you ever did that?
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.
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.
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.
Well, I completed my uflash edits and submitted a pull request. We'll see what comes of it.
@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
hello, for a minor document issue what's best thing to do?
https://learn.adafruit.com/circuitpython-basics-i2c-and-spi/i2c-devices has a small but annoying error on it, the sample code for using I2CDevice shows read_into() - it's really called readinto()
@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).
Thanks, I've used that before. I'll use it again!
@simple pulsar if the code block has alink to github then you can PR to it there
I looked. it doesn't.
that was my first thought, too. (sorry if that reply seemed "snarky" π)
@idle owl @slender iron hey since that's an older guide, can you take a look next week?
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?
https://learn.adafruit.com/circuitpython-basics-i2c-and-spi/i2c-devices
Read over it, test examples and update as needed for CircuitPython 3.0.0.
@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
i just installed the latest on this board.
Are you playing dubstep?
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
gotcha
Does f.close() effectively happen when f goes out of scope as function returns?
@Truwen put your code in triple backquotes and it will be easy to read. see https://support.discordapp.com/hc/en-us/articles/210298617
@simple pulsar, no, you could use a with block instead
@simple pulsar nope, python doesn't make any promises about when a finalizer (before deletion) is run
π¦
'''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'''
hmm I didn't do that correctly π
er f.close() <- parens
...
# done
```
code here
```
the backtick is usually next to the number 1, under ESC.
oh, ha, thanks. Same as Tilde.
yep! that's the one. they're lonely keys, these days. π
@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.
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
@timber mango awesome!
Now that I know it works well enough time to make the remaining code just work, then add accelerated brightness adjustment to it too.
;) @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 :(
I was wondering which of the following ways to do brightness computation for neopixels:
- double buffering: require two buffers be passed in, update both on setting pixels, recompute the scaled one on brightness change
- compute on write, don't handle brightness changes (requires re-writing pixels)
- add way to copy the pixel buffer to another one with brightness scaled.
<< they fly
lol @raven canopy i finally remembered my 3rd option
oh man...now i look crazy. shoe fits, though. π
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.
- is closest to what we do now
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)
peak memory is the same π
true.
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.
so maybe #1 and note that #2 is viable.
Since I don't really want to change existing behaviour on anyone.
But if you want highest color fidelity, algorithmic processing probably doesn't work so good. So, table lookups.
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)
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
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.
@simple pulsar yep! that was my plan.
I think smoked glass filters (or the like) might enhance things visually. Many projects don't make it that far.
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.
Fixes Issue #642.
hspi.c->spi_init_gpio() is now bypassed for both construct and configure.
Tested pin locking for MOSI & MISO. Passes. Tested that SPI still works with a TFT display. Passes.
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...
@meager fog @tulip sleet I'm adding a nrf52840 build to travis for the DK
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 ...
One last note that I missed... Queue Where is my head?
I removed the passing of HSPI arguments, since it never passed anything but that. I didn't see anywhere else that it was needed for busio.SPI either.
@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.
I think those tests are fine. I tested bidirectional SIPI just by jumpering MOSI to MISO.
stomach is overriding brain... food. then, test. π
I mean I think testing with the Saleae woudl be fine for actually see that levels show up.
@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.
yeah, I'm ok punting it
i will change the milestone
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
@tulip sleet totally, we can clean things up as we need to improve them
Great job, @tulip sleet!
@hathach hey thach, FYI we're starting on automating nrf52840 builds, check out PR and if you have any suggestions (we'll merge it but maybe there's some ways to make it better) please let us know
@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).
zip import looks like what I'm looking for
any other extension won't be obvious to the user
i'm not sure extension matters as much as the fact that it's one file. gotta step out, will be back
I think the extension is important because zip is the most well-known container extension. It says "Hey, there are files in me!"
indeed. and it's file index is uncompressed.
Nice
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
found referenced in https://github.com/pfalcon/uzlib
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'.
indeed. then the compression wars began.
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.
i'm forgetting some, but arc, zip, rar, bzip, 7zip...
oh right arj!
and cab needs some honourable mention for making windows distributions smaller
really when gzip came out that was the first time I thought "this replaces .ZIP and .ZIP should bow out".
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
stuffit.
I imagine ftp.funet.fi still has some of the oldest ones (if a mirror exists or if it exists).
oh wow funet isnt slow anymore.
zoo
next we'll start talking about the old music file formats (which might be relevant for CP)
mod, s3m, stm, etc
As long as it's not a self-extracting archive *EXE I'm not complainin'.
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...
@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.
@tulip sleet can we work it?
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
Finally getting around to my "when MIDI was New " blog articles
MOSI Only:
>>> import busio, board
>>> spi = busio.SPI(clock=board.SCK, MOSI=board.MOSI, MISO=None)
>>> spi.try_lock()
True
>>> buffer = bytearray(b'0xff\0xff\0xff')
>>> spi.write(buffer)
>>>
I couldn't get MISO only to register anything. I tried using a gpio just set as high/low, as well as another board connected as a SPI Master. Reading SPI tea-leaves is...
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
@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.
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.
@hazy trail those three are "built-in" libraries; no need to load them as external libraries.
understood. thank you very much for the very quick response.
here are all of the built-in, "Core Modules": http://circuitpython.readthedocs.io/en/latest/shared-bindings/index.html
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.
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.
Got it. Thank you. Also, Thanks for the link .
You're welcome! Hope you're enjoying CircuitPython. One more link for posterity: https://learn.adafruit.com/welcome-to-circuitpython
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'.
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.
@tulip sleet I don't think we need zip in the non-express builds. We could probably make it M4 only too
yah, since the whole library won't fit on non-express builds anyway
i will test MISO on sommersoft's PR and then approve it
made the testing issue https://github.com/adafruit/circuitpython/issues/584 into checklists: maybe should separate M0 and M4
@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.
@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...
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()
@raven canopy π at Discord saying you're "Playing Atmel Studio".
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).
@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.
i tried that, and got nothing... π€·
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
>>>
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).