Upload command update for Arduino DUE
authorsandipan.p <sandipan.p@samsung.com>
Mon, 14 Sep 2015 12:51:55 +0000 (18:21 +0530)
committerPatrick Lankswert <patrick.lankswert@intel.com>
Fri, 18 Sep 2015 15:22:18 +0000 (15:22 +0000)
With the previous implementation, CA and RI binaries were trying to get uploaded
on DUE board during SConscript parsing.

Change-Id: I12955a09e5695192b6cb756f2252b12bc62c0726
Signed-off-by: sandipan.p <sandipan.p@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2515
Reviewed-by: Abhishek Sharma <ce.abhishek@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
Reviewed-by: Naga Ashok Jampani <jn.ashok@samsung.com>
Reviewed-by: Abhishek Pandey <abhi.siso@samsung.com>
Reviewed-by: Patrick Lankswert <patrick.lankswert@intel.com>
build_common/arduino/SConscript

index 5df7fb3..73e753e 100644 (file)
@@ -194,12 +194,11 @@ def __upload(env, binary):
                 install_cmd = env.Command('install_cmd', None, upload_cmd)
                 env.Default('install_cmd')
         elif target_arch == 'arm':
-                protocol = __get_board_info(board, '.upload.protocol')
-                speed = __get_board_info(board, '.upload.speed')
                 port = 'ttyACM0'
-                uu = __get_board_info(board, '.upload.native_usb')
-                os.system('stty -F /dev/' + port + ' speed 1200 cs8 -cstopb -parenb')
-                os.system(arduino_home + '/hardware/tools/bossac -i --port=' + port + ' -U false -e -w -b ' + binary + ' -R')
+                upload_cmd = 'stty -F /dev/' + port + ' speed 1200 cs8 -cstopb -parenb \n' + arduino_home + '/hardware/tools/bossac -i --port=' + port + ' -U false -e -w -b ' + binary + ' -R'
+                print "Upload command: %s" %upload_cmd
+                install_cmd = env.Command('install_cmd', None, upload_cmd)
+                env.Default('install_cmd')
 
 # Print the command line that to upload binary to the board
 def __upload_help(env):