ESP8266 Not running Arduino code when uploaded - arduino

I have just recently got some ESP8266's and Ive been trying to use the Arduino IDE 1.8 to program them. (I have also used versions 1.6.5 and 1.6.9).
I have successfully ported a custom build from here and it runs perfectly, I upload Lua code and it runs with no problem.
But when I try to run the Arduino code (Such as the blink example found on this tutorial, with an LED on GPIO 2) that successfully uploads every time, the code never runs. In the Serial program on my PC, I won't see any text, (and the LED will be constantly on).
I followed several online tutorials saying pretty much the same procedure and no luck. Has anyone else experienced this issue and know the solution? Thanks!

Related

Cannot find Arduino IDE VS Code

I am using windows and I installed the Arduino IDE from Microsoft store, but I wanted to code everything in VS Code. When I want to run the program or select the board it just says this:
Cannot find Arduino IDE. Please specify the "arduino.path" in the user settings. Requires a restart after change.
How can I fix this, where can I find the arduino.path?
Install PlatformIO extension for VS Code. It has Arduino framework and it works with all possible boards, and then some.
For me nothing could make Arduino IDE.app (2.0 beta) work. Switching to 1.8.6 (Arduino.app), putting that into my Applications folder (so the path is /Applications/Arduino.app) and setting the VSCode setting to:
"arduino.path": "/Applications/Arduino.app"
Fixed this error (and got me to select a board, which I was able to do with the command palette. Make sure to open the new non-beta Arduino.app and add any existing board manager jsons, such as esp32 in my case, that might have already been added to the beta Arduino. The libraries appear to already be in place.)
I also had to add this to my C/C++ settings for includePath:
${workspaceFolder}/**
/Users/<owen>/Library/Arduino15/packages/esp32/hardware/esp32/1.0.6/**
At this point "verify" began working. It was still pretty slow, and flashes the Arduino splash screen while running, so I'm now going to follow the platformIO advice and see if it's any better.
P.S. At first I also got an error about [Warning] Failed to generate IntelliSense configuration but think I fixed this by clicking the "don't show again" or similar on the popup that appeared in the lower left. (Similar errors show up on syntax issues, so could be related to that instead.)

Arduino code uploads fine, however avrdude output is not able to read / verify memory

Purchased some clone Arduino nanos a while ago and finally got to working with them.
Of the 3 i worked with, 2 of them upload and verify fine.
The third is able to upload (code functions properly), however it fails to read flash data.
this is required to post pastebin
Here is the output from a clone that worked:
https://pastebin.com/x1y0yr1k
Here is the output from the one with the issue:
https://pastebin.com/YGAGC4XN
this is required to post pastebin
What I've done so far:
Reflashed bootloader from working Arduino as ISP
CH340 driver installed
Used (old) bootloader when uploading
Tested on both Linux and OSX
Any suggestions or insight would be much appreciated.
If you have a working UNO or similar board, you could try uploading the bootloader using the Arduino IDE (https://www.arduino.cc/en/Main/Software), and see if you get different results. Sorry, I'm not familiar with using avrdude.
The link on sparkfun gives really good instructions on how to accomplish this task. Scroll about half-way down to where it says Upload Arduino as ISP https://learn.sparkfun.com/tutorials/installing-an-arduino-bootloader/all
Basically, you connect the UNO to your target as shown in the link, then select ArduinoISP in the examples menu, select the COM port and board, and upload the sketch. Then you select your target board in tools, and select Programmer, Arduino as ISP in tools, and finally, Burn Bootloader in tools.
I've had 100% success burning blank Atmega chips using this method.

Arduino hanging on upload

Getting this when I upload the blink example from the arduino getting started book. The file compiles but just hangs at this point. I have reset, restarted, reinstalled. Nothing seems to work.
It worked just 1 day ago and there have been no changes since.
System wide configuration file is "C:\Program Files (x86)\Arduino/hardware/tools/avr/etc/avrdude.conf"
Using Port : COM5
Using Programmer : avr109
Overriding Baud Rate : 57600
Most of the problems with uploading sketches to Arduino boards come down to communication problems.
Try using other USB ports, check if you selected the correct COM port in the Arduino IDE, also check that you selected the correct board in the IDE.
If all else fails, please check if you can upload the sketch on another PC.
this error might be caused from a mistake in connecting the wires or a problem in the program.So try to check the connection of the wires and if you uploaded the program just because you still don't know how to write arduino codes, I advise you to learn and experiment with the help of the tutorials on the arduino site and reference.I hope that my answer helped you.

Arduino leonardo infinite uploading on windows 10

I'm trying to build a midi controller using an Adafruit Trellis and an arduino leonardo. When it comes to run the code, the uploading status freezes and doesn't complete. I've tried to run a hello world using both an arduinoleonardo and a uno but I still had the same problem. I've deleted the IDE, reinstalled it but nothing has changed. I think it's a driver problem but I actually don't know what to do.
Assuming your Uno is good (no defect), try to plug into a different USB port and try different COM #. Also make sure that you are selecting the correct type of Arduino.

nodemcu/ESP8266 using Arduino IDE - Firmware?

I guess I'm having a basic understanding issue regarding the nodemcu/ESP8266 when it is used with the Arduino IDE and/or visual micro (for MS Visual Studio).
Everytime I upload a program/sketch which is obviously written in C in this case, it is compiling and uploading a binary of about 280kb, even if it is only a simple "blink" example.
Is it some kind of firmware being uploaded everytime or is it just monsterious libraries needed for the ESP to work with the Arduino IDE?
If it is firmware, do you normally "update" the firmware to a more recent build when working with the Arduino IDE? When using the nodemcu LUA firmware, there are periodic updates.
Thanks!
Basically, you build the firmware, which is a combination of your own code, and lots of other code/libraries.
All the other parts are part of the Arduino ESP8266 core, which does indeed get updates (it lives here: https://github.com/esp8266/Arduino). And it itself contains the Espressif SDK, which also gets updates (https://github.com/esp8266/Arduino/tree/master/tools/sdk).
Like NodeMCU you can get periodic updates, but they are of the core, and the only way to get them into your firmware is to recompile your sketch.
This is completely normal - When writing code for an interpreted language like Lua for the ESP/NodeMCU, you're just uploading what is a relatively small text file(s), as the code needed to run it is already on the chip, and doesn't change.
However, when you start working with compiled languages like C (With the Espressif SDK only, for example), or C++ with the Arduino IDE, you are replacing the entire firmware each time your code changes. This includes the TCP/IP stack, WiFi management, the logic controlling the PHY/MAC interface, the mini OS, and a host of other bits to make your ESP8266 work. Even if your code appears to be just a simple "blink" sequence, there's a lot of code running behind the scenes to make it possible, leading to the large sketch size.
Generally, every change to your sketch code will produce a complete copy of everything needed to create a bootable, runnable binary for the ESP8266. This is what is causing the 280KiB file. Since each copy of your code includes the newest (Or at least whatever is in your IDE at the time) copy of the system level code, there is no separate update process - Each time you upload your sketch, the system code is updated too.
Additionally, there is some extra overhead from the Arduino abstraction on the Espressif SDK, leading to a larger resulting binary size.

Resources