- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am using PSoC Creator 4.3 and have created two projects which I would like to share the same TopDesign file with, but however I could not find a way to include external TopDesign in my project like what I can do with Design Wide Resources. Is there anyway I can achieve this? Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Since the question seemed to be fun, I gave it a try. (I used CY8CKIT-044)
But please note that the following is my experiment and is not recommended by Cypress nor anyone else including myself.
And proceed at your own risk.
(1) I prepared a couple of workspaces, namely workspac1 and workspace2
(2) I created a project named "share_test1" in the workspace1 with usual method.
And I placed a UART and a LED_R in the schematic.
(3) I created a project named "share_test2" in the workspace2 with usual method.
(4) After quitting the PSoC Creator(s), I moved "workspace2\share_test2.cydsn\TopDesign\TopDesign.cysch" to the trash. (aka removed)
(5) I started the "command prompt" and change directory to "workspace2\share_test2.cydsn\TopDesign\"
(6) I entered the following command at the prompt
mklink /H TopDesign.cysch ..\..\..\workspace1\share_test1.cydsn\TopDesign\TopDesign.cysch
(7) Then I closed the command prompt
(8) I started PSoC Creator by double clicking "workspace2\workspace2.cywrk"
(9) Now share_test2 project has components in its schematic.
I added another Digital Output "LED_G" and saved the schematic using "ctrl-s"
(10) Then I opened another PSoC Creator by double clicking "workspace1\workspace1.cywrk".
PSoC Creator noticed that the schematic was modified externally.
I selected OK.
Now in the schematic of share_test1, there is a new LED_G
(11) To test the opposite path, I added another component "LED_B" in the share_test1's schematic
(12) When I switched to the PSoC Creator of share_test2, similar thing happed.
Now the schematic of share_test2 has the third LED, LED_B.
(12) To test if the project works, I assigned pins
(13) I wrote main.c for both project with slight difference to confirm that they are different and working.
main.c (share_test1)
==========================
#include "project.h"
#include "stdio.h"
#define STR_LEN 64
char str[STR_LEN+1] ;
void print(char *str)
{
UART_UartPutString(str) ; /* PSoC 4 */
// UART_PutString(str) ; /* PSoC 5 */
}
void cls(void)
{
print("\x1b[2J\x1b[;H") ;
}
void splash(char *prog_name)
{
cls() ;
if (prog_name && *prog_name) {
print(prog_name) ;
}
print(" (") ;
print(__DATE__) ;
print(" ") ;
print(__TIME__) ;
print(")\n") ;
}
int main(void)
{
CyGlobalIntEnable; /* Enable global interrupts. */
UART_Start() ;
splash("Test1") ;
for(;;)
{
if (LED_R_Read()) {
LED_R_Write(0) ;
} else {
LED_R_Write(1) ;
}
CyDelay(100) ;
}
}
==========================
main.c (share_test2)
==========================
#include "project.h"
#include "stdio.h"
#define STR_LEN 64
char str[STR_LEN+1] ;
void print(char *str)
{
UART_UartPutString(str) ; /* PSoC 4 */
// UART_PutString(str) ; /* PSoC 5 */
}
void cls(void)
{
print("\x1b[2J\x1b[;H") ;
}
void splash(char *prog_name)
{
cls() ;
if (prog_name && *prog_name) {
print(prog_name) ;
}
print(" (") ;
print(__DATE__) ;
print(" ") ;
print(__TIME__) ;
print(")\n") ;
}
int main(void)
{
CyGlobalIntEnable; /* Enable global interrupts. */
UART_Start() ;
splash("Test2") ;
for(;;)
{
if (LED_G_Read()) {
LED_G_Write(0) ;
} else {
LED_G_Write(1) ;
}
CyDelay(500) ;
}
}
==========================
(14) Then I compiled and ran each project and confirmed that they are working
as the message written to the terminal were different and the blinking speed and led were different.
Conclusion by using "mklink /H <link> <target>" command, I could fool PSoC Creator.
For the time being it seems to be working.
But there is no guarantee that this will continue to work with future version(s) of PSoC Creator.
So again please proceed at your own risk 😉
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Since the question seemed to be fun, I gave it a try. (I used CY8CKIT-044)
But please note that the following is my experiment and is not recommended by Cypress nor anyone else including myself.
And proceed at your own risk.
(1) I prepared a couple of workspaces, namely workspac1 and workspace2
(2) I created a project named "share_test1" in the workspace1 with usual method.
And I placed a UART and a LED_R in the schematic.
(3) I created a project named "share_test2" in the workspace2 with usual method.
(4) After quitting the PSoC Creator(s), I moved "workspace2\share_test2.cydsn\TopDesign\TopDesign.cysch" to the trash. (aka removed)
(5) I started the "command prompt" and change directory to "workspace2\share_test2.cydsn\TopDesign\"
(6) I entered the following command at the prompt
mklink /H TopDesign.cysch ..\..\..\workspace1\share_test1.cydsn\TopDesign\TopDesign.cysch
(7) Then I closed the command prompt
(8) I started PSoC Creator by double clicking "workspace2\workspace2.cywrk"
(9) Now share_test2 project has components in its schematic.
I added another Digital Output "LED_G" and saved the schematic using "ctrl-s"
(10) Then I opened another PSoC Creator by double clicking "workspace1\workspace1.cywrk".
PSoC Creator noticed that the schematic was modified externally.
I selected OK.
Now in the schematic of share_test1, there is a new LED_G
(11) To test the opposite path, I added another component "LED_B" in the share_test1's schematic
(12) When I switched to the PSoC Creator of share_test2, similar thing happed.
Now the schematic of share_test2 has the third LED, LED_B.
(12) To test if the project works, I assigned pins
(13) I wrote main.c for both project with slight difference to confirm that they are different and working.
main.c (share_test1)
==========================
#include "project.h"
#include "stdio.h"
#define STR_LEN 64
char str[STR_LEN+1] ;
void print(char *str)
{
UART_UartPutString(str) ; /* PSoC 4 */
// UART_PutString(str) ; /* PSoC 5 */
}
void cls(void)
{
print("\x1b[2J\x1b[;H") ;
}
void splash(char *prog_name)
{
cls() ;
if (prog_name && *prog_name) {
print(prog_name) ;
}
print(" (") ;
print(__DATE__) ;
print(" ") ;
print(__TIME__) ;
print(")\n") ;
}
int main(void)
{
CyGlobalIntEnable; /* Enable global interrupts. */
UART_Start() ;
splash("Test1") ;
for(;;)
{
if (LED_R_Read()) {
LED_R_Write(0) ;
} else {
LED_R_Write(1) ;
}
CyDelay(100) ;
}
}
==========================
main.c (share_test2)
==========================
#include "project.h"
#include "stdio.h"
#define STR_LEN 64
char str[STR_LEN+1] ;
void print(char *str)
{
UART_UartPutString(str) ; /* PSoC 4 */
// UART_PutString(str) ; /* PSoC 5 */
}
void cls(void)
{
print("\x1b[2J\x1b[;H") ;
}
void splash(char *prog_name)
{
cls() ;
if (prog_name && *prog_name) {
print(prog_name) ;
}
print(" (") ;
print(__DATE__) ;
print(" ") ;
print(__TIME__) ;
print(")\n") ;
}
int main(void)
{
CyGlobalIntEnable; /* Enable global interrupts. */
UART_Start() ;
splash("Test2") ;
for(;;)
{
if (LED_G_Read()) {
LED_G_Write(0) ;
} else {
LED_G_Write(1) ;
}
CyDelay(500) ;
}
}
==========================
(14) Then I compiled and ran each project and confirmed that they are working
as the message written to the terminal were different and the blinking speed and led were different.
Conclusion by using "mklink /H <link> <target>" command, I could fool PSoC Creator.
For the time being it seems to be working.
But there is no guarantee that this will continue to work with future version(s) of PSoC Creator.
So again please proceed at your own risk 😉
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi MoTa_728816,
I just tried and it seems to work so far. Thank you for the very helpful experiment!
Best,
Joseph
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The reason I've been trying to do this is because in order to debug multiple devices "at the same time", I would like to open multiple workspaces to include the exact same project.
I'd like to ask is it possible to do so? And, by saying that, I mean including the same project in different workspaces without any conflicts in building/debugging the two separate project "instances". If so, then how?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear JoYa-san,
Although I'm willing try to attack the problem,
since the theme is now using multiple instance(s) of the same project,
which is different from the subject of this discussion.
Could you create another question/discussion with the appropriate subject?
Best Regards,
19-Jun-2020
Motoo Tanaka