mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-15 20:35:19 +03:00
AT32 MCU DFU added
This commit is contained in:
parent
5a6c2d7040
commit
cf35bd6142
5 changed files with 17 additions and 6 deletions
|
@ -1,7 +1,10 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var usbDevices = {
|
var usbDevices = {
|
||||||
STM32DFU: {'vendorId': 1155, 'productId': 57105}
|
filters: [
|
||||||
|
{'vendorId': 1155, 'productId': 57105},
|
||||||
|
{'vendorId': 11836, 'productId': 57105}
|
||||||
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
var PortHandler = new function () {
|
var PortHandler = new function () {
|
||||||
|
@ -152,7 +155,7 @@ PortHandler.check = function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
PortHandler.check_usb_devices = function (callback) {
|
PortHandler.check_usb_devices = function (callback) {
|
||||||
chrome.usb.getDevices(usbDevices.STM32DFU, function (result) {
|
chrome.usb.getDevices(usbDevices, function (result) {
|
||||||
if (result.length) {
|
if (result.length) {
|
||||||
if (!$("div#port-picker #port [value='DFU']").length) {
|
if (!$("div#port-picker #port [value='DFU']").length) {
|
||||||
$('div#port-picker #port').append($('<option/>', {value: "DFU", text: "DFU", data: {isDFU: true}}));
|
$('div#port-picker #port').append($('<option/>', {value: "DFU", text: "DFU", data: {isDFU: true}}));
|
||||||
|
|
|
@ -115,7 +115,7 @@ STM32_protocol.prototype.connect = function (port, baud, hex, options, callback)
|
||||||
PortHandler.check_usb_devices(function(dfu_available) {
|
PortHandler.check_usb_devices(function(dfu_available) {
|
||||||
if (dfu_available) {
|
if (dfu_available) {
|
||||||
clearInterval(interval);
|
clearInterval(interval);
|
||||||
STM32DFU.connect(usbDevices.STM32DFU, hex, options);
|
STM32DFU.connect(usbDevices, hex, options);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Check for the serial port
|
// Check for the serial port
|
||||||
|
|
|
@ -336,6 +336,8 @@ STM32DFU_protocol.prototype.getChipInfo = function (_interface, callback) {
|
||||||
// H750 SPRacing H7 EXST: "@External Flash /0x90000000/998*128Kg,1*128Kg,4*128Kg,21*128Ka"
|
// H750 SPRacing H7 EXST: "@External Flash /0x90000000/998*128Kg,1*128Kg,4*128Kg,21*128Ka"
|
||||||
// H750 SPRacing H7 EXST: "@External Flash /0x90000000/1001*128Kg,3*128Kg,20*128Ka" - Early BL firmware with incorrect string, treat as above.
|
// H750 SPRacing H7 EXST: "@External Flash /0x90000000/1001*128Kg,3*128Kg,20*128Ka" - Early BL firmware with incorrect string, treat as above.
|
||||||
|
|
||||||
|
// AT32F435: "@Internal Flash /0x08000000/512*002Kg,@Option byte /0x1FFFC000/01*512 g"
|
||||||
|
|
||||||
// H750 Partitions: Flash, Config, Firmware, 1x BB Management block + x BB Replacement blocks)
|
// H750 Partitions: Flash, Config, Firmware, 1x BB Management block + x BB Replacement blocks)
|
||||||
if (str == "@External Flash /0x90000000/1001*128Kg,3*128Kg,20*128Ka") {
|
if (str == "@External Flash /0x90000000/1001*128Kg,3*128Kg,20*128Ka") {
|
||||||
str = "@External Flash /0x90000000/998*128Kg,1*128Kg,4*128Kg,21*128Ka";
|
str = "@External Flash /0x90000000/998*128Kg,1*128Kg,4*128Kg,21*128Ka";
|
||||||
|
@ -617,6 +619,11 @@ STM32DFU_protocol.prototype.upload_procedure = function (step) {
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
|
// workaroud for AT32
|
||||||
|
if (typeof self.chipInfo.option_bytes === "undefined" && typeof self.chipInfo.option_byte !== "undefined") {
|
||||||
|
self.chipInfo.option_bytes = self.chipInfo.option_byte;
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof self.chipInfo.option_bytes === "undefined") {
|
if (typeof self.chipInfo.option_bytes === "undefined") {
|
||||||
console.log('Failed to detect option bytes');
|
console.log('Failed to detect option bytes');
|
||||||
self.cleanup();
|
self.cleanup();
|
||||||
|
|
|
@ -47,7 +47,8 @@
|
||||||
"notifications",
|
"notifications",
|
||||||
"alwaysOnTopWindows",
|
"alwaysOnTopWindows",
|
||||||
{"usbDevices": [
|
{"usbDevices": [
|
||||||
{"vendorId": 1155, "productId": 57105}
|
{"vendorId": 1155, "productId": 57105},
|
||||||
|
{"vendorId": 11836, "productId": 57105}
|
||||||
]}
|
]}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
|
@ -405,7 +405,7 @@ TABS.firmware_flasher.initialize = function (callback) {
|
||||||
GUI.log('<span style="color: red">Please select valid serial port</span>');
|
GUI.log('<span style="color: red">Please select valid serial port</span>');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
STM32DFU.connect(usbDevices.STM32DFU, parsed_hex, options);
|
STM32DFU.connect(usbDevices, parsed_hex, options);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$('span.progressLabel').text(chrome.i18n.getMessage('firmwareFlasherFirmwareNotLoaded'));
|
$('span.progressLabel').text(chrome.i18n.getMessage('firmwareFlasherFirmwareNotLoaded'));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue