Seeking Effective Flash Protection Methods for 54L05 Chip

Hello everyone,
I am currently working on implementing the flash protection feature for the 54L05 chip. My objective is to safeguard the code storage area from unintended erasure or overwriting during program execution. I have attempted to use the fprotect_area function for this purpose. However, upon verification, I found that the protected area can still be erased or written to. Could anyone share some ideas or alternative solutions to achieve effective flash protection?
P.S. The SDK version I am using is 3.0.0.
Thank you in advance for your valuable input!
Parents Reply Children
  • Hi, thanks for your reply!
    As soon as I read your response, I immediately spotted the mistake in my code and made the necessary corrections. However, the outcome is still not satisfactory. I set the length to (0x1000*0x80), but it still returns an error code of -22. After verification, I found that the code only works effectively when the length (pro_len) is less than or equal to (0x1000*0x07).
    Looking forward to your reply!
    Ozzy

    #define pro_len (0x1000 *0x80) 
    /*
    To ensure the operation is successful, 
    the value of this macro definition needs
    to be less than or equal to 0x7000.
    */
    void flash_test(void)
    {
    	printf("Lock 0x%x from 0\n",pro_len);
    	errno = fprotect_area(0x0000, pro_len);
    	if (errno) {
    		printf("Failed lock err %d\n", errno);
    	}
    	else{
    		printf("Lock ok\n");
    	}
    }
Related