Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Flash memory clarification

Status
Not open for further replies.
Hi,

i have this clarification, in general our executable code goes into the flash memory using some flash tool like debugger etc. Suppose i receive some external data through some serial port can i still write that data into some unused flash memory ? or i can write only in EEPROM for storage purpose even after power off.

Thanks in advance,
regards,
Satya
 
i have this clarification, in general our executable code goes into the flash memory using some flash tool like debugger etc. Suppose i receive some external data through some serial port can i still write that data into some unused flash memory ? or i can write only in EEPROM for storage purpose even after power off.

Short answer is: Yes, you can have system like that.
 
This may not be a good idea. Flash has a limited number of writes it can take before it wears out.
 
It is a freescale micro contorller. My doubt is generally when in bootloader we write into the application flash area using flash driver algorithms. Does the same can be done while i am running my application code and run the flash algorithms and write into the flash memory.

thanks and regards,
satya
 
Freescale is a big company and I am pretty sure they make lots of different MCUs. So I guess you will need to read the relevant datasheets and find out how it works with the particular one you want to use.

From what I can remeber on ATmega series you can only write to flash from the bootloader, so you would need to take that into account when writing the code.
Either way, why dont you use the EEPROM instead? Do you need a self-modifying code? Could you use external flash?
 
I got this idea only because say my Flash memory is large and want to use it to the maximum extent possible. Next is i have lot of configurable items which are selected at the compile time say parameter1 = 50 (this parameter1 is by default in flash memory by linker file) is what i have selected and i want to test the behavior of the system for parameter1 = 60 this i wanted to achieve by receiving this through serial port and write at the same location of flash memory. can i achieve this? Also is it possible that i declare a pointer in flash memory and write data into it will it work? How to actually write into flash memory?

Thanks and regards,
satya
 
Pointer will most likely not work, but that depends on your compiler. Read the datasheet and find out what instructions you can use to write to flash, and then find how to make your compiler achieve that.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top