Teensy 4.0 & 4.1

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Teensy 4.0 & 4.1

Post by Roberthh » Sat Oct 30, 2021 7:36 pm

Does it work when using sudo? Then it could be a missing udev setting. What does lsusb tell about the id's. The USB-ID is f055:9802, when running.

manitou
Posts: 73
Joined: Wed Feb 25, 2015 12:15 am

Re: Teensy 4.0 & 4.1

Post by manitou » Sat Oct 30, 2021 10:55 pm

Somewhere in the testing i tried sudo and that didn't help, and udev rules are current. As noted uploading circuitpython .hex works fine with teensy cli, and REPL works

here's what dmesg and lsusb say

Code: Select all

[261972.909658] usb 1-3.4: new high-speed USB device number 108 using xhci_hcd
[261973.010811] usb 1-3.4: New USB device found, idVendor=f055, idProduct=9802, bcdDevice= 1.00
[261973.010817] usb 1-3.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[261973.010821] usb 1-3.4: Product: Board in FS mode
[261973.010824] usb 1-3.4: Manufacturer: MicroPython
[261973.010827] usb 1-3.4: SerialNumber: 000000000000
[261973.013744] cdc_acm 1-3.4:1.0: ttyACM0: USB ACM device
 lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 108: ID f055:9802  
In the mean time, I copied my various .py tests in to mimxrt/modules/ and was able to import my tests on the 16.04 machine. Some comparison numbers at https://forum.pjrc.com/threads/59040-Ci ... post226210

still a mystery

alphaFred
Posts: 31
Joined: Wed Apr 15, 2020 6:47 pm

Re: Teensy 4.0 & 4.1

Post by alphaFred » Sun Oct 31, 2021 6:22 am

How do you connect to the serial port (115200 baud is ok) - via putty or screen etc. ?
Does it fail to establish the serial connection at all?

If you have a connection could you trie CTRL-D to issue a soft reset?

manitou
Posts: 73
Joined: Wed Feb 25, 2015 12:15 am

Re: Teensy 4.0 & 4.1

Post by manitou » Sun Oct 31, 2021 10:31 am

Yep, i tried arduino monitor, kermit, minicom, screen, ampy, mpremote, rshell @115200 baud ... they all hang. ctrl-d had no effect. no characters are echo'd, and even exiting terminal emulators required unplugging USB !

update: REPL woks on ubuntu 20.04 on another USB port. Got 18.04 workstation to work by cycling power on USB hub. Still hanging on 18.04 laptop.
Last edited by manitou on Sun Oct 31, 2021 12:03 pm, edited 1 time in total.

alphaFred
Posts: 31
Joined: Wed Apr 15, 2020 6:47 pm

Re: Teensy 4.0 & 4.1

Post by alphaFred » Sun Oct 31, 2021 11:57 am

Mhmh that is really strange.

I have Ubuntu 20.04 which is working fine for me but I mostly use my RaspberryPi which is part of my development setup. I had different OS releases running on the pi but never had any issues with the serial connection.

Shards
Posts: 39
Joined: Fri Jun 25, 2021 5:14 pm
Location: Milton Keynes, UK

Re: Teensy 4.0 & 4.1

Post by Shards » Mon Nov 01, 2021 11:37 pm

No issues with my Ubuntu 18.04 laptop. Just updated Teensy 4.1 with the latest daily build and works as expected. Can access board using pyboard, Thonny and picocom as with older builds.

rkompass
Posts: 66
Joined: Fri Sep 17, 2021 8:25 pm

Re: Teensy 4.0 & 4.1

Post by rkompass » Thu Nov 04, 2021 8:31 pm

I tried Teensy 4.1 today and it seems to be really fast:

Code: Select all

MicroPython v1.17-134-gcb99ca986 on 2021-11-03; Teensy 4.1 with MIMXRT1062DVJ6A
Pystone(1.2) time for 50000 passes = 4045 ms
This machine benchmarks at 12360 pystones/second
I assume this results from commit "mimxrt: Optimize the runtime speed" ?

Thank you for porting Micropython so well.

Raul

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Teensy 4.0 & 4.1

Post by Roberthh » Thu Nov 04, 2021 8:48 pm

Kudos go to Damien first and all the other team members for making MicroPython so well and providing all the good templates for implementation and optimization.

alphaFred
Posts: 31
Joined: Wed Apr 15, 2020 6:47 pm

Re: Teensy 4.0 & 4.1

Post by alphaFred » Thu Nov 04, 2021 8:51 pm

Hi Raul,

glad that you like the performance.
I assume this results from commit "mimxrt: Optimize the runtime speed" ?
This commit definitely increased the performance of MicroPython code on MIMXRT by placing parser, runtime, GC etc. in the tightly coupled RAM of the controller. Robert-hh did great work with that, again.

Although using in-place execution from the external flash is not too slow (in comparison) due to caching etc. it is by no means comparable to running code from the tightly coupled memory of course.

FeK9
Posts: 33
Joined: Sun Jan 20, 2019 8:19 am

Re: Teensy 4.0 & 4.1

Post by FeK9 » Wed Nov 10, 2021 10:46 am

Good day @Roberthh & @alphaFred :)

Is the onewire module for the Teensy 4.0 working..?

I've managed to get large numbers on my 128x64 sh1106 OLED, and wanted to
attach 18B20 temp sensor and show temperature on the sh1106... Unfortunately I
was unsuccessful...

The code I used comes from MicroPython Docs, and is shown below..

Code: Select all

import time
import machine
import onewire, ds18x20

# the device is on GPIO12
dat = machine.Pin(16)

# create the onewire object
ds = ds18x20.DS18X20(onewire.OneWire(dat))

# scan for devices on the bus
roms = ds.scan()
print('found devices:', roms)

# loop 10 times and print all temperatures
for i in range(5):
    print('temperatures:', end=' ')
    ds.convert_temp()
    time.sleep_ms(750)
    for rom in roms:
        print(ds.read_temp(rom), end=' ')
    print()
The output / result on REPL is shown below...

Code: Select all

MPY: soft reboot
MicroPython v1.17-135-gc9c55032d on 2021-11-05; Teensy 4.0 with MIMXRT1062DVJ6A
Type "help()" for more information.

>>> %Run -c $EDITOR_CONTENT
REPL output just hangs and no result, I have to power cycle the
Teensy to get the REPL again.

I did the same code with the stable build v1.17 dated 2021-09-02
with the same result, lockup and no output.

I then entered the individual lines of code one at a time on REPL
and it locked up with line shown below...

Code: Select all

# scan for devices on the bus
roms = ds.scan()
I also did the same code on a Pi Pico and it worked perfectly...

For interest I also tried the Teensy with Ardunio with no changing of
wiring and having a pull-up resistor of 4.7K for onewire, it worked as
expected...

Code: Select all

Dallas Temperature IC Control Library Demo
 Requesting temperatures...DONE
Temperature is: 26.25 Requesting temperatures...DONE
Temperature is: 26.25 Requesting temperatures...DONE
Temperature is: 26.25 Requesting temperatures...DONE
Temperature is: 26.25 Requesting temperatures...DONE
Temperature is: 26.25 Requesting temperatures...DONE

Post Reply