Programming/Debugging
Connect the PSOC™ 6 kit to the host PC.
As needed, run the fw-loader tool to make sure the board firmware is upgraded to KitProg3. See
KitProg3 User Guide
for details. The tool is located in this directory by default:
<user_home>/ModusToolbox/tools_3.1/fw-loader/bin/
Select
Debug > Start/Stop Debug Session
.
You can view the system and peripheral registers in the SVD view.

To use KitProg3/MiniProg4, CMSIS-DAP, and ULink2 debuggers
Select the
Device
tab in the Options for Target dialog and check that M4 core is selected:
Select the
Debug
tab.
Note:
To use the ULink2 probe for multi-core debugging, select the CMSIS-DAP Debugger instead of ULink for each core of the project (CM4 and CM0P).
Click the
Settings
button.
On the Target Driver Setup dialog on the
Debug
tab, select the following:
set
Port
to "SW"
set
Max Clock
to "1 MHz"
set
Connect
to "Normal"
set
Reset
:
For PSOC™ 6, to "VECTRESET"
For PSOC™ 4, PMG1, and AIROC™ CYW208xx, to "SYSRESETREQ"
enable
Reset after Connect
option
For PSOC™ 4, PMG1, and AIROC™ CYW208xx, to "SYSRESETREQ"
Select the
Flash Download
tab and select "Reset and Run" option after download, if needed:
Select the
Pack
tab and check if "Cypress.PSoC6_DFP" is enabled:
To use J-Link debugger with PSOC™ MCUs
Make sure you have J-Link software version 6.62 or newer.
Select the
Debug
tab in the Options for Target dialog, select J-LINK / J-TRACE Cortex as debug adapter, and click "Settings":
If you see the following message, click
OK
in the Device selection message box:
Select the appropriate target in Wizard:
Go to
Debug
tab in Target Driver Setup dialog and select:
set Port to "SW"
set Max Clock to "1 MHz"
set Connect to "Normal"
set Reset to "Normal"
enable Reset after Connect option
Select the
Flash Download
tab in Target Driver Setup dialog and select "Reset and Run" option after download if needed:
To use J-Link debugger with XMC7000 devices
Program set-up instructions
Select the
Debug
tab in the Options for Target dialog, select "J-LINK / J-TRACE Cortex" as the debug adapter, and click
Settings
.
On the
Debug
tab in the Cortex J-Link/JTrace Target Driver Setup dialog, select "SW" for
Port
, 2 MHz for
Max Clock
, and "Connect under Reset" on the
Reset
pull-down menu, and then click
OK
.
Select the
Utilities
tab in the Options for Target dialog and deselect the
Update target before Debugging
check box.
Debug set-up instructions
Select the
Debug
tab in the Options for Target dialog, select "J-LINK / J-TRACE Cortex" as the debug adapter, and click
Settings
.
On the
Debug
tab in the Target Driver Setup dialog:
Port
: select "SW"
Max Clock
: select 2 MHz
Reset
pull-down: select "Normal," "Core" or "Reset Pin"
Download Options
: enable "Verify Code Download" and "Download to Flash"
Perform ETM/ITM trace
Program external memory
Download internal flash as described above.
Notice "No Algorithm found for: 18000000H - 1800FFFFH" warning.
Select the Flash Download tab in Target Driver Setup dialog and remove all programming algorithms for On-chip Flash and add programming algorithm for External Flash SPI:
Download flash.
Notice warnings:
No Algorithm found for: 10000000H - 1000182FH
No Algorithm found for: 10002000H - 10007E5BH
No Algorithm found for: 16007C00H - 16007DFFH
Erase external memory
Select the
Flash Download
tab in Target Driver Setup dialog and remove all programming algorithms for On-chip Flash and add programming algorithm for External Flash SPI:
Click
Flash > Erase
in menu bar.
PSOC™ Control C3 devices
For Infineon PSOC™ Control C3 devices, the same physical flash memory can be erased/programmed over SBUS 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, this means non-secure access only).
To erase the entire flash memory, it's important to only erase the non-secure range of addresses. Remove the flashloader with the secure address range from the list prior to performing the erase.

However, if the application has data that must be programmed through a secure address range, the previously deleted flashloader needs to be re-added by using the
Add
button and specifying the secure address range.