Author Topic: Rigol DSXXXX .GEL firmware file format  (Read 63132 times)

0 Members and 1 Guest are viewing this topic.

Offline Userli

  • Regular Contributor
  • *
  • Posts: 72
  • Country: de
Re: Rigol DSXXXX .GEL firmware file format
« Reply #25 on: July 16, 2016, 05:37:27 pm »
I tidied up the logo handling. It will now save as bmp and requires bmp as input. The new version is attached.

The LZMA header is indeed as you say except for the file SparrowCalFile.hex, where compressed and uncompressed sizes are much different from the real ones.

 
The following users thanked this post: janekivi, Marcos

Offline boffin

  • Supporter
  • ****
  • Posts: 1027
  • Country: ca
Re: Rigol DSXXXX .GEL firmware file format
« Reply #26 on: July 16, 2016, 05:51:37 pm »
4 is AA 55 55 AA (something spezial ?)

55AA is often used to verify that memory is working it's (every other bit)
01010101
10101010

IIRC correctly IBM PC add on roms required 55AA as the 1st two bytes to signal it was a real thing (and not just random data). But that was a loooong time ago
 

Offline Fenichel

  • Contributor
  • Posts: 45
Re: Rigol DSXXXX .GEL firmware file format
« Reply #27 on: July 16, 2016, 07:01:54 pm »
Quote
55AA is often used to verify that memory is working it's (every other bit)
01010101
10101010

IIRC correctly IBM PC add on roms required 55AA as the 1st two bytes to signal it was a real thing (and not just random data). But that was a loooong time ago

0x55AA also used to be widely used in older graphic file formats, where the byte order used by the writing and reading machines might be unpredictably different.  I've forgotten what one was supposed to write (21930 or 43605), but whatever it was, if you read the other one back then you knew you had to byte-swap while reading the rest of the file.  In recent, tagged (TIFF-based) formats, the byte order is still the file-writer's choice, but it is the file-writer's obligation to put an indicator (0x4D4D for big-endian, 0x4949 for little-endian) as the first 16 bits of the file header.  The codes are ASCII for "II" (hinting at Intel,  little-enders) and "MM" (hinting at Motorola, big-enders).
 

Offline janekiviTopic starter

  • Frequent Contributor
  • **
  • Posts: 368
  • Country: ee
Re: Rigol DSXXXX .GEL firmware file format
« Reply #28 on: July 16, 2016, 07:47:14 pm »
Logo customize option is working now.  :clap:
So, we can close this thread.

Of course not. This is only beginning and may be there can be done something more useful.
But be careful with next steps and think about motto there:
"We don't like to break it - we like to make it better!"
and test your idea before and have repair or undo procedures
ready so you don't have many angry "brick" owners here.

Always is good idea to remove non working files from here too. Or what you think?
 
The following users thanked this post: Marcos

Offline smithnerd

  • Regular Contributor
  • *
  • Posts: 120
  • Country: gb
Re: Rigol DSXXXX .GEL firmware file format
« Reply #29 on: July 16, 2016, 10:45:51 pm »
SparrowCalFile.hex consists of 420 individual LZMA streams concatenated together. Each one is 604 bytes long (uncompressed). I've only decompressed a few at random, but they don't look terribly interesting.
« Last Edit: July 16, 2016, 11:39:29 pm by smithnerd »
 

Offline Userli

  • Regular Contributor
  • *
  • Posts: 72
  • Country: de
Re: Rigol DSXXXX .GEL firmware file format
« Reply #30 on: July 17, 2016, 08:44:57 am »
@smithnerd is there any documentation on this archive format? What tool did you use to decompress it?

Edit:
Sometimes it's just too obvious. Got it.
« Last Edit: July 17, 2016, 11:57:53 am by Userli »
 

Offline janekiviTopic starter

  • Frequent Contributor
  • **
  • Posts: 368
  • Country: ee
Re: Rigol DSXXXX .GEL firmware file format
« Reply #31 on: July 17, 2016, 09:09:33 am »
I was able to replace the start screen image (logo.hex) by the one attached.
......
I'm not a good artist but something like this is needed there  :-BROKE
or old BW type : )

