cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103VBT6 Flash memory

keng1230
Associate II
Posted on September 21, 2011 at 03:27

basically i just want to some simple stuff. write in a variable into the flash memory (permanent) and read it , make sure it is the same .

as i am newbie to micro-controller, and i couldn't get any simple code or example code from the internet or in this forum. so can anyone teach me how to write the code  or give me some sample code 

thx you 

#stm32-flash
10 REPLIES 10
trevor23
Associate III
Posted on September 21, 2011 at 15:59

Do you ever want to cange the variable in flash from your program or will it always be constant? If always constant then just declre it const e.g.

const int variable_in_flash;

printf( ''variable = %d\r\n'', variable_in_flash );

This tells the compiler it will never change which in this case should allow the complier to put it in program memory - flash memory in this case (maybe as part of an instruction etc. but you shouldn't care about that)

However if you need to change the variable you will beed to erase a page of flash and then write to flash.

Let us know which method you require.

Posted on September 21, 2011 at 16:51

i couldn't get any simple code or example code from the internet or in this forum

 

https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/flash read and write (urgent)&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=335

There are also manuals for the part, and an application note about programming flash on STM32 parts.

http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/PROGRAMMING_MANUAL/CD002834pdf

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on September 22, 2011 at 00:13

Cross-post:

http://www.keil.com/forum/19571/

keng1230
Associate II
Posted on September 22, 2011 at 06:46

error:  #147-D: declaration is incompatible with ''void RCC_LSEConfig(u8)'' (declared at line 268 of ''C:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_rcc.h'')

i got this error ? 

Posted on September 22, 2011 at 08:19

''declaration is

incompatible

with 'void RCC_LSEConfig(u8)'''

 

So use a declaration which

is

  compatible with that!!

How do you expect anyone to help you resolve that error without seeing the code to which it relates?? Remember that your code is not visible to the forum!

keng1230
Associate II
Posted on September 22, 2011 at 09:43

ops... that one solve it .... 

now with something new error

.\Release\STM32F10x.sct(7): error: L6236E: No section matches selector - no section to be FIRST/LAST.

i am using this example 

C:\Keil\ARM\Examples\ST\STM32F10xFWLib\Examples\FLASH\Program\main.c

mikebright311
Associate
Posted on January 01, 2013 at 08:04

Hi Mr K

I have this problem too, could you find any response?

Please say me

Thanks

mikebright311
Associate
Posted on January 01, 2013 at 08:06

my email address : mikebright311@yahoo.com

Posted on January 01, 2013 at 17:52

Be aware that this thread was last tickled around 18 months ago, don't expect a response from the original participants.

State clearly your situation and your problem, and don't assume a METOO kind of problem is exactly the same, or conveys enough detail to be answered by current forum participants.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..