Multi-platform-machine development?

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

I'm a eager newb trying to learn XMEGA controllers AND 'C' programming.  I'm using the Atmel avr8 toolchain under Linux, and slowly blundering around with a little XMEGA board, learning slowly.  But it occurs to me that I really want to experiment in the *PC* environment, using straight gcc libraries/environment to learn 'C' faster - quicker, more forgiving, use stdio.h to communicate with the code, etc. and obviously better for a 'C' novice.  But - I'm scared about 'breaking' my avr8 environment, changing paths, etc.  I have to leave a nice fat path of breadcrumbs to be able to find my way back home again.  Can somebody advise me on whether I can use -I option in the makefiles to 'segregate' the AVR code development environment from the screwing-around-learning-C-on-the-PC environment? much thanks, paul

This topic has a solution.
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

But - I'm scared about 'breaking' my avr8 environment, changing paths, etc. 

There's no worries I have loads of variants of gcc (avr8, avr32, arm, host amd_64) on my PC and build for them all without issue.

 

In fact I'd highly recommend your approach - it's far easier to test quick results and to debug using the host GCC than some cross compiling version for a resource limited target that has communication issues. The host GCC really will allow the classic:

#include <stdio.h>

int main(void) {
    printf("hello world\n");
    return 0;
}

and it will just work without huge amount of fannying about trying to connect stdout to a UART or LCD output channel.

 

Everything a particular GCC does is all relative to its install_dir/bin/ so the host GCC will find its own <stdio.h> and the AVR one will find its own one copy and never the twain shall meet.

 

PS if you want to make things real fancy consider something like CMake which allows one source and one CMakeLists.txt file and it can then build Makefiles for any of the versions of GCC (or any IDE, even including VisStudio on Windows etc). We do this commercially using the same files for Win-VS2008, amd64_gcc and arm-gcc.

Last Edited: Thu. Oct 30, 2014 - 04:06 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ahhhh, much thanks, clawson, as usual, you're a great help.  As a bonus, I've learned a new phrase in Britishese - 'fannying about'!  I will no doubt impress my friends - paul

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