Skip to main content
Topic: [solved] Firmware Update using Linux (Read 4236 times) previous topic - next topic

[solved] Firmware Update using Linux

I've just started to tinker with my freshly arrived board. I looking into upgrading to the latest FPGA firmware and would like to upgrade to some never versions.

But it looks like the supplied package is Windows-only.

Where can I find information about upgrading the firmware on Linux ?
Markus

Re: Firmware Update using Linux

Reply #1
you need to checkout the svn from gadgetfactory, in trunk/bootloader/fw_update is the SW to upload new firmware.

You need to compile it using standard procedure "configure, make, make install". I have created patch that fixes some issues with libusb support. This patch is attached to this post:
http://dangerousprototypes.com/forum/in ... 76#msg2976

The pump-loader, is available in trunk, and should compile without any problem, just run make in the "trunk/pump-loader". The pump-loader is used to upload the content of the FPGA into spi dataflash.

This also assumes that you have gcc, gnu make , etc installed :)

Re: Firmware Update using Linux

Reply #2
Hi Markus - Only new FPGA bitstreams have been released at this point, there are no PIC firmware upgrades. The pump-loader application (and Perl script alternative) should be around, but I'm not sure they're in the project archive, maybe in the SVN.
Got a question? Please ask in the forum for the fastest answers.

Re: Firmware Update using Linux

Reply #3
There is a pump-loader.pl supplied in the zip file. After some massaging (#!/usr/bin/perl at the beginning) and installing Devices::Serial port it seems to work. But it is not very clear to me and there is no documentation or readme.

For example I started with verifying the installed code:
Code: [Select]
$ bin/pump-loader.pl -p /dev/ttyACM0 -v
PUMP-Loader v0.1
Using: /dev/ttyACM0
Read/write: 2048 pages
Reading firmware version:
Hardware: 0, Firmware: 0.0, Bootloader: 0
Reading JEDEC ID: 0x
Incorrect flash, or flash not found!
Is there a problem or do I misunderstand the -v flag ?

Also the pump.loader can, with -w write a BIN  file [to the FPGA, I suppose], but what is supplied is a .bit file or a mcs file. As I don't know what the recovery options are when I write the wrong file I have not tried. I suppose '-w ' would write the file to the fpga / update it to the version in , but this is not completely clear to me.
Markus

Re: Firmware Update using Linux

Reply #4
The Perl script pump-loader.pl was an early tool/utility for testing the PIC firmware, in particular the upload of VHDL description files (bitstreams) via USB/PIC to the SPI flash. Before downloading the VHDL description the HEX file must be converted to BIN format using the utility hex2bin.pl that should be included in the zip file as well. For details and instructions on pump-loader.pl see Firmware development ff.

pump-loader.pl sends the bitstream in binary format to the PIC and the PIC writes it to the SPI flash (not to the FPGA). The FPGA loads the configuration bitstream from the SPI flash upon boot-up/reset.

pump-loader.pl was later replaced/superseded by robots generic C code pump-loader.

Re: Firmware Update using Linux

Reply #5
Could you please try the attached pump-loader ?

I have compiled it with "static" so most things should already be included. (I just hope you have fairly new glibc  :) ) Don't forget to reset the OLS with update button pressed.

Re: Firmware Update using Linux

Reply #6
I've tried your binary:
Code: [Select]
$ ./pump-loader -p:/dev/ttyACM0 -t:115200 -status
PUMP loader
Opening serial port '/dev/ttyACM0' @ 115200 ... OK
Error reading PUMP id
The SUMP client works fine:
Code: [Select]
$ ./runme 
Experimental:  JNI_OnLoad called.
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7
/dev/ttyACM0
Device Controller found: org.sump.analyzer.devices.FpgaDeviceController
/dev/ttyACM0
Device Controller found: org.sump.analyzer.devices.Hp16500DeviceController
Device Controller = FPGA Controller
Tool found: org.sump.analyzer.tools.I2CProtocolAnalysis
Tool found: org.sump.analyzer.tools.SPIProtocolAnalysis
Tool found: org.sump.analyzer.tools.StateAnalysis
Tool found: org.sump.analyzer.tools.UARTProtocolAnalysis
Attaching to: /dev/ttyACM0 (115200bps)
Run started
Device ID: 0x534c4131
11000000 00000000 00000000 00000000 00000000
11000001 00000000 00000000 00000000 00000000
11000010 00000000 00000000 00000000 00001000
10000000 00000000 00000000 00000000 00000000
10000001 11111111 00000001 11111111 00000001
Flags: 10
10000010 00000010 00000000 00000000 00000000
Run completed
Markus
Markus

Re: Firmware Update using Linux

Reply #7
Are you sure you reset the OSL with update button pressed ? 

If so you have a bad connection to the button.  Java client should not be able to talk to the OLS in the update mode.
If not please try again :)

Re: Firmware Update using Linux

Reply #8
I was not aware that had to place the OSL in update mode and how to accomplish that !

Code: [Select]
$ ./pump-loader -p:/dev/ttyACM0 -t:115200 -status
PUMP loader
Opening serial port '/dev/ttyACM0' @ 115200 ... OK
Found PUMP HW: 1, FW: 0.1, Boot: 1
Found flash: ATMEL AT45DB041D
PUMP status: 9c

As usual, the problem was sitting in front of the screen and keyboard.

Thanks !
Markus

Re: Firmware Update using Linux

Reply #9
Glad you got it going. I'll prep short, independent firmware, bitstream, and other update guides ASAP to help with this stuff.

On another great note, I notice you have the bootloader installed. Some don't, but your output shows it in place. This is a huge relief for us, I was worried it was a problem effecting the whole batch.
Got a question? Please ask in the forum for the fastest answers.

Re: Firmware Update using Linux

Reply #10
Yes, documentation is lacking for now. It doesn't help that the info is spread out over several websites too, so it is difficult for us newbies to get going. However, I'm happy with what I've got, it's a nice little piece of equipment.

Good to know about the boot loader. Could have been a big pain !

Markus
Markus

Re: Firmware Update using Linux

Reply #11
Probably the best place to look for now is the OLS hardware overview. About 3/4 into the article there's a heading 'ROM update procedure' with an illustrated upgrade guide. It also shows how to update the firmware. Here's the link for anyone else who's having issues and stumbles across this thread:
http://dangerousprototypes.com/2010/02/ ... nalyzer-2/
Got a question? Please ask in the forum for the fastest answers.