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/TMS570LC4357: Number of arguments in a function

Part Number: TMS570LC4357

Tool/software: Code Composer Studio

Hello E2E Support Team,

I use TMS570LC4357 microcontroller. Code Composer Studio version is 6.1.1.00022.

I have a function that has 7 Arguments passed in it. But only the first 4 Arguments get the correct value assigned when the function call enters function definition.

Last 3 Arguments get a random value.

Is there any limitations to pass number of Arguments with respect to the compiler? Awaiting for your support.

Thanks,

Sindhu

  • Sindhu Krishna said:
    Is there any limitations to pass number of Arguments with respect to the compiler?

    No.

    How do you know the last 3 arguments are wrong?  Exactly how do you see it?  

    Thanks and regards,

    -George

  • Hello George

    I did "Step into" in Disassembly Window. Where I found the first 4 arguments were backed up in Registers R1 to R4. Then loaded back to these variables. The last 3 arguments had different values being passed to the function definition.
  • How arguments are passed to functions is described in the section titled Function Structure and Calling Conventions in the ARM compiler manual.  The types of the arguments affect how it is done.  In your case, it is likely the first 4 arguments are passed in registers, and the rest are on the stack.  When you stop at the start of the functions, you should be able to see all the arguments in the watch window.  If you can't, step a few instructions into the function, so that the local frame is set up.  If you still cannot see the arguments in the watch window, then there is probably some problem with the debugger.

    Thanks and regards,

    -George