Tag Archives: esp32

ESP32 – IDF Sdk with Eclipse

After configuring the IDF development environment in the previous article

ESP32 – IDF Sdk

let’s see now how to use Eclipse as IDE for code development. Instructions are available at the link

Eclipse Setup

Download the  C/C++ Eclipse  for Linux

Eclipse Download

Unpack the file and move it to /opt/

Run ecplise

Set the workspace for eclipse

eclipse-workspaceOnce the IDE is open, select File -> Import -> C / C ++ – -> Existing Code as Makefile Project

eclipse-importPress Next; on the next screen select the folder containing the Makefile of a sample project in the “Existing Code Location” field and choose CrossGcc as “Toolchain for indexer settings” as shown below

eclipse-import2Once the project is loaded, using the mouse right button on the project name, select the properties option

eclipse-project-propertiesUnder C / C ++ Build -> Envinronment add the variable

eclipse-batchAdd the IDF_PATH variable pointing to the downloaded IDF SDK in the same section

eclipse-idf-pathEdit the PATH variable and add the path to the bin folder of the cross compiler /home/sviluppo/Esp32/espressif/esp/xtensa-esp32-elf/bin

eclipse-pathAccess “C / C ++ General” -> “Preprocessor Include Paths”; choose the Providers tab and click on “CDT Cross GCC Built-in Compiler Settings”

eclipse-cross-cdtReplace $ {COMMAND}

eclipse-cross-cdt1with xtensa-esp32-elf-gcc

eclipse-cross-cdt2Choose now, always in the providers section,  “CDT GCC Build Output Parser”

eclipse-cross-cdt3and insert at the beginning of the “Compiler command pattern” xtensa-esp32-elf-

eclipse-cross-cdt4Save the configurations.

The project settings should always be made by make menuconfig in the unix shell. Access the shell and set the LED to be switched on/off  the value 2 as GPIO; this is because in our case the card is a doit whose design is illustrated in this document


Access to Example configuration

blink-configurationand set the gpio value to 2

blink-gpioSave the configuration. Go back to Eclipse and proceed with cleaning with

eclipse-clean-blinkand subsequent compilation with Project -> Build

eclipse-build-blinkTo run firmware flash from eclipse;, select the project and with the right button choose Build Targets -> Create …

eclipse-create-targetEnter flash as value in the target name field, leaving everything else as default

eclipse-create-target-flashAt this point we proceed to upload the image by double-clicking on the new flash item within the project targets

eclipse-run-flashThe settings to run the flash must be set with make menuconfig, as seen in the previous article

 

ESP32 – IDF Sdk

This article describes how to set the Espressif development environment for the ESP32.

From the link to the resources for the soc

https://www.espressif.com/en/products/hardware/esp32/resources

we access the guide for compiling the firmware on the Windows, OSX and Linux platforms

http://esp-idf.readthedocs.io/en/latest/get-started/index.html

In this article we use Linux Debian 9 as operating system, configured as described previously  here

MicroPython – Python ib embedded devices

We  use the IDF github. On Debian 9, with the user used to connect to the system, we create  the Esp32 folder under the user’s Home and  the espressif folder inside it

Install the prerequisites

Download the cross compiler

Create the esp folder and unpack the toolchain

Add the bin folder of the cross compiler to the PATH

Add the user used for the operations to the dialout group

Clone the IDF repository from  $HOME/Esp32/espressif

Add the IDF_PATH environment variable

Create the project folder under $HOME/Esp32/espressif and copy an example from di IDF examples

Run the configuration

Access Serial flasher config -> and set the connection parameters; in our case we leave the default

idf-serial_flasher-engSave the configuration and build the firmware

To upload the firmware on the device run

To upload only the application run

while to build only the application run

To run the program monitor run

hello_world-engHere are the other examples available with sdk

https://github.com/espressif/esp-idf/tree/f586f5e/examples

The following link contains the references of the IDF API

http://esp-idf.readthedocs.io/en/latest/api-reference/index.html

You can also generate documentation from the github source. Go into  ~/Esp32/espressif/esp-idf/docs/en

Install the prerequisites

Generate documentantion in html format

make-html-eng

The documentation is available under  _build / html.

In the next article we will configure Eclipse as IDE  to build our applications

ESP32 -IDF Sdk with Eclipse

 

ESP32 – Nodemcu firmware compiling

After  the compilation of the MicroPython firmware for ESP32

ESP32 – MicroPython compiling for ESP32

this article shows how to generate the Nodemcu firmware for the ESP32 MCU.

The firmware is not yet complete as the one existing for ESP8266.

The instructions can be found on the github at the link

https://github.com/nodemcu/nodemcu-firmware/tree/dev-esp32

