Help me to know advantages of creating Lib file

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

Help me to know advantages of creating Lib file

708 Views
rahulkrishna
Contributor IV

Hi,

I have some driver layer files and some application layer files, i do not want driver files to be modified so i am planning to create a lib file from these driver files.

First question is can I create only some files as lib files.

Second question: Will I able to achieve my goal of driver files not being modified. I mean to say am i in the right direction of creating lib file or should i think of something else.

I am using code warrior and s12x.

Labels (1)
0 Kudos
4 Replies

558 Views
ankur_kala
NXP Employee
NXP Employee

Hi,

usually a project will have a single output. If the project while creation is defined to produce executable, you will not be able to generate library and vice versa. In case you need to convert some files into libraries, you need to make an independent project and set library as the output while creating the project. Add the files and build. the output will be a library that can then be included in your original project. A library is a collection of pre-compiled object files that promote code reuse across many projects. Libraries provide a form of encapsulation such that the end user can take full advantage of the library's functions without being provided with the source code.

Regards,

Ankur

0 Kudos

558 Views
kef2
Senior Contributor IV

Hi Ankur,

I don't see option in CW5.1 Project Wizard, which would allow choosing between executable and library. Perhaps some older version had this option?

But I can't agree that you can't switch existing project from exe to lib. This is doable changing in Standard Settings  Target->Target Settings->Linker = Linker for XXXX vs Libmaker for XXXX.

Rahul,

Regarding using lib to hide code. If you have PRO license, you can use source code encryption feature and supply your customers with encrypted source code files. This has one important advantage over lib file. Your encrypted file can include customer customizable header files and compile code with new compile time constants or customer supplied macros. This is not possible with precompiled library.

Regards

Edward

0 Kudos

558 Views
ankur_kala
NXP Employee
NXP Employee

Hi Edward,

I explained it in terms of the eclipse CW (10.6). In classic codewarriors, yes you get the option to change the output from executable to library. CW 10.6 does not support it.

Regards,

Ankur

0 Kudos

558 Views
rahulkrishna
Contributor IV

It is always nice to hear from experts. I adds little confidence. As I mentioned earlier as I keep developing new features or adding applications. My basic functionalities  like reading switch inputs and power on some LED should not get affected. I do not want under any circumstances these basic functionalities getting affected. If i miss by chance testing even a single feature and if it malfunctions it will create lot of problems, as it will be under production. So,I want to ask

1. Already developed and tested basic functionalities how to isolate from getting modified by new modules. Is creating lib files a solution?

2. What are the programming steps i need to follow to achieve it?

3. I was also thinking of something like suppose after development of suppose module A the flash memory let us say it occupies from 0x4000-0x5000 and RAM from 0x2000 - 0x2300. Now whatever additional modules added should occupy from Flash 0x5001-somevalue and similarly for RAM. Will it help? Or can I do it?

4. Any tools from code warrior available to support ?

Thanks in advance

0 Kudos