I am making code also for mac.
At the beginning I had same problem "Unable to halt arm core..." with J-Link.
"Device guaranted is not secured...."
When my processor were stuck, I didn't do anything to secure processor.
I think problem was related to my code... ?
My way to solve the problem was replace the microcontroller. (at the beginning I did it three times)
Somebody may have better solution but I didn't find it....
When I got interrupts and flash writing working, I haven't had this problem any more....