mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-14 11:59:51 +03:00
STM F3 support
Partial F3 support. Should be enough to flash correctly. Currently only full chip erase is supported. IT IS NOT TESTED AT ALL as I don't have hardware
This commit is contained in:
parent
d10023ec4b
commit
ef682cdca9
1 changed files with 28 additions and 0 deletions
|
@ -304,6 +304,8 @@ STM32_protocol.prototype.verify_chip_signature = function (signature) {
|
||||||
break;
|
break;
|
||||||
case 0x422: // not tested
|
case 0x422: // not tested
|
||||||
console.log('Chip recognized as F3 STM32F30xxx, STM32F31xxx');
|
console.log('Chip recognized as F3 STM32F30xxx, STM32F31xxx');
|
||||||
|
this.available_flash_size = 0x40000;
|
||||||
|
this.page_size = 2048;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,6 +344,8 @@ STM32_protocol.prototype.verify_flash = function (first_array, second_array) {
|
||||||
STM32_protocol.prototype.upload_procedure = function (step) {
|
STM32_protocol.prototype.upload_procedure = function (step) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
var extendedErase=false;
|
||||||
|
|
||||||
switch (step) {
|
switch (step) {
|
||||||
case 1:
|
case 1:
|
||||||
// initialize serial interface on the MCU side, auto baud rate settings
|
// initialize serial interface on the MCU side, auto baud rate settings
|
||||||
|
@ -389,6 +393,9 @@ STM32_protocol.prototype.upload_procedure = function (step) {
|
||||||
self.retrieve(data[1] + 1 + 1, function (data) { // data[1] = number of bytes that will follow [– 1 except current and ACKs]
|
self.retrieve(data[1] + 1 + 1, function (data) { // data[1] = number of bytes that will follow [– 1 except current and ACKs]
|
||||||
console.log('STM32 - Bootloader version: ' + (parseInt(data[0].toString(16)) / 10).toFixed(1)); // convert dec to hex, hex to dec and add floating point
|
console.log('STM32 - Bootloader version: ' + (parseInt(data[0].toString(16)) / 10).toFixed(1)); // convert dec to hex, hex to dec and add floating point
|
||||||
|
|
||||||
|
|
||||||
|
extendedErase=data[7]==0x44;
|
||||||
|
|
||||||
// proceed to next step
|
// proceed to next step
|
||||||
self.upload_procedure(3);
|
self.upload_procedure(3);
|
||||||
});
|
});
|
||||||
|
@ -418,6 +425,26 @@ STM32_protocol.prototype.upload_procedure = function (step) {
|
||||||
// erase memory
|
// erase memory
|
||||||
$('span.progressLabel').text('Erasing ...');
|
$('span.progressLabel').text('Erasing ...');
|
||||||
|
|
||||||
|
|
||||||
|
if(extendedErase)
|
||||||
|
{
|
||||||
|
console.log('Executing global chip extended erase');
|
||||||
|
|
||||||
|
self.send([0x44, 0xBB], 1, function (reply) {
|
||||||
|
if (self.verify_response(self.status.ACK, reply)) {
|
||||||
|
self.send( [0xFF, 0xFF, 0x00], 1, function (reply){
|
||||||
|
if (self.verify_response(self.status.ACK, reply)){
|
||||||
|
console.log('Executing global chip extended erase - done');
|
||||||
|
self.upload_procedure(5);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}else{
|
||||||
|
|
||||||
if (self.options.erase_chip) {
|
if (self.options.erase_chip) {
|
||||||
console.log('Executing global chip erase');
|
console.log('Executing global chip erase');
|
||||||
|
|
||||||
|
@ -462,6 +489,7 @@ STM32_protocol.prototype.upload_procedure = function (step) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
// upload
|
// upload
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue