3.3.3 Trust Zone Project Setup

  1. Create MPLAB Harmany Project with below device and DFP version
    • Device: PIC32CM5164LS00100
    • XC32 Compiler: v4.10
    • DFP: PIC32CM-LS_DFP (v1.1.162)

      1.1 Create new 32-bit MCC Harmony Project as shown below

      1.2 Select the Framework Path (Framework path must match SDK setup document)and select Next

      1.3 Select Project Folder and select Next

      1.4 Select the device "PIC32CM5164LS00100" for standalone project using the PIC32CM-LS device family in the "Target Device" and click Finish

      1.5 MPLABx Code Configurator will be launched automatically. Then Select "MPLAB Harmony" and Click Next for the Harmony Framework Path.

      1.6 Select "Finish"

      1.7 Project Graph window of the Configurator may have predefined components

      Right click on the project properties and verify the selected configuration

  2. After creating the project as shown in the above step go to device resource and verify RNBD was under Wireless component

    Click on Plus icon under RNBD to add it under the Project Resource

  3. Project Graph and RNBD Module Configuration

    User can Select RNBD under the Select Module Type Drop Down either of the one as shown below

  4. Selecting Example Application
    • Expand the Drop down under Select Example Application option and choose any one as mentioned in the below
      • Basic Data Exchange
      • Transparent UART Application

    4.1 Basic Data Exchange:

    • Basic Data Exchange uses only ONE SERCOM for the Data Transmission

      4.2 Transparent UART

      • Transparent UART Application uses TWO SERCOM as a Dependency for the Data Transmission

        SERCOM3 Pin Setting is same as mentioned under Basic Data Exchange above.

  5. PIN Settings for Example Application:
    • Basic Data Exchange Pin Settings
    • Transparent UART Pin Settings
  6. Enabling RNBD Secure and Non Secure for Trust Zone Devices

    Click the below check box to Enable and Disable RNBD secure

  7. Table for Secure and Non-Secure Configuration
    Table 3-9. 
    S.noRNBD Secure (Check Box in the UI)Dependency(SERCOM)Pins
    1Non SecureNon SecureNon Secure
    2Non SecureSecureNon Secure
    3SecureSecureSecure
    Note: If RNBD Secure (Check Box in the UI) is marked to secure then BT_RST pin settings should be Secured and if RNBD Secure (Check Box in the UI) is marked to Non-secure then BT_RST pin settings should be Non-Secure
    • Case1: (RNBD: Non-Secure, Dependency: Non-Secure, BT_RST Pin: Non-Secure)
      • RNBD Secure (Check Box in the UI) –> Unchecked (Non-Secure) as shown below

      • Dependency –> Non-Secure

        • Goto –> Project Graph –> expand the plugins drop down –> and select Arm TRUSTZONE for Armv8-M
        • Select Peripheral Configuration as shown below

        • NOTE: Set SERCOM2 from secure to Non-Secure as shown below (Applicable for Transparent UART if TWO SERCOM was used)
      • Pin Settings –> Non-Secure

        • Goto –> Project Graph –> expand the plugins drop down –> and select Pin Configuration as shown below
        • Set BT_RST pin to Non-Secure under PIN Security Mode as shown below
      • Project Structure:

        Click Generate Button under Project Resource for Code Generation to the selected configuration

      • Adding example application to main.c
        • Once after Generation is complete include the headers for RNBD as shown below
          • if Select Module Type is selectedn is for RNBD: #include "examples/rnbd_example.h"

            Call the function RNBD_Example_Initialized(); in main() after SYS_Initialize ( NULL );

      • Program to the Development Board

        This is the End of Case1 project kindly refer RNBD Example1: Running Basic Data Exchange Example Application and RNBD Example 2: Running Transparent UART Example Applicaiton Running Example Application

      • Build the Generated Project:
    • Case 2: (RNBD: Non-Secure, Dependency: Secure, BT_RST Pin: Non-Secure)
      • RNBD Secure (Check Box in the UI) –> Unchecked (Non-Secure) as shown below
      • Dependency –> Secure
        • Goto –> Project Graph –> expand the plugins drop down –> and select Arm TRUSTZONE for Armv8-M

        • Select Peripheral Configuration as shown below
        • NOTE: Set SERCOM2 from secure to Non-Secure as shown below (Applicable for Transparent UART if TWO SERCOM was used)
      • Pin Settings –> Non-Secure
        • Goto –> Project Graph –> expand the plugins drop down –> and select Pin Configuration as shown below
        • Set BT_RST pin to Non-Secure under PIN Security Mode as shown below
      • Project Folder Structure:

        Click Generate Button under Project Resource for Code Generation to the selected configuration

      • Adding example application to main.c
        • Once after Generation is complete include the headers for RNBD or RN487x as shown below
          • if Select Module Type is selected for RNBD: #include "examples/rnbd_example.h"

            Call the function RNBD_Example_Initialized(); in main() after SYS_Initialize ( NULL );

      • Build the Generated Project:
      • Program to the Development Board

        This is the End of Case2 project kindly refer RNBD Example1: Running Basic Data Exchange Example Application and RNBD Example 2: Running Transparent UART Example Applicaiton Running Example Application

    • Case 3: (RNBD: Secure, Dependency: Secure, BT_RST Pin: Secure)
      1. Scenario 1:
        • RNBD Secure (Check Box in the UI) –> Enable Check (Secure)

          Note: Generate RNBD Non Secure Entry check box Disabled (Unchecked) as shown below
        • Dependency –> Secure
          • Goto –> Project Graph –> expand the plugins drop down –> and select Arm TRUSTZONE for Armv8-M

          • Select Peripheral Configuration as shown below

            NOTE: Set SERCOM2 from secure to Non-Secure as shown below (Applicable for Transparent UART if TWO SERCOM was used)

        • Pin Settings –> Secure
          • Goto –> Project Graph –> expand the plugins drop down –> and select Pin Configuration as shown below
          • Set BT_RST pin to Non-Secure under PIN Security Mode as shown below
        • Project Folder Structure:

          Click Generate Button under Project Resource for Code Generation to the selected configuration

        • Adding example application to main.c
          • Once after Generation is complete include the headers for RNBD or RN487x as shown below
            • if Select Module Type is selected for RNBD: #include "examples/rnbd_example.h"

              Call the function RNBD_Example_Initialized(); in main() after SYS_Initialize ( NULL );

        • Build the Generated Project:
        • Program to the Development Board

        This is the End of Case3 –> Scenario 1 project kindly refer RNBD Example1: Running Basic Data Exchange Example Application and RNBD Example 2: Running Transparent UART Example Applicaiton Running Example Application

      2. Scenario 2:
        • RNBD Secure (Check Box in the UI) –> Enable Check (Secure)
          Note: Generate RNBD Non Secure Entry check box Enabled (checked) as shown below
        • Dependency –> Secure
          • Goto –> Project Graph –> expand the plugins drop down –> and select Arm TRUSTZONE for Armv8-M

          • Select Peripheral Configuration as shown below

            NOTE: Set SERCOM2 from secure to Non-Secure as shown below (Applicable for Transparent UART if TWO SERCOM was used)

        • Pin Settings –> Secure
          • Goto –> Project Graph –> expand the plugins drop down –> and select Pin Configuration as shown below
          • Set BT_RST pin to Non-Secure under PIN Security Mode as shown below
        • Project Folder Structure:

          Click Generate Button under Project Resource for Code Generation to the selected configuration

          Verify the RNBD Non-Secure Entry code Generation as shown below

        • Adding example application to main.c
          • Once after Generation is complete include the headers for RNBD or RN487x as shown below
            • if Select Module Type is selected for RNBD: #include "examples/rnbd_example.h"

              Call the function RNBD_Example_Initialized(); in main() after SYS_Initialize ( NULL );

        • Build the Generated Project:
        • Program to the Development Board

          This is the End of Case3 –> Scenario 2 project kindly refer RNBD Example1: Running Basic Data Exchange Example Application and RNBD Example 2: Running Transparent UART Example Applicaiton Running Example Application