(I'm developing a firmware on nRF52832, but had actually stareted on nRF51822 and observed the same issue, SDK 12, pending migration to SDK 15)
When my app starts, I output NRF_GPIO->DIR, and get a value of 4D5CE81... While I would expect all ports to be by default inputs, so 0x00000000...
This is the first thing I do in my main(). I also tried running without the softdevice, same result (and similar result on nRF51).
Now, I also try setting them all to my default:
for (unsigned char i = 0; i < 32; ++i)
{
if (NRF_GPIO->PIN_CNF[i] == 0x02)
{
NRF_GPIO->PIN_CNF[i] = 0x06; // Input pulldown with disconnected buffer
}
}
But not long after running this code, things will hang, breaking execution, it's somewhere inside the softdevice and it loops.
So my main question is: am I just getting everything wrong?