Library-Project for Cortex m0

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked
        I have a library-project which compiles fine for a PSoC5 and can be included from another project under "Dependencies". I cannot tell the librara-project to compile for a Cortex m0, it will always generate for Cortex m3. Where is the setting to change that?   
   
Bob   
Now permanently having the "Small Window", nothing helps, any suggestions?   
0 Likes
1 Solution
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

This is a naming problem. Specifiying a library name results in Creator appending the option '-lLibrary01' to the linker command line. Gcc then interprets this as looking for a file named 'libLibrary01.a' to be loaded.

   

So either you need to have an additional step renaming the created library file (since I found no place where I could specifiy its name). Or you rename the library project to be called 'libLibrary01'. I did the latter, and it worked.

   

But why don't you want to specify the dependency to your library project? I see no downside to this...

View solution in original post

0 Likes
15 Replies
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored
        When creating the library project, do you have the option of creating a PSoC4 library?   
0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked
        Hi Hli, back from the shadows?   
That was exactly my question: where can I set my library to produce m0 code. Furthermore: When I want to create a library with target independent code (a function that SHOULD work) how to specify that?   
   
Bob>br>Now having permanently the small window, thinking about to quit this forum!   
0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

We could always start directing people to psocdeveloper.com, where

   

these problems with forum software do not exist. Almost a year now to

   

fix this.........

   

 

   

Regards, Dana.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

I justed tested it. If have a test workspace with a PSoC4 and a PSoC5 project in it. I created a new project ("Library01") there, and choose "library project" as type (the "other" tab in the wizard).

   

Then I opened the project properties for the two other projects, opened end editor for "dependencies" and checked the "code" column for the"Library01"ry project (though it doesn't seem to stick sometimes, better to check again).

   

When I now build these two projects, the library gets build too, with the CPU settings of the importing project (so I have two different versions of the Library01.a file).

   

If I compile the library project on its own, it always use the build settings defined for it (which happens to be Cortex-M3 by default, but can be changed).

   

So maybe you are just missing the dependency setting?

   

(btw: one also needs to set the proper include path, this won't bet set by adding the dependency)

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

@bob - no, no shadows, just two weeks at a north sea beach with my family 🙂 And I prefer to stay offline then...

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked
        Found it! Your hint was excellent. Since I do not want to use the way with "Dependencies" I face the problem to thee to use Mylibrary.a which is generated when the library is compiled. Even when setting "Additional Libraries" I get the message "-iMyLib not found"   
   
Bob   
0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked
        Sorry for my pidgin-english, but the "Small Window" hinders me to review my post before sending it.   
   
Bob   
0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked
        @Dana   
Yes, the "Other Forum"... The software works, but the visits of users is too few (No posts in the last 2 days) I suggested Cypress to use their (free, open) software and adapt it to their needs. Xes, more than a year ago...   
So to reduce my blood-pressure it might be the only choice for me to stop contributing here...   
   
Bob   
0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

You know, You can resize that edit window by dragging its bottom-right corner...

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

I think you need to also set the library path. Otherwise gcc will look only in its current directories, but your library is elsewhere.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked
        The edit-window is NOT dragabke.   
Of course I provided an additional directory for the library.   
   
Bob   
0 Likes
Anonymous
Not applicable

 The lower right corner can be used to expand and reduce the edit box.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

This is a naming problem. Specifiying a library name results in Creator appending the option '-lLibrary01' to the linker command line. Gcc then interprets this as looking for a file named 'libLibrary01.a' to be loaded.

   

So either you need to have an additional step renaming the created library file (since I found no place where I could specifiy its name). Or you rename the library project to be called 'libLibrary01'. I did the latter, and it worked.

   

But why don't you want to specify the dependency to your library project? I see no downside to this...

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

There was a question from a user in this forum as how to give away a developed functionality without giving away the sources. While testing the howtos I ran into the above problems.

   

 

   

Bob 

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

@Hli

   

Thanx a lot: The "Lib"-trick indeed did work!

   

 

   

Bob

0 Likes