Teensy 4.0 & 4.1
- rcolistete
- Posts: 352
- Joined: Thu Dec 31, 2015 3:12 pm
- Location: Brazil
- Contact:
Re: Teensy 4.0
@Roberthh : there are many differences between CircuitPython x MicroPython :
https://circuitpython.readthedocs.io/en ... icropython
AFAIK, even v5.0.0 doesn't have interrupts and deepsleep, so I can't use CircuitPython in many projects.
And some features are simplified, e. g., "analogio.AnalogIn(pin)" doesn't allow to configure the ADC of each board (resolution, gain, etc).
https://circuitpython.readthedocs.io/en ... icropython
AFAIK, even v5.0.0 doesn't have interrupts and deepsleep, so I can't use CircuitPython in many projects.
And some features are simplified, e. g., "analogio.AnalogIn(pin)" doesn't allow to configure the ADC of each board (resolution, gain, etc).
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).
Re: Teensy 4.0
Yes. I gave it a short test. The core features seem to be there. I could run upysh and easily adapt the pye() Editor.
But with other test it simply stalls, like entering microcontroller.cpu.temperature
But they have added some functionality to disable concurrent access by the host and the module to the file system. No example yet how to disable host file access and keep USB REPL.
But with other test it simply stalls, like entering microcontroller.cpu.temperature
But they have added some functionality to disable concurrent access by the host and the module to the file system. No example yet how to disable host file access and keep USB REPL.
- rcolistete
- Posts: 352
- Joined: Thu Dec 31, 2015 3:12 pm
- Location: Brazil
- Contact:
Re: Teensy 4.0
Bugs so far :
- CircuitPython halts after :
Also pointed by @Roberthh;
- REPL disconnects after pasting more than approx. 4 lines in paste mode (CTRL+E). I have to disconnect from the USB port and connect to REPL work again.
- CircuitPython halts after :
Code: Select all
import microcontroller
microcontroller.cpu.temperature
- REPL disconnects after pasting more than approx. 4 lines in paste mode (CTRL+E). I have to disconnect from the USB port and connect to REPL work again.
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Teensy 4.0
Indeed, I was amazed how many. I understand what they are trying to do: make the driver easily used by absolute beginners. In consequence the code is hard to follow and performance is sacrificed. Porting drivers from C is often simpler than porting them from CP.
I guess it's a matter of coding style but I assume drivers will be used by experimenters and aim to make their operation understandable.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
- rcolistete
- Posts: 352
- Joined: Thu Dec 31, 2015 3:12 pm
- Location: Brazil
- Contact:
Re: Teensy 4.0
One new issue :rcolistete wrote: ↑Mon Jan 13, 2020 4:54 pmBugs so far :
- CircuitPython halts after :Also pointed by @Roberthh;Code: Select all
import microcontroller microcontroller.cpu.temperature
- REPL disconnects after pasting more than approx. 4 lines in paste mode (CTRL+E). I have to disconnect from the USB port and connect to REPL work again.
- ampy doesn't work with Teensy 4.0 #2516.
Neither 'mpfshell' and 'rshell', but they aren't compatible with CircuitPython boards. Ampy is from Adafruit and should work with all CircuitPython boards.
Mu Editor in CircuitPython mode works with Teensy 4.0.
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).
Re: Teensy 4.0
I implemented the start of a basic port of MicroPython to the Teensy 4.0 -- PR at https://github.com/micropython/micropython/pull/5558
It's at the same level as the SAMD port in functionality (REPL over USB VCP), but it should be very straightforward to add basic Pin support.
One thing I noticed straight off the bat... as expected, this chip (the i.MX RT 1062) is _fast_. Power consumption is pretty low too, and it's very fast to flash firmware onto thanks to the way the loader works.
It's at the same level as the SAMD port in functionality (REPL over USB VCP), but it should be very straightforward to add basic Pin support.
One thing I noticed straight off the bat... as expected, this chip (the i.MX RT 1062) is _fast_. Power consumption is pretty low too, and it's very fast to flash firmware onto thanks to the way the loader works.
- rcolistete
- Posts: 352
- Joined: Thu Dec 31, 2015 3:12 pm
- Location: Brazil
- Contact:
Re: Teensy 4.0
Thanks a lot ! Great to see MicroPython, as well as CircuitPython, on Teensy 4.0.jimmo wrote: ↑Thu Jan 23, 2020 1:54 amI implemented the start of a basic port of MicroPython to the Teensy 4.0 -- PR at https://github.com/micropython/micropython/pull/5558
My 1st test :
Code: Select all
MicroPython v1.9.3-2582-g691ce3dd5 on 2020-01-24; Teensy 4.0 with MIMXRT1062DVJ6A
>>> import gc
>>> gc.collect()
>>> gc.mem_free()
774000
Code: Select all
$ git clone -b teensy40 --recurse-submodules https://github.com/jimmo/micropython.git
$ cd micropython/mpy-cross
$ make -j 4
$ ./mpy-cross --version # MicroPython v1.9.3-2582-g691ce3dd5 on 2020-01-24; mpy-cross emitting mpy v5
$ cd ../ports/mimxrt
$ make -j 4 submodules
$ make BOARD=TEENSY40 clean
$ make -j 4 BOARD=TEENSY40
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).
Re: Teensy 4.0
OK, i built and uploaded the micropython to my Teensy4 and got a /dev/ttyACM0 REPL. But no "pop up" USB drive ... is there a way import .py files ? rebuild with the .py files in some special folder or ?
I've got some comparative numbers of micropython and circuitpython on a few different MCUs, see
https://forum.pjrc.com/threads/59040-Ci ... post226210
I've got some comparative numbers of micropython and circuitpython on a few different MCUs, see
https://forum.pjrc.com/threads/59040-Ci ... post226210
Re: Teensy 4.0
Not yet -- this is currently just the minimum possible port and doesn't have an onboard filesystem. I just wanted to get the skeleton in place so that other people can start adding drivers.
A block device driver for the flash memory is required, (as well as enabling USB MSC in tinyusb, which is fairly straightforward).
The best option for now would be to add support for frozen python code (via the manifest system), which would be a relatively small change to the Makefile (copy from STM32).
Re: Teensy 4.0
I'm curious about any progress of MicroPython for the Teensy 4.0.....
Did a performance comparison with MicroPython on an ESP32 and CircuitPython on a Teensy 4.0 with (to me) surprising results.
So when the differences in hardware features between ESP32 and Teensy 4.0 are not of immediate importance - but Python is - then an ESP32 is "good enough'. But looking at the potential of the Teensy 4.0 MicroPython might blow away the ESP32 (apart from Wifi!).
Looking forward....
Regards, Rob.
Did a performance comparison with MicroPython on an ESP32 and CircuitPython on a Teensy 4.0 with (to me) surprising results.
Code: Select all
pystone_lowmem.py: ESP32 1057 pystones/sec
pystone_lowmem_monotonic.py: Teensy 4.0 1087 pystones/sec
Looking forward....
Regards, Rob.