Depend on Arduino Core from official repository
This commit is contained in:
@@ -11,7 +11,6 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Arduino
|
Arduino
|
||||||
|
|
||||||
@@ -22,117 +21,10 @@ kinds of creative coding, interactive objects, spaces or physical experiences.
|
|||||||
http://arduino.cc/en/Reference/HomePage
|
http://arduino.cc/en/Reference/HomePage
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from os.path import isdir, join
|
from os.path import join
|
||||||
|
|
||||||
from SCons.Script import DefaultEnvironment
|
from SCons.Script import DefaultEnvironment, SConscript
|
||||||
|
|
||||||
env = DefaultEnvironment()
|
SConscript(
|
||||||
platform = env.PioPlatform()
|
join(DefaultEnvironment().PioPlatform().get_package_dir(
|
||||||
|
"framework-arduinoespressif32"), "tools", "platformio-build.py"))
|
||||||
FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif32")
|
|
||||||
assert isdir(FRAMEWORK_DIR)
|
|
||||||
|
|
||||||
env.Prepend(
|
|
||||||
CPPDEFINES=[
|
|
||||||
("ARDUINO", 10610),
|
|
||||||
"ARDUINO_ARCH_ESP32"
|
|
||||||
],
|
|
||||||
|
|
||||||
CFLAGS=["-Wno-old-style-declaration"],
|
|
||||||
|
|
||||||
CCFLAGS=[
|
|
||||||
"-Wno-error=deprecated-declarations",
|
|
||||||
"-Wno-unused-parameter",
|
|
||||||
"-Wno-sign-compare"
|
|
||||||
],
|
|
||||||
|
|
||||||
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", "fatfs"),
|
|
||||||
join(FRAMEWORK_DIR, "tools", "sdk", "include", "freertos"),
|
|
||||||
join(FRAMEWORK_DIR, "tools", "sdk", "include", "log"),
|
|
||||||
join(FRAMEWORK_DIR, "tools", "sdk", "include", "mdns"),
|
|
||||||
join(FRAMEWORK_DIR, "tools", "sdk", "include", "vfs"),
|
|
||||||
join(FRAMEWORK_DIR, "tools", "sdk", "include", "ulp"),
|
|
||||||
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", "sdmmc"),
|
|
||||||
join(FRAMEWORK_DIR, "tools", "sdk", "include", "openssl"),
|
|
||||||
join(FRAMEWORK_DIR, "tools", "sdk", "include", "app_update"),
|
|
||||||
join(FRAMEWORK_DIR, "tools", "sdk", "include", "tcpip_adapter"),
|
|
||||||
join(FRAMEWORK_DIR, "tools", "sdk", "include", "xtensa-debug-module"),
|
|
||||||
join(FRAMEWORK_DIR, "tools", "sdk", "include", "coap"),
|
|
||||||
join(FRAMEWORK_DIR, "tools", "sdk", "include", "wpa_supplicant"),
|
|
||||||
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", "bootloader_support", "bt", "btdm_app", "c",
|
|
||||||
"c_nano", "coap", "coexist", "core", "cxx", "driver", "esp32",
|
|
||||||
"ethernet", "expat", "fatfs", "freertos", "hal", "json", "log",
|
|
||||||
"lwip", "m", "mbedtls", "mdns", "micro-ecc", "net80211", "newlib",
|
|
||||||
"nghttp", "nvs_flash", "openssl", "phy", "pp", "rtc", "sdmmc",
|
|
||||||
"smartconfig", "spi_flash", "tcpip_adapter", "ulp", "vfs", "wpa",
|
|
||||||
"wpa2", "wpa_supplicant", "wps", "xtensa-debug-module", "gcc", "stdc++"
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
env.Append(
|
|
||||||
LIBSOURCE_DIRS=[
|
|
||||||
join(FRAMEWORK_DIR, "libraries")
|
|
||||||
],
|
|
||||||
|
|
||||||
LINKFLAGS=[
|
|
||||||
"-T", "esp32.common.ld",
|
|
||||||
"-T", "esp32.rom.ld",
|
|
||||||
"-T", "esp32.peripherals.ld"
|
|
||||||
],
|
|
||||||
|
|
||||||
UPLOADERFLAGS=[
|
|
||||||
"0x1000", '"%s"' % join(FRAMEWORK_DIR, "tools",
|
|
||||||
"sdk", "bin", "bootloader.bin"),
|
|
||||||
"0x8000", '"%s"' % join(FRAMEWORK_DIR, "tools",
|
|
||||||
"sdk", "bin", "partitions_singleapp.bin"),
|
|
||||||
"0x10000"
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
#
|
|
||||||
# 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()
|
|
||||||
|
|
||||||
libs.append(envsafe.BuildLibrary(
|
|
||||||
join("$BUILD_DIR", "FrameworkArduino"),
|
|
||||||
join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core"))
|
|
||||||
))
|
|
||||||
|
|
||||||
env.Prepend(LIBS=libs)
|
|
||||||
|
|||||||
@@ -30,20 +30,19 @@ env = DefaultEnvironment()
|
|||||||
platform = env.PioPlatform()
|
platform = env.PioPlatform()
|
||||||
|
|
||||||
FRAMEWORK_DIR = platform.get_package_dir("framework-espidf")
|
FRAMEWORK_DIR = platform.get_package_dir("framework-espidf")
|
||||||
|
assert FRAMEWORK_DIR and isdir(FRAMEWORK_DIR)
|
||||||
FRAMEWORK_VERSION = platform.get_package_version(
|
FRAMEWORK_VERSION = platform.get_package_version(
|
||||||
"framework-espidf")
|
"framework-espidf")
|
||||||
assert isdir(FRAMEWORK_DIR)
|
|
||||||
|
|
||||||
|
|
||||||
def build_espidf_bootloader():
|
def build_espidf_bootloader():
|
||||||
envsafe = env.Clone()
|
envsafe = env.Clone()
|
||||||
framework_dir = env.subst("$ESPIDF_DIR")
|
|
||||||
envsafe.Replace(
|
envsafe.Replace(
|
||||||
CPPDEFINES=["ESP_PLATFORM", ("BOOTLOADER_BUILD", 1)],
|
CPPDEFINES=["ESP_PLATFORM", ("BOOTLOADER_BUILD", 1)],
|
||||||
|
|
||||||
LIBPATH=[
|
LIBPATH=[
|
||||||
join(framework_dir, "components", "esp32", "ld"),
|
join(FRAMEWORK_DIR, "components", "esp32", "ld"),
|
||||||
join(framework_dir, "components", "bootloader", "src", "main")
|
join(FRAMEWORK_DIR, "components", "bootloader", "src", "main")
|
||||||
],
|
],
|
||||||
|
|
||||||
LINKFLAGS=[
|
LINKFLAGS=[
|
||||||
@@ -64,7 +63,7 @@ def build_espidf_bootloader():
|
|||||||
LIBS=[
|
LIBS=[
|
||||||
envsafe.BuildLibrary(
|
envsafe.BuildLibrary(
|
||||||
join("$BUILD_DIR", "bootloaderLog"),
|
join("$BUILD_DIR", "bootloaderLog"),
|
||||||
join(framework_dir, "components", "log")
|
join(FRAMEWORK_DIR, "components", "log")
|
||||||
), "gcc"
|
), "gcc"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
@@ -73,7 +72,7 @@ def build_espidf_bootloader():
|
|||||||
join("$BUILD_DIR", "bootloader.elf"),
|
join("$BUILD_DIR", "bootloader.elf"),
|
||||||
envsafe.CollectBuildFiles(
|
envsafe.CollectBuildFiles(
|
||||||
join("$BUILD_DIR", "bootloader"),
|
join("$BUILD_DIR", "bootloader"),
|
||||||
join(framework_dir, "components", "bootloader", "src", "main")
|
join(FRAMEWORK_DIR, "components", "bootloader", "src", "main")
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -142,11 +141,11 @@ env.Append(
|
|||||||
#
|
#
|
||||||
|
|
||||||
partition_table = env.Command(
|
partition_table = env.Command(
|
||||||
join(env.subst("$BUILD_DIR"), "partitions_table.bin"),
|
join("$BUILD_DIR", "partitions_table.bin"),
|
||||||
join("$ESPIDF_DIR", "components",
|
join(FRAMEWORK_DIR, "components",
|
||||||
"partition_table", "partitions_singleapp.csv"),
|
"partition_table", "partitions_singleapp.csv"),
|
||||||
'"$PYTHONEXE" "%s" -q $SOURCE $TARGET' % join(
|
'"$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)
|
env.Depends("$BUILD_DIR/$PROGNAME$PROGSUFFIX", partition_table)
|
||||||
@@ -158,7 +157,7 @@ env.Depends("$BUILD_DIR/$PROGNAME$PROGSUFFIX", partition_table)
|
|||||||
|
|
||||||
linker_script = env.Command(
|
linker_script = env.Command(
|
||||||
join("$BUILD_DIR", "esp32_out.ld"),
|
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"
|
"$CC -I$PROJECTSRC_DIR -C -P -x c -E $SOURCE -o $TARGET"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -6,13 +6,13 @@
|
|||||||
"homepage": "http://platformio.org/platforms/espressif32",
|
"homepage": "http://platformio.org/platforms/espressif32",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"engines": {
|
"engines": {
|
||||||
"platformio": "^3.0.0"
|
"platformio": ">=3.3.0-a7"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/platformio/platform-espressif32.git"
|
"url": "https://github.com/platformio/platform-espressif32.git"
|
||||||
},
|
},
|
||||||
"version": "0.4.0",
|
"version": "0.5.0-a1",
|
||||||
"packageRepositories": [
|
"packageRepositories": [
|
||||||
"https://dl.bintray.com/platformio/dl-packages/manifest.json",
|
"https://dl.bintray.com/platformio/dl-packages/manifest.json",
|
||||||
"https://sourceforge.net/projects/platformio-storage/files/packages/manifest.json/download",
|
"https://sourceforge.net/projects/platformio-storage/files/packages/manifest.json/download",
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
"framework-arduinoespressif32": {
|
"framework-arduinoespressif32": {
|
||||||
"type": "framework",
|
"type": "framework",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"version": "~1.1.0"
|
"version": "https://github.com/ivankravets/arduino-esp32.git"
|
||||||
},
|
},
|
||||||
"framework-espidf": {
|
"framework-espidf": {
|
||||||
"type": "framework",
|
"type": "framework",
|
||||||
|
|||||||
Reference in New Issue
Block a user