• AVR Freaks

Hot!Harmony V3 SDHC and FAT

Author
GARETH_71
Senior Member
  • Total Posts : 164
  • Reward points : 0
  • Joined: 2006/11/18 13:46:50
  • Location: UK
  • Status: offline
2019/09/05 00:20:06 (permalink)
0

Harmony V3 SDHC and FAT

Harmony V3….
 
Since the MZ2064DAG176 is becoming obsolete, I have moved over to the MZ2064DAR176.
However, Harmony v2 does not support this new chip and Harmony v3 does not work.
 
All I am trying to do is use SDHC with a FAT file system.
 
So, I have created a new project. (There are no app examples, the only SDHC/FAT example uses a crypto chip which cannot be undone to non crypto!).
 
It is a bare minimum project with no RTOS and I used the configurator to make it.
 
First of all, the Harmony Configurator does not enable REF4CLK (which the data sheet says is required for SDHC), and now that is enabled manually, the SDHC registers are accepting the config data generated by the configurator tool.
  
However, two days on this, and I cannot get past this line of code:
 
if(SYS_FS_Mount(SDCARD_DEV_NAME, SDCARD_MOUNT_NAME, FAT, 0, NULL) != 0)
 
It always fails and the reason seems to be that the file sys is not ready, however when I run this line of code in the init:
 
    /*** File System Service Initialization Code ***/
    SYS_FS_Initialize( (const void *) sysFSInit );
 
It comes back as a success.
 
 
NOTE that as per the errata, I have added this line of code:
 
SDHCCON1bits.CDSSEL = 1;        //Errata workaround - Gareth
 
Although it fails to work regardless.
 
I have hard tied the CD line to ground (Vss)
 
Anyone had similar issues? Or have any ideas?
#1

6 Replies Related Threads

    optimus_jack
    Starting Member
    • Total Posts : 54
    • Reward points : 0
    • Joined: 2017/02/16 03:02:47
    • Location: 0
    • Status: offline
    Re: Harmony V3 SDHC and FAT 2019/09/05 02:16:15 (permalink)
    0
    Hi Gareth_71,
     
     
    GARETH_71
    First of all, the Harmony Configurator does not enable REF4CLK (which the data sheet says is required for SDHC), and now that is enabled manually, the SDHC registers are accepting the config data generated by the configurator tool.
     

        This is expected behavior. User need to configure REFCLK for the peripherals being used. MHC doe not autoconfigure the REFCLKs
     
     
    GARETH_71
    if(SYS_FS_Mount(SDCARD_DEV_NAME, SDCARD_MOUNT_NAME, FAT, 0, NULL) != 0)
     
    It always fails and the reason seems to be that the file sys is not ready
     

        What do you mean when you say sys fs is not ready? can you provide some more information?
    Also you can check through debugging if the file system is procedding ahead of the below line where it checks for the media status. This indicates whether the media is attached or not.
     
    File sys_fs_media_manager.c:1575
     
    1. What is the Harmony 3 version you are using?
    2. You can launch MHC for harmony_3\core\apps\fs\sdmmc_fat\firmware\pic32mz_das_sk.X application and check configuration for (SDMMC driver, SDHC, Clock, File System). There should not be any difference in these configuration apart from PIN's if any between DAS169 and DAR176

    Attached Image(s)

    #2
    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 FAT 2019/09/09 02:55:48 (permalink)
    0
    optimus_jack
    Hi Gareth_71,
     
     
    GARETH_71
    First of all, the Harmony Configurator does not enable REF4CLK (which the data sheet says is required for SDHC), and now that is enabled manually, the SDHC registers are accepting the config data generated by the configurator tool.
     

        This is expected behavior. User need to configure REFCLK for the peripherals being used. MHC doe not autoconfigure the REFCLKs
     

     
    Okay, many thanks. I just wonder though, what else needs to be configured. If there is documentation about this, I cannot find it. One would think that as the configurator has red box for required modules etc, you would think that would be a full list of requirements. Anyway, ref clk configured, so all good there, and thank you for your comments. :)
     
     
    optimus_jack
     
    GARETH_71
    if(SYS_FS_Mount(SDCARD_DEV_NAME, SDCARD_MOUNT_NAME, FAT, 0, NULL) != 0)
     
    It always fails and the reason seems to be that the file sys is not ready
     

       What do you mean when you say sys fs is not ready? can you provide some more information?
    Also you can check through debugging if the file system is procedding ahead of the below line where it checks for the media status. This indicates whether the media is attached or not.
     

     
    What I mean is that the error message is that the file sys is not ready.
     
     
    GARETH_71 
    File sys_fs_media_manager.c:1575
     
    1. What is the Harmony 3 version you are using?
    2. You can launch MHC for harmony_3\core\apps\fs\sdmmc_fat\firmware\pic32mz_das_sk.X application and check configuration for (SDMMC driver, SDHC, Clock, File System). There should not be any difference in these configuration apart from PIN's if any between DAS169 and DAR176




    Yes, I did this, and all seemed okay, but when I compile I get a zillion error messages about the crypto ... ?
     
    Any thoughts please? I really need to get SD working...
    post edited by GARETH_71 - 2019/09/09 02:58:09
    #3
    optimus_jack
    Starting Member
    • Total Posts : 54
    • Reward points : 0
    • Joined: 2017/02/16 03:02:47
    • Location: 0
    • Status: offline
    Re: Harmony V3 SDHC and FAT 2019/09/09 22:41:32 (permalink)
    0
    GARETH_71
    Yes, I did this, and all seemed okay, but when I compile I get a zillion error messages about the crypto ... ?
    Any thoughts please? I really need to get SD working...

        Just to be sure, were you able to get the SDHC configurations properly done?
        Regarding to the compilation errors on crypto i am not sure on this.
    Can you please post your project in a zip file so that i can have a look and help you out.
    #4
    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 FAT 2019/09/11 07:01:36 (permalink)
    0
    Hi
     
    No, this is not working yet. Still at the same point. I am waiting for further help.
     
     
    #5
    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 FAT 2019/09/16 00:49:25 (permalink)
    0
    So, regenerating code from MHC3 a few times over, and one of the project generated worked!!!???
    #6
    optimus_jack
    Starting Member
    • Total Posts : 54
    • Reward points : 0
    • Joined: 2017/02/16 03:02:47
    • Location: 0
    • Status: offline
    Re: Harmony V3 SDHC and FAT 2019/09/16 20:09:16 (permalink)
    0
    GARETH_71
    So, regenerating code from MHC3 a few times over, and one of the project generated worked!!!???


    That is strange, Did you get to check what was the difference before and after regenerating?
    #7
    Jump to:
    © 2019 APG vNext Commercial Version 4.5