I am reading the reference manual page 75 that shows the flash memory organization of STM32F4 MCUs. There is an OTP area of 528 Bytes in it as shown in the image:

enter image description here

Is it possible to write on this OTP area at run-time under user program control or is it writable at the chip-flash time only? I have tried to search this detail in the document but i cannot find it.

  • 5
    \$\begingroup\$ The 8th question in 24 hours asking us to read the documentation for you. Just do a search for "OTP" in the document you linked and all of your questions will be answered. \$\endgroup\$ – Elliot Alderson Feb 20 at 19:02
  • \$\begingroup\$ I better not post any question for next 24 hours. As a matter of fact I appreciate your comments since I am learning how to ask question on a public forum like this. What I understand so far is that my question should be of significant use for other users also. \$\endgroup\$ – scico111 Feb 20 at 19:19
  • \$\begingroup\$ We will also expect "other users" to try to find their own answers, so this question will not be of use to our average "other users". \$\endgroup\$ – Elliot Alderson Feb 20 at 19:32

Is it possible to write on this OTP area at run-time under user program control

Yes. There are some details in section 3.8 (page 97) of the reference manual.

In brief, the OTP area behaves similarly to other parts of flash memory, except that it cannot be erased, and it contains a set of fine-grained lock bytes which can be used to prevent further writes.

  • \$\begingroup\$ Are there any CubeMX HAL library functions for reading writing this OTP area? \$\endgroup\$ – scico111 Feb 20 at 19:12
  • 1
    \$\begingroup\$ @scico111 You should not ask another question in the comments. This should have been part of your original question, and you should have provided a link to the documentation of the CubeMX HAL library. \$\endgroup\$ – Elliot Alderson Feb 20 at 19:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.