How to use git and Atmel Studio with multiple devices?

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have a question regarding git and Atmel Studio. I have a project with common code for two target devices.

 

When changing device in Atmel Studio through the menu, git will detect a lot of changes. (See attachment for details.) This of course is not useful when tracking changes to my other source code.

 

A possible solution would be to create two projects in one Atmel solution, and to predefine (and never change) the target device per project, and to link some shared/common code. One downside of this option is that there is also (mainly ASF) code that is shared in the projects, but that is not really shared and therefore duplicate in both projects. Which means that when we add another ASF module to one project, we have to do it on the other project as well.

 

Which option is better? Is it a matter of taste? Or is there another option? Hope to hear from you guys. Thanks in advance!

Attachment(s): 

Maybe someday I'll have a nice quote here.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nobody has got a good tip/solution for me?

Maybe someday I'll have a nice quote here.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can put whatever code you want on GitHub.

 

Different projects might use ASF, Arduino, ... when building the final executable

But you only need to put your files on GitHub.

 

I prefer a single copy of library code.   i.e. put the library source code in one directory.   your projects access via links.

 

If the library source code is 100% stable,   it does not matter if you duplicate it over every project.

This means that you can ZIP up a project and send it abroad.    All components are intact.

Which is how AS7.0 encourages you to organise projects.    But is a nightmare if you ever change a single line in one of the numerous projects.

 

Actually.   GitHub should help you keep track.    But it still makes your head hurt.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi David, Sorry but I don't really follow you. Well, I understand some of what you're saying but can you please have another look at my question, on how to approach the problem of changing the device (which microcontroller) on a project?

 

Are you saying I should take the "multiple project approach" and select a different device (and keep it fixed) on every project? And whenever I need to add a different ASF module, just add it manually to every project through the ASF wizard?

Maybe someday I'll have a nice quote here.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I tend to have multiple projects that share the same source code.

 

e.g. run the same code on m328P, Xmega, SAMD21, SAM3XE, ...

 

Which means that each target has its own startup, linker script etc

But the logic source code is via links rather than duplicated files.

 

I am not brave enough to use ASF.

I suspect that you would have a fresh set of ASF for each target.

 

It depends very much on what sort of targets you have.

Most AVR programs will just vary for Flash and SRAM size.    And a few spelling changes for registers.

 

Much easier than say an ARM project for NXP, Atmel, ST, ... targets

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

empewoow wrote:
Nobody has got a good tip/solution for me?

I'd have thought this is more of a Git question than anything specifically to do with Atmel Studio?

 

The same stuff would apply whatever IDE you use.

 

I'm sure there must be ways for one Git Repo to "link" from another - but, again, that's a Git question.

 

SVN can certainly do this - so I'd be very surprised if Git can't.

 

david.prentice wrote:
I prefer a single copy of library code.

I prefer the opposite!

 

 

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If there is some 100% stable library code,   it does not matter how many duplicate copies are on your PC.

You are never going to make any changes.

 

On the other hand,   your killer application is going to "continuously improve".     I don't want to track each "development change" over multiple duplicate copies of the same source code.

 

Git can help.  But a single Repository seems a lot safer.

And you can have Tags and Releases.  As well as experimental Branches.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...