9 years, 2 months ago.

Nucleo L152RE EEPROM issue

I'm trying to write double word in EEPROM through following code:

include the mbed library with this snippet

#include "mbed.h"

Serial pc(USBTX, USBRX);

int main()
{		
        uint64_t a=1; 
	  
		HAL_FLASHEx_DATAEEPROM_Unlock(); 
		HAL_FLASHEx_DATAEEPROM_ProgramDoubleWord(0x08080008, a);
		HAL_FLASHEx_DATAEEPROM_Lock();
		
		uint32_t address=0x08080008;;
        uint64_t tmp = *(__IO uint64_t*)address;
		pc.printf("value=%d\n\r",tmp);
    
}

But it get stuck at "HAL_FLASHEx_DATAEEPROM_ProgramDoubleWord(0x08080008, a);".

Kindly can somebody tell me the error?

Thankyou.

Be the first to answer this question.