PORTS Forum

Ports and Interfaces => USB => Topic started by: erdmann on June 18, 2015, 07:57:37 am

Title: "bulk only" protocol - CBW and CSW alignment ?
Post by: erdmann on June 18, 2015, 07:57:37 am
The "bulk only spec" states this for CBW and also CSW:
"The CBW shall start on a packet boundary"
"The CSW shall start on a packet boundary"
"Fields appear aligned to byte offsets equal to a multiple of their byte size."

Does this mean the CBW and CSW has to be 4-byte aligned in memory (considering the fact that both structures start with 4-byte length signature fields) ? I don't really see what a "packet boundary" is supposed to mean.

I wonder if data alignment has any repercussion on how the host controller actually sends out this data on the very lowest protocol level ...

Title: Re: "bulk only" protocol - CBW and CSW alignment ?
Post by: Jan Axelson on June 18, 2015, 10:35:18 am
I believe "packet boundary" just means that the host shouldn't fill out an otherwise short packet (transaction) with the start of a new CBW or CSW. In other words, make the previous packet a short packet if necessary and start a new packet with the CBW or CSW.

The bulk only spec defines the starting locations for the field in a CBW or CSW.

So as I see it, "Fields appear aligned to byte offsets equal to a multiple of their byte size." is just describing the structures specified for the CBW and CSW.
Title: Re: "bulk only" protocol - CBW and CSW alignment ?
Post by: erdmann on June 18, 2015, 12:30:01 pm
Ok. Thanks.