Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions application/edge_agent/boards/espressif/esp_sparkbot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# ESP32-S3 SparkBot

## Hardware Overview

| Feature | Specification |
|---------------|-------------------------------------------------|
| Chip | ESP32-S3 |
| Flash | 16MB DIO 80MHz |
| PSRAM | Octal 80MHz |
| Display | ST7789 1.3" 240x240 SPI |
| Camera | OV3660 DVP (SCCB 0x3C, chip id 0x3660) |
| IMU | BMI270 (I2C, addr 0x68) |
| Audio Input | Internal ADC over I2S (mono 16 kHz) |
| Audio Output | I2S DAC out (codec `none`, DAC-only path) |
| Backlight | LEDC PWM (GPIO46, active high) |
| Status LED | GPIO3 |

## GPIO Mapping

| Function | GPIO |
|---------------------------|------|
| I2C SDA (shared) | 4 |
| I2C SCL (shared) | 5 |
| SPI MOSI (LCD) | 47 |
| SPI SCLK (LCD) | 21 |
| LCD CS | 44 |
| LCD DC | 43 |
| LCD Backlight (LEDC) | 46 |
| I2S MCLK | 45 |
| I2S BCLK | 39 |
| I2S WS | 41 |
| I2S DOUT | 42 |
| I2S DIN | 40 |
| Camera XCLK (LEDC, 20MHz) | 15 |
| Camera PCLK | 13 |
| Camera VSYNC | 6 |
| Camera HREF/DE | 7 |
| Camera D0..D7 | 11, 9, 8, 10, 12, 18, 17, 16 |
| Status LED | 3 |

## Camera Notes

SparkBot ships with an OV3660 DVP sensor on the shared I2C bus (port 0, SDA=4, SCL=5).
Its SCCB responds at 7-bit address `0x3C` and reports chip ID `0x3660` at registers
`0x300A / 0x300B`. The DVP XCLK is generated by LEDC at 20 MHz before `esp_video_init`
runs, to match the sensor's required clock. The default capture format is
`YUV422 (YUYV) 640x480 @ 10fps`; see `sdkconfig.defaults.board` to change it.

`PWDN` and `RESET` are tied on the sensor module (not connected to any ESP32-S3 GPIO),
so they are set to `-1` in `board_devices.yaml`.

If a SparkBot unit ships with a different sensor (older batches used OV2640 at
SCCB `0x30` with XCLK 16 MHz), you can confirm the installed sensor with a quick
I2C scan from the Lua REPL before adjusting `CONFIG_CAMERA_*` and `xclk_freq`.

## Build & Flash

```bash
cd application/edge_agent

# Set target chip
idf.py set-target esp32s3

# Generate board configuration
idf.py bmgr --customer-path ./boards -b esp_sparkbot

# Build
idf.py build

# Flash (replace with your actual serial port)
idf.py -p /dev/cu.usbmodem2101 flash

# Monitor logs
idf.py -p /dev/cu.usbmodem2101 monitor
```

## Partition Table

Uses `partitions_16MB.csv` for the 16MB flash layout.

## Files

| File | Description |
|-------------------------------|-------------------------------------------------------|
| `board_info.yaml` | Board identity (chip, manufacturer) |
| `board_peripherals.yaml` | Peripheral pin and bus configuration |
| `board_devices.yaml` | Device driver configuration (LCD, audio, IMU, camera) |
| `sdkconfig.defaults.board` | Board-level sdkconfig defaults |
| `setup_device.c` | Display panel factory entry (ST7789) |
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
version: 1.0.0
# Devices Configuration for ESP32-S3 SparkBot

devices:
- name: display_lcd
chip: st7789
type: display_lcd
sub_type: spi
version: default
config:
mirror_x: false
mirror_y: false
swap_xy: false
invert_color: true
x_max: 240
y_max: 240
io_spi_config:
cs_gpio_num: 44
dc_gpio_num: 43
spi_mode: 0
pclk_hz: 40000000
lcd_panel_config:
reset_gpio_num: -1
data_endian: LCD_RGB_DATA_ENDIAN_BIG
vendor_config: NULL
peripherals:
- name: spi_display

- name: lcd_brightness
type: ledc_ctrl
version: default
peripherals:
- name: ledc_backlight

- name: audio_dac
chip: none
type: audio_codec
version: default
init_skip: true
config:
adc_enabled: false
dac_enabled: true
peripherals:
- name: i2s_audio_out

- name: audio_adc
chip: internal
type: audio_codec
version: default
config:
adc_enabled: true
dac_enabled: false
adc_max_channel: 1
adc_channel_mask: "1"
adc_init_gain: 0
peripherals:
- name: i2s_audio_in

- name: imu_sensor
chip: bmi270
type: custom
version: 1.0.0
init_skip: true
config:
i2c_addr: 0x68
frequency: 400000
int_gpio_num: -1
sdo_gpio_num: -1
peripherals:
- name: i2c_master

