Migration of direction finding connectionless code from 2.5.6 to 3.1.0 fails to enable UART and configure CTE params (ERROR -134)

Hi, I recently upgraded my nRF Connect SDK to 3.1, and have migrated my code (which was originally based on the direction finding connectionless example) to 3.1 so that it builds.

However, when I flash to my devkit, UART configuration fails with -134 on ret != 0 below

    static const struct uart_config default_uart_cfg = {.baudrate = 115200,
                                                        .parity = UART_CFG_PARITY_NONE,
                                                        .stop_bits = UART_CFG_STOP_BITS_1,
                                                        .data_bits = UART_CFG_DATA_BITS_8,
                                                        .flow_ctrl = UART_CFG_FLOW_CTRL_NONE};

    g_if.dev = DEVICE_DT_GET(DT_NODELABEL(uart0));
    if (!device_is_ready(g_if.dev))
    {
        LOG_ERR("UART device not ready!");
        return NULL;
    }

    // Use provided config or default if NULL
    const struct uart_config *cfg_to_use = uart_cfg ? uart_cfg : &default_uart_cfg;

    LOG_INF("UART config: baudrate=%d, parity=%d, stop_bits=%d, data_bits=%d, flow_ctrl=%d", cfg_to_use->baudrate,
            cfg_to_use->parity, cfg_to_use->stop_bits, cfg_to_use->data_bits, cfg_to_use->flow_ctrl);
    int ret = uart_configure(g_if.dev, cfg_to_use);
    if (ret != 0)
    {
        LOG_ERR("UART configure failed: %d", ret);
        return NULL;
    }

The system is able to find the UART device itself, for what it's worth. I have also copied the boards folder from the updated samples for v3.1.0 to my project folder for use instead of the old ones. If I ignore trying to configure the UART and just enable it, that's OK, but then the CTE params configuring fails.

    LOG_INF("Update CTE params...");
    err = bt_df_set_adv_cte_tx_param(adv_set, &cte_params);
    if (err)
    {
        LOG_ERR("failed (err %d)\n", err);
        return 0;
    }
    LOG_INF("success\n");

where my cte_params are as follows (identical to the sample)

struct bt_df_adv_cte_tx_param cte_params = {.cte_len = CTE_LEN,
                                            .cte_count = PER_ADV_EVENT_CTE_COUNT,
                                            .cte_type = BT_DF_CTE_TYPE_AOA,
                                            .num_ant_ids = 0,
                                            .ant_ids = NULL
};

After this failed, I then tried to flash the sample I based it off of, just in its current version in v3.1.0, and then I discover that the sample also fails to enable CTE params in the same way
*** Booting nRF Connect SDK v3.1.0-6c6e5b32496e ***
*** Using Zephyr OS v4.1.99-1612683d4010 ***
Starting Direction Finding periodic advertising Beacon Demo
Bluetooth initialization...success
Advertising set create...success
Update CTE params...failed (err -134)

Have the samples been updated correctly to the new version? Any known issues that may have to be addressed on our part?

Kind regards,

Glen

Related