Can Components from the Components Library be used in C++ projects?

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

Can Components from the Components Library be used in C++ projects?

跳至解决方案
2,125 次查看
michaelbinz
Contributor III

In S32 DS we created a project for the mpc5748g and selected C++ as the programming language.

pastedImage_1.png

The project generates and compiles.  But it is not possible to add components from the Component Explorer:

pastedImage_2.png

What needs to be done to use Components in a C++ project?

0 项奖励
回复
1 解答
2,028 次查看
martin_kovar
NXP Employee
NXP Employee

Hello Michael,

C++ project can be used in MPC5748G. I am only trying to explain that SDK drivers has never been tested in C++ projects.

So, you can write your own driver which is based on SDK driver using C++, but functionality of SDK driver is not guaranteed. From my point of view, it will work correct, but this is only my opinion.

Hope this helps.

Regards,

Martin

在原帖中查看解决方案

0 项奖励
回复
5 回复数
2,028 次查看
martin_kovar
NXP Employee
NXP Employee

Hello,

unfortunately, this is not possible. SDK is determined for C projects only and cannot be used for C++ projects.

Regards,

Martin

0 项奖励
回复
2,028 次查看
michaelbinz
Contributor III

Hi Martin,

i just checked the S32_SDK_BETA_2.9.0.  I found S32_SDK_BETA_2.9.0\platform\pal\ and a lot of drivers below.  After checking some of them (can and i2c), these look like classic drivers, that is, drivers that do not require Device Expert code generation.  If I do not miss something, these drivers can be used from C++, since it is no problem to call C code. 

So you mean that Processor Expert and the Components Library integrated in S32 DS cannot be used in C++, only classic drivers from the SDK can be used?

Please clarify. 

0 项奖励
回复
2,028 次查看
martin_kovar
NXP Employee
NXP Employee

Hello,

in general, SDK code has never been tested in C++ projects and it is not determined to use in C++ project. I understand that C code can be called in C++ projects, but NXP cannot guarantee correct functionality.

So, you can try to use SDK drivers in your C++ project, but it is on your responsibility.

Regards,

Martin

0 项奖励
回复
2,028 次查看
michaelbinz
Contributor III

Hi Martin,

that means that C++ is currently NOT supported as an implementation language on the mpc5748g?

Is there a plan to support C++ in the future?

Regards,

Michael.

0 项奖励
回复
2,029 次查看
martin_kovar
NXP Employee
NXP Employee

Hello Michael,

C++ project can be used in MPC5748G. I am only trying to explain that SDK drivers has never been tested in C++ projects.

So, you can write your own driver which is based on SDK driver using C++, but functionality of SDK driver is not guaranteed. From my point of view, it will work correct, but this is only my opinion.

Hope this helps.

Regards,

Martin

0 项奖励
回复