Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Is using Cosa without Arduino based on a Makefile possible? #506

Closed
joede opened this issue Apr 30, 2018 · 3 comments
Closed

Question: Is using Cosa without Arduino based on a Makefile possible? #506

joede opened this issue Apr 30, 2018 · 3 comments

Comments

@joede
Copy link

joede commented Apr 30, 2018

In most cases, I'm using my old legacy C code-base together with avr-gcc and a big Makefile. I had have an eye on Cosa for some time now and I'm very impressed. Thanks for the project!

I'm using Geany or Eclipse (only sometimes) to work an Makefile based projects. Is it possible to use Cosa with such a project? I can imaging two ways to work with Cosa.

  1. Cosa is used as Git submodule. Therefore the Makefile of the project must somehow integrate the code of Cosa in the build process.
  2. Cosa can be built as GCC library and linked with the code of the project. In this case Cosa must have a Makefile to build the static library for a configured list of targets.

As far as I can see, both ways are currently not possible. IMO it would be a very important enhancement. Especially with the multi-platform in mind (#505).

@mikaelpatel
Copy link
Owner

Cosa does not use the Arduino core. Actually it has its own main() and init(), https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/main.cpp#L35. There is a makefile/shell-script based build system in the build directory.

The Cosa init() focuses on low-power startup. Most additional startups are moved to the corresponding class such as AnalogPin.

I use GNU Emacs and the Cosa build system. Please note that the additional build scripts (e.g. build/cosa) removed the need for a makefile per sketch.

Using Cosa as a submodule is more or less a question about Software Configuration Control.

Cosa is built as a library that is linked with the sketch code. This is part of the "cached" build strategy to improve build time.

To summarize, the different ways of working with Cosa are possible (and in some cases already supported). The most important issue is actually what you are trying to build and where main() is defined.

Cheers!

@joede
Copy link
Author

joede commented Apr 30, 2018

There is a makefile/shell-script based build system in the build directory.

Thanks for the info. I will drop some time on that later.

Using Cosa as a submodule is more or less a question about Software Configuration Control.

Yes and no. It depends on how

(1) the build process of the project can integrate the build mechanism used in (the as submodule integrated) Cosa, or
(2) your build-script can integrate a "surrounding" (one hierarchy above) project.

Nevertheless, first I have to look at your build-scripts. ;-)

@dhillondeep
Copy link

@joede you can check out wio. We built it to make embedded development simpler and it supports AVR development using Cosa by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants