<?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>ESB Can not trigger handler</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/121511/esb-can-not-trigger-handler</link><description>Hi 
 sdk:17.1 ble_app_uart(esb_timeslot)) 
 When I was conducting the integration test between my device (nRF52832) and the external device (nRF24L), I encountered a problem. The nRF24L sent a message via 2.4GHz. The nRF52832 was able to enter the function</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 16 May 2025 07:17:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/121511/esb-can-not-trigger-handler" /><item><title>RE: ESB Can not trigger handler</title><link>https://devzone.nordicsemi.com/thread/535703?ContentTypeID=1</link><pubDate>Fri, 16 May 2025 07:17:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24e11fd4-b1b1-454c-9822-e25e7008ee9a</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I would suggest not to use the DPL and used fixed length&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;// change below
nrf_esb_config.protocol       = NRF_ESB_PROTOCOL_ESB_DPL;

to 

// fixed, 16-byte packets
nrf_esb_config.protocol       = NRF_ESB_PROTOCOL_ESB;
nrf_esb_config.payload_length = 16;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Also your CRC should match. Make sure that your PRX is also have 16bit CRC as the 16 bit CRC you have configured here for PTX.&lt;/p&gt;
&lt;p&gt;In your PRX you should have something like below&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;//your “legacy” config to FIXED-length ESB (no DPL)

#define NRF_ESB_LEGACY_CONFIG  {                        \
    .protocol           = NRF_ESB_PROTOCOL_ESB,        /* fixed */ \
    .mode               = NRF_ESB_MODE_PRX,            \
    .event_handler      = nrf_esb_event_handler,       \
    .bitrate            = NRF_ESB_BITRATE_2MBPS,       \
    .crc                = NRF_ESB_CRC_16BIT,           /* 2-byte CRC */ \
    .tx_output_power    = NRF_ESB_TX_POWER_0DBM,       \
    .retransmit_delay   = 300,                         \
    .retransmit_count   = 1,                           \
    .payload_length     = 16,                          /* must match PTX */ \
    .selective_auto_ack = false,                       \
    .radio_irq_priority = 1,                           \
    .event_irq_priority = 2                            \
}

static nrf_esb_config_t nrf_esb_config = NRF_ESB_LEGACY_CONFIG;

// Split the PTX’s 5-byte address into 4-byte base + 1-byte prefix
static const uint8_t pt_addr[5] = { 0xA1, 0xA2, 0xA3, 0xA4, 0xA5 };


uint32_t err;

// after nrf_esb_init()
err = nrf_esb_set_base_address_0((uint8_t[]){ pt_addr[1],
                                              pt_addr[2],
                                              pt_addr[3],
                                              pt_addr[4] });
VERIFY_SUCCESS(err);

// tell the radio the “first byte” of the pipe address
err = nrf_esb_set_prefixes(&amp;amp;pt_addr[0], 1);
VERIFY_SUCCESS(err);

