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.

CC2652R7: Consecutive Builds without code change results in different .hex files

Part Number: CC2652R7

Hello, 

I have noticed that if I build the same project consecutively without changing the code, the hex files are completely different. It seems to be related to CCS v12.7 which I am currently on because when I was on CCS v12.6 and this wasn't an issue. So I'm wondering is there is a setting I can toggle to fix this or if I should just revert to the older version. Also using the SDK I am using is 7_40_00_77.

Thanks,
Kenneth Thomas

  • Hi Kenneth,

    Let me check if others on my team have noticed this behavior, I'll get back to you within 3 business days.

    Thanks,
    Toby

  • Hi Kenneth,

    My team has not noticed such a behavior, we just did a similar test with F3 SDK (CC2340), and the hex files are identical when building twice with the no code changes (expected).

    Yes, I'd recommend reverting to a version which worked ok for you (CCS 12.6).

    Note that according to the Release Notes ( dev.ti.com/.../node ), the recommended CCS is " CCS-12.5.0".

    From my experience, usually a Release Notes "+1" version should work ok (e.g. CCS 12.6 == CCS 12.5 +1).

    Thanks,
    Toby

  • Hey Toby,

    Sorry for taking so long to respond but I tried reverting it back to CCS v12.6. I thought I had already checked to see if consecutive builds produced different hex files however maybe we didn't do enough builds. So we have few more observations, 1) sometimes it can take up to 7 times for a different hex file to be produced, 2) changing the optimization level seemed to help but not fix the problem, 3) project_zero which our project is currently is built around doesn't seem to have this same issue, 4) something to note is that our entire project include our project_zero file is written in C++, 5) Also by consecutive builds I mean like rebuild projects, 6) Lastly our map, out and bin files also seem to be different as well.  

    These are some photos for reference:

    Thanks,
    Kenneth

  • Hi Kenneth,

    1) sometimes it can take up to 7 times for a different hex file to be produced, 2) changing the optimization level seemed to help but not fix the problem

    This is an interesting observation. I don't think I've seen it before.

    3) project_zero which our project is currently is built around doesn't seem to have this same issue

    Thanks for confirming this. We also tested with an out-of-box SDK.

    4) something to note is that our entire project include our project_zero file is written in C++

    That might be a good clue... I wonder if there is something additional needed to enable C++. I'll look into adding C++ code to an example to see if I start noticing the same issues you've reported.

    5) Also by consecutive builds I mean like rebuild projects

    Understood.

    6) Lastly our map, out and bin files also seem to be different as well

    This is at least a good sign of consistency -- whatever's causing the hex file contents to be different is likely also causing differences in map/out/bin files.

    I'll look into this and update you within 3 business days.

  • I got these observations from a team member who was also looking into this problem. 

    1) "FYI, by unchecking "Enable parallel build" on the project properties (Build page), the file order in the build log is fixed. But that doesn't solve the issue. So maybe the linker is parallelizing something as well and that's not deterministic.

    2)I built the project 21 times (which is 3x as much as previous max before observed build inconsistency) with optimization level 2 (instead of z), and there were no inconsistencies.  In addition, back to level z, but then checking "select link-time optimization" (which made the build take forever), also made the build consistent (ran 21 times)"

    Hopefully this helps too

  • Hi Kenneth,

    I tried reproducing this on my end, but unable to.

    What I'm using:

    • CCS 12.6
    • F2 7.40 SDK (CC13xx/CC26xx)
    • example: C:\ti\simplelink_cc13xx_cc26xx_sdk_7_40_00_77\examples\rtos\LP_CC2652R7\drivers\empty\freertos\ticlang
    • number of re-builds: 22
    • optimization level: z

    For the C++ aspect, I renamed empty.c to empty.cpp, and added a simple class.

    Code attached: 

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /*
    * Copyright (c) 2015-2019, Texas Instruments Incorporated
    * All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the distribution.
    *
    * * Neither the name of Texas Instruments Incorporated nor the names of
    * its contributors may be used to endorse or promote products derived
    * from this software without specific prior written permission.
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Can you share with me a simple project which causes the issue you observe?

    Thanks,
    Toby