Hello,
I am new to Zephyr and I am trying to figure out the best way to set up a new project for a nRF91 modem. Ideally, the project should allow patching of the nRF Connect SDK in the future if needed. To preface, I have found a few ways to do this by researching online. I have tested none of these methods:
1. Create a fork of the nRF Connect SDK and update your west.yml file to point to the fork. Patch the fork directly as needed.
2. Use CMake to overwrite a file with the patched file: Custom implementation for a source file in the NRF connect SDK/ Zephyr
This assumes the SDK lives in your project repo and is downloaded via "west update". Otherwise you will overwrite the default installation directory of the SDK in C:\ncs\... which is not good.
3. Use "git apply" to apply a ".patch" file to your SDK after downloading the SDK with "west update".
I don't particularly like any of these methods, and was wondering if the following is possible:
Question 1: Can you apply a patch by excluding the patched file from the "clean" version of the nRF Connect SDK when it is downloaded with "west update"?
For example:
Lets say you want to patch the following (Random file I picked): C:\ncs\v2.9.0\nrf\subsys\uart_async_adapter\uart_async_adapter.c
Is it possible to commit ONLY this file to my project repo (I am using SVN) and exclude it from the nRF Connect SDK download via the west.yml file?
Such as (Pseudo code): west.yml
manifest: self: path: application remotes: - name: nrf url-base: https://github.com/nrfconnect projects: - name: sdk-nrf remote: nrf path: nrf revision: v2.9.0 import: path-prefix: external clone-depth: 1 exclude: nrf\subsys\uart_async_adapter\uart_async_adapter.c
In the above, note the following:
exclude:
nrf\subsys\uart_async_adapter\uart_async_adapter.c
Again, this is pseudo code. I don't know what the correct syntax is, or if this is even possible.
My goal is to avoid managing a fork of the nRF Connect SDK. I will be using SVN for version control, not Git. I also don't want to apply patches manually as this seems prone to user error of forgetting to apply the patches. Thus, it should be automated so the user/developer doesn't have to think about it.
Is my proposed method of excluding a specific file from the vanilla nRF Connect SDK download possible?
Edit: Question 2: Can you apply patches to the nRF Connect SDK that is installed in the default location (C:\ncs\...) without modifying the SDK itself?
Perhaps put the patched files in a /patches folder in your project directory and point your project to use that file instead of the one in the nRF Connect SDK? This is what I used to do when developing with the old nRF SDK using Keil uVision IDE.
Thanks,
Derek