Create and add my libs to my project

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

Create and add my libs to my project

1,415 Views
ricardo_velho
Contributor II

Hello,

I'm new with NXP and S32 Design Studio.

My main goal is create one project where I can import my libs.

That is, I want to create 2 lib (for example for CAN communication and ADC, for S32K118) with all peripheral functions available (for example CAN->MCR=.....). I can't do that and I have another difficult all libs created, are created with the name mylibrary.c/.h it is possible change the name? How use the #include if all of them have the same name?

In resume, my difficult are in create libraries for one particular processor with all the function/register previously defined and import them for my project.

I want to create my libs with the syntax previously developed and import for my projects.

Thanks for your help.

Best regards,

Ricardo Velho

Tags (3)
4 Replies

1,100 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

So, first of all - you need to select library project - if you like to build library:

pastedImage_1.png

Output will be library archive libYourProjectName.a . You can use your library in other projects just by adding it in project settings:

pastedImage_2.png

Also don't forget add include path for your library header files. 

Jiri

1,100 Views
ricardo_velho
Contributor II

Hello Jiri,

Thanks for your reply.

Ok, and what about the syntax, that is, if I create one lib for CAN communication. I don't have defined for example CAN0->MCR. How can I import/add this into my library?

Thanks again for your collaboration.

Best regards,

Ricardo 

0 Kudos

1,100 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

register names and other definitions are in Cpu.h for particular MCU. Just include this header file in  your project.

Easiest way how to setup all stuff is start with New S32DS Application project and switch it from executable target to library target: 

pastedImage_1.png

Jiri

1,100 Views
ricardo_velho
Contributor II

Hi Jiri,

Thank you for your help.

Best regards,

Ricardo

0 Kudos