Compile time error with PE generated flexcan code

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Compile time error with PE generated flexcan code

跳至解决方案
1,221 次查看
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?

标签 (1)
标记 (2)
0 项奖励
回复
1 解答
1,079 次查看
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 项奖励
回复
2 回复数
1,079 次查看
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 项奖励
回复
1,080 次查看
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 项奖励
回复