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.

CCS v5.3 error reading 'used' flash in map file

Other Parts Discussed in Thread: MSP430FG4618, MSP430FR5739, MSPMATHLIB

MSP430FG4618 uC

I just switched a project from CCS v4.2 to v5.3

In v4.2 there was ~4kb of used flash memory.

With the same processor and code in v5.3, the used flash memory reads 14,254! (Unused 0x96b2)

I note that at the top of the map file: MSP430 Linker PC v4.1.5

Is there a different way to read flash in v5.3?  Or, is there a known bug?

Thanks in advance!

  • Hi,

    I suspect this might be from different compiler versions.  Perhaps an unintended option changed etc.   Can you provide more details?  Do you see the normal code size using the older compiler version?  You can add it using window->prefeernces->code composer studio->build-> code generation tools if you have not deleted it.

    Please keep us informed.

    Best Regards,
    Lisa

  • Hi Lisa,

    I have both compiler versions on my computer, installed in different folders with independent Eclipse installs. 

    All of the options are default for the install.

    Yes, I see the normal code size in the v4.2.

    Ah, why would I add the v4.2 code generation tools to v5.3?  

    Can you elaborate?

  • Hi,

    my thought was to verify this was from the change in compiler version to start isolating what would cause the code size inflation.

    Some early v5 releases had a couple compiler bugs for example, some already fixed in the latest release.   For example, did the version update

    - change the optimization settings?

    - have you verified the linker command file is as desired?

    - eabi(ELF) - new msp430 default vs COFF

    The map file itself does not have a different interpretation and really should make sense when compared to the linker command file.

    Best Regards,
    Lisa

  • Hi Lisa,

    I downloaded the CCS v5 a month or so ago, then updated it yesterday:  v5.3.0.00090

    I have not optimized this code, it this what you are asking?

    The linker command file is the default, and I beleve my earlyer post stated the linker version in the map file.

    I do not know what the following means (I have default setup): - eabi(ELF) - new msp430 default vs COFF

  • Hi,

    there is lots of google information available about ELF and COFF standard formats.  My point was simply

    We are trying to understand where your code is getting inflated.  It would be good to know

    - did any settings change with the migration?

    - was this a fresh and full ccs v5.3 installation?

    - how was the migration done?

    Best Regards,
    Lisa

  • The long story of CCS v5.3, I will paste your comments into this response to make things easier:

    Hi,

    there is lots of google information available about ELF and COFF standard formats.  My point was simply

    I use CCS in it's default install state, does this answers your question?

    We are trying to understand where your code is getting inflated.  It would be good to know

    - did any settings change with the migration?

    Well, I did not check the settings before and after, I use the default install settings.

    - was this a fresh and full ccs v5.3 installation?

    All installs are in a new directory and a fresh install of Eclipse. 

    Here is the scoop:  I installed CCS v5. something over a year ago.  It turns out that the version I installed, even though downloaded for W-XP, was for Linux.  Thus, I removed it and cleaned my registry.  Then I put in what was to be the correct version of v5.x and during the install, the internet connection failed, I deleted this one also.

    I installed again, and this version did not work properly, so I waited for the bugs to get fixed.

    I removed the old version of v5.x and downloaded the latest version a few weeks ago, then went through a full update.

    Needless to say, I am not happy with CCSv5.x 

    - how was the migration done?

    I keep my old version of CCS v4.2 (thank goodness) and installed new version of 5.x each and every time.  I make new workspaces in the respective version of CCS, and insert the '.C' file to build a project.

    Does this help?

    Best Regards,
    Lisa

  • Hi,

    Ok, this does help us some, but what would really help (and I should have asked in the previous post) is if you could send us the two map files.  You can do this offline ... my ID is a link which may be used for a friend/conversation request.

    The increase in code size is likely due to the move from COFF to ELF (as in my previous question) but to really understand where the increase is coming from we would need to look at their 2 map files – from the older and newer codegen versions.

     

    One change that could contribute to code size increase is the difference in size for type “double”. Please see this post for details: http://e2e.ti.com/support/development_tools/compiler/f/343/p/190046/682220.aspx#682220

     

    However, I wouldn’t necessarily presume that is the case here.

    Best Regards,
    LIsa

  • Hi Lisa,

    Thanks for your ongoing help!

    I forgot how to send you an e-mail, let me know and I will attach the map files you requested.

    I will read the link you posted later, for now, yes I am using a type float variable (I am swamped!).  I am only using type float temporally to field test an application, will make code more efficient once control theory is proven.

    I am converting resistance to temperature using a Pt1000 RTD (copy of this calculation in the copy of the map files you requested).

    Restated, if you have an example (c-code) of fixed point calculation for square root (SQRT) , please do share the example with me :)

    I have found that in v4.2, the program keeps resetting due to some code error?  In v5.3, the code seems to work fine (other than some annoyances like what we are dealing with now).

  • I checked the Properties > General (the defaults are set as):

    Compiler version:  TI v4.1.5

    Output format:        eabi (ELF)

    I was thinking the default for an MSP is COFF?

    Any advice here?

    Will each time I build a new workspace the settings I set here take effect?

    At Build > MSP430 Compiler > Processor Options

    Silicon version:  mspx (what is the difference with just msp?)

    Application binary interface: eabi

  • Hi,

    COFF used to be the default.  But in the newer version no longer.   I can check if you can change the default for you.

    mspx is for the larger msps with 20 bit wide registers.  msp for smaller 16 bit ones.

    Hope this helps clarify.  So did you find it was ELF vs COFF?

    Best Regards,

    Lisa

  • Lisa: Hope this helps clarify. So did you find it was ELF vs COFF?

    MAC: I thought the former message I sent stated the file was ELF?  If this is not correct, please tell me where to look for the answer to this question?  Is the answer in the MAP file I sent you?

  • Hi,

    it is a long weekend so responses will be slower, howevere

    - I still have not recieved on offline messages or any files from you

    - in older compiler versions, COFF was the default.   In newer versions we have moved to ELF   So yes I expect the v5 generated code to be ELF.

    Best Regards,
    Lisa

  • Hi Lisa, I think the float variable was the issue with the memory error.

    When you get back from your Easter egg hunt, I hope this information will be of use, but first a short and dumb story:

    I thought I would save some time by not using fixed point calculations.  Rather, I used a float type variable to calculate a square root.  Following are the results for both versions of CCS without the type float. 

    v4.2   Flash Used = 0x998 = 2456d Optimize -> 0x982 = 2434d

    v5.3   Flash Used = 0xb28 = 2856d Optimize -> 0xAE6 = 2790d

    I set the Optimization in v5.3 (everything else is default including the output format of eabi(ELF):

    Optimization level: 4

    Control speed vs. size trad-off: 0

    Now I change to output format legacy COFF:

    v5.3   Flash Used Optimize -> 0x956 = 2390d

    1) Upon re-staring CCS v5.3, the default changes back to eabi(ELF).

    2) Big But, the legacy COFF has some kind of error in the code that results in the reset of the control in v5.3.   If I place a break point in the main(), that break point keeps being hit.  

    Question: Is there a single ISR that can handle all the unused interrupts? If so, please share a code example.

    At any rate, I put in all the dummy ISR with break points, none of these interrupts are being hit.  We are working on ......

  • Hi,

    I am happy to hear you have found the source of the code size difference.  I have moved this to the msp forum for you as they will know best about interrupt handling on their parts.

    All the best with development.

    Best Regards,
    Lis

  • Hi Lisa,W

    Please let me know how to contact you off line. The issue turns out to not be solved.  We need to chat about how I am going to fix the issue.

    It looks like it was a mistake to add you as a friend, it appears that I am filling my inbox with all of your posts, can I just reject the fiends thing to solve this issue?

  • Hi Lisa,

    I need you to tell me how to turn off the e-mails coming to my e-mail account.  Apparently I toggled something on, and can not turn it off.

    I assume I will hear back on my issues with CCS v5.3?

  • Hi,

    I am still waiting for details of your issue and map files.   I have requested help to stop the emails so hopefully we can get that done for you.

    Best Regards,
    LIsa

  • Greetings,

    It appears you are subscribed to get email alerts for all of Lisa's E2E activity. If you want to turn it off we can help and alternatively at any time to manage your subscriptions click on your username in the top text navigation and then once on your profile page go to the "subscription" tab and you can remove any subscriptions you no longer wish to get.

    Blake

  • Hi Lisa,

    I was hoping to hear back from you after our last correspondence. 

    It is good that time has gone by,  to summarize my ongoing issue with CCS v5.x, I took part in the Beta program for CCE.  I have had many versions of CCE and CCS on this computer.  I need to know if there is a way to clean up my registry and start anew with CCS?  I ask because I have programs on this hard drive that I can not reinstall due to their age.  Presently, I am still using CCS v4.2.4 because it works, with the exception of a few issues I can get around.

    At this point, it sounds as though I need to reformat and do a fresh install of CCS v5.3.  I do not want to do this until all bugs are worked out with v5.3.  Can you advise me as to wait until a newer 5.x version arrives that is the most bug free?  

    I want to save time if posable, thank you for your ongoing support. 

  • Hi,

    unfortunately there is not really a super clean way to remove the installation(s).  We usually do this here as a mostly manual process ourselves.

    Yes a clean installation of the latest released version is always the best.   v5.4 should be out soon if you would prefer to wait for that.   Of course no one can make any "totally bug free" guarantee but each release  more bugs are found and fixed.

    Best Regards,
    Lisa

  • Sounds as though you have a manual method to remove CCE and/or CCS.

    If you can share the manual method of cleaning out my registry, I would like to start fresh with CCS.  I have never used 5.x todate due to a series of problems.

    You have my e-mail address, any instructions would be greatly appreciated. 

  • Hi,

    we simply remove the folders and don't usually do anything with the registry.

    As mentioned, if you are able to wait a touch, v5.4 is soon to be released.  Otherwise we post the most current version here

    http://processors.wiki.ti.com/index.php/Download_CCS

    Best Regards,
    Lisa

  • Hi Lisa,

    Here is my plan, I found a back-up hard drive that has the programs that I do not want to louse by reformatting.  This drive has CCE 3v beta on it.  I will start with this drive and remove the beta version and clean the registry before installing the v5.4.

    I think my whole issue is that when I installed v5.0, somehow it was the version for Lenux.  This may have corrupted my registry? 

    Otherwise, I will report back and state if this fixes the ongoing issues with 5.x

  • MAC Engineering said:
    2) Big But, the legacy COFF has some kind of error in the code that results in the reset of the control in v5.3.

    In COFF, uninitialized variables are exactly that: uninitialized. If your code assumes that they are initialized to 0, it may fail and do weird things.
    In ELF, uninitialized variables are initialized to zero, which takes additional time at startup, makes reset-persistent data more difficult and may cause problems with the watchdog on larger amounts of data. However, it is compatible with what most C coders expect.

  • Hi Mr. Gross,

    Thank you for your comments.  I must admit I am confused as I do not remember posting a question about "legacy COFF".  Could you refresh my memory.

    At any rate, I am not initializing the variables to a value, when the variables are set by the code after initialization.  This is an old habit from CCE, where if one did not have to initialize variables, this would save some memory.   My understanding it that the new format used with CCS v5.x, erratic behaviour may result if there is no initialization to a value during variable declaration?    

  • W.r.t. code size compiling this example for a MSP430FR5739 with MSP430 Compiler 4.1.5 in CCS 5.4:

    #include <msp430.h>
    #include <math.h>

    /*
    * main.c
    */
    int main(void) {
       volatile float input = 743.0f;
       volatile float result;
        WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer

        result=sqrt(input);

       return 0;
    }

    Results in:

    - Code Size - Text: 7174 bytes Data: 348 bytes when the output format is eabi (ELF)

    - Code Size - Text: 1926 bytes Data: 106 bytes when the output format is legacy COFF

    The difference is because is with eabi (ELF) the size of double is 64-bits whereas with legacy COFF the size of double is 32-bits. sqrt is defined to take double parameters, and so in the above example there is an implicit cast between the float variables and double in the call to sqrt.

    If the above example is changed to use sqrtf which takes float parameters, then the resulting size is:

    - Code Size - Text: 2264 bytes Data: 324 bytes when the output format is eabi (ELF)

    - Code Size - Text: 1908 bytes Data: 98 bytes when the output format is legacy COFF

    If your code only needs 32-bit floats then to reduce the code size you should call the float, rather than double, variants on the floating point library routines in math.h

  • MAC Engineering said:
    Thank you for your comments.  I must admit I am confused as I do not remember posting a question about "legacy COFF".  Could you refresh my memory.

    The quoted text is from your post on the first page of this thread. You were not explicitely asking but rather stating that there is a error with COFF, and I pointed out one of the difference between COFF and ELF which can make an application to choke.

    If an applicaiton was developed in ELF anbd then are compiled with COFF, uninitialized variables may make the program crashing as they won't contain the assumed initial value of 0.
    OTOH, the additional initialization of uninitialized variables in ELF mode may make the watchdog trigger befor emain is reached, when it didn't in COFF.
    And IIRC, the init values are now stored in compressed format, whcih saves flash, but adds to the tiem needed for init. (again, teh watchdog may trigger where it didn't before).

  • Chester Gillon said:

    If the above example is changed to use sqrtf which takes float parameters, then the resulting size is:

    - Code Size - Text: 2264 bytes Data: 324 bytes when the output format is eabi (ELF)

    - Code Size - Text: 1908 bytes Data: 98 bytes when the output format is legacy COFF

    If the sqrtf example is changed to use the new MSPMATHLIB, then the code size when compiled for eabi (ELF) reduces to:

    Code Size - Text: 982 bytes Data: 2 bytes

    i.e. the new MSPMATHLIB can reduce code size, as well as reported speed increase. 

**Attention** This is a public forum