CONFIG_BT_MESH_DFD_SRV_TARGETS_MAX questions

Hello

I've been experimenting in increasing the number of targets that a mesh FOTA distribution server can support on nRF52840

The CONFIG_BT_MESH_DFD_SRV_TARGETS_MAX has a maximum  65535

But for practical purposes I'd be happy if I could have at least 50-60.
Ran into build asserts in zephyr\subsys\bluetooth\mesh\dfd_srv.c
"The Firmware Distribution Receivers List message does not fit into the maximum " "outgoing SDU size"

The comparison is done to the  BT_MESH_TX_SDU_MAX which is built as follows
#define BT_MESH_TX_SDU_MAX        MAX((BT_MESH_TX_SEG_MAX *     \
                       BT_MESH_APP_SEG_SDU_MAX),    \
                      BT_MESH_APP_UNSEG_SDU_MAX)
CONFIG_BT_MESH_TX_SEG_MAX is limited to 32
BT_MESH_APP_SEG_SDU_MAX is defined as 12
BT_MESH_APP_UNSEG_SDU_MAX is defined as 15
By trial and error I was able to set the number of targets to 39 with these configurations
ONFIG_BT_MESH_MSG_CACHE_SIZE=256
CONFIG_BT_MESH_ADV_BUF_COUNT=128
CONFIG_BT_MESH_TX_SEG_MAX=32
CONFIG_BT_MESH_RX_SEG_MAX=32
CONFIG_BT_MESH_TX_SEG_MSG_COUNT=64
CONFIG_BT_MESH_RX_SEG_MSG_COUNT=64
CONFIG_BT_MESH_DFD_SRV_TARGETS_MAX=39
Is this it? Or is there another way to increase the number of supported targets?
Thank you
 
  • Update

    Experimented with CONFIG_BT_MESH_TX_SEG_MAX and CONFIG_BT_MESH_DFD_SRV_TARGETS_MAX
    Was able to increase CONFIG_BT_MESH_DFD_SRV_TARGETS_MAX to 40 with CONFIG_BT_MESH_TX_SEG_MAX set to 20

    However, new problem
    Image transfer fails with status 3 (internal error)

    Distributor log shows multiple messages " <wrn> bt_mesh_transport: SDU canceled"

    which come from zephyr\subsys\bluetooth\mesh\transport.c 

    ack = net_buf_simple_pull_be32(buf);
    If the ack is not in the buffer this message is printed
    More experimentation shows that any  CONFIG_BT_MESH_TX_SEG_MAX value greater than 10 causes "SDU canceled" message and a failure to transfer the image
    Which means that the CONFIG_BT_MESH_DFD_SRV_TARGETS_MAX can only be 22 - any greater value requires CONFIG_BT_MESH_TX_SEG_MAX  to be increased otherwise there is a build assert  described above. 
     
    Any ideas?
    Thanks

     

  • Hi Andy,

    What you are trying is to try sending a large number of receive info in one shot. This will exceed the maximum size of a mesh packet (segmented packets) hence the build error you saw. With mesh, the strategy is to avoid sending a large packet. It will be redistributed to the whole network and waste a lot or resources of the network (and cause congestion). 
    The better way of doing it is to send smaller number of receive list one by one using Firmware Distribution Receivers Add messages, instead of sending them at once. 

    This is my understanding after taking a look at the doc: 
    https://docs.zephyrproject.org/latest/connectivity/bluetooth/api/mesh/dfu.html#populating-the-distributor-s-receivers-list

  • The reason for the build errors is the assert. The assert occurs if CONFIG_BT_MESH_DFD_SRV_TARGETS_MAX is increased. My goal is to be able to have 50 or more targets. If I increase the number of targets I get the assert. If I increase the CONFIG_BT_MESH_TX_SEG_MAX build succeeds but any CONFIG_BT_MESH_TX_SEG_MAX value greater than 10 results in "SDU canceled" message during transfer and transfer fails.

    So in reality  the max number of targets I can have with CONFIG_BT_MESH_TX_SEG_MAX=10 is 22

    Is there a way to overcome this limit?

    In your internal testing, what was the largest number of targets you were able to send a DFU image to?

     

  • I would need to check with the team. But what's the problem of adding the list by multiple  Firmware Distribution Receivers Add messages ? 


    Don't you agree that it's unrealistic to add 65535 addresses in one mesh message (even though the max number of receiver can be 65535 ? 

  • I don't understand your question.

    My goal is to distribute firmware to 50+ targets.

    Increasing CONFIG_BT_MESH_DFD_SRV_TARGETS_MAX  leads to build asserts

    Increasing CONFIG_BT_MESH_TX_SEG_MAX to anything greater than 10 allows  the build to succeed but distribution fails with "SDU canceled" errors

    How can I achieve my goal? 

    Thanks 

Related