4 How to Use the PUF Driver
The PUF driver provided by Microchip for PIC32 MCUs offers an easy access to the PUF hardware module, its configuration and the PUF operations. It is delivered as an include file and a library.
To use the PUF driver, this guidelines must be followed:
- Initialize base addresses to the
hardware registers of the PUF module. This is performed by calling
DRV_PUF_Initializefunction. - Optionally, reset the PUF module with
DRV_PUF_SoftResetfunction and power down the SRAM withDRV_PUF_SramPwrSwitchDisablefunction. - Start the PUF module by calling
DRV_PUF_Startfunction. This function enables the PUF clock and initializes the PUF state machine. It also allows to configure several things, such as disabling of commands, SRAM power-up, and privileged access. These configurations can also be set with independent functions once the PUF driver has been initialized. - If there is no Activation Code
available, run the Enroll command with
DRV_PUF_EnrollCmdfunction and store the returned AC in NVM. - If there is an Activation Code
available, run the Start command with
DRV_PUF_StartCmdfunction. - Perform key operations (Get Key, Wrap, Wrap Generated Random, and Unwrap) and random number generation with the corresponding functions.
- Run the Stop command with
DRV_PUF_StopCmdfunction and power down the SRAM withDRV_PUF_SramPwrSwitchDisablefunction when the PUF module is not going to be used for a long time.
In case of errors, refer to the PUF Error Handling section.
For details on all available functions, refer to the PUF API references.
To see examples on how to use the PUF module, refer to the PUF demo applications.
