MPC5606S: program Test flash block

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MPC5606S: program Test flash block

1,031件の閲覧回数
lzh1762
Contributor I

hello,

I learned from the MPC5606S reference manual that  the first 8KB of the Test falsh block may be used for user defined functions. I can read it now ,but I want to know how to program it?

thanks!

0 件の賞賛
返信
1 返信

977件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

here is simple example:

   /* unlock all blocks */
    CFLASH0.LML.R = 0xA1A11111; /* write password */
    CFLASH0.LML.R = 0x00000000; /* unlock all low and mid blocks including test flash primary */
    CFLASH0.SLL.R = 0xC3C33333; /* write password */
    CFLASH0.SLL.R = 0x00000000; /* unlock all low and mid blocks including test flash secondary */

    /* program double word to User OTP area of CFLASH0 */
    CFLASH0.MCR.B.PGM = 1;
    *(unsigned int *)0x00400000 = 0x11223344; /* interlock write */
    *(unsigned int *)0x00400004 = 0x55667788; /* program data write */
    CFLASH0.MCR.B.EHV = 1;
    while(CFLASH0.MCR.B.DONE == 0);
    CFLASH0.MCR.B.EHV = 0;
    CFLASH0.MCR.B.PGM = 0;

Notice that this is OTP area, it can't be erased.

Regards,

Lukas

0 件の賞賛
返信