maicod
Posts: 16
Joined: Wed Jun 20, 2012 12:29 pm
Location: Netherlands

Does booting from USB flash drive alter OTP memory forever ?

Sun Feb 26, 2017 7:22 pm

in this article: http://www.makeuseof.com/tag/make-raspb ... -boot-usb/ I read that making the Rpi3 boot from an USB flash drive alters the OTP memory through editing config.txt. As OTP stands for One Time Programmable, does that mean I can't disable the boot from USB setting anymore ?

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Does booting from USB flash drive alter OTP memory forev

Sun Feb 26, 2017 7:29 pm

Yes. OTP == one time programmable. Once an OTP bit is set it can never be reset.

It's adding

Code: Select all

program_usb_boot_mode=1
to /boot/config.txt that sets the bit USB/PXE boot bit in OTP byte 17.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

maicod
Posts: 16
Joined: Wed Jun 20, 2012 12:29 pm
Location: Netherlands

Re: Does booting from USB flash drive alter OTP memory forev

Sun Feb 26, 2017 7:33 pm

DougieLawson wrote:Yes. OTP == one time programmable. Once an OTP bit is set it can never be reset.

It's adding

Code: Select all

program_usb_boot_mode=1
to /boot/config.txt that sets the bit USB/PXE boot bit in OTP byte 17.
What implications does that have in functionality ? What if I ever want to boot from MicroSD card again by using

Code: Select all

program_usb_boot_mode=0
or such ?

User avatar
PeterO
Posts: 5879
Joined: Sun Jul 22, 2012 4:14 pm

Re: Does booting from USB flash drive alter OTP memory forev

Sun Feb 26, 2017 7:40 pm

Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Does booting from USB flash drive alter OTP memory forev

Sun Feb 26, 2017 7:48 pm

That's a syntactically invalid directive so will be 100% completely, totally ignored.

Once a OTP is set it can NEVER be reset, at all ever, for all of future time.

All three of my Raspberry Pi 3Bs boot perfectly OK from an SDCard with that OTP set. The bigger problem was when I left a USB stick (with no bootcode.bin on it) in one of those machines - that resulted in a boot failure even though one of the USB devices was bootable.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

maicod
Posts: 16
Joined: Wed Jun 20, 2012 12:29 pm
Location: Netherlands

Re: Does booting from USB flash drive alter OTP memory forev

Sun Feb 26, 2017 10:00 pm

Thanks. Very thorough information but just a little bit too complicated to exactly understand what the implication is when the OTP bit for usb_boot_mode is set.

maicod
Posts: 16
Joined: Wed Jun 20, 2012 12:29 pm
Location: Netherlands

Re: Does booting from USB flash drive alter OTP memory forev

Sun Feb 26, 2017 10:11 pm

DougieLawson wrote:That's a syntactically invalid directive so will be 100% completely, totally ignored.
thats ok. I just thought it would work like that but apparently it does not :)
DougieLawson wrote: Once a OTP is set it can NEVER be reset, at all ever, for all of future time.
clear :)
DougieLawson wrote: All three of my Raspberry Pi 3Bs boot perfectly OK from an SDCard with that OTP set. The bigger problem was when I left a USB stick (with no bootcode.bin on it) in one of those machines - that resulted in a boot failure even though one of the USB devices was bootable.
After having set the OTP USB boot bit I could live with having to remove USB sticks if I wanted to boot from MicroSD but what concerns me is if it would take longer before booting from MicroSD starts, because maybe it tries to boot from USB sticks (not present) first. Did you notice a delay since you set the OTP USB boot bit or not ?

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Does booting from USB flash drive alter OTP memory forev

Sun Feb 26, 2017 10:40 pm

The time from entering shutdown -r now to the new kernel running is less than eight seconds. I don't think there's any value in trying to save microseconds from that incredibly short timespan.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

maicod
Posts: 16
Joined: Wed Jun 20, 2012 12:29 pm
Location: Netherlands

Re: Does booting from USB flash drive alter OTP memory forev

Sun Feb 26, 2017 11:48 pm

DougieLawson wrote:The time from entering shutdown -r now to the new kernel running is less than eight seconds. I don't think there's any value in trying to save microseconds from that incredibly short timespan.
you're right !

Return to “Advanced users”