How do I add another board and .conf file to an existing project?

I have been working with some code for a nrf5340 DK and now want to add a custom board to the project as an additional build configuration, but I need to now pull out configurations which are set in the prj.conf as they conflict. For example the dk uses a st7789 display and the custom board uses a gc9a01. In my prj.conf I have CONFIG_ST7789V=y which now should not be in the prj.conf but a specific conf for the configured DK.

I had the dk overlay in the root directory. Do I create another directory under boards for my specific configuration of the DK and create a .conf file for it? Will that make it get automatically picked up? Since it's a nrf5340 dk, should I name the directory something else as not to conflict with the existing structure? By naming the conf file the same as the overlay (just different extension, conf vs overlay) does that mean it will get picked up? 
By putting the overlay in a different directory and referencing it in the build, does zephry know to look for a corresponding conf file automatically? 

This might be simple, but I haven't found a good explanation of this specific process which a novice like me could consume.

I'm using vs code and nrf connect (2.6) and zephyr.

Parents Reply Children
  • Ok. These are good links. Thank you. I do need to understand the process more completely and will read through them. I don't know if what I'm doing is considered a child image.

    The second link includes coverage of _deconfig, which may be an option, but it's not really in the overlay is not in the boards directory because I'm using a DK. The third link covers the overlay, which is what I'm using. I suppose it's a legitimate question to ask if I am creating a prototype using a nrf5340 dk, do I create a directory in boards if I'm going to test on other similar boards, as I am doing now and evolve the prototype into a custom board.

    For one build I have a nrf5340dk_nrf5340_cpuapp.overlay in the root and I was wondering if I created a nrf5340dk_nrf5340_cpuapp.conf in root if it would get merged with the prj.conf. This way the CONFIG_ST7789V=y line could be moved out of the prj.conf and into the nrf5340dk_nrf5340_cpuapp.conf and not interfere with the configuration of the 2nd build.

    I will need to know how to create a custom board, but I built my code on a dk with a certain configuration and am now trying to see if it works on board somebody else built.

    This link which you provided seemed the most helpful. I think this falls into the application configuration category. Maybe I need to do #2 "Otherwise, prj_<BOARD>.conf is used if it exists in the application configuration directory.", if the application configuration directory is the root with the prj.conf in it.

     

    I read How to Optimize Zephyr Configuration and Overlays which was helpful as well.

Related