Hi all,
I am using custom board of MCU LPC54S016. I have a question: How to set bits of OTP BOOT_SRS of LPC54S016?
Thank all ./.
Solved! Go to Solution.
Hi thanhnambka,
BOOT_SRC is at OTP bank 3, word 0. so the bankIndex = 3; regIndex =0, value parameter is the entire 32bit register ( 45.12.4.3 OTP memory bank 3, word 0 - Boot ROM control data ), see UM11060 Table 1108.LPC540xx OTP memory bank 3, word 0
Jun Zhang
Hi Jun Zhang, Thank you for your response.
If i want set value of BOOT_src=0x1 (as image below):
I must use function:
status_t OTP_ProgramRegister(uint32_t bankIndex, uint32_t regIndex, uint32_t value);
I must input 3 parameters: bankIndex = 3; and what is regIndex, value parameters value to enter?
Thank you.
Hi thanhnambka,
BOOT_SRC is at OTP bank 3, word 0. so the bankIndex = 3; regIndex =0, value parameter is the entire 32bit register ( 45.12.4.3 OTP memory bank 3, word 0 - Boot ROM control data ), see UM11060 Table 1108.LPC540xx OTP memory bank 3, word 0
Jun Zhang
Hi thanhnambka,
OTP is accessed with API. You can refer otp demo code under MCUXpresso SDK to know how to use OTP API.
Function OTP_ProgramRegister, which calls otpProgramReg API, is to set OTP register. BOOT_SRC is at OTP bank 3, word 0, bit 10:9.
For more information about this register, see UM11060 45.12.4.3 OTP memory bank 3, word 0 - Boot ROM control data.
Please note, OTP is One-Time Programmable memory. That's to say, once OPT is written, it can't be written again. No matter you do system reset or not. Please double check your setting and make sure it is correct before programming OTP.
Hope this helps,
Jun Zhang