Skip to content

Problem with SDO Block Transfer (+workaround) #618

@DrJMH

Description

@DrJMH

Hi, if i try a SDO download with block transfer like in the docs, but without crc, i.e.

FIRMWARE_PATH = '/path/to/firmware.bin'
FILESIZE = os.path.getsize(FIRMWARE_PATH)

with open(FIRMWARE_PATH, 'rb') as infile,
        node.sdo['Firmware'].open('wb', size=FILESIZE, block_transfer=True, request_crc_support=False) as outfile:

  # Iteratively transfer data without having to read all into memory
  while True:
      data = infile.read(1024)
      if not data:
          break
      outfile.write(data)

the transfer ends after one or two sub blocks. The last SDO from the client has the invalid payload=DD 00 00 00 00 00 00 00. The transfer is working without the 1024 chunk. Just use data = infile.read() or a chunk size of 7*1024.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions