We have used the first version of the S132 softdevice with the Engineering A version of the nrf52 chip. Now with the newer Engineering B version, we have moved to the second version of the S132 softdevice. Since this version, we started to have some issues with debugging.
When we were using the older softdevice we had little to no problems when we would pause and start the debugger again(to check some values for instance). Although Bluetooth was no longer working(which we expected), other parts such as UART and TWI(for I2C) would still work. Now, when we pause and start the debugger or when we add a breakpoint, a hardfault occurs.
In the GDB log we see something that seems strange to us and could be the problem:
Starting target CPU...
WARNING: T-bit of XPSR is 0 but should be 1. Changed to 1.
...Target halted (PC = 0x00030706)
The "0x00030706" is the hardfault handler address of course.
Somehow, the T-bit is set to 0 and j-link sets it to 1. (the older softdevice does not have this issue) We have researched this, and it seems it should not be possible for this bit to become 0 in our situation.(we only use thumb instructions as far as we know)
We have tested this both in Keil(modified an example from the latest SDK to work with S132-SD-v2) and in GCC (our own code using LPCXpresso, an eclipse derivative). We have the latest j-link software (V5.02k) installed.
Because there isn't a supported SDK yet for S132-SD-v2, we can't check this issue with a verified example.
We would like to know if somebody could help us with this issue as it slows down our development right now.