From 0f2c2f2a1dc24eb68dae4eef7050800c315bef8b Mon Sep 17 00:00:00 2001 From: cTn Date: Wed, 13 Nov 2013 10:25:08 +0100 Subject: [PATCH] adding support for baseflights "R" bootloader jump --- js/stm32.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/js/stm32.js b/js/stm32.js index b82592aa..3e765848 100644 --- a/js/stm32.js +++ b/js/stm32.js @@ -111,7 +111,11 @@ STM32_protocol.prototype.initialize = function() { this.hex_to_flash.shift(); // first step - self.upload_procedure(1); + if ($('input.updating').is(':checked')) { + self.upload_procedure(0); + } else { + self.upload_procedure(1); + } }; // no input parameters @@ -236,6 +240,15 @@ STM32_protocol.prototype.upload_procedure = function(step) { self.steps_executed++; switch (step) { + case 0: + // reboot into bootloader mode + console.log('STM32 - Trying to jump into bootloader mode'); + self.send([0x52]); + + GUI.timeout_add('reboot_into_bootloader', function() { + self.upload_procedure(1); + }, 100); + break; case 1: // initialize serial interface on the MCU side, auto baud rate settings self.send([0x7F], 1, function(reply) {