<?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>nRF54L15DK: small BLE app and system stalls after phone reconnect (LED heartbeat + shell stop, no reset)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/126403/nrf54l15dk-small-ble-app-and-system-stalls-after-phone-reconnect-led-heartbeat-shell-stop-no-reset</link><description>On nRF54L15 DK (CPUAPP) the app boots and advertises fine, I bound my phone using nrfconnect but when I reboot the DK and try to reconnet using nrfconnect, the device hangs. LED heartbeat stops, LED pattern stops, shell stops responding, but no reset</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 07 Jan 2026 13:24:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/126403/nrf54l15dk-small-ble-app-and-system-stalls-after-phone-reconnect-led-heartbeat-shell-stop-no-reset" /><item><title>RE: nRF54L15DK: small BLE app and system stalls after phone reconnect (LED heartbeat + shell stop, no reset)</title><link>https://devzone.nordicsemi.com/thread/558158?ContentTypeID=1</link><pubDate>Wed, 07 Jan 2026 13:24:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26826366-c799-4400-bb03-c65ef183a19c</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Sounds good! closing case.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF54L15DK: small BLE app and system stalls after phone reconnect (LED heartbeat + shell stop, no reset)</title><link>https://devzone.nordicsemi.com/thread/558138?ContentTypeID=1</link><pubDate>Wed, 07 Jan 2026 11:42:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6449f5c-e992-4d8a-a011-0b45cebf25a8</guid><dc:creator>jvermillard</dc:creator><description>&lt;p&gt;after more testing and moving&amp;nbsp;the advertising restart out of the disconnect callback, it works on 3.2.0 (not on zephyr master, but I&amp;#39;ll open an issue there)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF54L15DK: small BLE app and system stalls after phone reconnect (LED heartbeat + shell stop, no reset)</title><link>https://devzone.nordicsemi.com/thread/558131?ContentTypeID=1</link><pubDate>Wed, 07 Jan 2026 10:35:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:629963c1-2239-4cf2-a07b-e4470d2156fb</guid><dc:creator>jvermillard</dc:creator><description>&lt;p&gt;I simplifyied the code and it&amp;#39;s still freezing:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;zephyr/types.h&amp;gt;
#include &amp;lt;stddef.h&amp;gt;
#include &amp;lt;errno.h&amp;gt;
#include &amp;lt;zephyr/logging/log.h&amp;gt;
#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/sys/util.h&amp;gt;

#include &amp;lt;zephyr/drivers/hwinfo.h&amp;gt;
#include &amp;lt;zephyr/settings/settings.h&amp;gt;

#include &amp;lt;zephyr/bluetooth/bluetooth.h&amp;gt;
#include &amp;lt;zephyr/bluetooth/hci.h&amp;gt;
#include &amp;lt;zephyr/bluetooth/conn.h&amp;gt;
#include &amp;lt;zephyr/bluetooth/uuid.h&amp;gt;
#include &amp;lt;zephyr/bluetooth/gatt.h&amp;gt;

LOG_MODULE_REGISTER(app, CONFIG_LOG_DEFAULT_LEVEL);

