I have seen this problem posted several times in these forums but none of the existing solutions sit right with me.
I have an NRF52840 (using a UBlox BMD-340 dev board). I am using the S140 soft device (v.7.2.0).
I'm using Keil uVision 5.
---
I am able to build applications in Keil as normal.
I am able to use nrfjprog to program my application and soft device and get it to run without issue.
I am not, however, able to program my uBlox BMD-340 from Keil to debug. During the 'erase' step, it fails.
**JLink Warning: T-bit of XPSR is 0 but should be 1. Changed to 1.
On an interesting side note: I AM able to program (using Keil) example applications like Blinky, so I'm wondering if there is something wrong with my custom project file.
For what it's worth, I was able to debug/program last week with my custom project. Keil seems to like to change things in the project without me knowing about it, so it is completely reasonable that Keil nuked something or changed something behind the scenes, but I don't know how to figure out what that something might be.