<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nRFConnect SDK custom application/board set up issues with nRF5340</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/76484/nrfconnect-sdk-custom-application-board-set-up-issues-with-nrf5340</link><description>Hello, 
 
 I am in the process of writing a custom application for a custom board for the nRF5340, but have run into some odd behavior with SES when I started changing around things to use relative paths instead of the absolute paths that are put in place</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 23 Jun 2021 14:35:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/76484/nrfconnect-sdk-custom-application-board-set-up-issues-with-nrf5340" /><item><title>RE: nRFConnect SDK custom application/board set up issues with nRF5340</title><link>https://devzone.nordicsemi.com/thread/316785?ContentTypeID=1</link><pubDate>Wed, 23 Jun 2021 14:35:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab8e1858-b129-4440-845e-bf7df198581f</guid><dc:creator>SpencerMougey</dc:creator><description>&lt;p&gt;Hi Carl,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So I updated to set the Zephyr base to match the pathing based on my CMakeLists.txt file for my new Zephyr base, and just to make sure that I could ensure that I was using the using the new zephyr base, I temporarily renamed my original 1.5.1 nRFConnect directory to 1.5.1_test so that anything that was using the old file paths would break if it tried to use the original zephyr base.&lt;/p&gt;
&lt;p&gt;The system does not build at all amongst other things, so there is more to just setting the zephyr base variable. When I try to build in SES, the build fails quickly with the error &amp;quot;1&amp;gt; CMake Error: Generator: execution of make failed. Make command was: C:/Users/SMougey/Documents/nRFConnectSDKs/v1.5.1/toolchain/opt/bin/ninja.exe&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Just looking through the files that are in the directory for my project files, CMakeCache.txt, cmake_install.cmake, build.ninja, rules.ninja, zephyr_modules.txt, and zephyr_setting.txt files all still reference the old Zephyr path. Based on the .ninja files, these are created by Cmake, but it seems like that creation only occurs when I initially generate the entire project from nRFConnect based on the timestamps that the files were generated, and do not appear to be updated as I make changes to the CMakeLists.txt file (at least with what we have changed thus far).&lt;/p&gt;
&lt;p&gt;The .ninja files explicitly call out to not modify them, but I have to wonder if I need to do something to force update them. More importantly, I don&amp;#39;t want to just change the absolute path it points to as that defeats the whole point of my goal to make a relative path to the CMake/project file.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;To add to this, I updated my build.emProject and AppCore.emProject files to use relative paths based on the $(ProjDir) variable which does in fact result in SES being able to find and open the files if I double click on them in the IDE. However, this seems to cause all sorts of problems with the nRFConnect linked in utilities where I can no longer edit the CmakeLists.txt file through the IDE (I get a &amp;quot;Can&amp;#39;t open CMakeLists.txt for reading&amp;quot;), the GUI editor for the KConfig file under the project tab is now completely missing (see attached screenshot).&lt;/p&gt;
&lt;p&gt;Reverting the project files back to their original state results in the CMakeLists.txt editing to come back, but the KConfig editor is still missing.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1624458787543v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRFConnect SDK custom application/board set up issues with nRF5340</title><link>https://devzone.nordicsemi.com/thread/316691?ContentTypeID=1</link><pubDate>Wed, 23 Jun 2021 11:19:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47bcebd4-28c7-44c5-a910-f537c021c8b5</guid><dc:creator>Carl Richard</dc:creator><description>&lt;p&gt;Hi again, Spencer!&lt;br /&gt;&lt;br /&gt;Could it be a viable solution to&amp;nbsp;explicitly set the ZEPHYR_BASE environment variable to the desired value at the start of CMakeLists.txt, like demonstrated below?&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;# SPDX-License-Identifier: Apache-2.0


cmake_minimum_required(VERSION 3.13.1)
set(ENV{ZEPHYR_BASE} ${CMAKE_CURRENT_SOURCE_DIR}/../../..)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(fade_led)

