Psoc creator always recompile all my C file

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

cross mob
roboteux
Level 3
Level 3
10 replies posted 10 sign-ins 5 replies posted

Hi,

on my project each time I compile (without any modification in the code, or desing), the arm toolchain recompile all my file.

This is related with the fact that I have some source code in another directory :

.\common\timer.c

.\myprojet.cydsn\main.c

my objets files are in (the normal default directory)

.\myprojet.cydsn\CortexM3\ARM_GCC_541\Debug\*.o

But I cant' figure out why the dependency check is not working

 

I'm using PSOC Creator 4.4_b80 on windows 10, but the issue is the same with psoc creator 4.2 and 4.3

0 Likes
9 Replies
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

roboteux.

Apparently you're not the only one to exhibit this issue.

Here's an unsolved link to the same issue:  PSOC-Creator-4-2-4-4-always-recompiling-C-files-Suggestions 

Len
"Engineering is an Art. The Art of Compromise."
0 Likes

Good to know. 

I think that it's related to the dependency files in the  . deps where the file in the other directory are written with a relative path.  The other file have an absolute path. 

 

But I don't know how to change the behavior

0 Likes
roboteux
Level 3
Level 3
10 replies posted 10 sign-ins 5 replies posted

Is there a  makefile generated somewhere ?

or a way to pass parameters for the makefile ? I'm convince that what I need is to a VPATH to my external directory.

0 Likes

roboteux,

There is a Pre-Build phase where you can supply command lines which can include batch file(s).

Len_CONSULTRON_0-1623426018050.png

 

I suppose you can create a Pre-Build that establishes a VPATH local environment variable.

Once you have this local variable, you can then add Custom Flags in the Compile phase.

Len_CONSULTRON_1-1623426112709.png

What you think?  Workable?

 

Len
"Engineering is an Art. The Art of Compromise."
0 Likes

Workable, yes. will it work ????

I could setup the environment variable, OK no real problem. But I've since found out that PSoc creator is not using make or gmake at all, to decide to recompile or not.
So I'm not so sure that the VPATH will work.
Also when I go deep in the dependency file, they do have relative path, but the path are still all OK, and refer to the correct directory.

So I'm less and less convinced that the VPATH route will work.

I'm wondering if I should in the prebuild step, do something that recopy my C file and may be my include file from my common directory to the codegentmp directory. And try  to compile all from there. That should work.
But (there is always a but) the error reporting will not point me to the correct file if I have an error in my common files.

The other idea, would be to create a complete makefile, and compile outside of psoc_creator. I'm already compiling most of the time outside of psoc creator, but I'm using cyprj to do it. so this is still using the internal of psoc creator.

I'm try to export my project to a makefile, but I didn't succeed to run the compilation using gmake. And it clearly a lot of issue with cygwin, windows 10 and all that stuff.
But I should be able to write a makefile from scratch, and make it work. I think that when building, we can see in the output windows all the command line call.
So that should not be too hard to do.

 

Thanks for your help.

0 Likes
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello @roboteux 

Could you please confirm if this is a project independent issue? 

Are you observing this issue with other project's as well?

Could you please attach your project in bundle format so that all the files are archived? 

Currently we are also internally working on this thread: https://community.cypress.com/t5/PSoC-Creator-Designer-Software/PSOC-Creator-4-2-4-4-always-recompil... to get this issue resolved.

Thanks and Regards

Ekta

0 Likes
lock attach
Attachments are accessible only for community members.

Hi,

It's not directly related to a project. But it's more complex than I thaught.
I have the following code :

main.c:
#include "inc.h"

inc.h:
#define PSOC5LP
#include "../commontest/configdata.h"

configdata.h:
#ifndef PSOC5LP
#include "timer.h"
#endif

 

