199 @exception ValueError raised to indicate an unsupported chip type |
199 @exception ValueError raised to indicate an unsupported chip type |
200 """ |
200 """ |
201 from .EspFirmwareSelectionDialog import EspFirmwareSelectionDialog |
201 from .EspFirmwareSelectionDialog import EspFirmwareSelectionDialog |
202 dlg = EspFirmwareSelectionDialog() |
202 dlg = EspFirmwareSelectionDialog() |
203 if dlg.exec() == QDialog.DialogCode.Accepted: |
203 if dlg.exec() == QDialog.DialogCode.Accepted: |
204 chip, firmware, flashMode, _ = dlg.getData() |
204 chip, firmware, baudRate, flashMode, _ = dlg.getData() |
205 if chip == "esp8266": |
205 if chip == "esp8266": |
206 flashAddress = "0x0000" |
206 flashAddress = "0x0000" |
207 elif chip == "esp32": |
207 elif chip == "esp32": |
208 flashAddress = "0x1000" |
208 flashAddress = "0x1000" |
209 else: |
209 else: |
237 Private slot to flash some additional firmware images. |
241 Private slot to flash some additional firmware images. |
238 """ |
242 """ |
239 from .EspFirmwareSelectionDialog import EspFirmwareSelectionDialog |
243 from .EspFirmwareSelectionDialog import EspFirmwareSelectionDialog |
240 dlg = EspFirmwareSelectionDialog(addon=True) |
244 dlg = EspFirmwareSelectionDialog(addon=True) |
241 if dlg.exec() == QDialog.DialogCode.Accepted: |
245 if dlg.exec() == QDialog.DialogCode.Accepted: |
242 chip, firmware, flashMode, flashAddress = dlg.getData() |
246 chip, firmware, baudRate, flashMode, flashAddress = dlg.getData() |
243 flashArgs = [ |
247 flashArgs = [ |
244 "-u", |
248 "-u", |
245 "-m", "esptool", |
249 "-m", "esptool", |
246 "--chip", chip, |
250 "--chip", chip, |
247 "--port", self.microPython.getCurrentPort(), |
251 "--port", self.microPython.getCurrentPort(), |
248 "write_flash", |
252 "write_flash", |
249 ] |
253 ] |
|
254 if baudRate != "115200": |
|
255 flashArgs.extend([ |
|
256 "--baud", baudRate |
|
257 ]) |
250 if flashMode: |
258 if flashMode: |
251 flashArgs.extend([ |
259 flashArgs.extend([ |
252 "--flash_mode", flashMode |
260 "--flash_mode", flashMode |
253 ]) |
261 ]) |
254 flashArgs.extend([ |
262 flashArgs.extend([ |