Helpful ReplyHot!Making custom changes to Harmony framework files

Making custom changes to Harmony framework files

I'm knee deep in my first major Harmony project and am running into several scenarios where I feel the need to make minor customizations to the Harmony framework files to meet the needs of my application. Trouble is, I'm having a hard time figuring out a clean way to do this.

For example, I'm using the WiFi driver for the MRF24WG. The driver has the embedded ability to save my wifi config parameters to NVM. However, my system is using an SD card so I would rather save this config data to the SD card where the rest of my config parameters are. Harmony doesn't support this by default, so I simply want to change the write/read/erase config functions that are part of the library to my own implementation that saves the data to the SD card instead. The code changes are simple, but figuring out a clean way to have MPLAB/Harmony to do this is not.

Some options I've tried:1. Just edit the source files in the harmony/framework. I don't like this because we have multiple developers on the project and they'd each need to manually edit/replace these files in their local harmony installation (since the framework source files aren't covered by our source control).

2. Make copies of the files, make changes, and put them in the local source tree (so they are covered by git) and then exclude the original source files pulled in by harmony. This is our current functional solution, but the thing I hate about this is every time we regenerate the project we have to manually go and re-exclude those files since the regeneration process re-includes all necessary source.

Has anybody found a good solution for this? Any suggestions? Surely this has to be a somewhat common use case. I really only want to overload/replace just a handful of functions or files.

Another option I've considered is to pull all included source files into my local project directory and cut Harmony out of the loop. From day 1 it has bothered me that the project structure expects us to keep Harmony source files outside of our local directory.

I have all Harmony under version control.Any changes I make in Harmony I mark with comments (so I know I did the changes!)Then when a new version of Harmony comes out I merge/update in version control, being carefull not to remove my changes.My harmony folder name does not include the release number, it's just "Harmony"

In Harmony v2.00b you can select "Generate Standalone Project".Then all the needed source files are copied in your local tree, where you can make changes, and put all in git.If you regenerate the code, there are different merging strategies, so your changes aren't lost.Works pretty well for me so far.

Do you keep the whole Harmony directory under version control or do you just keep the source files (/framework)? Looking at the whole directory, it is about 2GB which would really blow up our repo size. I'd like to remove some of the extraneous files but have a feeling MPLAB will no longer recognize it as a valid Harmony location if I do that.

The V2Beta standalone project feature sounds like exactly what I want, but I am somewhat wary of a) changing versions in the middle of a project (and the porting headache that may come with it) and b) using beta software. Granted the existing Harmony tools have always felt very 'Beta' to me, so maybe it wouldn't be a big change.

I just move in what is required. The porting from v1.08 to v2.00b was not that hard. Considering the state of harmony following the updates is a good idea, unless you have a very short project schedule .

The concept you're looking for is "vendor branch". So google for "git vendor branch" and you'll find lots of articles on different ways to organize this in git.

I do wish Microchip would make Harmony available as a git repo so that we can easily see changes between versions and clone/fetch those changes into our own work. (Did you know that Microsoft is now providing the source to .NET on Github?)

Attached Image(s)

when do some changes in harmony based project and generate code it displays two windows and show some red cross sign in right side and at left window it shows arrow sign what to do. my goal is to keep old code as it is and also add the changes then what option should i select please help thanks...