<?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>NRF9160 LittleFS build non-secure target</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/88253/nrf9160-littlefs-build-non-secure-target</link><description>(replica as the previous post was archived by accident...) 
 
 Hi, 
 I&amp;#39;m trying to incorporate LittleFS into our development. We are relying on services provided by TF-M. 
 
 To recreate: build /zephyr/samples/fs/littleFS and set target nrf9160dk_nrf9160_ns</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 25 May 2022 12:50:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/88253/nrf9160-littlefs-build-non-secure-target" /><item><title>RE: NRF9160 LittleFS build non-secure target</title><link>https://devzone.nordicsemi.com/thread/369536?ContentTypeID=1</link><pubDate>Wed, 25 May 2022 12:50:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ea5437de-db79-4405-b7a1-57c7602400a8</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;My deepest apologies&amp;nbsp;here, I have tested incorrectly yesterday.&lt;/p&gt;
&lt;p&gt;Yes, you&amp;#39;re completely right. You need to comment out, or &amp;#39;n&amp;#39; select this symbol for fitting the image into the section:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_DEBUG=n&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However, you will still have issues when running on ncs v1.9.1, as the non-secure storage partition isn&amp;#39;t properly handled wrt. non-secure access.&lt;/p&gt;
&lt;p&gt;ie. a secure fault will occur when you try to access the address range.&lt;/p&gt;
&lt;p&gt;Support for TF-M non-secure storage partition was added with this PR:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/pull/7702"&gt;https://github.com/nrfconnect/sdk-nrf/pull/7702&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And the latest tag where this is present is &amp;quot;v2.0.0-rc1&amp;quot;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 LittleFS build non-secure target</title><link>https://devzone.nordicsemi.com/thread/369472?ContentTypeID=1</link><pubDate>Wed, 25 May 2022 09:33:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6ef7a78-2887-4836-9609-b6eb18bb0bb8</guid><dc:creator>pbornerup</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;H&amp;aring;kon,&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;As per your suggestion I tried switching to a newer NCS version.&lt;br /&gt;&lt;br /&gt;After a quick backup I deleted all the content and used&lt;em&gt;&amp;nbsp;west init -m &lt;a href="https://github.com/nrfconnect/sdk-nrf"&gt;github.com/.../sdk-nrf&lt;/a&gt; --mr v1.9.1&amp;nbsp;&lt;br /&gt;&lt;/em&gt;and west update etc.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I just wanted a clean build system (been testing things out in the older..)&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;As before it builds and runs fine for the &amp;#39;nrf9160dk_nrf9160&amp;#39; target. When switching to TF-M I now get a new error:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;➜  littlefs west build
[0/196] Performing build step for &amp;#39;tfm&amp;#39;
[2/24] Linking C executable bin/tfm_s.axf
FAILED: bin/tfm_s.axf 
: &amp;amp;&amp;amp; /opt/gnuarmemb/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-gcc -mcpu=cortex-m33+nodsp+nofp -g -mcpu=cortex-m33+nodsp+nofp --entry=Reset_Handler --specs=nano.specs -Wl,-check-sections -Wl,-fatal-warnings -Wl,--gc-sections -Wl,--no-wchar-size-warning -Wl,--print-memory-usage -Wl,-Map=/home/pbor/xxxxxxxxx/yyyyyy/integration_testing/little_fs_v2/littlefs/build/tfm/bin/tfm_s.map -mfloat-abi=soft -Wl,--cmse-implib,--out-implib=/home/pbor/xxxxxxxxx/yyyyyy/integration_testing/little_fs_v2/littlefs/build/tfm/secure_fw/s_veneers.o -T /home/pbor/xxxxxxxxx/yyyyyy/integration_testing/little_fs_v2/littlefs/build/tfm/platform/target/nrf9160/nrf_common/CMakeFiles/tfm_s_scatter.dir/./gcc/nordic_nrf_s.ld secure_fw/CMakeFiles/tfm_s.dir/__/generated/secure_fw/spm/cmsis_func/tfm_veneers.o secure_fw/CMakeFiles/tfm_s.dir/__/platform/ext/target/nordic_nrf/common/nrf9160/gcc/startup_nrf9160_s.o secure_fw/CMakeFiles/tfm_s.dir/__/platform/ext/target/nordic_nrf/common/core/plat_test.o secure_fw/CMakeFiles/tfm_s.dir/partitions/lib/sprt/tfm_sp_log_raw.o secure_fw/CMakeFiles/tfm_s.dir/__/platform/ext/common/tfm_hal_sp_logdev_periph.o -o bin/tfm_s.axf  platform/libplatform_s.a  secure_fw/partitions/lib/sprt/libtfm_sprt.a  secure_fw/spm/libtfm_spm.a  lib/fih/libtfm_fih.a  secure_fw/partitions/crypto/mbedcrypto/nrf_security_src/libcrypto_service_mbedcrypto.a  secure_fw/partitions/audit_logging/libtfm_psa_rot_partition_audit.a  secure_fw/partitions/crypto/libtfm_psa_rot_partition_crypto.a  secure_fw/partitions/initial_attestation/libtfm_psa_rot_partition_attestation.a  secure_fw/partitions/protected_storage/libtfm_app_rot_partition_ps.a  secure_fw/partitions/internal_trusted_storage/libtfm_psa_rot_partition_its.a  secure_fw/partitions/platform/libtfm_psa_rot_partition_platform.a  platform/libplatform_s.a  secure_fw/partitions/lib/sprt/libtfm_sprt.a  secure_fw/spm/libtfm_spm.a  lib/fih/libtfm_fih.a  secure_fw/partitions/crypto/mbedcrypto/nrf_security_src/libcrypto_service_mbedcrypto.a  secure_fw/partitions/audit_logging/libtfm_psa_rot_partition_audit.a  secure_fw/partitions/crypto/libtfm_psa_rot_partition_crypto.a  secure_fw/partitions/initial_attestation/libtfm_psa_rot_partition_attestation.a  secure_fw/partitions/protected_storage/libtfm_app_rot_partition_ps.a  secure_fw/partitions/internal_trusted_storage/libtfm_psa_rot_partition_its.a  secure_fw/partitions/platform/libtfm_psa_rot_partition_platform.a  platform/libplatform_s.a  secure_fw/partitions/lib/sprt/libtfm_sprt.a  secure_fw/spm/libtfm_spm.a  lib/fih/libtfm_fih.a  secure_fw/partitions/crypto/mbedcrypto/nrf_security_src/libcrypto_service_mbedcrypto.a  secure_fw/partitions/audit_logging/libtfm_psa_rot_partition_audit.a  secure_fw/partitions/crypto/libtfm_psa_rot_partition_crypto.a  secure_fw/partitions/initial_attestation/libtfm_psa_rot_partition_attestation.a  secure_fw/partitions/protected_storage/libtfm_app_rot_partition_ps.a  secure_fw/partitions/internal_trusted_storage/libtfm_psa_rot_partition_its.a  secure_fw/partitions/platform/libtfm_psa_rot_partition_platform.a  /home/pbor/xxxxxxxxx/yyyyyy/nrf-sdk-yyyyyy/nrfxlib/crypto/nrf_cc310_platform/lib/cortex-m33/soft-float/no-interrupts/libnrf_cc310_platform_0.9.13.a  secure_fw/partitions/crypto/mbedcrypto/nrf_security_crypto/liboberon_mbedcrypto__psa_3.0.10.a  /home/pbor/xxxxxxxxx/yyyyyy/nrf-sdk-yyyyyy/nrfxlib/crypto/nrf_oberon/lib/cortex-m33/soft-float/liboberon_mbedtls_3.0.10.a  secure_fw/partitions/crypto/mbedcrypto/nrf_security_src/libmbedcrypto_base.a  /home/pbor/xxxxxxxxx/yyyyyy/nrf-sdk-yyyyyy/nrfxlib/crypto/nrf_oberon/lib/cortex-m33/soft-float/liboberon_3.0.10.a  lib/ext/t_cose/libtfm_t_cose_s.a  lib/ext/qcbor/libtfm_qcbor_s.a &amp;amp;&amp;amp; :
/opt/gnuarmemb/gcc-arm-none-eabi-10.3-2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: bin/tfm_s.axf section `.tfm_rodata&amp;#39; will not fit in region `FLASH&amp;#39;
/opt/gnuarmemb/gcc-arm-none-eabi-10.3-2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: address 0x47ec0 of bin/tfm_s.axf section `.gnu.sgstubs&amp;#39; is not within region `FLASH&amp;#39;
/opt/gnuarmemb/gcc-arm-none-eabi-10.3-2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: address 0x47ec0 of bin/tfm_s.axf section `.gnu.sgstubs&amp;#39; is not within region `FLASH&amp;#39;
/opt/gnuarmemb/gcc-arm-none-eabi-10.3-2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: region `FLASH&amp;#39; overflowed by 32768 bytes
Memory region         Used Size  Region Size  %age Used
           FLASH:        288 KB       256 KB    112.50%
             RAM:       44916 B        88 KB     49.84%
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
FAILED: modules/trusted-firmware-m/tfm-prefix/src/tfm-stamp/tfm-build tfm/secure_fw/s_veneers.o tfm/app/libtfm_api_ns.a tfm/generated/interface/include/psa_manifest/sid.h tfm/platform/libplatform_ns.a tfm/bin/tfm_s.bin tfm/bin/tfm_s.hex tfm/bin/tfm_ns.bin tfm/bin/tfm_ns.hex tfm/bin/tfm_s_signed.bin tfm/bin/tfm_ns_signed.bin tfm/bin/tfm_s_ns_signed.bin 
cd /home/pbor/xxxxxxxxx/yyyyyy/integration_testing/little_fs_v2/littlefs/build/tfm &amp;amp;&amp;amp; /home/pbor/cmake/cmake-3.20.5-linux-x86_64/bin/cmake --build .
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /home/pbor/cmake/cmake-3.20.5-linux-x86_64/bin/cmake --build /home/pbor/xxxxxxxxx/yyyyyy/integration_testing/little_fs_v2/littlefs/build
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;It can be fixed by hard-coding a larger partition, but I suspect something is broken when I upgraded?&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;With CONFIG_TFM_MINIMAL:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;Memory region         Used Size  Region Size  %age Used
           FLASH:         96 KB        64 KB    150.00%
             RAM:       49280 B        88 KB     54.69%
collect2: error: ld returned 1 exit status
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Cheers,&amp;nbsp;&lt;br /&gt;P&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 LittleFS build non-secure target</title><link>https://devzone.nordicsemi.com/thread/369290?ContentTypeID=1</link><pubDate>Tue, 24 May 2022 12:59:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62d63dd6-b995-4078-b4af-6cb49647ac17</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is a continuation of this thread:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/88248/nrf9160-littlefs-build-non-secure-target"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/88248/nrf9160-littlefs-build-non-secure-target&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;TF-M is still&amp;nbsp;experimental, as described in the docs:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/nrf/ug_tfm.html#overview"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/nrf/ug_tfm.html#overview&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I see a fault (stack overflow) in older ncs versions, but if you run with ncs v1.9.x, with these additions:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_BUILD_WITH_TFM=y
CONFIG_MAIN_STACK_SIZE=4096&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You should be able to run the littlefs sample properly.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you try this and report back?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 LittleFS build non-secure target</title><link>https://devzone.nordicsemi.com/thread/369285?ContentTypeID=1</link><pubDate>Tue, 24 May 2022 12:45:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69782de8-3f7f-40c1-8871-6e2a44f01aeb</guid><dc:creator>pbornerup</dc:creator><description>&lt;pre&gt;&lt;strong&gt;Log:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;TF-M isolation level is: &lt;/pre&gt;
&lt;pre class="ctrl-char NUL"&gt;&lt;/pre&gt;
&lt;pre&gt;0x00000001&lt;/pre&gt;
&lt;pre class="ctrl-char CR"&gt;&lt;/pre&gt;
&lt;pre class="ctrl-char LF"&gt;&lt;/pre&gt;
&lt;pre class="ctrl-char ESC"&gt;&lt;/pre&gt;
&lt;pre&gt;[1;34mBooting TFM v1.3.0&lt;/pre&gt;
&lt;pre class="ctrl-char ESC"&gt;&lt;/pre&gt;
&lt;pre&gt;[0m&lt;/pre&gt;
&lt;pre class="ctrl-char CR"&gt;&lt;/pre&gt;
&lt;pre class="ctrl-char LF"&gt;&lt;/pre&gt;
&lt;pre class="ctrl-char NUL"&gt;&lt;/pre&gt;
&lt;pre&gt;*** Booting Zephyr OS build v2.6.99-ncs1-2276-gfe21e47c97f8  ***&lt;/pre&gt;
&lt;pre class="ctrl-char CR"&gt;&lt;/pre&gt;
&lt;pre class="ctrl-char LF"&gt;&lt;/pre&gt;
&lt;pre&gt;Area 5 at 0xf5000 on NRF_FLASH_DRV_NAME for 45056 bytes&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>