2 Replies Latest reply on Sep 16, 2011 1:09 PM by tomoc_264086

    Using Shared Libraries of Code with Multiple PSoC1 Projects

      I've been working on a shared library of code for PSoC1/3/5 and needed to be able to reference
      a shared respository of source code and include files that are located outside my project directory.
      It took a little experimenting, but I did find a good solution, and will describe it below.


      Solution description :


      You have library of shared source code that you would like to re-use in several PSoC1 projects.
      This library takes the form of :
      C:/my_lib/include   /* include (*.h) files */
      C:/my_lib/src         /* source  (*.c) files


      You would like these include file and source file to be part of several PSoC1 projects,
      however, if you do a "Project -> Add File" in the PSoC Creator, it COPIES the files
      to the local project directory, such that changes made in project are no longer reflected in
      other projects. What you want is a "shared source code library".


      For each of the projects that wants to use the  "shared source code library",
      do the following :


      1) "Project -> Open local.mk for "YourProjectName" Project"


           This will open a text edit window with a copy of that project's "local.mk" file.


      2) Cut and paste the attached "local.mk" file into the text window,
           and make whatever changes you need for your particular library path
           and source file names.


      3) "File -> Save All"


      4) "Build -> Generate/Build 'YourProjectName' Project"


      Now all of your include files will get included during compilation, and all of your source "C" files will get
      compiled and built into your projects.


      Best Regards,


      Tom Moxon



        • 1. Re: Using Shared Libraries of Code with Multiple PSoC1 Projects



          thank you for the solution guide to shared libraries. Comparing to the solution for Creator, this approach for Designer appears to be simpler.


          Out of curiosity, are there many projects that migrate from PSoC 1 to PSoC 3 or even PSoC 5? The difference in performance, memory size is quite significant, so I wonder how many Cypress customers do migrate / upgrade their projects.


          - Robert

          • 2. Re: Using Shared Libraries of Code with Multiple PSoC1 Projects



            It's not a matter of device/project migration - but one of shared/reusable code.


            I get a lot of cutomers who find the exact example they need for some widget,


            but it is not running on the device they want to use, and the porting effort can be large.


            I support PSoC1 (M8C) , PSoC3 (8051), PSoC5 (Cortex-M3), FX3 (ARM926), USB HOST (StrongARM), etc.


            and almost none of the code for one device is reusable for another. And I'm talking about the simple stuff,


            like getting a periodic interrupt to run a scheduler, etc.


            So, I've been working on a common API library that can be used to quickly port applications between
            different architectures, you can read about it at :