mpsl_fem_simple_gpio_interface_config_set gives MPSL assert 122, 29

Hi!

I'm trying to decipher the MPSL FEM API documentation and I'm adding code to a bare metal project to initialize the simple gpio interface FEM config.

I'm running (with nrfxlib 2.9.0):

    int32_t err = mpsl_init(&clock_cfg, MPSL_LOW_PRIO_IRQn, mpsl_assert_handler);

    mpsl_fem_simple_gpio_interface_config_t fem_config = {
        .dppi_channels = {
            2, 3, 4,
        },
        .egu_channels = {
            1, 2, 3,
        },
        .egu_instance_no = 20,
        .fem_config = {
            .pa_gain_db = 13,
            .lna_gain_db = 7,
            .pa_time_gap_us = 12,
            .lna_time_gap_us = 24,
        },
        .lna_pin_config = {
            .active_high = false,
            .enable = true,
            .gpio_pin = {
                .p_port = NRF_P1,
                .port_no = 1,
                .port_pin = 10,
            },
            .gpiote_ch_id = 1,
        },
        .pa_pin_config = {
            .active_high = false,
            .enable = true,
            .gpio_pin = {
                .p_port = NRF_P1,
                .port_no = 1,
                .port_pin = 14,
            },
            .gpiote_ch_id = 2,
        },
    };
    
    mpsl_fem_simple_gpio_interface_config_set(&fem_config);

If I remove the call to mpsl_fem_simple_gpio_interface_config_set, this, and the rest of the code, works fine. Adding it causes MPSL to call the assert-handler for file 122, line 29 and not return from mpsl_fem_simple_gpio_interface_config_set.

Is 20 the right value for EGU20? (I've tried 0..3 as well).

We don't use EGU20 for anything else. We also don't use the given DPPI channels (I've tried with others as well) nor the gpio-pins.

Is there some other function that should be called before calling this function?

I've called mpsl_fem_init() before (but its documentation says its not needed if mpsl_init is called). I've called mpsl_fem_power_model_set(NULL); before which didn't help either.

Related