hwh

  • *
  • 1018
Re: Problems set up Build environment on OS X
« Reply #15 on: January 14, 2017, 09:10:13 am »
I was never able to get the OPUploadTool to upload firmware.  I just tried four or five times again and never got it to work.

I always recommend using a STLinkV2 to flash things.  No jumpers, no critical timing, it just works.  A genuine one is less than $25 and the clones on eBay less than $5.  It works to read and write the firmware on most F1, F3, and F4 based boards.  The cc3d, revo, and GPSv9 all have the same debug (SWD) connector on them.  Several other boards also use the same connector.  The ones that don't just need another adapter cable made.

I've used them on linux and windows only but the texane utilities supposedly can be compiled on OS-X.
« Last Edit: January 14, 2017, 09:14:26 am by hwh »

f5soh

  • *****
  • 4572
    • LibrePilot
Re: Problems set up Build environment on OS X
« Reply #16 on: January 14, 2017, 11:38:44 am »
Maybe there is others issues around.
With OPUploaderTool there is no need to short pads.

Here is a screenshot where the GPSv9 is flashed from a custom LiveCD:





karla

  • *****
  • 629
Re: Problems set up Build environment on OS X
« Reply #17 on: January 14, 2017, 02:21:57 pm »
Here is a screenshot where the GPSv9 is flashed from a custom LiveCD:

Do you mean having a CD version of Linux than can boot up my Mac will make it run on Linux instead of OSX, then I can use the Linux version of the OPUploaderTool to flash the GPSv9?

If so, i still need to get hold of the OPUploaderTool executable for Linux right?

f5soh

  • *****
  • 4572
    • LibrePilot
Re: Problems set up Build environment on OS X
« Reply #18 on: January 14, 2017, 06:13:52 pm »
I made a i386 custom LiveCD with LP16.09, OPUploaderTool and firmware file on it.
Screenshot above describe the steps.

You can give a try using a PC if you have one at home.
Here is the iso file:
https://drive.google.com/drive/folders/0B5d_9OcqQj8BY1N1OXdqdGxGejA

http://www.linuxliveusb.com allow making a USB stick from Windows if you do not want to burn a DVD.



Re: Problems set up Build environment on OS X
« Reply #19 on: January 14, 2017, 06:38:13 pm »
You beat me to it.  I was in the middle of writing instructions to just download a live CD and install dependencies.

Re: Problems set up Build environment on OS X
« Reply #20 on: January 14, 2017, 07:30:15 pm »
FTDI USB to serial converter on eBay for $1.82 shipped.  Order one for later if not for now.  :)
http://www.ebay.com/itm/FTDI-Adapter-FT232RL-USB-zu-TTL-Serial-fur-3-3V-und-5V-fur-Arduino-PRO-Mini-/172456631436
The cheap one (USD $0.78) at this link would probably work too.  I just ordered one to play with.
http://www.ebay.com/itm/FTDI-FT232RL-USB-to-TTL-Serial-Converter-Adapter-Module-5V-3-3V-For-Arduino-New-/272501584059

Instructions to flash the GPS under Linux
I tested this myself just now (with my own built uploader and firmware)
-----------------------------------------------------------------------------------------------
set FTDI jumper to 5v or use the 5v pin when wiring a connector on the USB to serial adapter
  (the GPS needs 5v to run)
unplug the GPS from the FTDI (USB to serial converter)
plug the FTDI into the PC USB port
type this to make sure your device is called ttyUSB0
  ls -lrt /dev
I find ttyUSB0 third from the bottom for my FTDI brand USB to serial converter.  If using an OP FC set up as ComBridge instead of an FTDI, the device name will probably be ttyACM0.  In addition to being set up as ComBridge, an OP FC might need to have the correct baud rate set.  Use the GCS for that.  Do I recall that you need to leave the GCS running to use an FC as a ComBridge?

