Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Error] Exit with code=1 #1169

Open
Checho05 opened this issue Dec 31, 2020 · 12 comments
Open

[Error] Exit with code=1 #1169

Checho05 opened this issue Dec 31, 2020 · 12 comments

Comments

@Checho05
Copy link

I was programing with Vscode and the Arduino Extension and when I try to upload the code or to verify the code it sends me this Error :[Error] Exit with code=1. I cant find any fix pleas help.

@adiazulay
Copy link
Contributor

Does the same sketch verify and upload using the Arduino IDE?

@adiazulay adiazulay added the needs-more-info More details about this issue are needed for it to be actionable. label Jan 4, 2021
@cdgriffin
Copy link

I had this problem and fixed by opening the sketch (ino) file and on the status bar at the bottom of the VS Code window: selected/changed Language Mode from arduino-output to C++ before uploading. Check the other options (Sketch File, Show Board Config, Select Serial Port) are correct.

@csmtc
Copy link

csmtc commented Jan 14, 2021

Does the same sketch verify and upload using the Arduino IDE?

I had this problem,too.
image

And if I use arduino ide directly , it works well... Both compile and upload have no error

@cdgriffin
Copy link

When I get the "Exit with code=1 error I check the c_cpp_properties.json and arduino.json configurations in the .vscode folder in the same folder as my program ino file. I also make sure the selections in the bottom status bar are right. If not I click on them to change them.
VSCodeCapture
image
image

@csmtc
Copy link

csmtc commented Jan 14, 2021

When I get the "Exit with code=1 error I check the c_cpp_properties.json and arduino.json configurations in the .vscode folder in the same folder as my program ino file. I also make sure the selections in the bottom status bar are right. If not I click on them to change them.
VSCodeCapture
image
image

Thanks for your advice!
I had solved this problem,and the main reason is PATH ERROR.
.vscode dir placed in the another path, not arduino project root path.
Now it works well.

@FuryMartin
Copy link

I met this problem today and have solved it successfully.
The problem might be that there are some non-ascii characters (maybe Chinese, Japanese or other language characters) in the path of your project. For me, I have some Chinese characters in my project path and when I use path without Chinese characters, the extension works well.

我今天也遇到了这个问题并且顺利的解决了它们,我的情况和上面的不太一样。
问题可能出在你的项目路径上,你的路径里不应该包含中文。我今天的路径里存在中文,当我把文件夹改成英文名之后,插件正常运行了。

@heedaelee
Copy link

in my case, press f1 > arduino: Board Config

there, upload Speed setting was wrong. That solved my problem

image

@benmcmorran benmcmorran removed the needs-more-info More details about this issue are needed for it to be actionable. label Jan 7, 2022
@hemantshelar
Copy link

Is anyone facing this problem while configuring VS Code for MXCHIP development?

I have created a simple IoT Project using Azure IoT Device Workbench extension.

After loading the default configuration I can see the following error on the output window.

Loading configuration...
Initializing packages...
Preparing boards...
Verifying...
exec: "/bin/arm-none-eabi-g++": file does not exist
[Warning] Failed to generate IntelliSense configuration.
[Error] Analyzing sketch 'device.ino': Exit with code=1

I found that, project has a file named cpp_properties.json. By default compilerPath is pointing to C:\\Users\\heman\\AppData\\Local\\Arduino15\\packages\\AZ3166\\tools\\arm-none-eabi-gcc\\5_4-2016q3\\bin\\arm-none-eabi-g++ but tools folder is empty

Any idea how can I get this tool installed on my Windows 10 dev machine?

Here is the original stack overflow question.

@Avesta03
Copy link

Avesta03 commented May 7, 2023

image

Still getting errors myself - is there an issue here perchance?

@tauzn-clock
Copy link

I am using PlatformIO and it seems to be able to by pass the issue

@StarrPhysics
Copy link

StarrPhysics commented Dec 29, 2023

So, I figured out this issue when it came to my own stuff. I forgot where I read this since I just brute force searched the internet until I found something:

It turns out that you MUST have the project ino file share the same exact name as your project folder which contains it. My project folder was initially titled Arduino-Voltmeter and my program was titled Voltmeter_v0.1.ino which was the cause of the error. Once I renamed Voltmeter_v0.1.ino to Arduino-Voltmeter.ino and also reflected this name change in the arduino.json file, the issue resolved.

I'm confused why arduino.json asks for you to provide sketch name just for you to be forced to use a specific one otherwise the program fails. It gives the illusion of choice.

Sorry if I missed anything trying to give an explanation. I'm not an experienced developer, but hopefully this makes future error solving efforts much less exhaustive than mine was.

Edit:
Found the guy with the solution!
OriginalCREart addressed the cause of this error (at least if the naming problem was the cause) in Issue 1665:

Using the same name for the folder (i.e. "project") and the main file is the same what the Arduino IDE does, right? That could be a reason, but still we have a config for the main "sketch" which doesn't work.. so it's a bug for me

It turns out that the main sketch MUST be the same name of the container folder, I was having a file called WifiManager.ino inside a folder called WifiManager [WifiManager\WifiManager.ino], I renamed the WifiManager.ino to Ultrasonic.ino, and the verification/compilation/upload was failing, after reading @spinpwr comment, I renamed the folder to be as the same as the new sketch name Ultrasonic.ino but without the .ino extension and I ended up having [Ultrasonic\Ultrasonic.ino] and everything worked just fine and I was able to verify/compile/upload and rebuild IntelliSense configuration [shortcut -> "Ctrl+Alt+I"].

Thanks

@FMVSC
Copy link

FMVSC commented Feb 2, 2024

I was able to fix this issue by editing my include commands for libraries to be in the form of "#include "library.h";" instead of using the <> signs around the "library.h" file. Also, in the MacOS version of VScode to my knowledge there is no auto update for the c_cpp_properties folder, so you must manually find and update that folder with the file path to the source code of the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests