background image

• Connect the micro USB cable between PC and P6 link on the board while pressing and holding down ISP button.

• Download compiled executable file.

• Release ISP button after the download is successful.

3. Run

Reset the board to run by pressing the Reset (S4) button on the board.

4. Result

Two LEDs are used in this example. Blue LED indicates the pin state is read by normal GPIO, whereas green LED indicates
the pin stateis read by Secure GPIO. After reset, code is running in Secure world, and it initializes the system including
above two LEDs, and then it jumps to Non-secure world. In Non-secure world, it reads P0_5 pin (ISP button/S1 on EVK)
via both normal GPIO and Secure GPIO and the pin state it reads is 1 since this pin is pulled up externally by default. P0_5
will be read as 0 when ISP button is pressed and hold down, If P0_5 is 0, it turns on the blue LED and green LED as now
both normal GPIO and Secure GPIO read all 0 from this pin.

Press USER button (S3), it jumps to Secure world, toggle Secure GPIO Mask, and then jump back to Non-Secure world.
Press WAKEUP button (S2), it will jump to Secure world, make Secure GPIO Secure, and then jump back to Non-secure
world. At last, it tries to access the Secure GPIO from Non-Secure world, because of Secure access violation, it enters
Hard Fault. The following figure simply depicts its control flow:

Figure 16. Flow of Secure GPIO example

5 Conclusion

The example shows that Non-secure world can access a peripheral pin state regardless of the pin function and whether the
peripheral function is Secure or Non-secure. It results in Secure information leakage. To prevent, a Secure GPIO must be used
and it shall be configured and used in Secure world. Whereas, the normal GPIO shall be used in Non-secure world. Same rules
apply to Secure PINT and normal PINT.

6 Revision history

Revision

Date

Substantial Changes

0

15/01/2019

initial version

NXP Semiconductors

Conclusion

LPC55S6x Secure GPIO and Usage, Rev. 0, 15 January 2019

Application Note

11 / 12

Summary of Contents for LPC55S6 Series

Page 1: ...ecure state CPU S can execute instructions from Secure memory S memory but not allowed to execute instructions directly from Non secure memory NS memory However CPU S can access data in both S memory...

Page 2: ...roller The LPC55S6x implements second layer of protection with Secure AHB Controller to provide secure trusted execution at system level With Secure AHB Controller you can configure security access ru...

Page 3: ...powerful Like SPI UART and so on a normal GPIO is also a digital peripheral in the MCU Following is a simple block diagram of the normal GPIO The normal GPIO can read a pin state regardless of pin fun...

Page 4: ...a Secure peripheral which means that this UART is only allowed to be accessed by the Secure world i e code not by the Non secure world However in this case the UART pin states can still be monitored...

Page 5: ...to generate certain input pattern from external device for secure signaling For the same reason Secure world needs Secure Pin Interrupt Pattern Match Engine PINT so another module named Secure PINT is...

Page 6: ...separate interrupt in the NVIC Edge sensitive interrupt pins can interrupt on rising or falling edges or both Level sensitive interrupt pins can be HIGH active or LOW active 2 3 2 Secure Pattern Matc...

Page 7: ...events Non secure world from accessing the Secure GPIO Configure the IOCON block to Secure through Secure AHB Controller It prevents Non secure world from accessing the IOCON Configure the correspondi...

Page 8: ...T From application perspective the method of using Secure PINT is same as of normal PINT There is one thing that needs extra attention To disable the Non secure world from accessing the Secure PINT re...

Page 9: ...cable between PC and P6 link on the board for loading and running a demo 4 1 2 Software environment Tool chain IAR embedded workbench 8 30 1 Software package AN_SecureGPIO_Demo zip 4 2 Steps and resu...

Page 10: ...Configure secure_gpio_s and secure_gpio_ns projects as shown below Figure 15 Configuration of the projects 2 Compile Download Compile secure_gpio_s project first then compile secure_gpio_ns project N...

Page 11: ...IO and Secure GPIO read all 0 from this pin Press USER button S3 it jumps to Secure world toggle Secure GPIO Mask and then jump back to Non Secure world Press WAKEUP button S2 it will jump to Secure w...

Page 12: ...lement appropriate design and operating safeguards to minimize the risks associated with their applications and products NXP the NXP logo NXP SECURE CONNECTIONS FOR A SMARTER WORLD COOLFLUX EMBRACE GR...

Reviews: