Skip to main content

PSOC™ Control application

Follow instructions in Create/export application for Keil µVision.

Note:
Depending on your device, your application may be structured as follows:
  • Single-project application – A stand-alone project targeting the secure software model. Follow the proj_cm33_s project configuration in this case.
  • Dual-project application – A multi-core application consisting of two inner projects:
    • proj_cm33_s – TrustZone Secure project
    • proj_cm33_ns – TrustZone Non-Secure project

In addition to the TrustZone technology from Arm, PSOC™ Control C3 devices have various security life cycle stages (LCS). For more details about security, refer to Application Note AN240106 - Getting started with PSOC™ Control C3 security.

The following sections provide details about working with a device with the default out of the box policy versus a device that has been provisioned.

Configure and build each project

  1. Open the Options dialog for the project, go to the User tab, enable the Run #1 check box located under After Build/Rebuild. Then, paste the following command as single line.
    ide_postbuild.bat \"#L\"


  2. Click OK to close the Options dialog.
  3. Select Project > Build Target to build the project.
  4. Repeat these steps for other projects in the application (if they exist).

Configure the debugging probe

J-Link Target Driver Setup

Open the Options dialog. Select the Debug tab and choose “J-Link / J-TRACE Cortex” from drop-down menu.

Stay on the Debug tab and click Settings.

Use the following options to configure the J-Link Target Driver:

  • Port: SW/JTAG
  • Max Clock: 1 MHz (recommended)
  • Connect: Normal
  • Reset: Normal
  • Reset after Connect: enabled
Switch to the Flash Download tab and select Erase Sectors radio button, as well as Program, Verify, and Reset and Run check boxes.

CMSIS Target Driver Setup (ULINK2, MP4)

Open the Options dialog. Select the Debug tab and choose “CMSIS-DAP ARMv8-M Debugger” from the drop-down menu.

Stay on the Debug tab and click Settings.

Use the following options to configure the J-Link Target driver.

  • Port: SW
  • Max Clock: 1 MHz (recommended)
  • Connect: Normal
  • Reset: SYSRESETREQ
  • Reset after Connect: enabled
Switch to the Flash Download tab and select Erase Sectors radio button, as well as Program, Verify, and Reset and Run check boxes.

Figure 1.

Program the application

Before programming, ensure that all projects within your application are successfully built. If your application consists of both proj_cm33_s and proj_cm33_ns inner projects, you may initiate device programming from either of them. However, before proceeding with programming, project must be properly configured to ensure the correct hex file is programmed onto the device

Configure projects

Open the Options dialog, select the Utilities tab, disable Update Target before Debugging, and paste .\program.ini in the Init File field.

Click OK to close the Options dialog.

Target Programming

After configuring projects for programming and setting up the debugger connection, the next step is to program the target. To accomplish this, follow these steps:

  1. Select the µVision instance designated for the secure CM33 application.
  2. On the main menu, select Flash > Download.

Configure and run debug session

Configure the debugging probe as mentioned previously.

On the Options dialog, select the Debug tab and make sure that the Load Application at Startup check box is not selected.

Select the debug.ini file in the Initialization File field.

Click OK to close the Options dialog.

To start the debugger, select Debug > Start/Stop Debug Session.

Recommended Values for __Reset_Finish_Delay

Proper device operation may require adjusting the __Reset_Finish_Delay parameter, depending on the device's configuration. The following shows the recommended values for this parameter when using KitProg3/MiniProg4 or ULINK2 debuggers/programmers.

  • KitProg3/MiniProg4 – 200 000 - 400 000
  • ULINK2 – 200 000 – 400 000


Last updated on