lpcware

LPCOpen v1.03 OTP Programming with LPC4350

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by gregd on Tue Oct 29 06:36:49 MST 2013
Hello,

I am trying to program the MAC address into the LPC4350.  I am trying to use OTP Bank 3, word 2.  I have Vpp connected to VDDIO and VDDREG at 3.3V.  I am using LPCOpen v1.03.  I am running FreeRTOS so I am suspending all tasks just in case.  Here is the code I am using:

static void OTP_fix(volatile uint32_t dummy0, volatile uint32_t dummy1,
        volatile uint32_t dummy2, volatile uint32_t dummy3)
{
    return;
}

void program_mac_address( uint32_t last_three_of_mac ) {
            vTaskSuspendAll();      // suspend all tasks while doing hardware test.
           
            /* 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_ProgGPWord( 1, last_three_of_mac, last_three_of_mac);
           
            xTaskResumeAll();       // resume all tasks.
}

The status result from Chip_OTP_Init is always 0 (LPC_OK).

The problem is that I always get a status result of 0x60004 from Chip_OTP_ProgGPWord.  I can't find the meaning of this error code in any documentation.  The values in the OTP never change.

I am referring to documentation in AN11292 AN11292 Rev. 1

The user manual says to refer to general error codes but I can't find any that are listed in the manual.

Also, the documentation very unclear and inconsistent as to which function calls actually program OTP bank 3 word 1,2&3.  Is my code above correct for OTP bank 3 word 2 (Also referred to as "General purpose OTP memory 2, word 1).

Any ideas on how to resolve the problem would be greatly appreciated.

Thanks,
Greg Dunn

Outcomes