The compilation documentation is available at the link

https://nodemcu.readthedocs.io/en/dev-esp32/en/build/

The operating system used is Debian 9 previously encountered for the esptool and Adafruit-ampy utilities

MicroPython – Python on embedded devices

Log on  with the operating system user on Debian 9, sviluppo in our case; under the home folder  create the Esp32 folder and inside this folder the  nodemcu  folder

Clone the repository

To update the cloned repository follow the description on the compilation link, i.e.

Go into  nodemcu-firmware-esp32 folder and run

nodemcu-settingsEnable the bluetooth  in Component config–>Bluetooth

nodemcu-bluetoothEnable various modules in Component config–>Nodemcu modules

nodemcu-modulesIn the flash settings we set the default values for our ESP32,  Serial flasher config->

nodemcu-flashSave the configuration and exit. To build the firmware run

At the end of the compilation the command to upload the firmware  is shown; the same operation is executed  by simply running

For informations about the partitions of the various ESP32 versions, refer to the documentation

http://api-guides/partition-tables.html

In the next article we’ll  show how to make an application using the Espressif SDK

ESP32 – IDF Sdk

ESP32 – MicroPython compiling for ESP32

We begin now a series of articles about the Espressif ESP32 MCU

ESP32 Wifi-Bluetooth Module

After having analyzed in the previous articles  MicroPython  for ESP8266, in this we start to treat MicroPython on ESP32.

The following shows how to generate the MicroPython image from the source code for the ESP32 board.

The operating system is Debian 9, previously encountered for the esptool and Adafruit-ampy utilities

MicroPython – Python on embedded devices

Log on  with the operating system user on Debian 9, sviluppo in our case; under the home folder  create the Micropython folder and inside this folder the  esp32 folder

The MicroPython source code is available at the following link

Github Micropython

Instructions to build the firmware for the ESP32 are available at the link

MicroPython esp32

Clone the repository

Go into  micropython/ports/esp32 folder

Run

The command releases the git hash for the supported espidf

At the time of our compilation the result is as follows

Go into  /home/sviluppo/Micropython/esp32 folder and clone ESPIDF

Checkout with the hash obtained above

Run

We follow the instructions at the link

Cross compiler

to install the cross compiler; install the prerequisites for building

Download the cross compiler

Create the  esp folder under /home/sviluppo/Micropython/esp32

Unpack the cross compiler in esp

Add the binary folder of the cross compiler to the PATH envinronment variable

Go into the following folder

and create the makefile file with the following code inside

Go into the micropython folder available in /home/sviluppo/Micropython/esp32

Run

to add external dependencies.

Next step is the MicroPython cross compiler build

Finally we can build the ESP32  firmware with the following commands

The firmware is generated under ports/esp32/build with the name firmware.bin.

Proceed to load the firmware with the commands

In our case, the firmware upload was successful with the command

It is also possible to load the firmware.bin image with the commands

where  /dev/ttyXXX is replaced with the actual serial port to which we connect the ESP32 board.

In the next article we’ll compile the nodemcu firmware for ESP32

ESP32 – Nodemcu firmware compiling

ESP32 Wifi-Bluetooth Module

In this article we describe briefly the ESP32  chip from Espressif

ESP32

This lower power SOC  contains a 32 bit MCU  with bluetooth and wifi modules. At the Espressif web site we can find the detailed informations about the ESP32

ESP32 Resources

The device datasheet is available in the following pdf document

ESP32 Datasheet

The ESP32 modules are available individually or in a development kits; the last system simplifies its usage as the development kit contains all the hardware to use rapidly the soc device; we are already ready to load the firmware and use the device.

On internet various web sites describe home automation or iot projects using this soc.

A reference site for the ESP32  is

esp32

At above link we can find the various development platforms utilized  for the ESP32. The most relevant  are

  • Arduino Ide

ESP32 Arduino

  • ESP-IDF

ESP32 IDF

  • Micropython

MicroPython

  • PlatformIO

PlatformIO

  • Firmware Lua

LuaNode

Lua-RTOS-ESP32

Nodemcu Development

We can buy the ESP32 modules/dev kits from various internet online websites, for example ebay

ESP32 on ebay

Different ESP32  modules are available from different vendors

Espressif esp-wroom-32

AI-Thinker esp32s

At the link

http://esp32.net/

different hardware configurations available are listed.

As development kits we report

AI-Thinker NodeMCU-32S

DoIT ESP32 Dev Kit

There are development kits based on esp32 that also integrate a LORA wireless  module internally

Lora

We report for example the following

Heltec Wifi LoRa 32

TTGO LoRa32

In the next articles we’ll describe how to build firmwares and use the ESP32 MCU.