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
 
  • Hi Andy, 

    My opinion is that the build assert i pointed in my last reply need to be removed or change to something else. 


    I assume issue #2 and #3 you mentioned are also related to that build assert, correct ? 

    I don't think CONFIG_BT_MESH_TX_SEG_MAX  should be increased to a large number .The number of segment in a message should be kept low they use a lot of resource and can reduce the throughput of the network a lot. 

  • Only #2 is related to build asserts. 
    #3 is the "SDU canceled" error when CONFIG_BT_MESH_TX_SEG_MAX > 10 regardless of how many targets in the list.
    I commented out asserts I was getting for "Receivers List" and "Receivers add" messages  in zephyr\subsys\bluetooth\mesh\dfd_srv.c and was able to build successfully with CONFIG_BT_MESH_DFD_SRV_TARGETS_MAX  set to 100 and  CONFIG_BT_MESH_TX_SEG_MAX set to 10
    Distribution was successful without "SDU canceled" messages

    Looks like we solved the problem!
    Would be great to get that fix into the next SDK release
    Thank you for help!

  • Hi Andy, 


    I agree that that build assert should be removed. I was checking with the team and it seems that it's not mandated by the spec. We are continuing the investigation on why it's added in the first place. I suspect that we didn't think of using multiple  dfd receivers-get to get the list instead of using one single command to get the list. 

    The team has acknowledged this issue and we will have a fix. Thanks for the report. 

Related