Hard fault in NRFX_IRQ_ENABLE() after bootloader jumps to app

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.

Parents
  • Hi,

    You are not allowed to use nrfx_power_* while using the SoftDevice. I expect what is happening here is that the SoftDevice asserts, which is expected in this case. Why is nrfx_power_init() being called, and from where? If you refer to SDK code, you will see that it is used by nrf_drv_power_init() in integration\nrfx\legacy\nrf_drv_power.c, but only if SOFTDEVICE_PRESENT is not defined for the project. So my it seem like you may for some reason have not defined SOFTDEVICE_PRESENT even though you are using a SoftDevice.

Reply
  • Hi,

    You are not allowed to use nrfx_power_* while using the SoftDevice. I expect what is happening here is that the SoftDevice asserts, which is expected in this case. Why is nrfx_power_init() being called, and from where? If you refer to SDK code, you will see that it is used by nrf_drv_power_init() in integration\nrfx\legacy\nrf_drv_power.c, but only if SOFTDEVICE_PRESENT is not defined for the project. So my it seem like you may for some reason have not defined SOFTDEVICE_PRESENT even though you are using a SoftDevice.

Children
No Data
Related