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.

Linker Error in CCS



While trying to complete Lab 1 of PRU Training, I'm getting a linker error:


unresolved symbol __PRU_CREG_CFG, first referenced in ./main.obj   

<Linking>
warning #10247-D: creating output section ".creg.CFG.noload.near" without a SECTIONS specification

 undefined      first referenced
  symbol            in file     
 ---------      ----------------
 __PRU_CREG_CFG ./main.obj      

error #10234-D: unresolved symbols remain

for the line:   CT_CFG.SYSCFG_bit.STANDBY_INIT = 0;

I'm successful in including  <pru_cfg.h>

I'm running CCS Version: 6.0.1.00040 on Windows 7

Any explanation on how to resolve this is appreciated.

  • LJ50738 said:
    Any explanation on how to resolve this is appreciated.

    Those linkers error occur it step 6 to add the link.cmd file to project is omitted, since it is the link.cmd linker command file which defines the address of the CT_CFG register.

    Note that when following the lab instructions, when a new project is created in CCS6 a AM335x.cmd linker command file is added to the project by CCS. I had to remove the AM335x.cmd file from the project, since it had some duplicate memory ranges with the link.cmd file from the PRU software package.

  • 1) CCS already created a linker file, "AM335x.cmd". Should I delete the "AM335x.cmd" linker file your tool has added to the project and add the "link.cmd" file? When I do that (and do the change in #2 below), I get a clean build, but why would you ship a product where you have to delete TI's default and add an obscure file from a tutorial? Plus, you have to change the code in the tutorial to actually match the symbol in that linker file.
    2) "link.cmd" doesn't have any symbol "CT_CFG". It does have "C4_CFG" though, but that's isn't what the tutorial stipulates to use.
  • Hi

    LJ50738 said:
    1) CCS already created a linker file, "AM335x.cmd". Should I delete the "AM335x.cmd" linker file your tool has added to the project and add the "link.cmd" file?

    Yes. The discrepancies between the linker CMD files are due to timing. The one provided with CCS was created before the PRU support was fully implemented. A complete integration of the tutorial's PRU linker CMD file and the CCS linker CMD file is on the works (a few outstanding issues are still being solved).

    LJ50738 said:
    2) "link.cmd" doesn't have any symbol "CT_CFG". It does have "C4_CFG" though, but that's isn't what the tutorial stipulates to use.

    I wouldn't expect so. The symbol CT_CFG is defined in step 3.c when it is defined as a struct of type pruCfg (which exists inside the include file <pru_cfg.h>)
    All in all, I asked the owner of the page to clarify the need to remove the existing linker CMD file and clarify the procedure to add the existing one from the tutorial.

    Hope this helps,

    Rafael