This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430F5529: How does the __data20_write_char work in the intrinsics file?

Part Number: MSP430F5529

Hello TI forums,

I am using the __data20_write_char to write directly to flash, but I am worried that the function is erasing the flash sector for every write command and then replacing the bytes around the specified address, so it is wearing out the flash too quickly.

According to my understanding, every time a flash write operation happens, it needs to perform a flash erase of a segment (512 Bytes?) and then it can change the corresponding 1's to 0's for each byte, but how would this be implemented using the intrinsics functions? Is there a better way to write to flash to ensure flash longevity?

I am using this to perform over the air firmware updates, and I basically take the TI-TXT file that is generated from CCS and write bytes starting at the location specified by the @ symbol, so basically, if it needs to write100 bytes starting at 0x8000, I do a for loop for 100 bytes using the __data20_write_char starting at address 0x8000, but will this wear out the flash too quickly? Is there a better way to do this?


Thank you,

Nicolas

  • Flash erase and flash write operations are quite separate. After configuring the flash control registers for an erase operation, a write to the segment triggers an erase. Similarly for a data write. The intrinsics do not fiddle with flash control registers at all.

    To write to 0x8000 all you really need is a simple pointer. Be sure to check the data sheet for timing limitations on flash writes.

  • I want to say Thank-You to David for helping answer this and many of the postings here on the forum.  Your contributions are super appreciated :)

  • Hi Nicolas,

    It's been a while since we have heard from you, so I'm going to assume you were able to move forward with your project.
    I will mark this posting as RESOLVED, but if this isn’t the case, please click the "This did NOT resolve my issue" button and reply to this thread with more information.
    If this thread is locked, please click the "Ask a related question" button, and in the new thread describe the current status of your issue and any additional details you may have to assist us in helping to solve your issues.

**Attention** This is a public forum