Hey all, I recently tried programming the OTP memory on some STM32F401's with OpenOCD. I discovered that programming the segments worked as expected, but I wasn't able to set the protection bits. Using `flash protect ...` didn't have any effect - I could still write changes to the OTP areas.
After a bit of digging and reading through the flash driver, I worked up a patch to fix this: https://review.openocd.org/c/openocd/+/7277 I've tested it locally on my STM32F401 parts, but don't have any other F2 or F4 parts around to test. Given that this code path makes irreversible changes to the target, and it's my first stab at any OpenOCD patches, I'd love to get it well-tested and reviewed. Does anyone have a stash of F2's or F4's that they would be willing to test on, knowing that testing permanently sets the OTP memory? Will -- Will Rigby w...@breakfastny.com