(I was growing up with this kind of round corners TV http://mentallandscape.com/L_0249.jpg)
 
The following users thanked this post: Marcos

Offline smithnerd

  • Regular Contributor
  • *
  • Posts: 120
  • Country: gb
Re: Rigol DSXXXX .GEL firmware file format
« Reply #32 on: July 17, 2016, 01:02:40 pm »
guiPicData.hex is a very simple format, which is easy to traverse.

A 4 byte header represents x and y dimensions for each image, followed by the RGB565 data.

uint16 x;
uint16 y;
char data[x*y*2];

So it's easy to calculate the offset of the next image. I make it 494 bitmaps in total. Once I figure out how to put headers on the data, I will post a thumbnail image.

Edit:

This seems clunky, but it works OK:

Code: [Select]
$ avconv -vcodec rawvideo -f rawvideo -pix_fmt rgb565 -s 9x9 -i image.data -f image2 -vcodec png output.png
avconv is from libav.
« Last Edit: July 17, 2016, 01:50:18 pm by smithnerd »
 

Offline janekiviTopic starter

  • Frequent Contributor
  • **
  • Posts: 368
  • Country: ee
Re: Rigol DSXXXX .GEL firmware file format
« Reply #33 on: July 17, 2016, 03:09:41 pm »
I was trying this with logo before in windows
http://www.madox.net/blog/2011/06/06/converting-tofrom-rgb565-in-ubuntu-using-ffmpeg/
But I think Your output is something else... My 11x11 crap can't be the same
9x9 can't be the right number and what is the dimensions then for 40 00 11 00
Somehow I can make left arrow from first data if I use 32x32
 

Offline smithnerd

  • Regular Contributor
  • *
  • Posts: 120
  • Country: gb
Re: Rigol DSXXXX .GEL firmware file format
« Reply #34 on: July 17, 2016, 03:48:28 pm »
Quote
what is the dimensions then for 40 00 11 00

64 x 17

My 9x9 was for a file picked at random.

It seems avconv chokes on files smaller than 8 pixels wide. RGB565 is a pain in the arse...
 

Offline janekiviTopic starter

  • Frequent Contributor
  • **
  • Posts: 368
  • Country: ee
Re: Rigol DSXXXX .GEL firmware file format
« Reply #35 on: July 17, 2016, 04:18:57 pm »
This is better arrow : )

But let's ask from Userli, who made logo changer, what You can do with this file?
Rigol packer did make png from hex too or bmp or....
« Last Edit: July 17, 2016, 04:33:41 pm by janekivi »
 

Online pascal_sweden

  • Super Contributor
  • ***
  • Posts: 1539
  • Country: no
Re: Rigol DSXXXX .GEL firmware file format
« Reply #36 on: July 17, 2016, 04:32:23 pm »
Here is my preferred boot screen! :)
« Last Edit: July 17, 2016, 04:35:19 pm by pascal_sweden »
 
The following users thanked this post: bitwelder

Offline smithnerd

  • Regular Contributor
  • *
  • Posts: 120
  • Country: gb
Re: Rigol DSXXXX .GEL firmware file format
« Reply #37 on: July 17, 2016, 05:14:29 pm »
I'm hacking something up in C which puts a BMP header on the data - seems the easiest solution.
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
Re: Rigol DSXXXX .GEL firmware file format
« Reply #38 on: July 17, 2016, 05:26:09 pm »
 

Offline RhymeMess

  • Newbie
  • Posts: 7
  • Country: de
Re: Rigol DSXXXX .GEL firmware file format
« Reply #39 on: July 17, 2016, 08:50:11 pm »
There is CRC errors with V7. If I skip crc check, the file is extracted correctly and crc is the same as in the header.

Yeah sorry, there is some weired thing, where crc32 in python interprets the crc as a signed integer. I added the workaround to the second crc check as well... If anyone is still interested
 

Offline smithnerd

  • Regular Contributor
  • *
  • Posts: 120
  • Country: gb
Re: Rigol DSXXXX .GEL firmware file format
« Reply #40 on: July 17, 2016, 08:53:30 pm »
Quick and dirty RGB565 to BMP converter.
 

Offline smithnerd

  • Regular Contributor
  • *
  • Posts: 120
  • Country: gb
Re: Rigol DSXXXX .GEL firmware file format
« Reply #41 on: July 18, 2016, 04:55:34 am »
Converting back to RGB565 is easy with this android SDK tool:

https://android.googlesource.com/platform/build/+/android-4.4.3_r1/tools/rgb2565/

together with ImageMagick:

Code: [Select]
$ convert logo.bmp rgb:- | rgb2565 > logo.raw

 

Offline BloodyCactus

  • Frequent Contributor
  • **
  • Posts: 482
  • Country: us
    • Kråketær
Re: Rigol DSXXXX .GEL firmware file format
« Reply #42 on: July 18, 2016, 02:35:13 pm »
some interesting stuff here. nice work guys
-- Aussie living in the USA --
 

Offline garnix

  • Contributor
  • Posts: 32
  • Country: ch
Re: Rigol DSXXXX .GEL firmware file format
« Reply #43 on: July 18, 2016, 02:42:32 pm »
Being a complete "noob" on this hacking - what do you think is possible beside modifying the startup-screen?

Some things I would find useful:
  • Pluses -> Pulses  ;) text change
  • Help-menu: English text is sometimes almost non-understandable, could that be modified?
  • Exchange some GUI elements - e.g. the WAIT button has very uneven spacing...? Or menu-icons?
  • Remove all the "glass/gloss"-effects from the UI and make it more modern by replacing the underlying images?
« Last Edit: July 18, 2016, 02:45:06 pm by garnix »
 

Offline Userli

  • Regular Contributor
  • *
  • Posts: 72
  • Country: de
Re: Rigol DSXXXX .GEL firmware file format
« Reply #44 on: July 18, 2016, 03:29:32 pm »
I implemented the findings of smithnerd and re arranged the interface slightly.
Now the usage is more consistent: After loading the .GEL file you double click on the name of the file you're interested in.
This opens the hex code and clicking on "open content" will then decompress, show images, etc. , depending on the nature of the file.
It's iterative such that on each new panel you can again click open content to dig deeper if possible.

