Hello Kent,
For your solution 1 : You needn't open your project , you can utilize the any simple project when flash ,
only need choose the .elf file you want to flash , as this :

pay attention , configure correctly of the debugger , for example , if use the J-link , configure the correct "Device name"

About your solution 2: The KDS can directly generate the ".hex" file, you can refer to here :
Binary (and S19) Files for the mbed Bootloader with Eclipse and GNU ARM Eclipse Plugins | MCU on Ecl...


Have a great day,
Alice Yang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------