AnsweredAssumed Answered

KDS - problems with TSS library, GCC linker and my workaround

Question asked by lustfulrat on Jan 6, 2015
Latest reply on Jan 6, 2015 by Jorge_Gonzalez

Hello all!


This is my first post on Freescale Community forum


A few days ago I dreged my FRDM-KL25 board up because of new project in my job, where I'd like to use L series processor. To check the board and new Kinetis Design Studio IDE I've created simple project:

- on LPTMR interrupt RGB led changes its colour: green, red, blue, green, red, blue...

- touching a slider changes a period of LPTMR from 1 to 1000ms

To setup peripherals and create appropiate event functions I'm using Processor Expert.

Everything works fine, but I've got some problems when I was trying to use TSS library component, this is my steps:

1. I've added TSS library component in Processor Expert and configured it to use analog slider from FRDM-KL25 board - OK

2. Processor Expert created some files in folder named TSS and added callback function in events.c file - OK

3. I've added some code changing LPTMR period inside callback function and also Configure() (to initialize TSS) before main loop and TSS_Task() inside main loop - OK

4. Build project - FAIL, eclipse (KDS) shows many errors "undefined reference to TSS_..." in main file and in some files from TSS folder

5. After reading TSS library user guide, analyzing .c and .h TSS files and console log I've realized that all missing functions comes from library libTSS_KXX_M0.a from TSS folder. So, ok, I don't know why but it seems that gcc linker can't see that library.

6. In project properties (Project->Properties->C/C++ Build->Tool settings tab->Cross ARM linker->Libraries) I've manually added library search path "${workspace_loc:/${ProjName}/Sources/TSS}" and library "TSS_KXX_M0". Build project - FAIL, "undefined reference to TSS_..." errors disappear but KDS shows new errors with "undefined reference to asm" in file TSS_SensorTSIL.c.

7. In function TSIL_Recalibrate and TSIL_InitThresholds there are lines with asm("NOP"); I've changed asm to __asm__ and.. tadaaa... build project - OK!


So why do I have to made these changes? I'am asking because of this: Author creates very similar simple project with TSS library without any problems, but he uses CodeWarrior 10.3 (also based on Eclipse), some maybe problems comes from KDS?