<?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 DK SPI Example causing hard fault.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/47986/nrf9160-dk-spi-example-causing-hard-fault</link><description>I am trying to get a simple spi setup working. Through the dev zone I found a link to this https://github.com/Rallare/fw-nrfconnect-nrf/tree/nrf9160_samples/samples/nrf9160/spi repository. 
 I was successful in getting the uart example from the same repository</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 11 Jun 2019 08:40:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/47986/nrf9160-dk-spi-example-causing-hard-fault" /><item><title>RE: nRF9160 DK SPI Example causing hard fault.</title><link>https://devzone.nordicsemi.com/thread/191959?ContentTypeID=1</link><pubDate>Tue, 11 Jun 2019 08:40:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77c86fb3-23ed-4b27-a3ad-82ae57a93fde</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;you should have two overlay files in your project:&lt;/p&gt;
&lt;p&gt;nrf9160_pca10090.overlay&lt;/p&gt;
&lt;p&gt;nrf9160_pca10090ns.overlay&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Both these should hold the configuration for your spi peripheral. Since this is a Cortex M33, it has two regions&lt;/p&gt;
&lt;p&gt;* Secure (nrf9160_pca10090.overlay)&lt;/p&gt;
&lt;p&gt;* Non-secure (nrf9160_pca10090ns.overlay)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Depending on which region you configure for, the .overlay file will be&amp;nbsp;appended to the overall device tree source. I include both to make the example as generic as possible.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&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 DK SPI Example causing hard fault.</title><link>https://devzone.nordicsemi.com/thread/191683?ContentTypeID=1</link><pubDate>Fri, 07 Jun 2019 14:37:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c494fa50-e975-416f-a837-ec32c02a7c49</guid><dc:creator>Zada</dc:creator><description>&lt;p&gt;Yes this was also the root of the issue on my setup as well. However, on my setup after correcting the .overlay file name. SES can no longer load the project.&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/2656.Capture.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;The Fix I have found so far is to include the same lines in the ns.overlay file&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Solution.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;With the temporary fix, everything seems to be working as expected again. &lt;a href="https://devzone.nordicsemi.com/members/hkn"&gt;Håkon Alseth&lt;/a&gt; Any thoughts on how to fix this final part so I don&amp;#39;t have to double include the same lines?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 DK SPI Example causing hard fault.</title><link>https://devzone.nordicsemi.com/thread/191605?ContentTypeID=1</link><pubDate>Fri, 07 Jun 2019 10:47:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa2f2ebd-f4d4-4d0a-92b0-8c7298731a33</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;This is embarrassing from my side..&lt;/p&gt;
&lt;p&gt;Thanks to &lt;a href="https://devzone.nordicsemi.com/members/haxxlinus"&gt;Linus&lt;/a&gt;, I think we have found the culprit:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/48197/how-to-use-spi-on-nrf9160dk/191570#191570"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/48197/how-to-use-spi-on-nrf9160dk/191570#191570&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Could you check if this was the root of the issues on your side as well?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Humble 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 DK SPI Example causing hard fault.</title><link>https://devzone.nordicsemi.com/thread/191460?ContentTypeID=1</link><pubDate>Thu, 06 Jun 2019 17:44:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de76c0fa-57df-4ea8-98a6-b6d63a97616f</guid><dc:creator>Zada</dc:creator><description>&lt;p&gt;I received a new nRF9160-DK today and interesting results.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;nRF9160-DK V0.8.3 (old board)&lt;/span&gt;&lt;/p&gt;
&lt;h3&gt;H&amp;aring;kon&amp;nbsp;merged.hex = works&lt;/h3&gt;
&lt;p&gt;Zach merged.hex = fails&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;nRF9160-DK V0.8.5 (new board)&lt;/span&gt;&lt;/p&gt;
&lt;h3&gt;H&amp;aring;kon&amp;nbsp;merged.hex = works&lt;/h3&gt;
&lt;p&gt;Zach merged.hex = works&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;To summarize, the merged.hex that I sent to you works on the 0.8.5 hardware but not on the 0.8.3 hardware and the merged.hex file you sent me works on both hardware versions.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am working on wiping and reinstalling the entire ncs repository and version tag 0.4.0 to see if it helps. I will update here if it is successful.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 DK SPI Example causing hard fault.</title><link>https://devzone.nordicsemi.com/thread/191301?ContentTypeID=1</link><pubDate>Thu, 06 Jun 2019 10:28:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52a0cedb-6c8b-4445-8fba-201f4ab74496</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Thanks for the .zip. I ran your precompiled .hex file (in the nrf9160_pca10090ns build folder) and it runs as expected here:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;SPM: NS image at 0x8000
SPM: NS MSP at 0x20022e58
SPM: NS reset vector at 0xa1b1
SPM: prepare to jump to Non-Secure image.
***** Booting Zephyr OS v1.14.99-ncs1 *****
SPIM Example
Starting spi_test_send
Before spi_transceive
After spi_transceive
TX sent: 0
RX recv: 0
Starting spi_test_send
Before spi_transceive
After spi_transceive
TX sent: 1
RX recv: 0
Starting spi_test_send
Before spi_transceive
After spi_transceive
TX sent: 2
RX recv: 0&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I also tried to compile the project and run it, ran as expected then as well.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;are you certain that you have the correct tag of the &amp;quot;zephyr&amp;quot; repo?&lt;/p&gt;
&lt;p&gt;Mine is on tag &amp;quot;v1.14.99-ncs1&amp;quot; (git checkout&amp;nbsp;v1.14.99-ncs1)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you have any other nRF9160-DKs to test this on?&lt;/p&gt;
&lt;p&gt;Have you ensured that the &amp;quot;SW5&amp;quot; switch is in nRF91 position? If you have programmed the nRF52 with the nRF91&amp;#39;s SPI firmware, it might toggle some lines that you do not want to be toggled.&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 DK SPI Example causing hard fault.</title><link>https://devzone.nordicsemi.com/thread/191201?ContentTypeID=1</link><pubDate>Wed, 05 Jun 2019 21:10:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:377169ee-7ab2-49a9-a674-d4bc4359af9a</guid><dc:creator>Zada</dc:creator><description>&lt;p&gt;I have successfully run the &amp;quot;nrfjprog -e&amp;quot; and still no success with my setup. However, I was able to flash the merged.hex file you provided and it successfully ran the spi demo. So we can rule out a hardware issue. Here is my spi example&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8726.spi.zip"&gt;devzone.nordicsemi.com/.../8726.spi.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I also tried the ninja flash method instead of uploading through SES and it still failed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 DK SPI Example causing hard fault.</title><link>https://devzone.nordicsemi.com/thread/191052?ContentTypeID=1</link><pubDate>Wed, 05 Jun 2019 10:58:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e59c83f0-95e5-456a-b252-9e0730c5c275</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi again, I was actually able to reproduce this by connecting SCK to MOSI (shorting the clock). In that case, it hangs on the spi transfer function.&lt;/p&gt;
&lt;p&gt;Have you looped back any signals or connected them externally to a sensor or similar? If yes, please check the wiring.&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 DK SPI Example causing hard fault.</title><link>https://devzone.nordicsemi.com/thread/191013?ContentTypeID=1</link><pubDate>Wed, 05 Jun 2019 08:53:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3e49dcd-e027-45de-9261-7181a14d1da4</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;I have tried to replicate this, but I&amp;#39;m unable to get this behavior.&lt;/p&gt;
&lt;p&gt;Could you ensure that there&amp;#39;s no &amp;quot;other firmware&amp;quot; in flash when testing this, by issuing a &amp;quot;nrfjprog -e&amp;quot; to ensure a clean flash?&lt;/p&gt;
&lt;p&gt;If it still misbehaves, could you attach your &amp;quot;spi&amp;quot; example (.zip it) so I can try it out?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s my spi + spm for reference:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-d44cad78dc5f4faba4ab5bfd5e638be8/merged.hex"&gt;devzone.nordicsemi.com/.../merged.hex&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;After compiling in SES, you can go to the folder ..\ncs\nrf\samples\nrf9160\spi\build_nrf9160_pca10090ns in cmd.exe and write &amp;quot;ninja flash&amp;quot; to get it to generate a merged.hex file.&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 DK SPI Example causing hard fault.</title><link>https://devzone.nordicsemi.com/thread/190913?ContentTypeID=1</link><pubDate>Tue, 04 Jun 2019 19:35:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1870b3b-d61f-42dc-8aa0-a7a68b0d3f2c</guid><dc:creator>Zada</dc:creator><description>&lt;p&gt;I did a fresh git pull of the repository, so no modifications to the prj.conf and overlay files. No faults in debug mode. The firmware just hangs in the spi_transceive() call.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 DK SPI Example causing hard fault.</title><link>https://devzone.nordicsemi.com/thread/190731?ContentTypeID=1</link><pubDate>Tue, 04 Jun 2019 10:49:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5321d84f-dd10-43fe-b45e-ae983c7cc345</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;If you are able to print and have the spm (secure_boot) prints, then it runs the application as it should.&lt;/p&gt;
&lt;p&gt;Given that it does not fail in spi_init(), &amp;quot;spi_dev&amp;quot; should also be found.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you altered the prj.conf and overlay files in any way? If yes, could you try to revert these changes and see if it runs?&lt;/p&gt;
&lt;p&gt;If you enter debug mode and run, do you get any fault or similar?&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 DK SPI Example causing hard fault.</title><link>https://devzone.nordicsemi.com/thread/190612?ContentTypeID=1</link><pubDate>Mon, 03 Jun 2019 18:26:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:541175ff-174b-401c-9008-635720bbdd6a</guid><dc:creator>Zada</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/hkn"&gt;Håkon Alseth&lt;/a&gt;&amp;nbsp;The sample in your repository no longer hard faults with the changes. However, now the program gets to the line&lt;span&gt;&amp;nbsp;&amp;quot;&lt;/span&gt;err = spi_transceive(spi_dev, &amp;amp;spi_cfg, &amp;amp;tx, &amp;amp;rx);&amp;quot; and hangs.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void spi_test_send(void)
{
        printk(&amp;quot;Starting spi_test_send\n&amp;quot;);
	int err;
	static u8_t tx_buffer[1];
	static u8_t rx_buffer[1];

	const struct spi_buf tx_buf = {
		.buf = tx_buffer,
		.len = sizeof(tx_buffer)
	};
	const struct spi_buf_set tx = {
		.buffers = &amp;amp;tx_buf,
		.count = 1
	};

	struct spi_buf rx_buf = {
		.buf = rx_buffer,
		.len = sizeof(rx_buffer),
	};
	const struct spi_buf_set rx = {
		.buffers = &amp;amp;rx_buf,
		.count = 1
	};

        printk(&amp;quot;Before spi_transceive\n&amp;quot;);
	err = spi_transceive(spi_dev, &amp;amp;spi_cfg, &amp;amp;tx, &amp;amp;rx); // Program hangs here
        printk(&amp;quot;After spi_transceive\n&amp;quot;);

	if (err) {
		printk(&amp;quot;SPI error: %d\n&amp;quot;, err);
	} else {
		/* Connect MISO to MOSI for loopback */
		printk(&amp;quot;TX sent: %x\n&amp;quot;, tx_buffer[0]);
		printk(&amp;quot;RX recv: %x\n&amp;quot;, rx_buffer[0]);
		tx_buffer[0]++;
	}	
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Serial Output&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;***** Booting Zephyr OS v1.14.99-ncs1 *****
SPIM Example
Starting spi_test_send
Before spi_transceive
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Any thoughts on how to get this final piece working?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 DK SPI Example causing hard fault.</title><link>https://devzone.nordicsemi.com/thread/190419?ContentTypeID=1</link><pubDate>Mon, 03 Jun 2019 06:59:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:278d9e91-ff59-4bea-bb4c-63965a89b5ee</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 apologies, this sample has not been updated in my repo to reflect the requirements of newer zephyr builds.&lt;/p&gt;
&lt;p&gt;Could you see if adding this line to prj.conf helps? Remember to clean the build folder.&lt;/p&gt;
&lt;p&gt;CONFIG_MAIN_STACK_SIZE=4096&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;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;*edit*: Updated with this commit:&amp;nbsp;&lt;a href="https://github.com/Rallare/fw-nrfconnect-nrf/commit/6a02c1dcce42140ef737a408f9710c6982f91ac5"&gt;https://github.com/Rallare/fw-nrfconnect-nrf/commit/6a02c1dcce42140ef737a408f9710c6982f91ac5&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Also rebased the nrf9160_samples branch to match &amp;quot;v0.4.0&amp;quot; tag upstream.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 DK SPI Example causing hard fault.</title><link>https://devzone.nordicsemi.com/thread/190372?ContentTypeID=1</link><pubDate>Sat, 01 Jun 2019 22:01:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fff42f5f-a334-4a81-9dd0-3f54af52770d</guid><dc:creator>John</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/48057/ncs-v0-4-0-asset-tracker-application---faulting-instruction-address-0x7140/190370#190370"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/48057/ncs-v0-4-0-asset-tracker-application---faulting-instruction-address-0x7140/190370#190370&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The above link may get you further.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 DK SPI Example causing hard fault.</title><link>https://devzone.nordicsemi.com/thread/190323?ContentTypeID=1</link><pubDate>Fri, 31 May 2019 15:25:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c46999e6-c2ee-43a7-9cf1-a5ad2babe7d5</guid><dc:creator>DevinCallahan</dc:creator><description>&lt;p&gt;I think in the file &amp;quot;build_nrf9160_pca10090ns/CMakeCache.txt&amp;quot; there should be an entry like this:&lt;/p&gt;
&lt;p&gt;//Selected board&lt;br /&gt;CACHED_BOARD:STRING=nrf9160_pca10090ns&lt;/p&gt;
&lt;p&gt;The project I have that was built for the &amp;quot;ns&amp;quot; board has that as the string.&lt;/p&gt;
&lt;p&gt;Conversely the &amp;quot;nrf/samples/nrf9160/spm&amp;quot; project I was using as the bootloader has this for that entry:&lt;/p&gt;
&lt;p&gt;//Selected board&lt;br /&gt;CACHED_BOARD:STRING=nrf9160_pca10090&lt;/p&gt;
&lt;p&gt;They have to be exactly those strings because the zephyr cmake files use them to find the correct dts and overlays in the board directory at &amp;quot;zephyr/boards/arm/nrf9160_pca10090&amp;quot;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Also if you use the nrf9160_pca10090ns board, you need to rename your .overlay file to nrf9160_pca10090ns.overlay for the zephyr build to pull it in automatically.&amp;nbsp; Their script uses the board string when looking for overlay files in the project source directory.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 DK SPI Example causing hard fault.</title><link>https://devzone.nordicsemi.com/thread/190208?ContentTypeID=1</link><pubDate>Fri, 31 May 2019 08:50:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8944f793-dd0d-4e54-97ba-478a90988a95</guid><dc:creator>Zada</dc:creator><description>&lt;p&gt;nrf9160_pca10090.overlay&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;//&amp;amp;spi3 {
//	status = &amp;quot;ok&amp;quot;;
//	sck-pin = &amp;lt;9&amp;gt;;
//	mosi-pin = &amp;lt;8&amp;gt;;
//	miso-pin = &amp;lt;7&amp;gt;;
//	ss-pin = &amp;lt;10&amp;gt;;
//	spi-max-frequency = &amp;lt;4000000&amp;gt;;
//};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;nrf9160_pca10090_ns.overlay&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;//nrf9160_pca10090.overlay
&amp;amp;spi3 {
        status = &amp;quot;ok&amp;quot;;
        sck-pin = &amp;lt;13&amp;gt;;
        mosi-pin = &amp;lt;11&amp;gt;;
        miso-pin = &amp;lt;12&amp;gt;;
        ss-pin = &amp;lt;10&amp;gt;;
        spi-max-frequency = &amp;lt;4000000&amp;gt;;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;No change. Still getting the **** Hard Fault *****&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 DK SPI Example causing hard fault.</title><link>https://devzone.nordicsemi.com/thread/190134?ContentTypeID=1</link><pubDate>Thu, 30 May 2019 22:34:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dde63b45-7afb-4fa9-82e0-14471fa1ecf2</guid><dc:creator>Alan Jones</dc:creator><description>&lt;p&gt;I think you have a pin conflict in your SPI definition, which is also in the secure, rather than non-secure (&lt;span style="background-color:transparent;color:#11171a;float:none;font-family:&amp;#39;GT Eesti&amp;#39;,&amp;#39;Helvetica&amp;#39;,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;line-height:21px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;nrf9160_pca10090ns.overlay&lt;/span&gt;).&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve used this in the application directory as the non-secure overlay with the Dev Kit with success out of the box:&lt;/p&gt;
&lt;p&gt;&amp;amp;spi3 {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; status = &amp;quot;ok&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sck-pin = &amp;lt;13&amp;gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mosi-pin = &amp;lt;11&amp;gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; miso-pin = &amp;lt;12&amp;gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ss-pin = &amp;lt;10&amp;gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; spi-max-frequency = &amp;lt;4000000&amp;gt;;&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;I believe if you want to use your previous pin config, you need that in the secure overlay in SPM, as well as the same definition in the non-secure overlay in your application directory.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 DK SPI Example causing hard fault.</title><link>https://devzone.nordicsemi.com/thread/190132?ContentTypeID=1</link><pubDate>Thu, 30 May 2019 22:24:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64446f2d-8b77-43b5-8a14-51ac45b16417</guid><dc:creator>Zada</dc:creator><description>&lt;p&gt;I believe I am building the project for the nrf9160_pca10090ns&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/ns.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;The build_nrf9160_pca10090ns build folder is being created automatically. Is there a better way to confirm the project is being built for ns?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 DK SPI Example causing hard fault.</title><link>https://devzone.nordicsemi.com/thread/190131?ContentTypeID=1</link><pubDate>Thu, 30 May 2019 22:20:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:172f730a-1a5a-4296-abb6-a935641ec8a8</guid><dc:creator>Zada</dc:creator><description>&lt;p&gt;updated prj.conf&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_SERIAL=y
CONFIG_TRUSTED_EXECUTION_NONSECURE=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_UART_0_NRF_UARTE=y

# LTE link control
CONFIG_LTE_LINK_CONTROL=n
CONFIG_LTE_AUTO_INIT_AND_CONNECT=n

# BSD library
CONFIG_BSD_LIBRARY=y
CONFIG_BSD_LIBRARY_TRACE_ENABLED=n

# network
CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_NETWORKING=y
CONFIG_NET_BUF_USER_DATA_SIZE=1
CONFIG_NET_SOCKETS_OFFLOAD=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_POSIX_NAMES=y
CONFIG_NET_RAW_MODE=y
CONFIG_HEAP_MEM_POOL_SIZE=1024

# SPI
CONFIG_SPI=y
CONFIG_SPI_3=y
CONFIG_SPI_3_NRF_SPIM=y
CONFIG_SPI_3=y 
CONFIG_SPI_NRFX=y

CONFIG_GPIO=y
CONFIG_GPIO_NRF_P0=y
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The same error is occurring.&lt;/p&gt;
&lt;p&gt;SPM: NS image at 0x8000&lt;br /&gt;SPM: NS MSP at 0x20022258&lt;br /&gt;SPM: NS reset vector at 0xa191&lt;br /&gt;SPM: prepare to jump to Non-Secure image.&lt;br /&gt;Exception occurred in Secure State&lt;br /&gt;***** HARD FAULT *****&lt;br /&gt; Fault escalation (see below)&lt;br /&gt;***** BUS FAULT *****&lt;br /&gt; Precise data bus error&lt;br /&gt; BFAR Address: 0x50008120&lt;br /&gt;***** Hardware exception *****&lt;br /&gt;Current thread ID = 0x20020178&lt;br /&gt;Faulting instruction address = 0x0&lt;br /&gt;Fatal fault in ISR! Spinning...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 DK SPI Example causing hard fault.</title><link>https://devzone.nordicsemi.com/thread/190127?ContentTypeID=1</link><pubDate>Thu, 30 May 2019 22:00:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0b64594-a708-4a10-8475-e6ea03a4c33c</guid><dc:creator>Alan Jones</dc:creator><description>&lt;p&gt;I&amp;#39;ve seen that fault address too many times to count. Try either of these in the project configuration settings and you should be running again:&lt;/p&gt;
&lt;p&gt;CONFIG_GPIO=y&lt;/p&gt;
&lt;p&gt;CONFIG_GPIO_NRF_P0=y&lt;/p&gt;
&lt;p&gt;I think the GPIO is somehow locked down as secure, and when you jump to it, the UART tries to execute the printk, and bumps up against non-functional pins, so it errors out in the UART peripheral address space. There seems to be a problem with the default GPIO config lately.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 DK SPI Example causing hard fault.</title><link>https://devzone.nordicsemi.com/thread/190112?ContentTypeID=1</link><pubDate>Thu, 30 May 2019 21:26:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4c4bc9d-116b-4ca1-97c2-30975b67af2f</guid><dc:creator>DevinCallahan</dc:creator><description>&lt;p&gt;Could you trying building the project for the nrf9160_pca10090ns board instead?&amp;nbsp; It might not be getting linked to account for the bootloader.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>