Compile time error with PE generated flexcan code

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

Compile time error with PE generated flexcan code

Jump to solution
574 Views
thomasolenik
Contributor III

I'm using KDS 3.1.0, KSDK 1.3, and Processor Expert 3.0.2.

 

I am getting a compile time error in the PE generated code.The source of the error was line 82 of the the flexcan header files. Original code read "#define CAN0_IDX CAN0_IDX" The error generated was "'CAN0_IDX' undeclared (first use in this function)". By changing the line to "#define CAN0_IDX 0" I was then able to build the project, but have a warning that states ""CAN0_IDX" redefined [enabled by default]".

 

I have not yet tried to pick through the generated code to see how this macro is used.

 

Is this a bug or an oversight on my part?

Labels (1)
0 Kudos
1 Solution
432 Views
thomasolenik
Contributor III

I'm using MK26FN2M0VMD18.  For the configuration, I think I am using all of the default settings for now. RxD is PTA13 and TxD is PTA12. I named the component CAN0. I am using both of the K26 modules, CAN0 and CAN1. I get the error in both header files. I named the CAN1 component CAN1.

I am just getting the project started and just building frequently as I add components. I have not added much of my own code yet.

As I was typing this it occurred to me what the problem might be. I thought maybe it could be the name I used for the CAN components in PE. I changed the names of the components in PE, re-generated the PE code, and built the project.  That fixed the problem. I changed the component names back to how I had them and the problem came back.

Problem solved. Resolution: The component name field CAN NOT match the Device name on the properties tab of the CAN Component Inspector.

A nice improvement to PE would be to detect this issue when the component is named. :-)

View solution in original post

0 Kudos
2 Replies
432 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Thomas,

Which chip do you use , and how do you configure the CAN component ?

Please tell me how can i reproduce your problem step by step, or you can aslo

send your project to me .

BR

Alice

0 Kudos
433 Views
thomasolenik
Contributor III

I'm using MK26FN2M0VMD18.  For the configuration, I think I am using all of the default settings for now. RxD is PTA13 and TxD is PTA12. I named the component CAN0. I am using both of the K26 modules, CAN0 and CAN1. I get the error in both header files. I named the CAN1 component CAN1.

I am just getting the project started and just building frequently as I add components. I have not added much of my own code yet.

As I was typing this it occurred to me what the problem might be. I thought maybe it could be the name I used for the CAN components in PE. I changed the names of the components in PE, re-generated the PE code, and built the project.  That fixed the problem. I changed the component names back to how I had them and the problem came back.

Problem solved. Resolution: The component name field CAN NOT match the Device name on the properties tab of the CAN Component Inspector.

A nice improvement to PE would be to detect this issue when the component is named. :-)

0 Kudos