Add support for manual baud rate selection to firmware flasher.
parent
5471ab7f65
commit
3086a98828
|
@ -1047,11 +1047,11 @@
|
||||||
"firmwareFlasherFlashDevelopmentFirmwareDescription": {
|
"firmwareFlasherFlashDevelopmentFirmwareDescription": {
|
||||||
"message": "Flash most recent (untested) development firmware"
|
"message": "Flash most recent (untested) development firmware"
|
||||||
},
|
},
|
||||||
"firmwareFlasherFlashSlowly": {
|
"firmwareFlasherManualBaud": {
|
||||||
"message": "Flash slowly"
|
"message": "Manual Baud Rate"
|
||||||
},
|
},
|
||||||
"firmwareFlasherFlashSlowlyDescription": {
|
"firmwareFlasherManualBaudDescription": {
|
||||||
"message": "Use 115200 baudrate for flashing (useful for flashing via bluetooth)"
|
"message": "Manual selection of baud rate for boards that don't support the default speed or for flashing via bluetooth."
|
||||||
},
|
},
|
||||||
"firmwareFlasherShowDevelopmentReleases":{
|
"firmwareFlasherShowDevelopmentReleases":{
|
||||||
"message": "Show unstable releases"
|
"message": "Show unstable releases"
|
||||||
|
|
|
@ -60,8 +60,7 @@ STM32_protocol.prototype.connect = function (port, baud, hex, options, callback)
|
||||||
self.options = {
|
self.options = {
|
||||||
no_reboot: false,
|
no_reboot: false,
|
||||||
reboot_baud: false,
|
reboot_baud: false,
|
||||||
erase_chip: false,
|
erase_chip: false
|
||||||
flash_slowly: false
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (options.no_reboot) {
|
if (options.no_reboot) {
|
||||||
|
@ -74,11 +73,6 @@ STM32_protocol.prototype.connect = function (port, baud, hex, options, callback)
|
||||||
self.options.erase_chip = true;
|
self.options.erase_chip = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.flash_slowly) {
|
|
||||||
self.options.flash_slowly = true;
|
|
||||||
self.baud = 115200;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (self.options.no_reboot) {
|
if (self.options.no_reboot) {
|
||||||
serial.connect(port, {bitrate: self.baud, parityBit: 'even', stopBits: 'one'}, function (openInfo) {
|
serial.connect(port, {bitrate: self.baud, parityBit: 'even', stopBits: 'one'}, function (openInfo) {
|
||||||
if (openInfo) {
|
if (openInfo) {
|
||||||
|
|
|
@ -71,11 +71,15 @@
|
||||||
margin-left: 6px;
|
margin-left: 6px;
|
||||||
}
|
}
|
||||||
.tab-firmware_flasher .options select {
|
.tab-firmware_flasher .options select {
|
||||||
width: 280px;
|
|
||||||
height: 20px;
|
height: 20px;
|
||||||
|
|
||||||
border: 1px solid silver;
|
border: 1px solid silver;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tab-firmware_flasher .options .releases select {
|
||||||
|
width: 280px;
|
||||||
|
}
|
||||||
|
|
||||||
.tab-firmware_flasher .option.releases {
|
.tab-firmware_flasher .option.releases {
|
||||||
margin: 0 0 2px 0;
|
margin: 0 0 2px 0;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
|
@ -91,6 +95,10 @@
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tab-firmware_flasher .options .manual_baud_rate select {
|
||||||
|
width: 70px;
|
||||||
|
}
|
||||||
|
|
||||||
.tab-firmware_flasher .release_info {
|
.tab-firmware_flasher .release_info {
|
||||||
display: none;
|
display: none;
|
||||||
|
|
||||||
|
|
|
@ -31,12 +31,23 @@
|
||||||
</label>
|
</label>
|
||||||
<span class="description" i18n="firmwareFlasherFullChipEraseDescription"></span>
|
<span class="description" i18n="firmwareFlasherFullChipEraseDescription"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="option">
|
<div class="option manual_baud_rate">
|
||||||
<label>
|
<label>
|
||||||
<input class="flash_slowly" type="checkbox" />
|
<input class="flash_manual_baud" type="checkbox" />
|
||||||
<span i18n="firmwareFlasherFlashSlowly"></span>
|
<span i18n="firmwareFlasherManualBaud"></span>
|
||||||
|
<select id="flash_manual_baud_rate" title="Baud Rate">
|
||||||
|
<option value="921600">921600</option>
|
||||||
|
<option value="460800">460800</option>
|
||||||
|
<option value="256000" selected="selected">256000</option>
|
||||||
|
<option value="230400">230400</option>
|
||||||
|
<option value="115200">115200</option>
|
||||||
|
<option value="57600">57600</option>
|
||||||
|
<option value="38400">38400</option>
|
||||||
|
<option value="28800">28800</option>
|
||||||
|
<option value="19200">19200</option>
|
||||||
|
</select>
|
||||||
</label>
|
</label>
|
||||||
<span class="description" i18n="firmwareFlasherFlashSlowlyDescription"></span>
|
<span class="description" i18n="firmwareFlasherManualBaudDescription"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="option">
|
<div class="option">
|
||||||
<label>
|
<label>
|
||||||
|
|
|
@ -336,10 +336,11 @@ TABS.firmware_flasher.initialize = function (callback) {
|
||||||
options.erase_chip = true;
|
options.erase_chip = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($('input.flash_slowly').is(':checked')) {
|
if ($('input.flash_manual_baud').is(':checked')) {
|
||||||
options.flash_slowly = true;
|
baud = parseInt($('#flash_manual_baud_rate').val());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
STM32.connect(port, baud, parsed_hex, options);
|
STM32.connect(port, baud, parsed_hex, options);
|
||||||
} else {
|
} else {
|
||||||
console.log('Please select valid serial port');
|
console.log('Please select valid serial port');
|
||||||
|
@ -423,6 +424,35 @@ TABS.firmware_flasher.initialize = function (callback) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
chrome.storage.local.get('flash_manual_baud', function (result) {
|
||||||
|
if (result.flash_manual_baud) {
|
||||||
|
$('input.flash_manual_baud').prop('checked', true);
|
||||||
|
} else {
|
||||||
|
$('input.flash_manual_baud').prop('checked', false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// bind UI hook so the status is saved on change
|
||||||
|
$('input.flash_manual_baud').change(function() {
|
||||||
|
var status = $(this).is(':checked');
|
||||||
|
|
||||||
|
chrome.storage.local.set({'flash_manual_baud': status});
|
||||||
|
});
|
||||||
|
|
||||||
|
$('input.flash_manual_baud').change();
|
||||||
|
});
|
||||||
|
|
||||||
|
chrome.storage.local.get('flash_manual_baud_rate', function (result) {
|
||||||
|
$('#flash_manual_baud_rate').val(result.flash_manual_baud_rate);
|
||||||
|
|
||||||
|
// bind UI hook so the status is saved on change
|
||||||
|
$('#flash_manual_baud_rate').change(function() {
|
||||||
|
var baud = parseInt($('#flash_manual_baud_rate').val());
|
||||||
|
chrome.storage.local.set({'flash_manual_baud_rate': baud});
|
||||||
|
});
|
||||||
|
|
||||||
|
$('input.flash_manual_baud_rate').change();
|
||||||
|
});
|
||||||
|
|
||||||
chrome.storage.local.get('flash_on_connect', function (result) {
|
chrome.storage.local.get('flash_on_connect', function (result) {
|
||||||
if (result.flash_on_connect) {
|
if (result.flash_on_connect) {
|
||||||
$('input.flash_on_connect').prop('checked', true);
|
$('input.flash_on_connect').prop('checked', true);
|
||||||
|
@ -477,19 +507,6 @@ TABS.firmware_flasher.initialize = function (callback) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
chrome.storage.local.get('flash_slowly', function (result) {
|
|
||||||
if (result.flash_slowly) {
|
|
||||||
$('input.flash_slowly').prop('checked', true);
|
|
||||||
} else {
|
|
||||||
$('input.flash_slowly').prop('checked', false);
|
|
||||||
}
|
|
||||||
|
|
||||||
// bind UI hook so the status is saved on change
|
|
||||||
$('input.flash_slowly').change(function () {
|
|
||||||
chrome.storage.local.set({'flash_slowly': $(this).is(':checked')});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
$(document).keypress(function (e) {
|
$(document).keypress(function (e) {
|
||||||
if (e.which == 13) { // enter
|
if (e.which == 13) { // enter
|
||||||
// Trigger regular Flashing sequence
|
// Trigger regular Flashing sequence
|
||||||
|
|
Loading…
Reference in New Issue