Add initial support for briki core (#294)

This commit is contained in:
AlbertoPimpo
2020-03-17 10:51:38 +00:00
committed by GitHub
parent 2f3879724b
commit 98df86243e
8 changed files with 152 additions and 2 deletions
+39
View File
@@ -0,0 +1,39 @@
{
"build": {
"arduino":{
"ldscript": "esp32_out.ld"
},
"core": "mbcwb",
"extra_flags": "-DBRIKI_MBC_WB_ESP -DBRIKI_ABC -w",
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "dio",
"mcu": "esp32",
"variant": "briki_mbcwb_esp32",
"partitions": "8MB_ffat.csv"
},
"connectivity": [
"wifi",
"bluetooth",
"ethernet",
"can"
],
"debug": {
"openocd_board": "esp-wroom-32.cfg"
},
"frameworks": [
"arduino"
],
"name": "Briki ABC (MBC-WB) - ESP32",
"upload": {
"protocol": "mbctool",
"flash_size": "8MB",
"maximum_ram_size": 327680,
"maximum_size": 3407872,
"require_upload_port": true,
"speed": 1500000
},
"url": "https://briki.org",
"vendor": "meteca"
}
+39
View File
@@ -0,0 +1,39 @@
{
"build": {
"arduino":{
"ldscript": "esp32_out.ld"
},
"core": "mbcwb",
"extra_flags": "-DBRIKI_MBC_WB_ESP -DBRIKI_MBC_WB -w",
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "dio",
"mcu": "esp32",
"variant": "briki_mbcwb_esp32",
"partitions": "8MB_ffat.csv"
},
"connectivity": [
"wifi",
"bluetooth",
"ethernet",
"can"
],
"debug": {
"openocd_board": "esp-wroom-32.cfg"
},
"frameworks": [
"arduino"
],
"name": "Briki MBC-WB - ESP32",
"upload": {
"protocol": "mbctool",
"flash_size": "8MB",
"maximum_ram_size": 327680,
"maximum_size": 3407872,
"require_upload_port": true,
"speed": 1500000
},
"url": "https://briki.org",
"vendor": "meteca"
}
+8 -1
View File
@@ -27,10 +27,17 @@ from os.path import join
from SCons.Script import DefaultEnvironment, SConscript from SCons.Script import DefaultEnvironment, SConscript
env = DefaultEnvironment() env = DefaultEnvironment()
board = env.BoardConfig()
build_core = board.get("build.core", "").lower()
SConscript("_embed_files.py", exports="env") SConscript("_embed_files.py", exports="env")
if "espidf" not in env.subst("$PIOFRAMEWORK"): if build_core == "mbcwb":
SConscript(
join(DefaultEnvironment().PioPlatform().get_package_dir(
"framework-arduino-mbcwb"), "tools", "platformio-esp-build.py"))
elif "espidf" not in env.subst("$PIOFRAMEWORK"):
SConscript( SConscript(
join(DefaultEnvironment().PioPlatform().get_package_dir( join(DefaultEnvironment().PioPlatform().get_package_dir(
"framework-arduinoespressif32"), "tools", "platformio-build.py")) "framework-arduinoespressif32"), "tools", "platformio-build.py"))
+28
View File
@@ -341,6 +341,34 @@ elif upload_protocol == "esptool":
env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE") env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")
] ]
elif upload_protocol == "mbctool":
env.Replace(
UPLOADER=join(
platform.get_package_dir("tool-mbctool") or "", "bin", "mbctool"),
UPLOADERFLAGS=[
"--device", "esp",
"--speed", "1500000",
"--port", "$UPLOAD_PORT",
"--upload",
"0x1000", join(
platform.get_package_dir("framework-arduino-mbcwb"),
"tools", "sdk", "bin", "bootloader_qio_80m.bin"),
"0x8000", join("$BUILD_DIR", "partitions.bin"),
"0xe000", join(
platform.get_package_dir("framework-arduino-mbcwb"),
"tools", "partitions", "boot_app0.bin"),
"0x10000", join("$BUILD_DIR", "${PROGNAME}.bin"),
],
UPLOADCMD='"$UPLOADER" $UPLOADERFLAGS'
)
upload_actions = [
env.VerboseAction(env.AutodetectUploadPort,
"Looking for upload port..."),
env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")
]
elif upload_protocol in debug_tools: elif upload_protocol in debug_tools:
openocd_args = ["-d%d" % (2 if int(ARGUMENTS.get("PIOVERBOSE", 0)) else 1)] openocd_args = ["-d%d" % (2 if int(ARGUMENTS.get("PIOVERBOSE", 0)) else 1)]
openocd_args.extend( openocd_args.extend(
+10
View File
@@ -7,6 +7,16 @@
; Please visit documentation for the other options and examples ; Please visit documentation for the other options and examples
; http://docs.platformio.org/page/projectconf.html ; http://docs.platformio.org/page/projectconf.html
[env:briki_abc_esp32]
platform = espressif32
board = briki_abc_esp32
framework = arduino
[env:briki_mbc-wb_esp32]
platform = espressif32
board = briki_mbc-wb_esp32
framework = arduino
[env:esp wrover kit] [env:esp wrover kit]
platform = espressif32 platform = espressif32
framework = arduino framework = arduino
+10
View File
@@ -7,6 +7,16 @@
; Please visit documentation for the other options and examples ; Please visit documentation for the other options and examples
; http://docs.platformio.org/page/projectconf.html ; http://docs.platformio.org/page/projectconf.html
[env:briki_abc_esp32]
platform = espressif32
board = briki_abc_esp32
framework = arduino
[env:briki_mbc-wb_esp32]
platform = espressif32
board = briki_mbc-wb_esp32
framework = arduino
[env:esp32dev] [env:esp32dev]
platform = espressif32 platform = espressif32
framework = arduino framework = arduino
+11 -1
View File
@@ -17,7 +17,8 @@
"https://dl.bintray.com/platformio/dl-packages/manifest.json", "https://dl.bintray.com/platformio/dl-packages/manifest.json",
"http://dl.platformio.org/packages/manifest.json", "http://dl.platformio.org/packages/manifest.json",
"https://raw.githubusercontent.com/eerimoq/simba/master/make/platformio/manifest.json", "https://raw.githubusercontent.com/eerimoq/simba/master/make/platformio/manifest.json",
"https://raw.githubusercontent.com/eerimoq/pumbaa/master/make/platformio/manifest.json" "https://raw.githubusercontent.com/eerimoq/pumbaa/master/make/platformio/manifest.json",
"https://briki.org/download/resources/manifest.json"
], ],
"frameworks": { "frameworks": {
"arduino": { "arduino": {
@@ -52,6 +53,11 @@
"optional": true, "optional": true,
"version": "~3.10004.191002" "version": "~3.10004.191002"
}, },
"framework-arduino-mbcwb": {
"type": "framework",
"optional": true,
"version": ">=2.1.1"
},
"framework-espidf": { "framework-espidf": {
"type": "framework", "type": "framework",
"optional": true, "optional": true,
@@ -70,6 +76,10 @@
"tool-esptoolpy": { "tool-esptoolpy": {
"type": "uploader", "type": "uploader",
"version": "~1.20600.0" "version": "~1.20600.0"
},
"tool-mbctool": {
"type": "uploader",
"version": ">=2.0.0"
}, },
"tool-openocd-esp32": { "tool-openocd-esp32": {
"type": "debugger", "type": "debugger",
+7
View File
@@ -35,6 +35,13 @@ class Espressif32Platform(PlatformBase):
self.packages[p]['optional'] = False self.packages[p]['optional'] = False
self.packages['toolchain-xtensa32']['version'] = "~2.80200.0" self.packages['toolchain-xtensa32']['version'] = "~2.80200.0"
build_core = variables.get(
"board_build.core", self.board_config(variables.get("board")).get(
"build.core", "arduino")).lower()
if build_core == 'mbcwb':
self.packages["framework-arduinoespressif32"]["optional"] = True
self.packages["framework-arduino-mbcwb"]["optional"] = False
return PlatformBase.configure_default_packages(self, variables, return PlatformBase.configure_default_packages(self, variables,
targets) targets)