Skip to content

Setup ESP-IDF

ESP-IDF is an official Espressif SDK for ESP32 development. It contains latest features and provides full access to chip functionality and configuration. Almost any ESP32 framework (like ESP32 Arduino) is based on ESP-IDF, which provides required low-level drivers.
In combination, Totemmaker provides totem-bsp (Board Support Package) for RoboBoard development using ESP-IDF. It contains required drivers to control on board features (like motor drivers).

Step 1. Setup ESP-IDF

Visit Getting Started to setup ESP-IDF toolchain.

Manual setup (click to expand)

Clone esp-idf project:

mkdir ~/esp
cd ~/esp
git clone --recursive https://github.com/espressif/esp-idf.git
cd esp-idf
Install required tools (install.ps1 for PowerShell):
./install.sh
Load esp-idf environment (export.ps1 for PowerShell):
./export.sh
Go to your project and run:
idf.py build

Step 2. Create a project

  1. Create new ESP-IDF project or use command:
    idf.py create-project roboboard_project
    
  2. Inside project create manifest file main/idf_component.yml or use command:
    idf.py create-manifest
    
  3. Add roboboard_x3 or roboboard_x4 as dependency:
## IDF Component Manager Manifest File
dependencies:
  # Include roboboard_x3 component
  roboboard_x3:
    path: roboboard_x3
    git: https://github.com/totemmaker/totem-bsp.git
## IDF Component Manager Manifest File
dependencies:
  # Include roboboard_x4 component
  roboboard_x4:
    path: roboboard_x4
    git: https://github.com/totemmaker/totem-bsp.git

RoboBoard X4

Update motor driver firmware to latest version. See driver update guide.

Step 3. Write firmware

Include totem-bsp.h header and code into project main/roboboard_project.c file:

#include "bsp/totem-bsp.h"

void app_main(void)
{
    // Initialize board
    bsp_board_init();
    // Spin motor A at 100% power
    bsp_dc_spin(BSP_PORT_A, 100);
    // Spin servo A to 500us pulse
    bsp_servo_spin(BSP_PORT_A, 500);
    // RoboBoard X4 LED on
    // bsp_board_set_led(1);
    // bsp_rgb_color(BSP_PORT_ALL, 0xFF00FF00);
}

Step 4. Build project

Build project:

idf.py build

Flash to board:

idf.py flash monitor

Step 5. Using ESP-IDF

For more information read following topics:

Code documentation:

Code examples:

Question

Visit ℹ Support page to find more information or help from our community.