After cloning repository do you do the following?
git submodule update --init --recursive
then when building it is good to d:
make BOARD=metro_m0_express clean
then
make BOARD=metro_m0_express
1 messages ยท Page 115 of 1
After cloning repository do you do the following?
git submodule update --init --recursive
then when building it is good to d:
make BOARD=metro_m0_express clean
then
make BOARD=metro_m0_express
Sounds like your toolchain is too old. You can get a newer one by doing this:
sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
sudo apt update
sudo apt install gcc-arm-embedded python build-essential
Take the old toolchain out of your path.
It wouldn't even let me into the directory in terminal initially. Took a few resets to get it to show up in Finder correctly which while I had no intention of using the explorer to delete the file, it was freezing my terminal when it wasn't working in Finder anyway... reset a few times, took some fussing, but I finally got it to where I could delete it.
Well def need to soon
Auto-reload seems to be working
@formal plover Oh man...
took down my network
fun fact... when you have 4 usb ports and every since one has a CircuitPython board plugged in...
@formal plover ouch
bootloader mode will shut off the pi evey time
C-d does not force a reload. But if I press C-d several times (nothign happens) but then I press C-c, for each one a C-d gets processed. Once they're all processed, a C-c gets me to the repl.
Something going on with USB input processing?
@formal plover anotehr reason for the 9v supply - is it a powered hub?
bee back in 5 - I have to give the cats their treats!
Reset, doesn't mount in the explorer, enter the REPL, it shows up in the explorer. Repeat, mounts the first time. So that's inconsistent. Ahhh... but it won't let me do anything with it in Finder like it did when it had a main.py. This time I enter the REPL and it disappears from Finder. lol. Third and fourth time, like the first.
serial fails to connect with that 3.0 file
Mine or jerryn's?
yours is garbled @idle owl and @solar whale's times out
Oi
115200 is the correct baud rate?
Yeah
hmmm
@formal plover does CIRCUITPY show up ?
no
but it does leave bootloader -
yes
tyep dmesg - anything of note
@tulip sleet sorry about the wrong advice re: -lto error - I keep forgetting that that is the toolset
@solar whale your advice is necessary too. I'm sure that's the next thing they'll hit.
[ 739.150458] usb 1-1.5: reset full-speed USB device number 7 using dwc_otg [ 739.281805] cdc_acm 1-1.5:1.0: ttyACM0: USB ACM device [ 770.530678] usb 1-1.5: reset full-speed USB device number 7 using dwc_otg [ 770.662062] cdc_acm 1-1.5:1.0: ttyACM0: USB ACM device [ 801.230894] usb 1-1.5: reset full-speed USB device number 7 using dwc_otg [ 801.362305] cdc_acm 1-1.5:1.0: ttyACM0: USB ACM device [ 832.671232] usb 1-1.5: reset full-speed USB device number 7 using dwc_otg [ 832.802436] cdc_acm 1-1.5:1.0: ttyACM0: USB ACM device
hmm - is that mine or Kattnis's
Choose your poison - did oyu happen to checl dmesg with hers?
you folks seem to be willing to take a lot of punishment! I hope (and I'm sure Scott does too) that we'll fix all this in the next few days
probaly similar - 3.0 is not kind to USB
@tulip sleet we are gluttons for punishment - all for a good cause.
^^
@tulip sleet It's part of any development. The only thing that changes is the flavor.
in the meantime it's good jlink practice ๐
Though practice implies some previous knowledge to practice, lol..... all of it feels like brand new fumbling still.
@tulip sleet is CP close enough in design still to micropython for information on its architecture to be relevant to CP?
@pastel panther my metro-wing boards are in fab! Looking forward to trying one!
@pastel panther closest match is the feather HUZZAH
@solar whale metro-wing?
@solar whale sweet! I hope there are no bugs!
@pastel panther very much so; the main CPy changes are the atmel-samd port (which didn't exist before) and the changes of how to do I/O.
@umbral dagger I made an adapter for putting featherwings on a metro/uno
@tulip sleet Ok cool. I'm trying to get familiar with the code and an idea of the rough shape would be helpful
I say that because it's maintained more of the MicroPythonish stuff (not by a lot, but more than some other boards)
I've been able to grok some stuff by reading the code but more info is always better
@umbral dagger I can point you towards my oshpark page but I'm hesitant to encourage anyone else to order one until they've been tested
@pastel panther Ah. Cool.
the Python language implementation is completely the same. The shared-bindings and shared-module structure is new from Scott. It's a regularization and a cleaner split between port-independent and port-dependent parts. (port = chip choice)
right, makes sense
I'm waiting for an order of prototype boards to arrive (Tinket M0 based)
@tulip sleet always so good at explaining things out
were those base on the flash upgrade you did?
@pastel panther no. This is a small embedded humidity monitor/alarm. TrinketM0 + Si7021 breakout + TPL5110 + piezo buzzer + lipo
A few dozen lines of CP
noice
I have thoughts of making into a product next summer.
@umbral dagger is it made to scratch a particular itch?
@formal plover It was nice to learn to use the JLink commander tonight.
@pastel panther yes
Time for me to get to bed - Goodnight all!
'night
@solar whale Night!
night @solar whale!!! Thanks for the help!
@slender iron @tulip sleet What's the best way to inject a delay into the C code for CP? Akin to time.sleep(...)
night @solar whale
@pastel panther Though if I do commercialize it, I'll probably do a fully custom board (i.e. no breakouts)
@lofty topaz lolz
@umbral dagger I'm always looking for excuses to make new boards, hence the metrowing exists
@lofty topaz I want a delay on the order of a second. That's a lot of nops.
@umbral dagger Sorry, it just popped into my head for some reason. Memories can be a beeech. ๐
@pastel panther I'm the same. This board uses the breakouts (& the Trinket) and will be for a small batch of prototypes to actually deploy.
@pastel panther You use Oshpark? I have yet to try them. I've used FritzingFab and now Aisler (since they took over as Fritzings fab)
Does Oshpark do assembly as well or just raw boards?
@umbral dagger I've only used them but for the two projects I have, they've been great. They only do boards, though rumor is they're working on a flex-pcb service
@umbral dagger Have you checked out double difftime(time_t time1, time_t time2)
I'm headed out as well. Good work tonight!
night @idle owl
@idle owl Yeah, we seem to have made some progress.
Yay progress!
@solar whale You never quit my friend
Lucky to have you around
Side note as I was catching up lol
I'm out as well. 'night
night @umbral dagger
@umbral dagger look in the time module. You can call the c implementation of sleep if you like
@pastel panther Mainly just CircuitPython stuff. I have most the boards now, so just learning as I go. It's been a lot of fun
@nice I got my led matrix working in just a few minutes just the other day. Ain't CP great?
Nice! Yes, it's awesome
@slender iron are you going to be on show and tell talking about CircuitPython again?
<@&356864093652516868> Oh frabjous day. I just managed to build a Windows version of mpy-cross. It's 32-bit, I think. Compiled and ran a simple program. Try it out. We could supply this with the release.
@tulip sleet I can boot into windows and test it but I wouldn't know what to look for. Unless you think it might work with wine
@pastel panther that's ok, it works for me. I'll leave it here for someone who uses windows all the time.
i need a BeOS version, can you work on that next?
now we have a complete set of cross-platform mpy-cross's, which is what I was wanting
@tidal kiln no, the next version will run on the Commodore 64
ok, good night, debugging in the morning
๐
Night @tulip sleet !
tops-10
I'm out as well, night all
buenos nachos
oh oh THINGS were great until this happened:
text data bss dec hex filename
132574 808 872 134254 20c6e mpy-cross
make: Leaving directory `/home/vagrant/micropython/mpy-cross'
vagrant@vagrant-ubuntu-trusty-64:~/micropython$ cd ~/micropython/esp8266
-bash: cd: /home/vagrant/micropython/esp8266: No such file or directory
vagrant@vagrant-ubuntu-trusty-64:~/micropython$ make axtls
make: *** No rule to make target `axtls'. Stop.
vagrant@vagrant-ubuntu-trusty-64:~/micropython$ make
make: *** No targets specified and no makefile found. Stop.
vagrant@vagrant-ubuntu-trusty-64:~/micropython$
@hollow tartan I think you need to be in the esp8266 directory
okay... brb
it was there early in the step but now it is gone. ?
ls -l
and no sign of it.
? is my $PATH correct
/home/vagrant/esp-open-sdk/xtensa-lx106-elf/bin:/home/vagrant/xtensa-esp32-elf/b
in:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/
local/games
there is a
vagrant@vagrant-ubuntu-trusty-64:~/micropython/ports/esp8266$
directory
pressing on ... I get:
-rw-rw-r-- 1 vagrant vagrant 576404 Oct 25 04:36 firmware-combined.bin
-rwxrwxr-x 1 vagrant vagrant 894936 Oct 25 04:36 firmware.elf
-rw-rw-r-- 1 vagrant vagrant 35456 Oct 25 04:36 firmware.elf-0x00000.bin
-rw-rw-r-- 1 vagrant vagrant 539524 Oct 25 04:36 firmware.elf-0x09000.bin
-rw-rw-r-- 1 vagrant vagrant 2048253 Oct 25 04:36 firmware.map
vagrant@vagrant-ubuntu-trusty-64:~/micropython/ports/esp8266/build$
did you try building axtls in ports/esp8266?
yes, I did a cd ./ports/esp8266
it worked out find and I have installed my new bin into an ESP8266
object <module 'esp'> is of type module
__name__ -- esp
osdebug -- <function>
sleep_type -- <function>
deepsleep -- <function>
flash_id -- <function>
flash_read -- <function>
flash_write -- <function>
flash_erase -- <function>
flash_size -- <function>
flash_user_start -- <function>
neopixel_write -- <function>
apa102_write -- <function>
dht_readinto -- <function>
freemem -- <function>
meminfo -- <function>
check_fw -- <function>
info -- <function>
malloc -- <function>
free -- <function>
esf_free_bufs -- <function>
set_native_code_location -- <function>
SLEEP_NONE -- 0
SLEEP_LIGHT -- 1
SLEEP_MODEM -- 2
>>>```
So the methodology you want me to use is what exactly? to find the incongruent parameters.
it should be as easy as changing the arg_check_num arguments
hmmm he says
I think its the true here should be false: https://github.com/adafruit/circuitpython/blob/master/shared-bindings/digitalio/DigitalInOut.c#L65
now that you have it building it should be easy to test and verify
I did see something that said once repl prompt returns it has no memory of the previous state. Seems to me that is making debugging extra hard. Is the a learn guide on learn.adafruit for debugging and or working issues?
yes , possibly can tweet a module if I can scope out a path to it. so where is the road map?
loading a code.py with ampy on the esp8266 is an easier way to do it
I don't know what you mean by roadmap
@tannewt : i already tried with pip3.
travis error:-
$ pip3 install pycodestyle
pyenv: pip3: command not found
The `pip3' command exists in these Python versions:
3.5
3.5.3
I looked at the issue DigitalInOut.c#L65 and it contains the C source code in question. So they will all be like this one. I was given to thinking that it is a broader general problem. But, maybe you are saying that there are clearly defined specifc cases that issues have been noted already by others. Yes, that will be much easier.
Ah bummer! I might have to do with the installation order of python versus the pip command.
@hollow tartan DigitalInOut is one case and the issue has another one noted
start with those, it does need a broader look
OK, well, it is time to dream for 6 hours or more. I listen to The Dark Tower audio books for 30 min as I am falling asleep. ๐
Roland, The Gun Slinger.
night @hollow tartan !
Interesting. I just did a pull and built the latest CP 3.0 for the M4, and it no longer mounts as a mass storage device. At the same time, I don't have a working REPL.
I had the same issue on Ubuntu under Windows 10. I can assert that updating the toolchain as dhalbert suggests, followed by the build process that jerryneedell documents, should solve the problem. If the OP (rrace001) can confirm the build process is working I think we can close this.
To be clear, @tannewt , this is a request for a standalone Python program that you would run, for example, on your laptop, which would interact with the GitHub API to extract and aggregate the desired stats? I am stating it this way because I don't see a way to do this using Pulse within GitHub itself. Perhaps I'm just not familiar enough with it, though.
@tulip sleet Colloh! Callay!
Ditto @drowsy geyser
Ah, ok. Thanks for confirming, @formal plover . I thought I might have messed up my build.
Unfortunately, I need to get ready for work or I'd plug in the JLink and see if I could figure out where the REPL is hanging.
But hey, the NeoPixel works. Lolololol
Yeah. I'm working for home today, so I'll mess with it on lunch or a break later
Oh hey. My only meeting today is at 10. Maybe I'll take the M4 and JLink to work and tinker on my lunch break....
Awesome @drowsy geyser. I'll be around. Just tag/ping me if you want my attention haha. People get cooking on these channel mid day, sometimes it takes me 15mins just to figure out what's going on.
The jlink is a really cool tool btw. Thank you @slender iron for getting us into testing with the jlink.
A PEP (Python Enhancement Proposal) for a builtin function called breakpoint(): https://www.python.org/dev/peps/pep-0553/. Will probably be in Python 3.7.
@formal plover Tell me about it (the channel gets going mid-day). I usually have my personal laptop at work, too, but I can't keep up with the conversations!
@formal plover you mean the software or the programmer?
@tulip sleet a breakpoint() function... it's Smalltalk in 1980 all over again! In that case it was a halt method.
@stuck elbow both I guess.
@umbral dagger limor was interested in this. I was looking at what's coming up in Python 3.7. I was actually writing Smalltalk code in 1980.
because I'm not really impressed by JLinkExe
@tulip sleet sweet, Smalltalk was my first exposure to OO. Worked in it my first couple jobs out of grad school (and my grad work implementations primarily were in Smalltalk).
@umbral dagger me too. I did my thesis work in Smalltalk at Xerox: https://danhalbert.org
@tulip sleet As we move to more capable chips, it makes sense to enhance the implementation. Adding a debugger would be a good move.
@stuck elbow Haha I just think it's cool that I can take a dead board and program it with the jlink. So I guess the concept is what I like
@tulip sleet Legit background
@umbral dagger I'm old
@tulip sleet Some of us are.
@formal plover I see, well, I'm quite used to microcontrollers that you can't brick. STM32s even have a serial bootloader built-in, so you don't even need a special programmer
agreed
Ok, enough playing around. ๐ Time to put away Atmel Studio and actually get ready for work. I'll be AFK for a bit but I should be back online within the hour. I'm looking forward to the day's developments!
@tulip sleet Back to CP... based on what I was seeign last night, I am wondering if there's a race condition with USB initialization and running main.py (or one of the other 3 options).
@tulip sleet Things run fine if there's no code to execute. I.e. screen connects and I'm in the repl. Add a code file then and all remains good.
@tulip sleet If there's a code file to start, screen just gives nothing. Remove the code file and boom you're in the repl.
@umbral dagger you mean in 3.0? I'll look at that: it could easily be true. But on Linux, it's messed up even without main.py.
3.0, latest (as of ~11:00pm ET) master. on Linux.
@tulip sleet With the patch you posted to only start one device.
@umbral dagger Does the default build include main.py? My board is not working so I can't check atm. I have a fresh compile and it neither gives me a REPL nor mounts CPYTHON.
@tulip sleet I do.. approximately every 30 sec.
@tulip sleet And CIRCUITPY doesn't show up
@umbral dagger same here I am planning to look very carefully at the ASF4 library this morning and how we are calling it.
lol @formal plover I know what you mean. I usually keep up with what's going on in here pretty well. Then, sometime around midday, it gets really busy, and it's like you're all speaking a foreign language lol.
@tulip sleet OK.. several resets & dis/re-connection usb CIRCUITPY shows up and I can get the repl.
@umbral dagger You and @tulip sleet are using Linux?
@drowsy geyser yes
@floral dagger Haha right?! Or morning nothing works, then I check after work and @tulip sleet and @slender iron are on version 5.0 and 3.0 is sooo this morning. Lol
An exaggeration of course lol. But you get the point
@tulip sleet Really smells like something in USB setup. The semi-nondeterminism makes me think race condition of some sort. Especially where that's happened elsewhere. And the fact that it's running ~3x faster than previous hardware.
Interesting. No amount of resetting/reconnecting will get it to work on Windows 10. I'll have a Linux desktop tomorrow night to experiment with.
Different systems -> different USB stacks -> different timings -> different behaviour.
@drowsy geyser Linux, yes.
Thanks!
Also, once I get to the repl, it seems pretty solid.
@umbral dagger I am having the same problem on M0's. I haven't bothered to try on M4 yet. The devices are recognized properly by Linux if you look in the system log. But the issues with connecting to the REPL could be a race condition on the CPy side. THe "every 30 seconds" thing is odd, but the device is not talking to the host regularly, as it does in CPy 2.x (based on USb traces). ... Try letting it sit for several minutes with not activity and see if the REPL disconnects.
AH.. ok. maybe not that. Or maybe since using the ASF code is a 3.0 addition, yes?
@tulip sleet leaving it sit in the repl and tailing syslog
We switched from ASF3 to ASF4, which is a completely different set of libraries. It's also new and poorly documented. Scott had to write a scraper from the http://start.atmel.com website to get the code bundle: it's not even available as an ordinary packaged download, and there's no version information (can't tell when they update it).
There is no ASF3 for SAMD51, or else we would have just continued with that.
@tulip sleet ugh
Slight update: on Windows 10 pressing reset does nothing to make CIRCUITPY appear or the repl work. Disconnecting and reconnecting, however, does make CIRCUITPY mount. As soon as I try writing a file to the device, though, it locks up, the write never completes, and the REPL is not available. Again, the reset button does nothing and it takes a power cycle/disconnect-reconnect to bring it back.
And the write worked , in that my code.py now runs, but it never "completed" from the OS perspective.
@tulip sleet 5 minutes and repl is still good and no USB related activity in syslog
@tulip sleet is 3.0 going to use ASF4 for all the boards, or just SAMD51 boards?
@umbral dagger so the 30 second thing is something where the mass storage is cycling state for some reason.
ASF4 for all - it's too much trouble to have separate impls. If we can get it working on SAMD51 it should work fine on SAMD21 and vice versa. The differences are slight.
@tulip sleet Gotcha. I figured as much
Once you guys get it stable, it won't be as painful I'm sure
Says the guy not directly working on core code
Hahaha
OK.. back to Haskell for me. I'm around and this will be open if anything needs testing on linux. Just yell.
Sounds good @umbral dagger. I'm on break right now, but I'll check in at my 2pm break to see if the Linux status has changed.
@umbral dagger Haskell? Wow. The quintessential functional language, and Python. Almost polar opposites (though functions are first class objects in Python, too).
@drowsy geyser There are overlaps. The typing in Haskell was annoying at first, but I'm growing to love it. I spend most of my "free" time working in Lisp (Scheme actually), and various things for work. At the moment I'm adding some property based http API testing and decided to use QuickCheck. Now I'm refreshing/expanding my understanding of Haskell.
@drowsy geyser You'll see me react at times with "don't use strings for that!" It seems to be a knee-jerk reaction now. "But.. but.. there's no type information on a string!"
@drowsy geyser Actually some things at work are getting more functional: ObjC -> Swift, Java -> Kotlin. The .Net folks are resolute in their love of C#. I'll be gently nudging them toward F# in time, but there's many of them. Also, we have several ex-MS people, so it's deeply engrained.
@umbral dagger I hear you on the C# camp (I work at Microsoft). But there are things that are forcing their hands. For example, HDInsights (aka Spark ๐ ) is really most effective with Scala - which I'm teaching myself since I've been offered a 1,000 core cluster for experimenting.
@drowsy geyser Nice. Scala is certainly popular. Especially with the data commuinty. It's popular and high paying on the FP job boards, as well.
I'm still wrapping my head around functional programming. Just like people will look at my code and suggest more pythonic approaches ("you really should use a list comprehension there"), people will look at my Scala code and say my imperative programming background is showing. ๐
Much easier said than done! At least for me....
If you can think back to math classes in college, that's what helps me.
But, I'm mostly a Python coder.
@drowsy geyser That's why I like Haskell... stricter. IMO a better place to learn FP.
Haskell is a pure-functional language.
Which is why there are some weird things to do normal stuff you might want to do, like print things, that change the state of the world.
I'm mostly a security architect, but I dabble in coding, mostly Python and R, but now Scala. Maybe I should study Haskell in the evenings to sort of force my hand at FP....
Haskell is also a lazy-evaluation language, which lets you get away with apparently infinite loops.
Like defining the infinite sequence of counting numbers. It won't calculate any of them until you try to do something that actually requires a value.
Then it will calculate as many as you use, as you use them.
That's kind of interesting. I can see where that would be very useful in set theory.
Some of the Haskell libraries are built by people with a lot of interest in category theory.
Enough so that one of my friends joined a reading group to get a handle on Homotopy Type Theory.
Which I don't understand, so don't ask. ๐
That's serious. ๐
Clojure is similarly lazy
My sense is that Clojure is very Lisp-y
And you can easily implement lazy sequences in Scheme/Lisp
Clojure is a Lisp syntactically
It's somewhat something else really though
@umbral dagger function arguments are lazy in Haskell also.
It's lazy in general.
But, strongly typed, with decent type inference.
@fringe trench You mean function ARGUMENT (singular) ๐
autocurrying is a thing also, yes.
@fringe trench multi-argument functions are really just curried single argument functions
@fringe trench but not in a hurry... lazily ๐
thunk thunk thunk.
Anyway, I'm not any good at Haskell.
I just think it looks cool.
I've done Hello World in a number of languages, just so I have references.
So, if the argument is lazy, does that mean the compiler (interpreter?) doesn't allocate memory for the data until they're referenced?
@tulip sleet from my poking around last night it looks like maybe_run is the entry point into the python VM. Yes? so one could replace the python vm (and a corresponding stuff around calling maybe_run) and get all the other goodness? repl command line editing, USB storage file system, etc? There's need to be changes to repl details, naturally.
@tulip sleet I'm just wondering how decoupled that is.
@tulip sleet See, I have this Scheme runtime in C that I've been working on with the idea of running it in an embedded environment...
@drowsy geyser Nothing gets evaluated until its value is requested.
Cool!
@drowsy geyser Hence, if you have an infinite sequence, and ask for the first 5, it computes the first 5 values in the sequence. You can later ask for more values from it, and it will compute them then.
@astels well, maybe, but the python object types are used all over the place. So for instance the stuff in shared-bindings is the python-to-hal interface, but sometimes the objects are passed down into the hal level. You could probably use the top level stuff around main.c, but there's not a lot of it.
@drowsy geyser I don't know.
there was no attempt to decouple python knowledge at the various levels
@umbral dagger you could maybe port it as an IPython kernel, and interact with it in Jupyter notebooks....
Here's the Hello World repo in case anyone's interested: https://github.com/pcurry/hello-hello
@tulip sleet makes sense. The USB storage and change detection, and USB repl are the especially interesting bits.
@umbral dagger yes, the lowest level stuff that talks to the HW libraries could be reused, and the FAT storage stuff, which was adapted from an existing library.
The change detection has its own issues, due to delayed write of metadata both in Windows and Linux.
@tulip sleet OK, sounds like I could reuse enough to be worthwhile. If I ever get back to that project. It's close.. just have to finish the gc.
Did i miss something concerning M4 USB. I built metro M4 using latest this morning. My ubuntu machine now sees the CIRCUITPY drive (which wasn't working yesterday), but now my windows 10 machine does not mount the drive (which was was working day before yesterday)
@fading solstice yes - USB is rather unstable depending on platform and karma... It is being actively worked. Tha last 6000 or so messages (excluding the Haskeil discussion) contain the sordid details of testing last evening and htis morning. ๐
ok thanks
the response on Linux/Windows/mac/Rasp Pi are all different .
Hi folks! My M4 arrived. Are there any docs or a "getting started" link, or is that all in the package?
ha! good question. i think the chat in this channel over the last few days is 90% about this.
but i'm wondering same. if anyone has consolidated notes? i'm not going to be able to really take mine for a spin for a day or so.
@frail geode It's a moving target but I think this si sa basic outline use Jlink to load new bootlader that supports UF2 Flash the latest CP 3.0 Build for the M4 The latest bootloader has been posted to theis channel - last nigtht there were several.
is it possible to use Atom with Feather Huzzah Circuit Python?
@tidal kiln It's a moving target so I'm not sure what value that woudl have. Other than things like "how to flash the bootloader using jlink".
You can also build the image and use bossac if you don't want to go through setting up JLink...
neat - do we want to try implementing it before them - it may be a while till it trickles into micropython core since thats still at 3.4
@drowsy geyser yes - good point - Whne I first did that I had to update bossac - is that still necessary or is it icorpartaed into the CP repo now.
That stuff would be useful to have on a guide somewhere, regardless, for people that want to do low level hacking or debug C firmware.
I had to update bossac, but that was last weekend.
I'm not sure of the current status.
I have a OneNote notebook of all my tasks, from "I have a box with JLink and a bare M4 board" up to, well, this morning's USB discussion.
I can start making a guide, though I'll need help with the MacOS parts.
@bronze geyser yes. in general, you can use any text editor.
Thanks @tidal kiln I guess I'm being stupid. I keep thinking I need a REPL interface to interact with Python on the Huzzah...at the least be able to "mount" a drive like I can on the raspberry pi.
thanks @solar whale and folks
It was nice to find taht we culd upload the bootloader with just JLinkEXE (aka Jlink Commander) - It can also be done with JLinkGDBServer or Ozone. Choose your weapon....
@bronze geyser using the REPL isn't required, it's just another way to interact with Python running on the board. in that case (accessing REPL) you would use some form of terminal program
@tidal kiln = yah, if I wanna REPL, I use CoolTerm and all is great.
@bronze geyser the other way is to just edit a text file and put it on the board, it will then run it for you automatically
@bronze geyser there is no USB like file system on the Feather Huzzah for CircuitPythion
Thank you @solar whale. How do I save a file I'm editing in Atom (and then run it)?
ah. Right. there was some apy tool or something...thank you.
@bronze geyser you have to upload it via the ampy tool - or WebREPL if you have that working.
ampy is the best way in my opinion.
ah yes @solar whale . Thank you very much. Thank you @tidal kiln.
thanks @solar whale , yeah, the huzzah is a little different
a little ๐
didn't read past 'feather'
Another challenge I have with the Huzzah is lack of external antenna (i.e. : no FCC/CE certification...so no offering.)
that should be on the module itself
@bronze geyser one warnigt - make sure you exit your terminall session to the Huzzah before trying to use ampy to load. Only one serial connection at a time....
@solar whale Oh. Right. makes sense. Thank you.
I forget at least once a day....
yeah - it provides us a syntax that will be the standard
@bronze geyser HUZZAH, much fun there. Only CircuitPython board with Wi-Fi currently
We could also reach out upstream to see if its development we could fund.
On Wed, Oct 25, 2017 at 9:09 AM Dan Halbert notifications@github.com
wrote:
yeah - it provides us a syntax that will be the standard
โ
You are receiving this because you commented.Reply to this email directly, view it on GitHub
https://github.com/adafruit/circuitpython/issues/298#issuecomment-339383022,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADNqZr3jJgMUEODnfGdV...
@kurt h I thought Feather M0 WiFi - ATSAMD21 + ATWINC1500 would have CircuitPython. But ah yes. Different wifi
Yup, python script or js webpage (so everyone can see) would be perfect.
@bronze geyser there is wifi support for the M0 boards with the ATWINC1500 but it has not been implmented in CircuitPython -- yet
To my knowledge, networking only works on the HUZZAH ESP8266
For CircuitPython that is
I'll take the silence to mean we're ok with my proposal. Would someone mind:
board or simply making a PR for it.I am using a Arduino SPI library that talks to an ATM90e26 (energy monitor - reads power, voltage and stuff with input being a current transformer). I'm using it to monitor my house's energy use. I thought..geez...looks like it should be fairly "easy" to port this Arduino SPI to circuit python...but then...sigh...i (probably) need an external antenna...hmmm...there are esp-07's that have external antenna's...so now...hmm...i might try w/ this board.
Circuit Python has SPI support so hopefully that should make it easier.
@frail geode you can also try the arduino core for M4 https://github.com/adafruit/ArduinoCore-samd/tree/samd51
installation details in readme, scroll down
arduino core is 'pretty much done' and we appreciate any bug reports on that too - USB host and I2S dont work but honestly, they didn't work great on SAMD21 either ๐
@meager fog is there a linux build of the updated bossac that can be added to the released builds?
not at this time because i dont have access to a linux box ๐ if you do, give me the bin and ill attach it
I'll make one toninght when I get home and pass it along. - it is from the arduino branch, correct?
yep
OK - I was planning to set up the arduino support on my linux system this eveing so I'll be able to test it out.
@solar whale that would be great, please do! i know Arduino IDE on linux can be a little different
@meager fog I can try Arduino on it as well. Until CircuitPython Linux issues are sorted out.
I'll follow up with @solar whale on it
@slender iron here is someone else trying to use ASF4 and MSC. Very helpful. I also was wondering about MODE SENSE. https://hackaday.io/project/20772-orthrus/log/68209-firmware-success. I'll see if I can find his code.
I got Orthrus v3 hardware working all the way as a disk drive last night. There are a few bugs in Start's code that you have to work around:Start doesn't adjust the UTMI_CKTRIM register when configured with a 16 MHx crystal. You have to do that yourself.mscdf.c has no support for the MODE_SENSE_6 command, which is necessary (you just have to give back 4 zero bytes).mscdf.c has a bug where it returns non-zero when there's no error sending the zero-length "sync" at the end of a write.Start doesn't allow you to configure 512 byte endpoints, as the HS spec requires.There are still a couple of bugs to work out - mostly centered around the handling of situations where cards are removed or missing.Performance is not as good as hoped. Throughput is around 540 MB/sec. Halving the SD card clock doesn't appreciably change throughput, so this may be being limited by USB. But even at only ~5 times faster than before, it's now actually usable as opposed to unacceptable.Another couple of days to polish the firmware, and I think I'll be able to send some units off to the HP judges!
awesome! we should reach out
"Reaching out, touching me, touching you" ๐ต
You know where I'm going with this @slender iron.... Sweet Caroline!!!!
Sorry I had to
Code is here: https://github.com/nsayer/Orthrus
is macos finder complaining about data loss a known UF2 thing? like when dragging a UF2 file over.
seems like something i remember seeing mentioned before. maybe?
it complains about the early eject
the uf2 bootloader is smart enough to know when it has everything it needs
The Finder can't complete the operation because some data in the "FileName.UF2" can't be read or written. (error Code - 36)
that's it. expected / ignore?
@tidal kiln I have never seen that.
but its been 12 hours since I built 3.0 so who knows ๐
this is with current shipped image
shipped on what?
cpx
hrm, I haven't seen it
Sorry _ ithought you were talking about M4
no worries
i'm trying to catch up on my other duties so i can join everyone else in m4 land ๐
I wonder if that user has the v1.23 bootloader installed as recommended in the guide.
but that error sounds like it is on the Mac side.
@tidal kiln it may be worth asking them if it works despite the error
yep. almost did. we'll see what happens if they go through the posted steps again.
@solar whale if you're around later, might request your help with Arduino and the M4
not sure they knew about those
@formal plover sure - be happy to help. Will you be installig it on the RPi?
I've got some errands after work and ask an engineer is on tonight, so I'm not 100% sure, but we shall see. Yup, on the Pi
Hopefully if I get it workign on Linux RPi will be the same - I can try it on mine as well. I may not be availble late tonight but we'll get to it soon!
@tulip sleet @slender iron regarding Orthus, I actually know the guy who wrote it from my first job, though I doubt he remembers me
He was a rock star and I was a lowly QA peon
@pastel panther he fixed about five bugs in the ASF4 MSC impl; he clearly knows that low-level stuff; I'm trying his patches right now. you can tell me more in DM if you'd rather it be private (e.g. company, etc.)
@pastel panther after things get a little more stable with 3.0 and Linux, I'll try to whip up a quick guide for the flashing the M4.
@formal plover sweet!
@tulip sleet I'm looking at improving travis
It won't be anything fancy since after this is full blown production it'll never get used
what do you all think about bring the xtensa toolchain in as a submodule?
@slender iron doesn't the xtensa toochain require a "case-sesnsitve FS on a Mac" - will this cause problems for people who clone the repo?
looks like we could split the travis build using env variables: https://docs.travis-ci.com/user/customizing-the-build/#Build-Matrix
you mean https://github.com/pfalcon/esp-open-sdk, and stick it under esp8266 ? There's still a lot of setup needed, but it would make it easier to keep up to date. But maybe just a README in there would be good. I'm wondering if there would be platform issues (one commit works on Linux, another is needed for Mac, etc.)
yeah, thats what I'm thinking
more as a way to get travis building the esp8266 builds too
@slender iron the reason I do my esp8266 build in a Vagrant VM is to avoid the case senitive FS for the xtensa.
yeah, I have a sparsebundle FS on my mac for it
do you just have to put xtensa in it ? or the whole CP repo?
but you'd have to build the toolchain on each travis run, no? Or we need to pre-build it and stick that somewhere.
@solar whale both
@tulip sleet I was looking at https://docs.travis-ci.com/user/caching/
oooooh! (pronounced with a long u sound)
๐
got some more log folding working too: https://travis-ci.org/tannewt/circuitpython/builds/292748575
@slender iron diff topic: I built a windows mpy-cross last night and passed it to her. I suggested and she liked adding some precompiled mpy-cross's to the release dir now. There'll be pointers in a Learn Guide. I have windows, mac, and 64-bit linux right now. Could build rpi and 32-bit linux later.
any qualms?
@formal plover might be better for rpi since he does his dev on one
yah, we can just ask someone. I was going to spin up one of my rpi's
and precompiled mpy-crosses are fine with me
@slender iron what am I doing? Lol
we just had a discussion: I am under the impression that the MPy compiler reads the entire source file into RAM without stripping comments or anything in advance. Do you happen to know? I can look it up.
@formal plover do you have a built rpi mpy-cross you can drop here? Also @solar whale might have one. We are collecting a set to include with the release
@tulip sleet I don't think it does because the lexer does the reading
maybe that used to be true
when I looked into it before I believe the memory peak was when converting the ASTish thing to byte code
I dont have one now, but I can make one if needed.
but maybe there are comments in the AST
maybe
anyway, I can check
@solar whale if it's handy or @formal plover has one, that woudl be great. Otherwise I will boot up one of my rpis.
the heap profiling stuff I did woudl be agood way to look
@tulip sleet I can't do it for a few hours yet but happy to do it then.
I have a Pi handy but not a mpy-cross
I don't even know what is Lolololol
Obviously it's a mpy file, but I dunno what the cross is
@formal plover have you built circuitpython yourself yet?
@slender iron nope
mac folks - if i have an mpy-cross that is built on high sierra is it likely to be able to run on earlier versions? It's just an executable, but it may have some external dependencies, I guess (the equivalent of .so)
@tulip sleet I can provide one
@tulip sleet I was told it has dependency issues with previous versions.
I offered mine up to someone running something earlier and it failed. I'm on Sierra.
I'm on high sierra
@slender iron I have one I built for kattni a couple of weeks ago. Maybe it could be statically linked.
@slender iron one of the only things I haven't done since working on CircuitPython.
That and core code work
I'm not as legit/cool as @idle owl
Hahaha
Hah!
@formal plover I only built anything at all for the first time this weekend when I built CircuitPython. ๐
@idle owl and if I recall correctly, you did not build mpy-cross - is is not need for 3.0 yet. I meant to have you go back and do it.
@solar whale I did not build mpy-cross, nope. The version of it I have is from Dan and I was using it to get mpys for 2.x use
it is easy - just cd into mpy-cross subdirectory and type make.
@slender iron @tulip sleet I just looked at the lexer. It skips over comments.
@umbral dagger but is it reading from the file or from a string?
@solar whale For 3.0 ?
@tulip sleet I'll look... should be the same at that point unless it's weird
I upgraded the ubuntu from 12 to 14. and I have some troubles.
William@Magnificat_V2 MINGW64 ~/esp8266-micropython-vagrant (master)
$ vagrant up --provider=virtualbox
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
@idle owl same mpy-cross for 2.x and 3.0
i was collecting mpy-cross's for 2.1, not 3, but yes, it should be the same
Just make?
it also wanted me to provide the chef url and I left it blank.
in circuitpython/mpy-cross - just make
Fancy!
@tulip sleet Looks to all go through the same thing from what I see. There are various ways to instantiate a lexer: file name, file handle, string.
@tulip sleet A different reader gets created in each case, and handed to the lexer.
py/lexer.c starting at line 669
@obsidian helm how did you do the ubuntu update?? the vagrant config should have loaded the ubuntu version it is configured for.
@umbral dagger that sounds good. thanks for the code research! it was a q limor had
@rrace001 Please reopen if this is still an issue after updating your toolchain.
@solar whale right, after the ssh booted it suggested that I upgrade to 14 and told me the command to use.
@split ocean Nice job on the UFO!
soon that UFO fly inside @split ocean workshop
Thank you @idle owl and thanks so much for your help!
@split ocean Anytime!
@sick creek I think it'll make a nice addition to the decor
@hollow tartan hmm - I'll have to check my congiuration after I get home.
@split ocean it took all of me to not switch my avatar to your 90s photo and wait for someone to notice
@split ocean the important part is circle motion
@solar whale okay , I will wait to work with you in 3 or 4 hours.
@split ocean if you can make 2 opposide rotate rings
Ooh, I've got one of those big 60 pixel rings left over from my Lucio blaster project...
that design need 2 rings what rotate oppposite directions enough speed so the UFO should hover
@split ocean I love that you just have a 60 pixel ring left over from something.
@tulip sleet @slender iron From a small bit of code spelunking it appears that python source is compiled to bytecode. That happens with all code I assume. The bytecode is stored in, and excuted from, RAM. I'm guessing that MPY files are precompiled bytecode. Does that get copied to RAM before execution or is it executed directly from FLASH?
@split ocean try first with 2 fidget spinners perhaps if you can make them rotate different direction with circuitpython code and iterate from there
@umbral dagger .mpy files are loaded into RAM. Only bytecode that is built into the firmware image ("internal frozen modules") can be executed from flash. So importing a .mpy saves a compilation step, but does not save any RAM during executiong.
@tulip sleet Thanks. That gives me a couple intersting things to look in to (this stuff is where I live ๐ ) Related: With growing Flash space has thought been given to freezing more modules?
@umbral dagger yup right now there are only internal frozen modules in CPX, but we can add more. In the small M0 builds there is still not enough room for anything, and we have more C stuff we want to add (framebuf, turn some features back on, etc.). On the Express boards, we can freeze more stuff. Advantage is saving RAM; disadvantage is keeping them up to date and explaing to people about sys.path and how to make sure the internal frozen ones are imported rather than those in lib/
@tulip sleet That all makes sense. Flash grows faster than ram as you move to bigger chips. And you have the option of SPI flash as well (that must slow things down significantly, though... ya? Or is flash slow enough that SPI latency doesn't impact much? Not something I've spent time exploring.)
@umbral dagger you can't execute from SPI flash unless you enable XIP (execute in place), and have a 4-bit (QSPI) SPI flash chip interface. Then the external flash can be mapped into the CPU's address space. That's on the SAMD51 but not the 21. The SPI flash chips we're using are single-bit.
โฆbuffer of at least 1.
Fixes #358
@tulip sleet where are you at on the MSC stuff? I'm about ready to pick something else up
can we voice chat? it's a bit involved
sure!
@obsidian helm When I installed the esp8266 vagrant a few days ago, it installed Ubuntu 14.04 - Whn I ssh - it does let me know that 16.04 is avaialble, but I have not tried upgrading it.I'm not sure if that will cause any problems or not. Your report alos say it was using Ubuntu Trusty which is 14.04 so I am confused by your saying you were upgrading from 12 to 14....
@tulip sleet https://github.com/adafruit/uf2-samd21#samd51
@tulip sleet @slender iron have either of you ever tried upgrading the Ubuntu release within a Vagrant VM - since the Vagranfile is looking for a specific release, I think that will cause a problem, but I was curious if you have ever tried it?
Heh... claims to have developed it using TDD, then goes on to say "However, due to my limited time, not all the code base is tested yet, and it will be indeed an challenging to keep the test up to the code." Sigh.
@umbral dagger he actually contracts for adafruit and will probably circle back to it
I'm thinking it'll be a good usb stack to share across ports in circuitpython
@solar whale I have not tried that. I'd start with a newer vagrant base
@tulip sleet agreed but just trying to help @obsidian helm using the micropython_esp8266 as provided - I suggest leaving it as distributed.
@slender iron Cool. My comment relates to him saying two different things. The sigh was becasue that's so common... even after 17ish years.
@umbral dagger is a ringer: he wrote a book on TDD https://www.amazon.com/Test-Driven-Development-Practical-Guide/dp/0131016490/
@slender iron Having an 'internal' USB stack has definite advantages.
FYI: James' book on TDD for embedded C is good. Google did some amazing things TDD related for C++ using macros & templates. Mindboggling cool stuff. I think all that has been opensourced.
@tulip sleet That was back in my Java days shudder
@slender iron question if you're free ๐
@tidal kiln he said he was getting lunch
k. thanks @tulip sleet
what's maxiumum possible SPI clock on the samd21? I got as high as 24MHz, can I go higher?
I can't find it in the datasheet
and the code for _sercom_get_sync_baud_val is a bit convoluted
@stuck elbow check the first part of this out: https://github.com/arduino/ArduinoCore-samd/issues/147 it says 12 MHz (!)
that is weird, I have it working with baudrate=24000000 on my display right now
@stuck elbow I thought 12mhz as well
@umbral dagger I was at google for six years so my affinity for testing comes from there
@tidal kiln whats up?
using tuple to specify channels for differential adc
@slender iron Nice. I was with the Test Mercenaries, part of the Testing Grouplet, and edited Testing on the Toilet for a while.
chan0 = adc[(0,1)] (oops edited)
nice! I loved testing on the toilet
@slender iron https://github.com/dhalbert/circuitpython, branch msc-debugging. https://github.com/adafruit/asf4, branch orthrus-changes. The msc-debugging branch commit includes changing the asf4 submodule to point to the orthrus-changes branch.
guess you would like similar syntax for single ended?
haha, ok
chan0 = adc[0]
ok. good.
it's also pretty failsafe
one element tuples are a little weird
(0,) not (0)
exactly
but (0) is just 0 so if someone tries it, it will work
yup yup
next question is what error to throw
i'm using a dict to map the tuple request to actual adc channel
so easiest would be to just let it do the work, which would be a KeyError
yep. KeyError
you don't want me to trap that and throw something else?
@tulip sleet well, 48MHz works in circuitpython, though I have no idea what SPI clock it results in actually โ looking at the display's refresh speed, it seems to be less than 48MHz
@meager fog I tried updating for the samd51 for arduino on linux but when I try to compile blink I get lots of errors - here are the first few - any suggestions?? ```Arduino: 1.8.5 (Linux), Board: "Adafruit Metro M4 (SAMD51)"
In file included from /home/jerryneedell/Arduino/hardware/Adafruit/samd/cores/arduino/Arduino.h:66:0,
from sketch/Blink.ino.cpp:1:
/home/jerryneedell/Arduino/hardware/Adafruit/samd/cores/arduino/WVariant.h:107:36: error: 'TCC_INST_NUM' was not declared in this scope
extern const void* g_apTCInstances[TCC_INST_NUM+TC_INST_NUM] ;
^
/home/jerryneedell/Arduino/hardware/Adafruit/samd/cores/arduino/WVariant.h:107:49: error: 'TC_INST_NUM' was not declared in this scope
extern const void* g_apTCInstances[TCC_INST_NUM+TC_INST_NUM] ;
^
In file included from /home/jerryneedell/Arduino/hardware/Adafruit/samd/variants/metro_m4/variant.h:42:0,
from /home/jerryneedell/Arduino/hardware/Adafruit/samd/cores/arduino/delay.h:27,
from /home/jerryneedell/Arduino/hardware/Adafruit/samd/cores/arduino/Arduino.h:81,
from sketch/Blink.ino.cpp:1:
/home/jerryneedell/Arduino/hardware/Adafruit/samd/cores/arduino/SERCOM.h:146:16: error: expected ')' before '' token
SERCOM(Sercom s) ;
^
@tidal kiln nah, KeyError is fine
I'm gonna go heads down on USB reliability until the meeting. I can look later or tomorrow
@slender iron Good luck. Here for testing if you need it.
@slender iron cool. it's up now. same link as before. make sure to look at multi branch
for whenevs
@idle owl if you care, fwiw, etc. another good example of usefulness of dictionaries:
https://github.com/caternuson/CircuitPython_ADS1x15/blob/multi/adafruit_ads1x15/adafruit_ads1x15.py#L90
@tidal kiln Are (0,1) etc. addresses or something?
keys
ah
basic dictionary semantics:
dictionary = { key : value }
and you can have as many key/value pairs as you want
nice
and...the best part.....they can be anything
So it's arbitrary?
pretty much
the most obvious is for the key to be something simple, like an int
but doesn't have to be
what i linked uses tuples for the key
oh, and to get an item, you use:
dictionary[key]
@tidal kiln weren't you the one helping me with that back when I was working with my HUZZAH and open weather?
Dictionary stuff I mean
maybe. rings a bell. something that looked like a json return?
Yes!!!
guess so then
(brb also teaching someone else here ๐ )
And the usual crowd was around too @solar whale an company lol
hmm, the logic analyzer actually says it's 2.5MHz
at the best, it's very uneven, ranging from 500kHz ot 2.5MHz
correction, I had my analyzer in the wrong mode, it actually gives between 20MHz and 25MHz
Thanks all. Worked perfect!
bd7abcd shared-bindings: Check that I2C and SPI reads a... - tannewt
@meager fog Nevermind!! It was a problem with the "Device" file - all fixed - Blink works fine - Si7021 works fine!! all good
@meager fog oops - minor correction - I had an MCP9808 connected - it works great - si7021 code ran fine but gave funny results ๐
@solar whale I'm getting the arm-none toolchain set up on an RPi. Looks like I need to build it. Or did you just use the native Raspbian compiler?
@tidal kiln @idle owl Re: dictionary keys. Yes, they can be anything, but the implementation has optimizations for numbers and strings. In your case the keys are 2-tuples of small numbers so it's still fast/simple: hash each element of the tuple and add them. Using more complex structures as keys gets more expensive.
yep. nothing comes for free.
@tidal kiln @idle owl Another thing about dictionaries, and probably more relevant in small memory environments is that can take up significantly more room that what they contain, and they grow non-linearly to maintain a certain overhead as you add to them. They do this to try to maintain a high lookup speed. You're trading space for time. If you're not familiar with the implementation it could be a surprize.
@tidal kiln @idle owl In this case you only have a few things in it, and it doesn't grow over time, so it' doesn't have much impact.
if there's a more efficient approach, please let me know
efficient, but still has user friendly syntax
@tidal kiln In this case you're fine: small and simple -> little overhead and cheap hashing.
py/map.c and py/objdict.c is the relevant implementation
but even there. i'm always amazed at how there always seems to be a better way for everything.
at which point someone points out some python feature i've never seen before
@tidal kiln That's... pretty much all of my projects, ever. After I'm done, "Have you tried X?" "Huh, that would have saved me a lot of time before!"
@tidal kiln You'll often find that it's a trade off between readability/understandability/maintainability and efficiency. Always default to the former. Optimize to something more efficient (and again time/space is then often a tradeoff) only when you have a proven, observable need to.
yep. that's inline with my approach.
although for embedded stuff, the later can sometimes be the driver.
@tidal kiln And if you do optimize and have something less understandable, document/comment the *&^$#) out of it.
of course. i always document. ๐
@tidal kiln Yes, embedded has a different set of constraints.
yep. and cp is interesting as both are drivers.
readability (so it's beginner friendly) and efficiency (since we're running on mcu's)
If you're running on a non-Express board, you can even get to a point where individual characters can be too much filespace.
Definitely. Memory is probably a bigger constraint than time in most cases anyway. And you often also have power consumption to consider.
That said, The chip on the M4 is so much more everything that my first computers (ZX81 and then Apple ][+)....
avoid big letters, like O and W and try use skinny ones like I
The ATMEGA328 is more in line with those machines.
@tidal kiln Well, certainly forget using unicode ๐
I'm waiting for someone to write a python minifier
then I can safely give up on python and move onto rust or something
@stuck elbow wouldn't you need a python bytecode minifier?
@stuck elbow Well MP/CP is compiled to bytecode on load and you can precompile to mpy files.
(for memory usage at least)
@umbral dagger but all the names are retained
@pastel panther I'm not sure (yet) how much the MP compiler optimizes.
so shortening function and variable names still gives you gains
@stuck elbow Yes, right you are. That should be a simple compiler optimization... that adds complexity and overhead, so many in the py->mpy version.
It would be interesting to see a color coded or otherwise human decipherable map of memory usage
@silent radish you can't do that, as some programs would stop working -- namely the ones that use getattr with computed values
python is too dynamic for such optimizations
@umbral dagger I think I mean something like a byte by byte layout of memory, not a usage figure
@pastel panther that's available in micropython
@pastel panther not sure if cp has it
@stuck elbow Hmmm...
@stuck elbow Like a realtime map or some generic "these things go to these addreses"?
let me show you
@stuck elbow Also, I'm new to python.
here
>>> micropython.mem_info(1)
stack: 2144 out of 8192
GC: total: 36288, used: 7248, free: 29040
No. of 1-blocks: 49, 2-blocks: 14, max blk sz: 264, max free sz: 1806
GC memory layout; from 3ffef2b0:
00000: h=ShhhMhSDhBhDhB=BBBh===h====hhBhh==h===========================
00400: ================================================================
00800: ================================================================
00c00: ================================================================
01000: ============================================hBh==AAh=======h====
01400: ================================================================
01800: =============h=hBhThShh==hh=hhBh=hBhhhBhTSh=hhh=h=h===h=h=h=Bh=B
01c00: ..h...h=....h=..................................................
(27 lines all free)
08c00: ............................
ooh
That's what I was thinking of
a dot is free memory, each letter is a different structure (object, list, etc.) and equals means the same object as before contiunues
cool
@umbral dagger what did you use before? do you have any experience with dynamic languages like perl, js, lua, lisp, etc.?
From the discussion raised in this issue, w.r.t I2C bus:
https://github.com/adafruit/circuitpython/issues/340
It would be super cool if you could inspect the values as well but I imagine that would be significanly harder
well, you can access arbitrary memory addresses
where would you save it?
ah, well, with a debugger you can just pause your program and get the memory contents
I'm excited to play around with my jlink when it arrives. I imagine not every debugger is made equal though and I'm only getting the mini for now
I honestly can't see why the dongle you are using should even matter
Because licencing?
all it does is forwarding the commands from your computer and giving back what it got in reply
licensing is unenforceable in open source world
you can't license the specification of the commands
Hearing people on the embedded podcast talk about debuggers, I got the impression that nicer ones (tracers?) can do a strace like dump of instructions as they're completed
and once the commands are known, I can build my own debugger
Hey, if you want to build a sweet open hardware debugger, I'm all for it
Do they do everything you would want?
not sure it talks swd though
well, it's open source, so if it doesn't do something you want, you can add it
noice
note that I don't really have that much experience with different debuggers
so far I have only used the stlink and played briefly with black magic probe
so maybe there are some limitations of the actual hardware -- like the sizes of buffers or something
I'm sure. Back to the salt mines for me, ttyl
I helped my friend make a servo work on the CPX using MakeCode today! She's really getting into this. She's learning a lot!
Next step will be CircuitPython, but I think we're not there yet. She's starting to think in code structure though, so I think it's going wonderfully.
and tracing isn't expensive if the hardware supports tracing to memory
Yeah, made a new branch to work on the approach of breaking into multiple files. Sorry if that was confusing. "Master" is now like "The original idea" or something.
@slender iron Awesome
@pastel panther https://learn.adafruit.com/debugging-the-samd21-with-gdb/setup?view=all#micro-trace-buffer
ok I need testers
Assuming it requires a jlink I'm no help yet
@slender iron Ok
circuitpython with (hopefully) better usb
let me know if you need a different format
It's more jlink practice unless you can make a uf2 ๐
@slender iron I asume those aren't commited yet?
Oh nice!
nope
Ok, thanks!
@slender iron Yay!!!
Mounts on first flash! Going to repeat.
That was quick, @idle owl !
@idle owl Did you use your jlink to upload the uf2 or copy it to the virtual drive?
@pastel panther I double-tapped reset to get into the bootloader and dragged the file to METROM4BOOT
@stuck elbow I started with 8 bit assembly, Pascal, C, C++, ObjC, Java, various Lisps (mostly Scheme these days) (some of which I implemented) including Clojure, spent years with Ruby in various forms, Smalltalks of various flavours, and probbaly others Iโve forgotten about. Python is relatively new though. Tried to use it at Google but I was in a Ruby phase then. Guido extolled its virtues to me once, but to no avail.
@slender iron It's consistently mounting immediately after flash, no issues. I was replicating yesterday where you had to make a serial connection to get it to mount in Finder. Great job!
@stuck elbow Also dabbling in Swift & Kotlin for work. And am hardcore learning Haskell at the moment, also mainly for work.
CIRCUITPY mounts....
@idle owl Did you previously flash something with the segger to get the double tap->METROM4BOOT to work?
@pastel panther Yes. I had to flash the bootloader with the jlink
I suppose Ruby is the closest of those
ok, nvm for me then
Can you load the uf2 bootloader with bossac?
@idle owl yeah, the cdc reliability stuff I added also caused it to infinite loop if a terminal wasn't connected
@slender iron You're awesome! CIRCUITPy mounts and the REPL works!
@idle owl I have code that will allow you to update the bootloader through bossac
and bossac doesn't require a jlink?
Ah
Ah ok. That's what I wasn't sure about.
@pastel panther it doesn't make it impossible
Oh boy, smoke on mine
with gdb you just have to set a bit to tell it to ignore the bootloader protection
lol jk. Same results as @idle owl using my Pi
@formal plover Nice!
๐
That doesn't sound too bad
@formal plover you had me scared
Bwhahah gotta keep things interesting @slender iron
Kurt's being sassy
lol salty/sassy. @idle owl is correct
@pastel panther this should update it to the uf2 bootloader. beware it may break things and need a jlink to fix
@formal plover Sad panda, re: work from home day.
@slender iron And bossac instructions I can find will tell me what to do with that?
@pastel panther what OS you on?
OSX
10.10.5 if that's of consequence
try the download but its built with high sierra
@slender iron BTW, the problem with history getting garbled is fixed, too. I just tried it again....
@drowsy geyser yeah, my fix for that is what broke mass storage without serial being connected
Ahhh, ok! Well, all seems to be working now. I'll write some programs to stress test it.
w00t, I'll make a pull
Excellent!
@tulip sleet how closely do you want to review the nrf merge? I just did that usb fix on top of it
I could port it back or wait
@umbral dagger describe hosed and how you got there
no USB drives, no screen connection. at the moment I can't get jLink to connect.
bootloader ok?
I dragged your new uf2 to the boot drive
double reset:: red LED pusling, Neopixel green. No BOOT drive
I didn't test that build on linux yet
`
Adafruit CircuitPython 3.0.0-alpha.0-1025-gb31d67320-dirty on 2017-10-25; Metro M4 Express with samd51j19
`
That's my Pi
serial
Single reset -> green led. My file manager noticed but no drive mounts
@slender iron Ya, this is linux
which uf2 did you grab? circuitpython or the bootloader?
@slender iron the firmware.uf2 you posed at 6:40
Let me tell you about the wrong usb port...
lol
For those that were there trying to help me setup the jlink
That there is such a thing makes me wish they would remove the U from USB
i think it might be a software thing too
I tried a couple other ports... same
i had my linux box refuse to see my trinket at one point
is it uf2 with neopixel working?
while doing a bunch of testing and jumping between arduino and cp
tried it on a 2nd linux box and it showed up fine
bootloader timestampsed 10:08 ET last night
and neopixel works?
Neopixel seems fine in the bootloader: red than switches to green
Single reset: yes it turns off
kk, thats when it should be in circuitpython
Now, when I hook up the jlink, and double reset, neopixel is red and red LED pulses fast.
thats when its not enumerated
bbaib
With USB connected, double reset-> neopixel green, red LED pulsing slowly
Ya... no drive
sounds like the OS is unhappy
That's what I'm wondering. BRB going to turn it off and turn it on again
OK.. back
plug it in and CIRCUITPY shows up
double rest and nothing, and now it's unresponsive again
I saw a project really recently to make The Internet
did they get approval from "the hawk"?
OK.. bounced again. This time I went straight for jlink and reflashed the bootloader.
connect USB and have CIRCUITPY, screen in and have the repl
Nice!
No for the new firmware.uf2
double reset for the bootloader messes up everything
hrm
Nothing works after that.
building new bootloader and firmware
then bounce and try again
New bootloader flashed, but double reset hoses it
@slender iron I'll take a look. I can probably do it in a hour or less.
k, I'm distracted by streams now
When I reset: ```Oct 25 19:34:01 rohan kernel: [ 196.493057] cdc_acm 3-1.4.3:1.0: ttyACM0: USB ACM device
Oct 25 19:34:01 rohan kernel: [ 196.493741] usb 3-1.4.3: USB disconnect, device number 12
Oct 25 19:34:02 rohan kernel: [ 196.796181] usb 3-1.4.3: new full-speed USB device number 13 using xhci_hcd
Oct 25 19:34:02 rohan kernel: [ 197.054010] usb 3-1.4.3: New USB device found, idVendor=239a, idProduct=8021
Oct 25 19:34:02 rohan kernel: [ 197.054011] usb 3-1.4.3: New USB device strings: Mfr=0, Product=0, SerialNumber=0
Oct 25 19:34:02 rohan kernel: [ 197.054985] cdc_acm 3-1.4.3:1.0: ttyACM0: USB ACM device
Oct 25 19:34:02 rohan kernel: [ 197.055254] usb-storage 3-1.4.3:1.2: USB Mass Storage device detected
Oct 25 19:34:02 rohan kernel: [ 197.055440] scsi host7: usb-storage 3-1.4.3:1.2
Oct 25 19:33:55 rohan gnome-terminal-[3377]: message repeated 23 times: [ Allocating size to GtkBox 0x556616f218a0 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?]
Oct 25 19:34:03 rohan kernel: [ 198.068653] scsi 7:0:0:0: Direct-Access PQ: 0 ANSI: 3
Oct 25 19:34:03 rohan kernel: [ 198.068930] scsi 7:0:0:1: Direct-Access PQ: 0 ANSI: 3
Oct 25 19:34:03 rohan kernel: [ 198.069317] sd 7:0:0:0: Attached scsi generic sg0 type 0
Oct 25 19:34:03 rohan kernel: [ 198.069488] sd 7:0:0:1: Attached scsi generic sg1 type 0
Oct 25 19:34:03 rohan kernel: [ 198.069580] sd 7:0:0:0: [sda] 513 512-byte logical blocks: (263 kB/257 KiB)
Oct 25 19:34:03 rohan kernel: [ 198.070302] sd 7:0:0:0: [sda] Test WP failed, assume Write Enabled
Oct 25 19:34:03 rohan kernel: [ 198.070579] sd 7:0:0:1: [sdb] Attached SCSI removable disk
Oct 25 19:34:03 rohan kernel: [ 198.071006] sd 7:0:0:0: [sda] Asking for cache data failed
Oct 25 19:34:03 rohan kernel: [ 198.071008] sd 7:0:0:0: [sda] Assuming drive cache: write through
Oct 25 19:34:03 rohan kernel: [ 198.081432] sda: sda1
Oct 25 19:34:03 rohan kernel: [ 198.083084] sd 7:0:0:0: [sda] Attached SCSI removable disk
Oct 25 19:34:03 rohan systemd-udevd[3731]: message repeated 14 times: [ inotify_add_watch(9, /dev/sdb, 10) failed: No such file or directory]
gotta run for a bit
@slender iron when you get a chance, does this look right? bossac -e -w -v -R -p tty.usbmodem1411 update-bootloader.bin
yup!
yay!
Should be able to drop the uf2 you posted earlier?
Doesn't have to be now, but this can mention SAMD51
that's the one you posted around 3:40 for kattni?
yeah think so
hmm, I got a CIRCUITPY but no serial device now
hrm
it shows up with a double tap
yea, bootloader mode makes it show up but I'm assuming thats bossac compatibily?
it should support bossac and uf2 now
Ok, I was just commenting that the tty.usbmodem1411 showing up after double tap is bossac related
I just checked and copying blinky over works
yup, cdc during bootloader is for bossac
I'm assuming cdc != cult of the dead cow or center for disease control
google says communications device class. I assume that's the proper name for the usb serial
ya
any poking I can do to gather useful data?
ok
thanks for testing!
glad to help. I'm gradually getting more familar with the code thanks to your and Dan's help
@slender iron finished my review. Incredible churn without a lot that really needed to be looked at. Do you want to wait for ktown or should your or I squash and merge?
you want to keep the individual commits? ok by me to help bisecting or whatever
yeah, especially since I did the micropython merge separate from the nrf52 one
+994 commits ๐
woot!
Great job!
great googly moogly!
I'm a bit late to the party - Is the repo now up to date for current build for 3.0 and is there a new bootloader tonight?
no new bootloader, https://github.com/adafruit/uf2-samd21 has latest code for it
still getting pulls info asf4 and circuitpython
OK - just checking - looks like you made some great progress!
well done!
@tulip sleet I'm finding myself liking regular merge commits more
@slender iron how about the asf4 pull request? Do you want a merge commit there or just squash the 1?
Nice! You guys are rocking it.
crushing it!!!
@solar whale on the RPi, did you build the arm-none toolchain yourself, or did you find a prebuilt version, or did you just use the supplied compiler and it still worked for CPY compiles?
making sure it builds ๐
@tulip sleet been awhile since I built it on RPi - having trouble tonight buildiong bossac so I'm not confident in it - do you have "stretch" installed. I do and that may be part of the problem.
@solar whale - no I have ordinary packages and just downloaded the .bz2 from ARM, and will build that, probably.
waht raspian vesion are you using jessie or stretch?
I am starting with jessie only so I can have an mpy-cross that will definitely run on jessie (and will probably run also on stretch). After I build the mpy-cross I may upgrade to stretch, and rebuild or just test that it works.
Imave having problemd getting packages with stretch....
you mean they're missing from the stretch repos?
Catching up on the show...
Re the M4: CIRCUITPY has showed up, and I can manipulate the code on it, with autoreload working.
No repl, though ๐ฆ
There were a couple problems:
I had to yank my M4 outta my Pi
that PR is the last of the changes I have outstanding for today
I have no idea why, but with no serial connection running at all... just plugged in, not even in bootloader mode. CPU would rise and rise and rise until it locked up
You need to spin up another Pi something fierce.
yay @idle owl !! #latetotheparty
@umbral dagger Thanks!
ok - able to build bossac after update - there is hope for arduino! still not sure about CP build - will try that too.
Bwhahahah @idle owl
Yeah, gonna do it tomorrow. I'll download a fresh copy of NOOBS tonight though
Go team ESP32!
@slender iron thanks for all the updates! will give it a try.
@tulip pebble Welcome team ESP32!
Huh?

CircuitPython is on the ESP32 now?
@formal plover a bunch a ppl in the live chat were asking about helping with a ESP32 port
LOL... Not yet...
@formal plover Nah it's team-getting-it-on-the-ESP32
Gotcha! thanks @pastel panther
quick turn @tulip sleet !
Hhaha @tulip pebble more power to ya!!!
@slender iron this code I recognize!
๐
I'm still adjusting
for SCSI reference this PDF is good: https://www.seagate.com/files/staticfiles/support/docs/manual/Interface manuals/100293068j.pdf
I was putting up a giant vinal decal and paper flowers on a wall...
@slender iron squash and merge for this one?
I rebase if the commits make sense and squash if there are commits from feedback
I did git pull on the CP repo and got something that looked like errors, but there were so many updates that the scrollback doesn't have the errors anymore, lol. So no idea what that was.
what does git status say @idle owl ?
On branch master, up to date, a list of untracked files.
ah, the untracked files are probably build directories
all of the ports moved into ports
@tulip sleet I am able to build mpy-cross on my RPi
what is with the ports subdirectory !!!
upstream reorganized ๐
I suggested it a year ago and offered to do the work but they baulked then. Its done now though!
cool!
Are we still making the build in circuitpython/atmel-samd or is it in cp/ports/atmel-samd?
the second one
No Adafruit order in the mail today, but a bag of transisters from China.
@tulip sleet but cant build CP - need arm-none toolchain . What are you using?
ok I'm off for a while. I expect those changes improved USB but still needs work
@solar whale I haven't tried yet. But can you drop your mpy-cross here? Since it's stretch, I'll try it on jessie. Maybe checkout the 2.1.0 tag for consistency before building.
@solar whale I thought you were building circuitpython on the RPi (I thought you must be a very patient person if you were doing that.)
@tulip sleet no - I have used it for arduino but not for CP building - yet
just a sec - need to get mpy-cross to this machine
I'm building the arm-none toolchain, but it will be a while.
I've only got Pi0Ws... I don't think they can handle this stuff at all. And I keep having to remember that's totally not what you guys are running, because I keep picturing you having all of this stuff running off a tiny PI, an OTG cable and a USB hub... Which is quite wrong.
I mean that should work, right?
If we can get it as easy on a RPi as a mac, that would be sweet
@idle owl I might be able to supply you with a Pi 3
@formal plover Oh man...
@idle owl I've got one that I used for a retropie machine... Let's be honest, I won't be using that any time soon
@formal plover lol. I haven't done any dev with a Pi0W in ages... Picked up the CPX and never looked back. I have a Pi0W running my tabletop lightbox photo studio, so I ssh in, run the last command and it does it's thing. That's all I've done in so long...
@tulip sleet here is my mpy_cross for RaspberryPi Stretch
I'll reimage it with stretch. You can just VNC into it with your Mac @idle owl
@solar whale thanks very much - I'll test and upload it to the release if it works on jessie too.
@idle owl Your Pi is running a lightbox? Do you have a project page somewhere?
I have only verified that it turns a .py to a .mpy - not that the .mpy runs!
@pastel panther I don't... I keep thinking I should make one but I didn't take any in-progress photos. I made the entire thing.
@formal plover I have an DVI to HDMI adapter, an HDMI cable and a wireless keyboard/trackpad combo thing that I was using when I needed display on the Pis. I haven't used it in ages, but it's still sitting there, lol
I also have the one with the Z-wave card on it controlling... a lamp lololol
beep boop. light on, light off
This is running nearly 2m of 60LED/m dotstars. Obviously the dotstars are powered separately.
Can control like 40 devices.., and I am controlling a singular lamp lol
A friend of mine wrote a quick script to control the brightness and a few different modes, and to control the 3 panels separately. They're soldered into 3 9x9led squares.
@idle owl if you have any details you can share offline/DM that would be swell. I'm going to be making something similar with UV leds for curing resin to make custom IEMs
@pastel panther Yeah for sure! I'll try to get a few pics this week and I'll write up what I did. Won't be guide-worthy but enough to give you some ideas and at least give you some more questions to ask ๐
@idle owl awesome, thanks!
Anyone know a good place to find a selection of rubber bands? I need to hold a mold together and don't want to wait for the internet
I had it in the works for a while but I ended up finishing it much sooner so I could take the pics for the Key of Lime Learn Guide ๐
Thanks!
I'm going to try and do it with my neice once I get a CPX
the intersection of music and electronics is right up my alley
That's so great!
woohoo!! ```Adafruit CircuitPython 3.0.0-alpha.0-1030-gd613776 on 2017-10-25; Metro M4 Express with samd51j19
import led
jsut screen /dev/ttyACM0 115200 --- yes - Ubuntu 16.04
What build?
current master - just downloaded and built
@solar whale bootloader?
Did the Makefiles move or am I just...
@solar whale I thought Scott said to run make in the circuitpython/ports/atmel-samd .... Did I misunderrstand?
@idle owl taht is correct
@umbral dagger bootlaoder from last night - wioth working neopixel
I just got a boatload of fatal errors.
did you do git submodule update --init --recurstive
OK, I have the latest, workign neopixel
not again since I did git pull, I'll try it again
and it's been sitting here in bootloader mode (looking at the M4.. neopixel green) for 5 minutes or so.. and... the BOOT drive just showed up.
very important - major cahnges - do that at circuitpython/
just do it again
yse - make BOARD=xxx clean then real make
@pastel panther I think you need to download screen