This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52840-Preview-DK: HardFault exception while debugging ble_app_uart_c code

Hi,

I am developing a project in IAR Embedded Workbench for nRF52840-Preview-DK. I have integrated different modules (ble, ADC, SPI, I2C) in this project. I don't have any compilation errors but when I download the code, it gets stuck in nrf_sdh_enable_request() which is part of ble_stack_init(). While debugging, I found that the code works fine till it reaches sd_softdevice_enable which is on line number 214 in nrf_sdh.c After this line, the control does not proceed to next instruction. I tried setting a breakpoint and 'stepping into' the function call but it gave me following error.

Thanks!

Parents Reply
  • The project was not set up correctly when I opened it in IAR v.8.22.1. The core  set to Cortex M3 instead of Cortex M4 for instance. Suspect it has something to do with different IAR versions.I updated the project settings as shown below. Also moved the ble_stack initialization to beginning of main since I don't have the HW dependencies for TWI and SPI. The softdevice got enabled without errors. 

    Updated target settings:

    Use Jlink for debugging. Was set to use the simulator.

    Updated linker settings:

    Modified project:

    nrfx_spim_nordic.zip

Children
Related