Page 1 of 2

STM32F103C8T6 Flash Memory Write/Read

Posted: Tue May 17, 2022 11:21 am
by ardunocuqpw
How can ı write and read my datas to STM32. Does it have library? I need your help guys thank you.

Re: STM32F103C8T6 Flash Memory Write/Read

Posted: Tue May 17, 2022 11:31 am
by fpiSTM
You can use EEPROM library.

Re: STM32F103C8T6 Flash Memory Write/Read

Posted: Tue May 17, 2022 12:22 pm
by ardunocuqpw
STM32F103C8T6 does note have EEPROM sir, ı need to write flash memory but ı have no idea.

Re: STM32F103C8T6 Flash Memory Write/Read

Posted: Tue May 17, 2022 12:40 pm
by fpiSTM
Eeprom library emulate an eeprom in flash...

Re: STM32F103C8T6 Flash Memory Write/Read

Posted: Tue May 17, 2022 12:41 pm
by ardunocuqpw
Can you help me, how can ı emulate?

Re: STM32F103C8T6 Flash Memory Write/Read

Posted: Tue May 17, 2022 12:42 pm
by fpiSTM
Another way would be to use HAL Flash API but it is for advanced user.

Re: STM32F103C8T6 Flash Memory Write/Read

Posted: Tue May 17, 2022 12:44 pm
by fpiSTM
ardunocuqpw wrote: Tue May 17, 2022 12:41 pm Can you help me, how can ı emulate?
Simply try examples available in Arduino IDE.

Re: STM32F103C8T6 Flash Memory Write/Read

Posted: Tue May 17, 2022 12:51 pm
by ardunocuqpw
I can not run FlashStorage library for stm32. İt give error.

WARNING: The FlashStorage_STM32F1 library needs stm32, ststm32 architecture to work and may be incompatible for your circuit using STM32F1 architecture.

Re: STM32F103C8T6 Flash Memory Write/Read

Posted: Tue May 17, 2022 1:31 pm
by fpiSTM
OK this mean you use Roger core. I don't know what is available for this core.

Re: STM32F103C8T6 Flash Memory Write/Read

Posted: Tue May 17, 2022 3:13 pm
by ag123
take a look in the ref manual RM0008 and some app notes
https://www.st.com/resource/en/referenc ... ronics.pdf
https://www.st.com/resource/en/programm ... ronics.pdf
it isn't difficult to use the registers to write to on-chip flash

if you search in github, there are probably more examples.
https://github.com/khoih-prog/FlashStorage_STM32F1
https://github.com/avislab/STM32F103/tr ... tm_lib/src

Note that erase is a full block of flash, if you have only 64k flash, and your bin image is large, erasing flash may erase part of your program.