AnsweredAssumed Answered

BF518 OTP Memory Write Error(s).

Question asked by alemannia on May 24, 2013
Latest reply on Jul 27, 2013 by alemannia

Hi,

 

I am writing data (MAC address) into a page of the OTP memory. The data gets written correctly, but I often get the error codes:

 

ret = 0x021 ( OTP_MASTER_ERROR | OTP_ECC_MULT_ERROR )

ret = 0x200 ( OTP_ECC_SB_WARN )

 

When I then read the written page, the content is always OK. It's the ECC that's obviously messed up. Any idea why this would happen? I have stable 7V applied when writing the data.

 

I initialize the OTP once at system startup:

 

/* Initialize OTP timings. */

#define SYS_SCLK_MHZ     133

#define OTP_TIMING      ( 0x14548700 | ( SYS_SCLK_MHZ ) )

bfrom_OtpCommand( OTP_INIT, OTP_TIMING );

 

Here is my write routine:


unsigned int _write( uint_t page, const uint8_t data[DRV_OTP_PAGE_SIZE] )

  uint32_t ret;

  uint32_t flags;

 

  uint64_t lower;

  uint64_t upper;

 

  memcpy( &lower, &data[0], DRV_OTP_PAGE_SIZE/2 );

  memcpy( &upper, &data[8], DRV_OTP_PAGE_SIZE/2 );

 

  /* Write lower half page. */

  flags = OTP_LOWER_HALF | OTP_CHECK_FOR_PREV_WRITE;

  ret = bfrom_OtpWrite( page, flags, &lower );

  if( ret ) {

    return ret;

  }

 

  /* Write uppper half page and lock page. */

  flags = OTP_UPPER_HALF | OTP_CHECK_FOR_PREV_WRITE | OTP_LOCK;

  ret = bfrom_OtpWrite( page, flags, &upper );

  if( ret ) {

    return ret;

  }

 

  return 0;

}

 

Cheers!

 

 

Outcomes