<?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>Bus Fault while running crytpo sample examples on nRF5340 DK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/73929/bus-fault-while-running-crytpo-sample-examples-on-nrf5340-dk</link><description>Hi, 
 I tried running the crypto sample example as part of the nRF SDK project on my nRF5340 DK. 
 I successfully completed as few tests and then fails while trying to run the AES ECB MAC test suite. 
 It throws a BUS FAULT at BFAR Address: 0x50008158</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 15 Apr 2021 14:12:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/73929/bus-fault-while-running-crytpo-sample-examples-on-nrf5340-dk" /><item><title>RE: Bus Fault while running crytpo sample examples on nRF5340 DK</title><link>https://devzone.nordicsemi.com/thread/305135?ContentTypeID=1</link><pubDate>Thu, 15 Apr 2021 14:12:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:691a00ce-fe66-411b-96f1-738dc904e20d</guid><dc:creator>Carl Richard</dc:creator><description>&lt;p&gt;My pleasure. Please report back if you face any other issues.&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: Bus Fault while running crytpo sample examples on nRF5340 DK</title><link>https://devzone.nordicsemi.com/thread/305107?ContentTypeID=1</link><pubDate>Thu, 15 Apr 2021 12:59:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f5873a8-cc69-4190-bcd9-f219fe27b6e9</guid><dc:creator>BoscoJacinto</dc:creator><description>&lt;p&gt;Hi Carl,&lt;/p&gt;
&lt;p&gt;Thanks a lot.&amp;nbsp; I will try version 1.5.0&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Bosco Jacinto&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bus Fault while running crytpo sample examples on nRF5340 DK</title><link>https://devzone.nordicsemi.com/thread/305102?ContentTypeID=1</link><pubDate>Thu, 15 Apr 2021 12:51:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2dd40157-56a5-4996-b3f9-fcf8790daccb</guid><dc:creator>Carl Richard</dc:creator><description>&lt;p&gt;Hi again, Bosco!&lt;br /&gt;&lt;br /&gt;I can verify that there is an issue with the Crypto tests for nRF5340 on the master branch. However, I&amp;#39;ve verified that succeeds on the v1.5.0 release so I suggest switching to that. Use the following procedure&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;cd nrf
git checkout v1.5.0
west update&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;We recommend that customers to develop on the release tags, as the master branch is known to be unreliable, but I&amp;#39;ll report the issue of course.&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: Bus Fault while running crytpo sample examples on nRF5340 DK</title><link>https://devzone.nordicsemi.com/thread/304954?ContentTypeID=1</link><pubDate>Thu, 15 Apr 2021 05:29:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bbc3815d-32f1-4270-9979-46578f338e18</guid><dc:creator>BoscoJacinto</dc:creator><description>&lt;p&gt;Hi Carl,&lt;/p&gt;
&lt;p&gt;I tried running it without the debugger as well, the result is the same.&lt;/p&gt;
&lt;p&gt;The PC is at the fault handler (fault_s)&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1618464435246v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And hex 200002d8 is in ztest_thread in ztest.c itself&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1618464506990v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I am using master i guess because i had not checked out any specific tag during&amp;nbsp; &amp;quot;west init&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Bosco Jacinto&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bus Fault while running crytpo sample examples on nRF5340 DK</title><link>https://devzone.nordicsemi.com/thread/304744?ContentTypeID=1</link><pubDate>Wed, 14 Apr 2021 09:20:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6cf9abb5-22d8-4263-869d-9583a0ba9d7e</guid><dc:creator>Carl Richard</dc:creator><description>&lt;p&gt;Hi again!&lt;br /&gt;&lt;br /&gt;For this specific sample you should build for the secure target, yes. However, there are methods for using CryptoCell from the non-secure domain. You can read more about this in the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/drivers/entropy_cc310.html?highlight=cryptocell#cc310-entropy-driver"&gt;documentation&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Based on the error it seems like there may be some issue with the debugging.&amp;nbsp;Have you tried to run the sample while not debugging in SES?&lt;br /&gt;&lt;br /&gt;In addition you could search for 200002d8 in the &amp;lt;project_root&amp;gt;/build/zephyr/zephyr.map file and see which thread that is the culprit. This way you could check the program counter (PC) as well.&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: Bus Fault while running crytpo sample examples on nRF5340 DK</title><link>https://devzone.nordicsemi.com/thread/304617?ContentTypeID=1</link><pubDate>Tue, 13 Apr 2021 14:36:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03c84931-46df-4243-8636-1bddc1f9cd1b</guid><dc:creator>BoscoJacinto</dc:creator><description>&lt;p&gt;Hi Carl,&lt;/p&gt;
&lt;p&gt;Thanks for your quick response. Sorry I dint mention the target, yes was building for &lt;strong&gt;nrf5340dk_nrf5340_cpuappns.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Ok so I do need to build for&amp;nbsp;&lt;strong&gt;nrf5340dk_nrf5340_cpuapp&amp;nbsp;&lt;/strong&gt;?&lt;/p&gt;
&lt;p&gt;I did try with target &lt;strong&gt;nrf5340dk_nrf5340_cpuapp&lt;/strong&gt;, I got a null pointer exception this time at the same AES ECB MAC test suite.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;387: state_reset -- PASS -- [../src/main.c:48]

