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 » Wed Oct 06, 2021 9:02 am

Probably the ENET_RESET_PIN and ENET_INT_PIN are wrong (used reset pin, GPIO_AD_B0_09, is connected to the onboard led which goes on on initialization).
That's most likely the reason. I cannot find that pin in the Pinout and Schematics as well. Once that is aligned properly, it should work.
Note: The NXP EVK boards are confusing as well, since the are different variants of the PCB under the same marketing name, and even then different assemblies.

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 » Wed Oct 06, 2021 2:23 pm

@loboris: I started to write the boards files for the ARCH_MIX board. For now, I used the following names for the pins:

J3xx for the Pins numbered xx at J3
J4xx for the Pins numbered xx at J4
J5xx for the Pins numbered xx at J5

These are not the fanciest names, but they are printed on the board. I assigned them to logical devices as well. File pack enclosed. That should work together with today's build of the mimxrt_combined branch. I expect to get my ARCH MIX board tomorrow.

I also was a little bit puzzled that the pins mention enet as well, even if there is no Enet support on board. DO you know of a daughter board by Seed offering that?
ARCH_MIX.zip

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

Re: Teensy 4.0 & 4.1

Post by loboris » Wed Oct 06, 2021 2:50 pm

Roberthh wrote:
Wed Oct 06, 2021 2:23 pm
I started to write the boards files for the ARCH_MIX board. For now, I used the following names for the pins:
Maybe you could use the names in the form Jn_XX, or you could use just Axx and Bxx and mention somewhere (README.md) A=J3, B=J4.

J5 is dedicated to LCD and using it is very hard if you don't have some kind of expansion board with 50-pin FPC konnector, maybe it is better to not add this connector at all.

External PHY can be easily added. KSZ8081 is cheap and available and designing the PCB for it should not be hard. I have some plans to do it myself, maybe next month.
I'm not aware of any existing board.

Regarding Ethernet on SomLabs board, I didn't received any answer yet, but examining the board I'm quite sure there is no connection of KSZ8081 RST & INT to the module, they are probably using the polling mode for communication (?!).
After some debugging I've found that the initialization fails at early stage, while reading the PHY ID, which should succeed even without those pins connected. There is probably some other issue to...

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 » Wed Oct 06, 2021 3:19 pm

Any name is right. It's just a csv file.
About Ethernet: I checked with my MIXRT1050 board not to use the Reset and INT pins at all. That works as well. So the Pin seem not to be required. The reset would in best case ensure that the board starts well.
You could try to change the ENET_PHY_ADDRESS in the mpconfigboard.h. It has a range from 0..3 and is configured by wiring. If that does not match, the ID cannot be read.
edit: It should not be difficult to add drivers for an DP83848 or LAN8720 devices. They all use the same standard set of commands, with just one exception.

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 » Wed Oct 06, 2021 3:23 pm

About ARCH_MIX J5. I added that to have access to the Pins by the Python code. But you can always use the CPU pin names.

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 » Wed Oct 06, 2021 3:44 pm

PHY address range is 0..7 for the KSZ8081. The default is 1.

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

Re: Teensy 4.0 & 4.1

Post by loboris » Wed Oct 06, 2021 3:51 pm

Roberthh wrote:
Wed Oct 06, 2021 3:19 pm
You could try to change the ENET_PHY_ADDRESS in the mpconfigboard.h.
It should not be difficult to add drivers for an DP83848 or LAN8720 devices. They all use the same standard set of commands, with just one exception.
The ENET_PHY_ADDRESS has to be set to 0 for SomLabs board!
Now I can initialize lan and get the IP address.

INT and RST pins are really not needed. Maybe it would be a good idea not to initialize them in eth.c (eth_init()).

If you could find some time to add LAN8720 drivers, I have a LAN8720 ETH board I've used with ESP32, I could try it with Arch Mix.

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 » Wed Oct 06, 2021 4:09 pm

That's great. I will make the Reset and int pin configurable. If they are not defined, they will not be used.
You could simply try to use the LAN8720 with the ARCH MIX. As said, the basic register set and cuse is the same for all of these PYH drivers. The addresses of the LAN8720 are 0 and 1.

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 Oct 07, 2021 11:58 am

@loboris I just received the ARCH Mix board. Just a quick question: How did you load firmware to the board. My usual approach using the Ozone Debugger failed. I can connect to the board, read flash, single step. But no write.

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

Re: Teensy 4.0 & 4.1

Post by loboris » Thu Oct 07, 2021 12:26 pm

Roberthh wrote:
Thu Oct 07, 2021 11:58 am
@loboris I just received the ARCH Mix board. Just a quick question: How did you load firmware to the board. My usual approach using the Ozone Debugger failed. I can connect to the board, read flash, single step. But no write.
I'm working on Linux.
I'm using J-link and JFlash utility to load the firmware over SWD.

Another method is to use the serial downloader (MCUXpresso Secure Provisioning Tool) and flash over USB-OTG connector.
You must prepare the board as follows:
- connect the RxD pin (J3_19) to +3.3V
- set the switches to 0-0-0-1 (the last switch to ON)
The firmware must be created without FCB, or you can hex edit the firmware.bin and delete the first 4KB from the file (up to the address 0x1000), then load it into MCUXpresso Secure Provisioning Tool (Write Image tab) and flash it.
Afrer flashing you need to remove the RxD-3.3V jumper and set the switches to 0-0-1-0

Post Reply