stop NRST pin being driven by flash programming algorithms.
It looks like I made a fatal mistake by connecting the NRST pin to the PA0 pin on an STM32F778AIY. This is a part with no internal voltage regulator for the core so the PA0 pin acts like a power on reset. This hasn't caused problems with power cyclin...