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.

TMS320F28388D: __attribute__((ramfunc))

Part Number: TMS320F28388D
Other Parts Discussed in Thread: DAC81416

Hi team,

CCS Version: 11.1.0.00011 

Version of the compiler: ti-cgt-c2000_21.6.0.LTS

1)

Referring to the compiler documentation page 139, the customer adds a description of the ramfunc attribute to the function that they want to execute in RAM. When do not switch to flash mode, the keywords in the function are shown as normal, as shown in the following figure: 

However, when you switch to flash mode, the keywords that would otherwise appear are not displayed, as shown in the following figure: 

Also, using the shortcut key F3 on the function name only positions the function to its declaration, as shown in the following figure: 

But when compiling it's good, and the results of the .map file are fine. Why's this?

2) If a function is defined with the ramfunc attribute or declared with the original #pragma, the correspond function is loaded to flash and then final move to run in ram. However, if other functions are called in this function, they are not moved together to run in ram, as shown in the following figure: 

From the .map file, TIMER0_ISR is the function called in the TIMER0_ISR interrupt function, DAC81416_SPI_Write, the address is as follows: 

As you can see, the DAC81416_SPI_Write has not been moved to ram with the TIMER0_ISR. To move to an interrupt function executed in ram, write the function to be implemented one by one with statements, without function encapsulation, right? What does the compiler do if a macro function is called, such as RC_macro used here? 

Could you help check this case? Thanks.

Best Regards,

Cherry

  • Hi Cherry,

    However, when you switch to flash mode, the keywords that would otherwise appear are not displayed, as shown in the following figure: 

    I can reproduce the issue using the latest version of CCS. It seems like applying the attribute keyword to a function causes issues with the indexer. I can see that some syntax error was indicated for that line in the parser log.

    But when compiling it's good, and the results of the .map file are fine. Why's this?

    The indexer and compiler are unrelated. The indexer is a parser tool that comes with Eclipse that scans all the source of a project and builds an cache (index) that is used by the editor for things like syntax highlighting, code completion, just to declaration, etc. It is unrelated to compilation. The indexer is known to be a bit buggy.  

    I will note this issue. But please be aware that since CCS simply leverages the Eclipse CDT indexer, it is not something that we own. Hence if a fix is needed in the indexer itself, it may be something we cannot address ourselves. Also note that the CCS Eclipse environment is slowly be deprecated in favor of our new CCS Theia environment.

    As for #2, I will defer to the compiler experts.

    Thanks

    ki

  • The ramfunc attribute only applies to one function at a time.  It does not automatically propagate to the functions called by the function with the ramfunc attribute. 

    There is a compiler option --ramfunc=on.  I have never known anyone to use it when building an entire project.  Instead, the file specific options feature of CCS is used to apply it to one file at a time.  In that case, the all of the functions in that file are built as if the ramfunc attribute is used.

    Thanks and regards,

    -George

  • Hi Ki and George,

    Thanks for your support and just want to make sure, the possible solution is to centralize the interrupt functions into a user-created C file and then add the --ramfunc=on option to its build tag.

    The customer's coding habit was to use the default F2837xD_DefaultISR.c file to add own code to the corresponding interrupt functions defined in this file. If follow the above reply, because the F2837xD_DefaultISR file has all of the interrupt functions specified, having ramfunc=on consumes too much RAM space, so the coding habit is not so good, right?

    Thanks and regards,

    Cherry

  • I can only explain the ramfunc features of the compiler.  How you apply those features to your specific circumstances is up to you.  That said, the solutions you describe appear to be reasonable.

    Thanks and regards,

    -George