- name: camera
type: camera
sub_type: dvp
version: default
config:
dvp_config:
reset_io: -1
pwdn_io: -1
vsync_io: 6
de_io: 7
pclk_io: 13
xclk_io: 15
xclk_freq: 20000000
data_width: CAM_CTLR_DATA_WIDTH_8
data_io:
data_io_0: 11
data_io_1: 9
data_io_2: 8
data_io_3: 10
data_io_4: 12
data_io_5: 18
data_io_6: 17
data_io_7: 16
data_io_8: -1
data_io_9: -1
data_io_10: -1
data_io_11: -1
data_io_12: -1
data_io_13: -1
data_io_14: -1
data_io_15: -1
peripherals:
- name: i2c_master
frequency: 100000

- name: status_led
chip: gpio_led
type: custom
version: 1.0.0
init_skip: true
config:
gpio_num: 3
active_level: 1
peripherals:
- name: gpio_led
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
board: esp_sparkbot
chip: esp32s3
version: 1.0.0
description: "ESP32-S3 SparkBot"
manufacturer: "ESPRESSIF"
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
version: 1.0.0
# Peripherals Configuration for ESP32-S3 SparkBot

peripherals:
- name: i2c_master
type: i2c
role: master
config:
port: 0
pins:
sda: 4
scl: 5

# SparkBot LCD: 1.3" ST7789, 240x240, SPI3.
- name: spi_display
type: spi
role: master
config:
spi_bus_config:
spi_port: SPI3_HOST
data0_io_num: 47
sclk_io_num: 21
max_transfer_sz: 115200

# LCD backlight: GPIO46, active high.
- name: ledc_backlight
type: ledc
role: none
config:
gpio_num: 46
freq_hz: 5000
duty: 0
duty_resolution: LEDC_TIMER_10_BIT
output_invert: false

# SparkBot audio codec wiring from bsp_extra.
- name: i2s_audio_out
type: i2s
role: master
format: std-out
config: &i2s0_config
port: 0
sample_rate_hz: 16000
clk_src: I2S_CLK_SRC_DEFAULT
mclk_multiple: 256
data_bit_width: 16
slot_bit_width: I2S_SLOT_BIT_WIDTH_AUTO
slot_mode: I2S_SLOT_MODE_MONO
slot_mask: I2S_STD_SLOT_LEFT
ws_width: 16
pins:
mclk: 45
bclk: 39
ws: 41
dout: 42
din: 40

- name: i2s_audio_in
type: i2s
role: master
format: std-in
config: *i2s0_config

- name: gpio_led
type: gpio
role: io
config:
pin: 3
mode: GPIO_MODE_OUTPUT
default_level: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
CONFIG_ESPTOOLPY_FLASHMODE_DIO=y
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_16MB.csv"

CONFIG_SPIRAM=y
CONFIG_SPIRAM_MODE_OCT=y
CONFIG_SPIRAM_SPEED_80M=y

# USB: Serial JTAG
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG_ENABLED=y
CONFIG_ESP_CONSOLE_SECONDARY_NONE=y
CONFIG_ESP_CONSOLE_UART_NUM=-1

CONFIG_ESP_BOARD_PERIPH_I2S_SUPPORT=y
CONFIG_CODEC_DUMMY_SUPPORT=y
CONFIG_CODEC_DATA_ADC_SUPPORT=y
CONFIG_APP_CLAW_LUA_MODULE_LCD=y
CONFIG_APP_CLAW_LUA_MODULE_IMU=y
CONFIG_LUA_MODULE_IMU_CHIP_BMI270=y

# Camera: OV3660 over DVP (SCCB 0x3C, chip id 0x3660, XCLK 20 MHz)
CONFIG_ESP_BOARD_DEV_CAMERA_SUPPORT=y
CONFIG_ESP_VIDEO_ENABLE_DVP_VIDEO_DEVICE=y
CONFIG_CAMERA_OV3660=y
CONFIG_CAMERA_OV3660_AUTO_DETECT_DVP_INTERFACE_SENSOR=y
CONFIG_CAMERA_OV3660_DVP_YUV422_YUYV_640X480_10FPS=y
CONFIG_CAMERA_OV3660_DVP_DEFAULT_FMT_YUV422_YUYV_640X480_10FPS=y
CONFIG_APP_CLAW_LUA_MODULE_CAMERA=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "esp_lcd_panel_st7789.h"

esp_err_t lcd_panel_factory_entry_t(esp_lcd_panel_io_handle_t io,
const esp_lcd_panel_dev_config_t *panel_dev_config,
esp_lcd_panel_handle_t *ret_panel)
{
return esp_lcd_new_panel_st7789(io, panel_dev_config, ret_panel);
}