-
Notifications
You must be signed in to change notification settings - Fork 104
Spi memory lock #1415
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
base: master
Are you sure you want to change the base?
Spi memory lock #1415
Conversation
28dc7c4
to
950a314
Compare
// set the top/bottom protection bit. | ||
// This is an OTP bit,so the write will have an effect | ||
// only the first time. | ||
reg[1] = reg[1] | CR1_TB_BIT_BOTTOM; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it is ok to add this here, or if we want to do it inside the driver during the init function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as this gets executed during factor setup I think we are good.
1ba0527
to
050dd3e
Compare
49badb6
to
b29fa51
Compare
Assigned to @NickeZ who is more familiar with all this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general very good! Only some minor comments.
I also ran the test on my device which succeeded!
edit: I also unintendedly tested it because running the firmware in this PR left the memory locked, so flashing with the old code didn't work anymore 🎉
// set the top/bottom protection bit. | ||
// This is an OTP bit,so the write will have an effect | ||
// only the first time. | ||
reg[1] = reg[1] | CR1_TB_BIT_BOTTOM; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as this gets executed during factor setup I think we are good.
This adds api calls to lock/unlock and write a protected area of the memory.
b29fa51
to
22091b2
Compare
@NickeZ updated, PTAL 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK, I assume you will remove all changes from bootloader/startup.c
and firmware.c
before merging.
I just realized, does it make sense to move the test to factorysetup.c
?
Sure, I guess we'll call
I don't think so.. the test takes a lot of time to execute, I don't think we want that, wdyt? |
I'm pretty sure factory setup calls
True, yeah, we want factory setup to be as minimal as possible. Since we write the ble firmware to the chip we know if it works during factory setup. |
This adds api calls to lock/unlock and write a protected area of the memory.
This PR includes a test function to be removed before merging