OK, eventhough the #inlcude "timer.h" is not executed, when making the dependency list the compiler put timer.h in the dependency:
C:/fybotspcb/aspi/simurobot/firmware/test.cydsn/CortexM3/ARM_GCC_541/Debug/main.o : ../commontest/timer.h C:/fybotspcb/aspi/simurobot/firmware/test.cydsn/Generated_Source/PSoC5/CyDmac.h C:/fybotspcb/aspi/simurobot/firmware/test.cydsn/Generated_Source/PSoC5/CyFlash.h C:/fybotspcb/aspi/simurobot/firmware/test.cydsn/Generated_Source/PSoC5/CyLib.h C:/fybotspcb/aspi/simurobot/firmware/test.cydsn/Generated_Source/PSoC5/CySpc.h C:/fybotspcb/aspi/simurobot/firmware/test.cydsn/Generated_Source/PSoC5/cmsis_armcc.h C:/fybotspcb/aspi/simurobot/firmware/test.cydsn/Generated_Source/PSoC5/cmsis_compiler.h C:/fybotspcb/aspi/simurobot/firmware/test.cydsn/Generated_Source/PSoC5/cmsis_gcc.h C:/fybotspcb/aspi/simurobot/firmware/test.cydsn/Generated_Source/PSoC5/core_cm3.h C:/fybotspcb/aspi/simurobot/firmware/test.cydsn/Generated_Source/PSoC5/core_cm3_psoc5.h C:/fybotspcb/aspi/simurobot/firmware/test.cydsn/Generated_Source/PSoC5/cyPm.h C:/fybotspcb/aspi/simurobot/firmware/test.cydsn/Generated_Source/PSoC5/cy_em_eeprom.h C:/fybotspcb/aspi/simurobot/firmware/test.cydsn/Generated_Source/PSoC5/cydevice.h C:/fybotspcb/aspi/simurobot/firmware/test.cydsn/Generated_Source/PSoC5/cydevice_trm.h C:/fybotspcb/aspi/simurobot/firmware/test.cydsn/Generated_Source/PSoC5/cydisabledsheets.h C:/fybotspcb/aspi/simurobot/firmware/test.cydsn/Generated_Source/PSoC5/cyfitter.h C:/fybotspcb/aspi/simurobot/firmware/test.cydsn/Generated_Source/PSoC5/cyfitter_cfg.h C:/fybotspcb/aspi/simurobot/firmware/test.cydsn/Generated_Source/PSoC5/cypins.h C:/fybotspcb/aspi/simurobot/firmware/test.cydsn/Generated_Source/PSoC5/cytypes.h C:/fybotspcb/aspi/simurobot/firmware/test.cydsn/Generated_Source/PSoC5/project.h C:/fybotspcb/aspi/simurobot/firmware/commontest/configdata.h C:/fybotspcb/aspi/simurobot/firmware/test.cydsn/inc.h C:/fybotspcb/aspi/simurobot/firmware/test.cydsn/main.c C:/fybotspcb/aspi/simurobot/firmware/test.cydsn/Generated_Source/PSoC5/cydevicegnu_trm.inc C:/fybotspcb/aspi/simurobot/firmware/test.cydsn/Generated_Source/PSoC5/cyfittergnu.inc

 

As that is what cause the actual bug of recompiling each time.
I've attached the bundle, and the file in my commontest directory as they are not put in the archive (that is also a bug I think).

 

 

 

0 Likes

Eventough the timer.h should not be in the dependency list, the file actually exist and has not been changed, so I don't understand why it's triggering a compilation.

If I export the project in a makefile (and do the modification that I've described in another post).
Then the dependency is correctly created I get :

CortexM3\ARM_GCC_541\Debug/main.o: main.c inc.h \
Generated_Source/PSoC5/project.h Generated_Source/PSoC5/cyfitter_cfg.h \
Generated_Source/PSoC5/cytypes.h Generated_Source/PSoC5/cyfitter.h \
Generated_Source/PSoC5/cydevice.h Generated_Source/PSoC5/cydevice_trm.h \
Generated_Source/PSoC5/cydisabledsheets.h \
Generated_Source/PSoC5/core_cm3_psoc5.h Generated_Source/PSoC5/cytypes.h \
Generated_Source/PSoC5/core_cm3.h \
Generated_Source/PSoC5/cmsis_compiler.h \
Generated_Source/PSoC5/cmsis_gcc.h Generated_Source/PSoC5/CyDmac.h \
Generated_Source/PSoC5/CyLib.h Generated_Source/PSoC5/cyPm.h \
Generated_Source/PSoC5/CyFlash.h Generated_Source/PSoC5/CySpc.h \
Generated_Source/PSoC5/cypins.h Generated_Source/PSoC5/cy_em_eeprom.h \
Generated_Source/PSoC5/cyfitter.h ../commontest/configdata.h

 

 

0 Likes
lock attach
Attachments are accessible only for community members.
roboteux
Level 3
Level 3
10 replies posted 10 sign-ins 5 replies posted

Hi,

as this may be useful for other regarding this topic, here is what I've finally done.
I've exported to a makfile my project (psoc creator right click on the Project name, then export to IDE, then choose makefile option).That then create some file including a makefile and a platform_debug.mk

I've copied those 2 files one directory up, and I've modified them to make them compatible with windows 10 (without cygwin). I have gmake GNU Make 4.2.1 on my PC

After that I have to call gmake ..\makefileBert to compile.
actually I call gmake -j 5 ..\makefileBert to make it multithread which is faster

I've also made a batch file to call it from Visual studio, and start the compilation from here. You'll find my file attached to this comment. I hope it can help someone.

 

 

 

 

0 Likes