Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

CircuitPython 2.0.0 Beta 1 - Storage & SD Cards Oh My!
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

CircuitPython 2.0.0 Beta 1 - Storage & SD Cards Oh My!

by tannewt on Mon Aug 07, 2017 8:44 pm

From the GitHub release page:

Woohoo! After our first stable release with 1.0.0 we're back to breaking things while we improve them. DO NOT use this release if all you want to do is try CircuitPython. 1.0.0 is much better for playing around.

However, 2.0.0 is shaping up to have some awesome new features. Here is a short list:


Moving from 1.0.0 to 2.0.0 is not a perfect process. There are a few things that break when doing so.

  • mpy files compatible with 1.0.0 are NOT compatible with 2.0.0 because MicroPython changed the format. A beta bundle is available here. (Its built by changing the branch of circuitpython in the bundle repo before building it.)
  • uos is replaced by os, storage and multiterminal
  • urandom is replaced by random

This release is based on MicroPython 1.9.1. Support upstream MicroPython by purchasing a PyBoard (from Adafruit here).

Exhaustive change list since 1.0.0.

Have a Feather M0 Express, Metro M0 Express, Gemma M0 or Circuit Playground Express? Download a .uf2 and follow these instructions. To install our libraries simply download this beta bundle and copy the lib folder onto your CIRCUITPY drive.

To install on legacy boards, download a .bin file and follow the guide here for M0 and here for ESP8266.

tannewt
 
Posts: 1853
Joined: Thu Oct 06, 2016 8:48 pm

Re: CircuitPython 2.0.0 Beta 1 - Storage & SD Cards Oh My!

by zencuke2 on Thu Aug 10, 2017 6:31 pm

This is exciting. I've been watching the external disk feature on other platforms. Will this allow loading more libraries on controllers that are currently limited in disk space, like basically everything except the M0 Express? If so that expands the list of devices that can run useful circuitPython code. Add an SD card to M0 basic and it becomes a great MicroPython machine? If true that would be thrilling. I've basically given up on MicroPython waiting for better hardware even though I'm a Python fanatic. I could only run basic things.

Now if you could magically come up with more user space RAM....

Thanks

zencuke2
 
Posts: 236
Joined: Sun Feb 15, 2015 2:40 pm

Re: CircuitPython 2.0.0 Beta 1 - Storage & SD Cards Oh My!

by tannewt on Thu Aug 10, 2017 8:06 pm

zencuke2 wrote:This is exciting. I've been watching the external disk feature on other platforms. Will this allow loading more libraries on controllers that are currently limited in disk space, like basically everything except the M0 Express? If so that expands the list of devices that can run useful circuitPython code. Add an SD card to M0 basic and it becomes a great MicroPython machine? If true that would be thrilling. I've basically given up on MicroPython waiting for better hardware even though I'm a Python fanatic. I could only run basic things.

Now if you could magically come up with more user space RAM....

Thanks


I haven't actually tried loading modules from an SD card but I believe it should work. I did test that you can fit enough code on the tiny disk to store the SD card libraries. :-)

Dan did actually increase the heap size from 16k to 20k so it'd be worth trying it again. It decreases the stack size limit but its unlikely we'd hit it anyway.

Much of these troubles will go away once we've got the M4 going. :-) They have 192k - 256k RAM!

tannewt
 
Posts: 1853
Joined: Thu Oct 06, 2016 8:48 pm

Re: CircuitPython 2.0.0 Beta 1 - Storage & SD Cards Oh My!

by zencuke2 on Fri Aug 11, 2017 3:06 pm

tannewt2 wrote: I did test that you can fit enough code on the tiny disk to store the SD card libraries. :-)

Good thought. ;-) That would have been embarrassing.

tannewt2 wrote:Much of these troubles will go away once we've got the M4 going. :-) They have 192k - 256k RAM!

M4? Great news or rumor or whatever. Would "192k - 256k" mean they are considering the MK64 or MK66 parts? Maybe even hardware FPU? The future keeps looking better and better. Speaking of M4 I've considered the Teensy 3.5 or 3.6 with the "Teensy 3.x Feather Adapter" but I've avoided it so far because I prefer staying inside the Adafruit software ecosystem. You guys test cross compatibility a lot which I appreciate.

I guess I'm spoiled though. I cut my teeth writing real time software on a board with a 68000 and 1MB DRAM which we upgraded to 4MB before shipping it. 30+ years later I just bought my MacBook Pro maxed out with 16 gig of ram and was annoyed that's all they support. Worrying about 32k of ram here or there seems like such small potatoes. Of course we sold that 68000 board in a $50,000 high end FTIR spectrometer. Now I can buy all the Feathers I want with pocket change. I should stop whining. ;-)

-steve

zencuke2
 
Posts: 236
Joined: Sun Feb 15, 2015 2:40 pm

Re: CircuitPython 2.0.0 Beta 1 - Storage & SD Cards Oh My!

by tannewt on Fri Aug 11, 2017 3:31 pm

