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.

TI MSP430F2419 bootloader

Other Parts Discussed in Thread: MSP430F2419

TI MSP430F2419 microcontroller. 

I am writing a bootloader that reprograms the part and, when performing a block erase, the block that is erased is “off” by 256 bytes. 

For instance, if I perform a dummy write to 0x2100 (start of FLASH) to start a block erase, the memory range from 0x2000 – 0x21FF is erased.  The datasheet indicates that FLASH resides in the memory range of 0x2100 – 0x1FFFF, so I appear to be erasing 256 bytes of RAM and 256 bytes of FLASH when I do this erase.  Also, 0x1FFFF – 120KB is 0x2000, not 0x2100.  Is the datasheet incorrect or do the FLASH segments from an erasure standpoint need to start at 0x2000?  If so, I assume that I should keep an eye on my RAM usage and stay out of the 0x2000 – 0x20FF range.

  • Hello AJP,

    You are on to a couple of things here. First, there is an error on the datasheet. The datasheet indicates on page 1 that there is 120KB of flash + 256 bytes. This is the error. The 256 bytes refers to the 256 byte segment in Information memory. In fact there is a total of 120KB of flash (Not 120KB +256 bytes) including the 256 byte block in the information memory. 

    Now, you have already pointed out that 0x1FFFF-120KB is 0x2000. The way is actually works is 0x1FFFF - (120KB - 256B) = 0x2100.

    The other 256 bytes are in information memory at address 0x010FF-0x01000. 

    The next step is to understand how flash is segmented. If you look at page 312 of slau 056- the users guide for the 4xx family you will see the flash memory segmentation (for a 4K byte example). I know you are using 2xx, but I had this handy and it works the same way.

    http://focus.ti.com/lit/ug/slau056j/slau056j.pdf

    This segmentation works the same for the MSP430F2419, starting at 0x1FFFF (not 0xFFFF) is the first 512 byte block: 0x1FFFF-0x1FE00. This continues on down through memory 512 bytes at a time until you reach the 0x21FF segment. As you mentioned this should be 0x21FF-0x2000, but it is not. There is only a total of 512 bytes left and 256 is reserved for information memory. Therefore, the block 0x21FF-0x2100 exists instead of 0x21FF-0x2000. 

     

    In summary, all blocks of flash are 512 byte blocks except one 512 byte block that is split into 2 separate 256 byte blocks at addresses 0x2100-0x21FF and 0x1000-0x10FF. If you erase the 0x2100-0x21FF block, don't worry, it will not erase the info memory block at 0x1000-0x10FF with it. 

    As for your RAM being erased I am not sure what is going on. I would suspect that RAM is already empty when you perform your first block erase? The first 256 byte block of flash confuses people so I wanted to set you straight there. If you continue having RAM issues open another thread.