// channel and go into RX
VERIFY_SUCCESS(nrf_esb_set_rf_channel(58));
VERIFY_SUCCESS(nrf_esb_start_rx());
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I do not see any other things apart from this checks on PRX matching your PTX configuration.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ESB Can not trigger handler</title><link>https://devzone.nordicsemi.com/thread/535682?ContentTypeID=1</link><pubDate>Fri, 16 May 2025 03:38:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84aa0582-480a-4504-874f-7a1addac740c</guid><dc:creator>kenyon</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;br /&gt;Since the nRF24l is a device from an external company, I can only provide their configuration.&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;nRF24L
1）Reg（0x20+0x10），write buffer{0XA1,0XA2,0XA3,0XA4,0XA5}，byte5；
2）Reg（0x20+0x0A），write buffer{0XA1,0XA2,0XA3,0XA4,0XA5}，byte5；
3）Reg（0X20+0X01），write 0X01； //enable ack
4）Reg（0X20+0X02），write 0X01； //enable rev address
5）Reg（0X20+0X04），write 0X01； //auto ack
6）Reg（0X20+0X05），write 58；   //RF CHANNEL
7）Reg（0X20+0X11），write 16；   //data length
9）Reg（0X20+0X00），write 0X0E；//CONFIG &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This is nRF52832 config&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define NRF_ESB_LEGACY_CONFIG  {.protocol               = NRF_ESB_PROTOCOL_ESB_DPL,             \
                                .mode                   = NRF_ESB_MODE_PTX,                 \
                                .event_handler          = 0,                                \
                                .bitrate                = NRF_ESB_BITRATE_2MBPS,            \
                                .crc                    = NRF_ESB_CRC_16BIT,                 \
                                .tx_output_power        = NRF_ESB_TX_POWER_0DBM,            \
                                .retransmit_delay       = 300,                              \
                                .retransmit_count       = 1,                                \
                                .tx_mode                = NRF_ESB_TXMODE_AUTO,              \
                                .radio_irq_priority     = 1,                                \
                                .event_irq_priority     = 2,                                \
                                .payload_length         = 16,                               \
                                .selective_auto_ack     = false                             \
}
static nrf_esb_config_t             nrf_esb_config = NRF_ESB_LEGACY_CONFIG;         /**&amp;lt; Configuration structure for nrf_esb initialization. */
static const uint8_t base_addr_0[4] = {0xA2, 0xA3, 0xA4, 0xA5};
static const uint8_t base_addr_1[4] = {0xC2, 0xC2, 0xC2, 0xC2};
static uint8_t addr_prefix[8] = {0xA1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8 };    /**&amp;lt; Address prefix. */
uint32_t esb_timeslot_init(void)
{
	void nrf_esb_event_handler(nrf_esb_evt_t const * p_event);
	
    nrf_esb_config.protocol                 = NRF_ESB_PROTOCOL_ESB_DPL;
    nrf_esb_config.selective_auto_ack       = true;

    nrf_esb_config.bitrate                  = NRF_ESB_BITRATE_2MBPS;
    nrf_esb_config.mode                     = NRF_ESB_MODE_PRX;
    nrf_esb_config.event_handler            = nrf_esb_event_handler;
    nrf_esb_config.crc                      = NRF_ESB_CRC_16BIT;
    nrf_esb_config.radio_irq_priority       = 0;
    nrf_esb_config.tx_output_power          = NRF_ESB_TX_POWER_0DBM;

    NVIC_ClearPendingIRQ(TIMESLOT_END_IRQn);
    NVIC_SetPriority(TIMESLOT_END_IRQn, 2);
    NVIC_EnableIRQ(TIMESLOT_END_IRQn);

    NVIC_ClearPendingIRQ(TIMESLOT_BEGIN_IRQn);
    NVIC_SetPriority(TIMESLOT_BEGIN_IRQn, 2);
    NVIC_EnableIRQ(TIMESLOT_BEGIN_IRQn);

    return NRF_SUCCESS;
}
uint32_t esb_start_PRX(bool selective_auto_ack) { // need a return value due to &amp;quot;VERIFY_SUCCESS&amp;quot; did
    uint32_t err_code;

    if (m_state == LL_ESB_STATE_IDLE) {
        #if 1 // suggestion from Nordic forum to fix &amp;quot;wrong pattern&amp;quot;: power cycle RADIO before init
            NRF_RADIO-&amp;gt;POWER = 0;
            NRF_RADIO-&amp;gt;POWER;
            NRF_RADIO-&amp;gt;POWER = 1;
        #endif
        nrf_esb_config.mode               = NRF_ESB_MODE_PRX;
        nrf_esb_config.selective_auto_ack = selective_auto_ack;
        err_code = nrf_esb_init(&amp;amp;nrf_esb_config); APP_ERROR_CHECK(err_code);
	
       err_code = nrf_esb_set_base_address_0(base_addr_0);
   	 VERIFY_SUCCESS(err_code);
    	err_code = nrf_esb_set_base_address_1(base_addr_1);
   	 VERIFY_SUCCESS(err_code);

	nrf_esb_set_rf_channel(58);
	addr_prefix[0] = 0xA1;
        err_code = nrf_esb_set_prefixes(addr_prefix, 8); APP_ERROR_CHECK(err_code);
    }

    CRITICAL_REGION_ENTER();
    if (m_state != LL_ESB_STATE_RX)
    {
        /* No packets in the Tx FIFO: start reception */
        err_code = nrf_esb_start_rx();
        APP_ERROR_CHECK(err_code);
        m_state = LL_ESB_STATE_RX;
    }
    CRITICAL_REGION_EXIT();
    return NRF_SUCCESS;
}

void ESB_ReplyAck(unsigned char *pucData, unsigned long ulLen, unsigned long pipe, bool noack) {
    nrf_esb_payload_t tx_payload;
    memcpy(tx_payload.data, pucData, ulLen);
    tx_payload.length   = ulLen;
    tx_payload.pipe     = pipe;
    tx_payload.noack    = noack;//true;
    if (nrf_esb_write_payload(&amp;amp;tx_payload) == NRF_SUCCESS) {
            //
       }
}&lt;/pre&gt;&lt;br /&gt;If there is any information that needs to be supplemented, please let us know in time. Thank you very much&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote userid="6207" url="~/f/nordic-q-a/121511/esb-can-not-trigger-handler/535518"]I also think that it is best to read the full buffer in your&amp;nbsp;nrf_esb_event_handler(nrf_esb_evt_t const * p_event) function and process the packet before you read another packet.[/quote]
&lt;p&gt;Yes, we will process the data in the mainloop.&lt;br /&gt;&lt;br /&gt;Best regard&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ESB Can not trigger handler</title><link>https://devzone.nordicsemi.com/thread/535518?ContentTypeID=1</link><pubDate>Thu, 15 May 2025 10:26:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ece5d0db-482c-4126-ab7a-3ba395a60442</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There is too little information to be able to diagnose the problem. When you wrote that nRF24L is sending the data, are you sure that the payload size of PTX in your nRF24L configuration matches the PRX size in your nRF52832 receive end?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can you please show some code snippets on both the PTX and PRX sideon how you configure&amp;nbsp;nrf_esb_config_t&amp;nbsp; structure.&lt;/p&gt;
&lt;p&gt;I also think that it is best to read the full buffer in your&amp;nbsp;nrf_esb_event_handler(nrf_esb_evt_t const * p_event) function and process the packet before you read another packet.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>