1

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!

2 Answers 2

3

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you both! Thats kind of what I was expecting. The only thing I'm not sure about, is how to update the Arduino ESP8266 core/Espressif SDK when the Arduino Board Manager in the Arduino IDE is saying that it is up-to-date. Do I have to download the GIT repository and import it into the Arduino IDE like described in github.com/esp8266/Arduino/blob/master/README.md? How do I know which version I'm using then? Are there other "nightly" branches or something?
As I don't actually use the Arduino IDE, I'm not 100% sure, but looking at the installation instructions for the core (esp8266.github.io/Arduino/versions/2.0.0/doc/installing.html#), I would expect the 'Board Manager' to notify you of new versions, once the developers release them, and then allow you to install them. You only need to update the core, the amazing developers working on it will update the SDK and such, which is used in it.
2

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.