Program the bootloader and write to UICR.BOOTLOADERADDR
Using Keil
You cannot write to UICR.BOOTLOADERADDR when using the default J-Link target driver in Keil. Therefore, you must configure Keil to use an external tool, nrfjprog. To do so, select Project > Options for Target 'xxx' and configure nrfjprog.exe as the tool for flash programming. nrfjprog.exe is installed with the nRF5 MDK and must be in the Windows system path. The following screenshot shows the required settings for nrfjprog.exe:
Flash tool configuration in Keil
After configuring the flash command, program the bootloader as you would do with a normal application. If several J-Link emulators are connected, select the one that contains the nRF5 IC that you want to flash.