Microcontroller Board Programming
FleetingHow to build and upload programs to microcontrollers
The tooling with depend on:
- the microcontroller
- the compiler needs to know how to build for it,
- the board
- the tool needs to be able to discuss with its components,
In general, there is one specific microcontroller for a specific board, so we can focus of the later.
tooling
espressif/esptool: Espressif SoC serial bootloader utility
- External reference: https://github.com/espressif/esptool
Arduino IDE 2
-
External reference: https://docs.arduino.cc/software/ide-v2/tutorials/getting-started-ide-v2/ Reads programs in so-called sketches using the C++ arduino library, built for the target microcontroller and uploaded via a connection to the board.
It also provides some support for micropython.
Even though it is from arduino, it is not limited to the boards by arduino.
It hides most of the pain, making it easy to start, and hard to understand better.
flashing
This is the process of uploading the program that will run in the microcontroller. It contains the whole code, the bootloader and the code you built.1
bootloader
The part for the code that does the lowlevel stuff (initializing the clock, upgrade the firmware, etc) before running the higher level program.
languages
You can either build the source code to target the microcontroller directly or upload an interpreter built for it and run a program written in a higher level language directly on the controller2.
that can target directly the microcontroller
C++ arduino library
firmware based: higher level languages that are interpreted by a firmware that needs to be installed
Note that you cannot install several of them.3
micropython
-
External reference: https://micropython.org/ MicroPython - Python for microcontrollers
MicroPython is a lean and efficient implementation of the Python 3 programming language that includes a small subset of the Python standard library and is optimised to run on microcontrollers and in constrained environments.
nodemcu/nodemcu-firmware: Lua based interactive firmware for ESP8266, ESP8285 and ESP32
-
External reference: https://en.wikipedia.org/wiki/NodeMCU Don’t confuse with nodemcu board architecture
NodeMCU is an open source Lua based firmware for the ESP32 and ESP8266 WiFi SOCs from Espressif
NodeMCU is a low-cost open source IoT platform. It initially included firmware which runs on the ESP8266 Wi-Fi SoC from Espressif Systems, and hardware which was based on the ESP-12 module. Later, support for the ESP32 32-bit MCU was added.
Notes linking here
- board with a single microcontroller
- ESP8266
- how to play with the wemos d1
- IOT heart again, with micropython
- nodemcu board architecture
- testing batteries with a wemos d1
- trying to run a program on arduino without the IDE
Permalink
-
#+BEGIN_QUOTE Bootloaders can have many functionalities, but it’s mainly used to manage the application. They can also utilize different protocols such as UART, CAN, I2C, I2S, Ethernet, or USB to establish communication and initial a firmware upgrade ↩︎
-
Technically speaking NodeMCU is a firmware for ESP8266 developed using C Programming Language, Espressif NON-OS SDK and Lua scripting language.
Traditionally, we write code for our Microcontrollers like Arduino, STM32, 8051 etc., either in C or C++ and compile it with a set of tools and generate a binary file. This binary file is then uploaded into the flash memory of the microcontroller and it gets executed.
Things are quite different with NodeMCU. You can consider the NodeMCU firmware as an interpreter for Lua Scripts. So, if your ESP8266 is loaded with NodeMCU Firmware, you can simply write your application in Lua and send it to the ESP8266.
— https://www.electronicshub.org/getting-started-with-nodemcu/
-
IMPORTANT NOTE: Only one firmware can exist on the ESP8266. It can be either AT Commands Firmware, NodeMCU Firmware or Arduino based code. Once you upload an Arduino sketch, the NodeMCU firmware gets erased. If you want to work with Lua Scripts and NodeMCU, then you have to flash the NodeMCU Firmware.
— https://www.electronicshub.org/getting-started-with-nodemcu/