This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

The RAM usage for s132 with different bandwidth links

Dear experts,

I'm using nrf52832 with softdevice s132 v2 for BLE central products developing. According to the specification of s132 v2: We should run some code to get the app_ram_base address from calling sd_ble_enable(). Yes, I can get the value. And after I changed the value CENTRAL_LINK_COUNT which assigned to p_ble_enable_params->gap_enable_params.central_conn_count then the value of app_ram_base also is changed accordingly. When I set CENTRAL_LINK_COUNT to 8, and set 4 of them as HIGH bandwidth, and other 4 of then as LOW bandwidth as below. I got the value of app_ram_base as 0x20003be8.

    ble_enable_params.common_enable_params.p_conn_bw_counts->rx_counts.mid_count  = 0;
    ble_enable_params.common_enable_params.p_conn_bw_counts->rx_counts.low_count  = 4;
    ble_enable_params.common_enable_params.p_conn_bw_counts->tx_counts.high_count = 4;
    ble_enable_params.common_enable_params.p_conn_bw_counts->tx_counts.mid_count  = 0;
    ble_enable_params.common_enable_params.p_conn_bw_counts->tx_counts.low_count  = 4;```

But after I set 8 of them as HIGH bandwidth links and none as LOW bandwidth links, I still get the same value 0x20003be8 for `app_ram_base`.

```    ble_enable_params.common_enable_params.p_conn_bw_counts->rx_counts.high_count = 8;
    ble_enable_params.common_enable_params.p_conn_bw_counts->rx_counts.mid_count  = 0;
    ble_enable_params.common_enable_params.p_conn_bw_counts->rx_counts.low_count  = 0;
    ble_enable_params.common_enable_params.p_conn_bw_counts->tx_counts.high_count = 8;
    ble_enable_params.common_enable_params.p_conn_bw_counts->tx_counts.mid_count  = 0;
    ble_enable_params.common_enable_params.p_conn_bw_counts->tx_counts.low_count  = 0;```

Looks like value of `app_ram_base` is just changed according to total link counter is changed, but has no thing to do with the links bandwidth difference. This is not the same as the specification mentions that the RAM usage of softdevice will be changed according to bandwidth changing. It confuses me a lot. Is any misunderstanding I made?  Anyone can help me to understand it correctly?

Thanks!
Parents
  • I think you need to do something like this:

    ble_enable_params.gap_enable_params.central_conn_count = 8;
    
    ble_conn_bw_counts_t ble_conn_bw_counts;
    memset(&ble_conn_bw_counts, 0x00, sizeof(ble_conn_bw_counts_t));
    
    ble_conn_bw_counts.rx_counts.high_count = 8;
    ble_conn_bw_counts.rx_counts.mid_count = 0;
    ble_conn_bw_counts.rx_counts.low_count = 0;
    ble_conn_bw_counts.tx_counts.high_count = 8;
    ble_conn_bw_counts.tx_counts.mid_count = 0;
    ble_conn_bw_counts.tx_counts.low_count = 0;
    
    ble_enable_params.common_enable_params.p_conn_bw_counts = &ble_conn_bw_counts;
    
    // Enable BLE stack.
    err_code = softdevice_enable(&ble_enable_params);
    APP_ERROR_CHECK(err_code);
    

    Let me know how it goes.

Reply
  • I think you need to do something like this:

    ble_enable_params.gap_enable_params.central_conn_count = 8;
    
    ble_conn_bw_counts_t ble_conn_bw_counts;
    memset(&ble_conn_bw_counts, 0x00, sizeof(ble_conn_bw_counts_t));
    
    ble_conn_bw_counts.rx_counts.high_count = 8;
    ble_conn_bw_counts.rx_counts.mid_count = 0;
    ble_conn_bw_counts.rx_counts.low_count = 0;
    ble_conn_bw_counts.tx_counts.high_count = 8;
    ble_conn_bw_counts.tx_counts.mid_count = 0;
    ble_conn_bw_counts.tx_counts.low_count = 0;
    
    ble_enable_params.common_enable_params.p_conn_bw_counts = &ble_conn_bw_counts;
    
    // Enable BLE stack.
    err_code = softdevice_enable(&ble_enable_params);
    APP_ERROR_CHECK(err_code);
    

    Let me know how it goes.

Children
  • Hi Petter, I think that's exactly what I do in my code as below. And it works fine. The only thing as I mentioned above confusing me is that after I changing the bandwidth counter in ble_conn_bw_counts and keeping ble_enable_params.gap_enable_params.central_conn_count as the same value 8 the value of app_ram_base is not changed. But if I change the value of ble_enable_params.gap_enable_params.central_conn_count the value of app_ram_base is also changed accordingly. Looks like app_ram_base just depends on central_conn_count and has nothing to do with bandwidth counter. This is not the same as s132 spec mentions.

  • ble_enable_params_t ble_enable_params;

    err_code = softdevice_enable_get_default_config(8, 0, &ble_enable_params);
    
    ble_enable_params.common_enable_params.p_conn_bw_counts->rx_counts.high_count = 8;
    ble_enable_params.common_enable_params.p_conn_bw_counts->rx_counts.mid_count  = 0;
    ble_enable_params.common_enable_params.p_conn_bw_counts->rx_counts.low_count  = 0;
    ble_enable_params.common_enable_params.p_conn_bw_counts->tx_counts.high_count = 8;
    ble_enable_params.common_enable_params.p_conn_bw_counts->tx_counts.mid_count  = 0;
    ble_enable_params.common_enable_params.p_conn_bw_counts->tx_counts.low_count  = 0;
    
    CHECK_RAM_START_ADDR(8,0);
    
    err_code = softdevice_enable(&ble_enable_params);
    
  • Well, I see that it is not exactly what I'm doing. With your approach p_conn_bw_counts will point to NULL, and the SoftDevice will set standard bandwidths, your specific bandwidth settings will not have any effect. With my approach it will point to the address of &ble_conn_bw_counts. Have you tested?

Related