ESP32 S3 Sensor PCB


I’ll fix the remaining capacitor placement and fine-pitch routing constraints, then reroute the affected connections and check the result. I’ll keep the five fixed components and board geometry unchanged, and preserve useful existing traces.
Thought for 1 min 58 sec
Thought for 13 sec
1/3 Fix capacitor placement and fine-pitch/USB routing blockers; apply routing repairs.

Fix capacitor placement and fine-pitch/USB routing blockers; apply routing repairs.

Independently check connectivity, placement and DRC after repairs.

Resolve microphone identity and C14 decoupling with verified physical facts (blocked pending microphone identification).

Thought for 21 sec
Thought for 7 sec
Awaiting 1 task
"PCB Cleanup and Routing Verification" completed.
Created a project doc

Layout Repair Resume Notes

View Document

Layout Repair Resume Notes
User approved fixing remaining PCB layout/routing blockers. This session sent a focused repair continuation to existing executor 6z. Lifecycle wait returned interrupted; a subsequent completion notification arrived, but its report has NOT been retrieved or verified because ACUs ran out. Do not assume no changes, or that repairs succeeded: retrieve persisted executor report and inspect live checks first.
Last verified state before this continuation
40 airwires, zero redundant traces and zero copper shorts; three placement errors (C6 power-stage feed and two C7 neckdown findings), eight advisory warnings. Full findings are in pcb-cleanup-and-routing-verification. Board was not fabrication ready. USB breakout was blocked by foreign copper; prior autoro...
I started the focused placement and routing repairs, but couldn’t retrieve or verify the results before execution stopped. The last verified state was 40 unrouted connections and three placement errors, so the PCB must still be treated as incomplete; I saved the continuation details in Layout Repair Resume Notes.
Execution stopped because your ACUs ran out.

Waiting for input


Firmware Getting Started (ESP-IDF)
Final GPIO mapping

Table


FunctionESP32-S3 GPIONet
Native USB Dāˆ’ / D+19 / 20USB_DN / USB_DP
IIS3DWB CS / SCK / MOSI / MISO10 / 12 / 11 / 13SPI_CS_ACC / SPI_SCK / SPI_MOSI / SPI_MISO
INMP441 BCLK / WS / SD input5 / 6 / 4I2S_BCLK / I2S_WS / I2S_DIN
Battery ADC1 (ADC1_CH0)BAT_ADC
BOOT0ESP_BOOT
RESETENESP_EN
GPIO35–37 are unavailable on the N16R8 Octal-PSRAM module. GPIO0/3/45/46 are strapping-related and are not used for runtime peripherals; GPIO0 is used only by the BOOT button.
Toolchain
  • ESP-IDF 5.1 or later.
  • idf.py set-target esp32s3
  • Enable TinyUSB/USB console as desired in menuconfig; native USB is on fixed GPIO19/20.
Minimal compilable starter
Create a normal ESP-IDF project and place this in main/main.c:

C


#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/spi_master.h"
#include "driver/i2s_std.h"
#include "esp_adc/adc_oneshot.h"
#include "esp_log.h"

#define PIN_ACC_CS 10
#define PIN_SPI_SCK 12
#define PIN_SPI_MOSI 11
#define PIN_SPI_MISO 13
#define PIN_I2S_BCLK 5
#define PIN_I2S_WS 6
#define PIN_I2S_DIN 4
#define BAT_ADC_CH ADC_CHANNEL_0

static const char *TAG = "sensor";
static spi_device_handle_t acc;
static i2s_chan_handle_t i2s_rx;
static adc_oneshot_unit_handle_t adc1;

static esp_err_t iis3dwb_read(uint8_t reg, uint8_t *value) {
    spi_transaction_t t = { .length = 16 };
    uint8_t tx[2] = { (uint8_t)(reg | 0x80), 0 }, rx[2] = {0};
    t.tx_buffer = tx; t.rx_buffer = rx;
    esp_err_t e = spi_device_transmit(acc, &t);
    if (e == ESP_OK) *value = rx[1];
    return e;
}

