Brand new OLS (boot)loader tool - Windows and Linux

A cheap logic analyzer. Get one for $50, including worldwide shipping. A collaboration between the Gadget Factory and Dangerous Prototypes.

Re: Brand new OLS (boot)loader tool - Windows and Linux

Postby tayken » Wed Feb 02, 2011 4:53 am

User avatar
tayken
Developer
Developer
 
Posts: 1504
Joined: Sat Dec 12, 2009 10:58 am
Location: Tokyo, Japan

Re: Brand new OLS (boot)loader tool - Windows and Linux

Postby markus_b » Wed Feb 02, 2011 5:04 am

ian wrote:Sorry, I thought it did this already. I just meant to add it to the documentation.

I'll see about adding an easier jump from firmware to ROM update mode, that is a great idea.


Ian, is there a way to obtain the software levels in 'update mode' and from the boot loader ?

I think it would be good to define a fixed location in the binary images (firmware and bitstream) to hold a version number or build ID (a 16bit int is probably sufficient). This would allow querying and displaying these in 'update mode' quite easily. At least the bitstream version should be available to the (java) client as well.
User avatar
markus_b
Full Member
Full Member
 
Posts: 116
Joined: Mon May 17, 2010 5:24 am
Location: Switzerland

Re: Brand new OLS (boot)loader tool - Windows and Linux

Postby robots » Wed Feb 02, 2011 5:08 am

markus_b wrote:I still have questions :-).

The 'ols-fwloader' always uses serial port emulation to connect to either the APP loader (update FPGA firmware) or the BOOT loader (update PIC firmware). What is the use of the '-p pid' and '-v vid' flags ?

Could we change the error message, when you can not connect from 'Device not found' to 'Could not connect to device <vid>,<pid>: Is the OLS in update mode ?'.


Vid/pid is set internally to the vid/pid of bootloader, those two parameters are for overriding the default.

