diff --git a/js/stm32.js b/js/stm32.js index 3e765848d0..b6ef516bf0 100644 --- a/js/stm32.js +++ b/js/stm32.js @@ -42,6 +42,11 @@ var STM32_protocol = function() { // Erase (x043) and Extended Erase (0x44) are exclusive. A device may support either the Erase command or the Extended Erase command but not both. }; +// string = string .. duh +STM32_protocol.prototype.GUI_status = function(string) { + $('span.status').html(string); +}; + // no input parameters STM32_protocol.prototype.connect = function() { var self = this; @@ -97,6 +102,7 @@ STM32_protocol.prototype.initialize = function() { self.steps_executed_last = self.steps_executed; } else { console.log('STM32 - timed out, programming failed ...'); + STM32.GUI_status('STM32 - timed out, programming: FAILED'); // protocol got stuck, clear timer and disconnect GUI.interval_remove('STM32_timeout'); @@ -243,6 +249,7 @@ STM32_protocol.prototype.upload_procedure = function(step) { case 0: // reboot into bootloader mode console.log('STM32 - Trying to jump into bootloader mode'); + STM32.GUI_status('Rebooting'); self.send([0x52]); GUI.timeout_add('reboot_into_bootloader', function() { @@ -297,6 +304,7 @@ STM32_protocol.prototype.upload_procedure = function(step) { case 4: // erase memory console.log('Executing global chip erase'); + STM32.GUI_status('Erasing'); self.send([self.command.erase, 0xBC], 1, function(reply) { // 0x43 ^ 0xFF if (self.verify_response(self.status.ACK, reply)) { @@ -304,6 +312,7 @@ STM32_protocol.prototype.upload_procedure = function(step) { if (self.verify_response(self.status.ACK, reply)) { console.log('Erasing: done'); console.log('Writing data ...'); + STM32.GUI_status('Flashing ...'); // proceed to next step self.upload_procedure(5); @@ -359,6 +368,7 @@ STM32_protocol.prototype.upload_procedure = function(step) { } else { console.log('Writing: done'); console.log('Verifying data ...'); + STM32.GUI_status('Verifying ...'); // proceed to next step self.upload_procedure(6); @@ -409,12 +419,14 @@ STM32_protocol.prototype.upload_procedure = function(step) { if (result) { console.log('Verifying: done'); console.log('Programming: SUCCESSFUL'); + STM32.GUI_status('Programming: SUCCESSFUL'); // proceed to next step self.upload_procedure(7); } else { console.log('Verifying: failed'); console.log('Programming: FAILED'); + STM32.GUI_status('Programming: FAILED'); // disconnect self.upload_procedure(99); diff --git a/tabs/firmware_flasher.html b/tabs/firmware_flasher.html index cbb3513543..b53d29d508 100644 --- a/tabs/firmware_flasher.html +++ b/tabs/firmware_flasher.html @@ -2,6 +2,23 @@ .tab-firmware_flasher .info { margin: 0 0 10px 0; } + .tab-firmware_flasher .info strong { + margin-right: 5px; + } + .tab-firmware_flasher .note { + float: left; + + margin-bottom: 10px; + padding: 5px; + + border: 1px dotted silver; + } + .tab-firmware_flasher .note p { + margin-top: 5px; + } + .tab-firmware_flasher .note input { + margin-top: 2px; + } a.load_file { display: block; float: left; @@ -40,9 +57,18 @@
- Path:
- Size: + Path:empty
+ Size:0.000 kb
+ Status:Firmware not loaded
+
+ Reboot sequence: +

+ If you are flashing board with baseflight already flashed (updating), leave this checkbox checked.
+ If you are flashing "bare" board with no firmware preloaded or you have bootloader pins shorted, uncheck this checkbox.
+

+
+
Load Firmware Flash Firmware
\ No newline at end of file diff --git a/tabs/firmware_flasher.js b/tabs/firmware_flasher.js index e26625bff3..980918d6d3 100644 --- a/tabs/firmware_flasher.js +++ b/tabs/firmware_flasher.js @@ -28,6 +28,7 @@ function tab_initialize_firmware_flasher() { reader.onloadend = function(e) { console.log('File loaded'); + STM32.GUI_status('Firmware loaded, ready for flashing'); intel_hex = e.target.result; raw_hex = read_hex_file(intel_hex); @@ -46,6 +47,8 @@ function tab_initialize_firmware_flasher() { STM32.hex_to_flash = raw_hex.slice(0); STM32.connect(); + } else { + STM32.GUI_status('Firmware not loaded'); } }); });