2024-04-15 05:40 AM
What code works for the STM32L412 device?
I want to load an RTC calibration value into flash memory and retrieve it on subsequent running of the firmware.
I've got the reading of specific calibration values working in a different IC, for ADC calibration,
ICTempCal1 = (*((volatile uint16_t*)(0x1FF8007A)));
Will this work with the L412 IC?
But I cannot get programming of a page to work.
I tried 'HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, 0x080E0000,1000);'
But that fails within the routine. I'm assuming the Erase routine worked, but I haven't got far enough to check.
I tried the 'STM32CubeL4/Projects/NUCLEO-L4P5ZG/Examples/FLASH
/FLASH_FastProgram' code and found it to fail in the last section, the GetBank routine.
Different IC also.
Can anyone give me the code for these operations?
Solved! Go to Solution.
2024-04-30 07:57 AM
Yes I can get that code working OK
2024-04-30 08:03 AM
Hello @CGadg
In order to give better visibility on the answered topics, please click on 'Select as Best' on my reply which solved your issue or answered your question. See also 'Best Answers
Thanks
Kholdoun
2024-04-30 08:07 AM
The STM32 Github code I found is a version of what you were working on, though just further trawling found it.
Thank you for trying to help.