nRF5340 devices can be reprogrammed by erasing pages. Reprogramming is also dependent on the current nRF5340 security setting.
Checking protection status
nRF5340 devices have access port protection enabled by default, but they can also have secure access port protection and erase protection.
Erasing
The flash can be erased by either erasing page by page or erasing all pages.