From 63870fd8257fe69f7bee525e6b0582a731e18a73 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 29 Jan 2015 23:55:17 +0200 Subject: [PATCH 1/9] Add support for ARM-based credit-card computers: Raspberry Pi, BeagleBoard and CubieBoard --- HISTORY.rst | 4 +++- docs/index.rst | 30 ++++++++++++++++++++-------- docs/installation.rst | 12 ++++++----- docs/platforms/creating_platform.rst | 2 +- docs/platforms/index.rst | 2 +- docs/userguide/cmd_serialports.rst | 2 ++ 6 files changed, 36 insertions(+), 16 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 5d6194ad..a57557c4 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,8 @@ Release History 0.11.0 (2015-?) --------------- +* Added support for *ARM*-based credit-card computers: `Raspberry Pi `_, + `BeagleBoard `_ and `CubieBoard `_ * Refactored *Library Dependency Finder* (issues `#48 `_, `#50 `_, @@ -13,7 +15,7 @@ Release History command which allows to return the output in `JSON `_ format (`issue #42 `_) * Allowed to ignore some libs from *Library Dependency Finder* via - `ignore_libs `_ option * Fixed an issue with the libraries that are git repositories (`issue #49 `_) diff --git a/docs/index.rst b/docs/index.rst index ee2680b9..f0b272f2 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -21,17 +21,31 @@ platforms using only one command :ref:`cmd_run`. This happens due to options: platform type, firmware uploading settings, pre-built framework and many more. -Each platform consists of packages which are located in own repository. -Due to :ref:`cmd_update` command you will have up-to-date development -instruments. +Embedded Development. *Easier Than Ever.* +----------------------------------------- -**PlatformIO** is well suited for **embedded development**. It can: +* Colourful command-line output +* Built-in :ref:`Serial Port Monitor ` +* Configurable build :ref:`-flags/-options ` +* Integration with :ref:`development environments (IDE) ` +* Pre-built tool chains, frameworks for the popular Hardware Platforms -* Automatically analyse dependency -* Reliably detect build changes -* Build framework or library source code to static library +Smart Code Builder. *Fast and Reliable.* +---------------------------------------- + +* Reliable, automatic dependency analysis and detection of build changes +* Improved support for parallel builds +* Ability to share built files in a cache * Lookup for external libraries which are installed via :ref:`librarymanager` -* Upload firmware to your device + +The Missing Library Manager. *It's here!* +----------------------------------------- + +* Friendly Command-Line Interface +* Modern `Web 2.0 Library Search `_ +* Library dependency management +* Automatic library updating +* It runs on Windows, Mac OS X, and Linux (+ARM). Contents diff --git a/docs/installation.rst b/docs/installation.rst index 386b5532..49a58742 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -3,16 +3,18 @@ Installation ============ -*PlatformIO* is written in `Python `_ and works -on *Mac OS X*, *Linux*, *Windows OS* and Credit-card *ARM*-based -computers (*Raspberry Pi*). +**PlatformIO** is written in `Python `_ and works +on Mac OS X, Linux, Windows OS and *ARM*-based credit-card +computers (`Raspberry Pi `_, +`BeagleBoard `_, +`CubieBoard `_). System requirements ------------------- * **Operating systems:** * Mac OS X - * Linux + * Linux, +ARM * Windows * `Python 2.6 or Python 2.7 `_ @@ -36,7 +38,7 @@ Super-Quick (Mac / Linux) ------------------------- To install or upgrade *PlatformIO* paste that at a *Terminal* prompt -(you might need to run ``sudo`` first): +(**you might need** to run ``sudo`` first): .. code-block:: bash diff --git a/docs/platforms/creating_platform.rst b/docs/platforms/creating_platform.rst index 8b67ede2..f135c5ae 100644 --- a/docs/platforms/creating_platform.rst +++ b/docs/platforms/creating_platform.rst @@ -34,7 +34,7 @@ Packages -------- *PlatformIO* has pre-built packages for the most popular operation systems: -*Mac OS*, *Linux (+ARMv6)* and *Windows*. +*Mac OS*, *Linux (+ARM)* and *Windows*. .. list-table:: :header-rows: 1 diff --git a/docs/platforms/index.rst b/docs/platforms/index.rst index fa41ce83..29ea4168 100644 --- a/docs/platforms/index.rst +++ b/docs/platforms/index.rst @@ -4,7 +4,7 @@ Platforms & Embedded Boards =========================== *PlatformIO* has pre-built different development platforms for popular OS -(*Mac OS X, Linux (+ARMv6) and Windows*). Each of them include compiler, +(*Mac OS X, Linux (+ARM) and Windows*). Each of them include compiler, debugger, uploader (for embedded) and many other useful tools. Also it has pre-configured settings for most popular **Embedded Platform diff --git a/docs/userguide/cmd_serialports.rst b/docs/userguide/cmd_serialports.rst index 612429b3..360877ec 100644 --- a/docs/userguide/cmd_serialports.rst +++ b/docs/userguide/cmd_serialports.rst @@ -65,6 +65,8 @@ Examples Description: Silicon Labs CP210x USB to UART Bridge (COM3) +.. _cmd_serialports_monitor: + platformio serialports monitor ------------------------------ From 8926e27c468839ff36ee79f2c244f2bac4e94ff3 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 30 Jan 2015 23:24:37 +0200 Subject: [PATCH 2/9] Fix bug with "ignore_pattern" for BuildLibrary when path contains "examples" --- platformio/builder/tools/platformio.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index 7bb942b6..731feb73 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -56,8 +56,10 @@ def GlobCXXFiles(env, path): return files -def VariantDirRecursive(env, variant_dir, src_dir, duplicate=True): - ignore_pattern = (".git", ".svn", "examples") +def VariantDirRecursive(env, variant_dir, src_dir, duplicate=True, + ignore_pattern=None): + if not ignore_pattern: + ignore_pattern = (".git", ".svn") variants = [] src_dir = env.subst(src_dir) for root, _, _ in walk(src_dir): @@ -72,7 +74,8 @@ def VariantDirRecursive(env, variant_dir, src_dir, duplicate=True): def BuildLibrary(env, variant_dir, library_dir): lib = env.Clone() - vdirs = lib.VariantDirRecursive(variant_dir, library_dir) + vdirs = lib.VariantDirRecursive( + variant_dir, library_dir, ignore_pattern=(".git", ".svn", "examples")) return lib.Library( lib.subst(variant_dir), [lib.GlobCXXFiles(vdir) for vdir in vdirs] From 4bb513e460a6445f93a52e966e4672cb6b73c0e4 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 31 Jan 2015 17:19:07 +0200 Subject: [PATCH 3/9] Apply "ignore_pattern" for BuildLibrary to variant directory --- platformio/builder/tools/platformio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index 731feb73..62622cd4 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -65,7 +65,7 @@ def VariantDirRecursive(env, variant_dir, src_dir, duplicate=True, for root, _, _ in walk(src_dir): _src_dir = root _var_dir = variant_dir + root.replace(src_dir, "") - if any([s in _src_dir.lower() for s in ignore_pattern]): + if any([s in _var_dir.lower() for s in ignore_pattern]): continue env.VariantDir(_var_dir, _src_dir, duplicate) variants.append(_var_dir) From 49b7cf6008de73084a48a1573f0f6497a810b739 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 31 Jan 2015 17:34:17 +0200 Subject: [PATCH 4/9] Enable by default "lib cyclic dependencies" for atmelavr platform // Resolve #50 --- platformio/builder/scripts/atmelavr.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platformio/builder/scripts/atmelavr.py b/platformio/builder/scripts/atmelavr.py index dc02c28b..705f3e67 100644 --- a/platformio/builder/scripts/atmelavr.py +++ b/platformio/builder/scripts/atmelavr.py @@ -52,8 +52,9 @@ env.Replace( LINKFLAGS=[ "-Os", + "-mmcu=$BOARD_MCU", "-Wl,--gc-sections", - "-mmcu=$BOARD_MCU" + "-Wl,--start-group" ], UPLOADER=join("$PIOPACKAGES_DIR", "tool-avrdude", "avrdude"), From 977f30d617727d711e15393c4353e4195a588638 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 31 Jan 2015 17:40:48 +0200 Subject: [PATCH 5/9] Added new boards to "atmelavr" platform: Arduino NG, Arduino BT, Arduino Esplora, Arduino Ethernet, Arduino Robot Control, Arduino Robot Motor and Arduino Yun --- HISTORY.rst | 3 ++ docs/platforms/atmelavr.rst | 76 ++++++++++++++++++++++++++++++---- platformio/boards/arduino.json | 2 +- 3 files changed, 73 insertions(+), 8 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index a57557c4..0c1fa5af 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -6,6 +6,9 @@ Release History * Added support for *ARM*-based credit-card computers: `Raspberry Pi `_, `BeagleBoard `_ and `CubieBoard `_ +* Added new boards to `atmelavr `_ + platform: *Arduino NG, Arduino BT, Arduino Esplora, Arduino Ethernet, + Arduino Robot Control, Arduino Robot Motor and Arduino Yun* * Refactored *Library Dependency Finder* (issues `#48 `_, `#50 `_, diff --git a/docs/platforms/atmelavr.rst b/docs/platforms/atmelavr.rst index 9e9722d9..fbd1cbc4 100644 --- a/docs/platforms/atmelavr.rst +++ b/docs/platforms/atmelavr.rst @@ -75,6 +75,34 @@ Arduino - Frequency ``board_f_cpu`` - Flash - RAM + * - ``atmegangatmega168`` + - `Arduino NG or older (ATmega168) + `_ + - ATmega168 ``atmega168`` + - 16 MHz ``16000000L`` + - 16 Kb + - 1 Kb + * - ``atmegangatmega8`` + - `Arduino Arduino NG or older (ATmega8) + `_ + - ATmega8 ``atmega8`` + - 16 MHz ``16000000L`` + - 8 Kb + - 1 Kb + * - ``btatmega168`` + - `Arduino BT (ATmega168) + `_ + - ATmega168 ``atmega168`` + - 16 MHz ``16000000L`` + - 16 Kb + - 1 Kb + * - ``btatmega328`` + - `Arduino BT (ATmega328) + `_ + - ATmega328 ``atmega328`` + - 16 MHz ``16000000L`` + - 32 Kb + - 2 Kb * - ``diecimilaatmega168`` - `Arduino Diecimila or Duemilanove (ATmega168) `_ @@ -89,6 +117,19 @@ Arduino - 16 MHz ``16000000L`` - 32 Kb - 2 Kb + * - ``esplora`` + - `Arduino Esplora `_ + - ATmega32u4 ``atmega32u4`` + - 16 MHz ``16000000L`` + - 32 Kb + - 2.5 Kb + * - ``ethernet`` + - `Arduino Ethernet + `_ + - ATmega328P ``atmega328p`` + - 16 MHz ``16000000L`` + - 32 Kb + - 2 Kb * - ``fio`` - `Arduino Fio `_ @@ -123,6 +164,13 @@ Arduino - 8 MHz ``8000000L`` - 32 Kb - 2 Kb + * - ``megaADK`` + - `Arduino Mega ADK + `_ + - ATmega2560 ``atmega2560`` + - 16 MHz ``16000000L`` + - 256 Kb + - 8 Kb * - ``megaatmega1280`` - `Arduino Mega (ATmega1280) `_ @@ -137,13 +185,6 @@ Arduino - 16 MHz ``16000000L`` - 256 Kb - 8 Kb - * - ``megaADK`` - - `Arduino Mega ADK - `_ - - ATmega2560 ``atmega2560`` - - 16 MHz ``16000000L`` - - 256 Kb - - 8 Kb * - ``micro`` - `Arduino Micro `_ @@ -207,6 +248,20 @@ Arduino - 16 MHz ``16000000L`` - 32 Kb - 2 Kb + * - ``robotControl`` + - `Arduino Robot Control + `_ + - ATmega32u4 ``atmega32u4`` + - 16 MHz ``16000000L`` + - 32 Kb + - 2.5 Kb + * - ``robotMotor`` + - `Arduino Robot Motor + `_ + - ATmega32u4 ``atmega32u4`` + - 16 MHz ``16000000L`` + - 32 Kb + - 2.5 Kb * - ``uno`` - `Arduino Uno `_ @@ -214,6 +269,13 @@ Arduino - 16 MHz ``16000000L`` - 32 Kb - 2 Kb + * - ``yun`` + - `Arduino Yun + `_ + - ATmega32u4 ``atmega32u4`` + - 16 MHz ``16000000L`` + - 32 Kb + - 2.5 Kb More detailed information you can find here `Arduino boards `_. diff --git a/platformio/boards/arduino.json b/platformio/boards/arduino.json index 3e86b106..4d84f47a 100644 --- a/platformio/boards/arduino.json +++ b/platformio/boards/arduino.json @@ -537,4 +537,4 @@ "wait_for_upload_port": true } } -} \ No newline at end of file +} From 673c484fa789a3c04ee1b4a6af172b86587ad72e Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 31 Jan 2015 22:42:52 +0200 Subject: [PATCH 6/9] Ask about "auto-uploading" within "platformio init" command --- docs/quickstart.rst | 14 ++++++--- docs/userguide/cmd_init.rst | 40 ++++++++++++++++++-------- platformio/builder/scripts/atmelavr.py | 4 +-- platformio/commands/init.py | 27 +++++++++++++---- 4 files changed, 61 insertions(+), 24 deletions(-) diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 773a416e..1ad7e264 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -19,17 +19,23 @@ Quickstart $ platformio init --board=TYPE_1 --board=TYPE_2 --board=TYPE_N + Would you like to enable firmware auto-uploading when project is successfully built using `platformio run` command? + Don't forget that you can upload firmware manually using `platformio run --target upload` command. [y/N]: y + The current working directory *** will be used for the new project. You can specify another project directory via `platformio init -d %PATH_TO_THE_PROJECT_DIR%` command. The next files/directories will be created in *** - `platformio.ini` - Project Configuration File - `src` - a source directory. Put your source code here - `lib` - a directory for the project specific libraries + platformio.ini - Project Configuration File. |-> PLEASE EDIT ME <-| + src - Put your source code here + lib - Put here project specific or 3-rd party libraries Do you want to continue? [y/N]: y Project has been successfully initialized! - Now you can process it with `platformio run` command. + Useful commands: + `platformio run` - process/build project from the current directory + `platformio run --target upload` or `platformio run -t upload` - upload firmware to embedded board + `platformio run --target clean` - clean project (remove compiled files) Put your source code ``*.h, *.c, *.cpp or *.ino`` files to ``src`` directory. diff --git a/docs/userguide/cmd_init.rst b/docs/userguide/cmd_init.rst index 295d2b89..4890adf1 100644 --- a/docs/userguide/cmd_init.rst +++ b/docs/userguide/cmd_init.rst @@ -68,12 +68,15 @@ Examples `platformio init -d %PATH_TO_THE_PROJECT_DIR%` command. The next files/directories will be created in *** - platformio.ini - Project Configuration File - src - a source directory. Put your source code here - lib - a directory for the project specific libraries + platformio.ini - Project Configuration File. |-> PLEASE EDIT ME <-| + src - Put your source code here + lib - Put here project specific or 3-rd party libraries Do you want to continue? [y/N]: y Project has been successfully initialized! - Now you can process it with `platformio run` command. + Useful commands: + `platformio run` - process/build project from the current directory + `platformio run --target upload` or `platformio run -t upload` - upload firmware to embedded board + `platformio run --target clean` - clean project (remove compiled files) 2. Create new project in the specified directory @@ -83,12 +86,15 @@ Examples $ platformio init -d %PATH_TO_DIR% The next files/directories will be created in *** - platformio.ini - Project Configuration File - src - a source directory. Put your source code here - lib - a directory for the project specific libraries + platformio.ini - Project Configuration File. |-> PLEASE EDIT ME <-| + src - Put your source code here + lib - Put here project specific or 3-rd party libraries Do you want to continue? [y/N]: y Project has been successfully initialized! - Now you can process it with `platformio run` command. + Useful commands: + `platformio run` - process/build project from the current directory + `platformio run --target upload` or `platformio run -t upload` - upload firmware to embedded board + `platformio run --target clean` - clean project (remove compiled files) 3. Initialise project for Arduino Uno @@ -96,10 +102,20 @@ Examples $ platformio init --board uno + Would you like to enable firmware auto-uploading when project is successfully built using `platformio run` command? + Don't forget that you can upload firmware manually using `platformio run --target upload` command. [y/N]: y + + The current working directory *** will be used for the new project. + You can specify another project directory via + `platformio init -d %PATH_TO_THE_PROJECT_DIR%` command. + The next files/directories will be created in *** - platformio.ini - Project Configuration File - src - a source directory. Put your source code here - lib - a directory for the project specific libraries + platformio.ini - Project Configuration File. |-> PLEASE EDIT ME <-| + src - Put your source code here + lib - Put here project specific or 3-rd party libraries Do you want to continue? [y/N]: y Project has been successfully initialized! - Now you can process it with `platformio run` command. + Useful commands: + `platformio run` - process/build project from the current directory + `platformio run --target upload` or `platformio run -t upload` - upload firmware to embedded board + `platformio run --target clean` - clean project (remove compiled files) diff --git a/platformio/builder/scripts/atmelavr.py b/platformio/builder/scripts/atmelavr.py index 705f3e67..16734e4c 100644 --- a/platformio/builder/scripts/atmelavr.py +++ b/platformio/builder/scripts/atmelavr.py @@ -190,8 +190,8 @@ if is_uptarget: break if "UPLOAD_PORT" not in env: - Exit("Please specify environment 'upload_port' or use global " - "--upload-port option.") + print("WARNING!!! Please specify environment 'upload_port' or use " + "global --upload-port option.\n") # # Setup default targets diff --git a/platformio/commands/init.py b/platformio/commands/init.py index f81cf5e4..31dc7a39 100644 --- a/platformio/commands/init.py +++ b/platformio/commands/init.py @@ -30,8 +30,17 @@ def cli(project_dir, board, disable_auto_uploading): if board and not set(board).issubset(builtin_boards): raise UnknownBoard(", ".join(set(board).difference(builtin_boards))) + # ask about auto-uploading + if board and app.get_setting("enable_prompts"): + disable_auto_uploading = not click.confirm( + "\nWould you like to enable firmware auto-uploading when project " + "is successfully built using `platformio run` command? \n" + "Don't forget that you can upload firmware manually using " + "`platformio run --target upload` command." + ) + if project_dir == getcwd(): - click.secho("The current working directory", fg="yellow", nl=False) + click.secho("\nThe current working directory", fg="yellow", nl=False) click.secho(" %s " % project_dir, fg="cyan", nl=False) click.secho( "will be used for the new project.\n" @@ -42,15 +51,16 @@ def cli(project_dir, board, disable_auto_uploading): click.echo("The next files/directories will be created in %s" % click.style(project_dir, fg="cyan")) - click.echo("%s - Project Configuration File" % + click.echo("%s - Project Configuration File. |-> PLEASE EDIT ME <-|" % click.style("platformio.ini", fg="cyan")) - click.echo("%s - a source directory. Put your source code here" % + click.echo("%s - Put your source code here" % click.style("src", fg="cyan")) - click.echo("%s - a directory for the project specific libraries" % + click.echo("%s - Put here project specific or 3-rd party libraries" % click.style("lib", fg="cyan")) if (not app.get_setting("enable_prompts") or click.confirm("Do you want to continue?")): + for d in (src_dir, lib_dir): if not isdir(d): makedirs(d) @@ -60,8 +70,13 @@ def cli(project_dir, board, disable_auto_uploading): if board: fill_project_envs(project_file, board, disable_auto_uploading) click.secho( - "Project has been successfully initialized!\n" - "Now you can process it with `platformio run` command.", + "Project has been successfully initialized!\nUseful commands:\n" + "`platformio run` - process/build project from the current " + "directory\n" + "`platformio run --target upload` or `platformio run -t upload` " + "- upload firmware to embedded board\n" + "`platformio run --target clean` - clean project (remove compiled " + "files)", fg="green" ) else: From a7fc1846623ae3628a2a34a5f93fe92c7ed5294a Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 31 Jan 2015 22:45:50 +0200 Subject: [PATCH 7/9] Remove unused import --- platformio/builder/scripts/atmelavr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/builder/scripts/atmelavr.py b/platformio/builder/scripts/atmelavr.py index 16734e4c..b3070b95 100644 --- a/platformio/builder/scripts/atmelavr.py +++ b/platformio/builder/scripts/atmelavr.py @@ -9,7 +9,7 @@ from os.path import join from time import sleep from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Builder, Default, - DefaultEnvironment, Exit) + DefaultEnvironment) from platformio.util import get_serialports From 666c6c70ca0d9769d65e90b2734e788dd3beb87c Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 31 Jan 2015 23:13:53 +0200 Subject: [PATCH 8/9] Improve "cyclic dependencies" for "Library Dependencies Finder" // Resolve #50 --- platformio/builder/scripts/atmelavr.py | 3 +-- platformio/builder/tools/platformio.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/platformio/builder/scripts/atmelavr.py b/platformio/builder/scripts/atmelavr.py index b3070b95..55dc2d74 100644 --- a/platformio/builder/scripts/atmelavr.py +++ b/platformio/builder/scripts/atmelavr.py @@ -53,8 +53,7 @@ env.Replace( LINKFLAGS=[ "-Os", "-mmcu=$BOARD_MCU", - "-Wl,--gc-sections", - "-Wl,--start-group" + "-Wl,--gc-sections" ], UPLOADER=join("$PIOPACKAGES_DIR", "tool-avrdude", "avrdude"), diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index 62622cd4..ab982f8c 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -211,7 +211,7 @@ def BuildDependentLibraries(env, src_dir): # pylint: disable=R0914 if isdir(join(ld, "utility"))]) libs = [] - for (libname, inc_dir) in deplibs: + for (libname, inc_dir) in reversed(deplibs): lib = env.BuildLibrary( join("$BUILD_DIR", libname), inc_dir) env.Clean(libname, lib) From 9bd4047425baacfbd92ab6e48075958c2c4ff3cc Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 31 Jan 2015 23:22:24 +0200 Subject: [PATCH 9/9] Revert "cyclic dependencies" flag to "atmelavr" platform --- platformio/builder/scripts/atmelavr.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platformio/builder/scripts/atmelavr.py b/platformio/builder/scripts/atmelavr.py index 55dc2d74..b3070b95 100644 --- a/platformio/builder/scripts/atmelavr.py +++ b/platformio/builder/scripts/atmelavr.py @@ -53,7 +53,8 @@ env.Replace( LINKFLAGS=[ "-Os", "-mmcu=$BOARD_MCU", - "-Wl,--gc-sections" + "-Wl,--gc-sections", + "-Wl,--start-group" ], UPLOADER=join("$PIOPACKAGES_DIR", "tool-avrdude", "avrdude"),