AnsweredAssumed Answered

Writing and reading flash

Question asked by collin.marc on Feb 4, 2015
hi

i have an stm32f4 and i try to write and read flash value.

01.#include <stm32f4xx_hal.h>
02.#include <stm32f4xx.h>
03.#include <stm32f4-hal/stm32f4xx_hal_flash.h>
04. 
05.float dataflash1 = 12.12;
06.float gain;
07.uint32_t Address= 0x08008000;
08.HAL_FLASH_Unlock();
09.HAL_FLASH_Program(TYPEPROGRAM_WORD, Address, *(uint32_t *)&dataflash1);
10.//HAL_FLASH_Lock();
11.gain=*(float*)Address;
12.trace_printf("gain: %f\n", gain)

program run but i never see the trace of gain but i see the one after gain...

any idea?

Outcomes