Firmware Getting Started
Toolchain
Use ESP-IDF for ESP32-S3 with TinyUSB device support: idf.py set-target esp32s3, idf.py menuconfig, then idf.py build flash monitor.
Pin map
#define PIN_USB_VBUS_PRESENT_N 2 // isolated, active low
#define PIN_THERM_ADC 1
#define PIN_TRIGGER_OUT 5
#define PIN_TOF_LPN 6
#define PIN_TOF_INT 7
#define PIN_I2C_SDA 8
#define PIN_I2C_SCL 9
#define PIN_IMU_CS 10
#define PIN_SPI_MOSI 11
#define PIN_SPI_SCLK 12
#define PIN_SPI_MISO 13
#define PIN_IMU_INT1 14
#define PIN_IMU_INT2 15
#define PIN_REMOTE_IMU_CS 16
#define PIN_LED_PWM 17
#define PIN_FRAME_SYNC_IN 18
#define PIN_SYNC_SPARE 21
#define PIN_EXP38 38
#define PIN_EXP39 39
#define PIN_EXP40 40
#define PIN_STATUS_LED 41
#define PIN_UART_RX 44
#define PIN_UART_TX 43
#define PIN_LED_FAULT 47
#define PIN_EFUSE_FAULT 48
Required startup sequence
- Drive LED PWM low before configuring LEDC; the external 100 kΩ pull-down already guarantees hardware default OFF.
- Drive both IMU CS signals high before SPI initialization.
- Configure GPIO2 as a digital input without internal pull-up/down; external R44 provides the pull-up. Low means J2 host VBUS is present.
- Read eFuse fault and buck PG.
- Initialize UART0 and native USB.
- Initialize SPI and verify ICM-42688-P WHO_AM_I.
- Program ICM-42688-P interrupts explicitly. Recommended V1 setting is active-low open-drain to match R41/R42 and remote sharing. Do not leave interrupt-mode assumptions implicit.
- Initialize I2C with internal pull-ups disabled when using the official SATEL carrier.
- Toggle ToF LPn, load the official ST ULD firmware, then enable interrupts.
- Start timestamped acquisition before permitting nonzero LED duty.
USB host-presence input
gpio_config_t vbus = {
.pin_bit_mask = 1ULL << PIN_USB_VBUS_PRESENT_N,
.mode = GPIO_MODE_INPUT,
.pull_up_en = GPIO_PULLUP_DISABLE,
.pull_down_en = GPIO_PULLDOWN_DISABLE,
.intr_type = GPIO_INTR_ANYEDGE,
};
gpio_config(&vbus);
bool usb_host_present = (gpio_get_level(PIN_USB_VBUS_PRESENT_N) == 0);
GPIO2 is no longer an ADC divider input. U6 provides isolated active-low presence detection. Firmware must never infer that J2 powers the board.
IMU configuration
- On-board IMU: assert only GPIO10 low.
- Remote IMU: assert only GPIO16 low.
- Never assert both CS lines simultaneously.
- Configure INT1/INT2 active-low open-drain unless the full shared-bus configuration is deliberately changed and verified.
Peripheral notes
- Native USB remains GPIO19 D− and GPIO20 D+.
- Use ST's official VL53L5CX ULD.
- Remote-IMU and ToF SDA/SCL pins must not be driven by an independently powered peripheral while this board is off; their USBLC6 arrays can inject into unpowered 3V3.
- Expansion GPIO38/39/40 and exposed J8 rails, J7 SYNC_SPARE, and J6 EN/BOOT are unprotected short-bench-jumper interfaces only. Do not support hot-plugging or long-cable use in firmware documentation without a hardware revision.
- LED current is fixed in hardware near 250 mA; PWM changes average light output, not peak current.