FiRa applications on DWM3001C

Hi

I have several DWM3001CDK dev boards and would like to use the FiRa ranging library in my application. I have some questions:

  1. Can I send custom UWB messages while the FiRa ranging task is active?
  2. Can I receive/listen to UWB messages (i.e. receive the raw data) while the FiRa ranging task is active?
  3. How can I put a FiRa responder into low power mode (i.e. a tag device operating from a cell battery) but still wake up and respond when required?
  4. Does the FiRa task work with multiple initiators and responders? (sorry I dont have access to the FiRa standard so I’m not familiar with how the FiRa devices share air time)
  5. Is the source code for the uwbstack and FiRa library available?

Regards
Ryan

1 Like

Hi @ryanharm ,

For 1st and 2nd question:
FiRa is only focusing on the ranging aspect and not optimised for the transfer data functionality.
So I would say it will be hard to adapt the FiRa task to exchange raw data.

3/ In the SDK, the ultra wide band low power functionality is already implemented. This is implemented in dw3000_lp_mcu.c. So the device will sleep between ranging round and even between slots if there is enough to wake up after.

4/ The FiRa task in the SDK wokrs with one initiator and multiplse responders (One To many), but multiple initiators and multiple responders is not implemnted in the actual version (many to many).


You need to enable Multi node mode, and add the second reponder address to the command.

5/ No the source code of the uwbstack and FiRa library is not available.

Hope it helps,
Wassim

Hi @Wassim_Qorvo ,
I am a little confused with some of the concepts in FiRa ranging, and how they articulate with each other:

  • DeviceType {Controller, Controlee}
  • DeviceRole {Initiator, Responder}
  • MultiNodeMode {Unicast, OnetoMany, ManytoMany}
  1. What is the difference between the DeviceType and the DeviceRole?
  2. Can an Initiator also respond to a ranging request?
  3. I did not understood in your previous message if the mode ManyToMany is implemented or not in the DWM3001C?
  4. And if it is implemented, what does it do?
  5. For my application, I have multiples drones that I will equip with DWM3001C. I want each drone to have the distance with all other drones. Is that possible? And what configuration should I choose?

Regards,
Fabien

Hi @Fabien-B ,

These questions are more related to FiRa.
You need to be a FiRa member in order to access their documentation and understand more in details how it’s working.

Controller: Defines and controls the ranging features by sending control message.
Controlee: utilizes the ranging features as configured via control message from the controller

Initiator: Initiates a ranging exchange by sending the first ranging frame.
Responder: Responds to the ranging initiation message received by the initiator.

6/ Then device type will define which device is controlling the ranging features.
And device role will define which device will initiate the ranging exchange.

7/ From the definition above, no it cannot.

8/ The many to many mode is not yet well defined in FiRa and not available in the package release on the website.

9/ Now it’s only possible to do the one to many mode.
In this mode, we’ll have one ranging initiator and multiple ranging responders participating in a ranging round.

I hope it’s more clear for you now,
Wassim

How can I set up my environment with 1 to multi? Where should I do
some changes?

Hi @Antonello ,

I answered in the correct thread:

Yes but the problem is that I built a firmware in a way that the responder starts automatically without any kind of command (so with no respf), this because I need the responder to be powered with power bank. So my question was if for each of the responder I should build a new firmware containing different address or should I do something only on the initiator’s firmware side? Thank you again

No you need to build a new fw containing different address.

Please use only one thread for each specific topic.

yes sorry, where do I need to put the new addresses in the fw?

Hi @Antonello,

uwbmac_set_short_addr function can be used to set the adress of controller and controlee.

For the controller/intiaiator device, you can pass the adresses for the controlees in the function fira_helper_add_controlees

In general you need to look on how this function fira_app_process_init is implemented.

Hi thanks @Wassim_Qorvo , basically I have this with the uwbmac_set_short_addr function:

/* fira_app_process_init
 */
static error_e fira_app_process_init(bool controller, void const *arg)
{
    fira_param_t *fira_param = (fira_param_t *)arg;

    session_id = fira_param->session_id;
    uint16_t string_len = STR_SIZE * (controller ? fira_param->controlees_params.n_controlees : 1);

    output_result.str = malloc(string_len);
    if (!(output_result.str))
    {
        char *err = "not enough memory";
        reporter_instance.print((char *)err, strlen(err));
        return _ERR_Cannot_Alloc_Memory;
    }
    output_result.len = string_len;

    // Update LUT for the current antenna set
    pdoaupdate_lut();

    fira_uwb_mcps_init(fira_param);

    int r = uwbmac_init(&uwbmac_ctx);
    assert(r == UWBMAC_SUCCESS);

    // unset promiscuous to accept only filtered frames.
    uwbmac_set_promiscuous_mode(uwbmac_ctx, true);
    // set local short address.
    uwbmac_set_short_addr(uwbmac_ctx, fira_param->session.short_addr);
    // register report cb
    r = fira_helper_open(&fira_ctx, uwbmac_ctx, &report_cb, "endless", 0, &output_result);
    assert(r == UWBMAC_SUCCESS);
    // Set fira scheduler;
    r = fira_helper_set_scheduler(&fira_ctx);
    assert(r == UWBMAC_SUCCESS);
    // init session;
    r = fira_helper_init_session(&fira_ctx, session_id);
    assert(r == UWBMAC_SUCCESS);
    // Set session parameters;
    r = fira_set_session_parameters(&fira_ctx, session_id, &fira_param->session);
    assert(r == UWBMAC_SUCCESS);

    // Send sp1 data;
    if (fira_param->session.rframe_config == FIRA_RFRAME_CONFIG_SP1)
    {
#if (PROPRIETARY_SP1_TWR_EXAMPLE_ENABLE == 1)
        r = fira_helper_send_data(&fira_ctx, session_id, &data_params);
        assert(r == UWBMAC_SUCCESS);
#else
        assert(0); /* PROPRIETARY_SP1_TWR_EXAMPLE_ENABLE not allowed */
#endif
    }
    if (controller)
    {
        // Add controlee session parameters;
        r = fira_helper_add_controlees(&fira_ctx, session_id, &fira_param->controlees_params);
        assert(r == UWBMAC_SUCCESS);
    }
    return _NO_ERR;
}

static void fira_app_process_start(void)
{
    /* OK, let's start. */
    int r = uwbmac_start(uwbmac_ctx);
    assert(r == UWBMAC_SUCCESS);
    // Start session;
    r = fira_helper_start_session(&fira_ctx, session_id);
    assert(r == UWBMAC_SUCCESS);
    started = true;
}

static error_e fira_app_process_terminate(void)
{
    if (started)
    {
        started = false; // do not allow re-entrance

        // Stop session;
        int r = fira_helper_stop_session(&fira_ctx, session_id);
        assert(!r);
        // Stop.
        uwbmac_stop(uwbmac_ctx);
        // Uninit session;
        r = fira_helper_deinit_session(&fira_ctx, session_id);
        assert(!r);
        fira_helper_close(&fira_ctx);

        // unregister driver;
        fira_uwb_mcps_deinit();

        free(output_result.str);
    }
    return _NO_ERR;
}

basically If I want to have 1 initiator and let’s suppose 4 responders, how do I give the different addresses, where do I need to write them? Thank you in advance for your time and patience, but I’m really stuck from some week on this point. Can I have an example?