Step 2: Configure Pins for Switch and LED
Configure External Interrupt Controller (EIC) PLIB for 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 your 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, set the security mode to NON-SECURE, and enable the interrupt. For External Interrupt 2, choose Rising Edge Detection as the edge selection. Then, enable both the Debounce and Filter options.

Pin Configuration for Switch and LED
Open the Pin Configuration tabs 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). Configure the pin function as EIC_EXTINT2, enable the internal pull-up resistor and set the Security Mode to NON-SECURE.

Configure PA15 as a General-Purpose Input/Output (GPIO) pin. Assign the appropriate pin name and specify the direction and latch settings required for LED operation.

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.

