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.

Maximum code size

Expert 1175 points
Other Parts Discussed in Thread: MSP430F5418

Hai, I am using msp430f5418.

I have a simple question.

Can anybody tell me what is the code size limitation for the device, if there any limitation exits??

Currently I have about 45 KB of code size (reported by linker listing). it works fine now.

So I am guessing that the code size has no relation with the RAM of the device, since the device has only 16KB of RAM.

I heard that "MSP chip overwrites to it's own flash", what does that mean?

is it happens when the code size is exceeded a particular limit??

 

Thank you

Hari

  • Hi Hari,

    the MSP430F5418 is a 128KB flash device. The linker will throw an error if you exceed that limits.

    MSP430 MCUs have self-programming capabilities; that means you can write code which allows for reprogramming of a certain part of flash (i.e. for EEPROM emulation or firmware update).

    Rgds
    aBUGSworstnightmare

  • Thank you for your answer.

    So you are saying that the code size can be a maximum of 128KB, since the size of flash is 128KB.

    Suppose if I add a memory chip of 2MB, can the size be that much??

    Although self programming is a good functionality. It can't happen unless we don't issued the command to do that. There is nothing to worry about it, isn't it?

  • Hi Hari,

    you need to issue a set of commands to start a programming flash memory; there's an example on how to do that in the code examples http://www.ti.com/litv/zip/slac166o

    Pls notice that the device is questions doesn't has an external memory bus. By adding a 2MB memory chip (i.e. an SD card because they're cheap) to the controller you would need to load each instruction from SD card to RAM and run your application from RAM. Although it's not impossible it would be a pin coding this.

    What you may want to do is using the external memory for storing large data.

    Rgds
    aBUGSworstnightmare

  • Hari said:
    Suppose if I add a memory chip of 2MB, can the size be that much??

    Well, yo (or nes?) :)

    The address bus of the MSP is not available externally, so you cannot extend the amount of flash (or ram) you can directly access. You can, however, interfacy any kind of external memory through the ports. This includes SD cards, external memory chips or even HDs. But this access mus tbe controlled by your software.

    The MSP, however, can reporogram its flash at runtime. So it is possible to load library functions from an external memory and execute them either in RAM or to write them to flash and execute them there. This is, however, not directly supported by the compiler toolchain and requires some tweaking. But it is possible.

    I theory, you can set up a bootloader that gets a command from outside and then loads onf af several applications from an external module and writes itinto flash, where it is executed as if it were always there. This can be used for field-configuring an universal device for a specific task, updating UI informations (fonts, input/output masks etc,).

    However, at any time there can only be 128k of code inside the MSP which can be direclty executed (144k, if you count in the 16k ram from whicoh code can be executed too).

    BTW: The 5437 processor has 256k flash built-in, and is pin- and functional compatible to the 5418 (and the 5438 is the 256k version of the 5419, which has more peripherals and pins, but is otherwise compatible to the 5418)

  • Thank you for your valuable suggestions Hari

**Attention** This is a public forum