Home        Store        Docs        Blog

Compiling using AVRA


(Alexander) #1

Hello, folks. I have a question regarding compiling the bluesc.hex file from source code under Windows, using the AVRA compiler as suggested. So far, I have:

  1. Downloaded and installed the avra executable in /Program Files/avra
  2. Added the avra.exe to the PATH variable, allowing it to execute via command line in any directory
The compile instructions on http://docs.bluerobotics.com/bluesc/ then call for "make bluesc.hex". This results in the error "Makefile: 19: recipe for target 'bluesc.hex' failed.

Looking at the AVRA useage instructions, the compile command is actually “avra … (arguments)”, not “make …”.

Has anyone used the AVRA compiler (or any other compiler for that matter) to produce working .hex files? If so, I could use some advice on the correct syntax.

Cheers & thank you in advance, -Alex


(Rusty) #2

Alex,

I’ve never done this on Windows. The command should be:


make blueesc.hex

The build process uses a makefile, which figures out the correct avra command, which is why you don’t use avra directly.

-Rusty


(Alexander) #3

Aha, that makes sense. Thank you for the quick reply. When using “make bluesc.hex”, I get the following error:

  • 'test' is not recognized as an external or internal command, operable program or batch file
  • 'ln' is not recognized as an external or internal command, operable program or batch file
  • Makefile: 19: recipe for target 'bluesc.hex' failed
So, the compiler is finding the Makefile, but tripping up on line 19 (shown below).

Makefile, starting on line 18:

.inc.hex:
@test -e *.asm || ln -s tgy.asm .asm
@echo "(ASM) -fI -o @ -D *_esc -D MOTOR_ID=(MOTOR_ID) -e *.eeprom -d
.obj *.asm" @set -o pipefail; (ASM) -fI -o @ -D _esc -D MOTOR_ID=(MOTOR_ID) -e .eeprom -d *.obj .asm 2>&1 | grep -v ‘PRAGMA directives currently ignored’
@test -L *.asm && rm -f
.asm || true

I noticed that I got the same error prior to installing AVRA, so I suspect that the ‘make bluesc.hex’ may not be correctly invoking the compiler, or invoking a different, pre-existing one. I’ll keep at it - if you have an epiphany, please let me know. And, again, thank you for the help and the quick reply.

-Alex


(Rusty) #4

Alex,

Looks like the makefile is using unix commands that are not available to you. I’d do one of the following:

  1. Try using Cygwin to get access to those commands.

  2. Use a VM running Ubuntu. I recommend Virtual Box, which is free.

-Rusty


(Alexander) #5

Rusty, I’ve tried CygWin with similar results (screenshot attached):

“Makefile:19: recipe for target “bluesc.hex” failed”

Makefile line 19 = “@test -e *.asm || ln -s tgy.asm *.asm”

It appears that AVRA is correctly invoked as the compiler but the error occurs in the same place in the Makefile, though the “@test” command is not explicitly implicated.

I will try the second recommended approach today. Thank you for the help,

-Alex



(Rusty) #6

Alex,

Are you using updated code from our tgy repository? If so, the filename should be blueesc.hex instead of bluesc.hex.

Have you tried the VM approach?

-Rusty


(Alexander) #7

Rusty, nice catch! I now have both file sets but, trying the same procedure with the later “blueesc.hex”, I get the same result:

“Makefile:19: recipe for target “blueesc.hex” failed”

I’ve working on setting up the VM - it’s a bit more work than the CygWin approach.

Have you used Atmel’s own compiler? It comes with Studio, and is native to Windows, though it does not accept makefiles. If I “pasted” the blueEsc specifics into tgy.asm, instead of “including” them, could I compile the single file?

Thanks for sticking with me - I appreciate it, even if I have to learn Unix command line!

-Alex


(Rusty) #8

Alex,

Bummer that it didn’t work on Cygwin. I haven’t used Atmel’s assembly compiler. I know there are some differences and the tgy code was written for avra so you might have to adjust some small things to get it to work.

Hopefully the VM approach works. You should be able to get it to compile in a few commands on an Ubuntu VM. Let me know if you want any help with that.

-Rusty