Author Topic: DG4000 - a firmware investigation  (Read 163532 times)

0 Members and 1 Guest are viewing this topic.

Online PA0PBZ

  • Super Contributor
  • ***
  • Posts: 4513
  • Country: nl
Re: DG4000 - a firmware investigation
« Reply #400 on: June 10, 2020, 06:49:32 pm »
[EDIT] It's fixed, I used a different (older) USB drive, that is the problem 99.9999999999999999999% of the time with these updates in my experience.  So the original drives must have allowed the bootloader to update but then, the same drive, wouldn't do the firmware update!  It kept the Model at DG4202...

I keep one USB drive apart for the DG4000 with a label "DG4000 UPGRADE" on it. I think I tried close to 10 different sticks before I found one that worked.

So... how is you counter now? And your square wave?
Keyboard error: Press F1 to continue.
 

Offline Gandalf_Sr

  • Super Contributor
  • ***
  • Posts: 1762
  • Country: us
Re: DG4000 - a firmware investigation
« Reply #401 on: June 10, 2020, 07:22:18 pm »
[EDIT] It's fixed, I used a different (older) USB drive, that is the problem 99.9999999999999999999% of the time with these updates in my experience.  So the original drives must have allowed the bootloader to update but then, the same drive, wouldn't do the firmware update!  It kept the Model at DG4202...

I keep one USB drive apart for the DG4000 with a label "DG4000 UPGRADE" on it. I think I tried close to 10 different sticks before I found one that worked.

So... how is you counter now? And your square wave?
I've tried the counter and it seems 'better' 1) it hasn't crashed yet 2) it actually counts.  I looked at some 'square' waves which were like slightly squared sine waves by the time I got up to 25 MHz, at 50 MHz they were sine waves.  I'll come up with pictures if you want.

I'm on version 1.12 which was the highest offered to by by Rigol's website, is 13 or 14 better?

Has anyone here done an automated calibration app for the DG4000?
If at first you don't succeed, get a bigger hammer
 

Offline tv84

  • Super Contributor
  • ***
  • Posts: 1946
  • Country: pt
Re: DG4000 - a firmware investigation
« Reply #402 on: June 10, 2020, 07:42:44 pm »
 :clap:

Now update to v1.14 (attached).

Code: [Select]
[Model Supported] DG4062,DG4102,DG4162,DG4202
[Latest Revision Date] 2017-12-23


[Updated Contents]
v00.01.14.00.01 2017-12-23

- Solve the abnormal output of part of the machine CH1 at normal temperature or low temperature
- Solve the keyboard board encoder causing crashes.


[Previous Versions and Updated Contents]
v00.01.13.00.00 2015-11-05

- Added Traditional Chinese in the Menu.
- The EdgeTime is too slow when the 5MHz square wave is modified to sweep frequency,
- Output can not be changed in real time when editing any wave point.
« Last Edit: June 10, 2020, 07:53:23 pm by tv84 »
 
The following users thanked this post: Gandalf_Sr, GonzoTheGreat

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 2656
  • Country: ro
Re: DG4000 - a firmware investigation
« Reply #403 on: June 10, 2020, 09:04:58 pm »
I have a DG4062 that I 'upgraded' to a DG4202 back in Aug 2014 and made no changes since, it reports the following under system info...
...
Anyway, I tried to use the frequency counter (32,768 Hz signal) yesterday and it was useless, locked up even. That made me revisit this thread. 

Mine was a DG4102, now upgraded to DG4202.  I've used the frequency counter before and after the upgrade, and it worked.  The only thing is on speed "Normal" might miss some counts and ruin the statistics (looks like it would be imprecise).  If this happens, change the statistics speed from Normal to Full.
Counter -> Down Arrow -> Statist Set -> Speed Full

Also, not all the displayed digits are measured, some are fake/computed.  The resolution is of only 7 digits/s, if there are more, those are not measured, the extra resolution is the results of arithmetic calculations.
 
The following users thanked this post: Gandalf_Sr

