Products > Embedded Computing

Programming an ESP32 from Raspberry Pi

<< < (2/2)

HwAoRrDk:

--- Quote from: djacobow on July 24, 2022, 03:06:48 am ---If the serial pins on the RPi GPIO header are not sufficient (I believe the main 40pin header only has tx and rx), you can always plug in an FTDI or other serial adapter cable into the RPi's USB port, and you'll get a complete serial port with all the extra signals. That will almost certainly work fine.

--- End quote ---

That was my first idea, which obviously should be the most straightforward solution. But then I thought "hang on, the GPIO header has a UART on it".

JTAG is out, as that's not present on the target board.

HwAoRrDk:

--- Quote from: langwadt on July 24, 2022, 03:32:23 am ---with a gpio available it should be possible to make a minor change to: https://github.com/espressif/esptool/blob/master/esptool/loader.py

--- End quote ---

Hmm, yes, I guess one could alter _setDTR and _setRTS methods there to toggle GPIOs instead, but I'd prefer not to get into maintaining custom versions of utilities if I can help it.

eugene:

--- Quote from: langwadt on July 24, 2022, 03:32:23 am ---
--- Quote from: djacobow on July 24, 2022, 03:06:48 am ---If the serial pins on the RPi GPIO header are not sufficient (I believe the main 40pin header only has tx and rx), you can always plug in an FTDI or other serial adapter cable into the RPi's USB port, and you'll get a complete serial port with all the extra signals. That will almost certainly work fine.

An alternative that you might investigate is JTAG programming. There is a branch of OpenOCD that works with ESP32, so you should be able to use it to JTAG program (and debug!). If you build it on the Raspberry Pi and use "LinuxGPIO" adapter, you can choose whichever GPIO pins are convenient for you and I bet it will work. I do exactly this for Cypress PSoC and it works surprisingly well.

--- End quote ---

with a gpio available it should be possible to make a minor change to: https://github.com/espressif/esptool/blob/master/esptool/loader.py

--- End quote ---

esptool uses the UART on a Raspberry Pi and can be used to program ESP32. There are a few tutorials online. No reason to reinvent the wheel.

langwadt:

--- Quote from: eugene on July 25, 2022, 05:36:31 pm ---
--- Quote from: langwadt on July 24, 2022, 03:32:23 am ---
--- Quote from: djacobow on July 24, 2022, 03:06:48 am ---If the serial pins on the RPi GPIO header are not sufficient (I believe the main 40pin header only has tx and rx), you can always plug in an FTDI or other serial adapter cable into the RPi's USB port, and you'll get a complete serial port with all the extra signals. That will almost certainly work fine.

An alternative that you might investigate is JTAG programming. There is a branch of OpenOCD that works with ESP32, so you should be able to use it to JTAG program (and debug!). If you build it on the Raspberry Pi and use "LinuxGPIO" adapter, you can choose whichever GPIO pins are convenient for you and I bet it will work. I do exactly this for Cypress PSoC and it works surprisingly well.

--- End quote ---

with a gpio available it should be possible to make a minor change to: https://github.com/espressif/esptool/blob/master/esptool/loader.py

--- End quote ---

esptool uses the UART on a Raspberry Pi and can be used to program ESP32. There are a few tutorials online. No reason to reinvent the wheel.

--- End quote ---

sure it has a uart so it can be used to program, but can it also automatically reset and control IO0 to enter the bootloader?

eugene:

--- Quote from: langwadt on July 25, 2022, 06:56:45 pm ---sure it has a uart so it can be used to program, but can it also automatically reset and control IO0 to enter the bootloader?

--- End quote ---

If you say it doesn't, then I believe you. Does it not run on RPi? The developers sure make it sound like it should access the bootloader.

Navigation

[0] Message Index

[*] Previous page

There was an error while thanking
Thanking...
Go to full version