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
 
Parents Reply Children
  • 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 

  • Hi Andy, 

    Happy New Year ! 
    If you want to set the DFU distributor to distribute firmware to for example 60 targets, you can send 3 Firmware Distribution Receivers Add messages , each contain 20 targets. 
    The targets will be added to the list and you will have all 60 targets in the list. 

    You don't have to send one Firmware Distribution Receivers Add message with all 60 targets. 

    I believe that what the documentation suggests: 

    Before the Distributor can start distributing the firmware image, it needs a list of Target nodes to send the image to. The Initiator gets the full list of Target nodes either by querying the potential targets directly, or through some external authority. The Initiator uses this information to populate the Distributor’s receivers list with the address and relevant firmware image index of each Target node. The Initiator may send one or more Firmware Distribution Receivers Add messages to build the Distributor’s receivers list, and a Firmware Distribution Receivers Delete All message to clear it.

  • I assume by "send 3 Firmware distribution Receivers Add messages" you mean sending "mesh models dfd receivers-add" command 3 times with a different set of addresses? If that's the case - it did not work

    Here is what I did. My CONFIG_BT_MESH_DFD_SRV_TARGETS_MAX  is set to 20


    mesh models dfd receivers-add 1,0;2,0;3,0;4,0;5,0;6,0;7,0;8,0;9,0;10,0;11,0;12,0;13,0;14,0;15,0;16,0;17,0;18,0;19,0;20,0
    mesh models dfd receivers-get 0 100
    {
    "target_cnt": 20,
    "targets": {
    "0": { "blob_addr": 1, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "1": { "blob_addr": 2, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "2": { "blob_addr": 3, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "3": { "blob_addr": 4, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "4": { "blob_addr": 5, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "5": { "blob_addr": 6, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "6": { "blob_addr": 7, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "7": { "blob_addr": 8, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "8": { "blob_addr": 9, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "9": { "blob_addr": 10, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "10": { "blob_addr": 11, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "11": { "blob_addr": 12, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "12": { "blob_addr": 13, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "13": { "blob_addr": 14, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "14": { "blob_addr": 15, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "15": { "blob_addr": 16, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "16": { "blob_addr": 17, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "17": { "blob_addr": 18, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "18": { "blob_addr": 19, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "19": { "blob_addr": 20, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 }
    }
    }

    mesh models dfd receivers-add 21,0;22,0;23,0;24,0;25,0;26,0;27,0;28,0;29,0;30,0;31,0;32,0;33,0;34,0;35,0;36,0;37,0;38,0;39,0;40,0

    mesh models dfd receivers-get 0 100
    {
    "target_cnt": 20,
    "targets": {
    "0": { "blob_addr": 1, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "1": { "blob_addr": 2, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "2": { "blob_addr": 3, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "3": { "blob_addr": 4, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "4": { "blob_addr": 5, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "5": { "blob_addr": 6, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "6": { "blob_addr": 7, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "7": { "blob_addr": 8, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "8": { "blob_addr": 9, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "9": { "blob_addr": 10, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "10": { "blob_addr": 11, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "11": { "blob_addr": 12, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "12": { "blob_addr": 13, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "13": { "blob_addr": 14, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "14": { "blob_addr": 15, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "15": { "blob_addr": 16, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "16": { "blob_addr": 17, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "17": { "blob_addr": 18, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "18": { "blob_addr": 19, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 },
    "19": { "blob_addr": 20, "phase": 0, "status": 0, "blob_status": 0, "progress": 0, "img_idx": 0 }
    }
    }

    As you can see devices with addresses 20-40 were not added

    That makes sense as CONFIG_BT_MESH_DFD_SRV_TARGETS_MAX  is 20

    Then I don't understand what you mean by "send 3 Firmware distribution Receivers Add messages". How do I do that?
    Thanks

Related