Offline Gandalf_Sr

  • Super Contributor
  • ***
  • Posts: 1762
  • Country: us
Re: DG4000 - a firmware investigation
« Reply #404 on: June 12, 2020, 04:42:10 pm »
Now update to v1.14 (attached).
Thanks, now I see...

Device Model: DG4202
Serial Number: DG4Exxxxxxxxxx
Software Vn: 00.01.14
FPGA Vn: 00.01.11
Hard Vn: 01.03
KeyBrd Vn: 06.01

(Bold stuff has changed)

Used the same USB drive that worked before and all went smoothly.
If at first you don't succeed, get a bigger hammer
 
The following users thanked this post: PA0PBZ

Offline GonzoTheGreat

  • Regular Contributor
  • *
  • Posts: 116
  • Country: aq
Re: DG4000 - a firmware investigation
« Reply #405 on: August 04, 2020, 04:16:06 pm »
[EDIT] It's fixed, I used a different (older) USB drive, that is the problem 99.9999999999999999999% of the time with these updates in my experience.  So the original drives must have allowed the bootloader to update but then, the same drive, wouldn't do the firmware update!
Buying a small pendrive nowadays borders a miracle!

I wonder what the problem is with the newer pendrives?
Is it the cluster size ?  If "yes" then creating a smaller partition on the pendrive would solve the problem, wouldn't it?

Must the partition be formatted as FAT32 or can it be also FAT16 ?
...and what are the acceptable Partition IDs in the partition table anyway ( 0x0b, 0x0c, 0x06, 0x0e, etc...) ?

Finally, must the filename be uppercase or lowercase and is any length acceptable?
 

Offline tv84

  • Super Contributor
  • ***
  • Posts: 1946
  • Country: pt
Re: DG4000 - a firmware investigation
« Reply #406 on: August 04, 2020, 04:23:32 pm »
FAT, FAT16 or FAT32 should work.

Format it with a linux machine.
 

Offline GonzoTheGreat

  • Regular Contributor
  • *
  • Posts: 116
  • Country: aq
Re: DG4000 - a firmware investigation
« Reply #407 on: August 04, 2020, 04:30:38 pm »
Just tried Linux - it did not work.

Could you post the partition table and Boot Sector/FS Information Sector so I can see what parameters work ?

Maybe the pendrive must support CHS addressing and the FAT partition must start on cylinder 1, ...or on head 0 and sector 1, etc...
 

Offline tv84

  • Super Contributor
  • ***
  • Posts: 1946
  • Country: pt
Re: DG4000 - a firmware investigation
« Reply #408 on: August 04, 2020, 04:38:16 pm »
Just tried Linux - it did not work.

Could you post the partition table and Boot Sector/FS Information Sector so I can see what parameters work ?

Maybe the pendrive must support CHS addressing and the FAT partition must start on cylinder 1, ...or on head 0 and sector 1, etc...

:)

I can't go into such detail as I don't have any pen DG4000-approved.

You need to use a small pen and not worry with those inner works.

Format it fully in linux and then a quick FAT format. I've said time and time again: IMHO sometimes it might be a controller timing thing and not so much the formatting params.
 

Offline GonzoTheGreat

  • Regular Contributor
  • *
  • Posts: 116
  • Country: aq
Re: DG4000 - a firmware investigation
« Reply #409 on: August 04, 2020, 04:50:01 pm »
You need to use a small pen and not worry with those inner works.
I need to worry about these details because, the smallest pendrive I have is 8GB.

I tried local computer stores - nothing
I tried local toy stores - nothing
I tried local novelty stores - nothing
I even asked my neighbors - nothing (although when I offered to trade a new 64GB pendrive for an old small used one, they suspected it was some kind of scam).
 

Offline tv84

  • Super Contributor
  • ***
  • Posts: 1946
  • Country: pt
Re: DG4000 - a firmware investigation
« Reply #410 on: August 04, 2020, 05:13:09 pm »
 :-DD  How do you get all that stuff in Antarctica??
 
The following users thanked this post: PA0PBZ

