STM32WB 信息块之OTP

1、OTP Area范围:0x1FFF 7000 - 0x1FFF 73FF 大小1 K

2、OTP描述

1 KB (128 double words) OTP (one-time programmable) for user data.The OTP data cannot be erased and can be written only once.If only one bit is at 0, the entire double word (64 bits) cannot be written anymore, even with the value 0x0000 0000 0000 0000.

The OTP area cannot be read when RDP level is 1 and boot source is not Flash memory user area.

Flash memory or OTP programming is done with a double-word granularity (64 bits).In order to save OTP bytes (1 K in the STM32WB Series), the load capacitance value on 6 bits can be appended to a 64-bit wide structure with other personalization data (such as the Bluetooth® device address, the MAC short address, the product specific code, the key).

推荐的OTP编程结构体:

typedef __packed struct
{
  uint8_t additional _data[6]; /* 48 bits */
  uint8_t hse_tuning; /* Load capacitance value */
  uint8_t index; /* structure index ==0x00*/
} OTP_BT_t;

3、OTP编程

由于OTP是one-time-programming,所以只能编程一次,编程只能以64bits对齐,指的是在同一款内存区只能编程一次,并不是整个1K大小的区域只编程64bits后下一次就不能编程了。在这个1K大小的区域中,只要以64bits对齐的区域的数据全是FF就能编程。

Even if the configuration phase is not supposed to be repeated, there may be some case where it should be overwritten. When using OTP bytes current configuration cannot be removed, the new one is placed at the next free double-word slot.

 4、OTP区常用于RF clock frequency tuning 功能

原文地址:https://www.cnblogs.com/yeshenmeng/p/10837507.html