PlatformIO Community

J-Link upload script with additional bootloader (.hex) file

Hi all,

I’m currently testing platformio together with a Adafruit nrf5832 Feather. In special I’m trying to upload the Arduino generated firmware file via my J-Link. This works fine. However, I noticed that the upload script is always erasing the whole chip before upload. This leads to the issue that the feather isn’t booting up after the upload_script finished. However if I flash the bootloader afterwards manually, everything works fine.

So now I’m asking myself: Is it possible to either make the J-Link upload script not erase the chip (to keep the bootloader), or to additionally specify the bootloader.hex so the upload_script is flashing it aswell. I know I could create my own upload script in Python, but I’m curios if there is an easier way.


What exact platformio.ini do you have? The adafruit-arduino scripts already implement loading the bootloader with in the complete upload process

Do you get a warning when uploading?

I don’t get this warning. My platformio.ini looks like this:

platform = nordicnrf52
board = adafruit_feather_nrf52832
framework = arduino
lib_extra_dirs = ~/Documents/Arduino/libraries

monitor_speed = 115200

debug_tool = jlink
upload_protocol = jlink

However, I noticed that it seems like more a reset issue than a missing bootloader. Sometimes the board just stays in bootloader mode instead of doing a reset.

Can you post the result of a verbose upload, starting at the invocation of the uploader? (“Verbose Upload” task or pio run -t upload -v in a PIO terminal)