Skip to content

Can negotiated MTU w/ MCUMgr params work for serial (uart/usb/shell transport) #73

Description

@JPHutchins

This is not covered by the present integration tests for serial (uart/usb/shell) transport. The optimized parameters are given to the transport on initialization by parsing the FW file name.

line_length, line_buffers, max_smp_encoded_frame_size = map(int, match.groups())

async with SMPClient(
SMPSerialTransport(
max_smp_encoded_frame_size=max_smp_encoded_frame_size,
line_length=line_length,
line_buffers=line_buffers,
),

See the DUT FW files themselves: https://github.com/intercreate/smpclient/tree/main/examples/duts/nrf52840dk_nrf52840/usb

Likewise, the USB transport upload file test is using default values:

async with SMPClient(SMPSerialTransport(), port) as client:

Defaults:

max_smp_encoded_frame_size: int = 256,
line_length: int = 128,
line_buffers: int = 2,

On the other hand, the BLE tests do use the MCUMgr parameters. That works because MTU is given by the BLE MTU, the the mcumgr params give the max frame size, allowing for efficient fragmentation.

What's missing with the serial transport is knowledge of the "line_length", AKA MTU. mcumgr params do not provide the MTU.

This is mostly relevant for USB transports where uploads and downloads can be very slow if the buffer sizes are smaller than what the FW provides. Like 9KBps vs 50KBps with correct MTUs.

CC @aldenhaase

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdocumentationImprovements or additions to documentationenhancementNew feature or requesthelp wantedExtra attention is needed

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions