napo7

  • *
  • 14
Help needed flashing SP racing F3
« on: May 15, 2018, 10:51:51 pm »
Hi

I'm new to librepilot and drones...
I've 3D printed a mavic clone, bought everything needed after a loooong time crawling the web for choosing a controller...

I've bought a SP Racing F3 deluxe, but have some problems flashing it ;)

So I'm here !

This is what I've done so far:
- The board came with betaflight (I think).
- At this moment, the blue light was light still, and the red blinking slowly.
- So I installed chrome, betaflight, and flashed the bootloader that I found in the wiki (bl_spracingf3.hex).
- Once the bootloader got flashed (no error messages), the red light now fade in and out, but I can't flash firmware with NEXT version of librepilot. I've tried to plug the board while the countdown, plug it before, same thing...
- I've also tried to go in betaflight to flash BF on it, but I always got "no bootloader response"... I suppose it is because I've flashed a LP bootloader on it ??

Forgot to mention, I'm on linux, the board is detected as /dev/ttyUSB0, and I managed to get r/w on it...

Edit : I managed to reflash betaflight when booting the board with the BOOT jumper. Tried the same with librepilot but no luck.

Any tips to help me ?

Thanks !
« Last Edit: May 16, 2018, 03:07:06 pm by napo7 »

Re: Help needed flashing SP racinghis i F3
« Reply #1 on: May 16, 2018, 03:51:17 am »
You would probably get better advice for BF on a BF forum, but if you want to put LP on it, see your other post and wait for mr_w (or one of several who know that subject better than I) to give you some advice.

f5soh

  • *****
  • 4572
    • LibrePilot
Re: Help needed flashing SP racinghis i F3
« Reply #2 on: May 16, 2018, 07:19:01 am »
Hi,

Try to make first the entire flash firmware file
Quote
make ef_spracingf3
And flash the file found in ./build/firmware/ef_spracingf3/ef_spracingf3.bin using BF.
Flashing from LP will work using/selecting the serial (instead of USB by default) into the Uploader plugin in Firmware tab or using the console uploader you can build using 'make uploader' (./build/uploader_release/UploadTool)

napo7

  • *
  • 14
Re: Help needed flashing SP racinghis i F3
« Reply #3 on: May 16, 2018, 08:33:51 am »
I managed to compile the firmware and got the ef_spracingf3.bin file.
But BF does want a HEX file...
So I've tried to "make uploader", but got compile errors...

Is there a way to convert the .bin to a .hex file ?

mr_w

  • *
  • 207
    • LibrePilot
Re: Help needed flashing SP racinghis i F3
« Reply #4 on: May 16, 2018, 08:38:04 am »
You could try

make fw_spracingf3_hex

Which would give you firmware part in hex. This doesn't contain bootloader, but as you have burned bootloader already, it should work.



napo7

  • *
  • 14
Re: Help needed flashing SP racinghis i F3
« Reply #5 on: May 16, 2018, 08:50:08 am »
Great !

It's so easy when you know what to do  8)

I've flashed the .hex file with BF.

Once the firmware got flashed, the board did not seem to boot. I had to reflash the bootloader, and it then came alive !

napo7

  • *
  • 14
Re: Help needed flashing SP racinghis i F3
« Reply #6 on: May 16, 2018, 10:41:06 am »
One last thing : When I connect librepilot (installed from ppa) to the F3, it says that the GCS and firmware versions doesn't match :

Version GCS : 20180429 23:01 (a4c0bcfb-7aff4e56)
Version Firmware :  (-)

I suppose that since I flashed my firmware manualy, the version reported is empty, and should match the GCS version ?
What can I do for this ?

Can I now flash the board from GCS ?

f5soh

  • *****
  • 4572
    • LibrePilot
Re: Help needed flashing SP racinghis i F3
« Reply #7 on: May 16, 2018, 03:03:16 pm »
Maybe some information about the firmware is not available while flashing from hex and just returns (-) as firmware description.
Since the board is alive you can connect the board and click the Upgrade&Erase button for a 'complete' firmware update.

napo7

  • *
  • 14
Re: Help needed flashing SP racing F3
« Reply #8 on: May 16, 2018, 03:08:55 pm »
Strangely, while the board is recognized and I can connet to it, trying a "Upgrade&Erase" still does not allows me to upgrade it.
I still have the 20s countdown, and even if I try to disconnect and reconnect it, GCS doesn't seems to recognize it.
Strange since I have in the console "ConnectionManager::devChanged - device count: 5", changing down & up as I disconnect and reconnect the board ?

mr_w

  • *
  • 207
    • LibrePilot
Re: Help needed flashing SP racing F3
« Reply #9 on: May 16, 2018, 03:59:43 pm »
The upgrade&erase won't work in next. I had it working in one of my private branches, but decided not to push the changes until other work on uploader was merged into next. which haven't happened so far.

But if you know that you used same version of firmware as you GCS is, you are safe. Just ignore the warning. Info about uavo/fw versions is stored in separate flash block and updated only when flashing from gcs. Don't worry.



napo7

  • *
  • 14
Re: Help needed flashing SP racing F3
« Reply #10 on: May 16, 2018, 04:04:13 pm »
So I suppose that the best I have to do is to pull git source, compile GCS & firmware and use both correct versions !

I have a small problem compiling the source. I have installed the deps as told in the wiki (linux mint), but I have the following error when "make uploader" :
Code: [Select]
Compiling ../../ground/gcs/src/experimental/USB_UPLOAD_TOOL/main.cpp
In file included from ../../ground/gcs/src/experimental/USB_UPLOAD_TOOL/main.cpp:28:0:
../../ground/gcs/src/experimental/USB_UPLOAD_TOOL/dfu.h:202:5: error: ‘uint8_t’ does not name a type

and some other similar errors...
Any idea ?

Edit : It seems that "make gcs" doesn't produce any errors (until now , not finished compiling !)
« Last Edit: May 16, 2018, 04:16:30 pm by napo7 »

Re: Help needed flashing SP racing F3
« Reply #11 on: May 16, 2018, 05:35:45 pm »
ef_something doesn't have something bootloader?

mr_w

  • *
  • 207
    • LibrePilot
Re: Help needed flashing SP racing F3
« Reply #12 on: May 17, 2018, 01:26:37 am »
Yes cliff it has bl, but unfortunately make ef_something_hex doesn't quite work. Could be a simple thing to fix though. 

napo7

  • *
  • 14
Re: Help needed flashing SP racing F3
« Reply #13 on: May 17, 2018, 08:47:39 am »
PS : I didn't had any issue with make ef_spracingf3_hex.

My problem was compiling the uploader with "make uploader" which failed with the above error ;)

mr_w

  • *
  • 207
    • LibrePilot
Re: Help needed flashing SP racing F3
« Reply #14 on: May 17, 2018, 09:56:30 am »
@napo7
You sure about

[mr_w@macbox librepilot-next]$ make ef_spracingf3_hex
 NOTE        Sanitized disallowed variable 'TMPDIR' from environment
make[1]: Nothing to be done for `bin'.
- LibrePilot UAVObject Generator -
Done: processed 122 XML files and generated 122 objects with no ID collisions. Total size of the data fields is 5110 bytes.
generating flight code
 FWINFO      /Volumes/Workspace/Flight/librepilot/librepilot-next/build/firmware/fw_spracingf3/fw_spracingf3.bin.firmware_info.c
make[1]: *** No rule to make target `hex'.  Stop.
make: *** [ef_spracingf3_hex] Error 2


?