<?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>Out of tree development: Building issues</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/56815/out-of-tree-development-building-issues</link><description>Hi, I&amp;#39;m trying to migrate from the nRF9160 DK to our own board, and I&amp;#39;m having some trouble getting the west build system to play nicely. I&amp;#39;ve essentially started with the obvious choice: copy all of the nrf9160_pca10090 files to a new .../boards/arm</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 26 Feb 2020 09:05:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/56815/out-of-tree-development-building-issues" /><item><title>RE: Out of tree development: Building issues</title><link>https://devzone.nordicsemi.com/thread/236448?ContentTypeID=1</link><pubDate>Wed, 26 Feb 2020 09:05:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:74127941-b968-43ae-9bd3-d4fa7798431b</guid><dc:creator>borg</dc:creator><description>&lt;p&gt;Thanks a lot, i had the same problem.&lt;/p&gt;
&lt;p&gt;The multi_image.cmake is included in the root CMakeLists.txt in the nrf/ folder. Maybe this include could be removed there and added again in the CMakeLists.txt of the examples. For an out-of-tree build one could then just take an example and edit the path in the CMakeLists.txt of your own project (and write your own multi_image.cmake).&lt;/p&gt;
&lt;p&gt;Or there could be some variable that is set in the project CMakeLists.txt which is then added to the nonsecure_boards_with_ns_suffix in the multi_image.cmake.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of tree development: Building issues</title><link>https://devzone.nordicsemi.com/thread/230144?ContentTypeID=1</link><pubDate>Tue, 21 Jan 2020 16:43:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e299599-1524-41a8-95a8-05ad10b66c30</guid><dc:creator>erik.johnson</dc:creator><description>&lt;p&gt;Welp, figured out where the magic comes from. In the nrf9160_pca10090ns build, I noticed this at the beginning of the SPM build step:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Changed board to secure nrf9160_pca10090 (NOT NS)&lt;/p&gt;
&lt;p&gt;This comes from nrf/cmake/multi_image.cmake:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;function(image_board_selection board_in board_out)&lt;br /&gt;&amp;nbsp; # It is assumed that only the root app will be built as non-secure.&lt;br /&gt;&amp;nbsp; # This is not a valid assumption as there might be multiple non-secure&lt;br /&gt; &lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;# images defined.&lt;br /&gt; &lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;# TODO: Allow multiple non-secure images by using Kconfig to set the&lt;br /&gt; &lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;# secure/non-secure property rather than using a separate board definition.&lt;br /&gt; &lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;set(nonsecure_boards_with_ns_suffix&lt;br /&gt;&amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;nrf9160_pca10090ns&lt;br /&gt;&amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;nrf9160_pca20035ns&lt;br /&gt;&amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;nrf5340_dk_nrf5340_cpuappns&lt;br /&gt; &lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;)&lt;br /&gt; &lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;if(${board_in} IN_LIST nonsecure_boards_with_ns_suffix)&lt;br /&gt;&amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;string(LENGTH ${board_in} len)&lt;br /&gt;&amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;math(EXPR len_without_suffix &amp;quot;${len} - 2&amp;quot;)&lt;br /&gt;&amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;string(SUBSTRING ${board_in} 0 ${len_without_suffix} board_in_without_suffix)&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;set(${board_out} ${board_in_without_suffix} PARENT_SCOPE)&lt;br /&gt;&amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;message(&amp;quot;Changed board to secure ${board_in_without_suffix} (NOT NS)&amp;quot;)&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;elseif(${board_in} STREQUAL actinius_icarus_ns)&lt;br /&gt;&amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;set(${board_out} actinius_icarus PARENT_SCOPE)&lt;br /&gt;&amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;message(&amp;quot;Changed board to secure actinius_icarus (NOT NS)&amp;quot;)&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;else()&lt;br /&gt;&amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;set(${board_out} ${board_in} PARENT_SCOPE)&lt;br /&gt; &lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;endif()&lt;br /&gt;endfunction()&lt;/p&gt;
&lt;p&gt;It&amp;#39;s quite a stretch to assume a developer is going to understand that they have to make this sort of a change, especially since it&amp;#39;s being kept under source control in a repo that should only need to be checked out to build a project against. I&amp;#39;m still working with the master branch in fw-nrfconnect-nrf, so hopefully this is addressed at some point, either in the source or in documentation.&lt;/p&gt;
&lt;p&gt;Hopefully this can help someone else out should they ever stumble upon a similar issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of tree development: Building issues</title><link>https://devzone.nordicsemi.com/thread/230141?ContentTypeID=1</link><pubDate>Tue, 21 Jan 2020 16:27:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35d50824-2e08-4390-8d10-074c1e5a8a4a</guid><dc:creator>erik.johnson</dc:creator><description>&lt;p&gt;Digging in a little more, it looks like there must be some kind of hidden magic going on for the nrf9160_pca10090/ns board that rewires SPM. The generated .config file for the nrf9160_pca10090 build has this section:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;CONFIG_BOARD=&amp;quot;nrf9160_pca10090&amp;quot;&lt;br /&gt;CONFIG_FLASH_LOAD_SIZE=0x30000&lt;br /&gt;CONFIG_FLASH_LOAD_OFFSET=0&lt;br /&gt;CONFIG_SOC=&amp;quot;nRF9160_SICA&amp;quot;&lt;br /&gt;CONFIG_SOC_SERIES=&amp;quot;nrf91&amp;quot;&lt;br /&gt;CONFIG_NUM_IRQS=65&lt;br /&gt;CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=32768&lt;br /&gt;# CONFIG_WATCHDOG is not set&lt;br /&gt;# CONFIG_UART_NS16550 is not set&lt;br /&gt;# CONFIG_GPIO is not set&lt;br /&gt;CONFIG_ARCH_HAS_CUSTOM_BUSY_WAIT=y&lt;br /&gt;# CONFIG_CORTEX_M_SYSTICK is not set&lt;br /&gt;CONFIG_ISR_STACK_SIZE=2048&lt;br /&gt;CONFIG_CLOCK_CONTROL=y&lt;br /&gt;CONFIG_NRF_RTC_TIMER=y&lt;br /&gt;CONFIG_SYS_CLOCK_TICKS_PER_SEC=32768&lt;br /&gt;CONFIG_SYS_POWER_MANAGEMENT=y&lt;br /&gt;CONFIG_BUILD_OUTPUT_HEX=y&lt;br /&gt;CONFIG_FLOAT=y&lt;br /&gt;CONFIG_TEXT_SECTION_OFFSET=0&lt;br /&gt;CONFIG_FLASH_SIZE=1024&lt;br /&gt;CONFIG_FLASH_BASE_ADDRESS=0x0&lt;br /&gt;CONFIG_SRAM_SIZE=64&lt;br /&gt;CONFIG_SRAM_BASE_ADDRESS=0x20000000&lt;br /&gt;# CONFIG_SPI is not set&lt;br /&gt;# CONFIG_TINYCRYPT is not set&lt;br /&gt;CONFIG_SOC_GECKO_EMU=y&lt;br /&gt;CONFIG_BOARD_NRF9160_PCA10090=y&lt;br /&gt;# CONFIG_BOARD_NRF9160_PCA10090NS is not set&lt;/p&gt;
&lt;p&gt;But when building for our new board:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;CONFIG_BOARD=&amp;quot;&amp;lt;board name&amp;gt;&amp;quot;&lt;br /&gt;CONFIG_FLASH_LOAD_SIZE=0x40000&lt;br /&gt;CONFIG_FLASH_LOAD_OFFSET=0x40000&lt;br /&gt;CONFIG_SOC=&amp;quot;nRF9160_SICA&amp;quot;&lt;br /&gt;CONFIG_SOC_SERIES=&amp;quot;nrf91&amp;quot;&lt;br /&gt;CONFIG_NUM_IRQS=65&lt;br /&gt;CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=32768&lt;br /&gt;# CONFIG_WATCHDOG is not set&lt;br /&gt;# CONFIG_UART_NS16550 is not set&lt;br /&gt;# CONFIG_GPIO is not set&lt;br /&gt;CONFIG_ARCH_HAS_CUSTOM_BUSY_WAIT=y&lt;br /&gt;# CONFIG_CORTEX_M_SYSTICK is not set&lt;br /&gt;CONFIG_ISR_STACK_SIZE=2048&lt;br /&gt;CONFIG_CLOCK_CONTROL=y&lt;br /&gt;CONFIG_NRF_RTC_TIMER=y&lt;br /&gt;CONFIG_SYS_CLOCK_TICKS_PER_SEC=32768&lt;br /&gt;CONFIG_SYS_POWER_MANAGEMENT=y&lt;br /&gt;CONFIG_BUILD_OUTPUT_HEX=y&lt;br /&gt;CONFIG_FLOAT=y&lt;br /&gt;CONFIG_TEXT_SECTION_OFFSET=0&lt;br /&gt;CONFIG_FLASH_SIZE=1024&lt;br /&gt;CONFIG_FLASH_BASE_ADDRESS=0x0&lt;br /&gt;CONFIG_SRAM_SIZE=128&lt;br /&gt;CONFIG_SRAM_BASE_ADDRESS=0x20020000&lt;br /&gt;# CONFIG_SPI is not set&lt;br /&gt;# CONFIG_TINYCRYPT is not set&lt;br /&gt;CONFIG_SOC_GECKO_EMU=y&lt;br /&gt;# CONFIG_BOARD_&amp;lt;BOARD_NAME&amp;gt; is not set&lt;br /&gt;CONFIG_BOARD_&amp;lt;BOARD_NAME&amp;gt;NS=y&lt;/p&gt;
&lt;p&gt;CONFIG_BOARD in both cases grabs the secure board name -- which is expected, since SPM needs to sit in the secure region -- but then they deviate on things that actually depend on the secure/non-secure definitions. Someone must be changing CONFIG_BOARD_NRF9160_PCA10090NS to the non-NS variant specifically...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of tree development: Building issues</title><link>https://devzone.nordicsemi.com/thread/230137?ContentTypeID=1</link><pubDate>Tue, 21 Jan 2020 16:12:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bae6b50b-a5b8-4cfd-81a6-01dc5bf152de</guid><dc:creator>erik.johnson</dc:creator><description>&lt;p&gt;Looks like it&amp;#39;s not getting set correctly:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;/mnt/c/git_root/test/zephyr/soc/arm/nordic_nrf/validate_base_addresses.c:38:9: note: #pragma message: Our clock: 0x40005000&lt;br /&gt; 38 | #pragma message &amp;quot;Our clock: &amp;quot; XSTR(DT_INST_0_NORDIC_NRF_CLOCK_BASE_ADDRESS)&lt;br /&gt; | ^~~~~~~&lt;br /&gt;/mnt/c/git_root/test/zephyr/soc/arm/nordic_nrf/validate_base_addresses.c:39:9: note: #pragma message: Their clock: ((NRF_CLOCK_Type*) 0x50005000UL)&lt;br /&gt; 39 | #pragma message &amp;quot;Their clock: &amp;quot; XSTR(NRF_CLOCK)&lt;/p&gt;
&lt;p&gt;Looking at back at the NRF_PERIPH() macro, it&amp;#39;s dependent on NRF_TRUSTZONE_NONSECURE, which I guess tracks with the warning about TRUSTED_EXECUTION_NONESECURE having issues during the Kconfig steps. So at this point I would guess I&amp;#39;ve still got an unknown issue with setting the trusted config, but hopefully once that&amp;#39;s resolved the flurry of compilation issues will go away.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of tree development: Building issues</title><link>https://devzone.nordicsemi.com/thread/230135?ContentTypeID=1</link><pubDate>Tue, 21 Jan 2020 15:55:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61506969-4a66-408b-bbb6-94ad766fee6c</guid><dc:creator>erik.johnson</dc:creator><description>&lt;p&gt;The assertions also don&amp;#39;t make a lot of sense to me, as they shouldn&amp;#39;t be failing. Taking the first one -- NRF_CLOCK -- as an example:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;/mnt/c/git_root/test/zephyr/soc/arm/nordic_nrf/validate_base_addresses.c:35:1: note: in expansion of macro &amp;#39;CHECK_ADDRESS&amp;#39;&lt;br /&gt; 35 | CHECK_ADDRESS(DT_INST_0_NORDIC_NRF_CLOCK_BASE_ADDRESS, NRF_CLOCK);&lt;br /&gt; | ^~~~~~~~~~~~~&lt;/p&gt;
&lt;p&gt;From my generated Devicetree files:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;$ grep -nr &amp;quot;DT_INST_0_NORDIC_NRF_CLOCK_BASE_ADDRESS&amp;quot; ./&lt;br /&gt;./build/b0/spm/zephyr/include/generated/generated_dts_board.conf:1014:DT_INST_0_NORDIC_NRF_CLOCK_BASE_ADDRESS=0x40005000&lt;br /&gt;./build/b0/spm/zephyr/include/generated/generated_dts_board_unfixed.h:1064:#define DT_INST_0_NORDIC_NRF_CLOCK_BASE_ADDRESS DT_NORDIC_NRF_CLOCK_40005000_BASE_ADDRESS&lt;br /&gt;./build/b0/zephyr/include/generated/generated_dts_board.conf:1014:DT_INST_0_NORDIC_NRF_CLOCK_BASE_ADDRESS=0x40005000&lt;br /&gt;./build/b0/zephyr/include/generated/generated_dts_board_unfixed.h:1064:#define DT_INST_0_NORDIC_NRF_CLOCK_BASE_ADDRESS DT_NORDIC_NRF_CLOCK_40005000_BASE_ADDRESS&lt;br /&gt;./build/mcuboot/spm/zephyr/include/generated/generated_dts_board.conf:1014:DT_INST_0_NORDIC_NRF_CLOCK_BASE_ADDRESS=0x40005000&lt;br /&gt;./build/mcuboot/spm/zephyr/include/generated/generated_dts_board_unfixed.h:1064:#define DT_INST_0_NORDIC_NRF_CLOCK_BASE_ADDRESS DT_NORDIC_NRF_CLOCK_40005000_BASE_ADDRESS&lt;br /&gt;./build/mcuboot/zephyr/include/generated/generated_dts_board.conf:1014:DT_INST_0_NORDIC_NRF_CLOCK_BASE_ADDRESS=0x40005000&lt;br /&gt;./build/mcuboot/zephyr/include/generated/generated_dts_board_unfixed.h:1064:#define DT_INST_0_NORDIC_NRF_CLOCK_BASE_ADDRESS DT_NORDIC_NRF_CLOCK_40005000_BASE_ADDRESS&lt;br /&gt;./build/spm/zephyr/include/generated/generated_dts_board.conf:1014:DT_INST_0_NORDIC_NRF_CLOCK_BASE_ADDRESS=0x40005000&lt;br /&gt;./build/spm/zephyr/include/generated/generated_dts_board_unfixed.h:1064:#define DT_INST_0_NORDIC_NRF_CLOCK_BASE_ADDRESS DT_NORDIC_NRF_CLOCK_40005000_BASE_ADDRESS&lt;br /&gt;./build/zephyr/include/generated/generated_dts_board.conf:1081:DT_INST_0_NORDIC_NRF_CLOCK_BASE_ADDRESS=0x40005000&lt;br /&gt;./build/zephyr/include/generated/generated_dts_board_unfixed.h:1133:#define DT_INST_0_NORDIC_NRF_CLOCK_BASE_ADDRESS DT_NORDIC_NRF_CLOCK_40005000_BASE_ADDRESS&lt;/p&gt;
&lt;p&gt;That seems to match what should be generated for the non-secure part:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;$ grep -nr &amp;quot;define.*NRF_CLOCK&amp;quot; ../&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;...&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;../modules/hal/nordic/nrfx_config_nrf9160.h:39:#define NRF_CLOCK&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NRF_PERIPH(NRF_CLOCK)&lt;/p&gt;
&lt;p&gt;Which is defined as:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;#if defined(NRF_TRUSTZONE_NONSECURE)&lt;br /&gt;#define NRF_PERIPH(P) P##_NS&lt;br /&gt;#else&lt;br /&gt;#define NRF_PERIPH(P) P##_S&lt;br /&gt;#endif&lt;/p&gt;
&lt;p&gt;That selects:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;../modules/hal/nordic/nrfx/mdk/nrf9160.h:2016:#define NRF_CLOCK_NS_BASE 0x40005000UL&lt;br /&gt;../modules/hal/nordic/nrfx/mdk/nrf9160.h:2136:#define NRF_CLOCK_NS ((NRF_CLOCK_Type*) NRF_CLOCK_NS_BASE)&lt;/p&gt;
&lt;p&gt;So this should pass the check above. Is there maybe something going on with auto-generation of includes or something? Perhaps the NRF_CLOCK value isn&amp;#39;t getting properly pulled in or something...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of tree development: Building issues</title><link>https://devzone.nordicsemi.com/thread/230133?ContentTypeID=1</link><pubDate>Tue, 21 Jan 2020 15:37:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d78ff83d-38f5-4ba0-91cc-416abfad8c6e</guid><dc:creator>erik.johnson</dc:creator><description>&lt;p&gt;Interestingly, updating to the latest in master from the fw-nrfconnect-nrf repo will let me get past #2 without having to use Zephyr&amp;#39;s tree. Still results in the same chain of assertion failures in #3, however.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>