Checking tennsy's capabilities

Status
Not open for further replies.

liudr

Well-known member
Hi, my background has been atmega and esp32 chips and sometimes I use Arduino IDE for small projects. I know teensy is a pretty cool family of dev boards but have never come around to try it out. I even have a 3.x board but it's probably now outdated since 4.x is much more powerful. That's what has finally brought me around to teensy.

I have a complete project based off ESP32 and ATMEGA chips but I want to achieve USB 2.0 high speed and my current hardware has no upgrade path to that. My current dev environment has an internet-of-things development framework on ESP32 with underlying RTOS. I am trying to see how I can make use of teensy to either achieve the USB 2.0 high speed capability for esp32 or replace esp32 in the project.

So I wonder, as a complete noob with teensy:
1. Is teensy dev environment only arduino IDE? I've used arduino for over a decade and I know its pros and cons. I had to strip away most of the arduino USB device code to make it usable for my project. I wonder if there is an independent c/c++ environment for teensy boards for the more serious developers.

2. Does the current teensy-arduino IDE support USB 2.0 high-speed host and device simultaneously on both the usb connector and the 5-pin header? My project requires one host port and one device port, both at high-speed, which is what the ATMEGA series lack.

3. Are there any reference designs of the teensy board 4.x available? I think the numbering is confusing so I'll just go directly to 4.x as there's very confusing comparisons I found.

4. Wishfully are there many developers spinning their own teensy 4.x compatible boards? It's got a BGA processor and that is at least 4 layer board. Just wondering if there are enough people with experience. I've been making boards with 2-layer designs but I'm a quick learner if there's any resources of designs.


Thank you and stay safe!
 
1. Is teensy dev environment only arduino IDE? I've used arduino for over a decade and I know its pros and cons. I had to strip away most of the arduino USB device code to make it usable for my project. I wonder if there is an independent c/c++ environment for teensy boards for the more serious developers.

No, you can:
1. Use a different IDE and just use Arduino to compile.
2. Paul supplies a Makefile, so you can use GCC with GNU make.
3. The core software is available, so you can adapt it to whatever build system you like. For me, I'm using a modified version of the core software with a CMake build system and a VS Code IDE.

3. Are there any reference designs of the teensy board 4.x available? I think the numbering is confusing so I'll just go directly to 4.x as there's very confusing comparisons I found.
4. Wishfully are there many developers spinning their own teensy 4.x compatible boards? It's got a BGA processor and that is at least 4 layer board. Just wondering if there are enough people with experience. I've been making boards with 2-layer designs but I'm a quick learner if there's any resources of designs.

Not yet, the bootloader chip for Teensy 4.x has not been released, so there won't be any reference designs or people designing custom 4.x boards until that happens. Tons of 3.x custom boards and reference designs though. And the Teensy 3.5 and 3.6 were BGA or LQFP chips.

Really, I wouldn't even consider the Teensy 3.6 obsolete - I keep throwing more code at it and have not hit a performance bottleneck yet.
 
For 480 Mbps USB the T_4.x is the answer over T_3.x's - for USBHost as well T_4.x works like the T_3.6 with the support it has.

On Teensy the USB support is native on chip hardware and Paul has done well to maximize the throughput at 12 or 480 Mbps, generally the T_4.x can transfer data faster than a PC can manage it.

@brtaylor notes on IDE interface and other are good - forum search will find a few used and supported IDE's and add-ons to common ones with VsCode, VisualStudio, PlatformIO ...

PJRC has not yet released a Teensy bootloader chip for T_4.x that will work with a raw 1062 processor to prep fuses and function, but that work is on his bench in some fashion pending completion. The core may work - but he is looking to extend to encrypted code on the external flash to make it secure for product usage.
 
Great! This is probably going to work. I can place Teensy 4.0 board on my board. Saves time from having to route a 4-layer board and get the skills of reflowing BGAs. I wish there's a developer's version with just headers and no USB connectors but I can try and align some pads to the bottom pads of the 4.0 board. A hard requirement for me is to run one USB 2.0 high speed host and one USB 2.0 high speed device, simultaneously. The actual transfer speed may not be much faster than full speed. The usb device is a printer so it's transfer speed is dependent upon it buffer size. On the long run it's slow because paper has to move under the print head to consume all that data.

