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: 2911
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Teensy 4.0 & 4.1

Post by Roberthh » Sat Oct 09, 2021 7:02 am

I just checked whether the serial load method is suitable for Teensy 4.x. It is not. GPIO_AD_B0_05 is tied to GND.

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

Re: Teensy 4.0 & 4.1

Post by Roberthh » Sat Oct 09, 2021 9:18 am

To enter serial download mode the pin GPIO_AD_B0_05 has to be set high, all other mode switches low.
I just tried that on the ARC MiX board using Debian Linux. Something that puzzled me when looking at the schematics is, that GPIO_AD_B0_05 is connected to the 3/6 position of the DIP switch, not the 4/5. But the 3/6 position has to be set for QSPI boot. Setting the 4/5 position allows to download the bootloader, but the schematics show them as connected to GPIO_AD_B0_04. That matches the Reference Manual.
Anyway, Serial Flash did only work, when using sudo. So I have to set the udev rules accordingly.
So, it is surely an alternative way of downloading firmware to the ARCH MIX board, if there is no J-Tag downloader at hand. For MIMXRT and Teensy boards, there is convenient flash support already provided.

loboris
Posts: 342
Joined: Fri Oct 02, 2015 6:19 pm

Re: Teensy 4.0 & 4.1

Post by loboris » Sat Oct 09, 2021 9:27 am

Roberthh wrote:
Sat Oct 09, 2021 9:18 am
I just tried that on the ARC MiX board using Debian Linux. Something that puzzled me when looking at the schematics is, that GPIO_AD_B0_05 is connected to the 3/6 position of the DIP switch, not the 4/5. But the 3/6 position has to be set for QSPI boot. Setting the 4/5 position allows to download the bootloader, but the schematics show them as connected to GPIO_AD_B0_04. That matches the Reference Manual.
Anyway, Serial Flash did only work, when using sudo. So I have to set the udev rules accordingly.
So, it is surely an alternative way of downloading firmware to the ARCH MIX board, if there is no J-Tag downloader at hand. For MIMXRT and Teensy boards, there is convenient flash support already provided.
Sorry, it was my mistake. The pin for mode[0] is GPIO_AD_B0_04 as you noticed.

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

Re: Teensy 4.0 & 4.1

Post by Roberthh » Mon Oct 11, 2021 8:31 am

@loboris I made the board files for the SOM Vision carrier board. Maybe you could try the, It contains the Pin definitions for the Arduino and RPi header. Unfortunately, no hardware SPI pins are routed to these headers. So there is not hardware SPI then. It may be better to define the SODIMM pins instead.
SOM_VISION.zip
(3.54 KiB) Downloaded 8 times

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

Re: Teensy 4.0 & 4.1

Post by Roberthh » Mon Oct 11, 2021 10:30 am

@loboris: I update pins.csv to include the S0DIMM pins as well.
SOM_VISION.zip
(19.53 KiB) Downloaded 9 times

loboris
Posts: 342
Joined: Fri Oct 02, 2015 6:19 pm

Re: Teensy 4.0 & 4.1

Post by loboris » Mon Oct 11, 2021 11:31 am

@Roberthh Thanks for the effort.
The SomLabs carrier board is not a best example of a general purpose development board, it is more oriented to demonstrate some capabilities of the module.
It is expected that the module user will develop own PCB. In that case, if using MicroPython, the new board definition needs to be created.
It is probably the best to use SODIMM pins.
I think the SPI pins on carrier board are connected to LEDS/buttons and the display connector (used as I2C)...

BTW, maybe you cold enable issues in you repo so that some things could be discussed there instead on this forum.

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

Re: Teensy 4.0 & 4.1

Post by Roberthh » Mon Oct 11, 2021 11:49 am

Issues are enabled now.

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

Re: Teensy 4.0 & 4.1

Post by Roberthh » Wed Oct 13, 2021 11:42 am

@loboris I made a PHY driver for the LAN8720 chip and tested it with a WaveShare LAN8720 board. It worked instantly (which means according to Murphy, it has nasty well hidden bugs). The connection is straightforward, with two aspects to take care of when using the Waveshare board:

- the RXER pin of the LAN8720 board is not available. Therefore the ARCH-MIX pin has to be tied to GND, preferably using a resistor. Alternatively, I could be configure that pin with an internal pull-down.
- the Waveshare board creates it own 50MHz clock. It should be possible to disable it by tying the oscillator pin 1 to GND. But that did not succeed. So I changed the code that the ARCH-MIX receives the 50MHz from the 8720 board. That's a setting in mpconfigboard.h. Not connecting the 50Mhz means, that MCU and PHY run at slightly different frequencies 49.997 vs 50.006 MHz in my case), which leads to regular transmission faults. If you use a different board or set-up which needs the 50MHz to be supplied, you have to change or erase that setting in mpconfigboard.h

Version available at the mimxrt_combined repo branch.

loboris
Posts: 342
Joined: Fri Oct 02, 2015 6:19 pm

Re: Teensy 4.0 & 4.1

Post by loboris » Wed Oct 13, 2021 11:50 am

Roberthh wrote:
Wed Oct 13, 2021 11:42 am
@loboris I made a PHY driver for the LAN8720 chip and tested it with a WaveShare LAN8720 board.
Thanks, I have the same lan board (it was used with ESP32, which has the similar issue with 50MHz clock) . I'll test it later today...

androiddrew
Posts: 13
Joined: Sat Jan 23, 2021 7:24 pm

Re: Teensy 4.0 & 4.1

Post by androiddrew » Thu Oct 14, 2021 2:40 pm

Is there support for CAN Bus in the micropython Teensy 4.x support?

Post Reply