Commit 1aa5efcb authored by Nick Andrew's avatar Nick Andrew
Browse files

README: Add usable build instructions



Put Marcel's online build server first, as this will be the go-to for
new users. Note that they should build 'dev' not 'master'.

Next, list the docker image which will build from your checked-out
repository and possibly including your own changes.

Finally, list the prerequisites if you want to build it all yourself,
including the sequence of commands (same as the docker image uses).
Signed-off-by: default avatarNick Andrew <nick@nick-andrew.net>
parent b27fc6f5
......@@ -204,42 +204,64 @@ cu:send("hello")
end)
```
# GPIO NEW TABLE (Build 20141219 and later)
# Building the firmware
<a id="new_gpio_map"></a>
<table>
<tr>
<th scope="col">IO index</th><th scope="col">ESP8266 pin</th><th scope="col">IO index</th><th scope="col">ESP8266 pin</th>
</tr>
<tr>
<td>0 [*]</td><td>GPIO16</td><td>8</td><td>GPIO15 (SPI CS)</td>
</tr>
<tr>
<td>1</td><td>GPIO5</td><td>9</td><td>GPIO3 (UART RX)</td>
</tr>
<tr>
<td>2</td><td>GPIO4</td><td>10</td><td>GPIO1 (UART TX)</td>
</tr>
<tr>
<td>3</td><td>GPIO0</td><td>11</td><td>GPIO9</td>
</tr>
<tr>
<td>4</td><td>GPIO2</td><td>12</td><td>GPIO10</td>
</tr>
<tr>
<td>5</td><td>GPIO14 (SPI CLK)</td><td></td><td></td>
</tr>
<tr>
<td>6</td><td>GPIO12 (SPI MISO)</td><td></td><td></td>
</tr>
<tr>
<td>7</td><td>GPIO13 (SPI MOSI)</td><td></td><td></td>
</tr>
</table>
#### [*] D0(GPIO16) can only be used as gpio read/write. no interrupt supported. no pwm/i2c/ow supported.
There are several options for building the NodeMCU firmware.
## Online firmware custom build
Please try Marcel's [NodeMCU custom builds](http://frightanic.com/nodemcu-custom-build) cloud service and you can choose only the modules you need, and download the firmware once built.<br />
NodeMCU custom builds can build from the master branch (0.9.6; deprecated) and dev
branch (1.4.0).
## Docker containerised build
See https://hub.docker.com/r/asmaps/nodemcu-builder/
This docker image includes the build toolchain and SDK. You just run the docker
image with your checked-out NodeMCU firmware repository (this one). The docker
image can also flash the firmware to your device.
You will need to see BUILD OPTIONS below, to configure the firmware before building.
## Build it yourself
See BUILD OPTIONS below, to configure the firmware before building.
### Minimum requirements:
- unrar
- GNU autoconf, automake, libtool
- GNU gcc, g++, make
- GNU flex, bison, gawk, sed
- python, python-serial, libexpat-dev
- srecord
- The esp-open-sdk from https://github.com/pfalcon/esp-open-sdk.git
### Build instructions:
Assuming NodeMCU firmware is checked-out to /opt/nodemcu-firmware:
```sh
git clone --recursive https://github.com/pfalcon/esp-open-sdk.git /opt/esp-open-sdk
cd /opt/esp-open-sdk
make STANDALONE=y
PATH=/opt/esp-open-sdk/xtensa-lx106-elf/bin:$PATH
cd /opt/nodemcu-firmware
make
```
# BUILD OPTIONS
Disable modules you won't be using, to reduce firmware size on flash and
free more RAM. The ESP8266 is quite limited in available RAM, and running
out can cause a system panic.
## Edit app/include/user_modules.h
Comment-out the #define statement for unused modules.
#Build option
####file ./app/include/user_modules.h
```c
#define LUA_USE_BUILTIN_STRING // for string.xxx()
#define LUA_USE_BUILTIN_TABLE // for table.xxx()
......@@ -273,11 +295,42 @@ cu:send("hello")
#define LUA_USE_MODULES_CJSON
#endif /* LUA_USE_MODULES */
```
#Online firmware custom build
For many application, some modules are not used, remove them can free many memory.<br />
Please try Marcel's [NodeMCU custom builds](http://frightanic.com/nodemcu-custom-build) cloud service and you can get your own firmware.<br />
# GPIO NEW TABLE (Build 20141219 and later)
<a id="new_gpio_map"></a>
<table>
<tr>
<th scope="col">IO index</th><th scope="col">ESP8266 pin</th><th scope="col">IO index</th><th scope="col">ESP8266 pin</th>
</tr>
<tr>
<td>0 [*]</td><td>GPIO16</td><td>8</td><td>GPIO15 (SPI CS)</td>
</tr>
<tr>
<td>1</td><td>GPIO5</td><td>9</td><td>GPIO3 (UART RX)</td>
</tr>
<tr>
<td>2</td><td>GPIO4</td><td>10</td><td>GPIO1 (UART TX)</td>
</tr>
<tr>
<td>3</td><td>GPIO0</td><td>11</td><td>GPIO9</td>
</tr>
<tr>
<td>4</td><td>GPIO2</td><td>12</td><td>GPIO10</td>
</tr>
<tr>
<td>5</td><td>GPIO14 (SPI CLK)</td><td></td><td></td>
</tr>
<tr>
<td>6</td><td>GPIO12 (SPI MISO)</td><td></td><td></td>
</tr>
<tr>
<td>7</td><td>GPIO13 (SPI MOSI)</td><td></td><td></td>
</tr>
</table>
#### [*] D0(GPIO16) can only be used as gpio read/write. no interrupt supported. no pwm/i2c/ow supported.
#Flash the firmware
nodemcu_latest.bin: 0x00000<br />
......@@ -300,6 +353,7 @@ Victor Brutskiy's [Esplorer](https://github.com/4refr0nt/ESPlorer) support most
####NodeMCU Studio
[NodeMCU Studio](https://github.com/nodemcu/nodemcu-studio-csharp) is written in C# and support Windows. This software is opensource and can write lua files to filesystem.
# OPTIONAL MODULES
####Use DS18B20 module extends your esp8266
```lua
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment