#circuitpython-dev
1 messages ยท Page 116 of 1
@formal plover not unless someone removed it from my machine ;p
OK, as before, CP is running fine, CIRCUITPY shows up, I can screen inm but can't get into the repl
wow - and it mounts and REPLs on my Mac!
@solar whale FYI, I ran git submodule etc again in circuitpython/ and it did nothing. So apparently directory doesn't matter
Rebuilding after clean anyway
@solar whale did you say build in the root directory? There seems to be no Makefile there. ports/atmel-samd built fine though
@idle owl good to know
@pastel panther Build in ports, correct.
@pastel panther build in ports/atmel-samd
@solar whale thats what I though. I guess I was confused by an earlier comment
+t
I always do the submodule update at root, but it may not matter
I had to to make my build go after the directory shuffle
Mounts immediately, REPL working, blinky flashing.
Yay!
@idle owl You're on Mac?
@umbral dagger Yes
hmm, I got mount, blinky but no REPL
unless it's changed names. I'm on a mac fwiw
What's displaying for the drive @pastel panther?
That's the issue
At least it was still an issue a few hours ago. Something with the way it's handling it, you can't get into the REPL fresh with a code.py running.
Also try /dev/tty.usbmodem* .. I had more than one board plugged in earlier so I had to identify them. I was using the * before that.
@pastel panther Ubuntu right?
@solar whale trying a 2.1 board on Rpi: I don't see a regular ttyACM0 or similar show up. Have you used the REPL from RPi?
yes - usually works
screen /dev/ttyACM0 115200
@grizzled arch no, mac. No dice after removing any .py from CIRCUITPY and re-flashing
just a sec - I'll try my 3.0 on mine
ahhhh ok @pastel panther
@formal plover I have no /dev/tty.usb*
@pastel panther Hmm.
@idle owl what version of OSX?
nvm @pastel panther I thought you were using Ubuntu for some reason
(do you have)
Reflashing the CircuitPython firmware won't clear any .py files anyway, at least it's designed not to.
@pastel panther I'm running Sierra
10.12.6 apparently
yea, I know. I just removed it for extra special forsuresies
That was a good idea
It took some serious nonsense to get the main.py file removed when I tried to do it. Can you remount it a few times and make sure the files are actually gone? Check in terminal...
Also I loaded my bootloader from bossec via instructions from scott, so maybe thats got something to do with it
@tulip sleet 3.0 works fin on RPi - mounts CIRCUITPY and REPL ay /dev/ttyACM0
sure, will do
Although, eh. no. That shouldn't matter. I could at least get to the serial connection before.
@pastel panther ls /dev/tty.*
@pastel panther Check it anyway though, it took me a few tries to get the main.py removed, and I wasn't the only one who ran into that.
That does a list
@solar whale for some reason not showing up. Tried two boards, so it's someting else. Maybe a misconfiguration in jessie. or something. I should reboot. I did a huge update after several months of non-reuse
and or ls /dev/cu.* @pastel panther
@pastel panther Wait does the way you flashed the bootloader affect whether or not you can get a serial connection? You did it differently than we did. I'm starting to speculate here.
@formal plover I think I'm good on locating a serial port if it's there. Thanks though
@tulip sleet would you know the answer to @idle owl's question?
@idle owl @slender iron said it would affect using the jlink but didn't mention anything about the serial port
Yeah I remember that but I'm now trying to identify what else is different about your setup that might be causing issues.
though it does do serial port fu to allow bossac to work, so maybe it's related
serial support sshould be fine. though I haven't tested on old mac
i wasn't following the discussion
No, it's whether the way they got the bootloader setup could affect whether or not it would be able to get a serial connection. We all used the j-link, @pastel panther didn't.
@tulip sleet the question is if flashing with bossac could cause problems with my serial port(CDC?) not showing up
the wizard says serial support should be fine
you have any other computers?
@pastel panther I don't think so. Did you unplug/replug just to be sure? Which build is this, the aboslute lateest one with the ports/atmel-samd dirs?
@pastel panther Also did you try multiple USB ports... so many of us ran into issues there and they were fixed by switching...
@tulip sleet yea, about 5 times or so. I'll check another port
@slender iron no other computer unless I drive to work and dust off my old windows machine
@formal plover I was also able to build/load a blinky.ino via arduion to the M4 on my Raspberry Pi! Whew.
awesome @solar whale !
np
@solar whale YAY!!! Nice! Way to go!
@solar whale Nice!
try a non-usb3 port if you have one, or a hub. But the difference in MacOS versions might be an issue as well. This is with the m4 board? Do you have other boards with CPy 2.1 or 2.0 that work?
now to see if I can put CP back on!
@solar whale - yes, I just needed a reboot
great
@tulip sleet I tried both ports, neither work (don't know if one is not USB3 or not). I had blinky/repl working on my metro m0 and feather with 2.1 the other day
I'll have to see if I have a usb port
hub rather
so just plug in one of the m0 boards and see if ti works, and then we can work forward from that
k
ok, m0 (I think with 2.1) works as expected, repl, blinky, etc
should I try 3.0?
you could try putting a 3.0 build on one of those boards. You can always put 2.1 back. Just build the right board.
you can use the uf2 loader to load the firmware.uf2
whew - taht was odd - when I wen back to linux box with arduino load on M4, I could not get bootloader to mount METROM4Boot - until I rebooted Linux box - then all OK - wa able to reflash CP 3.0 and all happy ...
loving the swoopy USB traces on the M4 Metro Express!
@tulip sleet built 3.0 for the m0 express fine, loaded the uf2 fine but now CIRCUITPY won't ls and there is no serial connection
It's hung righ tnow trying to ls
when did you last pull master?
ohman - I missed somethin I have gd613776
d61377 on master, says github
@solar whale that's what gitlog says?? should be dated 17:41:44 today
Oh we're looking at different things. Sorry for confusion.
@solar whale btw, your mpy-cross works. will upload to release.
@tulip sleet that is what th build says - I'm up to date accd to git. - great re:mpy-cross
@idle owl if you type git log|head in your CP directory it should tell you
should be something like ```commit d613776f0d4215e064964c6838de27e81d4fbcca
Author: Scott Shawcroft scott.shawcroft@gmail.com
Date: Wed Oct 25 17:41:44 2017 -0700
atmel-samd: Add support for ERR_ABORTED to indicate medium not present.
yup - same here
Oh. Yep, thanks. We were looking at different things, but apparently they use the same number. The REPL shows the beginning of the commit number.
@meager fog I was able to get arduino/samd51 working (at least for blink) on a Rasperry Pi as well. A few minor changes to procedure - I will try to post them to the github repo tomorrow after I do a bit more checkout. So far so good on Ubuntu Linux and Raspberry Pi.
@solar whale If you switch back to CircuitPython, see if you notice the CPU spike and run high with the M4 plugged in
IF
I have it back on my Linux box. just a sec - want to try somthing on RPi any way
oh ok, good deal
pack on Pi - CPU usage goes up to ~40%
It's not just me!!!
Mine went all the way to 80% after like 30mins
Then locked up
Interesting
I'v got a few thing running - ddi not drop when I went to bootlaoder but now running ad=rduino so hard to tell
Yeah, no matter what I had running it continued to rise until I removed it
High CPU is system-udevd; run top to see what's consuming a lot of CPU.
just loked at my linux box and top user is systemd-udevd
It might be good if someone were willing to write up this stuff. Perhaps someone running linux could open a linux 3.0 issue on things, and someone running on mac could open a similar issue. If you could write down the steps to reproduce and what does and doesn't work, that would be good.
other people could add any variants on the original report
@tulip sleet Spreadsheet?
I think it's paragraphs
@tulip sleet Sounds good
include log extracts, etc. if you find something interesting
stuff like: pro tip, unplug jlink when done using it lol
here's htop btw @tulip sleet similar to top, but prettier?
just installed it: I like it gives complete path for process, which is very helpful; thanks!
@tulip sleet You're welcome!
@tulip sleet Would it be worth opening an issue for the stuff I ran into?
I need to get some sleep - long day tomorrow --- Tahnks for all the great work tonight - I will work on Raspi Pi toolcahin for building CP tomorrow.
I'm writing up an issue right now for the Linux problems. I think it would be good to document it, especially since you're on an older but maybe not uncommon Mac veresions.
@solar whale I ran into problems running the .sh files in the arm download ./configure failure late in building pre-reqs. But I don't need it right now.
good night!
Night!
@solar whale have a good night and day tomorrow!
I did a little exploratory hacking to see how feasible it was for me to write example programs and I was able to get a functioning tachometer on the CPX using just the REPL. That's hecka neat. I think I actually will be able to contribute meaningfully.
@glacial bronze That'll be great!
Well, 99.9% credit to the author of the Arduino version. Brilliant to use the neopixels as a flashlight plus the light sensor
@glacial bronze You seem to have had the same experience I did the other day, working on my led matrix. It was just working before I knew it.
If you've never used one before it's easy to not understand how awesome a REPL can be
I've got some ideas in mind for how to make them more awesome, taken from some Ruby REPL enhancements I've seen, though memory might be an issue. We'll see.
A solid utility would be the ability to save the REPL session to a file
Yeah. More fully featured interactive editors like bpython can really chug even a Raspberry Pi type system
if the code gets complex enough
but really you program CircuitPython hooked up to a computer in any event, you don't really need an on-board editor
Commit: d613776f0d4215e064964c6838de27e81d4fbcca
Ubuntu 16.04
Metro M0
With this build, CIRCUITPY appears and the REPL works. However, the second disk that does not exist stills seems to be causing problems. After a time, CPU consumption of /lib/systemd/systemd-udevd and /usr/lib/udisks2/udisksd rises dramatically, and the errors below are repeated in syslog many times. E
Interestingly, if the board is unplugged, the cpu consumption of the processes above rises even higher. Even...
it would be an interesting exercise to see how small you could get. Theoreticaly your edior buffer could be dynamically sized to not waste memory, but overhead from the editor itself... I have no idea what would be involved
When I have some free time I might start poking around to see what super simple editors are out there. Probably would have to be written in c
FWIW I Googled up a lightweight DOS text editor and it's 80 KB with a 64 KB filesize limit. Nano is ~2 MB
nice
I don't think this is exactly the issue but it indicates how systemd-udevd can go crazy:
https://sourceforge.net/p/cdemu/bugs/93/#fc7c
There are other examples of high cpu for that process with devices in Hyper-V, etc.
I'm seeing it repeatedly test that the unit is ready and then follow up with a request sense for more details on why its not ready. I'm playing around with the request sense response to see if I can get it to back off.
anybody around to test?
Yup, I trusted the whole ERR_ABORTED thing too much. Changing it back to ERR_NOT_FOUND makes linux happy again.
The inquiry stuff was definitely wrong though. The read capacity response looks as it should.
@pastel panther do you need a uf2 to test with?
@slender iron yes, please
weeee
linux happiness
? I'm on a mac
loads, mounts CIRCUITPY, binky works, no CDC
hrm ok
let me try another port
nothing shows up like /dev/ttymodem
let me see
0 0 AppleUSBCDCACMControl: getFunctionalDescriptors - Descriptors are incorrect, checking...
0 1 AppleUSBCDCACMData: start - Find CDC driver for ACM data interface failed
0 1 AppleUSBCDCECMData: start - Find CDC driver for ECM data interface failed
AppleUSBCDC: Version number - 4.3.2b1
Google Chrome He (map: 0xffffff80329241e0) triggered DYLD shared region unnest for map: 0xffffff80329241e0, region 0x7fff89200000->0x7fff89400000. While not abnormal for debuggers, this increases system memory footprint until the target exits.
USB (XHCI Root Hub USB 2.0 Simulation):Port 1 on bus 0xa connected or disconnected: portSC(0xe0206e1)
USBMSC Identifier (non-unique): 0x239a 0x13 0x4201
0 [Level 5] [com.apple.message.domain com.apple.commssw.cdc.device] [com.apple.message.signature AppleUSBCDCACMData] [com.apple.message.signature2 0x239A] [com.apple.message.signature3 0x13]
AppleUSBCDCACMData: Version number - 4.3.2b1, Input buffers 8, Output buffers 16
AppleUSBCDC: Version number - 4.3.2b1
ah interesting. I wonder if its a driver issue
is it possible for you to upgrade the OS?
Yea, I suppose so. I've been meaning to do so but is having someone on an older version to test useful?
I'm not in a hurry (to upgrade or have a working M4) so if it's useful I can stay
Is ASF4 doing something different that needs a better/newer/faster driver?
ah, the old one works?
then we should be able to fix it
my brain isn't working so well
Yea, 2.x works fine
kk, yeah stay so you can test
Err, I haven't tried it on the m4
it's not m4 compatible, is it?
2.x isn't
I have a logic8 if it's of any consequence
Though I'm not so sure it would know what to do with usb. Isn't it high-ish speed differential?
those are awesome for other protocols
its 12mhz differential
I have some tooling and workflow for the beagle
we can hook you up with one if we need to
I will not turn away any tools that show up at my house ;P
cool, well thanks! I'm off
night
@solar whale still having trouble with chef (i think) on ubuntu 14
$ vagrant ssh
ssh_exchange_identification: read: Connection reset by peer
William@Magnificat_V2 MINGW64 ~/esp8266-micropython-vagrant (master)
$ vagrant ssh -v
Vagrant 1.9.7
William@Magnificat_V2 MINGW64 ~/esp8266-micropython-vagrant (master)
$ vagrant ssh-config
Host default
HostName 127.0.0.1
User vagrant
Port 2222
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile C:/Users/William/esp8266-micropython-vagrant/.vagrant/machines/default/virt
ualbox/private_key
IdentitiesOnly yes
LogLevel FATAL
you're having issues sshing in?
@pastel panther I did a uninformed upgrade of the ubuntu from v 12 to v14., apparently shot myself in the foot.
then takes a while to re-provision?
I forgot the exact syntax but if I recall, the first time you set up you have to download and install a bunch of stuff
do you use vagrant and virtual box on a windows machine?
before, of course
(thought you might have un-borked it)
Did you have to do much setup for the dev environment after you got vagrant up?
ah, yeah, the whole gcc compiler
You using something like this?: https://github.com/adafruit/esp8266-micropython-vagrant
yep, that is the one.
it might suck but I'd suggest starting from scratch.
I am going to bed soon. thanks for chatting.
@hollow tartan I think he correct way to update the Ubuntu release from 14.04 to 16.04 is to reinstall the vagrant box and change the line in Vagrantfile from ``` config.vm.box = "ubuntu/trusty64"
to
config.vm.box = "ubuntu/xenial64"
@solar whale Hello. I backed up and chose Vagrant 2.0 to get Ubuntu R14. 4 . So I have a Vbox with what you have and I am trying to get gcc and xtensa-lx106 playing nice together, so it will build a loadable bin.
my $PATH has an ESP32 reference. is that correct? I think I noticed it yesterday when I had R 12 running good.
@hollow tartan ok - good luck - I to sounds like you are building microoython at this time. Do you then plan to move to circuitpython as well?
@hollow tartan ok - good luck - I to sounds like you are building microoython at this time. Do you then plan to move to circuitpython as well?
yes I did. lots of fun ๐
make axtls
make```
is blowing up
the /esp8266 it is looking for is actually /ports/esp8266
and the xtensa-lx106-gcc is not being found!
good night, leave any thoughts you have and I will read tomorrow. 
@obsidian helm It does llok like the master buil at mircropythoin has also changed to but esp8266 in ports so yes - that is the way to build it. Not sure what the issue with xtensa is. - you shoudl; execut the make axtls in ~/micropython/ports/esp8266 . just curious Are you following this guide? https://learn.adafruit.com/building-and-running-micropython-on-the-esp8266/micropython-usage?view=all Of course there are many ways to do this,I'm just trying to follow along with what you are doing.
@slender iron @tulip sleet just a sanity check - It looks like the 2.x build did not migrate to the new repository layout, correct? Tha is 2.x does not hac the ports folder. It gets a bit confusing when you switch between branches. if I go from 2.x to master, then the top level atmel_samd folder is still there along with others. Is there a simple way to get git to remove all the unused subdirectories when you switch branches. I think it is jsut git submoule update --init --recursive to make sure they are properly reinstated after a switch but that does not remove the unused ones. Not a big deal, just wondering if there is some git magic I should know.
Thaks for the reminder, @solar whale ! I did a pull this morning and the build was failing. I hadn't looked closely at it because I'm working on the multi-repo "Pulse"-like Python program that Scott wanted, but git submodule update --init --recursive fixed it....
the metro m4 just arrived
I will do science to it
I was able to attach gdb to it with the black magic probe
now I have to learn to use gdb...
What could go wrong?
Attaching to Remote target
warning: while parsing target memory map (at line 1): Required element <memory> is missing
warning: No executable has been specified and target does not support
determining executable automatically. Try using the "file" command.
0x000055cc in ?? ()
(gdb)
are you trying to load the bootloader?
Thank you @tulip sleet for attacking those high CPU problems so fast! I guess it's a Linux problem not specifically Linux on the Pi. I'll write up some of the other stuff like making sure you don't have too many other things plugged in via USB and what not, in a document like you suggested.
@solar whale Re the esp breakout guide. Cool! I just got one of these to play with CP & IO. No idea what Iโm going to do yet.
Ok... adequate caffeination level achieved. Time to try the latest CP on M4.
Is that the ESP8266 or esp32?
@solar whale 8266
OK - I can help with that if you have questions - dont have any esp32s
Oops, the asf4 submodule wasn't pulled forward. I'll submit a PR for this.
@umbral dagger when you start playing with IO, my main warning is put in some checks for failed connections. I try twice then reset the board if it still does not connect. That usually gets it back.
Tested new PR's and the problem looks like it's fixed!
@tannewt Why not count how many filesystems there are and call mscdf_init() with that count? Or are you thinking they may be turned on and off dynamically after the USB descriptor has been sent? Or maybe there's an initialization order problem I'm not realizing.
@solar whale to remove stuff that isn't in a branch, you can use git clean -f. (It requires the -f because you could be removing stuff you want to keep.) git clean --dry-run (aka -n) will tell you what it will do to make sure. git help clean.
@tulip sleet thanks!
i have used it mostly up to now to clean up .orig etc. after fixing merge conflicts.
Sounds good - just makes it very imoprtant to do a git submodule update every time you switch braches!
yeah - I actually now have two clones for convenience, one for 2.x and one for master
probably the smart way to go...
sleep is overrated ๐
Haha true true @solar whale
@tulip sleet On the Pi - I tried apt-get install gcc-arm-none-api - installs all the right stuff, but it is an old gcc and fails the -lto stuff so it looks like a manual build is necessary. I thought I had done it inthe past, but it may have only been for the esp8266 under micropython - different tools....
@solar whale I grabbed the toolchain from ARM's site
@umbral dagger - for Pi? can you post alink?
@solar whale a little more work to install, but it's the latest. That was for Ubuntu on intel
@solar whale https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads but doesn't look for be an arm/pi build. There's source, so...
Download the GNU Embedded Toolchain for ARM, an open source suite of tools for C, C++ and Assembly programming for ARM Cortex-M and Cortex-R families.
@umbral dagger I don't see an ARM build there but should be able to build it from the source - thanks
Oh ya.. that works immediately.
And if I put it back, everything works great
I can reload, then get back into the repl no trouble.
So it looks like an initialization issue. It's like main.py starts before the usb/serial thing is up & running
yes
I just tried that. resetting with an empty CIRCUITPY lets me drop into the repl
It might be good to add that to the github issue that Dan has open for linux.
Yeah like @solar whale watch out @umbral dagger the M4, cranks up CPU usage
Just by being plugged in
What I'm seeing on Ubuntu 17.04 with Adafruit CircuitPython 3.0.0-alpha.0-1031-gee18b5cba on 2017-10-26; Metro M4 Express with samd51j19
If the board is reset with code in main.py, etc CIRCUITPY shows up, the code runs (in my case it blinks the LED and poutputs some text), the led blinks, and when I connect with screen I see the text. I cannot get into the repl, though.
If I then (from a terminal) remove the code on CIRCUITPY, I can get into the repl without problem. If I had tried to ...
I think this morning's ee18b5ca commit fixes the CPU usage issue. I have not seen it after that. However @dastel's note above documents a continuing issue.
will be off line for an hour or two
@tulip sleet @slender iron It's as if (or really is) the USB input processor doesn't have a chance to finish initializing before code starts running, and gets preventing until code stops running.
@tulip sleet @slender iron Updated my comment to include the case where main.py does NOT loop forever.
how do we build circuitpython now?
git submodule update --init --recurstive
cd ports/atmel_samd
make BOARD=desiredboard clean
make BOARD=desiredboard
ok thanks
taht is for 3.0 - for 2.x omit the ports/
i was looking to build 3.0
e7e8e0a Sync with https://github.com/adafruit/asf4/pull/3 - dhalbert
@dhalbert SD cards are never mounted when usb is inited because they currently require the Python VM. So, by supporting removable media we should be able to dynamically make it available.
@dastels that will still have the misleading inquiry response. try it with this latest commit. On my Arch linux box I see a warning about unable to get the write protect bit and the cache but it works otherwise.
Yes please. :-) Limor just tweaked it.
On Thu, Oct 26, 2017 at 9:11 AM Carter Nelson notifications@github.com
wrote:
Hmmmm. Maybe back to lux instead of light?
c966976
https://github.com/adafruit/circuitpython/commit/c966976591f6397eaa7821e00a51ad20fe8ae544โ
You are receiving this because you commented.Reply to this email directly, view it on GitHub
https://github.com/adafruit/circuitpython/issues/314#issuecomment-339717740,
or mute the thread
<https://github...
question on updating something in the bundle. did this originally to get it:
- worked in personal repo
- personal repo forked into adafruit
- made pr on adafruit fork to get into bundle
- bundle now has adafruit fork
now if i need to update my code, what's the process?
If the board is reset with code in main.py, etc CIRCUITPY shows up, the code runs (in my case it blinks the LED and poutputs some text), the led blinks, and when I connect with screen I see the text. I cannot get into the repl, though.
This may be due to improper ctrl-C interrupt handling, or the setup for that is in the wrong place.
Iโve been testing 3.0/master on a M4 with my early 2015 MacBook Pro 13 Retina running Yosemite. My M4 bootloader was flashed with BOSSAC with a .bin provided by @tannewt.
Hereโs what Iโm seeing with the current master and a build @tannewt sent last night around 9pm:
No /dev/tty.usbmodem* when the M4 is plugged in
CIRCUITPY mounts and is accessible
a code.py blinky in CIRCUITPY will run when written or reset
removing code.py or any .py in CIRCUITPY and resetting/powercycling several tim...
@tulip sleet finally got around to filing the ticket, sorry for the delay
@tidal kiln maybe fork a new personal repo from the adafruit one and then delete the old personal one. That will normalize the workflow so your personal one is downstream from adafruit/. To make a change, create a branch in the personal repo for this change, make the change, commit and push it. Then you'll probably see a pull request button both in the adafruit and your repo (you can always create one manually). This is how we normally do it in CPy: Scott and I work in personal repos on temporary feature or bugfix branches, then submit PR to adafruit/circuitpython. When accepted, we delete the temporary branch. When the PR is accepted, in the personal repo, we do git fetch upstream, then git checkout master [if necessary]; git merge upstream/master, and then push to the personal repo so it's sync'd with adafruit.
@tulip sleet thanks. that was my thinking as well.
but wanted to make sure before i nuke my original repo
@slender iron pull & rebuilt & flashed. Same behaviour.
Scott likes to name the upstream remote as adafruit instead of upstream, so the source is clear. I haven't started doing that consistently yet; I have muscle memory for upstream.
i name my remotes after power puff girls ๐
@umbral dagger I think @tulip sleet is right that we're not handling ctrl-c correctly
what should I do with text typed while main is running? save it for the repl or ignore everything but ctrl-cs unless input is going?
If it's being echo'd, I would say save it. Otherwise ignore it
I think you should flush everything before the ctrl-C. That's how it works in regular Python and in a shell.
I think the friendlyist thing would be to save it but make it very clear that it won't do anything until you stop main
Also consitency with @tulip sleet 's comments would be good
just tried it while True: pass, then abc<ctrl-C>. abc is echoed but not taken as input
in python3
ah ok
i am
though you can if you like
I can look at descriptor stuff
it should be fiixable in circuitpython code
I'll look briefly. was going to compare it with 2.x. Descriptor - you mean the duplicate disk name stuff? not sure
2.x is different because it caches the usb input in an interrupt
right now we only read from cdc when usb_read is called
if you're on a roll go ahead. I can finally get to busio and analogio. but if you have something else, i can look too.
can the interrupt handler peek without reading? I know right now it has a one-char rollback, I think
the only interrupt we get currently is the complete callback after we initiate a read
go ahead and take a look. I'll fix asf4 some more ๐
k๐
I gotta go help a friend for a bit in two hours too
i did my outside IT support this morning (plus groceries), but i'll be out at dinner time
kk, no worries. I'm just happy we aren't heating up linux boxes now
Always a good thing
I'm out for the evening, but will be here for another ~3 hrs, then probably back for a while at 10pmish ET.
I'll be in a superposition of work and discord. Observations may affect my postition.
@slender iron what's wrong, don't like baked Pi? Bwhaha oh man where's @cunning crypt ?
Mmmm pie
huh. apparently hacktoberfest checks constantly, not just at end of contest. just got notice i made it!
yay!
That's awesome @tidal kiln!
most of them were me fixing my own messes, but guess a pr is a pr
yup yup
cute progress checker: https://hacktoberfestchecker.herokuapp.com
Hmm... now I'm inspired
@tidal kiln My shirt's already ordered too!
So is the UF2 that doesn't drive up the CPU on Linux on the GitHub? I've just been grabbing them here when someone posts an update.
the s3 bucket should have one
ah. got it. first time even looking in the continuous builds. neat.
๐
@tidal kiln Yes, of course! I'll clean up a few inconsistencies and update for the new build tree structure, then move them to a public notebook and send you a link!
cool thanks. i'm only just now getting a chance to go hands on. so i'm like at t=0
No worries!
There are two notes pages there - Installing Debugging Components, and Compiling
Sorry about that....
Cool! I hope it's helpful.
Oh, I should have said the commands are for UINX-like systems (MacOS, Linux, Windows 10 Bash environment).
Thank you, @formal plover ! It's really just notetaking of how I got it working. Most of which is other peoples' advice!
@drowsy geyser you're welcome! I need to make something like that for tracking issues per @tulip sleet's suggestion
Oh? The "issues" link in GitHub isn't sufficient?
I was about to say the same thing
Though it would be nice to have a breif summary like
- OSX no serial console
- RPi: CPU is a toaster
- Windows: bla bla
Something like that would be useful as a pinned post
That's true. There may be more information we want to capture that would clutter up the issues page. Namely, historical information.
Yeah at least for where things are with the M4 right now @drowsy geyser
Learned today that an older CPX might not communicate consistently with a newer CPX over IR. I noticed the transmitters were different on the two I have, but figured they would operate the same. Apparently not. Figured it out with MakeCode, but I imagine it might happen with CP when we get to it.
@formal plover I'm working on the "Insights"-like program for Scott. It will generate statistics across multiple repos and sub-repositories. Since it's going to use the GitHub API (GraphQL) it might be handy for your task, too.
Once things go out of alpha, might not need it anymore.
@drowsy geyser nice! I saw some discussion on that. Are you using the GitHub API?
@formal plover Yes. There's an interface library called Graphene that abstracts away all the JSON query construction so you don't have to write code to do it!
@drowsy geyser that's fly
Well I'm excited to see the end results!
Keep up the good work @drowsy geyser!
I'd like to keep the issues list as the location for port status
Trying to stay focused! ๐ My new desktop system for a Linux build is arriving by FedEx today. Must not get distracted by that.
@slender iron That makes a lot of sense.
@drowsy geyser Or you should totally get distracted by that ๐
I'm really anxious to try the JLink on Linux and see how it is....
@drowsy geyser worked find on my Pi
Needed to apply the 99 rules file so that it could communicate, that wasn't hard.
It was in the readme
Cool. Thanks!
You're welcome!
@pastel panther are you working on your M4 yet? Or do you still need more info to get started?
Could not connect to target.
Please check power, connection and settings.
see note on power issue...anyone got it to work with pwr through usb?
@tidal kiln what are your settings? I got it to work fine that way
Wait you're trying to connect via jlink right?
yep.
@tidal kiln Yeah I did. I don't have a 9v power supply.
i'm powering through USB, but with an AC adapter
I'm on MacOS but I used the JLinkExe commandline util.
That's what I did for jlink stuff. Powered USB from a wall plug... 5 port wall adapter thing.
above was from JLinkGDBServer
I don't think I got that to work. Did you install the other tools you needed? gcc-arm-blah or something....
Oh, I've been using jlink exe
Seriously, we're just going down the list of stuff we ran into.
ha! wait. it can't just read the silk on the chip.
Connecting to target...ERROR: No CPU core or target device has been selected. Please make sure at least the core J-Link shall connect to, is selected.
What command are you using
JLinkGDBServer
JLinkGDBServer -if SWD -device ATSAMD51J19
^^
so it CAN'T read the silk. ok.
that worked.
Listening on TCP/IP port 2331
Connecting to target...Connected to target
Waiting for GDB connection...
yeah. i'm where everyone was 3 days ago!
Yay! Better late than never @tidal kiln!
Yeah!
darn. and now gotta run.
back later...
should this have functional firmware on it? or is that first step?
First step
@formal plover I have an open issue with my status. @slender iron is looking into it
yeah, I'm redoing all of the descriptor stuff
@pastel panther ah gotcha. Good deal. Just wanted to make sure you weren't left hanging
Nope, I'm good, thanks. Just have to figure out why my metro m0 doesn't want to talk to my SPI led matrix
I have some fixes so you can ctrl-C main.py. Tested on Metro M0. The REPL exits every 30 seconds unless I only enable one MSC device (with mscdf_init(0);). Then it's fine. @slender iron I can make a PR for this as an intermediate step. OK by you in your progress?
aaah doesn't work compiled with optimzation. not yet...
@formal plover It's a matrix I got from the SparkFun dumpster dive. It was previously working fine with 2.1 on my feather m0 express. It may well be a wiring issue. I'm sure I can figure it out.
Is this diagram roughly correct with regards to SPI pins? http://www.pighixxx.com/test/wp-content/uploads/2016/07/Metro_pinout_final.png
Wait, the Metro classic runs CircuitPython?
I don't think so, i was just using it as a reference for the pins
@drowsy geyser What'd you get for a Linux system?
Just a cheapo refurbished system from NewEgg. Nothing special. I didn't want to get a top end powerful system because I want to spend that money on a NAS.
Here's the schematic: you could verify orientation by checking for the +5V, gnd, and reset: https://cdn-learn.adafruit.com/assets/assets/000/041/522/original/microcontrollers_schem.png?1493850214
@drowsy geyser That's the beautiful thing, though, it'll work great
Yup! It'll be great running Linux.
If I need power these days I just use a cluster at work. ๐
@drowsy geyser After close to 15 years of buying Macs I was amazing how cheap it was to put together a top end Linux system. Granted, I'm just using the onboard video (which is pretty in line with Apples video choices).
@drowsy geyser There's always AWS or Azure if you need the power.
@umbral dagger I work at Microsoft, so I have literally thousands of cores of compute available.
@drowsy geyser Ya, I saw that.
I'm half asleep lol, hang on
I was thinking outloud and was comparing them.
The feather m0 and metro m0
@formal plover I read that as fell asleep. And the rest made half as much sense, but was twice as hilarious.
This was the guide I was looking for: https://learn.adafruit.com/circuitpython-basics-i2c-and-spi/i2c-devices?view=all#spi-devices
Read USB input as a background task when the interrupt character is enabled. The interrupt character is already handled in the course of doing input. All input is flushed when interrupt character is read, and a KeyboardInterrupt exception is raised at the next safe time.
Tested on Metro M0 under Linux: main.py contains a blinky program
Reset board. Enter repl. Type ctrl-C.
Not tested on MacOS.
This works most of the time. When it doesn't work, it appears to be because there's s...
Documentation note on https://github.com/adafruit/micropython-adafruit-bitmap-font
bitmapfont.py can be in /lib/ but if the font.bin is there, it won't be seen and init() will fail on line 28
putting the .bin in device root works
Relevant tutorial: https://learn.adafruit.com/micropython-displays-drawing-text/software right at the top
@glacial bronze This can be fixed by using BitmapFont(..., font_name='lib/font5x8.bin') as well. Also, we could change the code to look at bitmapfont.__file__. That returns the path to where the module was imported from. Feel free to submit an issue on the library.
I still haven't figured out GIT. It's on my to-do list for tomorrow night :v
To submit an issue, just go here: https://github.com/adafruit/micropython-adafruit-bitmap-font/issues/new (same as New Issue button) on https://github.com/adafruit/micropython-adafruit-bitmap-font/issues
@formal plover @tulip sleet Thanks for your help. I think that diagram is just wrong. I just looked at the board and SPI only goes to the header and not to any of the other pins
@pastel panther well, that's a Metro 328 (Arduino semi-clone), not a Metro M0. https://www.adafruit.com/product/2488. The schematic on that one does show SPI pins on the main headers: https://github.com/adafruit/Adafruit-METRO-328-PCB/blob/master/Metro Mini Schem.pdf
On the otherhand I think I made a boo boo with the MetroWing
Yea, I just looked at the board for the m0
The Metro 328 has a tilted CPU chip and doesn't say Express. The Metro M0 express has a straightened chip and says Express. The M4 has a tilted chip and says Express. This is kind of like which is the Biscayne, which is the BelAir, and which is the Impala.
Yea, I know. I just ended up with that diagram as I didn't see anything similar for the m0 express and I mistakenly thought they were the same
(Our family had two of those Chevy's, vintage 1963 or so)
Nice!
two-speed automatic, about 9 mpg
mpg is overrated when you're rollin' in style ;P
My friend in HS had a super sweet 72 Malibu that we would drive around in all the time when we should be doing something more productive
my father had to install aftermarket seatbelts to get any at all. The dashboard was metal. Roomy inside, enormous trunk. ... I'm getting punchy, need to say goodnight!
Night!
note to self: printing to the console can be as effective as a sleep at slowing down your code
@slender iron is SPI working as expected on the M4?
nope, its not implemented yet
you shouldn't be able to import busio
dan and I are still in USB land
Ok. I can't currently tell if it's importing because of the CDC issue
Is there a general roadmap of features that need to be implemented for 3.0 to be ready for release?
yeah, its the 3.0 beta issue then the 3.0 ones
they aren't well sorted though
busio will come after USB has settled down since it enables the spi flash
ok, cool
I'm brewing up some awsome stuff for usb I think
hopefully get to the point where we can change the usb funcitonality enabled in boot.py
ooooooh
I'm eager to see how that works. I've been watching the commits to get a better idea of how the code is working.
working on a python script to generate the descriptors to be built in with the idea that it can be used in boot.py later
cool
if you have code questions feel free to ask. I'm happy to point you places
Will do. I think I could get a decent lay of the land if tracing paths wasn't such a chore. I'm still haven't loaded the code in something that can index it for me yet to make finding function definitions a bit easier.
yeah, I'm low tech and use ag which is essentially grep
yeah, I should probably figure something out to do that
I've been trying out Atom and I think it has a ctags package so I might try that next
huh, apparently it has ag support with the atom-codesearch package
also a couple other search engines in the same package
Yea, I'm a bit annoyed with that so far. They seem to be reproducing on their own
yeah, I tried sublime and it had the same problem
Hmm, apparently JetBrains has CLion. I'm downloading it now in hopes it's similar to Rubymine
hey guys, so i'm new here. So this dischord thing... is sort of like an IRC right? and if i have any qns i just write it here? is that how it works?
@timber mango yup! questions on circuitpython go here. Anything that doesn't fit another channel can go in #general-tech
ok i have a little qn. i don't have my circuit python with me now, but awhile ago. and my baby girl threw it around for a bit . Then i'm having problems uploading code. So i double clicked the btn to go into bootloader mode.(red light blinks) Previously new code used to be able to be uploaded. but recently uploading code seems impossible as the arduino ide just gets stuck at uploading and it remains like that for a minute or so.... after that erroring out
@timber mango do you mean circuitplayground? the round board?
ok, I know less about the classic
I'd suggest posting on the forums if you haven't already
?forums
there are folks there who know arduino better than I do
oh dear... ok i mistook circuit playgrd for circuit python
ok thanks anw @slender iron
no worries! we all do it @timber mango
@tulip sleet built latest CP 3.0 Master loaded to M4 and connected to Linux box - running cool and no 100% udevd processes! Thanks!
@solar whale glad to hear that. I'll have to give it a try this weekend.
Notice an interesting quirk - If you have the board runnig on 9V and disconnect from USB, then reconnect - it bring usp CIRCUITPY but cannont connect to REPL unless I reset the board. Same happen on Mac - I suppose this makes sense since the CP board is not RESET so it does not initialize the conenction for the REPL
@formal plover I'll be happy to help you with Arduino any time as well. I hope to have my notes written up today.
@solar whale Awesome, thanks! We'll have to devise a plan for testing. Lady Ada said it's more stable than CircuitPython
@formal plover seems to work well and seesm to support many I2C devives with no problems
hmm - did somethig change regarding I2C on 2.1 with 2.1 Bundle- whwnever I try to init an i2c device, I am getting ```>>> import mpr121test
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "mpr121test.py", line 19, in <module>
File "libraries/drivers/mpr121/adafruit_mpr121/mpr121.py", line 52, in init
File "libraries/helpers/bus_device/adafruit_bus_device/i2c_device.py", line 60, in init
File "libraries/helpers/bus_device/adafruit_bus_device/i2c_device.py", line 58, in init
File "libraries/helpers/bus_device/adafruit_bus_device/i2c_device.py", line 56, in init
ValueError: Buffer must be at least length 1
this is on a metro_m0_express Adafruit CircuitPython 2.1.0-3-gbd7abcd on 2017-10-27; Adafruit Metro M0 Express with samd21g18
appears to be a bug in i2c_device but I am not sure when it was intrduced. Has anyone been able to use an I2C device with 2.1.0 and the 2.1 Bundle?
@solar whale we put in a test for buffers of length zero. it may be that particular driver which is passing zero-length buffers. https://github.com/adafruit/circuitpython/issues/358
it is in i2c_device.py
@tulip sleet I was jsut looking at the issue - but the error is in the i2c_device.py - part of bus_device in the Bundle.
# Verify that a deivce with that address exists.
while not i2c.try_lock():
pass
try:
i2c.writeto(device_address, b'')
except OSError:
raise ValueError("No I2C device at address: %x" % device_address)
finally:
i2c.unlock()
self.i2c = i2c
self.device_address = device_address
should this be changed to write b'\0' ?? I think the write is just tsting for "aliveness"
@solar whale ah, so it's testing whether the device is there by writing b''. Maybe there's a different way to do that.
it breaks all I2C examples I have
@tulip sleet would it be safe to just write a b'\0' is that the correct sytax to write a zero?
@solar whale you could just remove that try/except test for now. Not sure whether all devices would tolerate receiving a zero.
just remove everything before self.i2c = i2c
@tulip sleet its nota crisis for me - just testin new build - but this will break a lot of stuff.
I'm not that familiar with i2c transfer expectations at that low-level. We might need to back out that change, or not. Could you reopen that issue and point out the problem with i2c_device?
I'll enter an issue at #358
In 2.x this breaks i2c_device.py in bus_device
in line 56 it sends a zero length write"
# Verify that a deivce with that address exists.
while not i2c.try_lock():
pass
try:
i2c.writeto(device_address, b'')
except OSError:
raise ValueError("No I2C device at address: %x" % device_address)
finally:
i2c.unlock()
self.i2c = i2c
self.dev...
@tulip sleet how do I re-open the orginal issue?
I see a button on the empty comment form at the bottom of the issue that says "Reopen issue". Do you see that? Maybe a privs thing.
@tulip sleet I see it, too, and I h ave minimal repo privs.
I don't see it - Is the comment enoght to get attention - or can you reopen it?
I have less than minimal ๐
thanks!
I was really puzzled why none of my i2c sensor tests would work on the my new build of 2.1 - I don't have enough hair left to pull more out ๐
I'm picturing @solar whale as a bald cat now.
this is why we need regression testing that includes some external devices. it's on the agenda
Thats what we are here for.
thank you for being wetware rosie
nice to see my CPU at 50 degrees rather than 85 C ๐
Also nice for my Pi to not lock up and bring down my network
@tulip sleet removing the test for now does work - thanks
The compiler is clever... that s to say... it's rather obtuse until you get your head around a few things. Then you sit back and think "huh... that's clever"
clever is great until you try to debug....
uh huh
BTW I looked at the DEBUG=1 setting it it does not appear to invoke O0
HEAVY use of macros... grammar.h is a prime example. It gets included into compile.c several times... with different macro definitions each time to extract different bits of the rules.
Thus no direct, explicit wiring in the compiler... it's all done at compile time based on different interpretations of the grammer rule file.
That slight criticism aside, I like how it's putting ALL the compile rule information in one place.
Once that's clear, it all makes sense.
# Turn on Python modules useful for debugging (e.g. uheap, ustack).
CFLAGS += -ggdb
ifeq ($(CHIP_FAMILY), samd21)
CFLAGS += -DENABLE_MICRO_TRACE_BUFFER
endif```
unless -ggdb does it
Lanuguage implementation is what I do for fun, so digging through the MP compiler/vm is going to be a blast ๐
@solar whale -Os is on all the time for SAMD21. Scott chose -O2 forSAMD51: not sure why. It might not fit with -O0 and -ggdb.
Looks like the docs are at least building now. But this looks a bit odd (address=<sphinx.ext.autodoc._MockModule object>):
https://circuitpython.readthedocs.io/projects/tsl2561/en/latest/api.html#adafruit_tsl2561.TSL2561
Here's the mod I did for readthedocs:
https://github.com/adafruit/Adafruit_CircuitPython_TSL2561/pull/3/files
Totally new to sphinx / readthedocs, so let me know if this is wrong.
@tulip sleet Thanks - I was just curious how the optimization impacted the code for debugging. Sometimes it can make it hard to trace - especaill at the assembly language level.
I was used to turning off for debug builds. I'm sure it has a huge code size impact!
I turned off -Os for SAMD21. It overflows flash by 111kB!
๐ฌ
@tulip sleet Not sure if you saw this earlier - is this a bug ? If you have the board runnig on 9V and disconnect from USB, then reconnect - it bring usp CIRCUITPY but cannot connect to REPL unless I reset the board. Same happens on Mac - I suppose this makes sense since the CP board is not RESET so it does not initialize the conenction for the REPL
Sweet! My 8Mbyte FeatherM0 hack got reblogged on adafruit.com!! Level up!
Ah ! you reminded me I was going to do that mod this weekend!
@solar whale Support is in 2.x BOARD=feather_m0_supersized
I saw that - nice!
Start calling @tulip sleet the lawn mower!!! That man is always trimming.
That's fantastic @tulip sleet, great job!
@formal plover No, I'm not trimming. I was just showing what happens if we don't turn on optimizations.
Bwhaha fast read that whole statement @tulip sleet
On lunch reading fast and sloppy
Lol, sorry. Well still a true statement, you have created a lot more space since the beginning
@formal plover Just don't eat fast & sloppy or you're be wearing stains on your shirt all afternoon.
Haha @umbral dagger at least it's Friday. They are lucky I wear pants even.
@solar whale I have a PR in to allow ctrl-C to interrupt main.py. But sounds like we should add some logic to try to reconnect. Does it work fine on a 2.x board?
heya folkx - i made a BMP280 cirpython driver - anyone wanna try it?
The ASF4 API is a lot weaker than the ASF3 one.
I don't haz that one @meager fog, I'm sure someone does though
@slender iron @tulip sleet hey i still cant seem to get the API docs to appear at https://github.com/adafruit/Adafruit_CircuitPython_BMP280
@meager fog I only have a BME280 - sorry
happy to try it
@meager fog if you happen to make one for the SHT31-D, I'd be happy to try it
ok! ๐
๐ 
@meager fog - you mean in the github README? That's a deficiency they don't want to fix: https://github.com/github/markup/issues/534 โน
@meager fog just tested my BME280 ont he M4 board via Arduino (on linux...)
kool thx!
@meager fog I should have some time this afternoon (it's busy for the next few hours).
np, ill have BME280 by then, just checkin my math and humidity calibration
@meager fog I also have a couple BMP180s
@meager fog I do have a bmp280 - just had to dig inthe parts box- so feel free to post it. I'll give it atry.
@solar whale that's too funny. I've had that happen several times. Picking up an organizer after work today
@meager fog ๐ฆ ```>>> import bmp280_test
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "bmp280_test.py", line 5, in <module>
ImportError: cannot import name adafruit_bmp280
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name adafruit_bmp280
>>>
that is waht I ran - just renmed it
make sure the library files are in a folder called adafruit_bmp280 in CIRCUITPY
yup
does it matter if it is root or in lib
import works for me:
Adafruit CircuitPython 2.1.0 on 2017-10-17; Adafruit Trinket M0 with samd21e18
>>> from adafruit_bmp280 import adafruit_bmp280
>>>
thats my folder
^^ i'm same
root vs lib folder shouldnt matter. maybe check you have py files in adafruit_bmp280? ๐
doh - nevermind - just a sec
Temperature: 21.2 C
Pressure: 1014.2 hPa
Altitude = -8.48 meters
sorry - I did not creat a floder named adafruit_bmp280 - just copied the .py ....
temp and pressure look OK - I'm not underwater but the BME280 said -3m so its not too different
ooh yah
you can optimize the alt measurements by telling the sensor your sea-level pressure
since it varies every day
can you compare pressure to a local weather station?
pretty healthy change for 'minutes'
weatehr station say 1014.78
standard day sea level = 1013.25 hPa
so the negative alt at least makes sense
weather station agrees nicely
now have bme280 next to it - it reads 1013.37 - bmp280 still 1014.2
no - I'm not concerned
isn't government work an oxymoron
@solar whale Lolololol sure is.
worth about 20ft in elevation
thanks for testin! im wrapping up BME280 now - have some math to port
Glad to help - thanks for creating it!
@meager fog ๐ฏ
should get tonyd to test it! he has a bme280 based altimeter he takes hiking.
just for fun I switched the BMP over to the M4 board under arduino and it gives the same pressure reading 1014.45
@formal plover As a government worker, I resemble that remark ๐
@pastel panther we're both working for the man I see.
@formal plover I suppose so, what's your schtick?
@pastel panther State government
@formal plover Sweet, I'm a fed. I just need to go to defcon again so I can get a shirt
@pastel panther nice!
@formal plover The most boring kind of fed, I assure you
@meager fog want me to make readthedocs projects for the bmp280?
in a bit
Lolololol I'm in the same boat on the State side.
Quick question anyone. What is the I2C address of the CPX si7021. Defaults to 40 but complaining 40 has no device.
the CPX does not contain an SI7021
kk, let me know if you have questions about readthedocs @meager fog
๐ I'll probably do dynamic heap size soon
@slender iron some day soon we'll have to resume the readthedocs spoon feeding
can i join?
Ohhh yes, join the fun @tidal kiln
If we can nail the process down, I'll even document it.
I see, No si7021. Ok. Ahhh what about this code in the guide?
import adafruit_si7021
import busio
import board
i2c = busio.I2C(board.SCL, board.SDA)
sensor = adafruit_si7021.SI7021(i2c)
print("Temperature:", sensor.temperature)
print("Humidity:", sensor.relative_humidity)
Its just not intuitive enough for me to pick up and go
@lofty topaz probably for an external sensor
I should have documented things the first time we started readthedocs
If I had a dollar for all the things I should have documented from the beginning...
sphinx is the tricky thing. read the docs is covered in my sharing guide
@slender iron yeah that's true. It's really sphinx I need the help with
@idle owl ๐น
@lofty topaz what guide are you looking at?
The CPX guide in the CircuitPython area. It's the Libraries page. The example is for a sensor as @slender iron suggested.
I assumed it was on the board. Not an external.
My bad.
I just can't work/play with the Block builder. Need to cut code so I am going this route.
CircuitPython's not compatible with an ESP-12E chip, right? You can't take the ESP8266 build and put it onto any ESP chip?
@idle owl depends mostly on pinouts - may be ok - huzzah build works on feather and breakout ,
Hmm. Ok
let me see if I can find doc for 12E - feather is 12-S
I was going to try to answer a question in the forums. https://forums.adafruit.com/viewtopic.php?f=60&t=125642
@lofty topaz thanks for link. that's a general how-to on using libraries, not specific to the cpx. i can see how it might be confusing in that context though, since the cpx has all kinds of sensors on it. but it is as @slender iron said - for an external sensor.
I saw that and meant to answer then got sidetracked.
@solar whale I'll leave you to it then. If I answered it, it'd be getting all the info from you anyway.
@tidal kiln Yes, thanks for confirming. I have two CPX's now and wanted some data to send over the IR beam so I popped into that page, scarfed the code, and assumed the sensors were there.
ok - Ill respond in a few minutes
why did segger camel case their executables? thank goodness for alias.
@lofty topaz CircuitPython IR support is still being developed.
I know I've been out of the developers realm for a few years now but are you saying "camel case' is nolonger used?
@idle owl Yes, I know. Thought I'd try and see how far along it is.
no, i'm just whining. on linux and the segger tools are mixed case for some reason. makes using on cli 'fun'.
alias jlink='/opt/SEGGER/JLink_V620g/JLinkExe'
@lofty topaz This works for receiving and decoding many IR signals (might still fail to decode some, I'm not sure): https://github.com/adafruit/Adafruit_CircuitPython_IRRemote There's a module ported by someone who uses IR for communicating between accessibility devices: https://github.com/cyborg5/IRLibCP
@tidal kiln I could not agree more. It smacks of a company not familiar with unix.
or maybe they have stock in <SHIFT> key companies?
@tidal kiln Also, I hate things going into /opt ... that's what /usr/local is for!
The first one I've used on the CPX to receive signals from remotes and another CPX loaded with MakeCode. I haven't used the second one with the CPX. I also haven't made a CPX send IR signals using CircuitPython. But that's where I will start.
meh. distro wars.
@tidal kiln I cut my teeth on SunOS... never could get comfortable with Solaris.
@idle owl Thank You! I will check out the links and hack away. ๐
@tidal kiln Give me a BSD deriviative over a Sys V one, anyday.
@tidal kiln I am using aliases up the wazoo to save remembering stuff:
alias m4gdbserver='JLinkGDBServer -device ATSAMD51J20 -if SWD'
(now I sit back to see if anyone (other than maybe @tulip sleet ) is old enough to get that ๐ )
@umbral dagger Are those "mini memories"?
Also .gdbinit file contains:
target extended-remote :2331
end
yah, i'll probably there at some point. right now i'm at "can i even see the board?"
@umbral dagger i do know what you mean. I was at Berkeley at the right time. Wrote the first more command: https://danhalbert.org/more.html
"I named the program more. This was a daring move at the time, since it was such a long name for a UNIX command, and was also a real English word."
faints
@tulip sleet That's right .. more Awesome story btw.
not really
Does someone want to point out the errors of my ways?
the parser is rudimentary and doesn't keep much state
๐
@pastel panther paste away
return (x+ (y*8))
def swap(a,b):
t = a
a = b
b = t
return (a,b)
def fancyass_writeline(x0, y0, x1, y1, color):
byts = bytearray([0 for i in range(0,63)])
byt_array
steep = math.abs(y1-y0) > math.abs(x1-x0)
if steep:
x0, y0 = swap(x0, y0)
x1, y1 = swap(x1, y1)
if (x0 > x1):
x0, x1 = swap(x0, x1)
y0, y1 = swap(y0, y1)
dx = x1-x0
dy = math.abs(y1-y0)
err = dx/2
ystep = None
if (y0 < y1):
ystep = 1
else:
ystep = -1
while(x0<= x1):
if(steep):
byts[xytoi(y0,x0)] = color
else:
byts[xytoi(x0m, y0)] = color
err -= dy;
if(err < 0):
y0 += ystep
err += dx
x0++
return byts
it's complaining about return byts
Oh, I was going to make a array then call bytearray on it, guess I left it in
removed, still don't like the return
I found an errant semicolor
def swap(a,b):
retaurn b, a
also x0++ is not python
-r+n
by the way
@stuck elbow facepalm
x0 += 1
and semicolons err -= dy;
abs is not math.abs?
semicolon is ok but superfluous
yep
the human group compilation has finished
haha
thanks guys
Would you believe I did python for 3 years a loooooooong time ago? I've got py-cred, I swear! ;P
C does that to you
(blame ruby)
@tulip sleet On the Pi after installing many many packages and the crunching for a looong time my arm gcc build faile while building "genautomata" ...sigh - Is there where your failed as well? I'm about to give up on the Pi as a development platform.
I think @formal plover will just have to get a "real" computer to build CP. ๐
@solar whale mine was somewhere in build-prerequisites.sh. Compiler error reporting is too harsh for ./configure (perhaps remove -Werror). Found this, but I'm not sure it's relevant: https://stackoverflow.com/questions/27867271/zlib-harsh-compiler-warnings-and-configure-test
@solar whale Bwhaha! I have one. It got moved to a really inconvenient place after we set up the nursery
Mine failed there on the firs try, but I rerean it with --skip_steps=mingw32 and build-prerequisites completed.
how did you know to do that?
I read the GFX lib
It inthe intall guide pdf
oh, nvm
part of the .tgz file
I was using lesspipe to read the pdf on the rpi. I got that from google. But I just skimmed it. Should have read it on the big screen computer.
it converts the pdf to text
How-tobuild-toolchain.pdf - it listed all the packages too so I installed tehm all - except there is no build-esentials
I did see those packages (long list) and installed them, but I should have read further. Anyway, it was mostly to build mpy-cross and the one you built works fine on both jessie and stretch so I uploaded that to the 2.1.0 release.
I was able to build mpy-cross and bossac so I can use the arduino stuff on the M4 - I think I'll be happy with that - Sorry @formal plover
@formal plover @solar whale this may help: https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=99127; points to https://github.com/ARMinARM/arm-toolchain-build-scripts. But it's a couple of years old
I like that ARMinARM joke.
@tulip sleet what do you need me to look at today?
I'd be down for a voice chat. I've got some ideas about the supervisor
sure - now is fine
๐
@tulip sleet @formal plover taht builds gcc 4.8.2 - currnent build is 6.3.1 - worht a try, but probablt the same a apt-ge install arm-gcc-none-eabi - which won't support CP build.
I have to go for awhile -it is too nice outside to stay in all day!
should i flash a bootloader on the m4 first? or just use one of the cp bins?
Flash the bootloader if you want to be able to test using the .uf2 firmware files. That's what I've been using.
where to grab bootloader?
I know its here: https://github.com/tannewt/uf2-samd but let me find the last one I loaded and I'll copy the file here.
one of the ones he posted here?
Yeah that's the last one he posted, and the last one I flashed.
I haven't built the bootloader myself yet.
yeah, i'll worry about building next, first just want to flash an existing build
can i use the uf2 with jlink?
Totally understand that
Oh wait... you're right that's not it
hold on.
No you can't use the .uf2 with jlink.
jlink -if SWD -device ATSAMD51J19 -loadbin bootloader.bin,0x0
That's the bootloader from the 24th, which matches the last update to the uf2 repo.
that look correct?
For me the address was ,0
Otherwise I think so? I used JLinkExe to do it
connected first
then did loadbin
so I never ran exactly what you did, but other than the address being different when I did it, it looks right
Wait, I thought there's one from the 26th now
@formal plover @tidal kiln There's might be. Might want to ping Scott before you flash that... I might be behind.
oooo. fresher produce.
I think that's the firmware, not the bootloader...
I thought it has both
You might be right. I probably misunderstood.
well. let me try...
If you end up with a neopixel, it's the bootloader. If you end up with CircuitPython, it's the firmware. ๐
Yeah but I think travis builds both for the firmware
@idle owl gotcha
Since you can still use the jlink to flash a .bin firmware file.
both could be a bootloader, just diff formats I think
True true
Like I said, I could be wrong. That's just what I understood it to be.
hey @idle owl, You've done some CP library work right?
I'm probably wrong @idle owl Lolololol
@pastel panther Yeah for the CPX
@idle owl I was looking at the AdafruitGFX lib and I didn't see a CP equivalant, is that right?
i get....nothing
@pastel panther I don't know for sure. Cursory search says you're right. A lot of the CP libraries are included in the bundle, so that's always a good place to start looking for whether or not it exists already. Otherwise, a more thorough search of GitHub would be needed.
@tidal kiln That's not a very good prize
Cortex-M4 identified.
Halting CPU for downloading file.
Downloading file [adafruit-circuitpython-metro_m4_express-20171026-e7e8e0a.bin]...
Comparing flash [100%] Done.
Erasing flash [100%] Done.
Programming flash [100%] Done.
Verifying flash [100%] Done.
J-Link: Flash download: Bank 0 @ 0x00000000: 1 range affected (204800 bytes)
J-Link: Flash download: Total time needed: 2.905s (Prepare: 0.022s, Compare: 0.048s, Erase: 1.022s, Program: 1.760s, Verify: 0.045s, Restore: 0.004s)
O.K.
did something
@tidal kiln And you disconnected the jlink and did the double-tap to reset to see if it would go into the bootloader?
no
@idle owl Cool, separate from if it's needed, if I were to port something like that to CP would it make sense to write it in python or try to keep parts in C for performance? Is there a provision for including C/compiled code with a CP library?
@pastel panther Scott wrote a guide for contributing libraries to CP. https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/overview All of the library work I did was either Python or CircuitPython. I don't know if there's a provision or not. Scott might have a better answer. @tidal kiln has also written some drivers/libraries, so he might also have some ideas.
Oh right.
Did you start already
me? start what?
Try to connect to the REPL even though nothing seems to be happening. We ran into that but that was supposed to be fixed iin the latest build
Like nothing would happen, we'd connect to the REPL, and then it would show up
nothing is even showing up in dmesg
it's name is more promising
Valid
weeee ASF docs!
seems happier. neopixly happier.
Yay!
got METROM4BOOT, now let me try a UF2 from the s3 bucket...
I feel strongly that there should be a animated neopixel emoji
INFO_UF2.txt (fwiw):
UF2 Bootloader v1.23.0-14-g3db9182 SFHR
Model: Metro M4
Board-ID: SAMD21G19A-Metro-v0
@idle owl for the win
and this seems promising:
Adafruit CircuitPython 3.0.0-alpha.0-210-ge7e8e0a on 2017-10-26; Metro M4 Express with samd51j19
>>> print("hello world")
hello world
Yes!
@idle owl @tidal kiln you are mking it look so easy - Not like the "the old days .... " ๐
@solar whale Yeah all of 2 days ago.
thanks @idle owl i've now made baby step 1.
@tidal kiln That's how it always starts. Good job!
so the s3 bucket is just cp builds?
That's what I thought anyway.
seems like it. flashing the .bin from there did nothing.
flashing the bootloader.bin and then using the uf2 from the s3 bucket worked fine though.
That's the end goal anyway.
and i guess the .bin's are for loading cp with bossac
once you've got the bootloader on
Ah that makes sense
@idle owl @tidal kiln Howdy, just been kibitzn your conversation. I must say, that's hacking at it's best. Glad to see the M4 is progressing. ๐ธ
@lofty topaz thanks. i'm days behind everyone else. i'm probably benefiting from that.
@lofty topaz Every time we get a new build there's something new. They're doing so well.
@tidal kiln Wait on using main.py and code.py... I'm pretty sure they're still causing issues with connecting to the REPL. You can create a file and import it while in the REPL (I keep blinky.py around, that little red LED Is so satisfying!), but if you have a main/code, you can sometimes connect to the serial connection, but you can't give it any input or kb interrupts to get to the REPL.
k. thanks. mainly just making sure i got the flash/load process down at this point.
still curious where the latest bootloaders live?
@formal plover I use to tell people "My brain is not building today, sorry!".
@lofty topaz code.py is where your code lives. It's meant to be easier to understand for beginners. main.py is a carryover from MicroPython
@tidal kiln I think they're at that repo I linked. I think you can build them there. Scott posts them prebuilt for us when we need to test after he commits.
@idle owl Dang, I was afraid of that. You see, "main", whether for the start of C or the runtime in Python, it's a rock that shouldn't be moved nor changed. I hope "code.py" doesn't backfire and confuse beginners.
My opinion... ><>
@lofty topaz There's no difference between the two. CircuitPython looks for code.txt, code.py, main.txt, and main.py in that order, I believe. The .txt files are included because people just starting out may not have editors that understand .py files, so we want them to still be able to plug in a board and get started immediately.
@idle owl I understand, it's just giving choices at the fundimental level requires more explaining. I tend to view that sort of stuff as "noise".
@lofty topaz You're coming from a solid background. You're not really the target audience for code.py ๐ I think by the time it starts to matter whether someone is using main.py or code.py, they'll have enough knowledge to understand why one is needed over the other. That's the goal. Teaching.
now to read the 1732 page SAMD51 datasheet to see what we've got...
@tidal kiln See you in a month..?
maybe. not sure i'm that fast of a reader though.
@tidal kiln @idle owl haha
@tidal kiln good luck, take a towel
@idle owl @lofty topaz I like main.py. To me it says โthis is where it startsโ even if there are other files there.
my problem was "oooh look at all these peripherials!!!!!!!!!" and then realizing I have no idea how to use them. That's how I ended up here actually; CP 3.0 as a ASF4 app reference
@idle owl @lofty topaz code.py is great if thereโs just one file. And I agree it is more beginner friendly. So having both as options is excellent!
@umbral dagger That's exactly the point.
@umbral dagger I was in the middle of typing the same thing
main.py by itself is kinda like "wait, do I need more?"
Just one file. Why does that make a difference. Please, I'm only trying to understand. If they are suppose to be the same, then what's the difference?
And what if there are both?
@lofty topaz It gives beginners a simple place to start while leaving the options open for people who understand it already to use main.
@lofty topaz Then it reads them in the order I posted earlier. Finds one, and stops.
So if you have code.py and main.py, the first one will be read and that's it.
ok, got it.
just options
Yep
This has the code behind that choice if you're interested:
https://github.com/adafruit/circuitpython/blob/master/main.c
around line 134
Why isn't it called code.c ???
because it's c and no CP
python isn't c
just kidding... ><>
ah.. ya.. @tidal kiln covered that ๐
sometimes it's hard to tell a person kidding from a beginner with genuine questions
this can all change with time as user experience is gathered
I'm sorry, I was just trying to reenforce my point.
I actually use it to my advantage. Sometimes I'll use main.py for working code and code.py for testing other people's code. So someone has an issue, drop their code into code.py and it'll let me sort it out without moving or renaming my working code.
@lofty topaz Don't apologise. Discussion is always good.
Although, I don't get the rational of having .txt versions in addition to .py versions. It is python code.
And @tidal kiln is right, as things progress, and the user experience becomes more solid, things can change if it makes sense.
Maybe to accomodate people using editors that insist on using .txt ??
yea
@umbral dagger Exactly
@idle owl See that? Now you got experts asking questions. Told ya.
?
@umbral dagger So total beginners who ordered something, got a Trinket with it, have never coded anything and only have Notepad can at least get started.
@idle owl makes perfect sense. We loose sight of what it's like as a beginner.
the more I think about it, a CPX with a simple text editor is an amazing way of learning to code