To recover the LPC1778, force ISP mode by holding P2.10 low during reset, then connect through UART0 and erase/reprogram the flash. An invalid vector-table checksum should cause the ROM bootloader to enter ISP, but if 0x2FC (CRP) was accidentally programmed with a CRP value, SWD/JTAG may be disabled and ISP access can also be restricted. The 0x0000–0x0400 region is special because it contains the vector table, the checksum at 0x1C, and CRP at 0x2FC; therefore, writing it as ordinary data can cause exactly this problem. SET_VALID_CODE is intended to correct the vector checksum, so it is not inherently wrong, but you should verify that your FLM applies it to the correct vector-table format/address and that the CRP word at 0x2FC is preserved correctly. Writing 0x400–0x7FFFF works because it avoids these bootloader-sensitive locations.