Offline PeDre

  • Regular Contributor
  • *
  • Posts: 186
  • Country: at
    • Private Website
Re: DG4000 - a firmware investigation
« Reply #411 on: August 04, 2020, 05:46:01 pm »
Could you post the partition table and Boot Sector/FS Information Sector so I can see what parameters work ?

Here is the information from my 1 GB USB stick I use for the DG4000. Determined with the program 'USB Drive Info' by Uwe Sieber.
« Last Edit: August 04, 2020, 06:17:53 pm by PeDre »
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 2656
  • Country: ro
Re: DG4000 - a firmware investigation
« Reply #412 on: August 04, 2020, 07:09:16 pm »
You need to use a small pen and not worry with those inner works.
I need to worry about these details because, the smallest pendrive I have is 8GB.

I tried local computer stores - nothing
I tried local toy stores - nothing
I tried local novelty stores - nothing
I even asked my neighbors - nothing (although when I offered to trade a new 64GB pendrive for an old small used one, they suspected it was some kind of scam).

Try an USB SD card reader with any card inside.

Offline GonzoTheGreat

  • Regular Contributor
  • *
  • Posts: 116
  • Country: aq
Re: DG4000 - a firmware investigation
« Reply #413 on: August 04, 2020, 11:05:22 pm »
Here is the information from my 1 GB USB stick I use for the DG4000.
OK, I adjusted the partition table and the FAT16 parameter block to be as close to yours as possible (see the attachment), Windows can mount and write to this pendrive, chkdsk reports no errors, but it does not work with the DG4000.
The DG4000 just hangs there with the MOD, UTILITY and STORE buttons lit up steadily (there was a brief burst of activity indicated by the pendrive's LED when I inserted it, though).
« Last Edit: August 05, 2020, 08:34:39 am by GonzoTheGreat »
 

Offline PeDre

  • Regular Contributor
  • *
  • Posts: 186
  • Country: at
    • Private Website
Re: DG4000 - a firmware investigation
« Reply #414 on: August 05, 2020, 05:41:27 am »
You could record the USB protocol during the update from the USB stick. Once from a good and once from a bad USB stick. I'd have the option to do that. But searching the log is gonna be tedious.
 

Offline GonzoTheGreat

  • Regular Contributor
  • *
  • Posts: 116
  • Country: aq
Re: DG4000 - a firmware investigation
« Reply #415 on: August 05, 2020, 09:04:36 am »
You could record the USB protocol during the update from the USB stick. Once from a good and once from a bad USB stick. I'd have the option to do that. But searching the log is gonna be tedious.
Yup, that would be the next step in the analysis of the problem, but I don't have a USB capture device ...nor a DG400 "approved" pendrive for comparison.
 

Offline GonzoTheGreat

  • Regular Contributor
  • *
  • Posts: 116
  • Country: aq
Re: DG4000 - a firmware investigation
« Reply #416 on: August 05, 2020, 09:05:49 am »
Try an USB SD card reader with any card inside.
I did, without success ...but not with the clone of the "approved" FAT16 file system like before.
The MOD button is lit up steadily and the UTILITY button flashes slowly ...forever.
 

Offline PeDre

  • Regular Contributor
  • *
  • Posts: 186
  • Country: at
    • Private Website
Re: DG4000 - a firmware investigation
« Reply #417 on: August 05, 2020, 09:06:28 am »
Yup, that would be the next step in the analysis of the problem, but I don't have a USB capture device ...nor a DG400 "approved" pendrive for comparison.

I have a Saleae Logic and just tested the new Alpha Software v2.3.4. The DG4000 uses USB Full-Speed. A test with plugging in the USB stick and recording worked. The export of the raw data as CSV works. In the program I can display the USB protocol.
I will try to record the data.
 

Offline PeDre

  • Regular Contributor
  • *
  • Posts: 186
  • Country: at
    • Private Website
Re: DG4000 - a firmware investigation
« Reply #418 on: August 05, 2020, 10:31:43 am »
I have now used another USB stick with 2 GB for the update. The screenshot of the 010 editor is attached. So the update works when the stick is directly plugged in.

I now wanted to record the data with a self-made USB cable. But this does not work, the DG4000 gets stuck with the three illuminated buttons. Could this indicate a voltage problem?
The cable works without problems if the USB stick is used during normal operation of the DG4000.

With a USB power meter (Ruideng AT34 USB 3.0 tester) I measure 4.91 volts. The update also works with this adapter.
I will build a new short adapter, maybe it will work with it.
« Last Edit: August 05, 2020, 10:36:09 am by PeDre »
 

Offline GonzoTheGreat

  • Regular Contributor
  • *
  • Posts: 116
  • Country: aq
Re: DG4000 - a firmware investigation
« Reply #419 on: August 05, 2020, 12:14:42 pm »
I now wanted to record the data with a self-made USB cable. But this does not work, the DG4000 gets stuck with the three illuminated buttons. Could this indicate a voltage problem?
The cable works without problems if the USB stick is used during normal operation of the DG4000.
It could indicate intolerance of the boot-loader's code to propagation delays occurring in a longer cable.  How long was it?
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 2656
  • Country: ro
Re: DG4000 - a firmware investigation
« Reply #420 on: August 05, 2020, 12:49:53 pm »
Try an USB SD card reader with any card inside.
I did, without success ...but not with the clone of the "approved" FAT16 file system like before.
The MOD button is lit up steadily and the UTILITY button flashes slowly ...forever.

Why are you using FAT16 format?  I remember mine it was formatted FAT32.

I've just found my logs with the steps to upgrade, same thread in page 16, see the "code" section.  My USB pen drive was formatted FAT32:
https://www.eevblog.com/forum/testgear/dg4000-a-firmware-investigation/msg2829452/#msg2829452

Offline PeDre

  • Regular Contributor
  • *
  • Posts: 186
  • Country: at
    • Private Website
Re: DG4000 - a firmware investigation
« Reply #421 on: August 05, 2020, 01:26:33 pm »
It could indicate intolerance of the boot-loader's code to propagation delays occurring in a longer cable.  How long was it?

The cable is 1.3 m long.

But I cannot record any communication with the USB stick during the update at the moment. The USB stick is not accessed at all, only a short pulse appears on the data line D+. But the update is completely executed and takes about 7 minutes.
The new short adapter with 10 cm length works. During normal operation I can record the communication with the adapter.
At the moment I am standing before a mystery.

Edit: Maybe the update works via USB High-Speed? I'll check it with the oscilloscope.

Edit 2: The update is performed via USB High-Speed. I can't record this.

« Last Edit: August 05, 2020, 02:42:26 pm by PeDre »
 

Offline GonzoTheGreat

  • Regular Contributor
  • *
  • Posts: 116
  • Country: aq
Re: DG4000 - a firmware investigation
« Reply #422 on: August 05, 2020, 04:04:01 pm »
Why are you using FAT16 format?  I remember mine it was formatted FAT32.
Because our resident expert "tv84" has written here that it is OK to use FAT16 and "PeDre" has posted his file system structure here, which contained FAT16.  I just cloned it.
 

Offline PeDre

  • Regular Contributor
  • *
  • Posts: 186
  • Country: at
    • Private Website
Re: DG4000 - a firmware investigation
« Reply #423 on: August 05, 2020, 04:52:01 pm »
I have tested several other USB sticks with 4 and 8 GB, but none works with the update. Even an external power supply for the USB stick does not help.
 

Offline tv84

  • Super Contributor
  • ***
  • Posts: 1946
  • Country: pt
Re: DG4000 - a firmware investigation
« Reply #424 on: August 05, 2020, 05:56:26 pm »
I have tested several other USB sticks with 4 and 8 GB, but none works with the update. Even an external power supply for the USB stick does not help.

 :D That adds credit to my theory that this is a timing problem. The programming/interrupts doesn't know how to handle with certain controllers responses. It definitely seems that there is no flux control (delays, timeouts, etc) being maintained.

So, basically, it's a matter of luck.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf