cancel
Showing results for 
Search instead for 
Did you mean: 

How to write float data in Flash memory in STM32L4 ?

jeff.lee
Associate III

hello

i want to save float value in the flash memory in STM32L4.

it is my favor that you give me answer.

my below is my code

2 REPLIES 2
Piranha
Chief II

FLASH just stores bytes - it doesn't care what those bytes mean. The float is just a data type of a size of 4 bytes, so just write it as any other 4 bytes.

Ozone
Lead

Just use a global or static "const" variable, and it ends up in Flash.