Wednesday 4 January 2017

Flashing a bricked SP Racing F3 Flight Controller



I've been struggling for two days with this and finally found the solution. Scroll down for that.

Background:
So my UART2 plug broke off after a bad crash causing my quad to drop out of the sky on the next flight. Once I found the broken port, I thought that I could simply plug it into a new one, so I did.

Once connected I had problems getting the RX to be recognised, so I thought that the setting must be in Cleanflight. I went to the ports tab and changed some settings and boom, lost connection after saving. Since then I couldn't reconnect.
I tried the following, to no avail:

  • I tried the Zadig driver fixer when the ports weren't available, 
  • I tried the ImpulseRC Driver fixer
  • I tried the STM flash loader demonstrator - this worked after a few tries, but then I stopped being able to connect to the FC again.
  • I tried various SP Racing firmwares, thinking that perhaps I didn't have the same model
Anyway, finally I find a reddit post and I actually read the whole thread for once, and way at the bottom I get the answer.

Solution:
  • I went to 'Add or Remove Programs or Features' and removed the CP210 drivers(look for software by Silicon Laboratories Inc.)
  • Then I removed the STM3 drivers, just search for STM in the list.
  • Finally I installed the CP210 drivers again, and ignored the STM3 drivers.(these drivers can be downloaded from the links on the Cleanflight landing screen.
  • I opened Cleanflight and in the Firmware Flasher I selected my FC model and firmware version. I also checked:
    "No reboot sequence"
    "Flash on connect"
    "Full chip erase"
    and "Manual baud rate" and I set it to 256000
  • I then clicked on "Load Firmware(Online) and waited for it to be loaded
  • I shorted out the two boot pins(google to find yours) on my FC and then plugged in the USB.
BOOOM! instant flashing, no more USB errrors or bootloader errors like before!

I hope this helps you as it helped me

JavaScript replace() method's deviousness!

There is a trick to this method, if you do:
var test = 'old old old';
test = test.replace('old','new');
console.log(test);

The output would not be as expected, you would get:

'new old old'

However, if you remove the quotes and add regex tags:

test = test.replace(/old/g,'new');

You will get every instance replaced in your string.


My pleasure!

Devlog 8: AI and Radar explanation.