lpcware

LPC4330 OTP, boot source

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by inspire on Mon Apr 13 15:23:17 MST 2015
Hi,

I've got a problem with the LPC4330 NGX Xplorer board. It is mounted on top of another PCB which adds pull down resistors on the boot selection pins of the LPC. Of course, this makes the boot selection fix to a value I don't want. Thus, I wanted to use the OTP to set the boot source to the SPIFI without influence of the boot pins. In the datasheet it says

"If the OTP memory is not programmed or the BOOT_SRC bits are all zero, the boot mode is determined by the states of the boot pins P2_9, P2_8, P1_2, and P1_1."

The LPCOpen library offers a OTP interface which I try to use:

volatile uint32_t status;

SystemCoreClockUpdate();
Board_Init();

/* Initialize the OTP Controller */
status = Chip_OTP_Init();

/* Fix as per Errata, required for some LPC43xx parts */
OTP_fix(0, 0, 0, 0);

status = Chip_OTP_ProgBootSrc(CHIP_OTP_BOOTSRC_SPIFI);

uint32_t* test = (uint32_t*) (0x40045000 + 0x030);

// *(volatile char *) (0x40045000 + 0x030) |= 1 << 26; // HARD FAULT


If I got it right, the Chip_OTP_ProgBootSrc call should set the boot source to the SPIFI. At the next restart of the LPC it should boot from the SPIFI without considering the boot pins, right?

Unfortunately, this procedure doesn't show effect for me. At the next restart the LPC doesn't automatically boot from the SPIFI. Instead, it somehow hangs and shows no response until I manually press the reset button on the NGX board. So I think the boot source has not been changed with the above code.

What I noticed is that the *test doesn't show modified boot source bits. And when I use the last line of the code the LPC instantly goes to the hard fault handler.

How can I change the boot source now?

Thanks!
inspire

Outcomes