I'm working on modifying an existing app written on a custom nRF52832 board. The app uses softdevice s132, and was written for SDK14.2. The app was originally written with Keil, but I ported it successfully to Segger. The device has a buttonless DFU, written using the bootloader_secure_ble example with minimal changes.
I verified that if I compile my app with "Release" settings (i.e. no debug support, size optimization), and package the app properly, I can update the device flash using over the air DFU (nRF Toolbox) and everything works.
But if I flash the app when connected with J-link to the computer running Segger, the device always starts into the bootloader. So when I do a "build and debug" (or even a "build and run", the code starts from the bootloader and the only way to get it out of it, is to perform an OTA DFU update (which overwrites the app)
How can I flash an app to the nRF52832 and ensure it starts in the app, not in the bootloader? Or, in alternative, how can I exit the bootloader and jump into the app? (the device has no buttons, btw. and in sdk_config.h I have #define BSP_BTN_BLE_ENABLED 0
At the moment I can only proceed by erasing the device flash, then only load the softdevice and my app in debug mode. Without a bootloader in flash, my app starts as expected.