void app_main(void) {
    spi_bus_config_t bus = { .sclk_io_num=PIN_SPI_SCK, .mosi_io_num=PIN_SPI_MOSI,
        .miso_io_num=PIN_SPI_MISO, .quadwp_io_num=-1, .quadhd_io_num=-1 };
    ESP_ERROR_CHECK(spi_bus_initialize(SPI2_HOST, &bus, SPI_DMA_CH_AUTO));
    spi_device_interface_config_t dev = { .clock_speed_hz=10000000, .mode=3,
        .spics_io_num=PIN_ACC_CS, .queue_size=2 };
    ESP_ERROR_CHECK(spi_bus_add_device(SPI2_HOST, &dev, &acc));

    i2s_chan_config_t cc = I2S_CHANNEL_DEFAULT_CONFIG(I2S_NUM_0, I2S_ROLE_MASTER);
    ESP_ERROR_CHECK(i2s_new_channel(&cc, NULL, &i2s_rx));
    i2s_std_config_t sc = {
        .clk_cfg = I2S_STD_CLK_DEFAULT_CONFIG(48000),
        .slot_cfg = I2S_STD_PHILIPS_SLOT_DEFAULT_CONFIG(I2S_DATA_BIT_WIDTH_32BIT, I2S_SLOT_MODE_STEREO),
        .gpio_cfg = { .mclk=I2S_GPIO_UNUSED, .bclk=PIN_I2S_BCLK, .ws=PIN_I2S_WS,
                      .dout=I2S_GPIO_UNUSED, .din=PIN_I2S_DIN, .invert_flags={0} }
    };
    ESP_ERROR_CHECK(i2s_channel_init_std_mode(i2s_rx, &sc));
    ESP_ERROR_CHECK(i2s_channel_enable(i2s_rx));

    adc_oneshot_unit_init_cfg_t ac = { .unit_id=ADC_UNIT_1 };
    ESP_ERROR_CHECK(adc_oneshot_new_unit(&ac, &adc1));
    adc_oneshot_chan_cfg_t ach = { .atten=ADC_ATTEN_DB_12, .bitwidth=ADC_BITWIDTH_DEFAULT };
    ESP_ERROR_CHECK(adc_oneshot_config_channel(adc1, BAT_ADC_CH, &ach));

    uint8_t who = 0; ESP_ERROR_CHECK(iis3dwb_read(0x0F, &who));
    ESP_LOGI(TAG, "IIS3DWB WHO_AM_I=0x%02X", who);
    while (1) {
        int raw = 0; adc_oneshot_read(adc1, BAT_ADC_CH, &raw);
        // Calibrate ADC in production. Divider ratio: (1M+330k)/330k = 4.0303.
        ESP_LOGI(TAG, "battery ADC raw=%d", raw);
        vTaskDelay(pdMS_TO_TICKS(1000));
    }
}
Startup sequence
  1. Bring up USB console/logging.
  2. Initialize SPI and verify IIS3DWB WHO_AM_I (expected value from current ST driver/datasheet).
  3. Configure IIS3DWB output data rate/filter/FIFO for the vibration bandwidth needed.
  4. Start I2S at 48 kHz, 32-bit stereo frames; read the left slot because L/R is tied low. Discard the microphone startup settling interval.
  5. Initialize ADC1 and calibrate it; multiply calibrated BAT_ADC voltage by 4.0303.
Notes
  • USB Serial/JTAG or TinyUSB selection is a firmware/menuconfig choice; both use native GPIO19/20.
  • Avoid driving microphone clocks while 3.3 V is absent.
  • Add the official ST IIS3DWB register driver for production use; the starter only proves bus initialization/readback.
  • Final GPIO mapping

  • Toolchain

  • Minimal compilable starter

  • Startup sequence

  • Notes