So as I can see that currently there is one USB device port probably for programming the chip. But, can I re-purpose it as a generic device port with very basic hardware support, such as getting packets, handling control transfers etc. via interrupts?

I won't be using any class drivers, but the most basic interrupt-driven features such as writing to IN buffer and reading out of OUT buffer. I could benefit greatly if there is easy access to calls like control_transfer() for both host and device sides. Is this doable? I absolutely don't need any Arduino overhead. Give me a main.cpp and a reference manual :D

I know that teensy has no wifi built-in so I'll be using ESP32 and my existing IOT code base to handle that. ESP32 doesn't seem to have a parallel memory bus so there's probably no way to have a shared memory with DMA support to share the data. That part I'll have to figure out myself, maybe an SPI memory chip with some simple logic gate to control who gets to access it.
 
@brtaylor notes on IDE interface and other are good - forum search will find a few used and supported IDE's and add-ons to common ones with VsCode, VisualStudio, PlatformIO ...
PlatformIO is currently broken for Teensy 4.0, at least under Linux. The toolchain is missing some stuff. Would be nice if they got that fixed. It looks really nice and I want to try it with VSCode.
 
PlatformIO is currently broken for Teensy 4.0, at least under Linux. The toolchain is missing some stuff. Would be nice if they got that fixed. It looks really nice and I want to try it with VSCode.

Platformio is working great for me on macOS for Teensy 4.0 development. My recollection is that the toolchain is missing stuff for some ARM linux distributions, not sure about x86.
 
Platformio is working great for me on macOS for Teensy 4.0 development. My recollection is that the toolchain is missing stuff for some ARM linux distributions, not sure about x86.
I think you're right. It is definitely broken for ARM64.
 
OK thanks for letting me know that I can't use raspberry pi 4 as my dev system. I have a pretty good intel-based desktop for my dev work, fast and reliable. What about the USB features I asked about in my reply, any comments on that?
 
If your Raspberry Pi 4 is running the normal Raspbian or Noobs software, it's 32 bit ARM. Even though the hardware can run in 64 bit mode, the distros normally used are all still 32 bit.

To check, just run "uname -a" in a terminal. If your RPi 4 prints something like this (armv7l), you're running in 32 bit mode.

Code:
Linux raspberrypi 4.19.75-v7l+ #1270 SMP Tue Sep 24 18:51:41 BST 2019 armv7l GNU/Linux

Here is what "uname -a" on Jetson Nano prints. The "aarch64" means it really is 64 bit ARM.

Code:
Linux nano 4.9.140-tegra #1 SMP PREEMPT Wed Apr 8 18:10:49 PDT 2020 aarch64 aarch64 aarch64 GNU/Linux

Either way, the Arduino IDE and Teensyduino definitely do support both ARM 32 bit and 64 bit. ARM 64 bit may be broken on PlatformIO, but it absolutely does work with Arduino+Teensyduino. ARM64 can indeed be used, if you use Arduino/Teensyduino.
 
If your Raspberry Pi 4 is running the normal Raspbian or Noobs software, it's 32 bit ARM. Even though the hardware can run in 64 bit mode, the distros normally used are all still 32 bit.
Definitely ARM64 (using the beta.) Everything from graphics to disk I/O is substantially faster, to the point where I can run KDE, and Chromium doesn't slow down even when a web page is infested with tons of JavaScript. The RPi foundation has been resisting 64-bit for years, but the amount of performance you throw away is ridiculous. The number of bits is something of a red herring; they didn't just slap on 32 more traces. The whole architecture is massively improved. I think they will probably go into production with it next year.

The platformio issue with ARM is a problem on 32-bit (armv7l), unfortunately. It's been broken for a year, but in the last couple of days there has been some activity toward workarounds and fixes happening here: https://github.com/platformio/platform-teensy/issues/51#issuecomment-707322253
Good to know there is no reason to go back to 32-bit land. I noticed there was a lot of recent chatter, tried several work-arounds, but nothing helped.

I will tell you one thing. Once they get their toolchain fixed, I am sticking with PlatformIO. They have a unit testing system, and to me, that's the first thing necessary for any kind of professional work. For now, VS Code is fast enough, and I can use the Arduino IDE to compile.
 
Status
Not open for further replies.
Back
Top