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.

TMS320F280037: Analysis of CLA compilation error problem/CLA编译报错问题分析

Part Number: TMS320F280037

Tool/software:

We are currently compiling CLA code in our project and the compiler is reporting an error, making it difficult to pinpoint the cause. Can you help us take a look?

Phenomenon 1: compilation errors are reported when calling 7 function arguments transfer in xx.cla file, and the function content has been masked.

Phenomenon 2: compilation normal are reported when calling 6 function arguments transfer in xx.cla file, and the function content has been masked.

Based on the phenomenon, it seems to be a stack overflow error. If not misunderstood, cla's stack space is allocated in the. scratchpad segment.

When passing 6 arguments , Memory Allocation shows that there is still ample space pointed to by the stack.scratchpad segment.

Looking forward to the TI experts' response.

  • Hello,

    Are the functions being called directly from CLA a task? Or is there some nesting beforehand?

    As a note, in CLA programs you generally want to avoid too nested function calls, as this will slow down the CLA program and the scratchpad could overflow. In older versions of the CLA peripheral, a maximum of two function calls were allowed, although this requirement has been removed on the CLA for F28003x.

    Could you show what error message is shown in the console when you switch the function to having 7-parameters?

    Best Regards,

    Delaney

  • Hello,Delaney:

    Thank you for responding to my question.

    The error message displayed on the console is consistent with the error message displayed on the problems.

    The function is executed through a total of 4 layers of function calls.As shown in the figure below.

    Perhaps as you described, there are too many layers of function calls and arguments passed, which can lead to scratchpad overflow.

    But 28003x supports nested functions with more than 2 layers,the RAM memory space pointed to by the Scratchpad segment is also sufficient.

    There are some other rules that I am not aware of that limit the current program compilation?

  • Hi Shibo,

    Could you scroll up in the console log to see if there are any other error messages shown? Usually the actual issue(s) will create their own message and then at the end it will display the "Target 'all' not remade because of errors". 

    Best Regards,

    Delaney

  • What confuses me is that there are no other error messages on the console, even if I slide up to view all the information on the entire console

  • Hi Shibo,

    If you try doing a "Rebuild" rather than a "Build", does it show the description of the error in the console? It's difficult to say exactly what's going on without knowing what the error is being thrown for. 

    Also, in the working case with 6 parameters, are you checking the scratchpad before or after branching to the function?

    Best Regards,

    Delaney

  • Hi,Delaney

    I have tried "build" and "rebuild" many times, and the results displayed on the console are consistent.

    The multi-layer function calls you saw above are because we use MATLAB to automatically generate code using MBD, and the architecture determines the software calls. After communicating with you, we made various attempts and finally modified the architecture to store the parameter values that need to be passed in an array and pass them over. After generating the code, the function calls arguments by taking the first address of the array, reducing the number of parameters passed and making the compilation pass. However, the reason why it could not be compiled before is still unknown.

  • Hi Shibo,

    I'm glad to hear the program is building now. Besides fixing this, reducing the number of function calls will also help with CLA performance. 

    As far as the reasoning for behind the compilation error, I will consult some other experts to try to find the root cause. 

    Best Regards,

    Delaney