@@ -161,6 +161,8 @@ def check_config():
161161global root_output_dir
162162global output_dir
163163global log_file
164+ global stm32_url
165+
164166if args .ci is False :
165167if os .path .isfile (path_config_filename ):
166168try :
@@ -198,11 +200,11 @@ def check_config():
198200
199201try :
200202output = subprocess .check_output (
201- [arduino_cli ,"version" ],stderr = subprocess .DEVNULL ,
203+ [arduino_cli ,"version" ],stderr = subprocess .STDOUT ,
202204 )
203205except subprocess .CalledProcessError as e :
204206print ('"' + " " .join (e .cmd )+ '" failed with code: {}!' .format (e .returncode ))
205- print (e .stdout )
207+ print (e .stdout . decode ( "utf-8" ) )
206208quit (e .returncode )
207209else :
208210res = re .match (r".*Version:\s+(\d+\.\d+\.\d+).*" ,output .decode ("utf-8" ))
@@ -215,14 +217,17 @@ def check_config():
215217+ arduino_cli_default_version
216218 )
217219
220+ if args .url :
221+ stm32_url = args .url
222+
218223try :
219224output = subprocess .check_output (
220225 [arduino_cli ,"core" ,"search" ,"stm32" ,"--additional-urls" ,stm32_url ],
221- stderr = subprocess .DEVNULL ,
226+ stderr = subprocess .STDOUT ,
222227 )
223228except subprocess .CalledProcessError as e :
224229print ('"' + " " .join (e .cmd )+ '" failed with code: {}!' .format (e .returncode ))
225- print (e .stdout )
230+ print (e .stdout . decode ( "utf-8" ) )
226231quit (e .returncode )
227232else :
228233if arduino_platform not in output .decode ("utf-8" ):
@@ -232,13 +237,13 @@ def check_config():
232237try :
233238output = subprocess .check_output (
234239 [arduino_cli ,"config" ,"dump" ,"--format" ,"json" ],
235- stderr = subprocess .DEVNULL ,
240+ stderr = subprocess .STDOUT ,
236241 ).decode ("utf-8" )
237242except subprocess .CalledProcessError as e :
238243print (
239244'"' + " " .join (e .cmd )+ '" failed with code: {}!' .format (e .returncode )
240245 )
241- print (e .stdout )
246+ print (e .stdout . decode ( "utf-8" ) )
242247quit (e .returncode )
243248else :
244249cli_config = json .loads (output )
@@ -465,7 +470,7 @@ def find_board():
465470 ).decode ("utf-8" )
466471except subprocess .CalledProcessError as e :
467472print ('"' + " " .join (e .cmd )+ '" failed with code: {}!' .format (e .returncode ))
468- print (e .stdout )
473+ print (e .stdout . decode ( "utf-8" ) )
469474quit (e .returncode )
470475else :
471476boards_list = json .loads (output )
@@ -488,7 +493,7 @@ def find_board():
488493print (
489494'"' + " " .join (e .cmd )+ '" failed with code: {}!' .format (e .returncode )
490495 )
491- print (e .stdout )
496+ print (e .stdout . decode ( "utf-8" ) )
492497quit (e .returncode )
493498else :
494499board_detail = json .loads (output )
@@ -874,6 +879,12 @@ def build(build_conf):
874879+ cores_config_file_default ,
875880)
876881
882+ parser .add_argument (
883+ "-u" ,"--url" ,metavar = "<string>" ,help = "additional URL for the board manager\
884+ Default url : "
885+ + stm32_url ,
886+ )
887+
877888parser .add_argument (
878889"-v" ,"--verbose" ,help = "enable arduino-cli verbose mode" ,action = "store_true"
879890)