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.
Tool/software: TI C/C++ Compiler
Hello,
There was a related question "accessing C structure members in c28x assembly" which gave an example how to do this. I copied the example code
but I still get an error E0009 "Missing struct/union member or tag" in the assembler file. The .cdecls directive seems to work partly though, because I have
other variable and array definitions in the same linked header file, and they come ok in the assembler file, only the union and structure references do not work.
Maybe there are some properties settings in the compiler that need to be switched on? I also use a rather old compiler version, v.6.4.12.
Please help,
Jouko
Jouko Viitanen said:Maybe there are some properties settings in the compiler that need to be switched on?
No. The .cdecls directive alone should do it.
Is there any way you could provide a cutdown example of the problem? Remember to include the compiler version and all the build options.
Thanks and regards,
-George
Hi,
Here are the dummy code snippets:
// in the C program I have defined the struct, and for comparison one float variable as follows:
One of the header files included inside the .cdecls lines must contain this full definition of MY_STRUCT ...
Jouko Viitanen said:struct MY_STRUCT{
int M1;
int M2;
float M3;
};
That is the only way the assembler knows about members of the structure such as M3.
Thanks and regards,
-George
Hi,
Yes, I tried also with the full definition in the header file, but still got the same error message.
Jouko
Jouko Viitanen said:I tried also with the full definition in the header file, but still got the same error message.
Unfortunately, I cannot reproduce this behavior. I'd appreciate if you would submit a test case which I can build that demonstrates this problem. Maybe it makes sense to submit a CCS project. Keep in mind it only has to build far enough to demonstrate this problem. It does not have to link or run. Package up the project as described in the article Sharing Projects. Then attach the zip file to the next post.
Thanks and regards,
-George
Ok, I may try to check this later, but I was quite busy to go on with this project, and this was not a big problem in this case:
I am using an union on the C program side to allow loading of an array with interleaved different data types to the
assembler program. When the reference is done using just a pointer, it is passed through with the .cdecls directive without any error
message (and the assembler obviously does not care what types of data is loaded to the registers).
Probably this is just a problem with the old compiler version.
Thanks anyway,
Jouko