How to Read FS85 OTP_CFG_ASIL Register

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Read FS85 OTP_CFG_ASIL Register

62 Views
Contributor I

I used the function FS8x_ReadMirrorRegister to read the FS85 OTP_CFG_ASIL Register, But the result is wrong. I guess somethting is wrong with the function FS8x_ReadMirrorRegister. Does anyone know why?

    status = FS8x_ReadMirrorRegister(DrvConfig, false, FS8X_OTP_CFG_ASIL_ADDR, &regVal);

fs8x_status_t FS8x_ReadMirrorRegister(fs8x_drv_data_t* drvConfig, bool isFailSafe, uint8_t address, uint8_t* registerValue)
{
    fs8x_status_t status = FS8x_STATUS_OK;
    uint8_t cmdAddress;
    uint8_t dataAddress;
    uint16_t txData;
    fs8x_rxFrame_t rxData = {0};

    FS_ASSERT(drvConfig != NULL);
    FS_ASSERT(registerValue != NULL);

    if (isFailSafe)
    {
        cmdAddress = FS8X_FS_MIRRORCMD_ADDR;
        dataAddress = FS8X_FS_MIRRORDATA_ADDR;
    }
    else
    {
        cmdAddress = FS8X_M_MIRRORCMD_ADDR;
        dataAddress = FS8X_M_MIRRORDATA_ADDR;
    }

    txData = FS8x_BO_GETVAL(address, FS8X_ADDR_MASK, FS8X_ADDR_SHIFT);

    status = FS8x_WriteRegister(drvConfig, false, cmdAddress,
            txData, NULL);
    if (status != FS8x_STATUS_OK)
    {
        return status;
    }
    status = FS8x_ReadRegister(drvConfig, false, dataAddress, &rxData);
    if (status != FS8x_STATUS_OK)
    {
        return status;
    }
    /* Shadow register value is stored in high byte of the response data. */
    *registerValue = FS8x_BO_GET_REG_VALUE(rxData.readData, FS8X_DATAR_MASK, FS8X_DATAR_SHIFT);
    return status;
}

0 Kudos
1 Reply

18 Views
NXP TechSupport
NXP TechSupport

HI

I am afraid that you can't read OTP related registers.

0 Kudos