By default, projects in a workspace in the Cypress ModusToolbox IDE (mtb) share board and device configuration files.
There are several good reasons to do this, but it's not always what you need.
If you want to build designs with a different configuration, there are a few options.
The two easy ones are: multiple workspaces and - what I test here - a project with fully contained configurations.
The procedure is explained in the ModusToolbox User Guide, 5.4 Modifying the BSP Configuration for a Single Application.
If you have the IDE installed, the user guide is also available from the Help menu.
Summary of the goal: create a project in an active workspace that is isolated.
Board or device changes made to the project do not impact other projects.
Changes made to other projects do not impact this project.
Step 1: create a project for your board
In the IDE, create a new project. File -> New -> ModusToolbox Application
I'm using a PSoC 6 WiFi and Bluetooth prototype kit (I got this from balearicdynamics!).
I use the "empty" project for this board as the base. I name it Standalone_e14_blog.
Then click Create.
The result is a new project in the IDE.
It uses the shared configuration in the mtb_shared folder. If I reconfigure a device or the board file in my project now, my other project SCB_UART_Trans... would get the modification too.
Now let's start to isolate our configurations.
Step 2: set up local configuration structure
Create a directory named COMPONENT_CUSTOM_DESIGN_MODUS in the root of the new project.
Right click on Project -> New -> Folder
Enter COMPONENT_CUSTOM_DESIGN_MODUS and click Finish.
In that folder, create a subfolder with the structure . In my case TARGET_CY8CPROTO-062-4343W.
If you don't know what the name for your board should be, check the mtb_shared project. It will have a folder with the correct name for your board.
Then, I copy the necessary files into the new folder.
Copy everything from the mtb_shared / TARGET_XXXXXXXX_ / latest-vXXXX / COMPONENT_BSP_DESIGN_MODUS, except the GeneratedSource subfolder.
I paste the files in the custom folder structure of my freshly generated project:
Step 3: adapt the makefile
You need to add two lines to the makefile. It will tell the builder to look for our local configurations.
These two lines need to be added.
COMPONENTS += CUSTOM_DESIGN_MODUS DISABLE_COMPONENTS += BSP_DESIGN_MODUS
Save the file.
Last step: Refresh the Quick Panel
In the Quick Panel, click the Refresh Quick Panel hyperlink.
This is it. All tools will now use your local project configuration.
I have attached the project to this blog post as a zip file. You can import it in your IDE if you don't want to do all the steps.