• AVR Freaks

Cannot get Harmony v2.06 SD Card driver working on a PIC32MZ2064DAH176 processor...

Author
tporter905
Starting Member
  • Total Posts : 35
  • Reward points : 0
  • Joined: 2010/12/06 14:13:54
  • Location: 0
  • Status: offline
2020/05/20 19:36:28 (permalink)
0

Cannot get Harmony v2.06 SD Card driver working on a PIC32MZ2064DAH176 processor...

Hi,
 
I am trying to get this driver working, when I insert the SD card, it initializes and gets to the point where it checks the status continually for a detach. However at this point it starts toggling back and forth between attached and detached, each time it goes through the whole SD card initialization, then detects a detach. It is really frustrating, any ideas as to why???
 
Thanks,
 
Tom
 
#1

5 Replies Related Threads

    optimus_jack
    Junior Member
    • Total Posts : 78
    • Reward points : 0
    • Joined: 2017/02/16 03:02:47
    • Location: 0
    • Status: offline
    Re: Cannot get Harmony v2.06 SD Card driver working on a PIC32MZ2064DAH176 processor... 2020/05/20 19:57:47 (permalink)
    0
    Hi,
    If you are ok to look at Harmony 3 then you can try to get the below applications up on DAH
    Driver based --> https://github.com/Microchip-MPLAB-Harmony/core/tree/master/apps/driver/sdmmc/async/sdmmc_read_write/firmware/pic32mz_das_sk.X
     
    File system based --> https://github.com/Microc.../fs/sdmmc_fat/firmware
    #2
    tporter905
    Starting Member
    • Total Posts : 35
    • Reward points : 0
    • Joined: 2010/12/06 14:13:54
    • Location: 0
    • Status: offline
    Re: Cannot get Harmony v2.06 SD Card driver working on a PIC32MZ2064DAH176 processor... 2020/05/21 07:10:55 (permalink)
    0
    Can I use the harmony 3 SD driver on a platform already developed for Harmony 2?
    #3
    Paul PortSol
    Super Member
    • Total Posts : 611
    • Reward points : 0
    • Joined: 2015/07/03 11:52:03
    • Location: Newfoundland, Canada
    • Status: offline
    Re: Cannot get Harmony v2.06 SD Card driver working on a PIC32MZ2064DAH176 processor... 2020/05/21 08:48:02 (permalink)
    0
    I believe the SD driver shares code with the USB MSD, so looking at bugs related to that might help.
    Some USB MSD with Memory Stick issues were:
    - Need big Cap on 5V, like 150uF 6V ceramic (otherwise the dip when connecting some sticks/cards may mess things up).
    - Need lots Heap, like 10000 defined in MHC (100's heap used in demo/sample code gave unreliable operation).
    - Some people found HarmonyV2.04 worked better than HarmonyV2.06 for USB, although I though I saw someone post a patch for HarmonyV206 USB in the past month or two.
    - If you use a TPS2051 to power the card watch that the signals have correct polarity, as the suffix on TPS2051 part number affects the Enable & Fault signals' active levels.
    - Put a 100ohm between the VBUS on the connector and the VBUS_Monitor on the PIC32MZ (possibly only for USB).
    - Careful of the definition of pins in MHC, even unused pins may need to be defined for USB/SD for correct operation of the USB/SD module. Check the fine print in the datasheet, check IC errata, and check connections of PIC signals on demo boards.
     
    (You'll have to dig in forum to find more)
     
    Paul
    #4
    tporter905
    Starting Member
    • Total Posts : 35
    • Reward points : 0
    • Joined: 2010/12/06 14:13:54
    • Location: 0
    • Status: offline
    Re: Cannot get Harmony v2.06 SD Card driver working on a PIC32MZ2064DAH176 processor... 2020/05/25 07:33:26 (permalink)
    0
    Paul,
     
    Thank you for the reply,  
     
    We don't have any issues with our USB port, it works fine.
     
    We have mapped the card detect, goes low when card is inserted. The write protect line is not connected, was left at default which looks to be A0, we don't have anything connected to that PIN so should not be toggling or anything on us. 
     
    We don’t provide 5V power on our USB line, so there is no capacitance on there except 10nF to chassis for filtering. 
     
    On the VBUS monitor, there is no 100ohms resistor , it is just connected straight to VBUS.  There is no recommendation to do so in the datasheet. However we don't have any issues with the USB port. 
     
    We have used the SD card library before on a PIC24 based product, used the same circuit that one does, it works without any issues so we are wondering why the PIC32MZ has an issue...
     
    We are also using the Aria library, which gives us a heap of 19368, tried going to 30,000 and no luck.
     
    Still seems to do the annoying toggle...
     
    Thanks,
     
    Tom
    #5
    Paul PortSol
    Super Member
    • Total Posts : 611
    • Reward points : 0
    • Joined: 2015/07/03 11:52:03
    • Location: Newfoundland, Canada
    • Status: offline
    Re: Cannot get Harmony v2.06 SD Card driver working on a PIC32MZ2064DAH176 processor... 2020/05/25 08:02:02 (permalink)
    0
    Have you tried the MHC "Generate application code" to create a sample project that reads/writes SDCard?
    - Start a fresh project, then MHC - Application Config - Generate App Code -  System Services - Use File System - SDCard Read/Write
    That might give you a hint as to what's needed.
     
    - Do be careful as it might add a BSP.
    - See these older notes: MHC_CreatingProjectWithoutBSP_v00PR.txt
    - I haven't done SDCard, but there have been others doing SDCard so there might be older posts that can help. To search older posts change the date range at bottom of page after doing a search.
     
    Paul
     
    #6
    Jump to:
    © 2020 APG vNext Commercial Version 4.5