And it is not always using serial port emulation. in bootloader mode it is using serial port emulation just to enter bootloader mode, afterwards raw usb communication continues. (that's why it needs libusb)

I will try to add more sense to the error messages.
User avatar
robots
Hero Member
Hero Member
 
Posts: 569
Joined: Sat Dec 05, 2009 11:19 am
Location: CZ/Prague

Re: Brand new OLS (boot)loader tool - Windows and Linux

Postby ian » Wed Feb 02, 2011 6:16 am

Ian, is there a way to obtain the software levels in 'update mode' and from the boot loader ?


Do you mean versions? Or the current mode? In ROM update mode ols-loader can read and report the bootloader, PIC firmware, and hardware version. Note that the bootloader version is OUR bootloader version, not the manufacturer's protocol version that is reported in the bootloader mode. This is also documented on the wiki: http://dangerousprototypes.com/docs/Log ... e_protocol

The bootloader is an HID device, so there is no confusing it for the update mode. You can get the bootloader protocolversion in the bootloader mode, and that is it.

I think it would be good to define a fixed location in the binary images (firmware and bitstream) to hold a version number or build ID (a 16bit int is probably sufficient). This would allow querying and displaying these in 'update mode' quite easily.


The firmware does hold a version which can be queried and reported (see above). We could fix it to a program memory address, but the only advantage of that would be the ols-loader utility could read the version before programming. Why not just look at the file name?

I don't think there is the concept of a fixed variable location in the FPGA synthesis process. Querying the bitstream version from the PIC is a huge can of worms. I don;t see the advantage of the update mode reporting the existing bitstream version when it is about to be overwritten in 99.99% of cases.

At least the bitstream version should be available to the (java) client as well.


Ther eis currently no way to query the version from the SUMP Logic analyzer core in the FPGA. None. This is a long wanted feature, but no VHDL developer has ever contributed it. Very recently dogsbody dropped a Verilog replacement that implements this feature. It should be available in the next update.

The PIC could query this in ROM update mode to report the current bitstream version. If you make the modifications I'll happily include them in the next PIC release, but I'd need some motivation to do it myself and I don;t see the need right now.
User avatar
ian
Crew
Crew
 
Posts: 10803
Joined: Mon Jul 06, 2009 6:14 am

Re: Brand new OLS (boot)loader tool - Windows and Linux

Postby robots » Wed Feb 02, 2011 7:14 am

Attached is brand new ols-fwloader. You will have to go through process:

./configure
make
make install (optional)

It supports linux, darwin, mingw, also supports crosscompiling (--host=mingw32). Let me know when you find some configuration error. This is my first try to use autotools.
Attachments
ols-fwloader-0.1.tar.gz
(292.41 KiB) Downloaded 720 times
User avatar
robots
Hero Member
Hero Member
 
Posts: 569
Joined: Sat Dec 05, 2009 11:19 am
Location: CZ/Prague

Re: Brand new OLS (boot)loader tool - Windows and Linux

Postby markus_b » Wed Feb 02, 2011 8:29 am

ian wrote:
Ian, is there a way to obtain the software levels in 'update mode' and from the boot loader ?


Do you mean versions? Or the current mode? In ROM update mode ols-loader can read and report the bootloader, PIC firmware, and hardware version. Note that the bootloader version is OUR bootloader version, not the manufacturer's protocol version that is reported in the bootloader mode. This is also documented on the wiki: http://dangerousprototypes.com/docs/Log ... e_protocol

The bootloader is an HID device, so there is no confusing it for the update mode. You can get the bootloader protocolversion in the bootloader mode, and that is it.

So it looks to me like the infrastructure is there, we just need for ols-fwloader to be able to simply query the versions and exit. I've seen that is displays version info when interacting update mode. I've hacked a change to ols-fwloader, a new flag '-i' provides version info:
Code: Select all
$ ./ols-fwloader -i -P /dev/ttyACM0
Found OLS:  Hardware: 1, Firmware: 2.1, Bootloader: 1
Found flash: ATMEL AT45DB041D

The code can be found on https://github.com/markusb/ols-fwloader.git

ian wrote:
I think it would be good to define a fixed location in the binary images (firmware and bitstream) to hold a version number or build ID (a 16bit int is probably sufficient). This would allow querying and displaying these in 'update mode' quite easily.


The firmware does hold a version which can be queried and reported (see above). We could fix it to a program memory address, but the only advantage of that would be the ols-loader utility could read the version before programming. Why not just look at the file name?

Fair enough, file names work fine too.

ian wrote:
At least the bitstream version should be available to the (java) client as well.


There is currently no way to query the version from the SUMP Logic analyzer core in the FPGA. None. This is a long wanted feature, but no VHDL developer has ever contributed it. Very recently dogsbody dropped a Verilog replacement that implements this feature. It should be available in the next update.

The PIC could query this in ROM update mode to report the current bitstream version. If you make the modifications I'll happily include them in the next PIC release, but I'd need some motivation to do it myself and I don;t see the need right now.

I understand. I don't have a PIC toolchain right now, so chances for myself doing something are not good. But it looks like the feature is coming and might be available via Java client.

One last thing, the OLS has three distinct operation modes (nromal, update and bootloader), but two of them look the same (same LED state). Could we change the 'update' mode to be distinct, for example with a flashing 'act' LED ? This should help to reduce confusion about which states it is in.
User avatar
markus_b
Full Member
Full Member
 
Posts: 116
Joined: Mon May 17, 2010 5:24 am
Location: Switzerland

Re: Brand new OLS (boot)loader tool - Windows and Linux

Postby ian » Wed Feb 02, 2011 9:47 am

Could we change the 'update' mode to be distinct, for example with a flashing 'act' LED ? This should help to reduce confusion about which states it is in.


Blinking indicates error modes and being stuck in the FPGA load mode. I think it would be confusing to cross error with an actual mode. Ideally the hardware would have more LEDs and buttons to deal with all these things, but that's not how we built it :)
User avatar
ian
Crew
Crew
 
Posts: 10803
Joined: Mon Jul 06, 2009 6:14 am

Re: Brand new OLS (boot)loader tool - Windows and Linux

Postby jone » Wed Feb 02, 2011 10:00 am

robots wrote:Attached is brand new ols-fwloader. You will have to go through process:

./configure
make
make install (optional)


Thanks robots,

Can confirm it all builds fine here (32bit Fedora 14). Cosmetically, you seem to be missing a line feed on the printf("This is " PACKAGE_STRING); at the top of main()...

Regards,
Jon
jone
Jr. Member
Jr. Member
 
Posts: 64
Joined: Mon Jul 19, 2010 6:55 am

Re: Brand new OLS (boot)loader tool - Windows and Linux

Postby markus_b » Wed Feb 02, 2011 10:55 am

I've checked out the source from git (github). The ./configure script is missing there. It is present in the compressed tar.
User avatar
markus_b
Full Member
Full Member
 
Posts: 116
Joined: Mon May 17, 2010 5:24 am
Location: Switzerland

Re: Brand new OLS (boot)loader tool - Windows and Linux

Postby robots » Wed Feb 02, 2011 11:27 am

I know about the linefeed :) thanks anyways.

