I am trying to build an embedded system based on CANOpen principles. I constructed most of the object dictionary. I am mainly communicating with SDO (mostly expedited transfer). I have used CANOpen once before as a master (so my limits were clear), however I am in the slave side now.
Recently I am requested that the software of my device is to be updated over the same protocol. In order to do this, I leaned towards SDO block transfer, but I cannot figure out how it is done; what is the maximum size that can be transferred over SDO block transfer?
In SDO block transfer, as defined in CiA301 standard.
size : 4 bytes addressing = 4GB
However considering block and seq:
1 < blksize < 128
0 < seqno < 128
Each segment consists 7 bytes of data
1 block: blksize (127) * seqno(0 to 127: 128) * 7 = ~111KB
In contrast, in the same initiation, we set an m value (consisting of index and sub-index).
1 sub-index: 4 bytes
1 index: ~256(1 byte addressing)* 4 = ~1KB
Object dictionary: ~64K(2 bytes addressing) * ~1KB = ~64MB
Which one (or none) is true? I am confused here.
Disclaimer: Well, I don't have any experience with block transfers, but I have implemented expedited and segmented transfers in my projects. I have read CiA 301 and below are what I understand from the documentation:
First, object dictionary entries have no size limitations. They can contain binary blobs (see DOMAIN type). I guess 4 GB limit of the block transfer probably also limits the size of a object dictionary entry in practice. A block transfer is targeted to a single object dictionary entry, identified by an index - subindex pair.
Block transfers can consist of multiple sub-blocks. Each sub-block consists of multiple segments, numbered from 1 to n (max 127), which are also the sequence numbers. The SDO server (slave device in most cases) decides the size of each sub-block at the initiation and after each sub-block transfer. Each segment can contain 1-7 bytes of data.
Number of sub-blocks are not limited, you only have 127 number of segments limitation within each sub-block. So, SDO block transfer is able to transfer up to 4 GB of data.