Program esp32 from teensy

Yes. I believe that tutorial will work with Teensy in place of the Arduino Uno, but only if you have programmed your Teensy with the USBtoSerial sketch (or similar code).

In Arduino, first select Teensy from the Tools > Boards menu. Arduino's other menus update based on the selected board. Then click File > Examples > Teensy > USB_Serial > USBtoSerial. Upload that program to your Teensy. Once Teensy is running that code, I'm pretty sure you can use Teensy the same way as Arduino Uno is shown in that tutorial.

Arduino Uno has a dedicated USB to serial chip, so you don't need to upload any specific code to Uno in that tutorial. The other chip on Uno already has the needed code permanently programmed. On Teensy, there is no dedicated USB to serial chip, which is why you need to load this program onto your Teensy to make that tutorial work.
 
Yes. I believe that tutorial will work with Teensy in place of the Arduino Uno, but only if you have programmed your Teensy with the USBtoSerial sketch (or similar code).

In Arduino, first select Teensy from the Tools > Boards menu. Arduino's other menus update based on the selected board. Then click File > Examples > Teensy > USB_Serial > USBtoSerial. Upload that program to your Teensy. Once Teensy is running that code, I'm pretty sure you can use Teensy the same way as Arduino Uno is shown in that tutorial.

Arduino Uno has a dedicated USB to serial chip, so you don't need to upload any specific code to Uno in that tutorial. The other chip on Uno already has the needed code permanently programmed. On Teensy, there is no dedicated USB to serial chip, which is why you need to load this program onto your Teensy to make that tutorial work.

Thanks Paul. Very informative answer.
 
Indeed back in the days of ESP8266 T_3.2's were used to program them. Including toggling the control pins they needed.

Assuming the passthrough for programming is similar the indicated sketch or even customized should work well.
 
Hello,

I'm trying to program an ESP32-devkit1-32e using the Teensy. Of course I can use the onboard USB connector but I'm trying to test/verify for a custom PCB.

Here are my connections.

esp32-devkitc-32e-teensy4.1-programming.jpg

Code:
T4.1 | ESP32-devkitc-32e
GND | GND
3.3V | 3.3V
RX1 (0) | GPIO1 (U0TXD)
TX1 (1) | GPIO3 (U0RXD)

The devikit buttons
Code:
EN = EN
BOOT = GPIO0 (25 | BOOT)

1. Program the Teensy 4.1 with File > Examples > Teensy > USB_Serial > USBtoSerial

2. Open the ESP32 code in arduino that I'm trying to flash.

3. Set Arduino to the the COM5 Serial (Teensy 4.1) and confirmed the settings as defined from this example (although I don't have the AVR ISP Programmer, does that matter?)

arduino_settings.png

4. Run upload.

I wind up with the following error.

Code:
Arduino: 1.8.16 (Windows 10), TD: 1.55, Board: "ESP32 Dev Module, Disabled, Huge APP (3MB No OTA/1MB SPIFFS), 240MHz (WiFi/BT), QIO, 40MHz, 4MB (32Mb), 115200, None"

Sketch uses 899638 bytes (28%) of program storage space. Maximum is 3145728 bytes.

Global variables use 30116 bytes (9%) of dynamic memory, leaving 297564 bytes for local variables. Maximum is 327680 bytes.

esptool.py v3.0-dev

Serial port usb:0/140000/0/4

Traceback (most recent call last):

  File "esptool.py", line 3682, in <module>

  File "esptool.py", line 3675, in _main

  File "esptool.py", line 3329, in main

  File "esptool.py", line 263, in __init__

  File "site-packages\serial\__init__.py", line 88, in serial_for_url

  File "site-packages\serial\serialwin32.py", line 62, in open

serial.serialutil.SerialException: could not open port 'usb:0/140000/0/4': WindowsError(123, 'The filename, directory name, or volume label syntax is incorrect.')

Failed to execute script esptool

the selected serial port Failed to execute script esptool

 does not exist or your board is not connected



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

If I change the port to COM 5 (Teensy).... Then I get a timeout error. I try pressing Boot, nothing. I try EN, nothing. I try Hold boot, then EN, nothing.

Code:
Arduino: 1.8.16 (Windows 10), TD: 1.55, Board: "ESP32 Dev Module, Disabled, Huge APP (3MB No OTA/1MB SPIFFS), 240MHz (WiFi/BT), QIO, 40MHz, 4MB (32Mb), 115200, None"

Sketch uses 899638 bytes (28%) of program storage space. Maximum is 3145728 bytes.

Global variables use 30116 bytes (9%) of dynamic memory, leaving 297564 bytes for local variables. Maximum is 327680 bytes.

esptool.py v3.0-dev

Serial port COM5

Connecting........_____....._____....._____....._____....._____....._____.....____An error occurred while uploading the sketch

_



A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Does anyone have any advice on what I should try next?

Jay
 
Hi Frank B,

Thank you so much for your code example. I wanted to let you know that it is helpful and I am tinkering with this. I will report back when I have it working correctly and can confirm programming the ESP32 with the Teensy.

Jay
 
Slave ESP32 programming

Hi Frank B,

Thank you so much for your code example. I wanted to let you know that it is helpful and I am tinkering with this. I will report back when I have it working correctly and can confirm programming the ESP32 with the Teensy.

Jay

Jay, did you ever get this working with ESP32? Details?

Thanks
 
I have been programming an ESP32 via Teensy for a while now. It works fine for me but for some reason I've only ever been able to get programming to work at 115200 speed. This can be quite slow. I basically used the Espressif example code for how to flash an ESP32 from another MCU. I had to modify things as I am doing the update from an sdcard attached to a Teensy MM via my custom board. But, it does operate and I've flashed the ESP32 several times without any problems at all.

If you want to take a look the code is here: https://github.com/collin80/GEVCU7/tree/main/src/devices/esp32

Bonus points if anyone can tell me why switching baud rates causes the firmware update to fail.
 
Back
Top