Uploading with ftdi fails only for arduino framework

An identical esp32 arduino framework program runs if uploaded via serial, but when uploaded via ftdi, it just does software reset 0x3 repeatedly. When uploaded with ftdi, the verifications are OK, the so the IO must be OK, and the flash is being written correctly. Even disconnecting the jtag and restarting, the program just resets.

rst:0x3 (SW_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
mode:DIO, clock div:2
entry 0x400806ac
ets Jun  8 2016 00:22:57

An esf-idf program on the same board with the same debugger works fine serially or with debugger.
An esp-idf,arduino program also works fine with ftdi upload.
ONLY the ARDUINO framework alone fails.

This is a custom memory configuration for a wrover 16 MB. But I’m not sure of that is relevant.
It seems maybe these files are wrong when using the arduino framework because they are coming straight from .platformio/packages/framework-arduinoespressif32/tools/partitions:

  • bootloader_dio_40m.bin
  • partitions.bin
  • boot_app0.bin

But if I use the esp-idf they come form my project:

Shouldn’t they be custom built also?

Here is my platfromio.ini

platform = espressif32
framework = arduino
board = esp32_wrover_16M_FT2232H
monitor_speed = 115200
upload_speed = 460800
upload_port = COM6
board_build.partitions = default_16MB.csv
;debug_tool = ftdi
upload_protocol = ftdi
debug_init_break = tbreak setup

Here is my custom board config:

“build”: {
“core”: “esp32”,
“extra_flags”: “-DARDUINO_ESP32_DEV”,
“f_cpu”: “240000000L”,
“f_flash”: “40000000L”,
“flash_mode”: “dio”,
“hwids”: [
“ldscript”: “esp32_out.ld”,
“mcu”: “esp32”,
“variant”: “esp32”
“connectivity”: [
“debug”: {
“default_tool”: “ftdi”,
“onboard_tools”: [
“openocd_board”: “esp32-wrover.cfg”
“frameworks”: [
“name”: “Espressif ESP-WROVER-CUSTOM_16MB”,
“upload”: {
“flash_size”: “16MB”,
“maximum_ram_size”: 327680,
“maximum_size”: 16777216,
“protocols”: [
“require_upload_port”: true,
“speed”: 460800
“url”: “Overview | Espressif Systems”,
“vendor”: “Espressif”

No feedback on this?

Elevated to: https://github.com/platformio/platform-espressif32/issues/241

Note: It is possible to workaround this issue by using:
debug_load_cmds = preload
which confirms the issue is with the build, not the debugger itself.