388: ChaChaPoly Invalid mac_len=15 -- PASS -- [../test_cases/test_vectors_aead_chachapoly.c:142]

389: ChaChaPoly Invalid nonce_len=12 -- PASS -- [../test_cases/test_vectors_aead_chachapoly.c:124]

390: ChaChaPoly message_len=114 ad_len=12 -- PASS -- [../test_cases/test_vectors_aead_chachapoly.c:86]

391: ChaChaPoly message_len=265 ad_len=12 -- PASS -- [../test_cases/test_vectors_aead_chachapoly.c:51]

Test suite AEAD CHACHAPOLY succeeded

Running test suite AEAD CHACHAPOLY simple

392: state_reset -- PASS -- [../src/main.c:48]

393: ChaChaPoly Decrypt Invalid mac -- PASS -- [../test_cases/test_vectors_aead_chachapoly.c:218]

394: ChaChaPoly Encrypt Invalid mac -- PASS -- [../test_cases/test_vectors_aead_chachapoly.c:199]

395: ChaChaPoly Decrypt Invalid key -- PASS -- [../test_cases/test_vectors_aead_chachapoly.c:180]

396: ChaChaPoly Encrypt Invalid key -- PASS -- [../test_cases/test_vectors_aead_chachapoly.c:161]

397: ChaChaPoly Valid ad_len=0 -- PASS -- [../test_cases/test_vectors_aead_chachapoly.c:106]

Test suite AEAD CHACHAPOLY simple succeeded

Running test suite AES ECB MAC

398: state_reset -- PASS -- [../src/main.c:48]

399: CMAC 256 message_len=64 -- [00214230] &amp;lt;err&amp;gt; os: ***** Debug monitor exception *****

Null-pointer exception?

[00214466] &amp;lt;err&amp;gt; os: r0/a1:  0x00000000  r1/a2:  0x00000004  r2/a3:  0x00063734

[00214698] &amp;lt;err&amp;gt; os: r3/a4:  0x000000a0 r12/ip:  0x00000000 r14/lr:  0x0000d621

[00214931] &amp;lt;err&amp;gt; os:  xpsr:  0x61000000

[00215048] &amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x0000eace

[00215255] &amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 0: CPU exception on CPU 0

[00215459] &amp;lt;err&amp;gt; os: Current thread: 0x200002d8 (unknown)

[00215628] &amp;lt;err&amp;gt; os: Halting system
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The following is the call stack, am not sure if the resolution of this picture is ok&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Screenshot-from-2021_2D00_04_2D00_13-19_2D00_54_2D00_25.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The following is the project config &lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#
# Copyright (c) 2019 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# TEST
CONFIG_ZTEST=y
CONFIG_ZTEST_FAIL_FAST=y
CONFIG_ZTEST_STACKSIZE=4096
CONFIG_MAIN_STACK_SIZE=8192
CONFIG_ZTEST_TC_UTIL_USER_OVERRIDE=y

# LOG
CONFIG_TEST_LOGGING_DEFAULTS=n
CONFIG_LOG=y
CONFIG_LOG_PRINTK=y
CONFIG_LOG_MODE_IMMEDIATE=y
CONFIG_LOG_DEFAULT_LEVEL=3
CONFIG_LOG_BACKEND_UART=y
CONFIG_LOG_BACKEND_SHOW_COLOR=n
CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP=n

# MISC
CONFIG_DK_LIBRARY=y
CONFIG_SPEED_OPTIMIZATIONS=y

# CRYPTO
CONFIG_NORDIC_SECURITY_BACKEND=y
CONFIG_NRF_SECURITY_RNG=y
CONFIG_ENTROPY_GENERATOR=y

CONFIG_MBEDTLS=y
CONFIG_MBEDTLS_LIBRARY=y
CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_HEAP_SIZE=65536
CONFIG_MBEDTLS_INSTALL_PATH=&amp;quot;DUMMY&amp;quot;

CONFIG_MBEDTLS_ECJPAKE_C=y

# Quick fix to ensure the crypto tests can execute directly on nRF9160
CONFIG_SRAM_SIZE=128
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Bosco jacinto&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bus Fault while running crytpo sample examples on nRF5340 DK</title><link>https://devzone.nordicsemi.com/thread/304569?ContentTypeID=1</link><pubDate>Tue, 13 Apr 2021 13:26:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8a52dd9-689a-4470-b35a-7beebce64814</guid><dc:creator>Carl Richard</dc:creator><description>&lt;p&gt;Hello, Bosco!&lt;br /&gt;&lt;br /&gt;Based on your earlier cases I assume that your are building for the non-secure partition of the nRF5340(&lt;strong&gt;nrf5340dk_nrf5340_cpuappns&lt;/strong&gt; as target). Correct? This test sample requires the CryptoCell peripheral by default, which is not accessible from the non-secure domain. That may be the origin of the issue you&amp;#39;re seeing here.&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></channel></rss>