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:将浮点值写入闪存

Guru**** 657500 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1182755/launchxl-f280025c-write-float-to-flash

器件型号:LAUNCHXL-F280025C

您好!

基于闪存示例 flashapi_ex1_programming,我可以向闪存扇区6写入和读取 uint8、uint16和 uint32 (拆分为2 uint16)数据,而不会出现任何问题,但是对于  Fapi_issueProgrammingCommand,它 的* pu16DataBuffer 不长或 uint32_t……

我想知道是否可以将浮点32位编程到其中? 如果是32位、我可以将浮点值的地址编程到它。

 

我的代码:  

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

long_F = 765453;

doSetLongToBuffer (缓冲区、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);

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    我现在可以将浮点型转换为长整型、并将长整型值拆分为2个 uint16写入和读取闪存数据!!

    谢谢