PORTS Forum
Ports and Interfaces => USB => Topic started 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
-
Yes, it's how the host matches a CBW with the CSW the device sends in response.
-
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
-
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.
-
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.
-
Thank you Jan, Barry !
I will get back to you with the implementation results.
Regards,
Nik
-
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
-
Thanks tsybezoff !