How to have board-specific prf.conf files

I developed a project using nRF Connect 2.6.1 in VSCode.  I created a custom board for the development board I was using (the SparkFun Pro nRF52840 Mini - Bluetooth Development Board https://www.sparkfun.com/products/15025).  Now the final board has been produced, and I have created a custom board description for it (the final board is different than the Sparkfun board, although they both use the same processor).

I would like to be able to build my code for either the development board or the final board, so I need to have a general prf.conf file which has settings that apply to BOTH boards, and then board-specific prf.conf files that contain settings specific to the particular board.

I cannot figure out how to accomplish this.  I only seem to be able to get it pull in prf.conf.  I have created a new build configuration for the new board; what is the magic for pulling in both prf.conf and a config file for the board selected?  What does the prj file need to be named, and where should it be located?  How should the build configuration be set up?

--mkj

Parents Reply
  • mkjones said:
    I tried putting <board>.conf file in the boards directory, but it still only seemed to pick up the prj.conf (it did not appread to read in the board.conf file).

    The <board> name should be the same as the board for the building. Could you provide the completed build log via toolbar -> insert -> code?

    mkjones said:
    (I set that in the build config, right?)

    Yes, with "-DCONF_FILE=YourExtraConfig.conf".

Children
  • My <board>.cong file was in the boards directory, and had the same name as the board.  It does not get loaded automatically.

    I was able to get it to load my modifying the CACHED_CONF_FILE build settings and adding the board.conf after the prj.conf.

    BTW, setting CONF_FILE also worked, but the setting never got saved when I closed the build setting window.  So I guess I'll stick with adding it to CACHED_CONF_FILE.

  • mkjones said:
    My <board>.cong file was in the boards directory, and had the same name as the board.  It does not get loaded automatically.

    It has to add <board>.cong manually in the VS Code. West build would load it automatically. 

    mkjones said:
    setting CONF_FILE also worked, but the setting never got saved when I closed the build setting window. 

    VS Code would not save it. You have to check the build configuration of VS Code every time. 

Related