30 - Wikipedia. Texas Instruments. MSP430 Tools: From Development to Production Lane Westlund 2. Memory- Memory. SLAA149 4 Programming a Flash-Based MSP430 Using the JTAG Interface 1 Introduction This document provides an overview of how to program the flash memory module of an. SLAA149 4 Programming a Flash-Based MSP430 Using the JTAG Interface 1 Introduction This document provides an overview of how to program the flash.
In reply to: The memory area where the code is store is FLASH. This means it cannot be written to normally. Writing to FLASH requires special handling. You'll need to tell the flash controller that you want to write, then the writing takes a LONG time (compared to a read), and, even more important, you cannot write randomly. You can only write '0' bits. To write a '1' bit to a position where a '0' has been written already, you'll need to erase the whole flash segment (usually 512 bytes, 128 bytes for the info memory).
By doing so, ALL data in thia area is lost. Also, erasing takes an even longer time (30 ms). Read the section about the flash controller in the MSPs family users guide. In reply to: Hello, I need to store data in the flash of MSP43FE427. But when I activate FCTL1 to erase, write or secure, the system is working OK. But when I reset the system, all the data becomes corrupted.

(Reference code: Demo2 code for Single phase Watthour meter). I use this code and I need to store the flash data in normal mode but not in calibration mode/UART mode. Please help me.
Here, I need to reset the system very often. At that time, the system needs to get the previous value from flash and update.
Then, the measurement must continue. The system writes the value into flash, but, it losts its measured parameters.
Regards, SeshuramV. In reply to: Writing to flash is a very problematic thing. Since you cannot continue executing code while the flash area is being programmed, you need to disable interrupts while doing so. You will lose interrupts. Writing a 512 bytes sector will take about 32ms.
If your application survives this, well, you can go on. Also, when you update your code, the stored data will be erased. Well, thsi is why there is the info flash. Smaller sector size and will normally not be erased when you update the code. You still have the CPU blocked for some time, about 24ms for 128 bytes per info flash sector.
But you cannot just enable writing and then write to flash. It's a bit more complicated. You can only write '0' bits to flash.
Cell Phone Flash Programs
To turn them back to 1, you'll have to erase the whole flash sector. It's like shooting (way more than you'd think, on physical level). You can shoot holes into a paper target, but you cannot fill the holes by shooting again.
Flash Creator
You'll need to replace the target. Flash is similar. You'll have to erase a whole flash sector before you can start writing 0s to it again, or the 0s from the last write will remain, resulting in nonsense.
Also, you'll need to finish writing and lock flash again before you can safely continue with normal operation. If you want to measure data and store it in an unused portion of the program flash, you must keep in mind that it takes some time, so unless you only need to measure on large distances (50ms IS a large distance for an MCU) you should look for a different way where you can write the data while continue measuring. An external I2C or SPI connected flash memory or EEPROM. If that's all okay for you, then you should post your actual code used for writing and we can take a look at it. In reply to: Hi Jens-Michael, I am working on a data logger using the C6747 with SPI Flash M25P64 on the EVM board. I totally agree with the problematic erase-before-write problem. However, I would like to ask you about your comment on 'Also, when you update your code, the stored data will be erased.'
Msp430 Code Examples
When you say '.update your code.' , are you referring to loading of program to the DSP? I have a problem that is puzzling me. I can write and read from the SPI Flash in a single program with no problem. I then tried to separate the write and read into 2 programs. First, I download the write program to write certain set of data and verify it with read within the same program.
Then, I load program that only read the data from the same segment and it failed. All the data read were 0xff.
It seems like it had been erase after I loaded my program. I would like to ask: will loading of program to DSP erased the SPI Flash? Why would that happened? Thank you so much for taking your time off to help me. I think if you upload the new code to the flash using the normal programming cycle, the programmer will completely erase the flash (not knowing that part of it contains data that should be persistent) and then uploads the new code.
(a complete erase takes 30ms for all flash, a segmented erase takes 30ms for each 512 bytes, effectively doubling the programming time. So normally, no programming software will selectively erase and flash new program code. There might be an option in your programming software labeled 'keep unused memory' or such. Then the programmer will read the current flash content before writing and put the contents back which are not overwritten by the new code.
All content and materials on this site are provided 'as is'. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials.
No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI. Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.
No it's not necessary. You can write on the information memory while the code with the writing instructions is executed from flash. Not only the information memory, but the whole flash (except the code section which actually writes the flash) can be written from flash. Actually the flash controller of the MSP430 handles it quite intelligently, while it in big scary sentences that: Reading from or writing to flash memory while it is being programmed or erased is prohibited.
If CPU execution is required during the write or erase, the code to be executed must be in RAM. This sounds a bit intimidating at first, but if you read through the whole chapter (highly recommended) you will stumble upon information which tells you, that while the flash controller is busy, a read from the CPU will return 0x3FFF which turns out to be the opcode for JUMP PC (jump to the program counter) which will just stall the CPU until the flash controller is finished doing it's thing.
The block write mode is not supported from flash, so you won't be able to get the fastest write times if you execute your write from flash. I'd say if you just want to write some calibration values or serial numbers, it won't matter much. If you try to implement your own bootloader to flash the whole device, you better run it from RAM and use the block write mode to gain speed. Just be careful with the erase instruction first to actually delete only the stuff you need to delete, I accidentally lost all calibration information once because I wasn't.