* call esptool.py properly on Darwin

This commit is contained in:
florian 2023-02-11 21:06:40 +01:00
parent 67864b662a
commit d3ccd10674

View File

@ -1324,62 +1324,55 @@ begin
if success and not(cs_link_nolink in current_settings.globalswitches) then if success and not(cs_link_nolink in current_settings.globalswitches) then
success:=PostProcessExecutable(FixedExeFileName,false); success:=PostProcessExecutable(FixedExeFileName,false);
if success then
begin
{$if defined(DARWIN)}
success:=FindFileInExeLocations('python',true,binstr);
cmdstr:=idfpath+'/components/esptool_py/esptool/esptool.py ';
{$elseif defined(UNIX)}
binstr:=TargetFixPath(idfpath,false)+'/components/esptool_py/esptool/esptool.py';
cmdstr:='';
{$else}
binstr:='python';
cmdstr:=idfpath+'/components/esptool_py/esptool/esptool.py ';
{$endif UNIX}
{$if defined(XTENSA)} {$if defined(XTENSA)}
if success then if source_info.exeext<>'' then
begin binstr:=binstr+source_info.exeext;
{$ifdef UNIX} if (current_settings.controllertype = ct_esp32) then
binstr:=TargetFixPath(idfpath,false)+'/components/esptool_py/esptool/esptool.py'; begin
cmdstr:=''; success:=DoExec(binstr,cmdstr+'--chip esp32 elf2image --flash_mode dio --flash_freq 40m '+
{$else} '--flash_size '+tostr(embedded_controllers[current_settings.controllertype].flashsize div (1024*1024))+'MB '+
binstr:='python'; '--elf-sha256-offset 0xb0 '+
cmdstr:=idfpath+'/components/esptool_py/esptool/esptool.py '; '-o '+maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename,'.bin')))+' '+
{$endif UNIX} FixedExeFileName,
if source_info.exeext<>'' then true,false);
binstr:=binstr+source_info.exeext; end
if (current_settings.controllertype = ct_esp32) then else if (current_settings.controllertype = ct_esp8266) then
begin begin
success:=DoExec(binstr,cmdstr+'--chip esp32 elf2image --flash_mode dio --flash_freq 40m '+ success:=DoExec(binstr,cmdstr+'--chip esp8266 elf2image --flash_mode dout --flash_freq 40m '+
'--flash_size '+tostr(embedded_controllers[current_settings.controllertype].flashsize div (1024*1024))+'MB '+ '--flash_size '+tostr(embedded_controllers[current_settings.controllertype].flashsize div (1024*1024))+'MB '+
'--elf-sha256-offset 0xb0 '+ '--version=3 '+
'-o '+maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename,'.bin')))+' '+ '-o '+maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename,'.bin')))+' '+
FixedExeFileName, FixedExeFileName,
true,false); true,false);
end end
else if (current_settings.controllertype = ct_esp8266) then
begin
success:=DoExec(binstr,cmdstr+'--chip esp8266 elf2image --flash_mode dout --flash_freq 40m '+
'--flash_size '+tostr(embedded_controllers[current_settings.controllertype].flashsize div (1024*1024))+'MB '+
'--version=3 '+
'-o '+maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename,'.bin')))+' '+
FixedExeFileName,
true,false);
end
end
else
{$elseif defined(RISCV32)} {$elseif defined(RISCV32)}
if success then if source_info.exeext<>'' then
begin binstr:=binstr+source_info.exeext;
{$ifdef UNIX} if (current_settings.controllertype = ct_esp32c3) then
binstr:=TargetFixPath(idfpath,false)+'/components/esptool_py/esptool/esptool.py'; begin
cmdstr:=''; success:=DoExec(binstr,cmdstr+'--chip esp32c3 elf2image --flash_mode dio --flash_freq 80m '+
{$else} '--flash_size '+tostr(embedded_controllers[current_settings.controllertype].flashsize div (1024*1024))+'MB '+
binstr:='python'; '--elf-sha256-offset 0xb0 --min-rev 3 '+
cmdstr:=idfpath+'/components/esptool_py/esptool/esptool.py '; '-o '+maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename,'.bin')))+' '+
{$endif UNIX} FixedExeFileName,
if source_info.exeext<>'' then true,false);
binstr:=binstr+source_info.exeext; end;
if (current_settings.controllertype = ct_esp32c3) then {$endif defined(RISCV32)}
begin
success:=DoExec(binstr,cmdstr+'--chip esp32c3 elf2image --flash_mode dio --flash_freq 80m '+
'--flash_size '+tostr(embedded_controllers[current_settings.controllertype].flashsize div (1024*1024))+'MB '+
'--elf-sha256-offset 0xb0 --min-rev 3 '+
'-o '+maybequoted(ScriptFixFileName(ChangeFileExt(current_module.exefilename,'.bin')))+' '+
FixedExeFileName,
true,false);
end;
end end
else else
{$endif defined(RISCV32)}
if success then if success then
success:=DoExec(FindUtil(utilsprefix+'objcopy'),'-O binary '+ success:=DoExec(FindUtil(utilsprefix+'objcopy'),'-O binary '+
FixedExeFileName+' '+ FixedExeFileName+' '+