Hi,
I'm using NRF52840 and having a lot of issues with hard fault.
From time to time, I get an application crash with the following log:
HARD FAULT at 0x00000000
R0: 0x00000010 R1: 0x00000000 R2: 0x20007848 R3: 0x00000000
R12: 0x20012FCC LR: 0x00031F27 PSR: 0x00000000
Only when I run a specific function in a loop I can reproduce this error.
After a long investigation, I understood that the hard fault occurs due to a specific function. Inside this function I have a lot of actions, but it starts with a memset for a small byte array (8 bytes), and a log which is implemented with printf.
The weird thing is that only when I delete one of those two actions - hard fault doesn't occur anymore. Does it make sense? How can it be possible that those 2 simple actions can cause this hard fault?
Thanks!