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

Softdevice S132 3.1.0 on NRF52840 in CrossStudio 3.7.4

Downloaded the S132 from the NRF52840 site and loaded it onto the NRF52840DK board using NRFgo studio.

Then created a new project in CrossStudio. Imported the memory map and changed the flash start to 0x0001f000 and RAM start to 0x200019c0 as per the S132 documentation.

The only code in the project is this :

uint32_t error_code = 0; nrf_clock = { .source = NRF_CLOCK_LF_SRC_RC, .rc_ctiv = 16, .rc_temp_ctiv = 2, .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_250_PPM};

// Initialize SoftDevice. error_code = sd_softdevice_enable(&nrf_clock, softdevice_fault_handler);

Running full speed, or stepping through gives the same result. If stepping into the function call into softdevice I can see from the CPU registers that an SVC interrupt is called, but only after a few assembly instructions it jumps to Hardfault ( Not my error handler ) and stays there.

I've tried several softdevice functions, but they all lead to the same assembly instructions and shortly thereafter hardfault.

Assuming that there is nothing wrong with softdevice, but something else that is causing this issue.. Anyone experienced the same problems using CrossStudio, is there any particular settings that needs to be set in order for this to work ?

The final two instructions before hardfault are ldr r2, [r2] and then the bx r2 which leads to hardfault. ( Located around 0x0000092e approx ).

Parents Reply Children
No Data
Related