AnsweredAssumed Answered

FXTH87 flash operation functions

Question asked by Fu Huiming on Nov 3, 2015
Latest reply on Nov 4, 2015 by Fu Huiming

Why nothing changed after calling function TPMS_FLASH_ERASE() and TPMS_FLASH_WRITE() ? What's wrong with code below ?

 

fosc = 8MHz, fbus = 4MHz

FCDIV = 21;                                         // Fclk = 4MHz / (21+1) = 181.18KHz - 150KHz~200KHz

 

 

//----------------------------------------------------------------------------------

const BYTE CParaAddr[] @ 0xD200u =

{

0x44, 0x55, 0x66, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,

0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,

};

 

......

FCDIV = 21;

SendDebugContent(CParaAddr[0], CParaAddr[1], CParaAddr[2]);          // receive data are { 44 55 66 }

mRfData1 = TPMS_FLASH_ERASE((WORD)CParaAddr);                      // the function return 0x00, ERASE succeed ?

mCommonBuffer[0] = 0x77;

mCommonBuffer[1] = 0x88;

mCommonBuffer[2] = 0x99;

TPMS_FLASH_WRITE_1A((WORD)CParaAddr, &mCommonBuffer[0], 10);

SendDebugContent(CParaAddr[0], CParaAddr[1], CParaAddr[2]);

Outcomes