Multiple Devices for one project

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

Hi,

after using Visual Studio for many years to work on AVR Projects I had a look at Atmel Studio 7 today. My projects are pretty complex and use modularized makefiles for different configurations. Therefore I will continue to use my external build environment based on AVR-gcc.

 

Most of my projects are used for a number of different products. Those products use different configurations (controlled by #ifdef). They also use different microcontrollers. So far I did not find any way to support the different configurations and also devices. The right way to do that would be different platforms. That, however, is not possible because the Configuration Manager does not allow me to add new project platforms.

 

Is there any way to fix that or another way to handle different configurations for one Project?

 

Thanks in advance, Marcus

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

They also use different microcontrollers.

As in different AVRs or different brand of chips?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

A solution can contain multiple projects and a project can have multiple configurations.  I about 80% 50% sure that you will need a "project" for each microcontroller.  Within a project, each configuration has its own symbols (among other things) and these can be used to control conditional compilation.  I've never actually done this, so I could be utterly and completely wrong!

 

 

Greg Muth

Portland, OR, US

Xplained/Pro/Mini Boards mostly

 

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

I don't know much about make, but I do now enough to know that make & make files are redicilously configurable.

A long time ago I learned some make basics and all my projects are based on copies and modifications of my makefile.

(I turned one of the projects into a "template" to copy for new projects.

 

The IDE I use tends to switch every few years. Used CodeBlocks for a while. Used monodevelop for a while, got bored with too slow startupts with Eclipse, where I also got lost in a sea of menu's.

For the last few years I use Qt Creator. It has a nice mix of simplicity & sophistication which fits my psyche.

The important part however is that it supports external makefiles (which almost any IDE does)

 

That way, you can make the configuration as complex as you want.

But it does get a while to be able to use the make syntax to a suable degree.

There are also other build systems with a more "modern" syntax such as scons or cmake.

Paul van der Hoeven.
Bunch of old projects with AVR's:
http://www.hoevendesign.com

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

Thank you for the answers so far.

 

A few remarks:

 

- I am using 3 Projects with different Atmel Controllers (all AtMegas).

 

- I am using make and makefiles to build my projects. That works fine and without any problems. I do the builds with an external tool that starts my makefiles. That part is no problem and works fine. What I need is the integration with the IDE so that the IDE uses the correct register definitions and constants.

 

- I have some Projects that I use in more than a dozen different configurations. Adding a Project for each variant would add a lot of redundancy and confusion in the IDE.

 

Marcus

Last Edited: Sat. Feb 10, 2018 - 02:14 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Put your source files into one directory tree e.g. with a sensible name.
Then create separate AS7 projects for each target in one Solution.
Add the files to each project as links to the actual common source files.
.
Most IDEs can cope with this type of arrangement i.e. common source directory, separate build directory for each project.
AS7 can build Solution which will build every project in the Solution.
.
You can do the same thing with Makefiles.
How do you think Linux or anything else is built?
.
Yes, there is a certain amount of redundancy. How much of your multi-GigaByte PC is wasted?
How many seconds can you afford for an incremental build?
e.g. modify one source file, each project recompiles that single file, links with the fresh object file.
.
David.

Last Edited: Sat. Feb 10, 2018 - 07:22 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The usual solution (!) are multiple projects with different -D in each but if you are using external Makefiles I guess you already do this so it's going to be multiple projects but with each just assigned a different external makefile then you "build solution" and it builds all the project variants.

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

Hi David,

my makefile structure already takes care of the building process - so that is not a big deal.

 

My main concern with redundancy is not storage space but maintenance of a redundant structure. Adding a single file would need to be done in 15 different Projects.

 

Hmmm, I think I will need to live with the editor not knowing the current Atmel device for the project ....

 

Thanks, Marcus

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

I thought GNU make supported some kind of "include" facility? (In which case you could include a common source list).

 

EDIT Yup thought so..

 

https://www.gnu.org/software/mak...

 

BTW the make manual is a surpringly easy read so I'd scan through to see what else can make life easier.

Last Edited: Sat. Feb 10, 2018 - 07:45 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, that is exactly what I use for building today. The build process works pretty well. I am using the Artifact Name to define settings for a procedure that is started as an external tool.

 

It would have been nice to have all the settings in the IDE, too. However, it looks like that is not possible.

 

Anyways, thanks guys for the ideas and input.

 

Marcus