The configure script is generated automatically by autotools . Try running autoreconf --install.
User avatar
robots
Hero Member
Hero Member
 
Posts: 569
Joined: Sat Dec 05, 2009 11:19 am
Location: CZ/Prague

Re: Brand new OLS (boot)loader tool - Windows and Linux

Postby markus_b » Wed Feb 02, 2011 11:35 am

autoreconf --install does not work.
Code: Select all
$ autoreconf --install
aclocal: couldn't open directory `m4': No such file or directory
autoreconf: aclocal failed with exit status: 1

after creating the 'm4' directory is does work, though (and creates a m4 directory).

./configure display an error about libusb checking:
Code: Select all
$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
...
checking for pkg-config... /usr/bin/pkg-config
./configure: line 10766: OLS_CHECK_LIBUSB: command not found
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
User avatar
markus_b
Full Member
Full Member
 
Posts: 116
Joined: Mon May 17, 2010 5:24 am
Location: Switzerland

Re: Brand new OLS (boot)loader tool - Windows and Linux

Postby robots » Wed Feb 02, 2011 11:39 am

working now.
User avatar
robots
Hero Member
Hero Member
 
Posts: 569
Joined: Sat Dec 05, 2009 11:19 am
Location: CZ/Prague

Re: Brand new OLS (boot)loader tool - Windows and Linux

Postby markus_b » Wed Feb 02, 2011 1:14 pm

Yes, it is working now for me too :-).

I like the more explicit messages too. But I guess you don't like my version-display patch as I do.

Thanks Markus
User avatar
markus_b
Full Member
Full Member
 
Posts: 116
Joined: Mon May 17, 2010 5:24 am
Location: Switzerland

Re: Brand new OLS (boot)loader tool - Windows and Linux

Postby tayken » Sat Feb 05, 2011 4:44 am

Works like a charm! :)

But one note: I had to use -P option to be able to load the bitstream, you might want to include that in the usage part.
User avatar
tayken
Developer
Developer
 
Posts: 1504
Joined: Sat Dec 12, 2009 10:58 am
Location: Tokyo, Japan

Re: Brand new OLS (boot)loader tool - Windows and Linux

Postby robots » Sat Feb 05, 2011 5:27 am

yes. I have noticed that it is missing. sorry. will add soon :-)

edit: actually it has already been fixed in git.
User avatar
robots
Hero Member
Hero Member
 
Posts: 569
Joined: Sat Dec 05, 2009 11:19 am
Location: CZ/Prague

PreviousNext

Return to Open Bench Logic Sniffer