The problem:
We are getting a hard fault immediately after jumping from the bootloader while trying to initialize the nRF USBD driver. The fault happens in nrfx_power_init() at NRFX_IRQ_ENABLE(). If we don't initialize the USB driver it works fine. Also, the debug build of our app (no master boot record) works fine, with or without USB.
Development Setup:
We have a custom device based on nRF52833, SDK 17.1.0, using a softdevice, Seger toolchain. The application is based on FreeRTOS.
This problem seems very similar to devzone.nordicsemi.com/.../hardfault-on-bootloader-jump-to-app-for-release-build-works-with-debug-build I have tried changing optimization level on the bootloader from "2 size" to "1" with no success.