Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] OTP Read/Write #1352

Closed
6 tasks done
mirkomatonti opened this issue Nov 7, 2023 · 0 comments · Fixed by #1353
Closed
6 tasks done

[feature] OTP Read/Write #1352

mirkomatonti opened this issue Nov 7, 2023 · 0 comments · Fixed by #1353

Comments

@mirkomatonti
Copy link

mirkomatonti commented Nov 7, 2023

  • I made serious effort to avoid creating duplicate or nearly similar issue
  • Programmer/board type: [STLINK V2]
  • Operating system an version: [Linux]
  • stlink tools version and/or git commit hash: [ v1.7.0]
  • stlink commandline tool name: [st-flash]
  • Target chip (and board, if applicable): [STM32L4*]

Hello,

I need to read and write the otp area for a project of mine. I noticed that this feature has not being implemented yet so I did a quick implementation and it works. I know that OTP area is not standard across the STM32 line so how would that work in case I want to do a PR?
Can I just add support to L4x? (which is pretty easy as the OTP area is treated as FLASH) or do I need to do an implementation for all the supported boards?

My implementation is something along the line:

--area=otp read <output.bin> <len> //Read from the OTP start address to len
--area=otp write <input.bin> <add> //Write from a specific OTP address

To keep compatibility with the other boards I basically added two new fields (otp_base and otp_size) to the .chips file which in case they are not set the OTP read/write request returns a Not Implemented error. I suppose this will be helpful in case someone in the future wants to extend support to other boards.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants