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.

How can I make 1 firmware to work on two mcus without recompiling?

Other Parts Discussed in Thread: MSP430F5505, MSP430F5507

Hi,

I have two mcus F5505 (16KB) and F5507 (32KB), I want my firmware to be compatible with both mcu. How could I make it to work without re-compiling the code in CCS 6.1?

Should I modify the lnk_msp430f5505/7? And which part should I modify? What other files needed changes for this to work?

My code has specific

SECTIONS
{
...

.run_from_ram : load =  FLASH_MEM, run = RAM_MEM

...
}

which exist only in lnk_msp430f5507. 

Thanks

  • F5507 has everything F5505 has plus 16KB of Flash which you do not have to use. Thus if you have an object code that works in F5505, that same object code would work in F5507 without any change.

    Your requirement of load to FLASH & run in RAM could be something superficial. But if you have to use it and it works with F5507, it would work too with F5505.

    Having said all that, I do not know if CCS will allow you to do them. These things are very simple to do, but CCS maybe too smart to do such simple things and will automatically do something else.
  • Thanks old_cow_yellow for your reply.
    That's what I thought initially.
    The object code works very fine in F5507 but failed in F5505 during flashing using Elprotronics Lite FET-Pro430 flash programmer.
    The programmer detected the mcu as F5505 which is correct but when tried flashing it showed me an error.
    Error dialog says:
    "Code size (including Serial Number and Model Text) exceeds the Target Microcontroller Flash Memory space. Would you like to continue writing process anyway?"

    The code size doesn't go beyond 16KB boundary, I checked it in CCS->View->Memory Allocation, it takes up 15306bytes Flash memory only. Should be fine in F5505, right? Was the error cause by .run_from_ram section?

    Let me know your thoughts on this.
  • The problem is that the flash is aligned to the end of the address space (because the reset and interrupt vectors are there), so the flash starts at different addresses  in these two models.

    Ensure that the code is compiled for the smaller model. The resulting binary will not be loaded at the start of the flash in the bigger model, but this does not matter.

  • Gee said:
    That's what I thought initially.
    The object code works very fine in F5507 but failed in F5505

    Your thinking was wrong. (Did I not make myself clear in my first reply?)

    Object code that works on F5505 works on F5507 too.

    Object code that works on F5507 may not work on F5505. Even if it uses only 16KB of Flash, it may be using the 16KB that the F5505 does not have -- so it will not work on F5505. If is using only the 16KB that F5505 does have, then if will work in F5505 too.

  • Thanks Clemens and old_cow_yellow for your input.

    I checked the properties of my project and it was set to small for data memory model, globals for 'data must be near', but large for code memory model, did you suggest to make it small also? If so, I'll try and see if it make any difference.

    Hi old_cow_yellow,

    How can I make the F5507 object code to use the 16KB that F5505 uses?
    In F5505 the Flash origin was at 0x8000 whereas in F5505 it was 0xC000.
    Can I force my F5507 object code to use 0xC000 of F5505? If so, will the other vectors (interrupt, reset) be affected?

    thanks
  • Just compile for the F5505.
  • Thanks Clemens.
    I tried the F5507 object code to start at 0xC000 to use F5505 16KB flash mem, and it did works.
    Same thing with compiling it for F5505, your suggestion.

    However, I need to remove the .run_from_ram section as it takes 200bytes of flash.

    Thanks
  • You said it works, so I don't understand what the problem with this section is.

    Anyway, you added this section for reason. What was this reason?

**Attention** This is a public forum