My problem is a little bit weird: I don't get a HardFault, although I'd want so.
SDK-12.3.0 (d7731ad), FreeRTOS (from the SDK) and SoftDevice S130 (2.0.1) also from the SDK.
On all other Cortex M machines I used to work with (Kinetis M0, Kinetis M4, nRF52) the following code always generated a nice HardFault:
On the mentioned machines the default HardFault_Handler is always overridden by my version, they work like a charm. I want to have the same on nRF51822 too, but I keep on failing.
The most surprising is that the HardFault doesn't get generated. Or I don't know what happens. E.g. in 1-2% of all cases I see my HardFault_Handler executing, but in the rest cases the execution stops and the watchdog resets the machine. The current HardFault_Handler looks like this:
I haven't found any traces that HardFaults can be disabled anyhow. Forums are full with posts on handling the HardFault, investigating the reasons, but I found nothing telling why HardFault doesn't generate when it's expected to do so. Of course, I've tried to write to different memory location, different data size... Compiling with debug options also didn't do the trick. I tried in Ozone debugger putting a breakpoint to HardFault_Handler(void), but it doesn't get called...
The primitive SoftDevice init looks like this:
Any idea?
Thanks, regards,