Template:ArticleMainWriter Template:ArticleApprovedVersion
STM32CubeProgrammer can be used to read and update the OTP of the device which is see as a partition on the device .
1. OTP Partition[edit source]
The OTP partition is identified by the reserved Id 0xF2 and is exported as a specific alternate setting of the USB DFU [1].
This is used to access on-chip one time programmable memory of the STM32MP and is only supported in U-Boot.
The OTP partition must be programmed without header and must have a fixed size of 1024 Bytes = 256 Words (32bits), following the structure described in chapter #Data Structure.
1.1. Access operation[edit source]
For read operation, the host requests the OTP partition data and the platform replies with all the partition content (1024 bytes).
For write operation, the host needs to send the full structure containing one or more modifications. Each field will be analyzed by the platform. First the OTP values will be updated, then the otp controls (like lock) will be updated.
After any write operation, a read must be done to update the Host information.
1.2. Data Structure[edit source]
The data structure for STM32MP15x Series is described in the table below.
Access can be RWS = Read / Write / Sticky
Word | Field name | Description | RWS |
---|---|---|---|
0 | Version | Version of this structure | R |
1 | Configuration |
|
RW |
2 | Reserved | ||
3 | Status |
|
R |
4 | General Lock conf |
|
RWS |
5 | Debug conf |
|
RW |
6 | Feature conf |
|
RW |
7 | reserved | ||
8 | Disturbed Status 1 |
|
R |
9 | Disturbed Status 2 |
|
R |
10 | Disturbed Status 3 |
|
R |
11 | reserved | ||
12 | reserved | ||
13 | reserved | ||
14 | Error Status 1 |
|
R |
15 | Error Status 2 |
|
R |
16 | Error Status 3 |
|
R |
17 | reserved | ||
18 | reserved | ||
19 | reserved | ||
20 | Permanent Lock 1 |
|
RWS |
21 | Permanent Lock 2 |
|
RWS |
22 | Permanent Lock 3 |
|
RWS |
23 | reserved | ||
24 | reserved | ||
25 | reserved | ||
26 | Programming Lock 1 |
|
RWS |
27 | Programming Lock 2 |
|
RWS |
28 | Programming Lock 3 |
|
RWS |
29 | reserved | ||
30 | reserved | ||
31 | reserved | ||
32 | Shadow Write Lock 1 |
|
RWS |
33 | Shadow Write Lock 2 |
|
RWS |
34 | Shadow Write Lock 3 |
|
RWS |
35 | reserved | ||
36 | reserved | ||
37 | reserved | ||
38 | Shadow Read Lock 1 |
|
RWS |
39 | Shadow Read Lock 2 |
|
RWS |
40 | Shadow Read Lock 3 |
|
RWS |
41 | reserved | ||
42 | reserved | ||
43 | reserved | ||
44 | OTP 0 | Value of OTP 0 | RW |
45 | OTP 1 | Value of OTP 1 | RW |
... | OTP ... | Value of OTP ... | RW |
139 | OTP95 | Value of OTP 95 | RW |
140 | reserved | ||
... | reserved | ||
251 | reserved | ||
252 | Configuration register |
|
R |
253 | IP version |
|
R |
254 | IP ID | R | |
255 | IP_Magic_ID | R |