2019-04-05 05:15 AM
Hello,
i just want to use the Internal EEPROM of my STM32L052.
I followed the short description in the STM32CubeMX manual. But it is not working.
Here my small code example
HAL_FLASHEx_DATAEEPROM_Unlock();
HAL_FLASHEx_DATAEEPROM_Erase(0x08080000U);
//HAL_FLASHEx_DATAEEPROM_EnableFixedTimeProgram();??
HAL_FLASHEx_DATAEEPROM_Program (FLASH_TYPEPROGRAMDATA_WORD, 0x08080000U, 0x123456);
HAL_FLASHEx_DATAEEPROM_Lock();
HAL_Delay(100);
xprintf("EEPROM 0:\n\r",(*(__IO uint32_t*) 0x08080000U));
Sadly it is not working. There is also no good example which helps me with that.
Any ideas?
Best regards
Max
Solved! Go to Solution.
2019-04-05 06:04 AM
Try to debug into or print the values which the HAL functions return to find out which one returns an error.
Also, I don't know how your xprintf works, but if it's like the standard printf then I don't see any format string (for example %u) there.
2019-04-05 06:04 AM
Try to debug into or print the values which the HAL functions return to find out which one returns an error.
Also, I don't know how your xprintf works, but if it's like the standard printf then I don't see any format string (for example %u) there.
2019-04-05 06:28 AM
Omg, i´m such an idot. youre right. now it is working ( it was all the time;( )
sorry for that stupid mistake.
Thank you
2019-04-05 06:33 AM
No worries, "stupid" mistakes happen especially after long hours of work (: