Build Events error

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

Hi

About a year ago I came across this

avr-nm --size-sort $(OutputDirectory)\$(OutputFileName)$(OutputFileExtension) > $(OutputDirectory)\$(OutputFileName).sym

which gets put in the post build event command line. It worked fine in that project but have now tried it in a different project and get an error.

Error	1	The command "avr-nm --size-sort F:\Projects\Timing1\Debug\Timing1.elf > F:\Projects\Timing1\Debug\Timing1.sym" exited with code 9009.	C:\Program Files\Atmel\Atmel Studio 6.0\Vs\Avr.common.targets	27	5	Timing1

I have checked the paths being returned and they are all valid
Anybody with an idea as to why this would happen?

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

Wonder if you need quotes:

avr-nm --size-sort "$(OutputDirectory)\$(OutputFileName)$(OutputFileExtension)" > "$(OutputDirectory)\$(OutputFileName).sym" 

However the error you see is "odd". If you look at the source of nm it is here:

http://sourceware.org/cgi-bin/cv...

retval is set non-zero here:

  /* We were given several filenames to do.  */
  while (optind < argc)
    {
      PROGRESS (1);
      if (!display_file (argv[optind++]))
	retval++;
    }

For it to have reached 9009 suggests that the command mistakenly thinks it had to process 9009 files!

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

Quote:
Wonder if you need quotes:

I tried it with quotes and get the same error. It works fine in one of my older projects. I have compared all the settings for that project and this and they are the same apart from the project name.

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

What do you get if you issue the same command at a Command Prompt?

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

I used the paths given in the error message at the Cmd prompt and it worked.
I also tried it in the post build event with the actual paths and it still gives an error

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

Quote:

I used the paths given in the error message at the Cmd prompt and it worked.
I also tried it in the post build event with the actual paths and it still gives an error

In which case it's either a fault in the way AS6 launches the command or the way it interprets the result (presumably just %ERRORLEVEL% ). You could try running either procexp.exe or procmon.exe from SysInternals.com and see what AS6 is actually up to when it launches the command. procexp in particular could reveal the whole story but you'll get a LOT of output to sift through!

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

Try "$(ToolchainDir)\avr-nm"
(the "" are important !)

I had s similar problem using avr32-size in a postbuild step in Studio6.1