ESP32-S2fh2 flashing(configuration?) issues, getting constant resets while in bootloader

mick_dassive
Posts: 1
Joined: Mon Jul 07, 2025 11:18 am

ESP32-S2fh2 flashing(configuration?) issues, getting constant resets while in bootloader

Postby mick_dassive » Mon Jul 07, 2025 11:33 am

I’ve created a custom PCB for a purpose-built USB gamepad with the ESP32-S2 specifically the S2fh2 variant. I was unable to find a existing board configuration using this variant built into PlatformIO, so I modified an existing board.json to create a custom board with the appropriate changes. I thought that was all I needed to do to get running, unfortunately, that was not the case. All I’m getting from my chip is repeated

Code: Select all

RTC_SW_SYS_RST
resets before ever entering my sketch. When the flash is wiped I get invalid header: 0xffffffff over serial. After discussing with Copilot these symptoms don’t seem to indicate a hardware issue(I only trust Copilot so much so would appreciate some input). Also, I can get JTAG access to the core but doesnt give me any further insights. In addition, I’m very outa my depth when it comes to configuring boards and would appreciate some help.

my github repo of the project if you want a more in depth look at the project:

Code: Select all

github.com/mickdassive/drone_sim_controler
contents of bustom board file

Code: Select all

esp32-s2fh2

Code: Select all

{
  "name": "Custom ESP32-S2FH2 Board",
  "url": "https://google.com",
  "vendor": "custom",
  "build": {
    "arduino": {
      "ldscript": "esp32_out.ld"
    },
    "core": "esp32",
    "extra_flags": "-DCUSTOM_BOARD",
    "f_cpu": "240000000L",
    "f_flash": "40000000L",
    "flash_mode": "dio",
    "mcu": "esp32s2",
    "variant": "esp32s2"
  },
  "connectivity": [
    "wifi",
    "bluetooth",
    "ethernet",
    "can"
  ],
  "debug": {
    "openocd_target": "esp32s2.cfg"
  },
  "frameworks": [
    "arduino",
    "espidf"
  ],
  "upload": {
    "flash_size": "2MB",
    "maximum_ram_size": 327680,
    "maximum_size": 2097152,
    "require_upload_port": true,
    "speed": 460800
  }
}
contents of my

Code: Select all

platformio.ini

Code: Select all

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:esp32-s2]
platform = platform = https://github.com/pioarduino/platform-espressif32/releases/download/54.03.21/platform-espressif32.zip
board = esp32-s2fh2
board_upload.flash_size=2MB
framework = arduino
monitor_speed = 115200
upload_speed = 921600
build_flags = 
lib_deps = 
	adafruit/Adafruit TinyUSB Library@^3.5.0
lib_archive = false
debug_tool = jlink
error message over serial:

Code: Select all

ESP-ROM:esp32s2-rc4-20191025
Build:Oct 25 2019
rst:0x3 (RTC_SW_SYS_RST),boot:0xb (SPI_FAST_FLASH_BOOT)
Saved PC:0x4004f8e9
SPIWP:0xee
mode:DIO, clock div:2
load:0x3ffe5110,len:0x115c
load:0x4004a000,len:0x4
load:0x4004a004,len:0x8d8
load:0x4004e000,len:0x32bc
entry 0x4004a13c
E (28) flash_parts: partition 3 invalid - offset 0x150000 size 0x140000 exceeds flash chip size 0x200000
E (29) boot: Failed to verify partition table
E (31) boot: load partition table error!

Sprite
Espressif staff
Espressif staff
Posts: 10609
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32-S2fh2 flashing(configuration?) issues, getting constant resets while in bootloader

Postby Sprite » Tue Jul 08, 2025 1:31 am

Here's your issue:
E (28) flash_parts: partition 3 invalid - offset 0x150000 size 0x140000 exceeds flash chip size 0x200000
I think something in your setup assumes a default amount of flash of 4MiB and creates a partition table to go along with that - which obvs won't work when you only have 2MiB, and the bootloader catches that. Suggest you look into changing the partition table or creating a custom one that does fit your flash amount.

Who is online

Users browsing this forum: Bing [Bot] and 1 guest