<?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 using pin 29 as spi chip select</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/70376/nrf9160-using-pin-29-as-spi-chip-select</link><description>We are trying to connect the nrf9160 to a spi flash device. we have a custom board with the following pins connected: 
 sck: 27 
 mosi: 28 
 miso: 30 
 cs: 29 
 wp: 31 
 reset: 26 
 
 For the testing, we are using the drivers/spi_flash sample of zephyr</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 18 Jan 2021 13:54:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/70376/nrf9160-using-pin-29-as-spi-chip-select" /><item><title>RE: nrf9160 using pin 29 as spi chip select</title><link>https://devzone.nordicsemi.com/thread/289773?ContentTypeID=1</link><pubDate>Mon, 18 Jan 2021 13:54:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35068364-b579-4c86-b57c-4210d3970de5</guid><dc:creator>Mike Jongen</dc:creator><description>&lt;p&gt;No, it is a standard spi nor flash, and doesn&amp;#39;t require a specific driver. I just needed to set SPI_NOR.&lt;/p&gt;
&lt;p&gt;This is the final conf:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_STDOUT_CONSOLE=y
CONFIG_SPI=y
CONFIG_SPI_NOR=y
CONFIG_FLASH=y

# enable printing
CONFIG_SERIAL=y
CONFIG_PRINTK=y
CONFIG_CONSOLE=y
CONFIG_STDOUT_CONSOLE=y

# Enable log
CONFIG_LOG=y

# Enable rtt
CONFIG_USE_SEGGER_RTT=y

# Enable rtt shell
CONFIG_SHELL=y
CONFIG_SHELL_BACKEND_RTT=y

# Switch console to rtt, for print statements
CONFIG_UART_CONSOLE=n
CONFIG_RTT_CONSOLE=y
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The flash example now works, thanks for the help!&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 using pin 29 as spi chip select</title><link>https://devzone.nordicsemi.com/thread/289671?ContentTypeID=1</link><pubDate>Mon, 18 Jan 2021 10:21:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb744adb-0337-4513-b913-70a76ac5f33b</guid><dc:creator>&amp;#216;yvind</dc:creator><description>[quote user="Mike Jongen"]Small note, I had to use ${CMAKE_CURRENT_LIST_DIR} instead of $(&lt;span&gt;CMAKE_CURRENT_LIST_DIR&lt;/span&gt;), in case anyone has issues with the CMake.[/quote]
&lt;p&gt;&amp;nbsp;Thanks for the note! That&amp;#39;s one detail that went right past me&amp;nbsp;in my last reply.&amp;nbsp;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Mike Jongen"]The flash example still gives the same output, so I&amp;#39;ll have to see if something else is wrong.&amp;nbsp;[/quote]
&lt;p&gt;Assuming you mean it prints the&amp;nbsp; output &amp;quot;&lt;em&gt;SPI flash driver S25FL128L was not found!&lt;/em&gt;&amp;quot;? Or do you mean the output on pin 29?&lt;/p&gt;
&lt;p&gt;Have you actually added the drivers for this device? I am not able to find this device in Zephyr&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 using pin 29 as spi chip select</title><link>https://devzone.nordicsemi.com/thread/289399?ContentTypeID=1</link><pubDate>Fri, 15 Jan 2021 12:13:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57494a7b-4fc4-49c5-bd09-5de7a0c1f8f2</guid><dc:creator>Mike Jongen</dc:creator><description>&lt;p&gt;Thank you, I am now able to control the pins as gpio. The flash example still gives the same output, so I&amp;#39;ll have to see if something else is wrong.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Small note, I had to use ${CMAKE_CURRENT_LIST_DIR} instead of $(&lt;span&gt;CMAKE_CURRENT_LIST_DIR&lt;/span&gt;), in case anyone has issues with the CMake.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 using pin 29 as spi chip select</title><link>https://devzone.nordicsemi.com/thread/289335?ContentTypeID=1</link><pubDate>Fri, 15 Jan 2021 07:48:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28c64dcb-d33e-4a93-8ad1-0f790d2c5978</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Can you try&amp;nbsp;this instead:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;cmake_minimum_required(VERSION 3.13.1)

