Using ESP32 to program a SAM
Yes, you have to use a bootloader for this. This is a standard way of updating firmware after &quot;production&quot; either way if the MCU has a capabilities for bootloader (SAMD10 includes this).
Microchip actually provides a secure bootloader for SAMD10 already. Check out AN2570, they include source code &amp; documentation.
Another way might be writing your own bootloader or search for other publicly available bootloaders which will suit your needs.