ΣSigmaStudio Ask AI Русский Log in

OTP write to change SPI baud rate

Processors & DSP tdesilva Sep 11, 2018 00:00 1 replies Original on forum ↗
Subscribe
tdesilva Question
Sep 11, 2018 00:00

Hi all,

I'm attempting to write to OTP (on emulator) to change the SPI baud rate. The write function always returns with OTP_ECC_SB_WARN even when I write the same value which was read.

The HRM does not go into to detail about this error but to generalize it as a 'Single bad bit on ECC write'.

Has any one run into this before?

Find my code snippet below.

#include <bfrom.h>

ADI_PBS_BLOCK PBS;
u32 dPbsSet = 0;
u32 err;

// Read
err = bfrom_OtpRead(PBS00+dPbsSet*4,OTP_LOWER_HALF,
&(PBS.HalfPages.uqPbs00L));

// Modify
PBS.BitFields.spi_baud = 0x0004;

// Write
err = bfrom_OtpWrite(PBS00+dPbsSet*4, OTP_LOWER_HALF |
OTP_CHECK_FOR_PREV_WRITE,&(PBS.HalfPages.uqPbs00L));

Cheers,

Tharindu

otp

OTP_SPI_BAUD

blackfin

tdesilva Reply
Sep 11, 2018 00:00

Bummer!

I was missing a call to bfrom_otpCommand(OTP_INIT, OTP_INIT_VAL).

Thanks anyway.

Cheers