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/CC2640R2F: Turning off compiler optimization

Part Number: CC2640R2F

Tool/software: Code Composer Studio

We are trying to adapt the i2ctmp116_CC2640R2_LAUNCHXL_tirtos_ccs project to work with our own board.  It uses a smaller CC2640R2 package with less GPIOs, and when we try to run the code on our board it gets an error inside Board_init() and gets stuck at a while(1);

In trying to debug the problem by using single step through the section of code that gives the error (PIN_NO_ACCESS), it jumps around to different lines of code, which normally means that the compiler had optimized the code in that file.  It would be good to rebuild the file without the code being optimized, so that single step acts normally.

The file is called PINCC26XX.c.  Can we change a build option somewhere to change the compile option so that the file will be compiled unoptimized?  If so, where is that information located, and how can we change it to make the file be compiled unoptimized?

Thanks for any help you can give.
Dan Benkman
Innowave

  • Hi Daniel,

    The board files for i2ctmp116_CC2640R2_LAUNCHXL_tirtos_ccs are for CC2640R2F Launchpad. So if you use a custom CC2640R2F board with smaller CC2640R2F package, you need to modify the board files to match your custom CC2640RF board pinout.

    You can turn off optimization by going to project properties->optimization.


    -kel

  • To solve your initial issue, open the CC2640R2_LAUNCHXL.h and set PIN_UNASSIGNED for the IO that you don't use.
  • " you need to modify the board files to match your custom CC2640RF board pinout"
    We are aware that we will have to modify some files. But it seems to be extremely difficult to find out the exact names and locations of all the files we might need to modify.

    The size of the simplelink_cc2640r2_sdk_2_40_00_32 project is 841MB. There are 18,271 files in it in 1,801 Folders. It would take many months to examine each file to find what we might modify in it to work with our board. Also, the comments in the files are sometimes not very useful, so it would be easy to miss something.

    So the question is what are the 'board files' we need to modify, and where are they located?

    We would be very grateful for help in this
  • Thanks. We will try this.
  • At the i2ctmp116_CC2640R2_LAUNCHXL_tirtos_ccs CCS project the board files are below.

    Board.h
    CC2640R2_LAUNCHXL.h
    CC2640R2_LAUNCHXL.c

    -kel

  • You should look at the SimpleLink academy training to get you started on some topics. dev.ti.com/.../node covers covers drivers and also covers some on board files.
  • Thanks, I looked at the link you suggested, and decided to try the 'empty' project.  I have yet to access our custom board halfway around the world, but setting PIN_UNASSIGNED to the GPIO pins not available on our smaller chip resulted in a good compile and the blinking LED of the 'empty' project on my original TI board with the original chip package.

    I still have a question related to compiler optimization.  It turns out the two files I single stepped through that jump around are chipinfo.c and PINCC26XX.c.  They remain optimized because if I make a change to them they ignore my changes and don't compile.  Are they 'hard coded' low level files that can't be modified -- and thus can't be stepped through normally?

    Are they 'out of bounds' and not allowed to be modified or recompiled, or is there a way to force them to recompile?

    Thanks,
    Dan Benkman
    Innowave 

  • Out of the box, the compiled libraries are used for the drivers (see the project properties). But you can include the .c file you are interested in directly in the project, then you will be able to do changes in this and step through the code when debugging.