CodeWarrior v6.4 Post-Compile TDT

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CodeWarrior v6.4 Post-Compile TDT

1,196 Views
inuyashaitb
Contributor I

Hello, 

   I am working on implementing a feature into one of our projects, and I am running into a bit of a conundrum. I am generating a generic text file (using python) in which it deconstructs one of my Structures (and all sub-Structures) into a list of generic types

for example, if I had a structure like this:

#define MAX_ARRAY_SIZE_DEFINITION 100
#define MAX_ARRAY_SIZE MAX_ARRAY_SIZE_DEFINITION

typedef struct{
 uint_32   checksum;
 uint_16   sig1;
 uint_16   sig2;
 MyStruct2 SubStruct;
}MyStruct;

typedef struct{
 uchar   X;
 uchar   Y;
 uint_16 Z[MAX_ARRAY_SIZE];
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

The output would look like this:

uint_32 Checksum
uint_16 sig1
uint_16 sig2
‍‍‍‍‍‍‍uchar x
uchar y
uint_16 Z[100]

The problem I have is that the MAX_ARRAY_SIZE is not easily readable (and not as simple as it is defined in the code above), so there is no way for me to parse that part out.

I was looking through the TDT files, and ELF files to see if I could determine the array size based on those files, but I cannot get what i need from the ELF file (that i know of, been using Objdump a whole bunch but can't discern the information i need from it). So I was wondering if the TDT files held an encoded definition of the array size? 

"Z" is actually a much more detailed and unique name, so i can find it exactly as-is.

Tags (3)
0 Kudos
5 Replies

879 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Mashall.

To investigate your problem, we need more information:

1. Your CW version: Start the IDE and click on Help | About Freescale CodeWarrior. Click on Installed Products.Save all info displayed into a txt file and upload it here

2. your chip part number

3. demo project.

4. problem screenshot.

Thanks for your cooperation.

Best Regards,

Jennie Zhang

0 Kudos

879 Views
inuyashaitb
Contributor I

Code Warrior About

Chip: MFC5282 (M5282EVB(CFM) is what i use to flash it using CF Flasher)

Demo Project: none, this is a fully-released build that we developed and built-upon the MQX RTOS.

Problem SS: I don't think you understood what i was asking, no way to screenshot... I am asking if the .tdt files or .elf files contain information about variable array declaration.

0 Kudos

879 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Marshall,

The C preprocessor macros are used automatically by the C compiler to transform your program before actual compilation, so you will need to preprocess the files so that all the substitutions are made in order to get the size of the array:

pastedImage_1.png

You will see that inside the generated file the MAX_ARRAY_SIZE_DEFINITION has been replaced by its value:

pastedImage_2.png


Hope it helps!

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 Kudos

879 Views
inuyashaitb
Contributor I

I was really hoping that would work for me. Unfortunately my pre-process did not replace all of the array definitions :\

pastedImage_1.png

It looks like we have different versions of software as well, maybe it was not implemented in my version?

0 Kudos

879 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Marshall,

 

I have tested on my side using CodeWarrior for ColdFire v6.4 and it is also working:
pastedImage_1.jpg
After preprocessing the file:
pastedImage_2.jpg


Hope it helps!

 

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 Kudos