• AVR Freaks

How to clone a Harmony project and upgrade it to the latest Harmony version

Author
BillP
Super Member
  • Total Posts : 325
  • Reward points : 0
  • Joined: 2014/09/28 07:53:35
  • Location: CA
  • Status: offline
2016/07/30 09:02:22 (permalink)
5 (8)

How to clone a Harmony project and upgrade it to the latest Harmony version

In a previous post I was directed to other posts that allowed me to figure out how to clone a previous project and upgrade it to the latest versions of Harmony and MHC.  This is especially useful to me as I now have projects spread out over V1_06, V1_07 and now V1_08_01.  
 
Here are the steps that will copy a Harmony project and update it to the latest versions of Harmony and MHC.
 
Assume your project is named “oldname” and you want to copy it, rename it to “newname”  and update newname to the latest version of Harmony and MHC.
 
1.  Copy the folder named “oldname” from Microchip/V1_xx/apps (a previous Harmony version directory) to Microchip/V1_08_01/apps directory (the latest Harmony version).  Rename the “oldname” directory to “newname”.
 
2.  Start MPLAB IDE and select the Open Project. . .  Go to Microchip/V1_08_01/apps/newname/firmware/oldname.X.  Click on “Open Project”.
 
3.  Right click on the “oldname” project in the Projects window and select “Rename..”.  Check the “Also rename Project folder”, enter the new name (i.e. “newname”). Click Rename.  Right click on the newname project and click on “Set as Main Project”.
 
4.  In another window, go to Microchip/V1_08_01/apps/newname/firmware/  and delete the “oldname”.hconfig file.
 
5.  Click on tools>embedded>MPLAB Harmony Configurator.  Verify the pathname in the Open Configuration window shows the correct Harmony version, click OK.  [If not, select the left-most icon in the MHC Configurator toolbar to browse to the correct configuration file.]
 
6.  Click on the “code” icon on the MHC Harmony Configurator toolbar to remake the library.  There should be no errors (assuming the oldname project had no errors).
 
7  Click on Debug Main Project to recompile and reload the “new” project.  There should be no errors.  
 
You have now cloned the old project AND upgraded it with the latest version of Harmony.  This is certainly easier than creating a new project from scratch every time you want to “fork” a project.
 
 
 
 
#1

