Hello Graham,
First of all you do not need to SetPulse in a loop - you only need to do it once. But this is surely not the reason why you cannot talk to device no more.
I can advise to check whether Pins.GPIO_PIN_D6 is not the pin that you use for deploy - this possibly could have caused a deadlock (as it was in my case).