<?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>nrf5340 nrfx spis no events</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/68854/nrf5340-nrfx-spis-no-events</link><description>Hello 
 I am trying to configure the spis with the nrfx drivers. My code is as follows: 
 
 I enabled the nrfx SPIS driver and the nrfx SPIS3 instance via Segger Embedded and I am using ncs v1.4.0. 
 My serial output is: 
 *** Booting Zephyr OS build</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 08 Dec 2020 07:35:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/68854/nrf5340-nrfx-spis-no-events" /><item><title>RE: nrf5340 nrfx spis no events</title><link>https://devzone.nordicsemi.com/thread/283705?ContentTypeID=1</link><pubDate>Tue, 08 Dec 2020 07:35:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3e4e178-55ef-45ed-9ef7-cd9f186b7f69</guid><dc:creator>hmw</dc:creator><description>&lt;p&gt;hello&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I use SPIS0&lt;br /&gt;But it is wrong when cpmplier is as follows&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;gen_isr_tables.py: error: multiple registrations at table_index 3 for irq 3 (0x3)
Existing handler 0x558b, new handler 0x558b
Has IRQ_CONNECT or IRQ_DIRECT_CONNECT accidentally been invoked on the same irq multiple times?&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 nrfx spis no events</title><link>https://devzone.nordicsemi.com/thread/283275?ContentTypeID=1</link><pubDate>Fri, 04 Dec 2020 10:01:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9311fb8d-569d-45b4-92eb-4bebe7c6028a</guid><dc:creator>zuppiden</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting Zephyr OS build v2.4.0-ncs1  ***
SPIS started.
received
buffers set&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Yes I have PDK v0.8.0 and I switched to SPIS1 and now it works.&lt;/p&gt;
&lt;p&gt;Thank you for your support!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 nrfx spis no events</title><link>https://devzone.nordicsemi.com/thread/283273?ContentTypeID=1</link><pubDate>Fri, 04 Dec 2020 09:44:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9afa1e3-20f3-4cc5-a3a5-35b125be4e1c</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 that I didn&amp;#39;t notice this until now.&lt;/p&gt;
&lt;p&gt;Are you running on nrf5340 engineering A (PDK v0.8.0)? If yes, then SPIx3 is unfortunately not present:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/errata_nRF5340_EngA/ERR/nRF5340/EngineeringA/latest/anomaly_340_81.html?cp=3_0_1_2_1_65"&gt;https://infocenter.nordicsemi.com/topic/errata_nRF5340_EngA/ERR/nRF5340/EngineeringA/latest/anomaly_340_81.html?cp=3_0_1_2_1_65&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This errata (and many others) are fixed on engeering D and newer revisions:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/errata_nRF5340_EngD/ERR/nRF5340/EngineeringD/latest/err_340_fixed.html?cp=3_0_1_1_2"&gt;https://infocenter.nordicsemi.com/topic/errata_nRF5340_EngD/ERR/nRF5340/EngineeringD/latest/err_340_fixed.html?cp=3_0_1_1_2&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you try SPIS0 or 1 to see if you get the interrupt then?&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: nrf5340 nrfx spis no events</title><link>https://devzone.nordicsemi.com/thread/283269?ContentTypeID=1</link><pubDate>Fri, 04 Dec 2020 09:33:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60aca0d4-a9ed-4e07-a352-bf084e2b56a3</guid><dc:creator>zuppiden</dc:creator><description>&lt;p&gt;In fact, if I set a brakepoint at IRQ_DIRECT_CONNECT the debugger never reaches it. If I set a breakpoint at irq_enable it does reach it. It&amp;#39;s like the IRQ_DIRECT_CONNECT command gets skipped.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void manual_isr_setup()
{
    IRQ_DIRECT_CONNECT(SPIM3_SPIS3_TWIM3_TWIS3_UARTE3_IRQn, 0, nrfx_spis_3_irq_handler, 0);
    irq_enable(SPIM3_SPIS3_TWIM3_TWIS3_UARTE3_IRQn);
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 nrfx spis no events</title><link>https://devzone.nordicsemi.com/thread/283267?ContentTypeID=1</link><pubDate>Fri, 04 Dec 2020 09:27:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b2bb37f-44e1-48eb-ab71-be91943cbaf9</guid><dc:creator>zuppiden</dc:creator><description>&lt;p&gt;I erased the flash on both cores and it didn&amp;#39;t work and I got a new pdk and it still doesn&amp;#39;t work. I checked using the debug mode and the nrfx_spis_3_irq_handler never gets called. Am I missing some configs to enable IRQs in Zephyr?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 nrfx spis no events</title><link>https://devzone.nordicsemi.com/thread/282599?ContentTypeID=1</link><pubDate>Tue, 01 Dec 2020 08:27:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62fdebff-3e3b-4cf4-b418-98b29d432040</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;
[quote user="zuppiden"]What program do you have on the network core when running the spi code?[/quote]
&lt;p&gt;Its completely empty at my end, although it should not matter, as I keep the net core in sleep.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Try erasing the flash on both cores:&lt;/p&gt;
&lt;p&gt;nrfjprog --recover -f nrf53 --coprocessor CP_NETWORK&lt;/p&gt;
&lt;p&gt;&lt;span&gt;nrfjprog --recover -f nrf53 --coprocessor CP_APPLICATION&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Then flash again to see if this helps.&lt;/span&gt;&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: nrf5340 nrfx spis no events</title><link>https://devzone.nordicsemi.com/thread/282533?ContentTypeID=1</link><pubDate>Mon, 30 Nov 2020 18:06:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4023cc7f-29d4-4c39-8265-c1df9ec2d02a</guid><dc:creator>zuppiden</dc:creator><description>&lt;p&gt;I did the same and it&amp;#39;s still not working...&lt;/p&gt;
&lt;p&gt;What program do you have on the network core when running the spi code? I have &lt;span&gt;&lt;em&gt;hci_rpmsg &lt;/em&gt;from the ncs 1.4.0 on it. Does that have an influence?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Might my PDK be broken?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 nrfx spis no events</title><link>https://devzone.nordicsemi.com/thread/282391?ContentTypeID=1</link><pubDate>Mon, 30 Nov 2020 08:49:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39e2a97c-896c-42bf-b5b9-9abf53f04e44</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;I tried your fw, by pasting the source into zephyr/samples/basic/blinky, and configuring this with board nrf5340pdk_nrf5340_cpuapp, and got this print out:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting Zephyr OS build v2.4.0-ncs1  ***
SPIS started.
received
buffers set&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Additional kconfig settings:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_NRFX_SPIS3=y&lt;/pre&gt;&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: nrf5340 nrfx spis no events</title><link>https://devzone.nordicsemi.com/thread/282281?ContentTypeID=1</link><pubDate>Fri, 27 Nov 2020 14:14:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:577b308f-6b1c-4068-962a-2973b83b69ec</guid><dc:creator>zuppiden</dc:creator><description>&lt;p&gt;Thanks for your answer. This makes sense and I added it. However it still doesn&amp;#39;t work.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;zephyr.h&amp;gt;
#include &amp;lt;sys/printk.h&amp;gt;
#include &amp;quot;nrfx_spis.h&amp;quot;

#define PIN_SCK 4
#define PIN_MOSI 5
#define PIN_MISO 6
#define PIN_CSN 7
#define SPIS_NR 3

nrfx_spis_t spis_t = NRFX_SPIS_INSTANCE(SPIS_NR);
nrfx_spis_config_t spis_config_t = NRFX_SPIS_DEFAULT_CONFIG(PIN_SCK,PIN_MOSI,NRFX_SPIS_PIN_NOT_USED,PIN_CSN);

uint8_t rx_buffer[2];
uint8_t tx_buffer[2];

void spis_event_handler_t(nrfx_spis_evt_t const *p_event, void *p_context){
    printk(&amp;quot;received\n&amp;quot;);
    int err;
    switch(p_event-&amp;gt;evt_type){
        case NRFX_SPIS_XFER_DONE:
            err = nrfx_spis_buffers_set(&amp;amp;spis_t, tx_buffer, sizeof(tx_buffer), rx_buffer, sizeof(rx_buffer));
            if(err != NRFX_SUCCESS){
                printk(&amp;quot;Error with setting.\n&amp;quot;);
            }
            break;
        case NRFX_SPIS_BUFFERS_SET_DONE:
            printk(&amp;quot;buffers set\n&amp;quot;);
            break;
        case NRFX_SPIS_EVT_TYPE_MAX:
        
            break;
        default:
            ;
    }
}

static void manual_isr_setup()
{
    IRQ_DIRECT_CONNECT(SPIM3_SPIS3_TWIM3_TWIS3_UARTE3_IRQn, 0, nrfx_spis_3_irq_handler, 0);
    irq_enable(SPIM3_SPIS3_TWIM3_TWIS3_UARTE3_IRQn);
}

void init_spis(){
    int err;
    err = nrfx_spis_init(&amp;amp;spis_t,&amp;amp;spis_config_t,spis_event_handler_t,NULL);
    if(err != NRFX_SUCCESS){
        printk(&amp;quot;Error with init.\n&amp;quot;);
    } else {
        printk(&amp;quot;SPIS started.\n&amp;quot;);
    }
}

void main(void)
{
    int err;
    init_spis();
    manual_isr_setup();

    err = nrfx_spis_buffers_set(&amp;amp;spis_t, tx_buffer, sizeof(tx_buffer), rx_buffer, sizeof(rx_buffer));
    if(err != NRFX_SUCCESS){
        printk(&amp;quot;Error with setting.\n&amp;quot;);
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;My serial output is still:&lt;/p&gt;
&lt;p&gt;*** Booting Zephyr OS build v2.4.0-ncs1&amp;nbsp; ***&lt;br /&gt;SPIS started.&lt;/p&gt;
&lt;p&gt;I went through the code with the debugger and the nrf53 enters the function spis_state_entry_action_execute in nrfx_spi.c. It then goes to the case SPIS_BUFFER_RESOURCE_REQUESTED and returns then with NRFX_SUCCESS and never reaches SPIS_BUFFER_RESOURCE_CONFIGURED where the event type would be set.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 nrfx spis no events</title><link>https://devzone.nordicsemi.com/thread/282256?ContentTypeID=1</link><pubDate>Fri, 27 Nov 2020 12:42:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9edbe0fd-5d11-4181-b30f-cfd0395d557a</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 will need to setup the interrupt vector manually, using the zephyr&amp;#39;s IRQ_CONNECT*() API, similar to what is done here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Rallare/fw-nrfconnect-nrf/blob/nrf9160_samples/samples/nrf9160/nrfx_timed_signal/src/main.c#L128-L132"&gt;https://github.com/Rallare/fw-nrfconnect-nrf/blob/nrf9160_samples/samples/nrf9160/nrfx_timed_signal/src/main.c#L128-L132&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The handler you want to route, since you use SPIS3, would be &amp;quot;nrfx_spis_3_irq_handler&amp;quot;.&lt;/p&gt;
&lt;p&gt;Could you try this and see if that works?&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></channel></rss>