Step 2: Configure EIC for Switch in the Non-Secure Region and LED in the Secure Region
Configure External Interrupt Controller (EIC) PLIB as Non-Secure for the Switch Button
After launching MPLAB Code Configurator (MCC), navigate to the Device Resource tab. In the Device Resources panel, expand Libraries > Harmony > Peripherals > EIC. To add the EIC Peripheral Library (PLIB) to the project graph, either double-click on EIC or drag and drop it into the project graph area.
Select the EIC Peripheral Library in the Project Graph. The configuration options will appear on the right side of the interface. Enable EIC Channel 2 and set the security mode to NON-SECURE to designate the EIC peripheral as Non-Secure. Enable the interrupt for this channel. For External Interrupt 2, select Rising Edge Detection as the edge type. Then, enable both the Debounce and Filter options.
Pin Configuration for the Switch and LED
Open the Pin Configuration tab by clicking Project Graph > Plugins > Pin Configuration.

Select the MCC Pin Settings tab and sort the entries by Ports, as shown in the accompanying image.

Scroll down to Pin Number 32 (Pin ID: PA23). Set the Function to EIC_EXTINT2, enable the Pull Up resistor for this pin, and set the security mode to NON-SECURE.

Configure PA15 as a General-Purpose Input/Output (GPIO) pin. Assign an appropriate pin name, set the Direction to Out, the Latch to High, and the Security Mode to Secure to enable LED operation in the Secure region.

Arm® TrustZone® for Armv8-M
Go to Plugins drop-down options in Project Graph and then select Arm TrustZone for Armv8-M.

In the Peripheral Configuration > Peripherals section of the Arm TrustZone for Armv8-M window, by default, the EIC peripheral is a Mix-Secure Peripheral. This allows you to individually assign each external interrupt to the Secure or Non-Secure applications on the PIC32CM LS00 Curiosity Nano+ Touch Evaluation Kit.
