Skip to main content

PSOC™ 4 and PSOC™ 6 single-core application

Follow steps in Create/export application for IAR Embedded Workbench.

Then, use the instructions in this section to build, program, and debug the application for a single-core PSOC™ 4 and PSOC™ 6 device in IAR Embedded Workbench.

Configure and build

In most cases, there is very little required to configure and build a simple single-core application. For some cases where configuration may be required, see the following as applicable:

On the IAR main menu, select Project > Make to build the application. You should see output like this:

Hello_World.out

Total number of errors: 0
Total number of warnings: 0
Resolving dependencies...
Build succeeded

Program/Debug with KitProg3/MiniProg4 (CMSIS-DAP)

As needed, run the fw-loader tool to make sure the board firmware is upgraded to KitProg3. See the KitProg3 User Guide for details. The tool is in the following directory by default:

*C:\Infineon\Tools\ModusToolboxProgtools-[version]\fw-loader\bin*

  1. In IAR Embedded Workbench, open the Options dialog, go to Debugger , and select CMSIS-DAP in the driver list:

  2. Select the CMSIS-DAP node, switch the interface from JTAG to SWD , and set the Interface speed to 2MHZ .

    Note: When using MiniProg4 with a single-core PSOC™ 6 MCU, you must specify a special type of Reset under the Setup tab, as follows:

  3. Click OK .

  4. Select Project > Download and Debug .

    The IAR Embedded Workbench starts a debugging session and jumps to the main function.

    ../figures/image26.png

Program/Debug with J-Link

You can use a J-Link debugger probe to debug the application.

  1. Open the Options dialog and select the Debugger item under Category .

  2. Then select J-Link/J-Trace as the active driver:

    ../figures/image28.png

  3. Select the J-Link/J-Trace item under Category , and under the Connection tab, switch the interface to SWD :

    ../figures/image29.png

  4. Connect a J-Link debug probe to the 10-pin adapter (this needs to be soldered on the prototyping kits).

  5. Select Project > Download and Debug to launch the debugger.

Program external memory

IAR Embedded Workbench has disabled external memory programming by default. The SMIF region in the *.board file must be enabled manually for PSOC™ 6 devices. To do that:

  1. Open the Options dialog and select the Debugger item under Category .

  2. Click the Download tab and select the Override default .board file check box.

    • Identify the default . board file currently used for this project.

    • Click the Browse […] button, then navigate to and select the same . board file that also includes "SMIF".

    • Click Save .

  3. Click OK to close the Options dialog.

Erase PSOC 6 MCU with external memory enabled

To successfully erase external memory using flashloaders on PSOC™ 6 MCUs, the device's internal flash must contain valid QSPI configuration data. It may be part of a previously programmed application, such as the QSPI_XIP example. For more details, review section 7 of application note AN228740.

  1. Select Project > Download > Erase memory .

    ../figures/image35.png

  2. Deselect the check boxes for all regions, except for 0x18000000-0x1fffffff.

    ../figures/image36.png

  3. Click Erase .

  4. Select Project > Download > Erase memory again.

  5. Select all other regions and deselect 0x18000000-0x1fffffff.

    ../figures/image37.png

  6. Click Erase .