AnsweredAssumed Answered

STM32F4 Discovery - Write float in Flash memory

Question asked by Blueberry on Jul 10, 2014
Latest reply on Jul 10, 2014 by Blueberry
I'm trying to receive a float number through a VCP and writing it in the Flash memory of the STM32F4 discovery board.
The functions used to write in the Flash memory (FLASH_ProgramDoubleWord...FLASH_ProgramByte) accept an unsigned integer value as data input,but I've managed to write a signed integer in the Flash memory using this code:

int dataflash1 = -1000;
int gain;
uint32_t Address= 0x08008000;
.......
FLASH_ProgramWord(Address,dataflash1);
.......
gain=*(int*)Address;

Can someone tell me how can I write a float data in the Flash memory?

Is it possible to send/receive a float data through VCP?

Thank you.

Outcomes