COAP Block Transfer with 1024 block size does not work

Hi,

I am trying to use CoAP Block Transfer to transfer firmware images from server to nRF5340 custom board. We are using OpenThread library for CoAP.

The block transfer is successful with all block sizes except 1024. In the case of 1024, I can observe in the OpenThread MAC level logs that the Requests are being sent with response in the form : 

MeshForwarder-: Received IPv6 UDP msg, len:1122, chksum:137c, ecn:no, from:0x8800, sec:yes, prio:normal, rss:-39

But the Block Wise Receive Hook function is not being called on block reception, which is not the case for other block sizes. 

Rosh.

Parents
  • Hello,

    Sorry for the late reply.

    What block sizes did you test? Does it work with 1025 and 1023? Do you have an application (preferably client and server) that can reproduce the issue you are seeing? Where does the log come from?

    MeshForwarder-: Received IPv6 UDP msg, len:1122, chksum:137c, ecn:no, from:0x8800, sec:yes, prio:normal, rss:-39

    And does the coap_send_request() (is that the API you are using) return 0 or something else?

    Best regards,

    Edvin

  • Hey Edwin,

    Appreciate the reply. We use OpenThread CoAP API for block transfer since we are doing the communication over Thread. It has the following function 'otCoapSecureSendRequestBlockWise' 

    otError otCoapSecureSendRequestBlockWise(
      otInstance *aInstance,
      otMessage *aMessage,
      otCoapResponseHandler aHandler,
      void *aContext,
      otCoapBlockwiseTransmitHook aTransmitHook,
      otCoapBlockwiseReceiveHook aReceiveHook
    )

    With this function we send the first GET Request to the server. The consecutive requests are handled by the library. For all the other block sizes that we have tested the aReceiveHook function is called on each block's arrival.This is not happening only in the case of 1024. The function otCoapSecureSendRequestBlockWise does not return any error. But CoapResponseHandler returns a timeout error after roughly one minute.

    What block sizes did you test? Does it work with 1025 and 1023?

     We tested using 64, 128, 256 and 512 bytes block sizes. Sizes of the blocks are provided by OpenThread as an Enum.

    typedef enum otCoapBlockSzx
    {
        OT_COAP_OPTION_BLOCK_SZX_16   = 0,
        OT_COAP_OPTION_BLOCK_SZX_32   = 1,
        OT_COAP_OPTION_BLOCK_SZX_64   = 2,
        OT_COAP_OPTION_BLOCK_SZX_128  = 3,
        OT_COAP_OPTION_BLOCK_SZX_256  = 4,
        OT_COAP_OPTION_BLOCK_SZX_512  = 5,
        OT_COAP_OPTION_BLOCK_SZX_1024 = 6
    } otCoapBlockSzx;
    

    The log MeshForwarder-: Received IPv6 UDP msg, len:1122, chksum:137c, ecn:no, from:0x8800, sec:yes, prio:normal, rss:-39 comes when I enable OpenThread logs using the configuration

    # CONFIG_OPENTHREAD_DEBUG=y
    # CONFIG_OPENTHREAD_L2_DEBUG=y
    # CONFIG_OPENTHREAD_LOG_LEVEL_DEBG=y

    Thanks,

    Rosh

  • Hello,

    I understand. Do you have a client and server application that you can zip and upload, so that I can replicate the issue? I need to do so in order to investigate, and perhaps show it to our openthread team.

    Best regards,

    Edvin

Reply Children
Related