cancel
Showing results for 
Search instead for 
Did you mean: 

Write, Read code for STM32L412 elusive

CGadg
Associate III

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?

 

12 REPLIES 12
CGadg
Associate III

Yes I can get that code working OK

nouirakh
ST Employee

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

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.