After building the bootloader, it can be flashed to the device Over-the-Air using Particle CLI.
particle flash <devicename> bootloader.bin
This takes care of unlocking the protected memory regions, flashing the bootloader, and reprotecting the memory regions.
-
ensure that the environment variable
OPENOCD_HOME
points to the directory containing OpenOCD on your computer. -
connect the programmer shield and start a telnet session on port 3333 as described here
-
send the openOCD commands via telnet
reset halt flash protect 0 0 off
-
in the bootloader directory run
make PLATFORM=photon all program-openocd
-
finally send the telnet command
flash protect 0 0 on