Nope, its the bigger sibling of the SAMD21 called the SAMD51. More info here.

MicroPython has support for the Teensys. I would be happy to help you add support for them. One of my goals with 3.0 is making porting easier along with adding support for the SAMD51.

(I assume) I'm a little younger and actually learned programming first with PHP for the web. I've obviously circled back to smaller, simpler systems like the Cortex M0+ and really love it. It feels so much better being closer to the hardware. :-)

One exciting thing in this space is that Moore's law still basically applies. The SAMD21 is 48mhz and the 51 is 120mhz. :-) I think we'll keep seeing clock speeds increase as cost drops on the manufacturing tech.

tannewt
 
Posts: 1853
Joined: Thu Oct 06, 2016 8:48 pm

Re: CircuitPython 2.0.0 Beta 1 - Storage & SD Cards Oh My!

by zencuke2 on Sun Aug 13, 2017 10:29 am

Wow! From a web jock to bringing up kernels. I'm impressed! I used to have two definitions for embedded programmers.

1) Someone who knows what to do with a power on/reset vector.
2) Someone that realizes that the values of initialized globals are not actually ordained by God, that someone has to write code put the values in ram.

I'm hoping that porting the microPython kernel itself to a new cpu is simple, wrapped in a simple .asm file jumped to by the reset vector which initializes the initial stack, clears bss, initializes cache, copies global data from flash to ram and jumps to portable C++ initialization ( mostly call constructors for the static/global classes) and then finally calls main. Most of this is probably available from Arduino startup or maybe even from the vendor . Once the debug environment is set up (JTAG? gdb?) this should only take a couple of days. I'm assuming the hard part is dealing with the custom pins, especially trying to create a wrapper that makes them look like all the other ports so the next layer (porting hardware libraries) is almost free.

What I'd like to see is a microPython port to the Raspberry Pi. I can't fathom why it hasn't been done already. It seems like an obvious microPython platform, especially the WiFi Zero. Shouldn't be hard. All the tricky stuff can be stolen from Linux.

zencuke2
 
Posts: 236
Joined: Sun Feb 15, 2015 2:40 pm

Re: CircuitPython 2.0.0 Beta 1 - Storage & SD Cards Oh My!

by zencuke2 on Sun Aug 13, 2017 10:48 am

What does your development environment look like? I was just staring at one of my Huzzah32 boards trying to imagine where a debug header would go. Will the M4 boards be available initially as early prototypes?

zencuke2
 
Posts: 236
Joined: Sun Feb 15, 2015 2:40 pm

Re: CircuitPython 2.0.0 Beta 1 - Storage & SD Cards Oh My!

by tannewt on Sun Aug 13, 2017 1:15 pm

Getting to the point of being able to do math in the REPL isn't too hard. The hardest part is probably getting the USB connection going.

Once you do that though, getting the peripherals going is a bunch more work. In CircuitPython we have a clear C API underneath the python APIs that makes that side of things relatively easy.

My plan for Raspberry Pi was using CPython with a compatible API on top of it. I believe someone has tried doing it bare metal but I can't remember where I saw it.

I use GCC and GDB to compile and debug on the Metro M0 Express. Most other boards I do printf debugging. The ESP boards have a RTOS that can manage the printing.

MicroPython's ESP32 port is here: https://github.com/micropython/micropython-esp32

Our M4s will probably be released as Developer Editions first but its up to @ladyada. Availability depends on when we get chips from MicroChip.

Cheers,
Scott

tannewt
 
Posts: 1853
Joined: Thu Oct 06, 2016 8:48 pm

Re: CircuitPython 2.0.0 Beta 1 - Storage & SD Cards Oh My!

by zencuke2 on Mon Aug 21, 2017 10:18 am

Thanks again. I just found https://learn.adafruit.com/debugging-th ... 1-with-gdb so I don't have to ask you that question. ;-) However that tutorial mysteriously skips a key piece of information. It doesn't actually mention that you need a Jlink, or provide links to the Jlink versions that Adafruit sells. It is sort of a key part of the communication chain and so a strange thing to skip. I submitted feedback suggestion that the tutorial be updated.

I assume you debug on the metro because it has a header for the debug interface and the feather does not.

I should look at the board layout but do you happen to know if the ESP32 debug pins on the Feather are exposed so a careful surgeon could solder fine wires to them? There's obviously no room for pogo pins to connect.

zencuke2
 
Posts: 236
Joined: Sun Feb 15, 2015 2:40 pm

Re: CircuitPython 2.0.0 Beta 1 - Storage & SD Cards Oh My!

by tannewt on Mon Aug 21, 2017 2:50 pm

Thanks for the feedback! I'll take look at it now. The JLinks should have been linked to on the right hand side at least.

You are correct that I use the metro because its got the debug header. The boards are so similar that I can usually debug things on the metro and then the fix just works on the feather.

I've never done GDB debugging with the ESP32 so I can't help you there.

tannewt
 
Posts: 1853
Joined: Thu Oct 06, 2016 8:48 pm

Please be positive and constructive with your questions and comments.