target_sources(app PRIVATE src/main.c)
&lt;/pre&gt;&lt;br /&gt;This should give you the desired ZEPHYR_BASE through the rest of the build process as well, without affecting the system environment variables.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Carl Richard&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRFConnect SDK custom application/board set up issues with nRF5340</title><link>https://devzone.nordicsemi.com/thread/316338?ContentTypeID=1</link><pubDate>Mon, 21 Jun 2021 16:39:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58e2fb27-a72d-4666-a495-dac619afeaa0</guid><dc:creator>SpencerMougey</dc:creator><description>&lt;p&gt;Hi Carl!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So I took a bit more time to try and parse through more of the documentation, webinars, etc again, and I have the code building in my own application (outside of the Zephyr codebase) for my own custom board (also outside the Zephyr codebase). However, in my search for trying to make the relative pathing work, I am stuck again.&lt;/p&gt;
&lt;p&gt;1) I added in find_package(Zephyr REQUIRED HINTS ${CMAKE_CURRENT_SOURCE_DIR}/../Common/zephyr) to replace the $ENV{ZEPHYR_BASE} include, but that so far has seemed to have no effect on anything from a build perspective. I even made the path something that was invalid, and the code appears to compile for the ZEPHYR_BASE regardless.&lt;/p&gt;
&lt;p&gt;2) For my board.cmake file for the custom board, I swapped the include($ENV{ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) to include(${CMAKE_CURRENT_SOURCE_DIR}/../Common/zephyr/boards/common/nrfjprog.board.cmake) to try and make it relative, but the compilation process throws errors. It looks like everything is being pulled from the cache as the path used for the CURRENT_SOURCE ends up being the &amp;#39;original&amp;#39; zephyr base, and not the new one I want to use.&lt;/p&gt;
&lt;p&gt;The CMakeLists.txt is pasted below.&lt;/p&gt;
&lt;p&gt;For reference the directories in question are:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Original Zephyr Base&lt;/strong&gt;: C:/Users/SMougey/nRFConnect/1.5.1/zephyr&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;New Zephyr Base:&lt;/strong&gt; C:/Workspace/CustomerApp/Common/zephyr&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Application Location:&lt;/strong&gt; C:/Workspace/CustomerApp/AppCore&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Application board Location:&lt;/strong&gt; C:/Workspace/CustomerApp/AppCore/boards/arm/nRF5340_Custom&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#
# Copyright (c) 2018 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#
cmake_minimum_required(VERSION 3.13.1)

# use this to ensure that we are using the custom board directory in the
# board/&amp;lt;arch&amp;gt;/&amp;lt;board&amp;gt;
list(APPEND BOARD_ROOT ${CMAKE_CURRENT_SOURCE_DIR})

find_package(Zephyr REQUIRED HINTS ${CMAKE_CURRENT_SOURCE_DIR}/../Common/zephyr)
project(NONE)

# NORDIC SDK APP START
target_sources(app PRIVATE
  src/main.c
)
# NORDIC SDK APP END

zephyr_library_include_directories(.)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRFConnect SDK custom application/board set up issues with nRF5340</title><link>https://devzone.nordicsemi.com/thread/316289?ContentTypeID=1</link><pubDate>Mon, 21 Jun 2021 13:45:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1406874a-9857-4a3b-950e-813d3671752a</guid><dc:creator>Carl Richard</dc:creator><description>&lt;p&gt;Hello, Spencer!&lt;br /&gt;&lt;br /&gt;Thanks for reaching out. All the required steps for moving to a custom application should be described in the &amp;quot;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/gs_modifying.html?highlight=cmakelists#modifying-a-sample-application"&gt;Modifying a sample application&lt;/a&gt;&amp;quot;-documentation, but from what I can see you&amp;#39;ve already looked at that. However, I can see that the documentation is a bit unclear here. While &amp;quot;.config&amp;quot; is deleted when you clean the build directory it&amp;#39;s also generated when opening a new project. A more correct way to phrase it is that any changes you have made to the configuration in SES will be wiped when you clean the build directory, reverting the configuration to the original.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;When it comes to your issue with relative paths and options in SES I&amp;#39;m a bit unsure what may be causing it, but in CMakeLists &amp;quot;${CMAKE_CURRENT_SOURCE_DIR}&amp;quot; is normally used. Could you try that instead of &amp;quot;&lt;span&gt;$(ProjectDir)&amp;quot;?&lt;br /&gt;&lt;br /&gt;Maybe you could share the CMakeLists.txt you&amp;#39;re using as well?&lt;br /&gt;&lt;br /&gt;Please notify me if anything is unclear!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Carl Richard&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>