AM62A7: linker issue using fftlib

Part Number: AM62A7
Other Parts Discussed in Thread: FFTLIB

Tool/software:

Hello Team
"Could you please help me fix the linker issue to implement fftlib test from AM62AXMCU SDK 10.0.0.15 on C7504?


I tried to implement the fftlib test module FFTLIB_fft1d_i32fc_c32fc_o32fc from the fftlib folder into the example hello_world freertos project. I renamed the "main" function in
fftlib\test\fft_c7x\FFTLIB_fft1d_i32fc_c32fc_o32fc\FFTLIB_fft1d_i32fc_c32fc_o32fc_d.c
and called it in main.c file of the project (hello_world_am62ax-sk_c75ss0-0_freertos_ti-c7000\main.c)

But when building, it had some linker failure issues. I used the original linker from the helloworld project, and added the sections as fftlib source requires (fftlib\cmake\linkers\C7504\lnk.cmd). Please check the attachment.

At last, it failed at this error:

#17003-D relocation from function "TI_profile_setStackDepth" to symbol "__TI_STACK_SIZE" overflowed; the 33-bit relocated address 0xf7f341040 is too large to encode in the 32-bit signed PC-Relative field (type = 'R_C7X_PCR_OFFSET_ADDKPC_HI27' (33), file = "./test/common/TI_profile.obj", offset = 0x00000000004c, section = ".text:TI_profile_setStackDepth") TI_profile.c /hello_world_am62ax-sk_c75ss0-0_freertos_ti-c7000/test/common line 436 C/C++ Problem

Failed function:

void TI_profile_setStackDepth(void) {
#if !defined(_HOST_BUILD) && !defined(DISABLE_STACK_PROFILING)

  int32_t i;

  for (i = 0; i < ((uint64_t)&_STACK_SIZE / 4); i++) {
    if (topStack[i] != 0xDEADBEEF) {         // error
      break;
    }
  }

  newSP = (i * 4) + (uint64_t)topStack;

  stackSize[act_kernel] = (oldSP - newSP);
#endif
}

I found that the source code has some checking for memory segments. I also tried to disable DISABLE_STACK_PROFILING, this setting let me build the code successfully but when I ran debug, the system could not start at the "main" function.

my linker file: 

/cfs-file/__key/communityserver-discussions-components-files/791/linker-_2800_1_2900_.txt

Do you have any example on CCS that run fftlib on C7? Or please guide me how to use fftlib library on MCU SDK example project? 
Thank you
Guy
  • Hi Guy,

    For the linker error you are facing the following wiki article provides some details on relocation overflow errors, what could cause them and some solutions.

    Regarding your query on how to use fftlib on your project, I am working on it and will get back to you as soon as I have an update.

    Best Regards,

    Meet.

  • Thank you Meet for your efforts,

    we are waiting for news from you, 

    Best Regards

    Guy 

  • Hi Shemesh,
    I am looking at your query. Please expect reply by tomorrow.

  • Hi Shemesh,

    We don't have any freertos based fftlib examples as part of our sdk yet.

    Instead of directly trying to run the unit test in freertos, what I would suggest you to do is start with an empty freertos project, import fftlib library (FFTLIB_C7504.lib should be part of the sdk), and then start building your application from there. The test folder inside the fftlib is a no rtos project, and uses cmake for compiling, so you might be missing some dependency while trying to build in ccs). You can use those files as reference to create freertos project. Let me know if you get somewhere. The documentation for fftlib is at MCU_PLUS_SDK/source/fftlib/docs. 

    Thanks,
    Shreyansh

  • Hello Shreyansh,

    I appreciate your support. 

    Update on our side, we managed to do NORTOS project with FFTLIB. It works ok. However we wanted to add GPIO functionality, we can toggle it up until the point of cache initialization function of TI, afterwards it crashes. Please see further explanation and attachment, could you look into it please ? 

    I created a C7x empty nortos project and imported the test  FFTLIB_fft1d_i32fc_c32fc_o32fc to my project. It can work normally. 
    But when I want to control the GPIO (gpio0_41) in my project, the GPIO can only work before calling the FFTLIB_Test_Init function. The function GPIO_pinWriteHigh is called after FFTLIB_Test_Init makes the CPU stalled. Please refer to the attachment.
    Could you please tell me the root cause here? What can I do to make the GPIO work with FFTLIB?"

  • Hello Shreyansh,

    I appreciate your support. 

    Just to let you know, I posted this question as new topic, so I'm closing this thread. 

    Thank you

    Guy
    ePiccolo Engineering