From 882bddf77eaacd611899096f8f151836bc58f4ca Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 3 Jun 2016 00:42:52 +0300 Subject: [PATCH 01/13] Revert back some code linked with uploading to Leonardo/Due --- platformio/__init__.py | 2 +- platformio/builder/scripts/atmelavr.py | 6 +++++- platformio/builder/scripts/atmelsam.py | 6 +++++- platformio/builder/tools/pioupload.py | 3 +-- platformio/util.py | 2 +- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index e6127e13..31611539 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (2, 9, 2) +VERSION = (2, 9, "3.dev0") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/builder/scripts/atmelavr.py b/platformio/builder/scripts/atmelavr.py index 26370f22..a4b53263 100644 --- a/platformio/builder/scripts/atmelavr.py +++ b/platformio/builder/scripts/atmelavr.py @@ -22,6 +22,8 @@ from time import sleep from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Default, DefaultEnvironment, SConscript) +from platformio.util import get_serialports + def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 @@ -63,11 +65,13 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 if not upload_options.get("disable_flushing", False): env.FlushSerialBuffer("$UPLOAD_PORT") + before_ports = [i['port'] for i in get_serialports(use_grep=True)] + if upload_options.get("use_1200bps_touch", False): env.TouchSerialPort("$UPLOAD_PORT", 1200) if upload_options.get("wait_for_upload_port", False): - env.Replace(UPLOAD_PORT=env.WaitForNewSerialPort()) + env.Replace(UPLOAD_PORT=env.WaitForNewSerialPort(before_ports)) env = DefaultEnvironment() diff --git a/platformio/builder/scripts/atmelsam.py b/platformio/builder/scripts/atmelsam.py index 7cf50a31..a78febf0 100644 --- a/platformio/builder/scripts/atmelsam.py +++ b/platformio/builder/scripts/atmelsam.py @@ -21,6 +21,8 @@ from os.path import basename, join from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Default, DefaultEnvironment, SConscript) +from platformio.util import get_serialports + def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 env.AutodetectUploadPort() @@ -39,11 +41,13 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 if not upload_options.get("disable_flushing", False): env.FlushSerialBuffer("$UPLOAD_PORT") + before_ports = [i['port'] for i in get_serialports(use_grep=True)] + if upload_options.get("use_1200bps_touch", False): env.TouchSerialPort("$UPLOAD_PORT", 1200) if upload_options.get("wait_for_upload_port", False): - env.Replace(UPLOAD_PORT=env.WaitForNewSerialPort()) + env.Replace(UPLOAD_PORT=env.WaitForNewSerialPort(before_ports)) # use only port name for BOSSA if "/" in env.subst("$UPLOAD_PORT"): diff --git a/platformio/builder/tools/pioupload.py b/platformio/builder/tools/pioupload.py index cb973b92..aeb71000 100644 --- a/platformio/builder/tools/pioupload.py +++ b/platformio/builder/tools/pioupload.py @@ -47,8 +47,7 @@ def TouchSerialPort(env, port, baudrate): sleep(0.4) -def WaitForNewSerialPort(env): - before = [i['port'] for i in get_serialports(use_grep=True)] +def WaitForNewSerialPort(env, before): sleep(0.5) new_port = None elapsed = 0 diff --git a/platformio/util.py b/platformio/util.py index 221c6d9b..13a9b9e6 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -325,7 +325,7 @@ def get_serialports(use_grep=False): result.append({"port": p, "description": d, "hwid": h}) # fix for PySerial - if not result and not use_grep: + if not result and not use_grep and system() == "Darwin": result = _grep_serial_ports() return result From 190ffab76d75ab786da2f328d2f2ff6a93e3a1e6 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 3 Jun 2016 01:16:16 +0300 Subject: [PATCH 02/13] Hook when new serial port is the same in boot mode --- platformio/builder/tools/pioupload.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platformio/builder/tools/pioupload.py b/platformio/builder/tools/pioupload.py index aeb71000..902a162b 100644 --- a/platformio/builder/tools/pioupload.py +++ b/platformio/builder/tools/pioupload.py @@ -48,7 +48,6 @@ def TouchSerialPort(env, port, baudrate): def WaitForNewSerialPort(env, before): - sleep(0.5) new_port = None elapsed = 0 while elapsed < 10: @@ -62,6 +61,9 @@ def WaitForNewSerialPort(env, before): sleep(0.25) elapsed += 0.25 + if not new_port and env.subst("$UPLOAD_PORT") in now: + new_port = env.subst("$UPLOAD_PORT") + if not new_port: env.Exit("Error: Couldn't find a board on the selected port. " "Check that you have the correct port selected. " From c815e0fadc62b443ff0492c34b088ae415d15be0 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 3 Jun 2016 01:29:18 +0300 Subject: [PATCH 03/13] Add explanation about waiting for the new serial port --- platformio/builder/tools/pioupload.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platformio/builder/tools/pioupload.py b/platformio/builder/tools/pioupload.py index 902a162b..caebdb56 100644 --- a/platformio/builder/tools/pioupload.py +++ b/platformio/builder/tools/pioupload.py @@ -48,9 +48,10 @@ def TouchSerialPort(env, port, baudrate): def WaitForNewSerialPort(env, before): + print "Waiting for the new upload port..." new_port = None elapsed = 0 - while elapsed < 10: + while elapsed < 5: now = [i['port'] for i in get_serialports(use_grep=True)] diff = list(set(now) - set(before)) if diff: @@ -63,7 +64,6 @@ def WaitForNewSerialPort(env, before): if not new_port and env.subst("$UPLOAD_PORT") in now: new_port = env.subst("$UPLOAD_PORT") - if not new_port: env.Exit("Error: Couldn't find a board on the selected port. " "Check that you have the correct port selected. " From fb08322c175116ba66e8d0aaea8d7f7b8fc5e6ed Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 3 Jun 2016 13:58:51 +0300 Subject: [PATCH 04/13] Fix firmware uploading to the embedded boards with SAM-BA bootloader --- HISTORY.rst | 5 +++++ scripts/99-platformio-udev.rules | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 5aa6b40d..d4175898 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,11 @@ Release Notes PlatformIO 2.0 -------------- +2.9.3 (2016-06-??) +~~~~~~~~~~~~~~~~~~ + +* Fixed firmware uploading to the embedded boards with SAM-BA bootloader + 2.9.2 (2016-06-02) ~~~~~~~~~~~~~~~~~~ diff --git a/scripts/99-platformio-udev.rules b/scripts/99-platformio-udev.rules index 5ac03b12..5e77fc80 100644 --- a/scripts/99-platformio-udev.rules +++ b/scripts/99-platformio-udev.rules @@ -45,8 +45,14 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", MODE:="066 # QinHeng Electronics HL-340 USB-Serial adapter SUBSYSTEMS=="usb", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", MODE:="0666" -# ARDUINO UNO -SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0043", MODE:="0666" +# ARDUINO +SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="00??", MODE:="0666" + +# Arduino SAM-BA +ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", ENV{ID_MM_DEVICE_IGNORE}="1" +ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", ENV{MTP_NO_PROBE}="1" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", MODE:="0666" +KERNEL=="ttyACM*", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", MODE:="0666" # Digistump boards SUBSYSTEMS=="usb", ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="0753", MODE:="0666" From 439e6b4ccf86824514f5bdccd5544303336478bf Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 3 Jun 2016 18:35:47 +0300 Subject: [PATCH 05/13] Refactor firmware uploading to the embedded boards with SAM-BA bootloader --- platformio/__init__.py | 2 +- platformio/builder/scripts/atmelavr.py | 2 +- platformio/builder/scripts/atmelsam.py | 2 +- platformio/builder/tools/pioupload.py | 23 ++++++++++------- platformio/util.py | 35 +++----------------------- 5 files changed, 21 insertions(+), 43 deletions(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index 31611539..3c76b90d 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (2, 9, "3.dev0") +VERSION = (2, 9, "3.dev1") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/builder/scripts/atmelavr.py b/platformio/builder/scripts/atmelavr.py index a4b53263..ff3ceadf 100644 --- a/platformio/builder/scripts/atmelavr.py +++ b/platformio/builder/scripts/atmelavr.py @@ -65,7 +65,7 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 if not upload_options.get("disable_flushing", False): env.FlushSerialBuffer("$UPLOAD_PORT") - before_ports = [i['port'] for i in get_serialports(use_grep=True)] + before_ports = get_serialports() if upload_options.get("use_1200bps_touch", False): env.TouchSerialPort("$UPLOAD_PORT", 1200) diff --git a/platformio/builder/scripts/atmelsam.py b/platformio/builder/scripts/atmelsam.py index a78febf0..79eca59e 100644 --- a/platformio/builder/scripts/atmelsam.py +++ b/platformio/builder/scripts/atmelsam.py @@ -41,7 +41,7 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 if not upload_options.get("disable_flushing", False): env.FlushSerialBuffer("$UPLOAD_PORT") - before_ports = [i['port'] for i in get_serialports(use_grep=True)] + before_ports = get_serialports() if upload_options.get("use_1200bps_touch", False): env.TouchSerialPort("$UPLOAD_PORT", 1200) diff --git a/platformio/builder/tools/pioupload.py b/platformio/builder/tools/pioupload.py index caebdb56..80d66461 100644 --- a/platformio/builder/tools/pioupload.py +++ b/platformio/builder/tools/pioupload.py @@ -14,6 +14,7 @@ from __future__ import absolute_import +import sys from os.path import isfile, join from shutil import copyfile from time import sleep @@ -49,21 +50,25 @@ def TouchSerialPort(env, port, baudrate): def WaitForNewSerialPort(env, before): print "Waiting for the new upload port..." + prev_port = env.subst("$UPLOAD_PORT") new_port = None elapsed = 0 - while elapsed < 5: - now = [i['port'] for i in get_serialports(use_grep=True)] - diff = list(set(now) - set(before)) - if diff: - new_port = diff[0] - break - + while elapsed < 5 and new_port is None: + now = get_serialports() + for p in now: + if p not in before: + new_port = p['port'] + break before = now sleep(0.25) elapsed += 0.25 - if not new_port and env.subst("$UPLOAD_PORT") in now: - new_port = env.subst("$UPLOAD_PORT") + if not new_port: + for p in now: + if prev_port == p['port']: + new_port = p['port'] + break + if not new_port: env.Exit("Error: Couldn't find a board on the selected port. " "Check that you have the correct port selected. " diff --git a/platformio/util.py b/platformio/util.py index 13a9b9e6..36576295 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -280,34 +280,7 @@ def exec_command(*args, **kwargs): return result -def get_serialports(use_grep=False): - - def _grep_serial_ports(): - result = [] - if system() == "Windows": - output = exec_command(["mode"]).get("out", "") - for line in output.split("\n"): - line = line.strip() - if "COM" in line: - result.append({"port": line[line.index("COM"):-1], - "description": "", "hwid": ""}) - else: - if system() == "Linux": - patterns = ["/dev/%s*" % p for p in ( - "ttyS", "ttyUSB", "ttyACM", "ttyAMA", "rfcomm", "ttyO")] - else: - patterns = ["/dev/tty.*", "/dev/cu.*"] - for pattern in patterns: - for port in glob(pattern): - result.append( - {"port": port, "description": "", "hwid": ""}) - return result - - if use_grep: - result = _grep_serial_ports() - if result: - return result - +def get_serialports(): try: from serial.tools.list_ports import comports except ImportError: @@ -325,9 +298,9 @@ def get_serialports(use_grep=False): result.append({"port": p, "description": d, "hwid": h}) # fix for PySerial - if not result and not use_grep and system() == "Darwin": - result = _grep_serial_ports() - + if not result and system() == "Darwin": + for p in glob("/dev/tty.*"): + result.append({"port": p, "description": "", "hwid": ""}) return result From 45d5159fe333dffcebf5d95544c092e550fca594 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 3 Jun 2016 18:46:28 +0300 Subject: [PATCH 06/13] Remove unused imports --- HISTORY.rst | 2 +- platformio/builder/tools/pioupload.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index d4175898..d9c94813 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,7 +7,7 @@ PlatformIO 2.0 2.9.3 (2016-06-??) ~~~~~~~~~~~~~~~~~~ -* Fixed firmware uploading to the embedded boards with SAM-BA bootloader +* Refactored firmware uploading to the embedded boards with SAM-BA bootloader 2.9.2 (2016-06-02) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/builder/tools/pioupload.py b/platformio/builder/tools/pioupload.py index 80d66461..06f90790 100644 --- a/platformio/builder/tools/pioupload.py +++ b/platformio/builder/tools/pioupload.py @@ -14,7 +14,6 @@ from __future__ import absolute_import -import sys from os.path import isfile, join from shutil import copyfile from time import sleep From f3526b1d95ad7dc07731735d2a43f7aebee7c24c Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 3 Jun 2016 20:14:37 +0300 Subject: [PATCH 07/13] Add support for Arduboy --- HISTORY.rst | 1 + docs/frameworks/arduino.rst | 20 +++++++++++++++++++ docs/platforms/atmelavr.rst | 20 +++++++++++++++++++ docs/platforms/embedded_boards.rst | 20 +++++++++++++++++++ platformio/boards/misc.json | 32 ++++++++++++++++++++++++++++++ platformio/util.py | 2 +- 6 files changed, 94 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index d9c94813..6836d2e1 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,6 +7,7 @@ PlatformIO 2.0 2.9.3 (2016-06-??) ~~~~~~~~~~~~~~~~~~ +* Added support for Arduboy, the game system the size of a credit card * Refactored firmware uploading to the embedded boards with SAM-BA bootloader 2.9.2 (2016-06-02) diff --git a/docs/frameworks/arduino.rst b/docs/frameworks/arduino.rst index 90054e71..b4fcf0e7 100644 --- a/docs/frameworks/arduino.rst +++ b/docs/frameworks/arduino.rst @@ -176,6 +176,26 @@ Adafruit - 8 Kb - 0.5 Kb +Arduboy +~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``arduboy`` + - `Arduboy `_ + - ATMEGA32U4 + - 16 MHz + - 32 Kb + - 2.5 Kb + Arduino ~~~~~~~ diff --git a/docs/platforms/atmelavr.rst b/docs/platforms/atmelavr.rst index 30f5aa76..d1e26c13 100644 --- a/docs/platforms/atmelavr.rst +++ b/docs/platforms/atmelavr.rst @@ -166,6 +166,26 @@ Adafruit - 8 Kb - 0.5 Kb +Arduboy +~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``arduboy`` + - `Arduboy `_ + - ATMEGA32U4 + - 16 MHz + - 32 Kb + - 2.5 Kb + Arduino ~~~~~~~ diff --git a/docs/platforms/embedded_boards.rst b/docs/platforms/embedded_boards.rst index 440ddb8c..9b755937 100644 --- a/docs/platforms/embedded_boards.rst +++ b/docs/platforms/embedded_boards.rst @@ -162,6 +162,26 @@ Adafruit - 8 Kb - 0.5 Kb +Arduboy +~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``arduboy`` + - `Arduboy `_ + - ATMEGA32U4 + - 16 MHz + - 32 Kb + - 2.5 Kb + Arduino ~~~~~~~ diff --git a/platformio/boards/misc.json b/platformio/boards/misc.json index bbff9241..4d65abdb 100644 --- a/platformio/boards/misc.json +++ b/platformio/boards/misc.json @@ -738,5 +738,37 @@ }, "url": "http://www.atmel.com/devices/ATTINY85.aspx", "vendor": "Generic ATTiny" + }, + + "arduboy": { + "build": { + "core": "arduino", + "extra_flags": "-DARDUINO_ARCH_AVR -DARDUINO_AVR_LEONARDO", + "f_cpu": "16000000L", + "mcu": "atmega32u4", + "usb_product": "Arduino Leonardo", + "variant": "leonardo", + "hwid": [ + ["0x2341", "0x0036"], + ["0x2341", "0x8036"], + ["0x2A03", "0x0036"], + ["0x2A03", "0x8036"] + ] + }, + "frameworks": ["arduino"], + "name": "Arduboy", + "platform": "atmelavr", + "upload": { + "disable_flushing": true, + "maximum_ram_size": 2560, + "maximum_size": 28672, + "protocol": "avr109", + "require_upload_port" : true, + "speed": 57600, + "use_1200bps_touch": true, + "wait_for_upload_port": true + }, + "url": "https://www.arduboy.com", + "vendor": "Arduboy" } } diff --git a/platformio/util.py b/platformio/util.py index 36576295..864e0ea8 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -300,7 +300,7 @@ def get_serialports(): # fix for PySerial if not result and system() == "Darwin": for p in glob("/dev/tty.*"): - result.append({"port": p, "description": "", "hwid": ""}) + result.append({"port": p, "description": "n/a", "hwid": "n/a"}) return result From 11ef9dbdcb085cd6d26ceb5ded51dc525c457709 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 3 Jun 2016 20:40:24 +0300 Subject: [PATCH 08/13] Add new article --- docs/articles.rst | 1 + docs/platforms/espressif_extra.rst | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/articles.rst b/docs/articles.rst index e844b961..8791784c 100644 --- a/docs/articles.rst +++ b/docs/articles.rst @@ -23,6 +23,7 @@ Here are recent articles about PlatformIO: 2016 ^^^^ +* Jun 3, 2016 - **Daniel Eichhorn** - `ESP8266: Continuous Delivery Pipeline – Push To Production `_ * May 30, 2016 - **Ron Moerman** - `IoT Development with PlatformIO `_ * May 29, 2016 - **Chris Synan** - `Reverse Engineer RF Remote Controller for IoT! `_ * May 26, 2016 - **Charlie Key** - `7 Best Developer Tools To Build Your NEXT Internet of Things Application `_ diff --git a/docs/platforms/espressif_extra.rst b/docs/platforms/espressif_extra.rst index b9430876..fd04de77 100644 --- a/docs/platforms/espressif_extra.rst +++ b/docs/platforms/espressif_extra.rst @@ -240,6 +240,7 @@ Using Arduino Framework with Staging version Articles -------- +* Jun 3, 2016 - **Daniel Eichhorn** - `ESP8266: Continuous Delivery Pipeline – Push To Production `_ * May 29, 2016 - **Chris Synan** - `Reverse Engineer RF Remote Controller for IoT! `_ * May 22, 2016 - **Pedro Minatel** - `Estação meteorológica com ESP8266 (Weather station with ESP8266, Portuguese) `_ * May 16, 2016 - **Pedro Minatel** - `Controle remoto WiFi com ESP8266 (WiFi remote control using ESP8266, Portuguese) `_ From 646123f9aba5bb9c814a68bfe7b711b6d37942c7 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 3 Jun 2016 20:57:20 +0300 Subject: [PATCH 09/13] Notify Linux user to install PlatformIO udev rules --- HISTORY.rst | 1 + platformio/builder/tools/pioupload.py | 8 ++++++++ scripts/99-platformio-udev.rules | 5 +++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 6836d2e1..a1c13793 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -8,6 +8,7 @@ PlatformIO 2.0 ~~~~~~~~~~~~~~~~~~ * Added support for Arduboy, the game system the size of a credit card +* Updated `99-platformio-udev.rules `__ for Linux OS * Refactored firmware uploading to the embedded boards with SAM-BA bootloader 2.9.2 (2016-06-02) diff --git a/platformio/builder/tools/pioupload.py b/platformio/builder/tools/pioupload.py index 06f90790..d839f90f 100644 --- a/platformio/builder/tools/pioupload.py +++ b/platformio/builder/tools/pioupload.py @@ -90,6 +90,14 @@ def AutodetectUploadPort(env): env.Replace(UPLOAD_PORT=item['disk']) break else: + if not isfile("/etc/udev/99-platformio-udev.rules"): + print ( + "\nWarning! Please install `99-platformio-udev.rules` and " + "check that your board's PID and VID are listed in the rules." + "\n https://raw.githubusercontent.com/platformio/platformio" + "/develop/scripts/99-platformio-udev.rules\n" + ) + board_build_opts = env.get("BOARD_OPTIONS", {}).get("build", {}) for item in get_serialports(): if "VID:PID" not in item['hwid']: diff --git a/scripts/99-platformio-udev.rules b/scripts/99-platformio-udev.rules index 5e77fc80..a3c846b7 100644 --- a/scripts/99-platformio-udev.rules +++ b/scripts/99-platformio-udev.rules @@ -45,8 +45,9 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", MODE:="066 # QinHeng Electronics HL-340 USB-Serial adapter SUBSYSTEMS=="usb", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", MODE:="0666" -# ARDUINO -SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="00??", MODE:="0666" +# Arduino boards +SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="[08][02]*", MODE:="0666" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="2a03", ATTRS{idProduct}=="[08][02]*", MODE:="0666" # Arduino SAM-BA ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", ENV{ID_MM_DEVICE_IGNORE}="1" From ac4e8514db8823e503fce4af2d89bb895d407b0e Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 3 Jun 2016 21:03:48 +0300 Subject: [PATCH 10/13] Version bump to 2.9.3 --- HISTORY.rst | 2 +- platformio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index a1c13793..3797fe06 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,7 +4,7 @@ Release Notes PlatformIO 2.0 -------------- -2.9.3 (2016-06-??) +2.9.3 (2016-06-03) ~~~~~~~~~~~~~~~~~~ * Added support for Arduboy, the game system the size of a credit card diff --git a/platformio/__init__.py b/platformio/__init__.py index 3c76b90d..9e984cea 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (2, 9, "3.dev1") +VERSION = (2, 9, 3) __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From 439cd77db855fdcfb759d85e13c6b231b9c28e7a Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 4 Jun 2016 00:23:33 +0300 Subject: [PATCH 11/13] Show "udev" warning only for the Linux OS while upload firmware --- HISTORY.rst | 8 +++++++- platformio/builder/tools/pioupload.py | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 3797fe06..6ee3b220 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,10 +4,16 @@ Release Notes PlatformIO 2.0 -------------- +2.9.4 (2016-06-??) +~~~~~~~~~~~~~~~~~~ + +* Show ``udev`` warning only for the Linux OS while upload firmware + 2.9.3 (2016-06-03) ~~~~~~~~~~~~~~~~~~ -* Added support for Arduboy, the game system the size of a credit card +* Added support for `Arduboy `__, the game system + the size of a credit card * Updated `99-platformio-udev.rules `__ for Linux OS * Refactored firmware uploading to the embedded boards with SAM-BA bootloader diff --git a/platformio/builder/tools/pioupload.py b/platformio/builder/tools/pioupload.py index d839f90f..b7fe229e 100644 --- a/platformio/builder/tools/pioupload.py +++ b/platformio/builder/tools/pioupload.py @@ -15,6 +15,7 @@ from __future__ import absolute_import from os.path import isfile, join +from platform import system from shutil import copyfile from time import sleep @@ -90,7 +91,8 @@ def AutodetectUploadPort(env): env.Replace(UPLOAD_PORT=item['disk']) break else: - if not isfile("/etc/udev/99-platformio-udev.rules"): + if (system() == "Linux" and + not isfile("/etc/udev/99-platformio-udev.rules")): print ( "\nWarning! Please install `99-platformio-udev.rules` and " "check that your board's PID and VID are listed in the rules." From f1afa864cd6ad1ee11fc67d649991bb7673b53d5 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 4 Jun 2016 00:25:15 +0300 Subject: [PATCH 12/13] Version bump to 2.9.4 --- HISTORY.rst | 2 +- platformio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 6ee3b220..be668065 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,7 +4,7 @@ Release Notes PlatformIO 2.0 -------------- -2.9.4 (2016-06-??) +2.9.4 (2016-06-04) ~~~~~~~~~~~~~~~~~~ * Show ``udev`` warning only for the Linux OS while upload firmware diff --git a/platformio/__init__.py b/platformio/__init__.py index 9e984cea..e470d028 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (2, 9, 3) +VERSION = (2, 9, 4) __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From 34c171f9fd602993c61a6c17589d5a84cbda510e Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 4 Jun 2016 00:30:02 +0300 Subject: [PATCH 13/13] Typo fix --- HISTORY.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index be668065..6dd6566f 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,7 +7,7 @@ PlatformIO 2.0 2.9.4 (2016-06-04) ~~~~~~~~~~~~~~~~~~ -* Show ``udev`` warning only for the Linux OS while upload firmware +* Show ``udev`` warning only for the Linux OS while uploading firmware 2.9.3 (2016-06-03) ~~~~~~~~~~~~~~~~~~