cancel
Showing results for 
Search instead for 
Did you mean: 

SPC560P50L3 censorship issue

NGuze.1
Associate II

Hello,

I purchased SPC560P50L3CEFAR from Mouser and I'm able to enable the censorship as the reference manual suggests.

I'm modifying NVSCI0 and NVSCI1 registers with the value 0x55AABABA and the UDE cannot connect unless the correct password is provided. Everything's good so far.

Currently there's no stock in Mouser/Digikey so I could only find more in China so I purchased some SPC560P50L3 from Aliexpress. The chip works well, I'm using it for FlexRay development and everything works. However I cannot enable the censorship on those devices that I purchased from China. Even though I'm modifying the NVSCI registers, the UDE is still able to connect and debug the MCU with an incorrect password or even no password at all.

The MCU I purchased from China reads "SPC560P50L3 VG438395 992G0 VG". Might this be a clone, or from a different batch or something, or am I doing something wrong?

I'm using the example code provided by NXP below.

Thanks,

int main(void) {
    HW_init();
    GPIO_init();
    
    /* Turn LED OFF (by logic 1) */
    SIU.GPDO[LED1_pin].R = 1; 
    
    /* Following sequence gets the device to Censored state */
    /* Subsequent access via JTAG password 0xCAFEBEEFFEEDFACE */
 
    /* Unlock SHADOW flash */
    if(CFLASH.LML.B.TSLK)         /* Check Test/Shadow flash lock status */   
    {
        CFLASH.LML.R  = 0xA1A11111; /* Password to unlock LML */
        CFLASH.LML.B.TSLK = 0;      /* Test/Shadow Lock Bit */
    }
    if(CFLASH.SLL.B.STSLK)        /* Check Secondary Test/Shadow flash lock status */    
    {
        CFLASH.SLL.R  = 0xC3C33333; /* Password to unlock SLL  */
        CFLASH.SLL.B.STSLK = 0;     /* Secondary Test/Shadow Lock Bit */
    }
 
    /* Erase SHADOW flash */
    CFLASH.MCR.R  = 0x00000004;   /* Set ERS in MCR: Select Operation */
    *((uint32_t*) 0x00200000) = 0xFFFFFFFF; /* Latch a CFlash Shadow Address with any data */
    CFLASH.MCR.R = 0x00000005;    /* Set EHV in MCR: Operation Start */
    while(!CFLASH.MCR.B.DONE);    /* Check DONE flag */
    while(!CFLASH.MCR.B.PEG);     /* Check PEG flag */
    CFLASH.MCR.R    = 0x00000004; /* Reset EHV in MCR: Operation End */
    CFLASH.MCR.R    = 0x00000000; /* Reset ERS in MCR: Deselect Operation */
    
    /* Program SHADOW flash */
    CFLASH.MCR.R = 0x00000010; /* Set PGM in MCR: Select Operation */
    *((uint32_t*) 0x203DD8) = 0xFEEDFACE; /* Latch Address and 32 MSB data */
    *((uint32_t*) 0x203DDC) = 0xCAFEBEEF; /* Latch Address and 32 LSB data */
    CFLASH.MCR.R = 0x00000011; /* Set EHV in MCR: Operation Start */
    while(!CFLASH.MCR.B.DONE); /* Check DONE flag */
    while(!CFLASH.MCR.B.PEG);  /* Check PEG flag */
    CFLASH.MCR.R = 0x00000010; /* Reset EHV in MCR: Operation End */
    CFLASH.MCR.R = 0x00000000; /* Reset PGM in MCR: Deselect Operation */
 
    /* Program SHADOW flash */
    CFLASH.MCR.R = 0x00000010; /* Set PGM in MCR: Select Operation */
    *((uint32_t*) 0x203DE0) = 0x55AABABA; /* Latch Address and 32 MSB data */
    *((uint32_t*) 0x203DE4) = 0x55AABABA; /* Latch Address and 32 LSB data */
    CFLASH.MCR.R = 0x00000011; /* Set EHV in MCR: Operation Start */ 
    while(!CFLASH.MCR.B.DONE); /* Check DONE flag */
    while(!CFLASH.MCR.B.PEG);  /* Check PEG flag */
    CFLASH.MCR.R = 0x00000010; /* Reset EHV in MCR: Operation End */
    CFLASH.MCR.R = 0x00000000; /* Reset PGM in MCR: Deselect Operation */
 
    /* Lock SHADOW flash */
    CFLASH.LML.B.TSLK  = 1;      /* Test/Shadow Lock Bit */
    CFLASH.SLL.B.STSLK = 1;      /* Secondary Test/Shadow Lock Bit */
 
    /* Confirm succesful operation by LED light ON */
    
    /* Turn LED ON (by logic 0) */
    SIU.GPDO[LED1_pin].R = 0;
    
    /* Programming succesful
       Device is now censored with private password: 0xCAFE_BEEF_FEED_FACE */ 
                      
    /* Loop forever */
    while (1) 
    {
     
    }
}

1 ACCEPTED SOLUTION

Accepted Solutions
Erwan YVIN
ST Employee

hello ,

Good to see that Flexray is working.

normally , all the SPC5 MCUs in the classic distributors are supporting this feature.

I do not think that it is a clone.

i wonder if the MCU is coming from Internal Delivery , Customer deliver, Oem production which disables the censorship.

I recommend to check with Aliexpress Vendor or Field Application Engineer

Best regards

Erwan

View solution in original post

1 REPLY 1
Erwan YVIN
ST Employee

hello ,

Good to see that Flexray is working.

normally , all the SPC5 MCUs in the classic distributors are supporting this feature.

I do not think that it is a clone.

i wonder if the MCU is coming from Internal Delivery , Customer deliver, Oem production which disables the censorship.

I recommend to check with Aliexpress Vendor or Field Application Engineer

Best regards

Erwan