Skip to content

Commit

Permalink
Merge branch 'release/v0.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed Jan 27, 2017
2 parents 9357ef8 + 105d914 commit 3d7d4f3
Show file tree
Hide file tree
Showing 14 changed files with 108 additions and 145 deletions.
1 change: 1 addition & 0 deletions boards/esp320.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
],
"name": "Electronic SweetPeas ESP320",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 294912,
"maximum_size": 1044464,
"require_upload_port": true,
Expand Down
3 changes: 2 additions & 1 deletion boards/esp32dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
],
"name": "Espressif ESP32 Dev Module",
"upload": {
"maximum_ram_size": 114688,
"flash_size": "4MB",
"maximum_ram_size": 294912,
"maximum_size": 1044464,
"require_upload_port": true,
"resetmethod": "nodemcu",
Expand Down
1 change: 1 addition & 0 deletions boards/espea32.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
],
"name": "April Brother ESPea32",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 294912,
"maximum_size": 1044464,
"require_upload_port": true,
Expand Down
28 changes: 28 additions & 0 deletions boards/hornbill32dev.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"build": {
"core": "esp32",
"extra_flags": "-DESP32_DEV -DHORNBILL_ESP32_DEV",
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "dio",
"ldscript": "esp32_out.ld",
"mcu": "esp32",
"variant": "hornbill32dev"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "Hornbill ESP32 Dev",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 294912,
"maximum_size": 1044464,
"require_upload_port": true,
"resetmethod": "nodemcu",
"speed": 115200,
"wait_for_upload_port": true
},
"url": "https://hackaday.io/project/18997-hornbill",
"vendor": "Hornbill"
}
28 changes: 28 additions & 0 deletions boards/hornbill32minima.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"build": {
"core": "esp32",
"extra_flags": "-DESP32_DEV -DHORNBILL_ESP32_MINIMA",
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "dio",
"ldscript": "esp32_out.ld",
"mcu": "esp32",
"variant": "hornbill32minima"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "Hornbill ESP32 Minima",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 294912,
"maximum_size": 1044464,
"require_upload_port": true,
"resetmethod": "nodemcu",
"speed": 115200,
"wait_for_upload_port": true
},
"url": "https://hackaday.io/project/18997-hornbill",
"vendor": "Hornbill"
}
1 change: 1 addition & 0 deletions boards/lolin32.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
],
"name": "WEMOS LoLin32",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 294912,
"maximum_size": 1044464,
"require_upload_port": true,
Expand Down
1 change: 1 addition & 0 deletions boards/nano32.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
],
"name": "MakerAsia Nano32",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 294912,
"maximum_size": 1044464,
"require_upload_port": true,
Expand Down
1 change: 1 addition & 0 deletions boards/node32s.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
],
"name": "Node32s",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 114688,
"maximum_size": 1044464,
"require_upload_port": true,
Expand Down
1 change: 1 addition & 0 deletions boards/quantum.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
],
"name": "Noduino Quantum",
"upload": {
"flash_size": "16MB",
"maximum_ram_size": 294912,
"maximum_size": 1044464,
"require_upload_port": true,
Expand Down
92 changes: 5 additions & 87 deletions builder/frameworks/arduino.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
Arduino
Expand All @@ -22,91 +21,10 @@
http://arduino.cc/en/Reference/HomePage
"""

from os.path import isdir, join

from SCons.Script import DefaultEnvironment

env = DefaultEnvironment()
platform = env.PioPlatform()

FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif32")
assert isdir(FRAMEWORK_DIR)

env.Prepend(
CPPDEFINES=[
("ARDUINO", 10610),
"ARDUINO_ARCH_ESP32"
],

CPPPATH=[
join(FRAMEWORK_DIR, "tools", "sdk", "include", "config"),
join(FRAMEWORK_DIR, "tools", "sdk", "include", "bt"),
join(FRAMEWORK_DIR, "tools", "sdk", "include", "driver"),
join(FRAMEWORK_DIR, "tools", "sdk", "include", "esp32"),
join(FRAMEWORK_DIR, "tools", "sdk", "include", "ethernet"),
join(FRAMEWORK_DIR, "tools", "sdk", "include", "freertos"),
join(FRAMEWORK_DIR, "tools", "sdk", "include", "log"),
join(FRAMEWORK_DIR, "tools", "sdk", "include", "lwip"),
join(FRAMEWORK_DIR, "tools", "sdk", "include", "newlib"),
join(FRAMEWORK_DIR, "tools", "sdk", "include", "nvs_flash"),
join(FRAMEWORK_DIR, "tools", "sdk", "include", "spi_flash"),
join(FRAMEWORK_DIR, "tools", "sdk", "include", "tcpip_adapter"),
join(FRAMEWORK_DIR, "tools", "sdk", "include", "vfs"),
join(FRAMEWORK_DIR, "tools", "sdk", "include", "expat"),
join(FRAMEWORK_DIR, "tools", "sdk", "include", "json"),
join(FRAMEWORK_DIR, "tools", "sdk", "include", "mbedtls"),
join(FRAMEWORK_DIR, "tools", "sdk", "include", "nghttp"),
join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core"))
],
LIBPATH=[
join(FRAMEWORK_DIR, "tools", "sdk", "lib"),
join(FRAMEWORK_DIR, "tools", "sdk", "ld"),
],
LIBS=[
"app_update", "bt", "btdm_app", "c", "coexist", "core", "driver",
"esp32", "ethernet", "expat", "freertos", "g", "hal", "json", "log",
"lwip", "m", "mbedtls", "net80211", "newlib", "nghttp", "nvs_flash",
"openssl", "phy", "pp", "rtc", "smartconfig", "spi_flash",
"tcpip_adapter", "ulp", "vfs", "wpa", "wpa2", "wpa_supplicant", "wps",
"xtensa-debug-module"
]
)

env.Append(
LIBSOURCE_DIRS=[
join(FRAMEWORK_DIR, "libraries")
],

LINKFLAGS=[
"-T", "esp32.common.ld",
"-T", "esp32.rom.ld",
"-T", "esp32.peripherals.ld"
]
)

#
# Target: Build Core Library
#

libs = []

if "build.variant" in env.BoardConfig():
env.Append(
CPPPATH=[
join(FRAMEWORK_DIR, "variants",
env.BoardConfig().get("build.variant"))
]
)
libs.append(env.BuildLibrary(
join("$BUILD_DIR", "FrameworkArduinoVariant"),
join(FRAMEWORK_DIR, "variants", env.BoardConfig().get("build.variant"))
))

envsafe = env.Clone()
from os.path import join

libs.append(envsafe.BuildLibrary(
join("$BUILD_DIR", "FrameworkArduino"),
join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core"))
))
from SCons.Script import DefaultEnvironment, SConscript

env.Prepend(LIBS=libs)
SConscript(
join(DefaultEnvironment().PioPlatform().get_package_dir(
"framework-arduinoespressif32"), "tools", "platformio-build.py"))
26 changes: 16 additions & 10 deletions builder/frameworks/espidf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,19 @@
platform = env.PioPlatform()

FRAMEWORK_DIR = platform.get_package_dir("framework-espidf")
assert FRAMEWORK_DIR and isdir(FRAMEWORK_DIR)
FRAMEWORK_VERSION = platform.get_package_version(
"framework-espidf")
assert isdir(FRAMEWORK_DIR)


def build_espidf_bootloader():
envsafe = env.Clone()
framework_dir = env.subst("$ESPIDF_DIR")
envsafe.Replace(
CPPDEFINES=["ESP_PLATFORM", ("BOOTLOADER_BUILD", 1)],

LIBPATH=[
join(framework_dir, "components", "esp32", "ld"),
join(framework_dir, "components", "bootloader", "src", "main")
join(FRAMEWORK_DIR, "components", "esp32", "ld"),
join(FRAMEWORK_DIR, "components", "bootloader", "src", "main")
],

LINKFLAGS=[
Expand All @@ -64,7 +63,7 @@ def build_espidf_bootloader():
LIBS=[
envsafe.BuildLibrary(
join("$BUILD_DIR", "bootloaderLog"),
join(framework_dir, "components", "log")
join(FRAMEWORK_DIR, "components", "log")
), "gcc"
]
)
Expand All @@ -73,10 +72,11 @@ def build_espidf_bootloader():
join("$BUILD_DIR", "bootloader.elf"),
envsafe.CollectBuildFiles(
join("$BUILD_DIR", "bootloader"),
join(framework_dir, "components", "bootloader", "src", "main")
join(FRAMEWORK_DIR, "components", "bootloader", "src", "main")
)
)


env.Prepend(
CPPPATH=[
join("$PROJECTSRC_DIR"),
Expand Down Expand Up @@ -128,18 +128,24 @@ def build_espidf_bootloader():
"-T", "esp32.rom.ld",
"-T", "esp32.peripherals.ld"
],

UPLOADERFLAGS=[
"0x1000", join("$BUILD_DIR", "bootloader.bin"),
"0x4000", join("$BUILD_DIR", "partitions_table.bin"),
"0x10000"
]
)

#
# Generate partition table
#

partition_table = env.Command(
join(env.subst("$BUILD_DIR"), "partitions_table.bin"),
join("$ESPIDF_DIR", "components",
join("$BUILD_DIR", "partitions_table.bin"),
join(FRAMEWORK_DIR, "components",
"partition_table", "partitions_singleapp.csv"),
'"$PYTHONEXE" "%s" -q $SOURCE $TARGET' % join(
"$ESPIDF_DIR", "components", "partition_table", "gen_esp32part.py")
FRAMEWORK_DIR, "components", "partition_table", "gen_esp32part.py")
)

env.Depends("$BUILD_DIR/$PROGNAME$PROGSUFFIX", partition_table)
Expand All @@ -151,7 +157,7 @@ def build_espidf_bootloader():

linker_script = env.Command(
join("$BUILD_DIR", "esp32_out.ld"),
join("$ESPIDF_DIR", "components", "esp32", "ld", "esp32.ld"),
join(FRAMEWORK_DIR, "components", "esp32", "ld", "esp32.ld"),
"$CC -I$PROJECTSRC_DIR -C -P -x c -E $SOURCE -o $TARGET"
)

Expand Down
10 changes: 10 additions & 0 deletions builder/frameworks/simba.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,15 @@ def VariantDirWrap(env, variant_dir, src_dir, duplicate=False):
PLATFORMFW_DIR=env.PioPlatform().get_package_dir("framework-simba")
)

env.Append(
UPLOADERFLAGS=[
"0x1000", join("$PLATFORMFW_DIR", "3pp", "esp32",
"bin", "bootloader.bin"),
"0x4000", join("$PLATFORMFW_DIR", "3pp", "esp32",
"bin", "partitions_singleapp.bin"),
"0x10000"
]
)

SConscript(
[env.subst(join("$PLATFORMFW_DIR", "make", "platformio.sconscript"))])

0 comments on commit 3d7d4f3

Please sign in to comment.