Flash security Byte

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

Flash security Byte

1,407 Views
Schani
Contributor I

Hello

 

When I study NormalDemo code, I find code as below

 

/* Program the Security Byte in the Flash Configuration Field to an unsecure value */
returnCode = pFlashProgramLongword(&flashSSDConfig, 0x40C, 4, \
(UINT32)(&unsecure_key), pFlashCommandSequence);
if (FTFx_OK != returnCode)
{
ErrorTrap(returnCode);
}

 

It seems to unlock some security function by writing 4 bytes data from 0x40C.

But I can't find any data sheet talked about memory mapping(0x40C).

Could somebody help me ??

Thanks a lot

 

 

 

 

0 Kudos
Reply
4 Replies

843 Views
mjbcswitzerland
Specialist V

Hi

 

The FLASH configuration is described in the Flash memory module. In the K60 user's manual Rev. 5 this is chapter 28.3.1. The Flash configuration parameters are read from address 0x00000400 at reset and its structure is shown below.

 

typedef struct stKINETIS_FLASH_CONFIGURATION                             // loaded from FLASH 0x00000400 at reset{    unsigned char  ucBackdoorComparisonKey[8];    unsigned char  ucProgramFlashProtection[4];    unsigned char  ucFlashSecurity;    unsigned char  ucNonvolatileOption;    unsigned char  ucEEPROM_protection;    unsigned char  ucDataFlashProtection;} KINETIS_FLASH_CONFIGURATION;

 

Regards

 

Mark

 

0 Kudos
Reply

843 Views
Schani
Contributor I

Dear Mark

 

BTW, pFlashProgramLongword function of this code(NormalDemo)

 

        

/* Program the Security Byte in the Flash Configuration Field to an unsecure value */
returnCode = pFlashProgramLongword(&flashSSDConfig, 0x40C, 4, \
(UINT32)(&unsecure_key), pFlashCommandSequence);
if (FTFx_OK != returnCode)
{
ErrorTrap(returnCode);
}

 

 

        K60 flash command (FCMD: 0x06) is used,

        But, why can't I find any information described this command at K60 Sub-Family

        Reference Manual Rev. 2, Dec 2011 or any offical documents?

 

 

        It just lists FCMD 

0x00 Read 1s Block 
0x01 Read 1s Section 
0x02 Program Check 
0x03 Read Resource 
0x07 Program Phrase 
0x08 Erase Flash Block 
0x09 Erase Flash Sector 
0x0B Program Section
0x40 Read 1s All Blocks 
0x41 Read Once
0x43 Program Once

0x44 Erase All Blocks 
0x45 Verify Backdoor Access Key
0x46 Swap Control 
0x80 Program Partition 
0x81 Set FlexRAM Function

 

        Do you know any detail information about FCMD: 0x06 command??

        Thank  you..

 

 

 

0 Kudos
Reply

843 Views
admin
Specialist II

It looks like your FTFL flash command list is out-of-date.  Here is the latest from rev 6 of the manual.

 

0x00 Read 1s Block 
0x01 Read 1s Section 
0x02 Program Check 
0x03 Read Resource 
0x06 Program Longword

0x07 Program Phrase
0x08 Erase Flash Block 
0x09 Erase Flash Sector 
0x0B Program Section
0x40 Read 1s All Blocks 
0x41 Read Once
0x43 Program Once

0x44 Erase All Blocks 
0x45 Verify Backdoor Access Key

0x46 Swap Control

0x80 Program Partition 
0x81 Set FlexRAM Function

 

 

0 Kudos
Reply

843 Views
Schani
Contributor I

Dear Mark,

 

 

    I got it .

   Thank for your help.:smileyhappy:

 

 

Best Regards,

Schani

 

0 Kudos
Reply