static void log_reset_cause(void)
{
#if IS_ENABLED(CONFIG_HWINFO)
        static const struct {
                uint32_t bit;
                const char *name;
        } causes[] = {
                { RESET_PIN, &amp;quot;pin&amp;quot; },
                { RESET_SOFTWARE, &amp;quot;software&amp;quot; },
                { RESET_BROWNOUT, &amp;quot;brownout&amp;quot; },
                { RESET_POR, &amp;quot;power-on&amp;quot; },
                { RESET_WATCHDOG, &amp;quot;watchdog&amp;quot; },
                { RESET_DEBUG, &amp;quot;debug&amp;quot; },
                { RESET_SECURITY, &amp;quot;security&amp;quot; },
                { RESET_LOW_POWER_WAKE, &amp;quot;low-power-wake&amp;quot; },
                { RESET_CPU_LOCKUP, &amp;quot;cpu-lockup&amp;quot; },
                { RESET_PARITY, &amp;quot;parity&amp;quot; },
                { RESET_PLL, &amp;quot;pll&amp;quot; },
                { RESET_CLOCK, &amp;quot;clock&amp;quot; },
                { RESET_HARDWARE, &amp;quot;hardware&amp;quot; },
                { RESET_USER, &amp;quot;user&amp;quot; },
                { RESET_TEMPERATURE, &amp;quot;temperature&amp;quot; },
                { RESET_BOOTLOADER, &amp;quot;bootloader&amp;quot; },
                { RESET_FLASH, &amp;quot;flash&amp;quot; },
        };
        uint32_t supported = 0U;
        uint32_t cause = 0U;
        int err;

        err = hwinfo_get_supported_reset_cause(&amp;amp;supported);
        if (err == 0) {
                LOG_INF(&amp;quot;Reset causes supported: 0x%08x&amp;quot;, supported);
        }

        err = hwinfo_get_reset_cause(&amp;amp;cause);
        if (err == 0) {
                LOG_INF(&amp;quot;Reset cause: 0x%08x&amp;quot;, cause);
                for (size_t i = 0; i &amp;lt; ARRAY_SIZE(causes); i++) {
                        if ((cause &amp;amp; causes[i].bit) != 0U) {
                                LOG_INF(&amp;quot;Reset cause flag: %s&amp;quot;, causes[i].name);
                        }
                }
        } else {
                LOG_WRN(&amp;quot;Reset cause unavailable (err %d)&amp;quot;, err);
        }

        err = hwinfo_clear_reset_cause();
        if (err) {
                LOG_WRN(&amp;quot;Reset cause clear failed (err %d)&amp;quot;, err);
        }
#else
        LOG_INF(&amp;quot;Reset cause: HWINFO disabled&amp;quot;);
#endif
}

static struct bt_conn *default_conn;
struct bond_state {
        int count;
};

static void bond_check(const struct bt_bond_info *info, void *user_data)
{
        struct bond_state *state = user_data;
        char addr[BT_ADDR_LE_STR_LEN];

        bt_addr_le_to_str(&amp;amp;info-&amp;gt;addr, addr, sizeof(addr));
        LOG_INF(&amp;quot;Bonded device: %s&amp;quot;, addr);
        state-&amp;gt;count++;
}

static void update_paired_from_bonds(void)
{
        struct bond_state state = { 0 };

        bt_foreach_bond(BT_ID_DEFAULT, bond_check, &amp;amp;state);
        LOG_INF(&amp;quot;Bond count: %d&amp;quot;, state.count);
}

static const struct bt_data ad[] = {
        BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
};

static const struct bt_data sd[] = {
        BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_DEVICE_NAME, sizeof(CONFIG_BT_DEVICE_NAME) - 1),
};

void mtu_updated(struct bt_conn *conn, uint16_t tx, uint16_t rx)
{
        char addr[BT_ADDR_LE_STR_LEN];

        bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));
        LOG_INF(&amp;quot;MTU updated for %s: TX %u RX %u&amp;quot;, addr, tx, rx);
}

static struct bt_gatt_cb gatt_callbacks = {
        .att_mtu_updated = mtu_updated
};

static void connected(struct bt_conn *conn, uint8_t err)
{
        char addr[BT_ADDR_LE_STR_LEN];
        int sec_err;

        bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));
        if (err) {
                LOG_WRN(&amp;quot;Connection failed (%s): err 0x%02x %s&amp;quot;,
                        addr, err, bt_hci_err_to_str(err));
        } else {
                LOG_INF(&amp;quot;Connected: %s&amp;quot;, addr);
                if (default_conn) {
                        bt_conn_unref(default_conn);
                }
                default_conn = bt_conn_ref(conn);
                sec_err = bt_conn_set_security(conn, BT_SECURITY_L2);
                if (sec_err) {
                        LOG_WRN(&amp;quot;Failed to set security (err %d)&amp;quot;, sec_err);
                }
        }
}

static void disconnected(struct bt_conn *conn, uint8_t reason)
{
        char addr[BT_ADDR_LE_STR_LEN];
        int err;

        bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));
        LOG_INF(&amp;quot;Disconnected: %s reason 0x%02x %s&amp;quot;,
                addr, reason, bt_hci_err_to_str(reason));

        if (default_conn) {
                bt_conn_unref(default_conn);
                default_conn = NULL;
        }

        LOG_INF(&amp;quot;Restarting advertising&amp;quot;);
        err = bt_le_adv_start(BT_LE_ADV_CONN_FAST_1, ad, ARRAY_SIZE(ad),
                              sd, ARRAY_SIZE(sd));
        if (err &amp;amp;&amp;amp; err != -EALREADY) {
                LOG_ERR(&amp;quot;Advertising restart failed (err %d)&amp;quot;, err);
        } else {
                LOG_INF(&amp;quot;Advertising started&amp;quot;);
        }
}

