cancel
Showing results for 
Search instead for 
Did you mean: 

I wish to store data in the flash memory of my STM32G030C8T6 microcontroller. The issue I am facing is that my data is not being stored in contiguous memory banks, but rather the banks are being skipped, as seen from the image.

YBend.1
Associate III

0693W00000Y8sbDQAR.pngI have written a small driver code for the same to store different types of data types to a memory location.

The link to my code is: Yadnik1/Eeprom-Emulation-driver-STM32 (github.com)

and I have taken reference from here: STM32/FLASH_PROGRAM/F1 SERIES at master ·

Reference Blog: How to Program Flash memory in STM32 » ControllersTech

The available code was for STM32F103C8T6 microcontroller, and I had to make some changes to the code for my g0 series MCU.

It would be very helpful if someone can please tell me what mistake I am making.

Thank you very much!!!

12 REPLIES 12
gbm
Lead III

In the code above, you've set .Page twice and you didn't set .NbPages or PageAddress at all. Read the docs, look at the examples, then write your code. I do not use HAL, so I can't help here.

YBend.1
Associate III

Thanks @gbm​ .

I will go through the documentation and if I am yet stuck I will ask with the HAL tag in the forum, since the issue seems to have been identified.

gbm
Lead III

There is no issue, it's just you are not passing the required parameters.