This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Modifying SDK. Is that good practice?

Hello,

Is it a good practice to modify SDK files?

I mean, do you use SDK as integral part of your project and feel free to modify it, or do you try to avoid it and just use API's as it is?

This question is a little bit related to this: devzone.nordicsemi.com/.../

  • For me it is not a good idea because when you want to update the SDK 12.2 ->12.3 for instance you lose your modifications.

  • Totally agree with @emmanuel, usual practice is that you get the SDK source files, copy them to your project and modify there. During compilation you should have always project-specific PATH before SDK so modified files will get into the compilation/linking process (this is the way with compilation chains like GCC, can differ if you use different tools). And when you migrate to new SDK you check changes on these incriminated files and either port changes from new SDK into your project-specific files (if there is reason to keep your custom code) or abandon them and start using these from new SDK version (e.g. if it fixes the problem you were fixing manually before).

    Cheers Jan

  • I totally agree with both @endnode and @Emmanuel

    You should not change anything inside the SDK at all.

    This includes even adding a custom header file for a custom board, hence see my post / question about making sure your project source code is completely isolated from the SDK.

    In your case, I think you'd need to duplicate the files that you need to modify and change your makefile to use your copies instead of the SDK version

Related