set(spm_CONF_FILE
    prj.conf
    $(CMAKE_CURRENT_LIST_DIR)/spm.conf
    )
    
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(spi_flash)

FILE(GLOB app_sources src/*.c)
target_sources(app PRIVATE ${app_sources})&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 using pin 29 as spi chip select</title><link>https://devzone.nordicsemi.com/thread/289207?ContentTypeID=1</link><pubDate>Thu, 14 Jan 2021 12:56:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ab9561d-b09d-402a-bf7f-43a25c27886a</guid><dc:creator>Mike Jongen</dc:creator><description>&lt;p&gt;I have tried the solution without success.&lt;br /&gt;&lt;br /&gt;My CMakeLists.txt is now:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;cmake_minimum_required(VERSION 3.13.1)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(spi_flash)

set(spm_CONF_FILE
    prj.conf
    $(CMAKE_CURRENT_LIST_DIR)/spm.conf
    )

FILE(GLOB app_sources src/*.c)
target_sources(app PRIVATE ${app_sources})&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;spm.conf is:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_SERIAL=n
CONFIG_STDOUT_CONSOLE=n
CONFIG_LOG=n
CONFIG_BOOT_BANNER=n
CONFIG_PRINTK=n

CONFIG_SPM_BOOT_SILENTLY=y
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is the waveform that is send over pin 29 at startup:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/pin_5F00_29_5F00_waveform.zip"&gt;devzone.nordicsemi.com/.../pin_5F00_29_5F00_waveform.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have tried the flash example, and tried to toggle pin 29 as gpio. both failed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 using pin 29 as spi chip select</title><link>https://devzone.nordicsemi.com/thread/288851?ContentTypeID=1</link><pubDate>Wed, 13 Jan 2021 09:28:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca19c602-abfe-413a-a3fe-2a048a6a023f</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;You were right, this is the SPM causing issues on UART0.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Have a look at this solution:&amp;nbsp;&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/55667/nrf9160-disable-bootloader-and-spm-uart-console-print"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/55667/nrf9160-disable-bootloader-and-spm-uart-console-print&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 using pin 29 as spi chip select</title><link>https://devzone.nordicsemi.com/thread/288728?ContentTypeID=1</link><pubDate>Tue, 12 Jan 2021 16:32:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87e36b76-8266-427c-a90a-3dc3a024ee96</guid><dc:creator>Mike Jongen</dc:creator><description>&lt;p&gt;Here is the zephyr.dts:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/zephyr.dts"&gt;devzone.nordicsemi.com/.../zephyr.dts&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The board is a custom board.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 using pin 29 as spi chip select</title><link>https://devzone.nordicsemi.com/thread/288682?ContentTypeID=1</link><pubDate>Tue, 12 Jan 2021 13:58:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b26f8664-79c4-408a-a311-1e0b48eccc0d</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Thanks for updating with that information. The overlay file looks good. I agree that it seems that pin 29 might be configured to something else. Can you provide zephyr.dts from the build folder? Are you running a custom board, or the nRF9160 DK or Thingy:91?&lt;/p&gt;
&lt;p&gt;-Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 using pin 29 as spi chip select</title><link>https://devzone.nordicsemi.com/thread/288640?ContentTypeID=1</link><pubDate>Tue, 12 Jan 2021 12:52:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19d06ea4-207c-4783-87d0-28d1c1982ff3</guid><dc:creator>Mike Jongen</dc:creator><description>&lt;p&gt;Yes, see line 7 of the overlay I have included.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 using pin 29 as spi chip select</title><link>https://devzone.nordicsemi.com/thread/288616?ContentTypeID=1</link><pubDate>Tue, 12 Jan 2021 11:10:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac41f671-1dcc-4d04-8942-d353d4aa633f</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Have you configured the CS pin in your overlay file?&lt;br /&gt;&lt;br /&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>