Go Down

Topic: Atmel Studio 7 import Sketch "Not enough arguments for format string" (Read 802 times) previous topic - next topic


I'm working in Windows 7 using Atmel Studio 7 and Arduino 1.6.7.

I have a simple sketch for testing my 20x4 LCD display, using a different LiquidCrystal library than the
one installed with Arduino 1.6.7.

Using the Arduino IDE, it compiles and uploads and runs correctly on my ATmega2560.

However, when trying to import the Sketch in Atmel Studio using File -> New -> Create project from Arduino sketch, setting the solution name and project name, then selecting my .ino file, I immediately get the "AtmelStudio: Not enough arguments for format string" dialog box.

No further hints are given by Atmel Studio, and I couldn't find anything on the forum or on the web.

Any ideas?




In the FAQ for Atmel Studio 7 at https://avrstudio5.wordpress.com/2015/10/08/atmel-studio-7-faq/ it is said that:

15. Supported Arduino IDE's for "Sketch Import"

What is arduino-1.7.x ??? I thought the current latests version is 1.6.9?
Furthermore, my version 1.6.7 is not listed, so I also tried anew with arduino-1.6.4, but still the same error.

Any help from Arduino people would be greatly appreciated!


I can`t help but having the same Problem ...

... did test some other/older IDEs, did delete preferences.txt, did a fresh windows-installation (some people wrote that it could be a problem between visual studio and atmel studio...) etc...

Always the same problem (at the moment i`am still looking for a solution and found your thread ...)

The one from me is this one:

My Thread regarding this Problem

Hopefully someone can help us ...




In the last hour i tested newest Version of Atmel Studio 7:

Atmel Studio 7.0.1006
Arduino IDE 1.6.9

--> It works without Problems (Visual Studio 2015 is installed on my Computer, too)




Hi Stephan,
Thanks for your kind reaction.

I discovered the cause to my problem and a workaround, but I think it must be a bug in Atmel Studio.

Although I upgraded to Studio 7.0.1006 as you suggested, the problem persisted.

I finally identified the cause of my error. It happens when I try to declare my global lcd variable using
a multi-argument constructor.

When I use the following global var declaration in my .ino file, the import in AS7 works:

Code: [Select]
LiquidCrystal_I2C lcd(0x27);

However, when using the following, I get the error "AtmelStudio: Not enough arguments for format string"

Code: [Select]
LiquidCrystal_I2C lcd(0x27,BACKLIGHT_PIN, POSITIVE);

This constructor simply does the same thing as  LiquidCrystal_I2C lcd(0x27); just adding in its body:

Code: [Select]
lcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE);

If I use the LiquidCrystal_I2C lcd(0x27); version and add the lcd.setBacklightPin part in the setup() function in the same .ino file, the import in Atmel Studio works.

It only fails if I use other constructors with more than 1 argument.

I reported potential bug on the official Atmel AVR forum:
Expecting the Atmel team to react to that message.

As a workaround, I just used the single-parameter constructor in the .ino file, then import it in Atmel Studio, then replace it again there. It builds, uploads and runs correctly from Atmel Studio then.


PS. As to my confusion with the arduino version, I was not aware about there being two competing versions of arduino (arduino.cc and arduino.org) apparently because of internal rife in the arduino team. So there are also two latests versions of arduino: 1.6.9 (arduino.cc) and 1.7.10 (arduino.org)...
The 1.7.10 version has a small GUI bug: when selecting the Tools menu, there is a small bug annoying delay before the menu items appear.


I have the same Problem
ILI9341_due tft = ILI9341_due(TFT_CS, TFT_DC, TFT_RST);
URTouch  myTouch(6, 5, 4, 3, 2);

I remark them, AS is importing and after that I delete the Remarks
That sucks, I know.


I want to confirm that I ran into an exactly same issue with my brand new installation of Atmel Studio 7 and the solution proposed by @diracsbracket worked for me as well.  I had a class constructor with 2 arguments in an arduino sketch i was trying to import, and AS7 was failing to create a project.  Converting the constructor to a single argument resolved the issue.  This is clearly a bug in AS7.

As far as I recall, I had this very same code imported into Atmel Studio 5 several years ago and it did not have this import issue.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131