I've submitted a patch to fix this here:
https://review.openocd.org/c/openocd/+/7612
I've also submitted three related patches, one to require enabling OTP writes
before OTP protection can be set, one to fix a typo in a message and one to
improve the message when trying to undo OTP protection
This is an automated email from Gerrit.
"Matthijs Kooijman " just uploaded a new patch set to
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/7615
-- gerrit
commit ac045143d4c7c988b756cccbbbdd9d227811feff
Author: Matthijs Kooijman
Date: Thu Apr 27 18:34:44 2023 +0200
This is an automated email from Gerrit.
"Matthijs Kooijman " just uploaded a new patch set to
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/7613
-- gerrit
commit aeb19ae0246c2491f2f8a6ec95b7cc181baa6842
Author: Matthijs Kooijman
Date: Thu Apr 27 16:01:49 2023 +0200
This is an automated email from Gerrit.
"Matthijs Kooijman " just uploaded a new patch set to
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/7614
-- gerrit
commit c70a825f553a356311cb38b4972139e63feb2615
Author: Matthijs Kooijman
Date: Thu Apr 27 16:05:02 2023 +0200
This is an automated email from Gerrit.
"Matthijs Kooijman " just uploaded a new patch set to
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/7612
-- gerrit
commit 3248998224dc4b189bf4e2977ceb45dcb75c6495
Author: Matthijs Kooijman
Date: Thu Apr 27 10:06:33 2023 +0200
I patched the code to fix this, and further found that:
- The code also did not do an unlock sequence and did not set the FLASH_PG
bit, so the write would also silently fail.
- The code would allow protecting OTP sectors without requiring the otp enable
command, as is required before doing regu
---
** [tickets:#393] STM32F2: Protecting OTP fails (code inverts lock value)**
**Status:** new
**Milestone:** 0.10.0
**Created:** Thu Apr 27, 2023 07:33 AM UTC by Matthijs Kooijman
**Last Updated:** Thu Apr 27, 2023 07:33 AM UTC
**Owner:** nobody
**Attachments:**
-
[openocd.log.txt](https:/