@rnicolls ,
I use the following code on 1176, maybe it can help you in some way:
#define FUSE_REGISTER_BT_FUSE_SEL 0x16 // This is (0x960 - 0x800) >> 4. BT_FUSE_SEL bit is number 4 in this register (register address 0x960)
// Page 2186 in the UM for 1176 shows this formula (OCOTP control and status register)
#define SET_BT_FUSE_SEL 0 // Set this to 1 to set the BT_FUSE_SEL
//----------------------------------------------------------------------------
//
//----------------------------------------------------------------------------
void setFuses(void) {
uint32_t version;
/*
* When the macro FSL_FEATURE_OCOTP_HAS_TIMING_CTRL is defined as 0, then the
* OCOTP clock frequency is not used, pass in 0 directly.
*/
#if (defined(FSL_FEATURE_OCOTP_HAS_TIMING_CTRL) && FSL_FEATURE_OCOTP_HAS_TIMING_CTRL)
OCOTP_Init(OCOTP, EXAMPLE_OCOTP_FREQ_HZ);
#else
OCOTP_Init(OCOTP, 0U);
#endif
/* Get the OCOTP controller version. */
version = OCOTP_GetVersion(OCOTP);
status_t status = kStatus_Success;
uint32_t fuseData = 0U;
// read original value from the register with BT-FUSE_SEL
status = OCOTP_ReadFuseShadowRegisterExt(OCOTP, FUSE_REGISTER_BT_FUSE_SEL, &fuseData, 1);
if (status != kStatus_Success) {
messageDebug(DBG_ERR, __FILE_NAME__, __LINE__,"Error in OCOTP_ReadFuseShadowRegisterExt(), rc=", status );
return;
}
messageDebug(DBG_INFO, __FILE_NAME__, __LINE__,"OCOTP_ReadFuseShadowRegisterExt(), fusedata=0x%08X", fuseData);
#if defined(SET_BT_FUSE_SEL) && SET_BT_FUSE_SEL
// Program the original value plus bit 4 set (BT_FUSE_SEL)
status = OCOTP_WriteFuseShadowRegister(OCOTP, FUSE_REGISTER_BT_FUSE_SEL, fuseData | (0x10));
if (kStatus_Success == status) {
status = OCOTP_ReadFuseShadowRegisterExt(OCOTP, FUSE_REGISTER_BT_FUSE_SEL, &fuseData, 1);
if (status != kStatus_Success) {
messageDebug(DBG_ERR, __FILE_NAME__, __LINE__,"Error in OCOTP_ReadFuseShadowRegisterExt(), rc=", status );
return;
}
} else {
messageDebug(DBG_ERR, __FILE_NAME__, __LINE__,"Error in OCOTP_WriteFuseShadowRegister(), rc=", status );
}
#endif
}