betaflight / betaflight-configurator

Cross platform configuration tool for the Betaflight firmware
GNU General Public License v3.0
2.53k stars 896 forks source link

Configurator is only detecting 128kb flash for an STM32F722 #444

Closed MJ666 closed 7 years ago

MJ666 commented 7 years ago

Configurator is only detecting 128kb flash for an STM32F722 (has 512kb) and refuse to flash the firmware since its larger than this. Have no idea how to debug this? Here is the mapping of the flash read with DfuSe Demo.

stm32f722_flash

mikeller commented 7 years ago

F7 support will probably have to be added to https://github.com/betaflight/betaflight-configurator/blob/master/js/protocols/stm32usbdfu.js#L299 and https://github.com/betaflight/betaflight-configurator/blob/master/js/protocols/stm32.js#L260 .

MJ666 commented 7 years ago

With the STM32F745 there is no problem and flashing is working without issue.

blckmn commented 7 years ago

Is it the board identifier not being recognized in the Configurator?

mikeller commented 7 years ago

@blckmn: Either that, or in the case of DFU being used, it could be that the parser for the memory descriptor is failing for whatever is returned by the STM32F745, which is something I can't test since i don't have a board with STM32F745.

MJ666 commented 7 years ago

My STM32F722 does not have a firmware yet. So no board ID but in dfu mode. Flashing is working for an F745 as usual for other MCU's.

mikeller commented 7 years ago

Can you debug the configurator at https://github.com/betaflight/betaflight-configurator/blob/master/js/protocols/stm32usbdfu.js#L299, and see what is returned by the MCU, and how it's parsed?

MJ666 commented 7 years ago

You have any info how debug is working for chrome apps? Never done this before. Thanks.

MJ666 commented 7 years ago

Found how to debug. Here is the result string "@Internal Flash /0x08000000/04016Kg,0164Kg,03*128Kg". Will see how it is parsed. Looks to be not much different as the result for the F4? Parsing this string looks to be fine but there are additional strings parsed also. Need to dig more into this.

MJ666 commented 7 years ago

The STM32F722 has some trailing non ASCII data in the string and this will make parsing of the last flash sector range fail. Also some of the other strings provided by this MCU have some non character bytes in between. I have pushed an related update #450 and flashing is working now properly.

mikeller commented 7 years ago

Welcome to chrome app development! ;-) And thanks for the fix.

MJ666 commented 7 years ago

Was a nice experience and more easy than expected. ;-) I had already another fix fro the configurator quite while ago but this was fixed without the need to debug.

mikeller commented 7 years ago

The Chorme inspector is actually not too bad as a debugger.