element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • Experts & Guidance
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • Store
    Store
    • Visit Your Store
    • 'Choose another store...'
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Personal Blogs
  • Members
  • More
Personal Blogs
Legacy Personal Blogs Version control in PSoC Creator
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: koudelad
  • Date Created: 18 Jun 2019 6:14 PM Date Created
  • Views 771 views
  • Likes 3 likes
  • Comments 1 comment
  • version control
  • psoc creator
  • git
  • cypress psoc
  • psoc
Related
Recommended

Version control in PSoC Creator

koudelad
koudelad
18 Jun 2019

Hello,

 

I know many people on element14 community know PSoCs and do projects with them. So do I. There is a newer IDE, ModusToolbox Software Environment (based on Eclipse), but currently only for PSoC 6 devices. However, for PSoC 5 and lower, there is only the old PSoC Creator (which works only on Windows). The trouble is, PSoC Creator has no integrated version control support. There are hundreds of files in each project directory, so the important files might not be visible at a first glance.

 

The only supporting information I found was a knowledge base article about what to include in the version control: Revision Control for PSoCRegistered CreatorTm Projects - KBA86358 (By the way it includes a few typos of the files that should be included, so you have to double check everything.)

 

Professional developers probably use different structure, but I use the following:

 

PSoC Creator folder is located in Documents of a current user by default. (Here is also the .gitignore file located, as explained below.)

  • 4.2 is a version specific folder containing downloads like components, examples etc.
  • common is my own folder with custom header and source files
  • CY8CKIT-044-4200M etc. - one folder per workspace for a specific hardware - in my case development boards with a particular PSoC family (I have 4 of these)
    • each workspace contains 1 to n projects - project_name.cydsn
      • each project contains main.c , project files, schematics, generated files etc.
  • PSoC4 Examples is my own folder with downloaded application notes, 3rd party projects etc.

image

 

I decided to use git as a version control system. And if I want to work on all of this alone as a hobby and mainly have version control system as a great backup system, I don't want to use a version control repository or project per PSoC project or per PSoC workspace.

With a great help of a colleague, I put up the following .gitignore file to respect the PSoC Creator structure. It is not easy to read at first, but is a generic way of solving a problem, how to version files or folders nested deep in a directory structure, but not version the rest of the structure.

 

# For nested folders, ignore the folder contents, but whitelist its subfolders.
/*
!/*/


# Ignore folder containg PSoC Creator version specific downloads
# like components, examples etc.
/4.2


# Then again ignore all the contents, but whitelist its subfolders etc.
# Git doesn’t list excluded directories, so this is the way to get to files
# nested in up to x subfolders
# (where x is the number of asterisks in the "pyramid" below).
/*/*
# Side effect is ignoring all the contents along the route,
# so whitelisting a specific folder content at a specific level needs to be
# stated after blacklisting the contents of the folder one level up.
# Custom folder with shared header and source files
!/common/*
!/*/*/
/*/*/*
!/*/*/*/
/*/*/*/*
!/*/*/*/*/
/*/*/*/*/*
!/*/*/*/*/*/
/*/*/*/*/*/*
!/*/*/*/*/*/*/
/*/*/*/*/*/*/*
!/*/*/*/*/*/*/*/


# Project Directory (project_name.cydsn)
!main.c
!cyapicallbacks.h
!*.cydwr
!*.cyprj
!*.cysch


# Optional files - workspace related
!*.cyprj.*
!*.cywrk
!*.cywrk.*


# Generated source and other source files inside the folder structure
#!*.c
#!*.h
#!*.inc
#!*.icf
#!*.ld
#!*.s
#!*.scat


# Binary files
#!*.hex
#!*.cyacd

 

Here is the output for the one specific project shown above. Please note most of the generated files are excluded, as they are commented in the .gitignore file above.

image

 

Someone might find it useful. I haven't seen exactly solutions like this on the web, because people usually know exact folder names along the way (sometimes it is really necessary).

 

Do you use a different setup? PSoCs are heavily tight to the PSoC Creator, so I haven't seen anyone using something else.

 

David

  • Sign in to reply

Top Comments

  • DAB
    DAB over 4 years ago +1
    Good post. Version control is an under appreciated necessity. You need to control the version of the software you develop. You also need to document the versions of the tools you use for your software…
  • DAB
    DAB over 4 years ago

    Good post.

    Version control is an under appreciated necessity.

    You need to control the version of the software you develop.

    You also need to document the versions of the tools you use for your software.

     

    It will save you a lot of time and effort in the long run.

     

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2023 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube