Program and debug
Before programming and debugging, the default debugger options for your desired probe. See
Program/Debug with KitProg3/MiniProg4 (CMSIS-DAP)
or
Program/Debug with J-Link
.
Open the options dialog to the
Extra Options
tab, select the
Use command line options
check box, and paste the following command-line option:
--drv_vector_table_base=__Vectors

This is needed to resolve an issue with an invalid for IAR name for the vector table in the C start-up code.
Click
OK
to close the Options dialog.
Select
Project > Build Target
to build the application.
Select
Project > Download > Download file…
and select the
<project_name>.hex
file in
<project_root>\Debug\Exe
[you might have to switch to
All Files (.)
].

Select
Project >Debug without Downloading
.
You may encounter flash access restrictions based on the policy that was used to provision the target. The same physical flash memory can be erased/programmed over S-BUS either over Non-Secure addresses (0x22000000-0x2203FFFF) or over Secure addresses (0x32000000-0x3203FFFF).
During flash programming operations, the CPU core operates in the Secure world. In this state, the Non-secure addresses are always accessible, but Secure addresses may be unavailable if certain regions are configured for Non-secure access (for PSOC™ Control C3 it means Non-secure access only).
To erase the entire flash memory, it's important to only erase the non-secure range of addresses. Just deselect the secure address range:
