This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to define 2 boards for the same application

hello Nordic 

i have a project than works with nrf52840 and ncs (zephyr) 

i want to have the same application running on nrf52832 as well, as part of a single code base strategy.

now i work with the nrf tool in for the vs code IDE,  

i added a board and i a build configuration for the second board, but i don't understand how can both boards work with the same CMakeLists.txt, pm_static.yaml and prj.conf, since they are the same for both boards in the same application 

obviously they require different partitioning since they don't have same memory size, that is just an example

any ideas on best practice for how to do that ?

 

hope to read from you soon

best regards

Ziv

  • the yml issue was solved by adding this line to the CMakeLists.txt, don't know if it is ok practice or just a workaround because something else is not right..

    set(PM_STATIC_YML_FILE ${CMAKE_SOURCE_DIR}/pm_static_${BOARD}.yml)
    regarding the .conf i don't hold a .overlay file, just the .conf file inside the boards/arm/board1 directory where the .dts and .defconfig etc. are at, but if the .conf stay at the the directory where the CMakeLists.txt is then it is found. 
     
    there is actually a another problem and maybe it relates to other problems i see, part of my CMakeLists.txt looks like this:
    set(BOARD_ROOT ${CMAKE_CURRENT_LIST_DIR}/../)
    set(PM_STATIC_YML_FILE ${CMAKE_SOURCE_DIR}/pm_static_${BOARD}.yml)
    if(BOARD_HALO_EP2)
        if(NOT DEFINED OVERLAY_CONFIG)
            set(OVERLAY_CONFIG halo_ep2.conf)
        endif()    
    elseif(BOARD_CANARY_PROTO_REV_4)
        if(NOT DEFINED OVERLAY_CONFIG)
            set(OVERLAY_CONFIG canary_proto_rev_4.conf)
        endif() 
    endif()
    and then i have a problem with .conf at the directory that is works, but if change the "elseif(BOARD_CANARY_PROTO_REV_4)" to just "else()" then there is no problem with the canary_proto_rev_4.conf, like the "BOARD_CANARY_PROTO_REV_4 is not defines/configured, but in the west comman generated by the nrf connect extension for vs code i can see there is " --board canary_proto_rev_4" and in my board directory (boards/arm/canary_proto_rev_4) there is a Kconfig.board file and this is its content:
    config BOARD_CANARY_PROTO_REV_4
    	bool "BOARD_CANARY_PROTO_REV_4"
    	depends on SOC_NRF52840_QIAA
    
    so why does it looks like it the board is not defined ?
     
    p.s. also tried like this before, "elseif(DEFINED BOARD=canary_proto_rev_4)" and also tried with "if
    (CONFIG_BOARD_CANARY_PROTO_REV_4)
    one more strange thing is that in the application/build_canary/zephyr build directory there is the CMakeCache.txt and there i see  - "BOARD:UNINITIALIZED=canary_proto_rev_4" why is UNINITIALIZED ??
    and same affect: 
    hope to read from you soon
    best regards
    Ziv
  • what solved the issue with the board was to write it like so in the CMakeLists.txt file:

    if("${BOARD}" MATCHES "canary_proto_rev_4")
    in the west command generated it is written like so: "west build .. --board canary_proto_rev_4 .. "
    regarding the .conf issue, when using the nrf connect extension for vs code, one needs to add the .conf when creating a new build, in the Kconfig fragments (if your .conf files are not there then it might not work, but if you put them in under the application dir they should be there)
    also i saw somewhere that naming of the .conf file (not talking about the prj.conf) should start with "overlay" so the file's name is "overlay_boardx.conf, for me it worked without it so far
    best regards
    Ziv 
Related