The new way of changing the start screen would be:
1) open firmware file
2) double click on /sys/logo.hex
3) click "show content" in new window
4) in logo window save image (as BMP)
5) modify BMP without changing it's size
6) click change image and select the changed BMP
7) save firmware file
I should maybe mention here that you use this application at your own risk.

I found that SparrowConfig.hex is the start screen image with "MSO ready"  written in addition. The tool will show it the same way as the logo file.

The aim is definitely to be able at some point to change more serious data.
The problem currently is that I didn't find a compression tool yet, which will create the same compressed form of a file as is in the .GEL.
This is necessary since the ELF file (SparrowApp.out) containing the processor code with all the typos is LZMA compressed in the .GEL .
The same holds for GuiPicData.hex, which contains all the little images the user interface is made of.
« Last Edit: July 21, 2016, 08:57:27 pm by Userli »
 
The following users thanked this post: Marcos

Offline janekiviTopic starter

  • Frequent Contributor
  • **
  • Posts: 368
  • Country: ee
Re: Rigol DSXXXX .GEL firmware file format
« Reply #45 on: July 18, 2016, 04:19:47 pm »
Being a complete "noob" on this hacking - what do you think is possible beside modifying the startup-screen?

Some things I would find useful:
Then You must learn!

First rule is... take all apart and look inside to see how the system is working [big hammer emoticon here]
and then we see what we can do if all are coming apart. We are working with hammer right now.
Like I said, who knows where we ending with this... at the end or dead end.
 

Offline smithnerd

  • Regular Contributor
  • *
  • Posts: 120
  • Country: gb
Re: Rigol DSXXXX .GEL firmware file format
« Reply #46 on: July 18, 2016, 07:22:58 pm »
The problem currently is that I didn't find a compression tool yet, which will create the same compressed form of a file as is in the .GEL.
This is necessary since the ELF file (SparrowApp.out) containing the processor code with all the typos is LZMA compressed in the .GEL .
The same holds for GuiPicData.hex, which contains all the little images the user interface is made of.

I share this concern and It's something I've been looking into.

I suspect the LZMA implementation is part of the MQX SDK used to create the firmware (Classic or v5, I couldn't say). I haven't got round to seeing what documentation or code is available on the NXP MQX pages yet.

That said, it may not be a problem. The fact that 7z's LZMA decoder can cope with their code bodes well for the opposite being true, so long as their header weirdness is respected.
 
The following users thanked this post: Marcos

Offline Circlotron

  • Super Contributor
  • ***
  • Posts: 3167
  • Country: au
Re: Rigol DSXXXX .GEL firmware file format
« Reply #47 on: July 18, 2016, 09:44:28 pm »
Just posting so I can be notified of replies to this thread.
Go guys and gals!!!  :popcorn:
 

Offline BravoV

  • Super Contributor
  • ***
  • Posts: 7547
  • Country: 00
  • +++ ATH1
Re: Rigol DSXXXX .GEL firmware file format
« Reply #48 on: July 19, 2016, 10:28:36 am »
Just fyi, quoting Borjam's post from other thread.

New firmware version!

http://int.rigol.com/Support/SoftDownload/3


Code: [Select]
[Supported Model]    All the MSO/DS1000Z Series Digital Oscilloscopes
[Latest Revision Date]  2016/05/31

[Updated Contents]
--------------------
v00.04.04.00.07  2016/07/19
     - Added the full-screen display in the XY mode
     - Modified the Trace data of average sample mode
     - Fixed the bug of system halted for wave persistance in the Zoom mode
     - Fixed bugs about Measure


Now. Who dares? ;)

 :popcorn:

Offline Shock

  • Super Contributor
  • ***
  • Posts: 4200
  • Country: au
Re: Rigol DSXXXX .GEL firmware file format
« Reply #49 on: July 19, 2016, 02:30:57 pm »
Nice finally Rigol released the whole firmware update history in the latest 00.04.04.00.07 firmware archive. If you have any of the firmware shown in red please PM or attach in a post.

v00.04.04.00.07   2016/07/19
v00.04.03.02.03   2015/10/20
v00.04.03.01.05   2015/06/16
v00.04.03.00.01   2015/05/05
v00.04.02.04.07   2014/12/31
v00.04.02.03.00   2014/10/21
v00.04.01.02.00   2014/07/28
v00.04.00.00.00   2014/03/18
v00.02.03.05.00   2014/01/27
v00.02.01.01.00   2013/10/31
v00.02.00.01.00   2013/09/02
v00.01.00.16.09   2013/08/14
v00.01.00.13.09   2013/07/25
v00.01.00.12.08   2013/07/10
v00.01.00.03.00   2013/05/21
v00.01.00.02.00   2013/05/19
v00.01.00.00.05   2013/05/19
Soldering/Rework: Pace ADS200, Pace MBT350
Multimeters: Fluke 189, 87V, 117, 112   >>> WANTED STUFF <<<
Oszilloskopen: Lecroy 9314, Phillips PM3065, Tektronix 2215a, 314
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf