S32K312 cannot get random numbers
/* Identifier for the only MU instance used in this example (MU0) */
#define MU0_INSTANCE_U8 ((uint8)0U)
/* Identifier of the MU channel used by HSE to listen for administrative requests (eg. read/write attributes) */
#define MU_ADMIN_CHANNEL_U8 ((uint8)0U)
#define TIMEOUT_TICKS_U32 ((uint32)10000000U)
hseSrvResponse_t getRandomNumReq(hseRngClass_t rngClass, uint32_t rngNumSize, uint8_t *rngNum)
{
hseSrvResponse_t hseStatus = HSE_SRV_RSP_GENERAL_ERROR;
hseGetRandomNumSrv_t *pGetRndSrv;
hseSrvDescriptor_t *pHseSrvDesc = &Hse_aSrvDescriptor[MU_ADMIN_CHANNEL_U8];
memset(pHseSrvDesc, 0, sizeof(hseSrvDescriptor_t));
pHseSrvDesc->srvId = HSE_SRV_ID_GET_RANDOM_NUM;
pGetRndSrv = &(pHseSrvDesc->hseSrv.getRandomNumReq);
pGetRndSrv->rngClass = rngClass;
pGetRndSrv->pRandomNum = (HOST_ADDR)rngNum;
pGetRndSrv->randomNumLength = rngNumSize;
/* Build the request to be sent to Hse Ip layer */
HseIp_aRequest[MU_ADMIN_CHANNEL_U8].eReqType = HSE_IP_REQTYPE_SYNC;
HseIp_aRequest[MU_ADMIN_CHANNEL_U8].u32Timeout = TIMEOUT_TICKS_U32;
// hseStatus = HSE_Send(muIf, muChannelIdx, gSyncTxOption, pHseSrvDesc);
/* Send the request to Hse Ip layer */
hseStatus = Hse_Ip_ServiceRequest(MU0_INSTANCE_U8, MU_ADMIN_CHANNEL_U8, &HseIp_aRequest[MU_ADMIN_CHANNEL_U8], pGetRndSrv);
return hseStatus;
}
hseSrvResponse_t cmd_rnd(uint8_t *rngNum)
{
return getRandomNumReq(HSE_RNG_CLASS_DRG3, 16U, rngNum);
}