cleanflight / cleanflight-configurator

Google chrome/chromium based configuration tool for the cleanflight firmware
GNU General Public License v3.0
334 stars 252 forks source link

Flashing - Support STM32F3 based targets in DFU mode. #65

Closed MJ666 closed 8 years ago

MJ666 commented 9 years ago

Looks to be the code already contain parts to enable DFU flashing? Not sure what the actual state is and if this part of the code is already working. Actually the GUI is only allowing Hex files to be selected and will do some basic tests. Also an STM device in boot mode is not detected by the GUI. Would be nice to be able to flash all targets easily via the GUI.

I have opened an related issue in CF already: https://github.com/cleanflight/cleanflight/issues/412

MJ666 commented 9 years ago

@hydra this may be also get interesting for you with the SP Racing F3?

hydra commented 9 years ago

@MJ666 SPRacingF3 uses CP2102, no DFU required. Sparky requires DFU mode.

andymac4182 commented 8 years ago

I have been working through this and it seems mostly there. The only issue I have now is the getDevices (https://developer.chrome.com/apps/usb#method-getDevices) function doesn't return a device even through I can see it in DFU mode and flash it with other software. Any ideas or pointers?

tracernz commented 8 years ago

Have you added the USB VID/PID to the manifest? It will only return devices you have permissions to access.

andymac4182 commented 8 years ago

They are added already in the existing Configurator. I confirmed they are correct. Been busy with work but going back to look at this soon.

tracernz commented 8 years ago

They are listed as optional permissions though. You will need to make sure you request them somewhere. https://developer.chrome.com/apps/permissions#method-request

tracernz commented 8 years ago

I had a look at this. You need to uncomment this line and then click the button on the landing page to request USB permissions: https://github.com/cleanflight/cleanflight-configurator/blob/master/tabs/landing.js#L13.

Then this line needs to go below line 356: https://github.com/cleanflight/cleanflight-configurator/blob/master/js/protocols/stm32usbdfu.js#L300

After that I successfully flashed my STM32F3 Discovery board using USB-DFU. I did note the code isn't really complete in that it doesn't handle some error conditions properly though.

andymac4182 commented 8 years ago

I will check this out again. I couldn't get it working on my version of Chrome.

tracernz commented 8 years ago

I've submitted a PR which makes the minimal changes, please test that. :)

skaman82 commented 8 years ago

@MJ666 can we close this?

MJ666 commented 8 years ago

Sorry will close it.