Atmel Studio puts wrong name in auto-generated file header comment.

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

 

I used 'New Project...' from the AS7 'Start' page, then chose 'GCC C Executable Project'

 

It creates the project, and a main.c file containing the usual "skeleton":

 

 

But it's put the wrong name in the automatically-generated header comment, Gromit! 

 

In this case, it's put 'uart.c' - when it's actually 'main.c'

 

In general, it puts '<project-name>.c' - but the file name is always 'main.c'

 

Not a big deal, of course - but not right.

 

When I create a new file, it does put the correct name into the automatically-generated header comment.

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Thu. Jun 25, 2020 - 10:41 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Note to self: maybe some clues here to fix it:

 

https://www.avrfreaks.net/commen...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Go on.   It seems perfectly appropriate to me.

 

I created a project called nobbyv_twi and AS7.0 creates a "main.c" file with a comment block saying nobbyv_twi.c,  Created,  Author

 

I immediately rename "main.c" to "nobbyv_twi.c"

 

Yes,  I would prefer a new project to create "project.c" in the first place.

But hey-ho,  some people like having multiple "main.c" files in a solution.

 

David.

 

p.s. "uart" seems an unusual sort of name for a project.   I would expect uart.c to be library file and "uart_andy" to be a project name.

Last Edited: Mon. Jul 19, 2021 - 09:30 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
Go on.

did you not read the OP?

I wrote:
Not a big deal, of course - but not right.

 

  It seems perfectly appropriate to me.

Go on!  It's created a file called X.c - so why on earth would it then write a comment saying that it's called Y.c ?!

 

From Cliff's recent post which I linked, I suspect it's probably just used the wrong $blah$ token ..

 

"uart" seems an unusual sort of name for a project

Indeed. IIRC, it was the client's choice of name.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
I would prefer a new project to create "project.c" in the first place.

Likewise.

 

I guess the linked post from Cliff might also give hints on how to achieve that ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It seems a common IDE or Wizard feature.   i.e. create a "main.c" file

Judging by the sheer number of GCCApplication1 projects there would be a lot of GCCApplication1.c files

 

Yes,   you could write a more appropriate template.  

https://onlinedocs.microchip.com... shows the macros.

 

I think this is a case "can't please everybody all of the time"

 

Oh, personally I would put F_CPU in the Project Symbols with any template.    Much like AS4.xx did

However it is far too late to do anything like that in AS7.0 now

 

David.

Last Edited: Mon. Jul 19, 2021 - 10:02 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
maybe some clues here to fix it:
Ah ha - I was just about to point you in the direction of that!

 

Rather curiously the placeholder seems to be called $safeitemname" and is suppose to be the name of the project (like GccApplication1 or something).

Last Edited: Mon. Jul 19, 2021 - 11:09 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
I suspect it's probably just used the wrong $blah$ token

Confirmed: https://www.avrfreaks.net/commen...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...