Multiple compile/link issues (Kflop works but Kogna fails)
Posted: Fri Sep 15, 2023 5:11 pm
Hi Tom,
I have a "C" program that I have been developing over the last few weeks that works perfect with a Kflop board.
I need to use a Kogna for this application, so I am attempting to port it over. I've run into several issues. I have NOT yet been been able to successfully build the code when targeting a Kogna.
I will note up front that I am making use of the optimizing TI compiler. My program implements a FAT file system and reads/writes files to a microSD card, so the optimizing compiler is important for the size of the code.
Problem #1 - strchr()
The code I am using for the FAT file system makes use of strchr(). This turns out to have some issues and differences for Kflop vs Kogna.
Kflop Behavior:
- KmotionDef.h declares "extern char *strchr(const char *_string, int _c);"
- When the program is built for Kflop, however, I *would* get a strchr() undefined symbol link error.
- To work around this, I implemented a strchr() function in my C code
- This works just find and the linker calls to my strchr() function.
- So, for Kflop I have the program working great with my own implementation of strchr()
Kogna Behavior
- When I keep my own strchr() function in code, the compiler issues a warning: symbol "strchr" being redefined.
- I can comment out my implementation and it will compile. It won't build, though.. because of problem #2 below
This doesn't seem to be a problem for me right now because I have a work-around, but thought I would share my experience.
Problem #2 - undefined symbol "__c6xabi_strasgi" during <Linking>
- With a Kflop board connected, the program compiles, downloads and runs perfectly (been doing this for weeks)
- With a Kogna board connected, the build gives an linker error (undefined symbol " __c6xabi_strasgi")
I have no idea where the __c6xabi_strasgi is coming from. Some initial web searches lead me to think it might have something to do with memcpy(). Any Ideass??
https://e2e.ti.com/support/tools/code-c ... ads-stores
Problem #3 - invalid TI_COMPILER pragma
I am also getting the following error message on attempted Kogna builds. When I get the error with Kogna, I can swap to a Kflop board, compile the exact same source and everything builds and runs just fine.
I usually have #pragma TI_COMPILER(3) as the first line of code. The snippet above was from a test when I removed the optimization level from the directive, but it doesn't matter either way .
I have multiple copies and some reduced/simplified versions of the code in different folders. Some of these copies have the problem, others don't. I'll continue to try to figure it out, but I am at a loss right now... The only think I know is I NEVER get his error when connected to a Kflop.
I have a "C" program that I have been developing over the last few weeks that works perfect with a Kflop board.
I need to use a Kogna for this application, so I am attempting to port it over. I've run into several issues. I have NOT yet been been able to successfully build the code when targeting a Kogna.
I will note up front that I am making use of the optimizing TI compiler. My program implements a FAT file system and reads/writes files to a microSD card, so the optimizing compiler is important for the size of the code.
Problem #1 - strchr()
The code I am using for the FAT file system makes use of strchr(). This turns out to have some issues and differences for Kflop vs Kogna.
Kflop Behavior:
- KmotionDef.h declares "extern char *strchr(const char *_string, int _c);"
- When the program is built for Kflop, however, I *would* get a strchr() undefined symbol link error.
- To work around this, I implemented a strchr() function in my C code
- This works just find and the linker calls to my strchr() function.
- So, for Kflop I have the program working great with my own implementation of strchr()
Kogna Behavior
- When I keep my own strchr() function in code, the compiler issues a warning: symbol "strchr" being redefined.
- I can comment out my implementation and it will compile. It won't build, though.. because of problem #2 below
This doesn't seem to be a problem for me right now because I have a work-around, but thought I would share my experience.
Problem #2 - undefined symbol "__c6xabi_strasgi" during <Linking>
- With a Kflop board connected, the program compiles, downloads and runs perfectly (been doing this for weeks)
- With a Kogna board connected, the build gives an linker error (undefined symbol " __c6xabi_strasgi")
I have no idea where the __c6xabi_strasgi is coming from. Some initial web searches lead me to think it might have something to do with memcpy(). Any Ideass??
https://e2e.ti.com/support/tools/code-c ... ads-stores
Problem #3 - invalid TI_COMPILER pragma
I am also getting the following error message on attempted Kogna builds. When I get the error with Kogna, I can swap to a Kflop board, compile the exact same source and everything builds and runs just fine.
Code: Select all
Error Line :1: invalid TI_COMPILER pragma
#pragma TI_COMPILER
Expected format:
#pragma TI_COMPILER
#pragma TI_COMPILER(opt level 0-3)
#pragma TI_COMPILER(opt level 0-3, Max Thread Space - hex or decimal)
I have multiple copies and some reduced/simplified versions of the code in different folders. Some of these copies have the problem, others don't. I'll continue to try to figure it out, but I am at a loss right now... The only think I know is I NEVER get his error when connected to a Kflop.