This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

RL-ARM mass storage sample and CD-ROM

Hi my friends!

I've used RL-ARM mass storage code from sample codes of KEIL 4.03 on AT91SAM7S256.
when I attach it to PC , the system recognizes it as a flash disk, correctly;

now I want to change it to apear as a CD-ROM in windows.

I want to know any changes in code.

can anyone help me?

thanks for your help!

Parents
  • We could get our CD-ROM to work!

    I post the modifications we made to your soluton in order to help others who might read this thread later.

    First:
    I changed the Read TOC function so that it respond to all other read TOC formats too.
    It is a shame! but I responded all Formats with the same data, Like another USB CD-ROM I was monitoring its commands.

    well, my analisys is that we had to make a proper response to any Read TOC which this code do not.

    Also the '1' at second if is a logical error.

    void MSC_ReadTOC (void) {
      if (  ((CBW.CB[1] & 0x02) == 0)     // MSF field
         && ((CBW.CB[2] & 0x0F) == 0)     // Format field
         )
      {
        memcpy( BulkBuf, SCSI_TOC_MSF0, sizeof(SCSI_TOC_MSF0) );
        BulkLen = sizeof(SCSI_TOC_MSF0);
        DataInTransfer();
      }
    
      if (  ((CBW.CB[1] & 0x02) == 1)     // MSF field <-----===== Change '1' to '2'
         && ((CBW.CB[2] & 0x0F) == 0)     // Format field
         )
      {
        memcpy( BulkBuf, SCSI_TOC_MSF1, sizeof(SCSI_TOC_MSF1) );
        BulkLen = sizeof(SCSI_TOC_MSF1);
        DataInTransfer();
      }
    
    //<-----===== Put the code to handle other formats here, even if you going to fail it(i did not test the fail myself)
    
    }
    

    After this the CD can be succecfully recognized in windows, but it has two halts(1 min each).
    These halts happen after failing "Read Disc Information" and "Get Configuration Commands" which was removed after implementing these commads based on MMC commands reffrence from T10.org

Reply
  • We could get our CD-ROM to work!

    I post the modifications we made to your soluton in order to help others who might read this thread later.

    First:
    I changed the Read TOC function so that it respond to all other read TOC formats too.
    It is a shame! but I responded all Formats with the same data, Like another USB CD-ROM I was monitoring its commands.

    well, my analisys is that we had to make a proper response to any Read TOC which this code do not.

    Also the '1' at second if is a logical error.

    void MSC_ReadTOC (void) {
      if (  ((CBW.CB[1] & 0x02) == 0)     // MSF field
         && ((CBW.CB[2] & 0x0F) == 0)     // Format field
         )
      {
        memcpy( BulkBuf, SCSI_TOC_MSF0, sizeof(SCSI_TOC_MSF0) );
        BulkLen = sizeof(SCSI_TOC_MSF0);
        DataInTransfer();
      }
    
      if (  ((CBW.CB[1] & 0x02) == 1)     // MSF field <-----===== Change '1' to '2'
         && ((CBW.CB[2] & 0x0F) == 0)     // Format field
         )
      {
        memcpy( BulkBuf, SCSI_TOC_MSF1, sizeof(SCSI_TOC_MSF1) );
        BulkLen = sizeof(SCSI_TOC_MSF1);
        DataInTransfer();
      }
    
    //<-----===== Put the code to handle other formats here, even if you going to fail it(i did not test the fail myself)
    
    }
    

    After this the CD can be succecfully recognized in windows, but it has two halts(1 min each).
    These halts happen after failing "Read Disc Information" and "Get Configuration Commands" which was removed after implementing these commads based on MMC commands reffrence from T10.org

Children
No data