Incremental build not working properly on S32DS project

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Incremental build not working properly on S32DS project

604 Views
losullivan
Contributor I

I have a long-standing problem with various S32DS projects (for S32k architecture - specifically s32k14x), where, if I change a source file, and rebuild via 'build project', then the toolchain does not see the changed dependency, and does not generate new built output (elf/hex/s19). The build/make output is as follows:

10:54:59 **** Incremental Build of configuration Debug for project S32K_Bootloader ****
make -j8
make: 'src/adc_poll.o' is up to date.

10:55:00 Build Finished. 0 errors, 0 warnings. (took 809ms)

If, however, I clean and then build, I get a fresh new build output that reflects my change.

This seems to tend to happen to my projects when I transition to a new PC (every 5 years or so). I suspect that the issue has something to do with projects getting created in an older version of S32DS, and then being imported into a newer version - but I'm not positive. I'm currently using S32DS for S32 Platform, Version 3.4. The project in question was initially created in may 2018 (probably with whatever S32DS version was current at that time

This has happened to about half a dozen projects over the years, and seems to also occur with S32DS for Power Architecture.

I've found that if I remake the project in S32DS (ie start with a new project, and then re-add all my source files, change all my project settings, etc), then incremental builds work properly. This is a pain , though, and I have some buried project settings changes, custom linker scripts, startup files, etc and i'm always nervous I've forgotten something.

I've looked at the various make artifacts, and have never been able to identify the problem. subdir.mk correctly includes the .c file that I changed (main.c), the main.d include main.c as a dependency, and yet when I change main.c, The build stops at 'xxx is up to date', make seems to think nothing has changed to necessitate a new build, and no new build artifact is created.

I've attached a 'minimum viable' demonstration project. If I import this project into s32ds (s32k platform) v3.4, and do a clean build, then change the 'i+=1;' in main.c, to 'i+=2' (i is volatile), then to an incremental build, then i get no new build artifact.

Does anyone have any idea why this is happening? Even some ideas on what/where to look would be valuable.

0 Kudos
2 Replies

585 Views
losullivan
Contributor I

I think I know more about this now. It seems the immediate cause of this is that, when I import an old project, the setting, C/C++ Build->Behavior->Workbench Build Behavior->Build (Incremental Build) is empty. On working projects, I see "all" here. In fact if I simply enter "all" for this setting on a broken project, it seems to work properly again.

That said, I think the root problem is deeper. I thing the old/broken projects have a toolchain specified in the .cproject file, which is no longer available in S32DS 3.4. In my case the old/unavailable toolchain is "ARM Bare-Metal 32-bit Target Binary Toolchain". When I import these projects, S32DS 3.4 seems to default to "NXP GCC 6.3 for Arm 32-bit Bare-Metal", and all other defaults seem about right for my projects. Though a couple things don't seem to work quite right in this situation (eg the build target getting blanked out).

If I toggle between a couple of the available toolchains, then finally press 'accept' on 'NXP GCC 6.3 for Arm 32-bit Bare-Metal', and then enter my settings in c/c++ build -> Settings -> Target Processor, specifically Arm Family and Libraries support, then things seem to go back to normal. 'all' appears in the build target box, my incremental builds work, etc.

S32DS's behavior here seems quite dangerous to me, though. I think it should complained loudly that, upon importing the project, it didn't recognize the toolchain specified in the .cproject file, and forced me to resolve the problem by picking an available toolchain. Instead it silently chose a default toolchain, and some fairly cryptic behavior ensued.

0 Kudos

603 Views
losullivan
Contributor I

... also attached here is another project, made fresh, using the same source files, which does do the incremental build properly (if main.c is changed).

0 Kudos