e-music
Member level 5
I'm trying to implement a SCSI target device (MSD) around a legacy SCSI Protocol Controller (SPC) and an embedded ARM Cortex-M uC. My SPC has all the required logic to interface directly with the SCSI bus and it also integrates a phase sequencer that can handle all SCSI phases at hardware level.
So far, I've been able to interface the chip with my uC, perform writes/reads to/from any of its internal registers, including the 16-byte FIFO.
HOwever, I'm struggling to understand how to process an incoming CDB, say the INQUIRY Command, how to return the INQUIRY DATA (inquiry response bytes stored in an array), and how/when the initiator gets the details about the medium (LUN) connected? I know that it has to send a REQUEST_SENSE command to the target, but I just don't understand when and during which SCSI phase?
My application starts by enabling selection and waits until an interrupt that indicates successful selection by an initiator. After which, the Identify message, bus ID, along with the full CDB are in the FIFO. I'm stuck here. Just don't know what to do next?
I tried to send the INQUIRY_RESPONSE bytes I had in the array back to the initiator but not sure how to verify whether the initiator received them and how to proceed from there?
By the way, the initiator responds when I send a "DISCONNECT_SEQUENCE" command by getting back to the BUS-FREE phase and releasing the bus.
If anyone has some experience working with SCSI Protocol Controllers, I would be glad to provide more info about the SPC used and any other details that might help.
Thank you!
So far, I've been able to interface the chip with my uC, perform writes/reads to/from any of its internal registers, including the 16-byte FIFO.
HOwever, I'm struggling to understand how to process an incoming CDB, say the INQUIRY Command, how to return the INQUIRY DATA (inquiry response bytes stored in an array), and how/when the initiator gets the details about the medium (LUN) connected? I know that it has to send a REQUEST_SENSE command to the target, but I just don't understand when and during which SCSI phase?
My application starts by enabling selection and waits until an interrupt that indicates successful selection by an initiator. After which, the Identify message, bus ID, along with the full CDB are in the FIFO. I'm stuck here. Just don't know what to do next?
I tried to send the INQUIRY_RESPONSE bytes I had in the array back to the initiator but not sure how to verify whether the initiator received them and how to proceed from there?
By the way, the initiator responds when I send a "DISCONNECT_SEQUENCE" command by getting back to the BUS-FREE phase and releasing the bus.
If anyone has some experience working with SCSI Protocol Controllers, I would be glad to provide more info about the SPC used and any other details that might help.
Thank you!