NXP Reader Library  v17.1.0.2535

Implementation of SAM Programmable Logic commands. More...

Collaboration diagram for 13_ProgrammableLogic:

Modules

 Defines
 Definitions for Programmable Logic commands.
 

Functions

phStatus_t phhalHw_Sam_Cmd_SAM_PLExec (phhalHw_Sam_DataParams_t *pDataParams, uint8_t bLFI, uint8_t *pPLData, uint8_t bPLDataLen, uint8_t **ppPLResp, uint16_t *pPLRespLen)
 The command SAM_PLExec is used to trigger the execution of the programmable logic. More...
 
phStatus_t phhalHw_Sam_Cmd_SAM_PLUpload (phhalHw_Sam_DataParams_t *pDataParams, uint8_t bIsFirstFrame, uint8_t bIsFinalFrame, uint16_t wUploadCtr, uint8_t bKeyNo, uint8_t bKeyVer, uint8_t *pPLCode, uint16_t wPLCodeLen, uint8_t *pPLReKey, uint8_t bPLReKeyLen)
 The command SAM_PLUpload is used to update the code of the programmable logic. More...
 

Detailed Description

Implementation of SAM Programmable Logic commands.

Function Documentation

◆ phhalHw_Sam_Cmd_SAM_PLExec()

phStatus_t phhalHw_Sam_Cmd_SAM_PLExec ( phhalHw_Sam_DataParams_t pDataParams,
uint8_t  bLFI,
uint8_t pPLData,
uint8_t  bPLDataLen,
uint8_t **  ppPLResp,
uint16_t pPLRespLen 
)

The command SAM_PLExec is used to trigger the execution of the programmable logic.

The command payload PLData is passed to the PL native code for processing. The SAM shall not interpret the command payload.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_SUCCESS_CHAININGOperation successful with chaining status.
PH_ERR_INVALID_DATA_PARAMSpDataParams is NULL.
PH_ERR_INVALID_PARAMETERpPLData and pPLRespLen are NULL.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bLFI[In] Option for updating the P1 information of Sam frame.
[in]pPLData[In] Programmable Logic command data.
[in]bPLDataLen[In] Length of bytes available in pPLData buffer.
[out]ppPLResp[Out] Buffer holding the Programmable Logic response data.
  • Actual data received from SAM
  • Actual error data received from SAM. The response will be of 2 bytes.
[out]pPLRespLen[Out] Length of bytes available in ppPLResp buffer.

◆ phhalHw_Sam_Cmd_SAM_PLUpload()

phStatus_t phhalHw_Sam_Cmd_SAM_PLUpload ( phhalHw_Sam_DataParams_t pDataParams,
uint8_t  bIsFirstFrame,
uint8_t  bIsFinalFrame,
uint16_t  wUploadCtr,
uint8_t  bKeyNo,
uint8_t  bKeyVer,
uint8_t pPLCode,
uint16_t  wPLCodeLen,
uint8_t pPLReKey,
uint8_t  bPLReKeyLen 
)

The command SAM_PLUpload is used to update the code of the programmable logic.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_SUCCESS_CHAININGOperation successful with chaining status.
PH_ERR_INVALID_DATA_PARAMSpDataParams is NULL.
PH_ERR_INVALID_PARAMETERpPLCode and pPLReKey are NULL.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bIsFirstFrame[In] Option to represent the first frame where the UploadCtr will be exchanged.
[in]bIsFinalFrame[In] Option to represent the last frame. If set, the LE byte will be exchanged and PLUploadACK will be received from SAM and will be validated internally.
[in]wUploadCtr[In] The upload counter value. This should be greater than the one availabe in SAM.
[in]bKeyNo[In] Key number of Upload key (Ku) in Software KeyStore.
[in]bKeyVer[In] Key version of Upload key (Ku) in software KeyStore.
[in]pPLCode[In] Plain Programmable Logic code.
[in]wPLCodeLen[In] Length of bytes available in pPLCode buffer.
[in]pPLReKey[In] The Rekey to be used for next crypto segment. This should have the next SessionENC key followed by the SessionMAC key.
[in]bPLReKeyLen[In] Length of bytes available in pPLReKey buffer. The length should be equal to double AES key size.