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

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

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

Jump to solution
1,046 Views
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 Kudos
1 Solution
949 Views
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

View solution in original post

0 Kudos
5 Replies
949 Views
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 Kudos
949 Views
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 Kudos
949 Views
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 Kudos
949 Views
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 Kudos
950 Views
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 Kudos