mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Add Silicon Labs EFM32 development platform // Resolve #226
This commit is contained in:
@ -47,3 +47,9 @@ board = nucleo_f401re
|
||||
platform = teensy
|
||||
framework = mbed
|
||||
board = teensy31
|
||||
|
||||
# Silicon Labs EFM32 Platform
|
||||
[env:siliconlabsefm32]
|
||||
platform = siliconlabsefm32
|
||||
framework = mbed
|
||||
board = efm32hg_stk3400
|
||||
|
86
platformio/boards/siliconlabsefm32.json
Normal file
86
platformio/boards/siliconlabsefm32.json
Normal file
@ -0,0 +1,86 @@
|
||||
{
|
||||
"efm32wg_stk3800": {
|
||||
"build": {
|
||||
"f_cpu": "48000000L",
|
||||
"cpu": "cortex-m4",
|
||||
"mcu": "efm32wg990f256"
|
||||
},
|
||||
"frameworks": ["mbed"],
|
||||
"name": "Silicon Labs EFM32WG-STK3800 (Wonder Gecko)",
|
||||
"platform": "siliconlabsefm32",
|
||||
"upload": {
|
||||
"maximum_ram_size": 32768,
|
||||
"maximum_size": 262144
|
||||
},
|
||||
"url": "https://developer.mbed.org/platforms/EFM32-Wonder-Gecko/",
|
||||
"vendor": "Silicon Labs"
|
||||
},
|
||||
|
||||
"efm32gg_stk3700": {
|
||||
"build": {
|
||||
"f_cpu": "48000000L",
|
||||
"cpu": "cortex-m3",
|
||||
"mcu": "efm32gg990f1024"
|
||||
},
|
||||
"frameworks": ["mbed"],
|
||||
"name": "Silicon Labs EFM32GG-STK3700 (Giant Gecko)",
|
||||
"platform": "siliconlabsefm32",
|
||||
"upload": {
|
||||
"maximum_ram_size": 131072,
|
||||
"maximum_size": 1048576
|
||||
},
|
||||
"url": "https://developer.mbed.org/platforms/EFM32-Giant-Gecko/",
|
||||
"vendor": "Silicon Labs"
|
||||
},
|
||||
|
||||
"efm32lg_stk3600": {
|
||||
"build": {
|
||||
"f_cpu": "48000000L",
|
||||
"cpu": "cortex-m3",
|
||||
"mcu": "efm32lg990f256"
|
||||
},
|
||||
"frameworks": ["mbed"],
|
||||
"name": "Silicon Labs EFM32LG-STK3600 (Leopard Gecko)",
|
||||
"platform": "siliconlabsefm32",
|
||||
"upload": {
|
||||
"maximum_ram_size": 32768,
|
||||
"maximum_size": 262144
|
||||
},
|
||||
"url": "https://developer.mbed.org/platforms/EFM32-Leopard-Gecko/",
|
||||
"vendor": "Silicon Labs"
|
||||
},
|
||||
|
||||
"efm32zg_stk3200": {
|
||||
"build": {
|
||||
"f_cpu": "24000000L",
|
||||
"cpu": "cortex-m0plus",
|
||||
"mcu": "efm2zg222f32"
|
||||
},
|
||||
"frameworks": ["mbed"],
|
||||
"name": "Silicon Labs EFM32ZG-STK3200 (Zero Gecko)",
|
||||
"platform": "siliconlabsefm32",
|
||||
"upload": {
|
||||
"maximum_ram_size": 4096,
|
||||
"maximum_size": 32768
|
||||
},
|
||||
"url": "https://developer.mbed.org/platforms/EFM32-Zero-Gecko/",
|
||||
"vendor": "Silicon Labs"
|
||||
},
|
||||
|
||||
"efm32hg_stk3400": {
|
||||
"build": {
|
||||
"f_cpu": "24000000L",
|
||||
"cpu": "cortex-m3",
|
||||
"mcu": "efm32hg322f64"
|
||||
},
|
||||
"frameworks": ["mbed"],
|
||||
"name": "Silicon Labs SLSTK3400A USB-enabled (Happy Gecko)",
|
||||
"platform": "siliconlabsefm32",
|
||||
"upload": {
|
||||
"maximum_ram_size": 8192,
|
||||
"maximum_size": 65536
|
||||
},
|
||||
"url": "https://developer.mbed.org/platforms/EFM32-Happy-Gecko/",
|
||||
"vendor": "Silicon Labs"
|
||||
}
|
||||
}
|
50
platformio/builder/scripts/siliconlabsefm32.py
Normal file
50
platformio/builder/scripts/siliconlabsefm32.py
Normal file
@ -0,0 +1,50 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
"""
|
||||
Builder for Silicon Labs EFM32 series ARM microcontrollers.
|
||||
"""
|
||||
|
||||
from os.path import join
|
||||
|
||||
from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Default,
|
||||
DefaultEnvironment, SConscript)
|
||||
|
||||
env = DefaultEnvironment()
|
||||
|
||||
SConscript(env.subst(join("$PIOBUILDER_DIR", "scripts", "basearm.py")))
|
||||
|
||||
#
|
||||
# Target: Build executable and linkable firmware
|
||||
#
|
||||
|
||||
target_elf = env.BuildFirmware()
|
||||
|
||||
#
|
||||
# Target: Build the .bin file
|
||||
#
|
||||
|
||||
if "uploadlazy" in COMMAND_LINE_TARGETS:
|
||||
target_firm = join("$BUILD_DIR", "firmware.bin")
|
||||
else:
|
||||
target_firm = env.ElfToBin(join("$BUILD_DIR", "firmware"), target_elf)
|
||||
|
||||
#
|
||||
# Target: Print binary size
|
||||
#
|
||||
|
||||
target_size = env.Alias("size", target_elf, "$SIZEPRINTCMD")
|
||||
AlwaysBuild(target_size)
|
||||
|
||||
#
|
||||
# Target: Upload by default .bin file
|
||||
#
|
||||
|
||||
upload = env.Alias(["upload", "uploadlazy"], target_firm, env.UploadToDisk)
|
||||
AlwaysBuild(upload)
|
||||
|
||||
#
|
||||
# Target: Define targets
|
||||
#
|
||||
|
||||
Default([target_firm, target_size])
|
36
platformio/platforms/siliconlabsefm32.py
Normal file
36
platformio/platforms/siliconlabsefm32.py
Normal file
@ -0,0 +1,36 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
from platformio.platforms.base import BasePlatform
|
||||
|
||||
|
||||
class Siliconlabsefm32Platform(BasePlatform):
|
||||
|
||||
"""
|
||||
Silicon Labs EFM32 Gecko 32-bit microcontroller (MCU) family includes
|
||||
devices that offer flash memory configurations up to 256 kB, 32 kB of
|
||||
RAM and CPU speeds up to 48 MHz.
|
||||
|
||||
Based on the powerful ARM Cortex-M core, the Gecko family features
|
||||
innovative low energy techniques, short wake-up time from energy saving
|
||||
modes and a wide selection of peripherals, making it ideal for battery
|
||||
operated applications and other systems requiring high performance and
|
||||
low-energy consumption.
|
||||
|
||||
http://www.silabs.com/products/mcu/32-bit/efm32-gecko/Pages/efm32-gecko.aspx
|
||||
"""
|
||||
|
||||
PACKAGES = {
|
||||
|
||||
"toolchain-gccarmnoneeabi": {
|
||||
"alias": "toolchain",
|
||||
"default": True
|
||||
},
|
||||
|
||||
"framework-mbed": {
|
||||
"default": True
|
||||
}
|
||||
}
|
||||
|
||||
def get_name(self):
|
||||
return "Silicon Labs EFM32"
|
Reference in New Issue
Block a user