[Info] Using Raspberry Pi as a development environment

User avatar
kolban
Posts: 591
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

[Info] Using Raspberry Pi as a development environment

Postby kolban » Sun Sep 25, 2016 9:34 pm

When we build solutions using the ESP32, we need a development environment on which to build those solutions. We also need some infrastructure for testing. For example if we are using I2C, SPI, UART or other protocols, we may wish to test that those are working. In the current DevKitC I have, it doesn't automatically cause the ESP32 to enter flash mode when I wish to flash. I also like to watch my serial console during development. And of course, the ESP32 needs to be powered.

With these thoughts in mind, I wondered if we could use a Raspberry Pi 3 to assist with some or all of these tasks. The result is a bread-boarded DevKitC connected to the Pi as shown in the following picture:

Image

The Pi can now control all aspects of I/O on the ESP32 ... including serial access and reboots into different modes. From there, we have a lot of choices. Here is a screen shot of a simple browser based app connecting to a Node.js server running on the Pi that is controlling boots and console output:

Image

We can also run the full compile tool-chain on Pi including the Espressif IDF. So in principle, no need for any desktop PCs. I'm working with some folks on porting software to ESP32 and those folks don't yet have ESP32s ... so now we have a "cloud hosted" environment ... and when all is said and done, they could even write their code, perform their compiles, flash to ESP32 and see the console ... all from a browser ... anywhere on the Internet.

Notes on using the Raspberry Pi as a development environment can found in a free downloadable PDF available here:

https://leanpub.com/ESP8266_ESP32

A download of a compressed tar file containing the binaries of a build of the Xtensa tool chain for the ARM processors (specifically the Raspberry Pi 3) can be downloaded here:

http://www.neilkolban.com/esp32/downloa ... elf.tar.gz

I recommend the content be extracted to the /opt directory.

A YouTube video illustrating the story is available here:

https://www.youtube.com/watch?v=jt0aaMQD1WI


*** this post contains some edits made over time ***
Last edited by kolban on Wed Dec 28, 2016 1:39 am, edited 5 times in total.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

ESP_Sprite
Posts: 500
Joined: Thu Nov 26, 2015 4:08 am

Re: Using Raspberry Pi as a development environment

Postby ESP_Sprite » Mon Sep 26, 2016 4:23 am

Sounds like a nice standalone dev environment! You may even be able to integrate a JTAG debugger in there. The Raspberry Pi GPIO can be used as a JTAG host interface that OpenOCD can control. (https://github.com/synthetos/PiOCD/wiki ... TAG-Dongle for an example). So, with four or five extra wires, you should be able to live-debug your ESP32 from the Pi as well.

User avatar
kolban
Posts: 591
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Using Raspberry Pi as a development environment

Postby kolban » Mon Sep 26, 2016 4:36 am

I'm very interested in learning more about "JTAG" which I know nothing about and will start studying that. I built the toolchain from your instructions in the IDF ... compiled without incident ... however it needed nearly 4GBytes of storage space to build and as such I had to use an NFS mount which slowed things considerably. All in all in took over 10 hours to build. The resulting toolchain is under 100MBytes which is fine. Would Espressif consider hosting a compiled build for developer download to save us having to build an ARM based toolchain ourselves? If not, in your experience, is there a place where community members like myself may upload the compiled binaries for distribution?

In these early days of ESP32 experience, I find myself concerned when I find something that doesn't work as expected. Using this ARM based environment ... I now no longer know if an issue with an ESP32 is my own coding, my mis-understanding of the APIs/environment, something not working yet in the early code drops of the ESP32 framework or ... and this would be new ... something I have introduced because I am compiling and uploading from an ARM device.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

ESP_igrr
Posts: 335
Joined: Tue Dec 01, 2015 8:37 am

Re: Using Raspberry Pi as a development environment

Postby ESP_igrr » Thu Sep 29, 2016 11:16 am

Regarding ESP32 toolchain for Linux ARM hosts: thanks for a reminder, I will add it to the list of pre-built toolchains.

Who is online

Users browsing this forum: No registered users and 2 guests