Step 3.1: Configure Switch Button Pin with the Secure External Interrupt Controller (EIC) to Generate an Interrupt
In this step, the switch button will be configured as per the USER_BUTTON shown in the SAM L11 Xplained Pro Evaluation Kit schematic. See the following image.
1
In the MPLAB® Harmony Configurator (MHC), select the Pin Settings tab and then scroll down to 25 in the Pin Number column and configure the PORT pin PA27 as an external interrupt pin for switch functionality. Internal pull-up is enabled to avoid false edge detection as there is no external pull-up on the SAM L11 Xplained Pro Evaluation Kit.
As per the application project design, the User Button must be configured in Secure mode and by default, this pin is configured as a Secure mode pin by MHC.
2
Select the Project Graph tab.
Step 3.2: Configure LED Pin in Secure Mode
In this step, the user LED will be configured as per the USER_LED shown in the SAM L11 Xplained Pro Evaluation Kit schematic. See the following image.
1
Select the MHC Pin Settings tab and then scroll down to 8 in the Pin Number column and configure the PORT pin PA07 as an output pin for LED functionality. See the following image.
- The LED on the SAM L11 Xplained Pro board is active low. Configure the LED in the default OFF state by configuring the latch value to logic High.
- As per the application project design, the User LED must be configured in Secure mode and by default, this pin is configured as a Secure mode pin by MHC.
Step 3.3: Rename the Default main File
1
Under the Project Graph tab, click on System, and give a name of your liking to the default template main file generated by the MHC.
- The name of the default main.c is changed to main_l11.c to indicate that the referred main.c is for the SAM L11 Arm® TrustZone® getting started training module.
- The default template main file name of both Secure and Non-Secure projects will be changed to main_l11.c.