Connect the development kit to the host PC.

XMC7000 and TRAVEO™ II specific steps

Because the XMC7000 and TRAVEO™ II devices have multiple cores – even if they are not used in a single-core application – you must perform special steps to modify the linker script for the IAR project.

See

XMC7000/TRAVEO™ II specific steps

for more details.

To use KitProg3/MiniProg4

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:

<user_home>/ModusToolbox/tools_<version>/fw-loader/bin/

  1. Select

    Project > Options > 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

    .



  3. Click

    OK

    .

  4. Select

    Project > Download and Debug

    .

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


    ../figures/image26.png

To use MiniProg4 with PSOC™ 6 single core and PSOC™ 6 256K

For a single-core PSOC™ 6 MCU, you must specify a special type of reset, as follows:


../figures/image27.png

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

    Note:

    For PSOC™ 64 "Secure Boot" MCU, you must specify a special type of reset, as shown:


    ../figures/image30.png

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

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.

  3. Identify the default .

    board

    file currently used for this project.


    ../figures/image31.png

  4. Copy the default .

    board

    file from the IAR Installation directory and paste it next to the IAR project file.

  5. Use a text editor to remove comment tags for the SMIF region around the

    <pass>

    element, and then comment out the ignore element for the XIP region in the recently copied file.

    Original file:


    ../figures/image32.png

    Edited file:


    ../figures/image33.png

  6. Save the file.

  7. In IAR, click the

    Browse […]

    button, then navigate to and select the edited .

    board

    file.


    ../figures/image34.png

  8. Click

    OK

    when you are finished.

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

    .

Erase PSOC™ Control C3 memory

After successfully building a PSOC™ Control C3 application, 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: