lPC546XX: ECRP Flash value in example projects

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

lPC546XX: ECRP Flash value in example projects

1,070 Views
giusloq
Contributor III

ECRP Flash value I found in example projects is zero:

 

__attribute__ ((used, section(".isr_vector")))
void (* const g_pfnVectors[])(void) = {
    // Core Level - CM4
    &_vStackTop,                       // The initial stack pointer
    ResetISR,                          // The reset handler
    NMI_Handler,                       // The NMI handler
    HardFault_Handler,                 // The hard fault handler
    MemManage_Handler,                 // The MPU fault handler
    BusFault_Handler,                  // The bus fault handler
    UsageFault_Handler,                // The usage fault handler
    __valid_user_code_checksum,        // LPC MCU checksum
    0,                                 // ECRP
    0,                                 // Reserved
    0,                                 // Reserved

 

From what I understand, zero value allows everything (least restrictive) when CRP_ALLOW_ZERO bit in OTP memory is 0 (factory). It locks everything (most restrictive) when CRP_ALLOW_ZERO bit is set.

Why doesn't NXP use the correct value, indipendently from CRP_ALLOW_ZERO? It should be:

 

(0x3F << 0) |    /* 0 sectors protected */
(0x2 << 10) |    /* IAP Sector Erase/Write protection is disabled */
(0x2 << 12) |    /* Allow ISP entry via pins */
(0x2 << 14) |    /* Allow ISP entry via IAP call */
(0x2 << 16) |    /* Enable external access to the chip */

 

That is 0x0002'A83F.

 

Labels (1)
Tags (1)
0 Kudos
Reply
2 Replies

1,050 Views
PabloAvalos
NXP TechSupport
NXP TechSupport

Hi @giusloq 

 

Please accept my apologies for late response. We are overloaded on the requests these days. I really appreciate your patience.

 

Regarding your question, it is just to get the lowest restrictive form from factory on the mcu and to get that with more simplicity. But you can tell me what are you trying to do? So I can help you more specifically on your issue.

 

I will stay tuned to your comments. Please let me know if you have more questions.

 

Best Regards.
Pablo Avalos.

0 Kudos
Reply

1,043 Views
giusloq
Contributor III

Regarding your question, it is just to get the lowest restrictive form from factory on the mcu and to get that with more simplicity.

Lowest restrictive if OTP memory is at the factory default, otherwise 0 could be highest restrictive.

But you can tell me what are you trying to do? So I can help you more specifically on your issue.

Nothing special. I was wondering why zero is used for ECRP in examples, considering zero is a "special" value that is considered lowest restrictive only in some cases (factory OTP).

 

0 Kudos
Reply