Burn bootloader.bin

There is any option to build “bootloader.bin” from Platformio using ESP32 and Arduino framework?

I will flash one ESP32 from another ESP32 based on “esp-serial-flasher” lib.
If I flash my firmware directly from platformio and then I flash firmware and partitions from the other ESP32, it works fine. But when I flash it with the bootloader.bin (bootloader_dio_40m.bin). It comes a constant bucle:

rst:0x3 (SW_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:10124
load:0x40080400,len:5828
entry 0x400806a8
ets Jul 29 2019 12:21:46

Thanks in advance.

The available bootloaders are not built from source. https://github.com/espressif/arduino-esp32/tree/master/tools/sdk/esp32/bin has the available binaries, and the code

selects which bootloader binary to use based on the current board settings. The board flash mode and flash frequency can be changed as per documentation. This will cause PlatformIO to select a different bootloader bin.

@maxgerhardt very interesting, but how to select an alternative (& custom built) bootlader ? any possibility ? does it need a hack ?