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.

AM2634: What is the proper sinf/cosf library to use?

Part Number: AM2634
Other Parts Discussed in Thread: MATHLIB,

Tool/software:

My question might not be the correct question, as I don't fully understand the problem. What is occurring is: my calls to sinf and cosf, that the (I think) makefile is picking up from C:\ti\ccs1230\ccs\tools\compiler\ti-cgt-armllvm_4.0.0.LTS\lib\armv7r-ti-none-eabihf/c/libc.a is corrupting many of my global variables. Each of calls is causing wide-ranging memory corruption. 

I then thought -- maybe this libc.a is not the correct library to use for math, and I found the mathlib.am263x.r5f.ti-arm-clang.release.lib from the MCU+SDK, but I cannot get the linker to choose this mathlib over libc.a, probably because libc.a is in the compiler path?

I have deleted all compiler-include-path options and linker-file-search-path options except to point to only my source directory. 

Any guidance here would be appreciated, but I think the questions are:

1. What is the proper sinf/cosf library to use for the AM2634?

2. Then how do I force the build preference of the preferred library over libc.a?

Thanks,

Jim

  • Do your types match what the library expects?

    Can you create a small example that shows the problem and post it here?

  • Keith,

    Before I try to create a small project to show this, which may change the outcome, it occurred to me that enabling ECC might affect global-variable initialization. This problem seems to only affect initialized globals, and different compilations will cause different variables to be corrupted. When I worked with ECC on the hercules, I think the process of enabling ECC erased all of that memory. I am using code from a few of the example projects to enable ECC on TCM, MSSL2, and R5FSS0 CORE0 DATA memories. Could the enabling of ECC on these memories be contributing to the corruption of initialized globals?

    Thanks,

    Jim

  • Sorry to bother you with this; it was a stack overrun caused by the additional calls to sin/cos.