• AVR Freaks

Hot!Harmony V3 SDHC and USB MSD

Author
GARETH_71
Senior Member
  • Total Posts : 164
  • Reward points : 0
  • Joined: 2006/11/18 13:46:50
  • Location: UK
  • Status: offline
2019/09/14 03:41:39 (permalink)
0

Harmony V3 SDHC and USB MSD

I am trying to use the MHC3 to create a project to use SDHC as a USB MSD - and after two days I cannot even get the generated code to compile - let alone get it working.
 
It seems that MHC generates code for MSD internal using internal program flash and thereby expect to call functions appropiate to that, but as I have chosen SDHC as the source in MHC, it fails.
 
Has anyone actually achieved MSD with SDHC?
 
Rather than post code, simply create a super simple Harmony project and use MHC to add USB Deivce MSD and SDHC - it does not work!
 
 
#1

1 Reply Related Threads

    GARETH_71
    Senior Member
    • Total Posts : 164
    • Reward points : 0
    • Joined: 2006/11/18 13:46:50
    • Location: UK
    • Status: offline
    Re: Harmony V3 SDHC and USB MSD 2019/09/16 00:46:56 (permalink)
    0
    Hi
     
    Okay, fixed.
     
    FYI:
    To get MHC3 to generate working MSD code, you need to do the following:
     
    1. Turn ON the REFCLK4 output (REFO4CONSET = 0x00008000;)
    2. Change the usb_device_init_data.c -> msdMediaInit0[1] function to:
     
    /*******************************************
    * MSD Function Driver initialization
    *******************************************/
    USB_DEVICE_MSD_MEDIA_INIT_DATA USB_ALIGN msdMediaInit0[1] =
    {
    {
    DRV_SDMMC_INDEX_0,
    512,
    sectorBuffer,
    NULL,
    0,
    {
    0x00, // peripheral device is connected, direct access block device
    0x80, // removable
    0x04, // version = 00=> does not conform to any standard, 4=> SPC-2
    0x02, // response is in format specified by SPC-2
    0x1F, // additional length
    0x00, // sccs etc.
    0x00, // bque=1 and cmdque=0,indicates simple queuing 00 is obsolete,
    // but as in case of other device, we are just using 00
    0x00, // 00 obsolete, 0x80 for basic task queuing
    {
    'M','i','c','r','o','c','h','p'
    },
    {
    'M','a','s','s',' ','S','t','o','r','a','g','e',' ',' ',' ',' '
    },
    {
    '0','0','0','1'
    }
    },
    {
    DRV_SDMMC_IsAttached,
    DRV_SDMMC_Open,
    DRV_SDMMC_Close,
    DRV_SDMMC_GeometryGet,
    DRV_SDMMC_AsyncRead,
    DRV_SDMMC_AsyncWrite,
    DRV_SDMMC_IsWriteProtected,
    DRV_SDMMC_EventHandlerSet,
    NULL
    }
    },



    };
     
    Hey Presto! 5MB/s write speed and >7MB/s read speed.
     
     
    #2
    Jump to:
    © 2019 APG vNext Commercial Version 4.5