• AVR Freaks

Helpful ReplyHot!Making custom changes to Harmony framework files

Author
ds13
New Member
  • Total Posts : 4
  • Reward points : 0
  • Status: offline
2016/09/15 13:09:17 (permalink)
4 (1)

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.
 
Thanks,
Dan
#1
martinw7750
Super Member
  • Total Posts : 295
  • Reward points : 0
  • Joined: 2013/05/28 01:31:19
  • Location: UK
  • Status: offline
Re: Making custom changes to Harmony framework files 2016/09/16 01:39:16 (permalink)
0
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"
#2
sisyphos
New Member
  • Total Posts : 11
  • Reward points : 0
  • Status: offline
Re: Making custom changes to Harmony framework files 2016/09/16 02:02:22 (permalink) ☄ Helpfulby stephaneC 2016/09/20 01:45:23
3 (1)
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.
#3
martinw7750
Super Member
  • Total Posts : 295
  • Reward points : 0
  • Joined: 2013/05/28 01:31:19
  • Location: UK
  • Status: offline
Re: Making custom changes to Harmony framework files 2016/09/16 03:10:39 (permalink)
0
That's a sensible addition - hadn't spotted that in the release notes
 
#4
ravic
think_do_repeat
  • Total Posts : 137
  • Reward points : 0
  • Joined: 2016/02/04 03:02:20
  • Location: Pune, MH, India
  • Status: offline
Re: Making custom changes to Harmony framework files 2016/09/16 03:32:17 (permalink)
0
Hi sisyphos, can you please elaborate, how to 'Generate Standalone Project'? in harmony?
#5
sisyphos
New Member
  • Total Posts : 11
  • Reward points : 0
  • Status: offline
Re: Making custom changes to Harmony framework files 2016/09/16 03:48:34 (permalink) ☄ Helpfulby martinw7750 2016/09/16 06:24:56
3 (1)
In MPLAB Harmony Configurator:
Device & Project Configuration
-Project Configuration
--Generate Standalone Project
#6
ravic
think_do_repeat
  • Total Posts : 137
  • Reward points : 0
  • Joined: 2016/02/04 03:02:20
  • Location: Pune, MH, India
  • Status: offline
Re: Making custom changes to Harmony framework files 2016/09/16 05:32:49 (permalink)
3 (1)
Yeah.. That's pretty good. I tried creating a standalone project. It's great. Little bit changes in folder structure.
#7
NKurzman
A Guy on the Net
  • Total Posts : 17236
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: online
Re: Making custom changes to Harmony framework files 2016/09/16 07:54:57 (permalink)
0
I use method 2 so That is a time saver.
I have been doing it manually.
V2.00 seemed a whole lot of nothing. I could not find a lot of changes.
#8
ds13
New Member
  • Total Posts : 4
  • Reward points : 0
  • Status: offline
Re: Making custom changes to Harmony framework files 2016/09/16 09:49:36 (permalink)
0
Thanks for the replies, this gives me something to think about.
 
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. 
#9
NKurzman
A Guy on the Net
  • Total Posts : 17236
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: online
Re: Making custom changes to Harmony framework files 2016/09/16 10:12:45 (permalink)
4 (1)
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 .
#10
ScratchMonkey
Starting Member
  • Total Posts : 33
  • Reward points : 0
  • Joined: 2016/02/13 11:51:56
  • Location: 0
  • Status: offline
Re: Making custom changes to Harmony framework files 2016/09/16 11:51:27 (permalink)
3 (1)
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?)
#11
twelve12pm
Overseer
  • Total Posts : 325
  • Reward points : 0
  • Joined: 2012/04/09 17:27:24
  • Location: 0
  • Status: offline
Re: Making custom changes to Harmony framework files 2016/09/26 09:53:25 (permalink) ☄ Helpfulby ScottSD 2017/11/02 11:20:10
0
This requires Harmony 2.00b. In MPLAB Harmony Configurator, under its Options tab, "MPLAB Harmony & Application Configuration," expand the bottom-most item, "Device & Project Configuration" and then "Project Configuration" under that. Put a check mark in "Generate Standalone Project," save changes, and regenerate code. This will copy source and header files (possibly a large amount of them, depending on what Harmony features you use) from your Harmony installation into your project directory.

Attached Image(s)

#12
EmbeddedEngineer
New Member
  • Total Posts : 26
  • Reward points : 0
  • Joined: 2016/02/24 06:56:35
  • Location: 0
  • Status: offline
Re: Making custom changes to Harmony framework files 2019/04/04 09:40:55 (permalink)
0
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...
#13
Jump to:
© 2019 APG vNext Commercial Version 4.5