This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

central multilink example not building

Hi, All

I am trying the example here ...ncs\v1.9.1\zephyr\samples\bluetooth\central_multilink\ with nRF52833dk_nrf52833 board, however it doesn't build, and saying the  maximum conn number is outside of the valid range of [1. 20]. 

What is the range of CONFIG_BT_MAX_CONN? another example says 20, but why this one set it to 62?

Another question, when a central is connected to some peripherals,  is it still able to do scanning?

Thanks you!

Ping

  • Hi, Simon

    Thanks for reply.

    1. Here is the disconnect API in the example -static void disconnect(struct bt_conn *conn, void *data), it requires to pass bt_conn *conn object in order to call it, so I don't think it should be cleared before it is disconnected, Am I wrong?

    2. Anyway, I tried to call the disconnect function with conn_connecting as parameter, and it works, but I had to modify the connected function, not to clear it. If I clear it . If I clear it to NULL and then call disconnect function, it crashes. Any solution to this?
    3. I am keeping the MAC address of all connected devices, also tried to keep all connection objects too, so I can disconnect and connect any of them at any time, but so far it works for one connection at a time only, if I try to connect a second one while the first one is connected , it give me an error of -12, please can you tell me why?
    Regards!
    Ping
  • Hi

    1. Correct, but bt_conn *conn is not the same as conn_connecting, these are two different structs, and it seems like your're mixing these up.

    2. It shouldn't be necessary to add conn_connecting. Use the bt_conn *conn struct instead. 

    3. Error -12 points to there being no more memory in your application. Have you checked how much memory your application uses as is, and does one connection take up what is available in your application?

    Best regards,

    Simon

  • Hi, Simon

    1. I think conn_connecting is an instance of bt_conn in pointer type, right?  definition below.

    struct bt_conn *conn_connecting;
    while it is created in following function -
        err = bt_conn_le_create(addr, &create_param, &conn_param,
                    &conn_connecting);
    and declaration of the function is :
    int bt_conn_le_create(const bt_addr_le_t *peer,
    		      const struct bt_conn_le_create_param *create_param,
    		      const struct bt_le_conn_param *conn_param,
    		      struct bt_conn **ret_conn)
     it is a type of struct bt_conn **ret_conn, looks like a pointer of a pointer, I am bit confused here, and not sure which one is the connect object after a connection is created, please clarify.
    2. About the SRAM usage, compile code uses ~30K RAM out of 128K,so there is still about 98K left, is there a way to know how much RAM a connection use? Please advise.
    Thank you again for your patience!
    Ping
  • Hi

    A connection should not take that much RAM. How much flash memory does your application and the SoftDevice controller take? If it's close to the SoCs flash, the pairing information might exceed the flash available. Can you also show me the prj.conf file of your application?

    Best regards,

    Simon

  • Thank you, Simon

    just checked prj.conf and realised that CONFIG_BT_MAX_CONN=20 is commented out - sorry my fault.

    It is now be able to connect 2 with no error.

    Flash usage is 35% and RAM 52%, use SoC 52833.

    Now I need to keep a table of connected device with MAC addresses and their connection objects.   will try to do connection and disconnect for any of them.

    Thank you again.

    Ping

Related