2023-01-30 10:16 PM
I tried implementing a driver by following the Flash example present of the GitHub page and a blog I found online:
How to Program Flash memory in STM32 » ControllersTech
The driver code according to this blog is: STM32/FlASH_PAGE_F1.c at master · controllerstech/STM32 (github.com)
I tried to implement it for my application: Eeprom-Emulation-driver-STM32/FlASH_PAGE_F1.c at main · Yadnik1/Eeprom-Emulation-driver-STM32 (github.com)
However, no data is being stored in the flash memory. I am making a mistake that I am not able to identify it, can someone please guide me with it.
Thank you very much!!
Solved! Go to Solution.
2023-01-30 11:51 PM
Read the section on Flash in the Reference Manual for G0 chips. Unlike in F1, in G0 Flash is written in 64-bit units - two 32-bit words must be written one after another in a single programming operation.
2023-01-30 11:51 PM
Read the section on Flash in the Reference Manual for G0 chips. Unlike in F1, in G0 Flash is written in 64-bit units - two 32-bit words must be written one after another in a single programming operation.
2023-01-31 12:20 AM
Thanks @gbm,
Can you please tell me, how to convert the logic into code.
From my understanding, the change will happen in this part:
while (sofar<numberofwords)
{
if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, Address, Data[sofar]) == HAL_OK)
{
Address += 8; // use StartPageAddress += 2 for half word and 8 for double word
sofar++;
}
Thank you very much !!
2023-01-31 02:20 AM
I don't use HAL and I have no reason to learn/understand it. I am afraid I cannot help you with any HAL-based stuff.
2023-01-31 02:22 AM
Okay @gbm. Thanks for your help.
2023-01-31 10:13 PM
Can someone else please help me with this, or should I open up a new thread for this?
Thanks.