-
Notifications
You must be signed in to change notification settings - Fork 1
/
ESPBuilder-correctedForNonOs2.0.0.ESP8266Wizard1.2.9.targets
178 lines (144 loc) · 12.1 KB
/
ESPBuilder-correctedForNonOs2.0.0.ESP8266Wizard1.2.9.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--** Item Group ******************************************************************************************************************************-->
<ItemGroup>
</ItemGroup>
<!--** Task ************************************************************************************************************************************-->
<UsingTask Condition="'$(ESPBoot)'=='No Boot'" TaskName="ESPRAM" TaskFactory="XamlTaskFactory" AssemblyName="Microsoft.Build.Tasks.v4.0">
<Task>$(VisualStudioXtensa)MSBuildTemplate\ESPBuilder\ESPBuilder_Flash_Merged.xml</Task>
</UsingTask>
<UsingTask Condition="'$(ESPBoot)'!='No Boot'" TaskName="ESPRAM" TaskFactory="XamlTaskFactory" AssemblyName="Microsoft.Build.Tasks.v4.0">
<Task>$(VisualStudioXtensa)MSBuildTemplate\ESPBuilder\ESPBuilder_Boot_Merged.xml"</Task>
</UsingTask>
<!--** Targets *********************************************************************************************************************************-->
<!-- XtensaLd After[Build] Depends[SetXtensaVariable] -->
<Target Name="ESPBuilder" AfterTargets="Build" DependsOnTargets="">
<CreateItem Include="Nothing">
<Output ItemName="ESPBuilder" TaskParameter="Include"/>
</CreateItem>
<ItemGroup>
<ESPBuilder>
<UserRam>512</UserRam>
<UserRam Condition="'$(SPISize)'>='2'">1024</UserRam>
<UserRam Condition="'$(SPISize)'>='5'">2048</UserRam>
<BootName>new</BootName>
<BootNum>0</BootNum>
<BootNum Condition="'$(ESPBoot)'!='No Boot'">2</BootNum>
<SPIRam>512</SPIRam>
<SPIRam Condition="'$(SPISize)'=='2'">1024</SPIRam>
<SPIRam Condition="'$(SPISize)'=='3'">2048</SPIRam>
<SPIRam Condition="'$(SPISize)'=='4'">4096</SPIRam>
<SPIRam Condition="'$(SPISize)'=='5'">2048</SPIRam>
<SPIRam Condition="'$(SPISize)'=='6'">4096</SPIRam>
<SPIRamName Condition="'$(SPISize)'=='0'">512K</SPIRamName>
<SPIRamName Condition="'$(SPISize)'=='2'">1M</SPIRamName>
<SPIRamName Condition="'$(SPISize)'=='3'">2M</SPIRamName>
<SPIRamName Condition="'$(SPISize)'=='4'">4M</SPIRamName>
<SPIRamName Condition="'$(SPISize)'=='5'">2M</SPIRamName>
<SPIRamName Condition="'$(SPISize)'=='6'">4M</SPIRamName>
<UserAddr>0x01000</UserAddr>
<UserAddr Condition="'$(SPISize)'>='2' and '$(ESPBin)'=='2'">0x81000</UserAddr>
<UserAddr Condition="'$(SPISize)'>='5' and '$(ESPBin)'=='2'">0x101000</UserAddr>
<MasterKey>0x3E000</MasterKey>
<MasterKey Condition="'$(SPISize)'>='2' and '$(MasterIOT)'=='true'">0x7E000</MasterKey>
<MasterKey Condition="'$(SPISize)'>='5' and '$(MasterIOT)'=='true'">0xFE000</MasterKey>
<ESPData Condition="'$(SPISize)'=='0'">0x7C000</ESPData>
<ESPData Condition="'$(SPISize)'=='2'">0xFC000</ESPData>
<ESPData Condition="'$(SPISize)'=='3'">0x1FC000</ESPData>
<ESPData Condition="'$(SPISize)'>='4'">0x3FC000</ESPData>
<Blank Condition="'$(SPISize)'=='0'">0x7E000</Blank>
<Blank Condition="'$(SPISize)'=='2'">0xFE000</Blank>
<Blank Condition="'$(SPISize)'=='3'">0x1FE000</Blank>
<Blank Condition="'$(SPISize)'>='4'">0x3FE000</Blank>
<SPISpeedName Condition="'$(SPISpeed)'=='0'">20M</SPISpeedName>
<SPISpeedName Condition="'$(SPISpeed)'=='1'">26M</SPISpeedName>
<SPISpeedName Condition="'$(SPISpeed)'=='2'">40M</SPISpeedName>
<SPISpeedName Condition="'$(SPISpeed)'=='15'">80M</SPISpeedName>
<SPIModeName Condition="'$(SPIMode)'=='0'">QIO</SPIModeName>
<SPIModeName Condition="'$(SPIMode)'=='1'">QOUT</SPIModeName>
<SPIModeName Condition="'$(SPIMode)'=='2'">DIO</SPIModeName>
<SPIModeName Condition="'$(SPIMode)'=='3'">DOUT</SPIModeName>
</ESPBuilder>
</ItemGroup>
</Target>
<Target Name="ESPRAM" AfterTargets="XtensaObjCopy" DependsOnTargets="SetPythonVariable">
<Exec Condition="'$(SelectRelease)'=='NON-OS' or '$(SelectRelease)'=='ESPMesh' " WorkingDirectory="$(MSBuildProjectDirectory)\$(OutputFolder)\Image\" Command="python "$(VisualStudioXtensa)ESPressif\$(SelectRelease)\$(SelectVersion)\tools\gen_appbin.py" $(MSBuildProjectName).eagle.app.v6.out %(ESPBuilder.BootNum) $(SPIMode) $(SPISpeed) $(SPISize) $(ESPBin)"/>
<Exec Condition="'$(SelectRelease)'=='RTOS'" WorkingDirectory="$(MSBuildProjectDirectory)\$(OutputFolder)\Image\" Command="python "$(VisualStudioXtensa)ESPressif\$(SelectRelease)\$(SelectVersion)\tools\gen_appbin.py" $(MSBuildProjectName).eagle.app.v6.out %(ESPBuilder.BootNum) $(SPIMode) $(SPISpeed) $(SPISize)"/>
<Message Condition="'$(ESPBoot)'=='No Boot'" Importance="High" Text="Generate : $(MSBuildProjectDirectory)\$(OutputFolder)\$(MSBuildProjectName).eagle.flash(0x00000).bin..." />
<Move Condition="'$(ESPBoot)'=='No Boot'"
SourceFiles="$(MSBuildProjectDirectory)\$(OutputFolder)\Image\eagle.app.flash.bin"
DestinationFiles="$(MSBuildProjectDirectory)\$(OutputFolder)\$(MSBuildProjectName).eagle.flash(0x00000).bin"
/>
<Message Condition="'$(ESPBoot)'=='No Boot'" Importance="High" Text="Generate : $(MSBuildProjectDirectory)\$(OutputFolder)\$(MSBuildProjectName).eagle.irom0text.bin(0x10000).bin..." />
<Move Condition="'$(ESPBoot)'=='No Boot'"
SourceFiles="$(MSBuildProjectDirectory)\$(OutputFolder)\Image\eagle.app.v6.irom0text.bin"
DestinationFiles="$(MSBuildProjectDirectory)\$(OutputFolder)\$(MSBuildProjectName).eagle.irom0text.bin(0x10000).bin"
/>
<Message Condition="'$(ESPBoot)'!='No Boot'" Importance="High" Text="Generate : $(MSBuildProjectDirectory)\$(OutputFolder)\$(MSBuildProjectName).user$(ESPBin).%(ESPBuilder.SPIRam).%(ESPBuilder.BootName).$(SPISize)(%(ESPBuilder.UserAddr)).bin..." />
<Move Condition="'$(ESPBoot)'!='No Boot'"
SourceFiles="$(MSBuildProjectDirectory)\$(OutputFolder)\Image\eagle.app.flash.bin"
DestinationFiles="$(MSBuildProjectDirectory)\$(OutputFolder)\$(MSBuildProjectName).user$(ESPBin).%(ESPBuilder.SPIRam).%(ESPBuilder.BootName).$(SPISize)(%(ESPBuilder.UserAddr)).bin"
/>
</Target>
<Target Name="ESPTOOL" AfterTargets="ESPRAM" DependsOnTargets="SetPythonVariable">
<Message Importance="High" Text="*** Flash Table **************************************" />
<Message Condition="'$(FlashMaster)'=='true'" Importance="High" Text="Master Device Key adresss : %(ESPBuilder.MasterKey)" />
<Message Condition="'$(FlashESPData)'=='true'" Importance="High" Text="ESP Init Data adresss : %(ESPBuilder.ESPData)" />
<Message Condition="'$(FlashBlank)'=='true'" Importance="High" Text="Blank Data adresss : %(ESPBuilder.Blank)" />
<Message Condition="'$(ESPBoot)'=='No Boot' and '$(FlashBoot)'=='true'" Importance="High" Text="eagle.flash adresss : 0x00000" />
<Message Condition="'$(ESPBoot)'=='No Boot' and '$(FlashUser)'=='true'" Importance="High" Text="eagle.irom0text adresss : 0x10000" />
<Message Condition="'$(ESPBoot)'!='No Boot' and '$(FlashBoot)'=='true'" Importance="High" Text="boot adresss : 0x00000" />
<Message Condition="'$(ESPBoot)'!='No Boot' and '$(FlashUser)'=='true'" Importance="High" Text="User$(ESPBin) adresss : %(ESPBuilder.UserAddr)" />
<PropertyGroup>
<ESPToolBaseParam>-p$(ComPort) -b$(ComSpeed) -r$(ESPToolReset) -q -ff%(ESPBuilder.SPISpeedName) -fm%(ESPBuilder.SPIModeName) -fs%(ESPBuilder.SPIRamName)</ESPToolBaseParam>
<ESPToolChipIDParam>-p$(ComPort) -b$(ComSpeed) -r$(ESPToolReset) -of</ESPToolChipIDParam>
<AdresseList></AdresseList>
<AdresseList Condition="'$(FlashMaster)'=='true'">$([System.String]::Concat($(AdresseList), "-a%(ESPBuilder.MasterKey) "$(MSBuildProjectDirectory)\master_device_key.bin" "))</AdresseList>
<AdresseList Condition="'$(FlashESPData)'=='true' and '$(ESPDataLocal)'!='true'">$([System.String]::Concat($(AdresseList), "-a%(ESPBuilder.ESPData) "$(VisualStudioXtensa)ESPressif\$(SelectRelease)\$(SelectVersion)\bin\esp_init_data_default.bin" "))</AdresseList>
<AdresseList Condition="'$(FlashESPData)'=='true' and '$(ESPDataLocal)'=='true'">$([System.String]::Concat($(AdresseList), "-a%(ESPBuilder.ESPData) "$(MSBuildProjectDirectory)\esp_init_data_default.bin" "))</AdresseList>
<AdresseList Condition="'$(FlashBlank)'=='true'">$([System.String]::Concat($(AdresseList), "-a%(ESPBuilder.Blank) "$(VisualStudioXtensa)ESPressif\$(SelectRelease)\$(SelectVersion)\bin\blank.bin" "))</AdresseList>
<AdresseList Condition="'$(FlashBoot)'=='true' and '$(ESPBoot)'=='No Boot'">$([System.String]::Concat($(AdresseList), "-a0x00000 "$(MSBuildProjectDirectory)\$(OutputFolder)\$(MSBuildProjectName).eagle.flash(0x00000).bin" "))</AdresseList>
<AdresseList Condition="'$(FlashBoot)'=='true' and '$(ESPBoot)'!='No Boot'">$([System.String]::Concat($(AdresseList), "-a0x00000 "$(VisualStudioXtensa)ESPressif\$(SelectRelease)\$(SelectVersion)\bin\$(ESPBoot).bin" "))</AdresseList>
<AdresseList Condition="'$(FlashUser)'=='true' and '$(ESPBoot)'=='No Boot'">$([System.String]::Concat($(AdresseList), "-a0x10000 "$(MSBuildProjectDirectory)\$(OutputFolder)\$(MSBuildProjectName).eagle.irom0text.bin(0x10000).bin" "))</AdresseList>
<AdresseList Condition="'$(FlashUser)'=='true' and '$(ESPBoot)'!='No Boot'">$([System.String]::Concat($(AdresseList), "-a%(ESPBuilder.UserAddr) "$(MSBuildProjectDirectory)\$(OutputFolder)\$(MSBuildProjectName).user$(ESPBin).%(ESPBuilder.SPIRam).%(ESPBuilder.BootName).$(SPISize)(%(ESPBuilder.UserAddr)).bin" "))</AdresseList>
</PropertyGroup>
<Message Importance="High" Text="*** Flash Info **************************************" />
<Exec Command="esp_tool $(ESPToolChipIDParam) > "$(MSBuildProjectDirectory)\ConsoleOutput.dbg"" Condition="'$(AdresseList)'!=''"/>
<ReadLinesFromFile File="$(MSBuildProjectDirectory)\ConsoleOutput.dbg">
<Output ItemName="_FileContents" TaskParameter="Lines"/>
</ReadLinesFromFile>
<PropertyGroup>
<ChipReady>True</ChipReady>
<ChipReady Condition="$([System.Text.RegularExpressions.Regex]::IsMatch('%(_FileContents.Identity)', 'connection attempt failed'))">False</ChipReady>
</PropertyGroup>
<Message Text="%(_FileContents.Identity)" Importance="High"/>
<Delete Files="$(MSBuildProjectDirectory)\ConsoleOutput.dbg"/>
<Warning Condition="'$(ChipReady)'=='False'" File="Flash Stop..." Text="Flash tool seem to not respond, verify cable and power supply."/>
<Message Condition="'$(AdresseList)'==''" Importance="High" Text="All Flash Parameter is Off. No use to flash." />
<Message Condition="'$(AdresseList)'!='' and '$(ChipReady)'=='True'" Importance="High" Text="Flashing...." />
<Exec Condition="'$(AdresseList)'!='' and '$(ChipReady)'=='True'" Command="esp_tool $(ESPToolBaseParam) $(AdresseList)"/>
</Target>
<Target Name="XtensaESPError">
<FileUpdate Files="$(MSBuildProjectDirectory)\ConsoleOutput.dbg" Regex=":(\d+):(\d+):" ReplacementText="($1,$2):"/>
<ReadLinesFromFile File="$(MSBuildProjectDirectory)\ConsoleOutput.dbg">
<Output ItemName="_FileContents" TaskParameter="Lines"/>
</ReadLinesFromFile>
<Message Text="%(_FileContents.Identity)" Importance="High"/>
<Delete Files="$(MSBuildProjectDirectory)\ConsoleOutput.dbg"/>
</Target>
<!-- SetXtensaVariable -->
<Target Name="SetPythonVariable">
<SetEnv Name="PATH" Value="$(VisualStudioXtensa)Python27;$(VisualStudioXtensa)Xtensa106\bin;$(VisualStudioXtensa);" Prefix="false" >
<Output TaskParameter="OutputEnvironmentVariable" PropertyName="PATH"/>
</SetEnv>
<SetEnv Name="COMPILE" Value="gcc" Prefix="false" >
<Output TaskParameter="OutputEnvironmentVariable" PropertyName="COMPILE"/>
</SetEnv>
</Target>
<Target Name="EspBuilderClean" AfterTargets="Clean">
<ItemGroup>
<FileToDel Include="$(MSBuildProjectDirectory)\$(OutputFolder)\*.bin"/>
</ItemGroup>
<Delete Files="@(FileToDel)" />
</Target>
</Project>