CW for MCUs v11.1 S12Z -prefix / -include problem

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

CW for MCUs v11.1 S12Z -prefix / -include problem

2,042 Views
kef2
Senior Contributor V

I'm using S12Z Compiler->Prefix File setting to provide common application defines in common header file. Additionally I'm using Defined Macros (-D command line switch) for different project targets. The problem is that additional common header file doesn't see -D defines if they appear on command line after -prefix / -include switch.

Having this in header file

#if !defined(DEVKIT)

#define DEVKIT 0

#endif

and DEVKIT=1 in Defined Macros I see macro redefined compiler error. If I move Prefix File setting to S12Z Compiler->General->Other Flags (with leading -prefix or -include switch), then all -D's come prior to -include and everything is fine.

0 Kudos
Reply
8 Replies

1,937 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Edward Karpicz

Please check if this solution can help you solve the problem

Fixing the Eclipse Index | MCU on Eclipse 

If this can't help, please upload your demo project here, I will check it directly. Thanks.


Have a great day,
Jun Zhang

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

1,937 Views
kef2
Senior Contributor V

ZhangJennie,

please remove ASSUMED ANSWERED!

Thanks,

Edward

0 Kudos
Reply

1,937 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Edward,

I don't know why it's assume answered, I don't have right to remove it. 

But this issue will always be tracked if you have any update.

The issue you described is abnormal, I can confirm it's not a feature. 

As I requested previously, please upload a demo project here, thus we can work on it directly. 

Thanks,

Jun Zhang

0 Kudos
Reply

1,937 Views
kef2
Senior Contributor V

Hi,

Thanks again. OK, you can't remove fooling assumed answered, I can't remove it. What for or who is this not working and annoying assumed answered? Green check box is the same for threads with solution, as well for threads with dead and. Is it normal?

Sorry, I didn't notice your demo request. Here it is, see comments in sources/config.h

0 Kudos
Reply

1,937 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Edward Karpicz

The problem is that the project can't identify config.h file under folder {ProjDirPath}/Sources/

This is because this path is not under "Access Paths" list. Please add it manually as below, which could fix the error.

Please make sure all the header file paths are added here in the same way.

please also remove ${ProjDirPath}/Sources/config.h from S12Z Compiler->Input->Prefix File

pastedImage_1.png

Let me know if this can also work for you.

Have a nice day,

Jun Zhang

0 Kudos
Reply

1,937 Views
kef2
Senior Contributor V
  • The problem is that the project can't identify config.h file under folder {ProjDirPath}/Sources/
  • This is because this path is not under "Access Paths" list. Please add it manually as below, which could fix the error.

Not true. First of all full path to config.h is specified using standard Eclipse environment variable ${ProjDirPath}. 2nd, since full path is given Access Paths has nothing to do here. You may try using Access Paths of course, but since Access Paths like -D defines appear on command line to the right from -include/-prefix switch, wouldn't things get even worse?

See what compiler message you get. After compiler error it should point you to config.h and claim that OSC_CLK is not defined, though it is really defined using -D command switch.

0 Kudos
Reply

1,937 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Thanks for the clarification. I will report this issue to development team. Will let you know once I get feedback.

Thanks,

Jun Zhang

0 Kudos
Reply

1,937 Views
kef2
Senior Contributor V

Hi Jun Zhang

and thank you for reply. My issue has nothing to do with indexer. Indexer is about comfortable sources navigation and lookup. My issue is S12Z compile issue. Do compile switches come in this order

... -include config.h -DOSC_CLK=16000000 ...

or in this order

... -DOSC_CLK=16000000 -include config.h ...

result is different. In the first case OSC_CLK is not visible to config.h. In the 2nd case OSC_CLK is visible to config.h. Is this a feature or bug? I think it's the bug. If feature, then IDE should provide the way to put -include switch after or priorto all -D's on command line. As I wrote previously my current workaround is to use S12Z Compiler->General->Other Flags setting instead of Compiler->Prefix File. This makes -include put past all -D's on command line.

Regards

Edward

0 Kudos
Reply