This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LAUNCHXL-F280025C: Write float to FLASH

Part Number: LAUNCHXL-F280025C


HI,

based on flash example flashapi_ex1_programming, I can able to write and read uint8, uint16 and uint32(split into 2 uint16) data to and from FLASH sector 6 without issues, however with Fapi_issueProgrammingCommand, it's *pu16DataBuffer not long or uint32_t ...

I would like to know if I can programme FLOAT 32 bit into it ? if it's 32 bits I can just programme the FLOAT value's address to it.

 

My codes : 

uint16_t uint16_Buffer[100] __attribute__((section(".DevOpt_Array")));

long_F  = 765453;

doSetLongToBuffer   (Buffer, 5, long_F);

oReturnCheck = Fapi_issueProgrammingCommand((uint32 *)u32Index,Buffer+i, 8, 0, 0, Fapi_AutoEccGeneration);

void doSetLongToBuffer(uint16_t *intBuffer, uint8_t charSetIndex, uint32_t longSetValue)
{
   uint16_t charTemp[2];

   charTemp[0] = longSetValue>>16&0xFFFF;
   charTemp[1] = longSetValue&0xFFFF;
   memcpy(&intBuffer[charSetIndex], &charTemp, 2);
}