18 Replies Related Threads

    RISC
    Super Member
    • Total Posts : 5376
    • Reward points : 0
    • Status: offline
    Re: How to clone a Harmony project and upgrade it to the latest Harmony version 2016/07/31 09:10:02 (permalink)
    0
    Hi,
    Microchip developer help website is dedicated to online support. There are tutorials and step by step which explain how to do just what you are looking for. Start here : http://microchip.wikidot.com/harmony:start
    Regards
    #2
    BillP
    Super Member
    • Total Posts : 325
    • Reward points : 0
    • Joined: 2014/09/28 07:53:35
    • Location: CA
    • Status: offline
    Re: How to clone a Harmony project and upgrade it to the latest Harmony version 2016/07/31 09:47:51 (permalink)
    0
    Maybe I am dense here, but where in the wikidot website do I find the instructions to do what I put in my post?  The reason I wrote the post was because I could not find the information in all these forums and training websites. In the forum there are a number of posts asking the same questions.  Am I missing something here?
    #3
    NKurzman
    A Guy on the Net
    • Total Posts : 17713
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: How to clone a Harmony project and upgrade it to the latest Harmony version 2016/07/31 12:45:37 (permalink)
    5 (1)
    You are missing that Harmony has a huge a amount of poorly organized information associated with it. With a lot of subjects missing.
    #4
    mrpackethead
    packet mangler
    • Total Posts : 967
    • Reward points : 0
    • Joined: 2007/04/01 23:33:39
    • Location: 0
    • Status: offline
    Re: How to clone a Harmony project and upgrade it to the latest Harmony version 2016/08/04 17:16:00 (permalink)
    0
    and also missing that the folks at Microchip are making the assumption that we understand the stuff they are writing when lots of its left out.
     
    #5
    mrpackethead
    packet mangler
    • Total Posts : 967
    • Reward points : 0
    • Joined: 2007/04/01 23:33:39
    • Location: 0
    • Status: offline
    Re: How to clone a Harmony project and upgrade it to the latest Harmony version 2016/08/04 17:17:40 (permalink)
    0
    Bill thanks a lot for your post, its really helpful.
     
     
    #6
    twelve12pm
    Overseer
    • Total Posts : 325
    • Reward points : 0
    • Joined: 2012/04/09 17:27:24
    • Location: 0
    • Status: offline
    Re: How to clone a Harmony project and upgrade it to the latest Harmony version 2016/11/18 14:00:34 (permalink)
    4.5 (2)
    The source code is the best documentation of the source code.
    #7
    yschen168
    New Member
    • Total Posts : 15
    • Reward points : 0
    • Joined: 2012/06/23 05:04:29
    • Location: 0
    • Status: offline
    Re: How to clone a Harmony project and upgrade it to the latest Harmony version 2017/01/04 00:48:17 (permalink)
    #8
    amuranyi
    Starting Member
    • Total Posts : 31
    • Reward points : 0
    • Joined: 2014/08/18 15:04:33
    • Location: 0
    • Status: offline
    Re: How to clone a Harmony project and upgrade it to the latest Harmony version 2017/02/26 11:42:38 (permalink)
    5 (1)
    Thanks BillP for the post and others for the additional information.
     
    Unfortunately this will only work if Microchip does not change their code between different versions of Harmony.
    I just tried this with my modified version of the "wifi_easy_configuration" project.  My modifications only consisted
    of changes to accommodate my own custom designed board (number of LEDs, switches, etc.), but nothing else.
    I am using the MRF24WN WiFi module.  I made my "clone" of the original project in Harmony v2.01b and I wanted
    to port it to v2.02.00b.  After I went through your instructions, it did not compile because Microchip removed
    "INITSTATUS_GET" from the "IWPRIV_CMD" enumeration, and the code in app.c will not work without it:
     
    iwpriv_get(INITSTATUS_GET, &s_app_get_param);
    if (s_app_get_param.driverStatus.initStatus == IWPRIV_READY) {
     
    Now I have to go through the fun of figuring out how they changed the corresponding code in the corresponding
    demo project in Harmony v2.02.00b and copy that into my project that I am trying to "upgrade" to v2.02.00b.
     
    Now that I am in the "venting mode", I want to mention that "requiring" that user projects should be placed in
    the installation area (under INSTALLDIR/apps) is one of the worst things that Microchip could do.  It sort of implies
    that when I uninstall an older version of Harmony I don't mind getting rid of my own projects too, unless I go
    through the nightmarish steps of "cloning" all my projects to the newer version of Harmony every time a release
    comes out.  This is like putting my designs into the "Windows" or "Program Files" directory.  Who in their
    right mind would do that?  I wish Microchip would find a better way to keep the user projects separate from the
    installation area of their tools, and make it easier to migrate the projects between the different versions of their
    tools (Harmony in particular).  I hope they are listening...
     
    Thanks,
     
    Arpad
    ============
    #9
    NKurzman
    A Guy on the Net
    • Total Posts : 17713
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: How to clone a Harmony project and upgrade it to the latest Harmony version 2017/02/26 12:09:41 (permalink)
    3 (1)
    Your issue with them wanting you to pay your apps in their folder was pointed out to the before. They still think it is the best solution for their problems.
    But note it is not required. You can put it on the same drive. There appear to be issues with having it on a different or network drive.
    #10
    amuranyi
    Starting Member
    • Total Posts : 31
    • Reward points : 0
    • Joined: 2014/08/18 15:04:33
    • Location: 0
    • Status: offline
    Re: How to clone a Harmony project and upgrade it to the latest Harmony version 2017/02/26 12:42:08 (permalink)
    5 (1)
    Note that I put the word "required" in quotes, indicating that I know that it is really not a requirement, even
    though many of the discussions/instructions seem to want us to believe that.  In fact, I have placed my project(s)
    in my own directory structure, and I got them to work that way, but it seems that the process of porting to a
    different Harmony version is a little more challenging that way.  (I am still learning)...  Thanks for pointing out
    that it should be on the same drive.  I didn't know that...
     
    Thanks,
     
    Arpad
    ========
    #11
    NKurzman
    A Guy on the Net
    • Total Posts : 17713
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: How to clone a Harmony project and upgrade it to the latest Harmony version 2017/02/26 14:08:46 (permalink)
    0
    The porting to the next version issue is an on going problem.
    Between bug fixes, renamed variables, an plain redos, migration version to version is work.
    The needed changes are never documented.
    One suggestion is to compare sample apps using similar components to to the previous version, and look for the needed changes.
    #12
    amuranyi
    Starting Member
    • Total Posts : 31
    • Reward points : 0
    • Joined: 2014/08/18 15:04:33
    • Location: 0
    • Status: offline
    Re: How to clone a Harmony project and upgrade it to the latest Harmony version 2017/02/26 14:36:12 (permalink)
    0
    Yes, it is very painful.  I just discovered the following nonsense:
     
    In v2.01b, app.c of the wifi_easy_configuration project contains the following code:
     
    #if (OSAL_USE_RTOS == 1) /* It means FreeRTOS V8.x.x is used. */
    #define APP_OSAL_MUTEX_LOCK() APP_OSAL_MutexLock(&s_appLock, OSAL_WAIT_FOREVER)
    #define APP_OSAL_MUTEX_UNLOCK() APP_OSAL_MutexUnlock(&s_appLock)
    #else
    #define APP_OSAL_MUTEX_LOCK() do {} while (0)
    #define APP_OSAL_MUTEX_UNLOCK() do {} while (0)
    #endif
     
    The corresponding section of the same project in v2.02.00b looks like this:
     
    #if (OSAL_USE_RTOS == 1) /* It means the latest FreeRTOS version is used. */
    #define APP_OSAL_MUTEX_LOCK() APP_OSAL_MutexLock(&s_appLock, OSAL_WAIT_FOREVER)
    #define APP_OSAL_MUTEX_UNLOCK() APP_OSAL_MutexUnlock(&s_appLock)
    #else
    #define APP_OSAL_MUTEX_LOCK() do {} while (0)
    #define APP_OSAL_MUTEX_UNLOCK() do {} while (0)
    #endif
     
    Note the difference in the first line of the above code snippets.  This made me wonder, did they
    rewrite the OSAL code, so I started to search a little further and found the following in BOTH
    versions of Harmony in the osal_definitions.h file:
     
    #elif (OSAL_USE_RTOS == 1 || OSAL_USE_RTOS == 9)
    #include "osal/src/osal_freertos.h"
     
    Nothing seems to have changed there...  I probably need to dig a little further to be sure that
    OSAL_USE_RTOS == 1 really means that "the latest FreeRTOS version is used" as opposed to
    "It means FreeRTOS V8.x.x is used", but such discrepancies are really not helpful, especially for
    the less experienced programmers, who need the "convenience" of  Harmony the most...
     
    I might submit a ticket for this.  It is confusing to say the least, if not a bug...
     
    Thanks,
     
    Arpad
    ==========
    #13
    amuranyi
    Starting Member
    • Total Posts : 31
    • Reward points : 0
    • Joined: 2014/08/18 15:04:33
    • Location: 0
    • Status: offline
    Re: How to clone a Harmony project and upgrade it to the latest Harmony version 2017/02/26 14:42:47 (permalink)
    0
    The drv_wifi_rtos_wrapper.h file of v2.02.00b contains this:
     
    /*
    * OSAL_USE_RTOS == 1 means FreeRTOS version 8.x.x is used.
    * OSAL_USE_RTOS == 9 means the latest FreeRTOS version that comes with Harmony
    * is used.
    * These are the only two cases supported by current MRF24WG driver.
    * Following functions are implemented specifically for these two cases.
    */
     
    which directly contradicts what they say in the app.c file (in the same version of Harmony):
     
    #if (OSAL_USE_RTOS == 1) /* It means the latest FreeRTOS version is used. */
     
    Go figure...
     
    Arpad
    =============
     
    #14
    BillP
    Super Member
    • Total Posts : 325
    • Reward points : 0
    • Joined: 2014/09/28 07:53:35
    • Location: CA
    • Status: offline
    Re: How to clone a Harmony project and upgrade it to the latest Harmony version 2017/02/26 16:51:45 (permalink)
    0
    Oh my..
    If I understand what you have posted, the Harmony version upgrades include changes to the APIs that are used in previous demo code. In that case, upgrading from one version to another will have to involve a step to compare the example code directories (winDiff or equivalent) and manually edit the source files (as suggested by NKurzman). Not ideal but doable.
     
    As far as placing the projects under the INSTALLDIR/apps directory, I have changed my mind and now like doing that. If all the projects are located in a different directory (which they can be and there is a posting to do just that), then you have to keep track of which project was developed with which versions of Harmony and the toolsets. I have found that by keeping the working projects in the /apps folder, then when I upgrade I can clone only those projects that I need and leave the others as a backup and reference if something goes crazy later.
     
    Finally, I love inline comments, but NEVER trust them to be accurate.  As a programmer in a hurry, I know the comment does not compile, so why bother changing it?  Well, now you know why.
     
    Bill
    #15
    amuranyi
    Starting Member
    • Total Posts : 31
    • Reward points : 0
    • Joined: 2014/08/18 15:04:33
    • Location: 0
    • Status: offline
    Re: How to clone a Harmony project and upgrade it to the latest Harmony version 2017/02/26 17:22:02 (permalink)
    0
    Bill,
     
    Yes, the more I look, the more changes I seem to discover in the API itself.  And yes, I started using diff
    tools also to see how these API changes affect the application code, in order to understand how I need to
    change my own code.  And the changes I see in the demo application code are even more abound...  With
    such a large amount of variation between Harmony versions I tend to conclude that we should only upgrade
    our projects to newer versions of Harmony if absolutely necessary.  As they say:
    "If it ain't broke, don't fix it".
     
    With such a strong version dependency I can see why it is more advantageous to put the user projects
    under INSTALLDIR/apps.  I didn't realize that it was this bad...
     
    Regarding your comment on inline comments, I feel the same when it comes to my own comments, there
    are times when being in a hurry I don't update them, consequently I don't rely on them 100%.  But when it
    comes to comments in the Harmony code and demo projects, I would expect them to be accurate, since they
    are kind of an "instruction aid". That's whole point of Harmony and the demo projects, help the less
    experienced people to learn and come up to speed.  From this perspective they better be accurate, even
    if they have nothing to do with the outcome of compiling/building the code.
     
    Thanks,
     
    Arpad
    =========
    #16
    BillP
    Super Member
    • Total Posts : 325
    • Reward points : 0
    • Joined: 2014/09/28 07:53:35
    • Location: CA
    • Status: offline
    Re: How to clone a Harmony project and upgrade it to the latest Harmony version 2017/02/26 17:32:56 (permalink)
    0
    I agree 100%!! 
    #17
    NKurzman
    A Guy on the Net
    • Total Posts : 17713
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: How to clone a Harmony project and upgrade it to the latest Harmony version 2017/02/26 18:27:05 (permalink)
    0
    I prefer to to keep my project up to date.
    They still are fixing a lot of bugs.
    #18
    Jim Nickerson
    User 452
    • Total Posts : 6186
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: online
    Re: How to clone a Harmony project and upgrade it to the latest Harmony version 2017/02/26 19:05:16 (permalink)
    0
    I am wondering if all "my" code needs to be in separate standalone files with only one call from within the Harmony app to my code.
    It looks to me to be a loosing battle to try to intermingle my code/functions within the Harmony framework.
    #19
    Jump to:
    © 2019 APG vNext Commercial Version 4.5