PORTS Forum

Ports and Interfaces => USB => Topic started by: Nik on January 23, 2014, 11:33:11 am

Title: Command Block Tag (dCBWTag)
Post by: Nik on January 23, 2014, 11:33:11 am
Hello all,

I am writing a USB Host MSD stack and has to implement the Bulk-Only-Transport protocol.

I am confused about the Command Block Tag (dCBWTag) value assignment. What should be the standard to be followed ?
Do I need to assign different value to every single packet ?

Regards,
Nik
Title: Re: Command Block Tag (dCBWTag)
Post by: Jan Axelson on January 23, 2014, 12:43:33 pm
Yes, it's how the host matches a CBW with the CSW the device sends in response.
Title: Re: Command Block Tag (dCBWTag)
Post by: Nik on January 23, 2014, 01:05:52 pm
Thank you so much for the response Jan.

Just to be clear, here is what I understood :
CBW no.1 - dCBWTag1
CBW no.2 - dCBWTag2
CBW no.3 - dCBWTag3
.                .
.                .
.                .
CBW no.N -  dCBWTagN

Is that correct ? Then how shall I select the value of the tag ?


Appreciate your time.

Regards,
Nik
Title: Re: Command Block Tag (dCBWTag)
Post by: Jan Axelson on January 23, 2014, 01:44:03 pm
I think the values can be anything as long as they're unique. Once a value is no longer in use, you should be able to reuse it.
Title: Re: Command Block Tag (dCBWTag)
Post by: Barry Twycross on January 23, 2014, 02:05:51 pm
It can be anything.

It doesn't even have to be unique, though it makes more sense if its unique. Just counting works perfectly well for several implimentations.
Title: Re: Command Block Tag (dCBWTag)
Post by: Nik on January 23, 2014, 02:32:47 pm
Thank you Jan, Barry !

I will get back to you with the implementation results.


Regards,
Nik
Title: Re: Command Block Tag (dCBWTag)
Post by: tsybezoff on January 29, 2014, 02:44:06 am
you can use that

#define TAG_REQ_SENSE                       0x41444903
#define TAG_READ10                             0x41444928
#define TAG_WRITE10                           0x4144492A
#define TAG_INQUIRY                            0x41444912
#define TAG_TEST_UNIT_READY              0x41444900
#define TAG_READ_FORMAT_CAPACITIES  0x41444923
#define TAG_READ_CAPACITY                  0x41444925
#define TAG_MODE_SENSE6                     0x4144491A
#define TAG_START_STOP                       0x4144491B
#define TAG_MEDIUM_REMOVAL          0x4144491E
Title: Re: Command Block Tag (dCBWTag)
Post by: Nik on January 29, 2014, 10:45:01 am
Thanks tsybezoff !