Jump to content


Command line tool to flash firmware via USB


  • Please log in to reply
7 replies to this topic

#1 Brian

Brian

    Core Developer

  • Members
  • PipPipPip
  • 567 posts
  • LocationTucson, AZ
  • Country: flag of United States United States


Posted 26 November 2011 - 04:45 PM

Is there a program that will allow me to flash a new firmware to a CC board via USB using the command line?  I have a Rube Goldberg setup that I'm testing with that includes a generic STM32 board that I flash via JTAG and several serial connections/Xbees to connect to a CC board and output debug from the STM32 board, and also connect to the GCS on my windows laptop via Xbee.  Now I need to debug some code on the CC board, and it doesn't have a JTAG connector.

All of this is connected to a headless Linux server, and the GCS crashes if I try to display it on my Windows laptop via X Windows, so I can't flash via the GCS on the Linux server.  It would be very inconvenient to connect it to my Windows laptop, so I am hoping there is a command line tool that does the same thing as the GCS.  Does such a program exist?

#2 dankers

dankers

    Janitor

  • Administrators
  • 5124 posts
  • Country: flag of Australia Australia


Posted 26 November 2011 - 05:22 PM

  • Put a JTAG header on the CC - I can send you one
  • Upload via the serial bootloader, many command line tools for this
  • PT wrote a cmd line flash utility once over USB, send him a PM to see if he still has it


#3 PT_Dreamer

PT_Dreamer

    GCS Core Developer

  • Administrators
  • 1211 posts
  • LocationCaparica, Portugal
  • Country: flag of Portugal Portugal


Posted 26 November 2011 - 05:27 PM

It's still on Git under experimental I think, vid and pids will probably need updating.
Life is just a game, but atleast the graphics are awesome!

#4 naiiawah

naiiawah

    Core Developer

  • Members
  • PipPipPip
  • 309 posts
  • LocationNorthwest USA
  • Country: flag of United States United States


Posted 26 November 2011 - 06:35 PM

While the tools that Dankers & PT mention may be what you are looking for, the following should solve your remote X issues with GCS.  Add the following to your .bashrc:

function setupQtRemote {
	export LIBGL_ALWAYS_INDIRECT=y
}

When you log in, just type "setupQtRemote" before you run GCS.  Note, I set it up as a function instead of just always defining it permanently since I sometimes do actually log in directly on the machine instead of remote X once in a while.

#5 dankers

dankers

    Janitor

  • Administrators
  • 5124 posts
  • Country: flag of Australia Australia


Posted 26 November 2011 - 07:09 PM

Neat trick, nice.

#6 Brian

Brian

    Core Developer

  • Members
  • PipPipPip
  • 567 posts
  • LocationTucson, AZ
  • Country: flag of United States United States


Posted 26 November 2011 - 07:42 PM

View Postnaiiawah, on 26 November 2011 - 06:35 PM, said:

While the tools that Dankers & PT mention may be what you are looking for, the following should solve your remote X issues with GCS.  Add the following to your .bashrc:

function setupQtRemote {
	export LIBGL_ALWAYS_INDIRECT=y
}

When you log in, just type "setupQtRemote" before you run GCS.  Note, I set it up as a function instead of just always defining it permanently since I sometimes do actually log in directly on the machine instead of remote X once in a while.

Thanks for the suggestion, but I still get a seg fault after several of these are printed:

[12:39:22.499] [Warning] QGraphicsScene::addItem: item has already been added to this scene

Was what you specified supposed to fix this, or some other issue?

#7 naiiawah

naiiawah

    Core Developer

  • Members
  • PipPipPip
  • 309 posts
  • LocationNorthwest USA
  • Country: flag of United States United States


Posted 26 November 2011 - 08:37 PM

View PostBrian, on 26 November 2011 - 07:42 PM, said:

Thanks for the suggestion, but I still get a seg fault after several of these are printed:

[12:39:22.499] [Warning] QGraphicsScene::addItem: item has already been added to this scene

Was what you specified supposed to fix this, or some other issue?

Here is what I get when the GCS borks if I don't do a setupQtRemote first.

[13:27:03.161] [DEBUG] Loading config:  "Uploader" , "default"						qdebug
[13:27:03.955] [Warning] QGraphicsScene::addItem: item has already been added to this scene						 qwarning
[13:27:03.955] [Warning] QGraphicsScene::addItem: item has already been added to this scene						 qwarning
[13:27:03.958] [Warning] QGraphicsScene::addItem: item has already been added to this scene						 qwarning
[13:27:04.041] [Warning] QGraphicsScene::addItem: item has already been added to this scene						 qwarning
[13:27:04.042] [Warning] QGraphicsScene::addItem: item has already been added to this scene						 qwarning
[13:27:04.044] [Warning] QGraphicsScene::addItem: item has already been added to this scene						 qwarning
[13:27:04.270] [Warning] QGLTempContext: No GL capable X visuals available.						 qwarning
Segmentation fault

Sounds similar, but not exactly the same as yours?!?  With running the setupQtRemote, I still get the item already added qwarning messages, so I think those are innocuous, but it continues on past them and doesn't give the No GL capable message.

Tell me about your X environment on the Windows boxen.  What SW is providing X?  How are you logging into the Linux machine remotely?  Putty?  Command line ssh?  If cmd line ssh, are you using the remote X switch (-X) to get X forwarding?  Same question for Putty.

Which version of the GCS SW are you running?

#8 Brian

Brian

    Core Developer

  • Members
  • PipPipPip
  • 567 posts
  • LocationTucson, AZ
  • Country: flag of United States United States


Posted 26 November 2011 - 08:55 PM

I'm running the cygwin/X server on Windows 7 64 bit, and looging in via putty.  I know X is working because I can bring up an xterm, but I get a segfault before I get the GL error that you're seeing.

The following is the start of my xdpyinfo if that helps:

name of display:	localhost:11.0
version number:	11.0
vendor string:	The Cygwin/X Project
vendor release number:	11003000
maximum request size:  16777212 bytes
motion buffer size:  256
bitmap unit, bit order, padding:	32, LSBFirst, 32
image byte order:	LSBFirst
number of supported pixmap formats:	7
supported pixmap formats:
	depth 1, bits_per_pixel 1, scanline_pad 32
	depth 4, bits_per_pixel 8, scanline_pad 32
	depth 8, bits_per_pixel 8, scanline_pad 32
	depth 15, bits_per_pixel 16, scanline_pad 32
	depth 16, bits_per_pixel 16, scanline_pad 32
	depth 24, bits_per_pixel 32, scanline_pad 32
	depth 32, bits_per_pixel 32, scanline_pad 32
keycode range:	minimum 8, maximum 255
focus:  PointerRoot
number of extensions:	22
	BIG-REQUESTS
	Composite
	DAMAGE
	DOUBLE-BUFFER
	DPMS
	GLX
	Generic Event Extension
	MIT-SCREEN-SAVER
	RANDR
	RECORD
	RENDER
	SGI-GLX
	SHAPE
	SYNC
	X-Resource
	XC-MISC
	XFIXES
	XFree86-Bigfont
	XINERAMA
	XInputExtension
	XKEYBOARD
	XTEST
default screen number:	0
number of screens:	1

screen #0:
  dimensions:	1920x1080 pixels (508x286 millimeters)
  resolution:	96x96 dots per inch
  depths (7):	24, 1, 4, 8, 15, 16, 32
  root window id:	0x101

I suppose I could try debugging this, but I don't use it enough to be too concerned. :P

I forgot to mention, I'm running the next branch...