static void security_changed(struct bt_conn *conn, bt_security_t level,
                             enum bt_security_err err)
{
        char addr[BT_ADDR_LE_STR_LEN];

        bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));
        if (err) {
                LOG_WRN(&amp;quot;Security failed (%s): level %u err %u&amp;quot;, addr, level, err);
        } else {
                LOG_INF(&amp;quot;Security changed (%s): level %u&amp;quot;, addr, level);
        }
}

static void le_param_updated(struct bt_conn *conn, uint16_t interval,
                             uint16_t latency, uint16_t timeout)
{
        char addr[BT_ADDR_LE_STR_LEN];

        bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));
        LOG_INF(&amp;quot;Conn params (%s): interval %u latency %u timeout %u&amp;quot;,
                addr, interval, latency, timeout);
}

BT_CONN_CB_DEFINE(conn_callbacks) = {
        .connected = connected,
        .disconnected = disconnected,
        .security_changed = security_changed,
        .le_param_updated = le_param_updated,
};

static void bt_ready(void)
{
        int err;

        LOG_INF(&amp;quot;Bluetooth initialized&amp;quot;);

        if (IS_ENABLED(CONFIG_SETTINGS)) {
                err = settings_load();
                if (err) {
                        LOG_WRN(&amp;quot;Settings load failed (err %d)&amp;quot;, err);
                } else {
                        LOG_INF(&amp;quot;Settings loaded&amp;quot;);
                }
                update_paired_from_bonds();
        }

        LOG_INF(&amp;quot;Starting advertising&amp;quot;);
        err = bt_le_adv_start(BT_LE_ADV_CONN_FAST_1, ad, ARRAY_SIZE(ad), sd, ARRAY_SIZE(sd));
        if (err) {
                LOG_ERR(&amp;quot;Advertising failed to start (err %d)&amp;quot;, err);
                return;
        }

        LOG_INF(&amp;quot;Advertising started&amp;quot;);
}

static void auth_passkey_display(struct bt_conn *conn, unsigned int passkey)
{
        char addr[BT_ADDR_LE_STR_LEN];

        bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));

        LOG_INF(&amp;quot;Passkey for %s: %06u&amp;quot;, addr, passkey);
}

static void auth_cancel(struct bt_conn *conn)
{
        char addr[BT_ADDR_LE_STR_LEN];

        bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));

        LOG_WRN(&amp;quot;Pairing cancelled: %s&amp;quot;, addr);
}

static struct bt_conn_auth_cb auth_cb_display = {
        .passkey_display = auth_passkey_display,
        .passkey_entry = NULL,
        .cancel = auth_cancel,
};

static void pairing_complete(struct bt_conn *conn, bool bonded)
{
        char addr[BT_ADDR_LE_STR_LEN];

        bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));
        LOG_INF(&amp;quot;Pairing complete: %s bonded=%u&amp;quot;, addr, bonded ? 1U : 0U);
}

static void pairing_failed(struct bt_conn *conn, enum bt_security_err reason)
{
        char addr[BT_ADDR_LE_STR_LEN];

        bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));
        LOG_WRN(&amp;quot;Pairing failed: %s (reason %d)&amp;quot;, addr, reason);
}

static struct bt_conn_auth_info_cb auth_info_cb = {
        .pairing_complete = pairing_complete,
        .pairing_failed = pairing_failed,
};

int main(void)
{
        int err;

        LOG_INF(&amp;quot;App start&amp;quot;);
        log_reset_cause();
        err = bt_enable(NULL);
        if (err) {
                LOG_ERR(&amp;quot;Bluetooth init failed (err %d)&amp;quot;, err);
                return 0;
        }

        err = bt_passkey_set(123456);
        if (err) {
                LOG_WRN(&amp;quot;Failed to set fixed passkey (err %d)&amp;quot;, err);
        }

        bt_conn_auth_cb_register(&amp;amp;auth_cb_display);
        bt_conn_auth_info_cb_register(&amp;amp;auth_info_cb);

        bt_ready();
        bt_gatt_cb_register(&amp;amp;gatt_callbacks);

        /* Implement notification. At the moment there is no suitable way
         * of starting delayed work so we do it here
         */
        while (1) {
                k_sleep(K_SECONDS(1));

                if (default_conn &amp;amp;&amp;amp; bt_conn_get_security(default_conn) &amp;gt;= BT_SECURITY_L2) {
                }
        }
        return 0;
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>