Once you are in a directory that has both uploader and the firmware you type this (but don't press Enter yet):
./OPUploaderTool -t /dev/ttyUSB0 -p fw_gpsplatinum.opfw

Get ready to plug the GPS "GPS+MCU" port into the FTDI
Press Enter and quickly plug the GPS into the FTDI

Within a few seconds, it should produce a progress bar, if not, ^C and try again.
« Last Edit: January 14, 2017, 07:37:27 pm by TheOtherCliff »

hwh

  • *
  • 1018
Re: Problems set up Build environment on OS X
« Reply #21 on: January 14, 2017, 07:50:54 pm »
...In addition to being set up as ComBridge, an OP FC might need to have the correct baud rate set.  Use the GCS for that....

You'd have to use an old version of GCS, that was deleted.  It automatically sets whatever baud rate the program opening the port sets.  If it doesn't set it then the system default is used.  The stty command will tell you what speed.

Have you tried combridge?  I remember someone saying it didn't work for the GPS update.
« Last Edit: January 14, 2017, 07:53:55 pm by hwh »

Re: Problems set up Build environment on OS X
« Reply #22 on: January 14, 2017, 09:33:08 pm »
Good to hear that ComBridge obeys the program for baud rate now.
I used ComBridge a long time ago (before GPS auto-everything) to connect GPS to u-center for configuration.  That is the last time I tried ComBridge.

I just used a Nano (a new K.Finisterre Nano) as a ComBridge and it starts but times out after flashing a few (5-22) percent.  I configured MainPort as a Combridge, stopped the GCS and unplugged everything, plugged in flight power to the Nano, plugged USB into the Nano, waited a few seconds for fast flashing and gyros to init, plugged GPS into the Nano and hit return on the following command line (which contains paths to files since they were not in my current directory).

./build/uploader_release/OPUploadTool -t /dev/ttyACM0 -p build/firmware/fw_gpsplatinum/fw_gpsplatinum.opfw

I tried several different things, INS13, 50hz output banks, disable USB HID, 6v power.
« Last Edit: January 14, 2017, 09:51:44 pm by TheOtherCliff »

Re: Problems set up Build environment on OS X
« Reply #23 on: January 14, 2017, 09:47:10 pm »
I just did it with an authentic Sparky2 and it worked fine and completed.

karla

  • *****
  • 629
Re: Problems set up Build environment on OS X
« Reply #24 on: January 15, 2017, 02:55:32 am »
Great this morning to find so much activity going on here!

I have been using ComBridge all along here.
Cliff, after you mentioned the GCS has to be kept running (I tried have GCS connected with usb to the board), then I got much further:

Karls-MacBook-Air-2:librepilot karl$ ./build/uploader_release/OPUploadTool -i -p ./build/firmware/fw_gpsplatinum/fw_gpsplatinum.opfw -t tty.usbmodem1421
OpenPilot serial firmware uploader tool.
Connect the board NOW
SYNC Succeded
Uploading...
Erasing, please wait...
Uploading firmware
Uploading firmware[===================>                              ]  39%     ____timeout
____timeout
Starting uploading description
Uploading firmware[=========================>                        ]  50%     ____timeout
Upload failed with code:1
Karls-MacBook-Air-2:librepilot karl$


But since you also seem to experience a lot of timeouts when using the ComBridge connection, I will abandon this.
The best I got was 63% uploaded but most of the cases its between 3-15%.

So I am downloading f5soh Linux bootable file with LP16.09 to make a USB and run on my PC from a USB memory with a  FTDI connector to my OP GPSv9. I have two different FTDIs and they have worked well for configuring my Bluetooth devices via the PC.

Thanks a lot all!

Re: Problems set up Build environment on OS X
« Reply #25 on: January 15, 2017, 05:54:02 am »
I had timeouts in Linux as well, so it isn't a MacOS issue.

I had good luck with a Sparky2 acting as ComBridge, but not with a Nano as ComBridge.  I suggest that you try different kinds of controllers or even several of the same kind as a last effort.

karla

  • *****
  • 629
Re: Problems set up Build environment on OS X
« Reply #26 on: January 15, 2017, 06:31:38 am »
Okay.
I have already tried 2 Nano, 2 Revo and 3 OPGPSv9 boards in all combinations I can think of.
Can the FTDI USB to serial converters not be used with Mac?

Re: Problems set up Build environment on OS X
« Reply #27 on: January 15, 2017, 06:38:31 am »
I am guessing that either the high CPU power of the Sparky2 gets by a CPU priority issue, or the good quality components of the authentic Sparky2 helped.

I don't own a Mac, but I would bet large money that a standard FTDI would work on a Mac.

Are your Revo boards authentic?  I could try authentic Revo here for a test.


karla

  • *****
  • 629
Re: Problems set up Build environment on OS X
« Reply #28 on: January 15, 2017, 06:50:04 am »
I dont know what an authentic Revo is :) all are from China. But no known problems with them. The two Nano are authentic.
If I plug in this FTDI to the USB port of the Mac I dont know how to figure out what Port name it has.
I suppose you give some command using Terminal... I tried the one you used for Linux but I cant find any new port after entering the USB.

karla

  • *****
  • 629
Re: Problems set up Build environment on OS X
« Reply #29 on: January 15, 2017, 09:53:15 am »
Meanwhile I am trying to download f5soh ISO file but I am in China and it did not work all day, Google drive and anyting Google is blocked and VPN is soso. However I will be in Hong Kong tomorrow and likely get it fast.